Hi Aspose Team,
we figured out some rendering issues when inserting a SVG using document builder into a word document.
The tspan property text-anchor=“middle” is not working, if the property is not (also) set in the parent text element. Therefore, text-align=“center” is not working as expected.
<?xml version="1.0" encoding="UTF-8"?>
<svg width="1.4834cm" height=".44192cm" color-interpolation="auto" color-rendering="auto" fill="#000000" font-family="Dialog" font-size="12px" image-rendering="auto" shape-rendering="auto" stroke="#000000" stroke-linecap="square" stroke-miterlimit="10" text-rendering="auto" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<metadata>
<rdf:RDF>
<cc:Work rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
<dc:title/>
</cc:Work>
</rdf:RDF>
</metadata>
<g transform="translate(-20.028 -281.92)">
<path id="node_IGF1R" transform="matrix(.81979 0 0 .63295 10.364 106.54)" d="m12.483 277.77h67v25h-67z" fill="#fff" stroke="#000" stroke-width="1.3882"/>
<text transform="translate(1.9512 .40395)" x="45.836914" y="294" clip-path="url(#clipPath211)" fill="#000000" font-family="Arial" stroke="none" text-rendering="geometricPrecision" xml:space="preserve"><tspan text-align="center" text-anchor="middle">IGF1R</tspan></text>
</g>
</svg>
Working version:
<?xml version="1.0" encoding="UTF-8"?>
<svg width="1.4834cm" height=".44192cm" color-interpolation="auto" color-rendering="auto" fill="#000000" font-family="Dialog" font-size="12px" image-rendering="auto" shape-rendering="auto" stroke="#000000" stroke-linecap="square" stroke-miterlimit="10" text-rendering="auto" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<metadata>
<rdf:RDF>
<cc:Work rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
<dc:title/>
</cc:Work>
</rdf:RDF>
</metadata>
<g transform="translate(-20.028 -281.92)">
<path id="node_IGF1R" transform="matrix(.81979 0 0 .63295 10.364 106.54)" d="m12.483 277.77h67v25h-67z" fill="#fff" stroke="#000" stroke-width="1.3882"/>
<text transform="translate(1.9512 .40395)" x="45.836914" y="294" clip-path="url(#clipPath211)" fill="#000000" font-family="Arial" stroke="none" text-rendering="geometricPrecision" text-anchor="middle" xml:space="preserve"><tspan text-align="center" text-anchor="middle">IGF1R</tspan></text>
</g>
</svg>
The expected behaviour is that the word IGF1R is center aligned in the box.
Best regards,
Andreas