Easy way to convert HTML to PDF using Javascript - Code With Mark

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 มิ.ย. 2021
  • PDF file format is very useful to download bulk data in the web application. It helps the user to download dynamic content in file format for offline use. With export to PDF functionality, the HTML content is converted to a PDF document and downloaded as a PDF file. In the dynamic web application, a server-side script is used to convert HTML to PDF and generate PDF file using PHP.
    If you want a client-side solution to generate PDF document, JavaScript is the easiest way to convert HTML to PDF. There are various JavaScript library is available for generating PDF from HTML.
    This is one of the best library to convert HTML to PDF using JavaScript.
    In this tutorial, you will learn how to generate PDF document and convert HTML to PDF using javascript
    Download Code: codewithmark.com/html-to-pdf
    😀 Subscribe: codewithmark.com/yt-subscribe
    Join The Facebook Group: g2gurl.com/83ga
    ***************************************************************************************
    Javascript & jQuery Course:
    Gift For You: codewithmark.com/gift
    Store : g2gurl.com/store-code-with-mark
    Contact Me: codewithmark.com/contact
    ***************************************************************************************
    Keywords:
  • แนวปฏิบัติและการใช้ชีวิต

ความคิดเห็น • 41

  • @Codewithmark
    @Codewithmark  3 ปีที่แล้ว

    😀 Subscribe: codewithmark.com/yt-subscribe
    Gift For You: codewithmark.com/gift

  • @francispierre-louis4313
    @francispierre-louis4313 ปีที่แล้ว

    Came in clutch. Thank you Mark!!

  • @user-xp6sd6uc1l
    @user-xp6sd6uc1l ปีที่แล้ว +3

    Hi there. This code was working fine a few months ago. But now the print button is not working properly. Please Someone helps me

  • @madhawapiumika4037
    @madhawapiumika4037 2 ปีที่แล้ว

    Love the video and a sublime user . its a life saver THANK YOU VERY MUCH. i was using dom PDF but ended up going crazy with it😄

  • @ronaldreis8242
    @ronaldreis8242 2 ปีที่แล้ว

    Thank you very much for sharing this solution! It worked like a charm!

  • @srujany7188
    @srujany7188 2 ปีที่แล้ว +3

    After downloading it will be saving pdf in image format I need pdf format any solution? Cz in image format text can't be selecteable in pdf format text will selecteable so I need text selectable format pdf....

  • @jorgetorres3916
    @jorgetorres3916 2 ปีที่แล้ว

    Mil gracias por este contenido. Me solucionaste un tremendo problema. 👍

  • @chisomokayuni8078
    @chisomokayuni8078 ปีที่แล้ว

    You really saved me a weeks work 🙌🙌 thank you

  • @arifdevcoding
    @arifdevcoding 2 ปีที่แล้ว +2

    but it's just an image. i cannot select text from that pdf. right? then why?

  • @user-el2co6fr8t
    @user-el2co6fr8t ปีที่แล้ว +1

    Thank you so much sir. your explanation is great, and this code are properly working. Thanks a lot once again.

  • @DelightZone2023
    @DelightZone2023 ปีที่แล้ว

    Awesome!

  • @filipecanzi
    @filipecanzi 2 ปีที่แล้ว

    Thanks Dude!

  • @preetamkumar1653
    @preetamkumar1653 3 ปีที่แล้ว +3

    Thanku so much sir, u saved my day🙏🤩

    • @Codewithmark
      @Codewithmark  3 ปีที่แล้ว

      Glad you found it helpful..
      Happy Coding

  • @rangabharath4253
    @rangabharath4253 3 ปีที่แล้ว

    awesome

  • @fredrickmsomba4123
    @fredrickmsomba4123 ปีที่แล้ว

    Great

  • @raffilevy2029
    @raffilevy2029 2 ปีที่แล้ว +2

    It’s nice but unfortunately it saves the contents within the pdf as an image so not as useful as I thought…

  • @moazzamali7483
    @moazzamali7483 ปีที่แล้ว

    Awesome video bro. But I want to ask how to use this code in wordpress. Please bro reply ASAP

  • @iconoyuri9555
    @iconoyuri9555 3 หลายเดือนก่อน

    Thanks a lot

  • @antareepdas3325
    @antareepdas3325 6 หลายเดือนก่อน

    will this work without internet connetion?

  • @alexsandroribeiro6759
    @alexsandroribeiro6759 3 หลายเดือนก่อน

    and if you have multiple pages?

  • @YannickLemelin
    @YannickLemelin ปีที่แล้ว

    Everybody seems to be using html2PDF, which uses html2canvas which sometimes cut lines at the end of the page in 2. As if it cannot handle the line height of some font types..

  • @kprakash9665
    @kprakash9665 2 ปีที่แล้ว

    Thankyou but your code is not supporting for barcodes

  • @vnitharavi
    @vnitharavi 2 ปีที่แล้ว

    It is working in chrome and Microsoft edge but not in ie. Can you please share the fix for this issue.

    • @Everest_moli
      @Everest_moli 2 ปีที่แล้ว +1

      Nobody uses the internet explorer. My recommendation is that avoid that navigator.

  • @naranyala_dev
    @naranyala_dev ปีที่แล้ว

    why do you encourage library creators to use jQuery, what are the benefits? Is Vanilla JavaScript unable to do their job? and what kind of library did you create yourself using jQuery?

  • @jeromystewart
    @jeromystewart 2 ปีที่แล้ว

    Code With Mark .. You can convert a jQuery Dom Element to a pure javascript element very simply, this addresses your "jQuery not working issue" .. var element = $('#container_content')[0]; this line is equivalent to your line getting the element by ID in native javascript

  • @NightDevs
    @NightDevs 2 ปีที่แล้ว +1

    Hello sir. Nice script but NOT for sensitive data... If somebody change the data on page "Locally" (with a simple javascript) the PDF will include the changed data and NOT the original one. I have already test what I mention. If you want I can provide you a video with the test :)

    • @johnnya1717
      @johnnya1717 2 ปีที่แล้ว +2

      EVERYTHING on clientside can be modified

  • @siddhardhak4367
    @siddhardhak4367 4 หลายเดือนก่อน

    Hey how to make it work for long tables

    • @Codewithmark
      @Codewithmark  4 หลายเดือนก่อน

      how long do you have in mind?

  • @MuhammadSalman-kz4jp
    @MuhammadSalman-kz4jp 3 ปีที่แล้ว +1

    How the hell do you know that i am searching for it from last few days?

    • @MuhammadSalman-kz4jp
      @MuhammadSalman-kz4jp 3 ปีที่แล้ว

      BTW Thank you so much. Nice and easy. Really appreciate !

    • @Codewithmark
      @Codewithmark  3 ปีที่แล้ว +1

      Your welcome....
      Keep an eye out for part two of this coming next week.... Where I will show you how you can add a custom footer... Like patient number or whatever you like..
      So make sure you subscribe to the channel so you get that video..
      Happy Coding

    • @MuhammadSalman-kz4jp
      @MuhammadSalman-kz4jp 3 ปีที่แล้ว

      I am gonna check that out for sure

    • @MuhammadSalman-kz4jp
      @MuhammadSalman-kz4jp 3 ปีที่แล้ว

      You got my subscription on youtube as well

  • @krzysiekwarchal
    @krzysiekwarchal 2 ปีที่แล้ว +1

    didn't receive the code files after completing the form lol

  • @MajidKhan-pu1tl
    @MajidKhan-pu1tl 2 ปีที่แล้ว

    html2pdf.bundle.min.js:6 Uncaught Missing source element or string.

  • @geethikegmn3580
    @geethikegmn3580 ปีที่แล้ว +1

    Hi there. This code was working fine a few months ago. But now the print button is not working properly. Please Someone helps me