Svg isn't drawn
See original GitHub issueAre you using the latest version of jsPDF? 1.4.1
Have you tried using jspdf.debug.js? Yes
Steps to reproduce https://jsbin.com/rayizodoxi/edit?html,js,output
What I saw Blank page
What I expected Drawn svg
Hi, i want to create pdf from svg. I have sample svg code
<svg height="500" version="1.1" width="500" xmlns="http://www.w3.org/2000/svg" style="overflow: hidden; position: relative;">
<desc style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);">Created with Raphaël 2.1.0</desc>
<defs style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);"></defs>
<text x="50" y="50" text-anchor="middle" font="10px "Arial"" stroke="none" fill="#000000" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0); text-anchor: middle; font: 10px Arial;" stroke-width="0.1155822959137042" transform="matrix(8.6436,-0.3768,0.3768,8.6436,-311.9625,-338.3442)">
<tspan dy="3.5" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);">TEXT</tspan>
</text>
</svg>
var doc = new jsPDF('l', 'px', 'a4');
var svg = '<svg height="500" version="1.1" width="500" xmlns="http://www.w3.org/2000/svg" style="overflow: hidden; position: relative;"><desc style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);">Created with Raphaël 2.1.0</desc><defs style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);"></defs><text x="50" y="50" text-anchor="middle" font="10px "Arial"" stroke="none" fill="#000000" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0); text-anchor: middle; font: 10px Arial;" stroke-width="0.1155822959137042" transform="matrix(8.6436,-0.3768,0.3768,8.6436,-311.9625,-338.3442)"><tspan dy="3.5" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);">TEXT</tspan></text></svg>';
doc.addSVG(svg, 0, 0, 500, 500);
doc.save('Test.pdf');
i use addSvg method for pdf create. But pdf export blank page.
Where am i doing wrong?
Thank You.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5
Top Results From Across the Web
HTML SVG Not Drawing (Works in Other Pages)
I can get the right HTML code to be injected into the HTML page, but no circle/svg is drawn.
Read more >Paths - SVG: Scalable Vector Graphics - MDN Web Docs
A good understanding of paths is important when drawing SVGs. While creating complex paths using an XML editor or text editor is not...
Read more >SVG Logo not visible | WordPress.org
I am unable to use a svg image as the site logo. When I inspect element the site, I see the logo is...
Read more >The follow svg not visible in android · Issue #1127 - GitHub
The following Svg component becomes invisible in 9.9.9 version and this svg is visible in 9.5.1.
Read more >4. Basic Shapes - SVG Essentials, 2nd Edition [Book] - O'Reilly
SVG lets you draw a straight line with the <line> element. ... The SVG in Example 4-1 draws several lines; the reference grid...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
better do this
https://jsbin.com/yimelaruwo/1/edit?html,js,output
I can understand, but addSVG is really not a good choice. Should be considered as deprecated.