SVG-to-PDFKit icon indicating copy to clipboard operation
SVG-to-PDFKit copied to clipboard

<image> tag in svg

Open xescape opened this issue 8 years ago • 3 comments

Hi, I recently ran into an issue with converting svg with elements to pdf. Basically, the image doesn't show. I tried an example like this using your demo site: <svg><image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="data:image/png;base64,[base64 stuff]"></image></svg> and the resulting pdf is blank. I believe this used to work a few months ago - not sure what changed since then. I've attached a txt file including the URI for reference. URI.txt

Is this an issue you can address, or should I be looking somewhere else? Thanks. [edit: I'm using pdfkit 0.8.2]

xescape avatar Feb 01 '18 20:02 xescape

In SVG1 the width & height attributes are required. When they are missing they are assumed to be 0 (so the image isn't visible). The SVG2 specification makes them optional but this is not yet supported by SVG-to-PDFKit.

alafr avatar Feb 02 '18 23:02 alafr

Okay, right. For reference, the image element itself needs to have the height and width properties. Thank you.

xescape avatar Feb 09 '18 19:02 xescape

Please update about the support for <image> tag in svg for SVGtoPDF

fubuk-i avatar Sep 01 '20 09:09 fubuk-i