Skip to content

Commit 6c00e43

Browse files
authored
Merge branch 'master' into fix-lineheight
2 parents b356aa8 + 57d6fb2 commit 6c00e43

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/jspdf.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3228,7 +3228,11 @@ function jsPDF(options) {
32283228
scaleFactor = 6;
32293229
break;
32303230
default:
3231-
throw new Error("Invalid unit: " + unit);
3231+
if (typeof unit === "number") {
3232+
scaleFactor = unit;
3233+
} else {
3234+
throw new Error("Invalid unit: " + unit);
3235+
}
32323236
}
32333237

32343238
var encryption = null;

types/index.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -844,7 +844,8 @@ declare module "jspdf" {
844844
ry: number,
845845
style?: string | null
846846
): jsPDF;
847-
save(filename?: string, options?: { returnPromise?: boolean }): jsPDF;
847+
save(filename: string, options: { returnPromise: true }): Promise<void>;
848+
save(filename?: string): jsPDF;
848849
saveGraphicsState(): jsPDF;
849850
setCharSpace(charSpace: number): jsPDF;
850851
setCreationDate(date?: Date | string): jsPDF;

0 commit comments

Comments
 (0)