public void save(XMLWriter out, LengthUnits units) {
		double[] size = getPaperSize(units);
		double[] margins = getPaperMargins(units);
		PrintService service = getPrintService();

		out.startTag(TAG_ROOT);
		if (service != null) {
			out.writeAttribute(ATTRIBUTE_PRINTER, service.getName());
		}
		out.writeAttribute(ATTRIBUTE_UNITS, Enums.toId(units));
		out.finishTagEOL();
		out.simpleTag(TAG_ORIENTATION, Enums.toId(getPageOrientation()));
		out.simpleTag(TAG_WIDTH, size[0]);
		out.simpleTag(TAG_HEIGHT, size[1]);
		out.simpleTag(TAG_TOP_MARGIN, margins[0]);
		out.simpleTag(TAG_LEFT_MARGIN, margins[1]);
		out.simpleTag(TAG_BOTTOM_MARGIN, margins[2]);
		out.simpleTag(TAG_RIGHT_MARGIN, margins[3]);
		out.simpleTag(TAG_CHROMATICITY, Enums.toId(getChromaticity(false)));
		out.simpleTag(TAG_SIDES, Enums.toId(getSides()));
		out.simpleTag(TAG_NUMBER_UP, getNumberUp());
		out.simpleTag(TAG_QUALITY, Enums.toId(getPrintQuality(false)));
		out.simpleTagNotEmpty(TAG_RESOLUTION, createResolutionString(getResolution(false)));
		out.endTagEOL(TAG_ROOT, true);
	}