diff --git a/types/jspdf/index.d.ts b/types/jspdf/index.d.ts index c3507fc5e5..ce5b58ed36 100644 --- a/types/jspdf/index.d.ts +++ b/types/jspdf/index.d.ts @@ -4,13 +4,14 @@ // Kevin Gonnord // Jackie Weng // Frank Brullo +// Leon Montealegre // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare module 'jspdf' { class jsPDF { constructor(orientation?:any, unit?:string, - format?:string, + format?:string|Array, compressPdf?:number); CapJoinStyles:any; diff --git a/types/jspdf/jspdf-tests.ts b/types/jspdf/jspdf-tests.ts index ab6dd3a82a..3b930f8526 100644 --- a/types/jspdf/jspdf-tests.ts +++ b/types/jspdf/jspdf-tests.ts @@ -121,6 +121,15 @@ function test_font_metrics_based_line_sizing_split() { pdf.save('Test.pdf'); } +function test_simple_custom_size_document() { + var doc = new jsPDF('l', 'px', [500, 200]); + doc.text(20, 20, 'Hello world!'); + doc.text(20, 30, 'This is client-side Javascript, pumping out a PDF.'); + doc.addPage(); + doc.text(20, 20, 'Do you like that?'); + doc.save('Test.pdf'); +} + function test_from_html() { var pdf = new jsPDF('p', 'pt', 'letter') , source = document.getElementById('#fromHTMLtestdiv')