Skip to main content
June 14, 2011

Vector images and the DITA Open Toolkit

Rendering vector images (such as line art or charts) for PDF output through the DITA Open Toolkit can be tricky. You would think that an exported GIF of a vector image would display beautifully in the PDF—but you would be wrong.

When GIFs or other formats look too fuzzy, SVG files are an option for displaying vector images in DITA content with clarity. However, SVGs present their own challenge: the DITA OT may not preserve the font, size, or style of text from the original image. After some trial and error with both the OT and Adobe Illustrator, I finally stumbled across the settings that will solve this fonts issue.

To create an SVG image that will retain its original look in PDF output from the DITA OT:

  1. Open the Illustrator (.ai) file you used to create the image.
  2. Select the File menu, then Save As.
  3. Type a file name, then select SVG(*.SVG) from the drop-down list.
  4. Select the Save button. The SVG Options window is displayed.
  5. Under the Fonts section, select SVG from the Type drop-down list and All Glyphs from the Subsetting drop-down list. Leave the default settings for everything else in the window.
  6. Select the OK button.

A few more points to keep in mind:

  • An SVG file can be created from an Illustrator file (.ai), an Illustrator EPS file (.eps), or an Illustrator template file (.ait).
  • An SVG file cannot be created from an exported image file (such as a GIF, PNG, or JPEG), as this will not preserve clarity.

Take a look at the images below to see the difference in the way GIFs and SVGs are displayed.

An example of how a GIF image looks in the PDF output...

...and the clearer SVG version.