artparks
artparks

Reputation: 761

html2pdf embed SVG files

I'm trying to use html2pdf to automatically create brochures that may need to go to print so need certain elements to be vector based. The class is hopelessly documented and I've got stuck trying to embed SVGs.

If I just try to embed the SVGs in the HTML to output like <embed src="img/test.svg" type="image/svg+xml" /> then I get an error saying the necessary methods to use this tag don't yet exist, likewise for <object> tags.

Digging further and the examples seem to show some sort of, I assume, proprietary <draw> tags that consist of all the required co-ords to draw the SVG. However I can't find any documentation anywhere to explain how to generate these?

Has anyone ever successfully embedded a SVG into a PDF using html2pdf?

Upvotes: 4

Views: 4607

Answers (1)

artparks
artparks

Reputation: 761

Well I've partly figured this out, it seems the <draw> tag just contains the contents of an SVG file ("show SVG code" when saving as SVG from Illustrator) but it turns out html2pdf doesn't support bezier curves, which makes it pretty much useless for most things.

Upvotes: 2

Related Questions