How to create a
Вставка
- Опубліковано 19 вер 2024
- Hello, looking for a simple way to export input data from an HTML page, I found that using the #jspdf library is the best way. So, here is a simple sample of how to use it. Enjoy.
- Web Post: thedigitalmike...
- jsPDF link: rawgit.com/MrR...
- library: unpkg.com/jspd...
source code with different content that instead of saving the file, it's open a new tab and presents the final pdf result
codepen.io/Mik...
If you need a good hosting plan, check these plans from A2Hosting:
www.a2hosting.c...
LIKE AND FOLLOW:
Sitio Web: thedigitalmike...
Fiverr: www.fiverr.com...
thank you for this solution. Highly appreciated
You're welcome! Glad it helped.
how can i style the pdf
The easiest way is to use the html2canvas library to export the entire page or the container you want to export. here is a video I made about it: ua-cam.com/video/nZR6UoV1vOA/v-deo.html it's in Spanish but I'm pretty sure I have it translated to English. if you have any questions feel free to ask me. Thanks
how to insert some like text box with gray background with text inside?
Sorry for the delay, I was making a video about your question, and I will be uploading that video this week. But it can be done by trying to use a doc.rect before the text and trying to center the text to be equal height. I will be adding the video in English and Spanish, stay tuned.
@@thedigitalmike nice thanks 👍
check the video, here, ua-cam.com/video/6zvlu3riSUI/v-deo.html
i would like to have the path that ypu added in the file index.html at the end what was it ?
that's the path to the jspdf library, I use the 1.5.3 debug version cdnjs.cloudflare.com/ajax/libs/jspdf/1.5.3/jspdf.debug.js.
hi, how could i add an image by input="File" and show it on the pdf, thanks
Hello, thanks for the comment, here I send you a video I recently uploaded (ua-cam.com/video/Ym7rMiuAQBc/v-deo.html) about how you can do it. the video is in spanish, but I will be uploading a new one in english in the future.
@@thedigitalmike thank you
Please give me source file....
Check the description of the video, I posted a blog entrance in my website and you will find also a link to codepen.io with the same code. You can use it. Hope it helps you with your projects
why it doesn't work when I apply css?😭
Hi, you have to use another method like the use of html to canvas to do it, see this video Como exportar #html + #css a #pdf usando #jspdf y #html2canvas
ua-cam.com/video/nZR6UoV1vOA/v-deo.html if you don’t follow because is not n Spanish, just let me make another one in English.
how about an image html to pdf? Thank you
- not an input img
Doesn't work
follow the post: thedigitalmike.com/como-crear-un-fichero-pdf-usando-javascript-con-jspdf/
you may need to translate it to english