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:
- Open the Illustrator (.ai) file you used to create the image.
- Select the File menu, then Save As.
- Type a file name, then select SVG(*.SVG) from the drop-down list.
- Select the Save button. The SVG Options window is displayed.
- 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.
- 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.