Merge pull request #30326 from jemerald/jspdf

Package: jsPDF - corrected function signature for jsPDF.addPage
This commit is contained in:
Armando Aguirre
2018-11-08 10:42:39 -08:00
committed by GitHub
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!');