JSPDF - addHTML() Multiple Canvas Page

Dion Alexander

I noticed already have a release "addHTML() can now split the canvas into multiple pages" which can find through this link : https://github.com/MrRio/jsPDF/releases/tag/v1.0.138.

May i know how it work? In my case, i just tried it out when click on "save as pdf" button, it just render a single page instead of multiple pages (sometimes didn't worked, i assume because the content is too long to be generated as pdf).

Would appreciate if there are some examples for this case. Thanks!

Attached my codes below:

var pdf = new jsPDF('p', 'pt', 'a4');

pdf.addHTML($(".pdf-wrapper"), function () {
    var string = pdf.output('datauristring');
    pdf.save("test.pdf");
});
diegocr

Splitting canvas into multiple pages work by providing a "pagesplit" option:

var pdf = new jsPDF('p', 'pt', 'a4');
var options = {
         pagesplit: true
    };

pdf.addHTML($(".pdf-wrapper"), options, function()
{
    pdf.save("test.pdf");
});

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

jsPDF - .addHTML is not a function

From Dev

Use html2canvas with jsPDF to save a PDF of a page

From Dev

How to print PDF with number page same number canvas using jsPDF?

From Dev

Draw Multiple Canvas on a single page

From Dev

Draw Multiple Canvas on a single page

From Dev

Empty PDF report is generated when we have multiple graphs using html2canvas and jsPDF library

From Dev

Converting Canvas to Pdf using JsPDF

From Dev

Init script on multiple <canvas> elements on same page

From Dev

Error on Opening PDF that is generated by JSPDF Image Canvas

From Java

Multiple html canvas element with random graphics on same page

From Dev

How to put multiple canvas js animations on one page. (Createjs)

From Dev

Html5 multiple canvas with image on one page

From Dev

HTML page, multiple refreshing "draw on canvas" from IPcamera snapshots

From Dev

Export multiple chart in a single page using canvas.js

From Dev

Adding a fixed header/footer for each page jsPDF

From Dev

jsPDF multi page PDF with HTML renderer

From Dev

Generating a pdf that preserves styling of the HTML page with jsPDF

From Dev

html2canvas and jsPDF : send generated pdf as email attachment

From Dev

jspdf/html2canvas cutting off data

From Dev

jspdf header needs to repeat multiple pages

From Dev

Generating PDF using multiple google charts and jspdf

From Dev

Creating a Canvas at the top of a page

From Dev

Canvas to span entire page

From Dev

Rotating multiple texts in canvas

From Dev

Canvas - Multiple Compositing Operations

From Dev

Multiple light sources on canvas

From Dev

Multiple canvas are not drawing image

From Dev

Canvas - clipping multiple images

From Dev

Control multiple canvas animations

Related Related

HotTag

Archive