RenderX

Chapter 15 of the IREn User Guide

Supported Graphic Formats

E.1. Bitmap Graphics

IREn supports the following raster graphics formats:

  • PNG

  • JPEG

  • GIF

  • TIFF

Bitmap graphic that have no built-in resolution or dimension data, default to a resolution of 120 dpi (5 dots of a 600-dpi printer) as prescribed by the CSS2 Spec. This is always the case for GIF images, but may also occur with other image types. The XSL Recommendation suggests using 0.28 mm as a pixel size in such cases, which corresponds to 90 dpi resolution. A smaller pixel size gives better print results because the proportion between pixel size and page width is similar to that of a computer screen. With lower resolutions, often the large GIF/JPEG images fit onto a screen but not into the printable area on the page. For interoperability with other XSL-FO implementations, it is advisable to specify image size explicitly in XSL-FO code.

E.1.1. PNG

IREn recognizes all types of PNG images described in the PNG specification, and reproduces them with the following limitations:

  • 16-bit component colors are trimmed down to 8-bit.

Single-color transparency and alpha channel are supported in PDF output only. For indexed-color images with alpha, the first completely transparent color in the palette is used.

Note: Combining single-color transparency with 16-bit color is not safe in IREn because of color depth reduction and consequent merging of adjacent colors.

If the image has an explicit gamma, it is corrected to the sRGB value of 2.2.

E.1.2. JPEG

Grayscale, RGB, and CMYK JPEGs are supported. Data stream is copied directly from the image file to the resultant PDF or PostScript, so there is no additional loss of quality.

For CMYK JPEGs, IREn analyzes the contents of APP14 marker. If the marker indicates that the image is created by Adobe, color polarity is inverted: 0 means "full colorant". Otherwise, standard CMYK conventions apply: 0 is treated as "no colorant".

E.1.3. GIF

IREn supports both interlaced and non-interlaced GIF images and includes implementation of LZW algorithm.

GIF transparency is supported in PDF output.

E.1.4. TIFF

IREn supports the following principal TIFF flavors:

  • File organization - strip-based or tiled

  • Color model - monochrome, grayscale, RGB or CMYK

  • Compression type - uncompressed, CCITT Fax (monochrome images only), PackBits or LZW

TIFF images with separate color planes (PlanarConfiguration=2) and/or associated alpha channel (ExtraSamples=1) are not supported.

E.2. Vector Graphics

IREn supports the following vector graphics formats:

  • SVG

  • PDF (PDF generator only)

  • EPS (PostScript generator only)

  • XEPOUT (All generators except AFP, XPS and XHTML)

E.2.1. SVG

IREn supports a subset of Scalable Vector Graphics, version 1.1. SVG images can be either referenced as external files (in src and background-image attributes) or directly embedded into the XSL-FO flow through <fo:instream-foreign-object> wrapper.

IREn implements the following SVG elements:

  • structure elements - <svg>, <g>, <defs>, <use>, <symbol>, <image>

  • styling - <style>

  • shapes - <rect>, <circle>, <ellipse>, <polygon>, <polyline>, <path>

  • basic clipping - <clipPath> (see limitations below)

  • text - <text>, <tspan>, <tref>

  • conditional processing - <switch>

  • paint servers - <linearGradient>, <radialGradient>, <pattern>

The following SVG properties are supported:

  • baseline-shift

  • clip-path (see below for limitations on clipping support)

  • color

  • fill

  • fill-opacity

  • fill-rule

  • font

  • font-family

  • font-size

  • font-stretch

  • font-style

  • font-weight

  • gradientTransform

  • gradientUnits

  • letter-spacing

  • marker

  • marker-end

  • marker-start

  • marker-mid

  • opacity (controls transparency)

  • patternContentUnits

  • patternTransform

  • patternUnits

  • stroke

  • stroke-width

  • stroke-linecap

  • stroke-linejoin

  • stroke-miterlimit

  • stroke-dasharray

  • stroke-dashoffset

  • stroke-opacity

  • text-anchor

  • transform

  • visibility

  • word-spacing

  • xml:base

  • xml:space

Notes on SVG support in IREn:

  1. Color treatment for SVG follows the same rules as for XSL-FO. In particular, #CMYK, #Grayscale, #SpotColor and #Registration pseudo profile names can be used in icc-color() function to produce CMYK, grayscale, spot, or registration colors.

  2. For an SVG image to be processed by IREn, it must have an intrinsic size. If height or width are expressed in percents, a viewBox attribute must be present: the intrinsic size is determined by the viewBox, assuming 1 user space unit = 1 pixel.

  3. Animation-related elements and attributes are ignored. All objects are drawn at their specified static positions; no attempt is made to reconstruct the initial state of an animated picture.

  4. The clip-path attribute is not supported on the elements inside <clipPath> element and on the <clipPath> element itself.

  5. Remote references to clipPath and marker elements are unsupported: only the fragment identifier is used to retrieve them. (Remote links in use elements are supported).

  6. Character-by-character placement and rotation in text elements are not supported. If an array is used in x, y, dx, dy, or rotate attributes of <text> or <tspan> element, only the first number is considered.

  7. Bidi reordering and Arabic glyph shaping does not work in SVG text.

  8. xml:base attribute works only when resolving relative URLs for external images via <image> element. It is ignored in <use>, <tref> and similar elements.

  9. IREn supports opacity, fill-opacity, and stroke-opacity attributes. Because of the output format limitations, these features are only supported in the PDF generator, and only if the PDF version is set to 1.4 or higher.

  10. IREn supports SVG styling via embedded CSS stylesheets (<style> element, style and class attributes). CSS support is limited to Level 1: only ancestor, class, and ID selectors are recognized. Pseudo classes and pseudo elements are not supported.

E.2.2. PDF

PDF images are supported in PDF generator only. IREn is capable to embed an arbitrary page of a PDF document as a vector image. All related resources (fonts, images, color profiles) are transferred to the output file. Annotations (text notes, hyperlinks, etc) are dropped.

The following XSL-FO code demonstrates this feature:

<fo:external-graphic src="url(background.pdf)" rx:pdf-page="5"/>

Here, the optional rx:pdf-page attribute defines the page to use. The attribute value must evaluate to a positive integer value.

Default: 1 (the first page in the document).

If the value is not parsed properly, or if a page number specified is greater than the total number of pages in the PDF document, the warning is issued and the selected page reverted to default value.

Any unencrypted PDF document which conforms to PDF 1.3 can be embedded as an image, provided that it does not mix LZW and non-LZW compression for parts of the same content stream.[1]

E.2.3. EPS

EPS images are supported in PostScript generator only. In the PDF generation module, they are replaced by a bitmap preview image (EPSI or TIFF) if available; otherwise, the corresponding area is left blank.

E.2.4. XEPOUT

XEPOUT images are supported in all generators except AFP. The MIME type used for XEPOUT images is application/xepout. IREn embeds the first page of a XEPOUT (IREn Intermediate Output Format) document as a vector image. All elements are transferred to the output file except: <xep:target>, <xep:internal-link>, <xep:internal-bookmark>, <xep:external-bookmark>, <xep:external-link> (supported in PS generator only).


[1] This possibility is purely theoretical: chances that an application uses different compression methods for parts of the same stream are virtually zero.

Download the complete IREn User Guide as PDF