html

jsPDF html PlugIn

Source:

Methods

(inner) html(source, optionsopt)

Source:

Generate a PDF from an HTML element or string using.

Example
var doc = new jsPDF();

doc.html(document.body, {
   callback: function (doc) {
     doc.save();
   },
   x: 10,
   y: 10
});
Parameters:
Name Type Attributes Description
source HTMLElement | string

The source HTMLElement or a string containing HTML.

options Object <optional>

Collection of settings

Properties
Name Type Attributes Description
callback function <optional>

The mandatory callback-function gets as first parameter the current jsPDF instance

margin number | array <optional>

Array of margins [left, bottom, right, top]

filename string <optional>

name of the file

image HTMLOptionImage <optional>

image settings when converting HTML to image

html2canvas Html2CanvasOptions <optional>

html2canvas options

jsPDF jsPDF <optional>

jsPDF instance

x number <optional>

x position on the PDF document

y number <optional>

y position on the PDF document