Hello everyone! In this video, I have posted a tutorial on how to convert your HTML to CSS into a PDF without losing some of your CSS and maintaining most of the resolution! This took tons of research and I spent a lot of hours on this, so hopefully this condensed video makes the process much easier for you!
Script files (convert } to ankle bracket):
{script src=”
{script src=” }{/script}
If you found this helpful, don’t forget to give a like to this video and subscribe to this channel! Additionally, don’t forget to comment down so that I know which videos you’re interested in me posting!
Here is my code:
Happy Coding! 🙂
Timings:
0:00 : Create Basic HTML + CSS Document
1:42 : Create basic download function
4:00 : Set up beginning downloading steps
4:50 : Explaining the downloading process
6:50 : Create the jsPDF document
7:40 : html2canvas
9:50 : Adding image to jsPDF
10:55 : Download jsPDF command
11:48 : Test Code, Fix Resolution, Final Tips
HTML/CSS Playlist: …(read more)
Convert Word 2 PDF: Word to PDF Converter
Convert PowerPoint 2 PDF: PPT to PDF Converter
Convert Excel 2 PDF: Excel to PDF Converter
Convert an Image 2 PDF: Image to PDF Converter
Convert HTML 2 PDF: HTML to PDF Converter
More Tools: PDF Converter
Thanks so much, I made this code in ReactJs and worked well. I have spended a lot of time to resolve that task. So, thank you!
Thank you.. thank you so much
Are you sure you don't need to download html2canvas?
Thanks that was really helpful. I do have some questions, currently I'm in the process of converting HTML into pdf , but is there is any way to make HTML anchor element working in pdf too. Like giving your profile link & in pdf by clicking it in there it should work.
Te amo me has salvado la nota
hello, I have a question. Why in my document doesn't appear a image that I load from a URL? Exist any way to show in my document? Thank you
This solution just works for small amount of content. For 500 html lines, it does not print the whole content.
I like your style right from the start. Really good and fast-paced description. Nice work!!!
Hello Whiz Girl, I tried this approach ,but for me the html2canvas promise is getting rejected saying "Proxy must be used when rendering url" ..Anything that i am missing .I followed the same steps like yours
thank you soo much
I think I love you. Thanks a lot, you safe my life.
Top!
You're so talented and have good ways to explain things. If you can make some videos about creating webpages with thumbnails of the content, videos would be more noticeable. You just saved me with this video and you truly deserve much more followers <3.
Nice work 🙂 thanks a lot <3
thank you so much this was very helpful, is there a way to centerize it inside the pdf ?
Thank you for the video.. solved my problem ❤️❤️
how to make perfect pdf ..is not pdf .This is taking screenshot of page .Then create pdf .
thank youuuuuuuuuuu
Hi Whiz Girl!
I created a CV using HTML and CSS, is it possible if I send you my code that I could get help pulling it down like a PDF? Am having difficulties when following the tutorial.
very helpful video, Thanks
This is really cool.
Hi I need to generate multiple pdf pages and pages are generating depending on the input I am passing..my issue is I need to add header margin and in footer page number to all the pages..can you help me out in this
It is very helpful for me as beginner in coding wold thank you for sharing your experience I do appreciate it
The pdf gets downloaded as soon as page loads without the button being clicked (if I call function on button click) In case of anchor tag like you did the pdf appears to be empty.
hai mam how can i export if there are some images are their which i have given src url when i exported entire html the images are missing .may be i though it was cors error could please help with that
Thanks miss for your video (I'm french sorry for my english). My javascript is beginner. If I understood correctly each element of the HTML must be by canvas as for the img element at code line 38 so if I have a complete code page of a document I have to take element by element of the HTML? Is it not possible to recover all the HTML in the javascript with body, so work with canvas on the entire body of a document without splitting the body elements of the HTML?
If so, thank you for your next video.
Ma'am Big fan from Pakistan
Ur a girl?
Hey! So it works but I need to show more than one page, but its only showing the first page using this code. How do I change to show all the data i need?
whenever i try to add my own <div> to the existing code the button appears on top and when i click the download button, It only downloads the "downloading please." text not the intended div.
here is my code
thank you very much for your contribution, it served me a lot
not working
Great work!