Open psamim opened 7 years ago
This indeed is not supported and "html2pdf" is definitely out of scope for "svg2pdf".
With the help of something like this: http://www.techumber.com/html-to-pdf-conversion-using-javascript/ you can probably get something like this to work. We would welcome a pull-request here.
MrRio has plans to rewrite the JsPDF API to use a canvas API, so combining the "html2canvas" project with this new API should enable a straightforward implementation of this task, too.
Are there some news regarding the issue (a few years later)? I would like to be able to export to PDF an SVG containing (both) "foreignObjects" and embedded images, without losing the export quality (i.e. without canvas PNG or JPG conversion) in a browser. Would appreciate any advice.
No. There aren't any news. Believe me, when we reimplement a browser engine, we will definitely add this in a note somewhere ;-) Right now, we don't have plans to implement our own user agent. This is still definitely out of scope of this project. There was a plugin for Chrome that takes SVG snapshots of a website. That source code might help to implement a rudimentary version of what you need. It definitely does not cover the whole HTML spec but it might work for simple use-cases:
https://chrome.google.com/webstore/detail/svg-screenshot/nfakpcpmhhilkdpphcjgnokknpbpdllg?hl=en
Hi,
I see that
foreignObject
SVG tag is not supported, for embedding HTML. Am I right?Thanks