Comparing version 2.2.0 to 2.3.0
@@ -7,2 +7,6 @@ # Changelog | ||
## [2.3.0] - 2019-05-07 | ||
### Changed | ||
- setTemplate now accepts an second optional parameter indicating whether the templates is to used for the first page only #126 | ||
## [2.2.0] - 2019-04-02 | ||
@@ -9,0 +13,0 @@ ### Fixed |
@@ -406,2 +406,6 @@ 'use strict' | ||
this._contents.length = 0 | ||
if (this._template && this._template.firstPageOnly) { | ||
this._template = null | ||
} | ||
} | ||
@@ -652,3 +656,3 @@ | ||
setTemplate(external) { | ||
setTemplate(external, firstPageOnly = false) { | ||
if (!(external instanceof ExternalDocument)) { | ||
@@ -659,3 +663,3 @@ throw new TypeError('argument must be of type ExternalDocument') | ||
this._begin(null) | ||
this._pending.push(() => external.setAsTemplate(this)) | ||
this._pending.push(() => external.setAsTemplate(this, firstPageOnly)) | ||
} | ||
@@ -662,0 +666,0 @@ |
@@ -87,3 +87,3 @@ 'use strict' | ||
async setAsTemplate(doc) { | ||
async setAsTemplate(doc, firstPageOnly) { | ||
await doc._endPage() | ||
@@ -155,2 +155,4 @@ | ||
} | ||
doc._template.firstPageOnly = firstPageOnly | ||
} | ||
@@ -157,0 +159,0 @@ } |
{ | ||
"name": "pdfjs", | ||
"author": "Markus Ast <npm.m@rkusa.st>", | ||
"version": "2.2.0", | ||
"version": "2.3.0", | ||
"description": "A Portable Document Format (PDF) generation library targeting both the server- and client-side.", | ||
@@ -22,11 +22,11 @@ "keywords": [ | ||
"opentype.js": "^0.11.0", | ||
"pako": "^1.0.8", | ||
"readable-stream": "^3.1.1", | ||
"unorm": "^1.4.1", | ||
"pako": "^1.0.10", | ||
"readable-stream": "^3.3.0", | ||
"unorm": "^1.5.0", | ||
"uuid": "^3.3.2" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^10.12.23", | ||
"tape": "^4.9.2", | ||
"typescript": "^3.3.3" | ||
"@types/node": "^10.14.6", | ||
"tape": "^4.10.1", | ||
"typescript": "^3.4.5" | ||
}, | ||
@@ -33,0 +33,0 @@ "repository": { |
@@ -122,4 +122,5 @@ declare module "pdfjs" { | ||
* @param external The external document to merge | ||
* @param firstPageOnly default: false, if true the template will only be used for the first page. | ||
*/ | ||
setTemplate(external: ExternalDocument): void; | ||
setTemplate(external: ExternalDocument, firstPageOnly?: boolean): void; | ||
@@ -126,0 +127,0 @@ /** |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
9783472
6390
0
Updatedpako@^1.0.10
Updatedreadable-stream@^3.3.0
Updatedunorm@^1.5.0