DiType User Guide/Supported Graphic Formats

From Docs

Jump to: navigation, search

< DiType User Guide


Supported Graphic Formats

Bitmap Graphics

DiType 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 for 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 the XSL-FO code.


DiType recognizes all types of PNG images described in the PNG specification. Currently, DiType translates PNG images into JPEG to reproduce in the PostScript and PDF output, so that transparency is not supported and image quality is affected. Handling of PNG images will be improved in future versions.


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, DiType analyzes the contents of the 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".


DiType supports both interlaced and non-interlaced GIF images, and includes implementation of the LZW algorithm.


DiType 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 ) or an associated alpha channel ( ExtraSamples = 1 ) are not supported.

Vector Graphics

XEP supports the following vector graphics formats:

  • SVG
  • EPS

Note: Embedding PDF illustration is currently not supported; instead, PostScript can be embedded in both PDF and PostScript outputs.


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 the <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 the icc-color() function to produce CMYK, grayscale, spot, and registration colors, respectively.
  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 attribute, 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 the <clipPath> element or on the <clipPath> element itself.
  5. Remote references to the 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 the x , y , dx , dy , or rotate attribute of the <text> or <tspan> element, only the first number is considered.
  7. Bidi reordering and Arabic glyph shaping do not work in SVG text.
  8. The xml:base attribute works only when resolving relative URLs for external images via the <image> element. It is ignored in the <use> , <tref> , and similar elements.
  9. XEP supports SVG styling via embedded CSS stylesheets ( <style> element, and 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.


EPS images are inserted intact into PostScript output. In DiType, the PDF output is generated from PostScript output by means of GhostScript, therefore EPS images are supported in both PostScript and PDF output.

Personal tools