Vector images and the DITA Open Toolkit

Gretyl Kinsey / DITA5 Comments

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.

About the Author

Gretyl Kinsey


Technical Consultant. Content strategy, tech comm, and LearningDITA. Musician, cosplayer, and devourer of delicious desserts.

5 Comments on “Vector images and the DITA Open Toolkit”

  1. We always convert fonts to outline in Illustrator before saving the file to SVG so we don’t have any issues with missing fonts. We also make sure to select the option to Preserve Illustrator Editing Capabilities so we can go back and edit the SVG in Illustrator, if necessary.

    1. You’re welcome. You can import a PSD file into Illustrator, then save it as an SVG file. However, PSD files contain bitmap images rather than vector images, so they will not be truly scalable like vector images created in Illustrator and saved as SVGs.

  2. Hi. Sorry to pose a question on an article from AGES ago. So I’m wondering how that works together with localization. One of the other benefits of svg images is that the text items are easily extracted and translated by a localization services provider. But a challenge is that other languages will use exotic unicode characters. For example accented characters. When you choose “All Glyphs” from the Subsetting drop-down list in Illustrator, is this in theory pulling in multilingual glyphs as well?

    1. Hi Cyril, thank you for your question. The “All Glyphs” subsetting captures all of the glyphs in use in the Illustrator file. You may need to reapply fonts and choose that subsetting again after translation depending on your language and font needs. I hope that helps!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.