Answer the question
In order to leave comments, you need to log in
How to do adequate html to pdf conversion in react.js?
The site has a test, after passing which a report is generated. It is necessary to allow the user to download this report in pdf format. I tried jsPDF according to this logic, first I turn the selected block into a picture and then it into pdf. However, there are problems with 2 pages, and proportions. Can anyone suggest a proper way to do this. Thanks in advance
Answer the question
In order to leave comments, you need to log in
The best and most trouble-free PDF is obtained in puppeteer, but it is only for backing and eats a lot of resources for generation. But due to the fact that it is on Chromium, I personally did not encounter any incomprehensible visual artifacts, either on the page or in PDF.
At the front, I didn’t generate a pdf, but creating an image from html, and it in pdf is a rather strange undertaking, since there are html → pdf generators. I won’t tell you which one to use best, but there are enough popular ones, try everyone.
I will note as a bonus @media print
for specifying styles when printing. However, this is true for printing by means of a browser and a Pupiter.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question