mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-05 15:27:05 +00:00
Merge pull request #30326 from jemerald/jspdf
Package: jsPDF - corrected function signature for jsPDF.addPage
This commit is contained in:
Vendored
+2
-1
@@ -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;
|
||||
|
||||
@@ -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!');
|
||||
|
||||
Reference in New Issue
Block a user