alafr / SVG-to-PDFKit

Insert SVG into a PDF document created with PDFKit
MIT License
397 stars 111 forks source link

Trying to embed image from svg file throws error #169

Open mickey58github opened 1 year ago

mickey58github commented 1 year ago

Hi, in one of my svgs to be included in a pdf, I'm trying to embed an svg image from a local file, on my Node server, through: <svg><image href="full-path-to-local-svg-image-file/test-image.svg"/></svg>

This works successfully for me for local png files (.png).

But if I try the same with an svg file, I get the error: "SVGElemImage: failed to open image "full-path-to-local-svg-image-file/test-image.svg" in PDFKit"

Is loading of svg files through <image href="..."> supported or not?

Thanks for any hints on this.