How to Convert HTML to PDF ? | Angular | React - Project Tricks & Tips
ฝัง
- เผยแพร่เมื่อ 12 ก.ย. 2022
- #htmltopdf #angular #react @partharanjan
Learn How to convert HTML to PDF in Angular and react.
Repo: github.com/partharanjan/angul...
Follow me on
Buy me a Book: www.buymeacoffee.com/parthara...
LinkedIn : / partharanjan
GitHub: github.com/partharanjan
Twitter: / partha_pw
Thank you.😆
Happy Learning & Coding!
Nice video sir 😍🙏
Love your content, I think I’ve watched your video four times.😄😄
it means lot to me thank you for sharing with such a nice explanation
Thank you. Keep watching
Awesome very good explined keep it up.
Thank you ❤️
Thanks.. After watching many videos this one worked 🎉❤
Keep watching
I have issue with the tag svg it's not render correctly, can u help me about this issue.
can you share code?
Nice very simple explanation even I am not IT profession but I can get it Easley.
Keep watching
how van we make the text selectable in the pdf? please help me out
Sure
Hii i want to add new page measn i have multiple pages content i need to download the multiple page pdf how can i downlad it?? Please help me in same code i want multiple page print
Coming soon! Keep watching!
can it work for multiple page ?
As of now no, I am preparing another video for multiple export. Keep watching.
@@partharanjan i solve this problem we can use react-to-print pacakge which directly giving an option for printing the all pages according to your page size and all, working in all devices and perfectly working.
How can we export more than one page in the pdf
var imgData = canvas.toDataURL('image/png');
var imgWidth = 210;
var pageHeight = 295;
var imgHeight = canvas.height * imgWidth / canvas.width;
var heightLeft = imgHeight;
var doc = new jsPDF('p', 'mm');
var position = 0;
doc.addImage(imgData, 'PNG', 0, position, imgWidth, imgHeight);
heightLeft -= pageHeight;
while (heightLeft >= 0) {
position = heightLeft - imgHeight;
doc.addPage();
doc.addImage(imgData, 'PNG', 0, position, imgWidth, imgHeight);
heightLeft -= pageHeight;
}
doc.save( 'file.pdf');`
stackoverflow.com/questions/27045704/how-do-i-get-a-multi-page-pdf-from-a-website-using-jspdf-and-html2canvas
I tried this but my content is dynamic so some lines are getting cut and coming in two different pages
will this work on all screen?
yes, did you try?
i tried it but doen't worked so i removed the meta tag conditionally to make it worked@@partharanjan