DiType User Guide/Supported Graphic Formats
From Docs
Contents |
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.
PNG
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.
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, 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".
GIF
DiType supports both interlaced and non-interlaced GIF images, and includes implementation of the LZW algorithm.
TIFF
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.
SVG
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:
- Color treatment for SVG follows the same rules as for XSL-FO. In particular,
#CMYK,#Grayscale,#SpotColor, and#Registrationpseudo profile names can be used in theicc-color()function to produce CMYK, grayscale, spot, and registration colors, respectively.
- For an SVG image to be processed by XEP, it must have an intrinsic size. If
heightorwidthare expressed in percents, aviewBoxattribute must be present: the intrinsic size is determined by theviewBoxattribute, assuming 1 user space unit = 1 pixel.
- 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.
- The
clip-pathattribute is not supported on the elements inside the<clipPath>element or on the<clipPath>element itself.
- Remote references to the
clipPathandmarkerelements are unsupported: only the fragment identifier is used to retrieve them. (Remote links inuseelements are supported.)
- Character-by-character placement and rotation in text elements are not supported. If an array is used in the
x,y,dx,dy, orrotateattribute of the<text>or<tspan>element, only the first number is considered.
- Bidi reordering and Arabic glyph shaping do not work in SVG text.
- The
xml:baseattribute works only when resolving relative URLs for external images via the<image>element. It is ignored in the<use>,<tref>, and similar elements.
- XEP supports SVG styling via embedded CSS stylesheets (
<style>element, andstyleandclassattributes). CSS support is limited to Level 1: only ancestor, class, and ID selectors are recognized. Pseudo classes and pseudo elements are not supported.
EPS
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.
