XEP User Guide/Appendix D Supported Graphic Formats

From Docs

Jump to: navigation, search



Supported Graphic Formats

Bitmap Graphics

XEP 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.


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

  • Alpha channel is completely ignored — sample values are not adjusted by the alpha.
  • 16-bit component colors are trimmed down to 8-bit.

Single-color transparency is 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 XEP 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.


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, XEP 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".


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

GIF transparency is supported in PDF output.


XEP 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.

Vector Graphics

XEP supports the following vector graphics formats:

  • SVG
  • PDF ( PDF generator only )
  • EPS ( PostScript generator only )


XEP 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.

XEP 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>

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
  • letter-spacing
  • marker
  • marker-end
  • marker-start
  • marker-mid
  • 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 XEP:

  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 XEP, 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. XEP supports 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. XEP 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.


PDF images are supported in PDF generator only . XEP embeds the first 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.

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]


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.


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

Back to XEP User Guide

Personal tools