Corrected function signature for jsPDF.addPage

As per https://rawgit.com/MrRio/jsPDF/master/docs/jsPDF.html#addPage
This commit is contained in:
Jackie Weng
2018-11-07 09:47:14 +13:00
parent aa8aa4d664
commit 547a807d0d
2 changed files with 14 additions and 1 deletions
+2 -1
View File
@@ -2,6 +2,7 @@
// Project: https://github.com/MrRio/jsPDF
// Definitions by: Amber Schühmacher <https://github.com/amberjs>
// Kevin Gonnord <https://github.com/lleios>
// Jackie Weng <https://github.com/jemerald>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare module 'jspdf' {
@@ -45,7 +46,7 @@ declare module 'jspdf' {
'getPageInfo'(pageNumberOneBased:number):any;
'getCurrentPageInfo'():any;
};
addPage(sizes?: number[]):jsPDF;
addPage(format?: string | number[], orientation?: 'p'|'portrait'|'l'|'landscape'): jsPDF;
setPage(n:number):jsPDF;
insertPage(beforePage:number):jsPDF;
movePage(targetPage:number, beforePage:number):jsPDF;
+12
View File
@@ -13,6 +13,18 @@ function test_simple_two_page_document() {
doc.save('Test.pdf');
}
function test_add_pages_with_different_format() {
var doc = new jsPDF();
doc.text(20, 20, 'Hello world!');
doc.addPage('a5', 'l');
doc.text(20, 20, 'Do you like that?');
doc.addPage('c6');
doc.text(20, 20, 'Do you like that?');
doc.addPage([595.28, 841.89]);
doc.text(20, 20, 'Do you like that?');
doc.save('Test.pdf');
}
function test_landscape() {
var doc = new jsPDF('landscape');
doc.text(20, 20, 'Hello landscape world!');