pdf2image
pdf2image copied to clipboard
Remove .page-number from the saved filename
Remove the .page-number
from the resulting image filename and let user fully control the output filename via saveFilename
.
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)
@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!