jsPDF

jsPDF

new jsPDF(orientation, unit, format) → {jsPDF}

Source:

If the first parameter (orientation) is an object, it will be interpreted as an object of named parameters

{
 orientation: 'p',
 unit: 'mm',
 format: 'a4',
 hotfixes: [] // an array of hotfix strings to enable
}
Parameters:
Name Type Description
orientation

One of "portrait" or "landscape" (or shortcuts "p" (Default), "l")
Can also be an options object.

unit

Measurement unit to be used when coordinates are specified. One of "pt" (points), "mm" (Default), "cm", "in"

format

One of 'pageFormats' as shown below, default: a4

Returns:
Type
jsPDF

Members

(static) API

Source:

jsPDF.API is a STATIC property of jsPDF class. jsPDF.API is an object you can add methods and properties to. The methods / properties you add will show up in new jsPDF objects.

One property is prepopulated. It is the 'events' Object. Plugin authors can add topics, callbacks to this object. These will be reassigned to all new instances of jsPDF. Examples: jsPDF.API.events['initialized'] = function(){ 'this' is API object } jsPDF.API.events['addFont'] = function(added_font_object){ 'this' is API object }

Example
jsPDF.API.mymethod = function(){
  // 'this' will be ref to internal API object. see jsPDF source
  // , so you can refer to built-in methods like so:
  //     this.line(....)
  //     this.text(....)
}
var pdfdoc = new jsPDF()
pdfdoc.mymethod() // <- !!!!!!