Forum Feature requests

<Symbol> blocks optimization in multiple SVGs --> PDF conversion

arkbene
Dear developers, thanks for the great tool!

Here's what I think: as the official description (https://developer.mozilla.org/en-US/docs/Web/SVG/Element/symbol) says,

The use of symbol elements for graphics that are used multiple times in the same document adds structure and semantics.


So, basically, define once, use many times. That's how it works within a single SVG, and that's why it's often used.

In a situation where several SVGs are converted to a single multi-page PDF, the SVGs may contain identical Symbol blocks in multiple SVGs, and so the fact that they end up in a single PDF allows for more optimization: one could keep a hash table of all encountered Symbol blocks, check every new Symbol block with the hash table (fast) and if a match exists just insert a link (!) to the respective PDF object that had been previously created for an earlier instance of the Symbol block. This way many identical Symbol blocks end up a single graphical object in PDF.

Exactly what time of PDF object is best for this is up for discussion, but it's definitely doable with XObjects.