XML Document Scheme
A printed XML Printer document contains only a couple of element types that define any document. This makes XML Printer a strong and easy-to-use tool.
printjob (root) element
Printjob is the root element in XML Printer document.
Attributes
- document
Contains the document name as it was sent by the printing application. This value differs from application to application and there's no general hint what exactly will be this field set to (i.e. try and see). - origin
Computer and user name of the originator of the document (i.e. computer on which the document was printed on and user who printed the document). - version
Version number of XML Printer used to print the document (major.minor.revision.build). - dpi
Resolution of the printed document in DPI.
Child Elements
- page
Each page child element represents a page in the document. There is always at least one page in the document.
page element
A page element represents a page in the document.
Attributes
- number
Sequence number of the page (starting at 1). - type
Size type of the media (e.g. A4, Letter, etc.). - width-mm
Width of the page in millimeters. - height-mm
Height of the page in millimeters. - width-px
Width of the page in pixels (synonym of dots in DPI). - height-px
Height of the page in pixels. - orientation
Page orientation (e.g. Landscape, Portrait, etc.).
Child Elements
- text
Defines text elements contained on a page. - image
Defines images within the page with reference to an external image file. - path
Defines paths (vector graphics) on the page.
text element
Text element defines a text somewhere on the page. The actual text is the element inner text.
Attributes
- left
Left coordinate of absolute position on page, in pixels. - top
Top coordinate of absolute position on page, in pixels. - width
Width of the bounding box surrounding the text, in pixels. - height
Height of the bounding box surrounding the text, in pixels. - font-face
Family name of the font used. The font can be none of the installed fonts, in that case font-face will be a file name of the temp font used (the file is in the same directory as the outputted XML file). - font-style
A comma separated list of applied styles. May include bold, italic, underline, strikeout. - font-size
Size of the font in points. - color
Text color in hexadecimal notation either as '#aarrggbb' or '#rrggbb'. - offset-x
If the text is rotated the left and top attributes are actually not the left and top of the string when drawing. offset-x and offset-y is the amount of pixels to add to left and top in order to keep the text in the specified bounding box. - offset-y
See comment on offset-x. - angle
The rotation angle of the text in degrees.
image element
Image element represents an image placed in the document. The actual image is always stored in an external file, in the same directory as the printed XML file. It is prefixed with filename of the XML file and one image may be referenced 2 or more times within the document.
Attributes
- left
Left coordinate of absolute position on page, in pixels. - top
Top coordinate of absolute position on page, in pixels. - width
Width of the image on page, in pixels. Note, that width on page may be different than width of the image if the image is scaled. - height
Height of the image on page, in pixels. Note, that height on page may be different than height of the image if the image is scaled. - src
Relative file name of the image file.
Image element may optionally contain a clip child element and in that case the image is clipped by the defined path.
path element
Path element defines a vector graphics within the page. It may be outlined only, filled only or both outlined and filled (depending on the existence of strokecolor and fillcolor attributes).
Attributes
- strokecolor
Hexadecimal-encoded color of the outline. If strokecolor attribute is not present the path is not stroked. - fillcolor
Hexadecimal-encoded color of the fill. If fillcolor attribute is not present the path is not filled. - width
Width of the stroke line, in pixels.
Child Elements
- clip
If present, the clipping region of the path. - line
With curve elements defines the guide points of the path. - curve
With line elements defines the guide points of the path.
line and curve elements
Elements define a line segment or a bezier curve patch, which is appended to previous segment unless it contains an attribute style="beginning".
Line and curve elements contain a number of point elements each having x and y attributes defining the position on page in pixels.