Convert SVG-to-PNG in the publishing stage?
SVGs from engineering drawings can be quite heavy in terms of file size and they tend to slow down the publication process dramatically. Therefore, I was wondering whether there are some good conversion tools around which can convert the SVGs to PNG when the DITA content is published to HTML and PDF, using the DITA-OT?
We want to keep using SVG in the DITA source files for the obvious reasons: editable vectors, editable and translatable text...
One thing to watch with SVGs, if you notice the publication process slowing down, is font substitution on PDF transforms. When you create a PDF, to maintain the exact presentation and layout, the PDF wants to have the fonts used embedded within.
To embed a font in a PDF is essentially copying software. The font must be licensed. Each font installed on a computer has a licensing bit indicating whether it is licensed for embedding or not.
When the PDF generator tries to convert the XSL-FO (or whatever intermediate format you are using) to PDF, it checks the fonts. If the font is not licensed for embedding, it substitutes the font for one that is licensed on that computer. With SVGs this can cause significant delays, especially if individual characters (such as callouts) are inserted.
By default in Windows, the only fonts licensed for embedding are Arial, Times New Roman, Courier, and I think Calibri. If you wish to use other fonts, you must license them (Microsoft and other “type foundries” have online portals where you can license their fonts).
To further Some SVG editors, such as Adobe Illustrator, like to include font names in the SVG. Illustrator used to default to Adobe Type I Postscript names, instead of TrueType names (now OpenType) for instance, in Windows. So, what you get when you insert Arial in an SVG on Illustrator was a call for the Arial Postscript font, instead of a reference to arial.ttf (the TrueType version on Windows).
Either license the font(s) that are included in the SVGs, OR configure the SVG creation tools to default to certain fonts that are licensed, such as arial.ttf. (You can check in your PDF/Ant House/RenderX server’s font folder to see which are licensed.
I have seen this with RenderX XEP cut publishing time from hours to minutes on the same document.