@kingstonsoftware/pdf-o-rama
Advanced tools
Comparing version 2.2.3 to 2.2.4
@@ -42,18 +42,22 @@ "use strict"; | ||
async concat(options) { | ||
(0, _assert.default)(options.pdfFiles.length >= 2, "Must specify at least two PDF files to concatenate"); | ||
(0, _assert.default)(options.pdfFiles.length !== 0, "Must specify at least one PDF file"); | ||
(0, _assert.default)(options.outputFile, "No output file specified"); | ||
for (let pdfFile of options.pdfFiles) { | ||
if (!this.fs.existsSync(pdfFile)) { | ||
throw new Error(`File '${pdfFile}' does not exist`); | ||
if (options.pdfFiles.length >= 2) { | ||
for (let pdfFile of options.pdfFiles) { | ||
if (!this.fs.existsSync(pdfFile)) { | ||
throw new Error(`File '${pdfFile}' does not exist`); | ||
} | ||
} | ||
} | ||
const pdfWriter = this.hummus.createWriter(options.outputFile); | ||
const pdfWriter = this.hummus.createWriter(options.outputFile); | ||
for (let pdfFile of options.pdfFiles) { | ||
pdfWriter.appendPDFPagesFromPDF(pdfFile); | ||
for (let pdfFile of options.pdfFiles) { | ||
pdfWriter.appendPDFPagesFromPDF(pdfFile); | ||
} | ||
pdfWriter.end(); | ||
} else { | ||
this.fs.copyFile(options.pdfFiles[0], options.outputFile); | ||
} | ||
pdfWriter.end(); | ||
} | ||
@@ -60,0 +64,0 @@ |
@@ -7,6 +7,6 @@ "use strict"; | ||
exports.fullVersion = exports.version = void 0; | ||
const version = '2.2.3'; | ||
const version = '2.2.4'; | ||
exports.version = version; | ||
const fullVersion = '2.2.3-20200219.0'; | ||
const fullVersion = '2.2.4-20200223.0'; | ||
exports.fullVersion = fullVersion; | ||
//# sourceMappingURL=version.js.map |
{ | ||
"name": "@kingstonsoftware/pdf-o-rama", | ||
"private": false, | ||
"version": "2.2.3", | ||
"version": "2.2.4", | ||
"description": "A tool for manipulating PDF files", | ||
@@ -18,3 +18,3 @@ "engines": { | ||
"clean": "rm -rf dist/*", | ||
"build": "babel src -d dist -s --ignore *.test.js", | ||
"build": "npm run clean && babel src -d dist -s --ignore *.test.js", | ||
"debug": "node --inspect-brk -- dist/pdf-o-rama.js", | ||
@@ -21,0 +21,0 @@ "test": "jest", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
67776
526