Skip to content

Commit 367df75

Browse files
committed
fix(index): add minVersion to pdfAttach options
1 parent 1378e0d commit 367df75

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

src/index.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -757,8 +757,16 @@ class Poppler {
757757
this.#acceptedOptions.set(
758758
"pdfAttach",
759759
freeze({
760-
printVersionInfo: { arg: "-v", type: "boolean" },
761-
replace: { arg: "-replace", type: "boolean" },
760+
printVersionInfo: {
761+
arg: "-v",
762+
type: "boolean",
763+
minVersion: "0.75.0",
764+
},
765+
replace: {
766+
arg: "-replace",
767+
type: "boolean",
768+
minVersion: "0.75.0",
769+
},
762770
})
763771
);
764772
break;
@@ -1240,7 +1248,8 @@ class Poppler {
12401248
async pdfAttach(file, fileToAttach, outputFile, options = {}, extras = {}) {
12411249
const { signal } = extras;
12421250
const acceptedOptions = this.#getAcceptedOptions("pdfAttach");
1243-
const args = parseOptions(acceptedOptions, options);
1251+
const versionInfo = await this.#getVersion(this.#pdfAttachBin);
1252+
const args = parseOptions(acceptedOptions, options, versionInfo);
12441253
args.push(file, fileToAttach, outputFile);
12451254

12461255
return execBinary(this.#pdfAttachBin, args, undefined, { signal });

0 commit comments

Comments
 (0)