Skip to content

fix(index): add minVersion to pdfAttach options#750

Open
Fdawgs wants to merge 1 commit intomainfrom
fix/index-attach
Open

fix(index): add minVersion to pdfAttach options#750
Fdawgs wants to merge 1 commit intomainfrom
fix/index-attach

Conversation

@Fdawgs
Copy link
Copy Markdown
Owner

@Fdawgs Fdawgs commented Feb 19, 2026

pdfattach binary was introduced with Poppler 0.75.0. See https://gitlab.freedesktop.org/poppler/poppler/-/blob/master/NEWS#L1475

Checklist

Copilot AI review requested due to automatic review settings February 19, 2026 15:38
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds minVersion: "0.75.0" to the printVersionInfo and replace options in the pdfAttach function configuration. According to the PR description, the pdfattach binary was introduced with Poppler version 0.75.0, so these options (and the entire binary) require at least this version.

Changes:

  • Added minVersion: "0.75.0" to printVersionInfo and replace options in the pdfAttach options object

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/index.js
Comment on lines +763 to +768
minVersion: "0.75.0",
},
replace: {
arg: "-replace",
type: "boolean",
minVersion: "0.75.0",
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding minVersion to these options is correct, but the pdfAttach function (line 1248-1254) doesn't retrieve the version before calling parseOptions(), which means the minVersion validation will never execute. The function should call this.#getVersion(this.#pdfAttachBin) before parsing options, similar to how other functions like pdfFonts, pdfImages, pdfToPpm, etc. handle this (see lines 1288-1289, 1307-1308 for examples). Without this version retrieval, users could attempt to use these options with older Poppler versions that don't support them, and the error won't be caught.

Suggested change
minVersion: "0.75.0",
},
replace: {
arg: "-replace",
type: "boolean",
minVersion: "0.75.0",
},
replace: {
arg: "-replace",
type: "boolean",

Copilot uses AI. Check for mistakes.
@Fdawgs Fdawgs force-pushed the fix/index-attach branch from 7de59e5 to 367df75 Compare March 11, 2026 12:09
@Fdawgs Fdawgs force-pushed the fix/index-attach branch from 367df75 to cd40607 Compare March 11, 2026 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants