yakovmeister / pdf2image

A utility for converting pdf to image and base64 format.
MIT License
434 stars 141 forks source link

Error on processing more than 10 pages #183

Closed piyushk96 closed 1 year ago

piyushk96 commented 1 year ago

I'm trying to convert pdf with more than 10 pages to images but it is giving following error:

"Error: gm().stream() or gm().write() with a non-readable stream.",
"    at gm._spawn (/myproject/node_modules/gm/lib/command.js:275:19)",
"    at /myproject/node_modules/gm/lib/command.js:139:19",
"    at series (/myproject/node_modules/array-series/index.js:11:36)",
"    at gm._preprocess (/myproject/node_modules/gm/lib/command.js:176:5)",
"    at gm.stream (/myproject/node_modules/gm/lib/command.js:137:10)",
"    at /myproject/node_modules/pdf2pic/dist/index.js:1:1362",
"    at new Promise (<anonymous>)",
"    at a.toBuffer (/myproject/node_modules/pdf2pic/dist/index.js:1:1317)",
"    at o (/myproject/node_modules/pdf2pic/dist/index.js:1:3412)",
"    at /myproject/node_modules/pdf2pic/dist/index.js:1:3517",
"    at Array.map (<anonymous>)",
"    at m (/myproject/node_modules/pdf2pic/dist/index.js:1:3509)",
"    at /myproject/node_modules/pdf2pic/dist/index.js:1:3870",
"    at Generator.next (<anonymous>)",
"    at a (/myproject/node_modules/pdf2pic/dist/index.js:1:294)",
"    at processTicksAndRejections (node:internal/process/task_queues:96:5)"

Usage:

const pdfConvert = fromBuffer(buffer);
const imgArr = await pdfConvert.bulk(-1, { responseType: 'buffer' });
mskec commented 1 year ago

Hi @piyushk96, thank you for reporting it. The latest version (3.0.3) should have this fixed. Let me know if you still have problems with it.

piyushk96 commented 1 year ago

Thanks for the quick update 👍🏻. It's working now