RenderX

Chapter 16 of the IREn User Guide

IREn Intermediate Output Format Specification

F.1. IREn Intermediate Output Format Specification

This section describes the IREn intermediate output format — an XML based representation of the layout that is passed from the generator to the final output generators (PDF, PostScript, etc). All elements reside in a separate namespace, http://www.renderx.com/XEP/xep (omitted from the description for brevity). All lengths are measured in units of 0.001 pt (1/72,000 inch), and expressed as integers. The format is represented by the following DTD fragment:

<!ENTITY % drawables
  " rotate
  | translate
  | word-spacing
  | letter-spacing
  | font-stretch
  | font
  | text
  | line
  | image
  | rgb-color
  | cmyk-color
  | spot-color
  | registration-color
  | rectangle
  | clip
  | polygon
  | path
  | target
  | internal-link
  | external-link
  | internal-bookmark
  | external-bookmark
  | page-number
  | media-object">

<!ENTITY % rx-accessibility-properties "
  xpath CDATA  #IMPLIED
  pdf-structure-tag CDATA  #IMPLIED
  pdf-artifact-type CDATA  #IMPLIED
  pdf-artifact-subtype CDATA  #IMPLIED
  alt-description CDATA  #IMPLIED
  actual-text CDATA  #IMPLIED
  abbreviation CDATA  #IMPLIED">

<!ENTITY % pages
  " page
  | insert-document">

<!ELEMENT document (pages+)>
<!ATTLIST document
  creator CDATA #REQUIRED
  initial-destination CDATA #IMPLIED>

<!ELEMENT page (%drawables;)*>
<!ATTLIST page
  width CDATA #REQUIRED
  height CDATA #REQUIRED
  page-number CDATA #REQUIRED
  page-id CDATA #REQUIRED>

<!ELEMENT insert-document EMPTY>
<!ATTLIST insert-document
  src CDATA #REQUIRED
  document-content-type CDATA #IMPLIED>

<!ELEMENT rotate EMPTY>
<!ATTLIST rotate
  phi CDATA #REQUIRED>

<!ELEMENT translate EMPTY>
<!ATTLIST translate
  x CDATA #REQUIRED
  y CDATA #REQUIRED>

<!ELEMENT word-spacing EMPTY>
<!ATTLIST word-spacing
  value CDATA #REQUIRED>

<!ELEMENT letter-spacing EMPTY>
<!ATTLIST letter-spacing
  value CDATA #REQUIRED>

<!ELEMENT font-stretch EMPTY>
<!ATTLIST font-stretch
  value CDATA #REQUIRED>

<!ELEMENT font EMPTY>
<!ATTLIST font
  family CDATA #REQUIRED
  weight CDATA #REQUIRED
  style CDATA #REQUIRED
  variant CDATA #REQUIRED
  size CDATA #REQUIRED>

<!ELEMENT text (line*)>
<!ATTLIST text
  x CDATA #REQUIRED
  y CDATA #REQUIRED
  value CDATA #REQUIRED
  width CDATA #REQUIRED
  %rx-accessibility-properties;>

<!ELEMENT page-number (line*)>
<!ATTLIST page-number
  x CDATA #REQUIRED
  y CDATA #REQUIRED
  value CDATA #REQUIRED
  width CDATA #REQUIRED
  %rx-accessibility-properties;>

<!ELEMENT line EMPTY>
<!ATTLIST line
  x-from CDATA #REQUIRED
  y-from CDATA #REQUIRED
  x-till CDATA #REQUIRED
  y-till CDATA #REQUIRED
  thickness CDATA #REQUIRED
  style CDATA #REQUIRED>

<!ELEMENT image EMPTY>
<!ATTLIST image
  src CDATA #REQUIRED
  base CDATA #IMPLIED
  type CDATA #REQUIRED
  x-from CDATA #REQUIRED
  y-from CDATA #REQUIRED
  scale-x CDATA #REQUIRED
  scale-y CDATA #REQUIRED
  %rx-accessibility-properties;>

<!ELEMENT gray-color EMPTY>
<!ATTLIST gray-color
  gray CDATA #REQUIRED>

<!ELEMENT rgb-color EMPTY>
<!ATTLIST rgb-color
  red CDATA #REQUIRED
  green CDATA #REQUIRED
  blue CDATA #REQUIRED>

<!ELEMENT cmyk-color EMPTY>
<!ATTLIST cmyk-color
  cyan CDATA #REQUIRED
  magenta CDATA #REQUIRED
  yellow CDATA #REQUIRED
  black CDATA #REQUIRED>

<!ELEMENT spot-color EMPTY>
<!ATTLIST spot-color
  colorant CDATA #REQUIRED
  tint CDATA #REQUIRED
  alt-gray CDATA #IMPLIED
  alt-red CDATA #IMPLIED
  alt-green CDATA #IMPLIED
  alt-blue CDATA #IMPLIED
  alt-cyan CDATA #IMPLIED
  alt-magenta CDATA #IMPLIED
  alt-yellow CDATA #IMPLIED
  alt-black CDATA #IMPLIED>

<!ELEMENT registration-color EMPTY>
<!ATTLIST registration-color
  tint CDATA #REQUIRED>

<!ELEMENT rectangle EMPTY>
<!ATTLIST rectangle
  x-from CDATA #REQUIRED
  y-from CDATA #REQUIRED
  x-till CDATA #REQUIRED
  y-till CDATA #REQUIRED>

<!ELEMENT clip (%drawables;)*>
<!ATTLIST clip
  x-from CDATA #REQUIRED
  y-from CDATA #REQUIRED
  x-till CDATA #REQUIRED
  y-till CDATA #REQUIRED
  clip-by-following-polygon CDATA #IMPLIED>

<!ELEMENT polygon (point,point+,arc,arc+)>
<!ATTLIST polygon
  x-from CDATA #REQUIRED
  y-from CDATA #REQUIRED>

<!ELEMENT point EMPTY>
<!ATTLIST point
  x-till CDATA #REQUIRED
  y-till CDATA #REQUIRED>

<!ELEMENT arc EMPTY>
<!ATTLIST arc
  x1-ctrl-point CDATA #REQUIRED
  y1-ctrl-point CDATA #REQUIRED
  x2-ctrl-point CDATA #REQUIRED
  y2-ctrl-point CDATA #REQUIRED
  x-till CDATA #REQUIRED
  y-till CDATA #REQUIRED>

<!ELEMENT target EMPTY>
<!ATTLIST target
  name CDATA #REQUIRED
  x CDATA #REQUIRED
  y CDATA #REQUIRED
  %rx-accessibility-properties;>

<!ELEMENT internal-link EMPTY>
<!ATTLIST internal-link
  destination-id CDATA #REQUIRED
  destination CDATA #REQUIRED
  destination-x CDATA #REQUIRED
  destination-y CDATA #REQUIRED
  %rx-accessibility-properties;>

<!ELEMENT external-link EMPTY>
<!ATTLIST external-link
  destination CDATA #REQUIRED
  show-destination (new | replace) #REQUIRED
  %rx-accessibility-properties;>

<!ELEMENT internal-bookmark (grey-color?, rgb-color?, cmyk-color?)>
<!ATTLIST internal-bookmark
  label CDATA #REQUIRED
  id CDATA #REQUIRED
  parent-id CDATA #REQUIRED
  destination-id CDATA #REQUIRED
  destination CDATA #REQUIRED
  destination-x CDATA #REQUIRED
  destination-y CDATA #REQUIRED
  collapse-subtree (true | false) #REQUIRED
  font-style CDATA #IMPLIED
  font-weight CDATA #IMPLIED
  %rx-accessibility-properties;>

<!ELEMENT external-bookmark (grey-color?, rgb-color?, cmyk-color?)>
<!ATTLIST external-bookmark
  label CDATA #REQUIRED
  id CDATA #REQUIRED
  parent-id CDATA #REQUIRED
  destination CDATA #REQUIRED
  collapse-subtree (true | false) #REQUIRED
  show-destination (new | replace) #REQUIRED
  font-style CDATA #IMPLIED
  font-weight CDATA #IMPLIED
  %rx-accessibility-properties;>

<!ELEMENT media-object (poster?)>
<!ATTLIST media-object
  src CDATA #REQUIRED
  base CDATA #IMPLIED
  type CDATA #REQUIRED
  x-from CDATA #REQUIRED
  y-from CDATA #REQUIRED
  scale-x CDATA #REQUIRED
  scale-y CDATA #REQUIRED
  embed  ( false | true ) #IMPLIED
  extraction-policy ( tempaccess | tempnever | tempextract
                    | tempalways ) #IMPLIED
  alt CDATA #IMPLIED
  show-controls ( true|false ) #IMPLIED
  play-mode CDATA #IMPLIED
  volume CDATA #IMPLIED
  duration CDATA #IMPLIED
  %rx-accessibility-properties;>

<!ELEMENT poster EMPTY>
<!ATTLIST poster
  src CDATA #REQUIRED
  type CDATA #REQUIRED

The following table provides a detailed description of the output elements:

Table F.1. Output Elements

ElementDescriptionAttributes
<document>The root element. At its beginning and at its end, initialization and finalization are usually performed.
  • creator - Information about the application that created the document.

  • initial-destination (optional) - The part of the document that is moved into focus when the document is first opened.

  • There are several other attributes (such as author or title) that transfer unchanged from <rx:meta-field> extension formatting objects (if present) in the source document. Their use is implementation-dependent; for example, PDF generator uses them to fill the fields of the Info object.

<page>Wraps a single page of the document. There is one <page> element for each page in the document.
  • height - Height of the page

  • width - Width of the page

  • page-id - Page number label

  • page-number - Page number as an ordinal

<rotate>Rotates the coordinate system.
  • phi - Rotation angle, in degrees. May take values in multiples of 90: 0, 90, 180, 270 degrees.

<translate>Shifts the origin of the coordinate system.
  • x - Horizontal shift distance

  • y - Vertical shift distance

<word-­spacing>Sets word spacing (additional spacing between words).
  • value - The value of word spacing

<letter-­spacing>Sets letter spacing (additional spacing between non-space characters).
  • value - The value of letter spacing

<font-­stretch>Sets font-stretch factor.
  • value - The value of font-stretch factor

<font>Changes the current font.
  • family - Font family

  • weight - Font weight (100 to 900)

  • style - Font style (normal, italic, oblique, or backslant)

  • variant - Font variant (normal or small-caps)

  • size - Font size

<text>Prints a character string.
  • x - Horizontal position of the initial point on the baseline.

  • y - Vertical position of the initial point on the baseline.

  • value - The text string to print.

  • width - Text width.

<line>Draws a line.
  • x-from - Horizontal position of initial point.

  • y-from - Vertical position of initial point.

  • x-till - Horizontal position of final point.

  • y-till - Vertical position of final point.

  • thickness - The thickness of the line.

  • style - The style of the line.

<image>Embeds an external image.
  • src - The source URL of the image.

  • base - The base directory to resolve hrefs in the image.

  • type - The image MIME type.

  • x-from - Horizontal position of the lower left corner of the image.

  • y-from - Vertical position of the lower left corner of the image.

  • scale-x - Horizontal scaling factor.

  • scale-y - Vertical scaling factor.

  • role - Alternate description for accessible PDFs.

<gray-color>Sets the current color for stroking and filling. The color is chosen in a grayscale color space.
  • gray - Gray color, value: 0 to 1

<rgb-color>Sets the current color for stroking and filling. The color is chosen in an RGB color space (additive).
  • red - Red color, value: 0 to 1

  • green - Green color, value: 0 to 1

  • blue - Blue color, value: 0 to 1

<cmyk-color>Sets the current color for stroking and filling. The color is chosen in CMYK color space (subtractive).
  • cyan - Cyan color, value: 0 to 1

  • magenta - Magenta color, value: 0 to 1

  • yellow - Yellow color, value: 0 to 1

  • black - Black color, value: 0 to 1

<spot-color>Sets the current color for stroking and filling. The color is chosen in a spot color space (subtractive).
  • colorant - Colorant name

  • tint - Color intensity, value: 0 to1

  • alt-gray - Alternative gray color, value: 0 to 1

  • alt-red - Alternative red color, value: 0 to 1

  • alt-green - Alternative green color, value: 0 to 1

  • alt-blue - Alternative blue color, value: 0 to 1

  • alt-cyan - Alternative cyan color, value: 0 to 1

  • alt-magenta - Alternative magenta color, value: 0 to 1

  • alt-yellow - Alternative yellow color, value: 0 to 1

  • alt-black - Alternative black color, value: 0 to 1

To describe an alternate color, one of the following attribute sets must be present:

  • alt-gray — The default color is grayscale.

  • alt-red, alt-green, alt-blue — The default color is RGB.

  • alt-cyan, alt-magenta, alt-yellow, alt-black — The default color is CMYK.

<registration-­color>Sets the current color for stroking and filling. The color is chosen in registration color space (subtractive): it appears on all separations in the document.
  • tint - Color intensity, value: 0 to 1

<rectangle>Draws a filled rectangle.
  • x-from - The horizontal position of the lower left corner.

  • y-from - The vertical position of the lower left corner.

  • x-till - The horizontal position of the upper right corner.

  • y-till - The vertical position of the upper right corner.

<clip>Sets the clipping area.
  • x-from - The horizontal position of the lower left corner.

  • y-from - The vertical position of the lower left corner.

  • x-till - The horizontal position of the upper right corner.

  • y-till - The vertical position of the upper right corner.

  • clip-by-following-polygon - Setting to true overrides all adjacent attributes of the same <clip> element; instead, the first <polygon> child of such <clip> element is used for clipping instead of drawing.

<polygon>Draws a filled polygon. All vertices but the first one are specified in the contained <point> elements.
  • x-from - The horizontal position of the first vertex.

  • y-from - The vertical position of the first vertex.

<point>Adds a vertex to a polygon.
  • x-till - The horizontal position.
  • y-till - The vertical position.
<arc>

Normally, Polygon is a figure that is defined by a finite number of straight line segments connected to form a closed polygonal chain or polygonal circuit. Arc element adds a curve to the form instead of a straight line added by point element. So, Polygon containing an Arc element is not a polygon anymore but a complex shape formed by a sequence of lines and curves.

Basically, Arc is a Bézier curve defined by two base- and two control points. The first base point is inherited from the previous point of a Polygon in the sequence, the second base point is defined by *-till attributes, while two control points are specified by *-ctrl-point attributes.

Only quadratic Bézier curves (with two control points) are currently supported.

  • x1-ctrl-point - The horizontal position of arcs first control point.

  • y1-ctrl-point - The vertical position of arcs first control point.

  • x2-ctrl-point - The horizontal position of arcs second control point.

  • y2-ctrl-point - The vertical position of arcs second control point.

  • x-till - The horizontal position of the arc end point.

  • y-till - The vertical position of the arc end point.

<path>Container element for grouping together multiple <polygon> elements. In case of further formatting to PDF all grouped polygons will be drawn as one pdf path which eliminates the problem with rough line and curve joins.None
<target>Sets the endpoint for an internal destination.
  • name - Internal destination name (id of the element that created the target).

  • x - Horizontal position.

  • y - Vertical position.

<internal-­link>Specifies an internal link destination.
  • destination-id - Name of the target endpoint. It should match the name attribute of a <target> element somewhere in the document.

  • destination - The page number to point the link to.

  • x-destination - Horizontal position of the destination point.

  • y-destination - Vertical position of the destination point.

<external-­link>Specifies an external link destination.
  • destination - a URL

  • show-destination - Controls whether to create a new window when jumping to the link target.

<internal-­bookmark>Specifies an internal bookmark destination.
  • label - Bookmark text.

  • id - Bookmark ID - a positive integer.

  • parent-id - ID of the parent bookmark, or 0 if the bookmark is a top-level element.

  • destination-id - Name of the target endpoint. It should match the name attribute of a <target> element somewhere in the document.

  • destination - Page number to point the link to.

  • x-destination - Horizontal position of the destination point.

  • y-destination - Vertical position of the destination point.

  • collapse-subtree - Initial state (collapsed or expanded).

  • font-weight - Bookmarks font weight (100 to 900)

  • font-style - Bookmarks font style (normal, italic)

<external-­bookmark>Specifies an external bookmark destination.
  • label - Bookmark text.

  • id - Bookmark ID - a positive integer.

  • parent-id - ID of the parent bookmark, or 0 if the bookmark is a top-level element.

  • destination - A URL.

  • collapse-subtree - Initial state (collapsed or expanded).

  • show-destination - Controls whether to create a new window when jumping to the link target.

  • font-weight - Bookmarks font weight (100 to 900)

  • font-style - Bookmarks font style (normal, italic)

<media-­object>Places multimedia.
  • src - The source URL of the media.

  • base - The base directory to resolve hrefs in the media.

  • type - The media MIME type.

  • x-from - Horizontal position of the lower left corner of the media.

  • y-from - Vertical position of the lower left corner of the media.

  • scale-x - Horizontal scaling factor.

  • scale-y - Vertical scaling factor.

  • embed - Specifies whether to embed media data.

  • extraction-policy - Media extraction policy (tempaccess, tempnever, tempextract, tepmalways).

  • alt - Alternate description for accessible PDFs.

  • show-controls - Specifies whether to show media playing controls.

  • play-mode (optional) - The play mode for playing the movie. Value is positive float - the number of times to replay (0.0="continuously"). The default value is 1.0.

  • volume (optional) - Specifies audio volume level, value: 0 to 1. The default value is 1.0 and means 100% of volume level.

  • duration (optional) - Specifies duration of the movie segment to be played. May take the following values: intrinsic, infinity or an positive float - the number of seconds in the time span. The default value is intrinsic

<poster>Embeds an external image to show, when not playing media.
  • src - The source URL of the poster image.

  • type - The poster image MIME type.

(see above)See above for applicable elements.
  • xpath - Specifies an xpath in the XPath notation, the RenderX internal attribute.

  • pdf-structure-tag - Overrides a structure tag name for a given element.

  • pdf-artifact-type - Specifies a type for a PDF artifact.

  • pdf-artifact-subtype - Specifies a subtype for a PDF artifact.

  • alt-description - Specifies an alternative description for accessible PDFs.

  • actual-text - Specifies a replacement text for accessible PDFs.

  • abbreviation - Specifies an abbreviation or acronym for accessible PDFs.

Processing instructions may appear in the output. They are taken from the source file and passed straight to the generator with no modification. Processing instructions placement meets the following conditions:

  • Instructions placed before <fo:root> element in the source file are reproduced at the very top, before the root <document> element.

  • Instructions placed inside an <fo:simple-page-master> element are reproduced on each page generated using that master, immediately after the opening tag of the <page> element.

All other processing instructions may vanish during formatting. Except for those specified above, ordering of instructions is not preserved.

Download the complete IREn User Guide as PDF