public static void setPaperSize(PrintService service, PrintRequestAttributeSet set, double[] size, LengthUnits units) {
		double[] margins = getPaperMargins(service, set, units);
		MediaSizeName mediaSizeName = MediaSize.findMedia((float) LengthUnits.IN.convert(units, size[0]), (float) LengthUnits.IN.convert(units, size[1]), Size2DSyntax.INCH);

		if (mediaSizeName == null) {
			mediaSizeName = MediaSizeName.NA_LETTER;
		}
		set.add(mediaSizeName);
		setPaperMargins(service, set, margins, units);
	}