public static double[] getPaperMargins(PrintService service, PrintRequestAttributeSet set, LengthUnits units) {
		double[] size = getPaperSize(service, set, LengthUnits.IN);
		MediaPrintableArea current = (MediaPrintableArea) getSetting(service, set, MediaPrintableArea.class, true);
		double x;
		double y;

		if (current == null) {
			current = new MediaPrintableArea(0.5f, 0.5f, (float) (size[0] - 1.0), (float) (size[1] - 1.0), MediaPrintableArea.INCH);
		}
		x = current.getX(MediaPrintableArea.INCH);
		y = current.getY(MediaPrintableArea.INCH);
		return new double[] { units.convert(LengthUnits.IN, y), units.convert(LengthUnits.IN, x), units.convert(LengthUnits.IN, size[1] - (y + current.getHeight(MediaPrintableArea.INCH))), units.convert(LengthUnits.IN, size[0] - (x + current.getWidth(MediaPrintableArea.INCH))) };
	}