jsPDF icon indicating copy to clipboard operation
jsPDF copied to clipboard

SVG support

Open Sohalt opened this issue 12 years ago • 6 comments

The sillysvgrenderer only supports paths, which makes it more or less useless. Please add support for proper SVG files.

Sohalt avatar Nov 01 '14 20:11 Sohalt

Any updates on this?

thecookieorg avatar Mar 26 '15 00:03 thecookieorg

+1

m-a-r-c-e-l-i-n-o avatar Sep 30 '15 22:09 m-a-r-c-e-l-i-n-o

I found this method doc.addSVG but give me to many errors:

TypeError: Cannot read property 'getAttribute' of undefined at Object.jsPDFAPI.addSVG

gabrielAnzaldo avatar Jan 04 '16 22:01 gabrielAnzaldo

are there any plans for increasing the capabilities of sillysvgrenderer?

adamabeshouse avatar May 17 '16 18:05 adamabeshouse

SVG support is now in the master branch :) Documentation to follow.

MrRio avatar Sep 26 '16 01:09 MrRio

Hello,

Could you provide links to examples and test cases? Looking through the source code, it appears that the code you committed on Sep 30 is a fork of Canvg with a few modifications to make it work with jsPDF.

I managed to get the canvg binding to run based on the one example I found in examples/canvg_context2d/bar_graph_with_text_and_lines.html, but it renders incorrectly on my SVG image that contains multiple embedded bitmap images. When I point canvg to a regular Canvas element instead of jsPDF, my image renders correctly, making me suspect that the problem lies somewhere in jsPDF's context2d API.

Thanks for maintaining this otherwise excellent module!

vote539 avatar Dec 05 '16 09:12 vote539