How to create a
Vložit
- čas přidán 18. 07. 2019
- 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.com/como-crear...
- jsPDF link: rawgit.com/MrRio/jsPDF/master...
- library: unpkg.com/jspdf@latest/dist/j...
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/Mikex/full/ZgYVjX
If you need a good hosting plan, check these plans from A2Hosting:
www.a2hosting.com/refer/294131
LIKE AND FOLLOW:
Sitio Web: thedigitalmike.com
Fiverr: www.fiverr.com/mokixfredd
thank you for this solution. Highly appreciated
You're welcome! Glad it helped.
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 (czcams.com/video/Ym7rMiuAQBc/video.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
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, czcams.com/video/6zvlu3riSUI/video.html
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: czcams.com/video/nZR6UoV1vOA/video.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
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
czcams.com/video/nZR6UoV1vOA/video.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