How to create a

Sdílet
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

Komentáře • 20

  • @fackermaker1
    @fackermaker1 Před 2 lety +1

    thank you for this solution. Highly appreciated

  • @krizimane4451
    @krizimane4451 Před 2 lety

    i would like to have the path that ypu added in the file index.html at the end what was it ?

    • @thedigitalmike
      @thedigitalmike  Před 2 lety

      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.

  • @jeeperscreepersgameplays8069

    hi, how could i add an image by input="File" and show it on the pdf, thanks

    • @thedigitalmike
      @thedigitalmike  Před 2 lety +1

      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.

    • @jeeperscreepersgameplays8069
      @jeeperscreepersgameplays8069 Před 2 lety +1

      @@thedigitalmike thank you

  • @AlexKofJsk
    @AlexKofJsk Před rokem +1

    how to insert some like text box with gray background with text inside?

    • @thedigitalmike
      @thedigitalmike  Před rokem +1

      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.

    • @AlexKofJsk
      @AlexKofJsk Před rokem +1

      @@thedigitalmike nice thanks 👍

    • @thedigitalmike
      @thedigitalmike  Před rokem

      check the video, here, czcams.com/video/6zvlu3riSUI/video.html

  • @antareepdas3325
    @antareepdas3325 Před 6 měsíci +1

    how can i style the pdf

    • @thedigitalmike
      @thedigitalmike  Před 6 měsíci

      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

  • @onlineghor-ko6wh
    @onlineghor-ko6wh Před rokem +1

    Please give me source file....

    • @thedigitalmike
      @thedigitalmike  Před rokem

      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

  • @jikoycopada1718
    @jikoycopada1718 Před 7 měsíci

    why it doesn't work when I apply css?😭

    • @thedigitalmike
      @thedigitalmike  Před 7 měsíci +1

      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.

    • @jikoycopada1718
      @jikoycopada1718 Před 7 měsíci

      how about an image html to pdf? Thank you
      - not an input img

  • @mayureshatole
    @mayureshatole Před 8 měsíci

    Doesn't work

    • @thedigitalmike
      @thedigitalmike  Před 8 měsíci

      follow the post: thedigitalmike.com/como-crear-un-fichero-pdf-usando-javascript-con-jspdf/
      you may need to translate it to english