Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove .page-number from the saved filename #192

Open
batchor opened this issue Nov 4, 2023 · 2 comments
Open

Remove .page-number from the saved filename #192

batchor opened this issue Nov 4, 2023 · 2 comments

Comments

@batchor
Copy link

batchor commented Nov 4, 2023

Remove the .page-number from the resulting image filename and let user fully control the output filename via saveFilename.

@mskec
Copy link
Collaborator

mskec commented Nov 4, 2023

Hi @batchfy-bot, removing the page number might work for 1-page PDFs.
We can consider it, but that would be breaking change and would have to wait for the next major release.

How do you propose we name multi-page PDFs in .bulk conversion?

You can always convert to buffer and save file with fs.

const convert = fromPath("./test/data/pdf1.pdf")
const pagePng = await convert(2, { responseType: "buffer" })
await fs.writeFile('./page.png', pagePng.buffer)

@batchor
Copy link
Author

batchor commented Nov 4, 2023

@mskec I mean we can optionally let the user to fully control the resulting image filename. I understand that a page number is necessary for bulk mode.

In my case, I'm creating a snapshot (first page only) of a pdf file. In my particular case, I only need one single outcome: pdf-file-name-snapshot.jpg without the page number.

Anyway, I think the buffer to file is a good solution. Thank you!

@github-project-automation github-project-automation bot moved this to To do in v4 Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: To do
Development

No branches or pull requests

2 participants