Skip to main content
Skip table of contents

Support for a symbol element in SVG

The release of iText Core 7.1.13 includes a number of bug fixes as well as useful feature additions.
As we continue to work on increasing support for SVG the support for another SVG element - <symbol> is among those features. This support is applicable to both the iText 7 Core library and version 3.0.2 of the pdfHTML add-on

a <symbol> element is used to define graphical template objects which can be instantiated by a <use> element.
If you'd like to know more about this element please check the specification

From now on you can convert any SVG containing <symbol> e.g:

<?xml version="1.0" encoding="UTF-8"?>
<svg viewBox="0 0 800 600" xmlns=""
	<symbol id="myDot" viewBox="0 0 500 500" >
		<circle cx="5" cy="60" r="50" stroke-width="20" stroke="#f00" style="fill: skyblue;"/>
	<use xlink:href="#myDot" x="0"  y="100" style="fill: yellow;"/>
	<use xlink:href="#myDot" x="250" y="100" style="fill: purple;"/>

to PDF


using iText Core and without any additional coding.
Code remains the same: 





JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.