Doc: simple example about how to generate PDF from HTML with SVG content
See original GitHub issueI’ve searched in many past issues, and I have seen an unmerged pull request in this direction, but currently no easy-to-test example.
Could we provide a simple example showing how fromHTML()
works when there is some SVG content?
Here is a beginning:
https://jsfiddle.net/6op5ofah/
What should I add to make it work? A jspdf.plugin.svg.js
file? Another version of jspdf? Another syntax?
Issue Analytics
- State:
- Created 7 years ago
- Reactions:4
- Comments:7
Top Results From Across the Web
How To Convert HTML To PDF With CSS And SVG(Chart ...
Step 1 - Create a HTML page · Step 2 - Copy all CDN links into your HTML page · Step 3 -...
Read more >How to design runtime generated PDF via HTML
In this article, we will learn to design the runtime generated pdf file via HTML. This task can be achieved in 3 ways:....
Read more >Convert HTML to PDF using JavaScript - CodexWorld
In this tutorial, we will show you how to generate PDF document and convert HTML to PDF using JavaScript and jsPDF library.
Read more >How to create a PDF document with the following HTML string ...
I am trying to convert an HTML String into a PDF document. But only the text part is being printed into the PDF...
Read more >Generating PDF from HTML in React Demo: Exporting Invoices
In this blog post, we'll build a sample invoice in our React app using HTML and CSS, then generate a PDF file based...
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 Free
Top 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
We are closing this issue, because we will not support any longer
fromHTML
andaddHTML
.Explaination: We are working on a new html2pdf plugin, which will be based on
html2canvas
and ourcontext2d
plugin. This should lead to more reliable results for your projects. And it will give us the time to focus on the core functionality of pdf-generation because we will not use our energy for writing/supporting/extending 2 html plugins. If you still want to useaddHTML
orfromHTML
you can still use jsPDF 1.4.1.Best Regards
@josephernest I have not found a good solution either. Every solution I tried involves converting the SVG to PNG which is bad for my needs since I want the image to stay vectorial. Right now I am only able to achieve that by calling window.print()
Here is the simple SVG I have tried working with :