pdf-merge-multistamp
Advanced tools
Comparing version 1.2.0 to 1.3.0
16
index.js
@@ -69,3 +69,3 @@ 'use strict'; | ||
// Single file without multistamp | ||
if (files.length === 1 && options.multistamp == null) { | ||
if (files.length === 1 && options.multistamp == null && options.getMeta == null) { | ||
const fileObjKeys = Object.keys(files[0]) | ||
@@ -110,3 +110,15 @@ if (fileObjKeys.length === 1 && fileObjKeys[0] === 'file') { | ||
if (files.length === 1 && options.multistamp != null) { | ||
if (files.length === 1 && options.getMeta == true) { | ||
args.push('dump_data'); | ||
const childPromise = (isWindows && options.libPath !== 'pdftk') | ||
? execFile(options.libPath, args) | ||
: exec(`${options.libPath} ${args.join(' ')}`); | ||
childPromise | ||
.then((meta) => { | ||
return meta; | ||
}) | ||
.then(resolve) | ||
.catch(reject); | ||
return; | ||
} else if (files.length === 1 && options.multistamp != null) { | ||
args.push('multistamp', options.multistamp, 'output', tmpFilePath); | ||
@@ -113,0 +125,0 @@ } else { |
@@ -6,3 +6,3 @@ { | ||
"name": "pdf-merge-multistamp", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"description": "Merge PDF files into a single PDF document, with multistamp supported", | ||
@@ -12,3 +12,3 @@ "main": "index.js", | ||
"type": "git", | ||
"url": "https://github.com/louie007/pdf-merge-multistamp.git" | ||
"url": "https://github.com/louis007/pdf-merge-multistamp.git" | ||
}, | ||
@@ -21,8 +21,8 @@ "keywords": [ | ||
], | ||
"author": "wubzz, louie007", | ||
"author": "wubzz, louis007", | ||
"license": "ISC", | ||
"bugs": { | ||
"url": "https://github.com/louie007/pdf-merge-multistamp/issues" | ||
"url": "https://github.com/louis007/pdf-merge-multistamp/issues" | ||
}, | ||
"homepage": "https://github.com/louie007/pdf-merge-multistamp", | ||
"homepage": "https://github.com/wubzz/pdf-merge-multistamp", | ||
"scripts": { | ||
@@ -29,0 +29,0 @@ "test": "mocha test --exit" |
@@ -34,2 +34,3 @@ # PDFMerge | ||
* `multistamp` Should only be provided if multistamp is used *Optional!* | ||
* `getMeta` Should only be provided to get single file meta *Optional!* | ||
* `execOptions` This is an optional string where you can pass additional argument to **pdftk**, for | ||
@@ -61,3 +62,3 @@ example **compress**. For the complete list see the docu of the **pdftk** | ||
### Examples 1 | ||
### Examples 2 | ||
```javascript | ||
@@ -74,1 +75,14 @@ const PDFMerge = require('pdf-merge'); | ||
``` | ||
### Examples 2 | ||
```javascript | ||
const PDFMerge = require('pdf-merge'); | ||
const files = [ | ||
`${__dirname}/1.pdf` | ||
]; | ||
//Applies each page of the stamp PDF to the corresponding page of the input PDF | ||
PDFMerge(files, {getMeta: true}) | ||
.then((meta) => {...}); | ||
``` |
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
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
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
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
38210
301
86