Page 1 of 1

PDF Cover Image in SVG format

Posted: Wed Feb 05, 2020 11:31 am
by Sunmy
I'm trying to add an SVG image to the cover of PDF output.
My SVG document contains a PNG image, text, and other vector graphics:

<defs>
<image width="34" height="34" id="logo" href="logo.png"/>
</defs>
<rect x="0" y="0" width="100%" height="100%" rx="10" ry="10"
stroke: #005000;
stroke-width: 3;"/>
<text x="45%" y="95%" color="#FFFFAA" font-size="0.7cm"> Sample </text>
<use id="logo" href="#logo" ransform="matrix(0.6,0,0,0.599,147,138)"/>

It's not working until I remove the PNG image.

Is there anyway to keep the PNG image, text, and vector graphics in a PDF cover?

Re: PDF Cover Image in SVG format

Posted: Wed Feb 05, 2020 1:19 pm
by julien_lacour
Hello,

Could you try to do the following in your SVG file
  1. Declare xmlns:xlink="http://www.w3.org/1999/xlink" in <svg> elemnt
  2. Modify the href="logo.png" attribute to xlink:href="logo.png"
Regards,
Julien

Re: PDF Cover Image in SVG format

Posted: Fri Feb 07, 2020 4:18 pm
by Sunmy
Thank you for your help, Julien. Implementing your suggestion did fix my problem. :D