how to export div to pdf using jquery?

Today, We want to share with you export div to pdf using jquery.In this post we will show you how to convert html(css) to pdf using javascript, hear for how to convert php page to pdf using javascript we will give you demo and example for implement.In this post, we will learn about How To Create Html To Pdf Using Php | Convert HTML To PDF Using PHP with an example.

Read Also:  Simple C Programming Structure Examples

convert html div to pdf using jquery Code Example

Example 1: index.html

<div id="cartctdata">
     <h3>Welcome To Pakainfo.com free Download Source code</h3>

    <p>a pararaph</p>
</div>
<div id="editor"></div>
<button id="cmd">generate PDF</button>

added External jquery

https://cdnjs.cloudflare.com/ajax/libs/jspdf/0.9.0rc1/jspdf.min.js

Example 2:

var doc = new jsPDF();
var specialElementHandlers = {
    '#editor': function (element, renderer) {
        return true;
    }
};

$('#cmd').click(function () {
    doc.fromHTML($('#cartctdata').html(), 15, 15, {
        'width': 170,
            'elementHandlers': specialElementHandlers
    });
    doc.save('full-pakainfo-banner.pdf');
});

Converting Div into PDF INCLUDING images

Example :

//HTML Code
<div id="cartctdata" style="background-color: white;">
  <h3>Tamil Rockers free download new website link</h3>
  <p>TamilRockers. TamilRockers is a public torrent website. TamilRockers website uploads the pirated versions of Tamil, Telugu, Hindi, English.</p>
  <img width=100 src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAlgCWAAD/2wBDAAMCAgICAgMCAgIDAwMDBAYEBAQEBAgGBgUGCQgKCgkICQkKDA8MCgsOCwkJDRENDg8QEBEQCgwSExIQEw8QEBD/2wBDAQMDAwQDBAgEBAgQCwkLEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBD/wAARCADIAMgDAREAAhEBAxEB/8QAHQAAAQUBAQEBAAAAAAAAAAAAAwIEBQYHAQAICf/EAEEQAAIBAwMCBAQEBAIIBgMAAAECAwAEEQUGIRIxBxNBUSJhcYEIFDKRFSNCoTNSCRYkQ1NiscElcoKS0fCy4fH/xAAbAQADAQEBAQEAAAAAAAAAAAAAAQIDBAUGB//EACwRAAICAg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D4ASKAPecAcB+r3xQATAkA+Ij60MBRgi/UsnUfalY0Y94jbG3frnihp2tW01tb7dsrDqfqkYvJdFscIBjhfWuLLxPLmU7pH0f4/8ALvhYNI+/RG+Ivh3u7X9rQ3G07wS6vpkv5qzFw3QJGHBTI4wRxz71OXgQa/X2a4/zcpyqZrG0bWaLS7Jbqz/LTLbRedEDkJIVBYZ9ec12JOEEmeByJ7TdeicngMkfloSOe9FnOIFkRGiSZbpH70WOxUVisbGQJ057U7ROzC2tmFnMzMSSMHNS5CbsfdKA8nt7VNv4EcdlxgYqkFAQwU5/sKAo8ZXIyFxigKPFpSmekmjokAzA5PTVIdAnk+EqRkGrooFbQIGBj4AOSDSYmrC3CqjqzdS5NCBdEfDLc4ADd/U1dIYi5gkLF3OSfSi0AmOB5AVxn50MA8dk68sAPkTUgPFDiLAdRz7YNJugOflfOIdjjFLYAoskTlT2ocgDJEpGGAqbYCGgRTjFFsaBTWkEyFZFDDPY0rZSbXoXFahSGQYx6U7bBt0FUIDlVAPakRbFkKRgtigDuEAGGoA95hbKn070qASTjAU06+wOuTwATQAjqccGgBYK49vnQARZEAHSATRTfoTFBwckDFKvskbyPGqkkDNUmAzaVMDGD9a0LG5uEDNnqDA+lACZJmOHUnjsPU1SQHUgkLhUft6Um0A9isyy/wAxiajYAhsmUdceFA9BS2sDgjweUIPvnNAHGDFgoKkUWFBAoIPUOB3NL5ADcvCkXWo5PaqXsDtpdoyjzB0vjH1qZRr0FDo9AGR681KGhQUSc9PFMTQJoirDpb6fKgoUkcjZ+L6UCZxwy566F2KgWMnA7HmnTKFxtzluwpAwhIk5HcUEgTIQekjB96KAUoY8Dk0CsV0H+ofegGckcGIgcg00JDbzeMHt6j51VFCjJFGAxGc0AJTDAsMEHvQgGkqBV6gVLZ7/AC9q0QDXLmTyxwBx96YH/9k=">
  <p>
    Text after img
  </p>
</div>
<button id="cmd">Create PDF</button>


//jQuery source Code

$('#cmd').click(function() {
  var options = {
  };
  var pdf = new jsPDF('p', 'pt', 'a4');
  pdf.addHTML($("#cartctdata"), 15, 15, options, function() {
    pdf.save('pageContent.pdf');
  });
});


I hope you get an idea about convert html to pdf by jquery.
I would like to have feedback on my infinityknow.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

Read Also:  Apache Virtual Host Tutorials - Setup Apache Virtual Hosts with Ubuntu

Related FAQ

Here are some more FAQ related to this Article:

  1. Read Also:  javascript convert html to pdf source code
  2. Read Also:  jQuery ToggleClass to Switch Between Classes
  3. Read Also:  Laravel Google Maps Geocoding Example
  4. Read Also:  Angular 6 Chart Example using Charts Package
  5. Read Also:  PHP Format File Size Convert KB MB GB
  6. Read Also:  Angular 6 JSON Array Merge into one array
  7. Read Also:  how to calculate percentage discount using calculator?
  8. Read Also:  how to send attachment in mail in php?
  9. Read Also:  10 little Importance PHP functions list with Example
  10. Read Also:  10 little Importance PHP functions list with Example
CLOSEX