PDF Cover Image in SVG format

Sunmy
Posts: 6
Joined: Fri Sep 06, 2019 10:58 am

PDF Cover Image in SVG format

Post by Sunmy » Wed Feb 05, 2020 11:31 am

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?

julien_lacour
Posts: 138
Joined: Wed Oct 16, 2019 3:47 pm

Re: PDF Cover Image in SVG format

Post by julien_lacour » Wed Feb 05, 2020 1:19 pm

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

Sunmy
Posts: 6
Joined: Fri Sep 06, 2019 10:58 am

Re: PDF Cover Image in SVG format

Post by Sunmy » Fri Feb 07, 2020 4:18 pm

Thank you for your help, Julien. Implementing your suggestion did fix my problem. :D

Post Reply