Ilyes-El-Majouti / pdftopic

Built for Node.js, this package empowers users to effortlessly convert PDF files into images of exceptional quality, supporting multiple formats including PNG, JPG, GIF, and others. Its streamlined functionality ensures a smooth and reliable conversion process, providing users with the flexibility to obtain top-notch images from their PDF documents
Apache License 2.0
26 stars 6 forks source link

Too many magick processes #10

Open MykhailoMatiiasevychKlarna opened 3 months ago

MykhailoMatiiasevychKlarna commented 3 months ago

Hi

Tool works great for my use-case. Thanks!

Got a problem though. For big PDF documents this code

const promises = Array.from(Array.isArray(page) ? page : { length: pdfcount }, (_, index) => imagemagickconverter(pdf, Array.isArray(page) ? _ : index, progress ? bar : null));
return Promise.all(promises);

is pretty much killing my system by hundreds of magick processes.

Would be nice to use something like p-limit to make it possible to limit number of processes.

Ilyes-El-Majouti commented 3 months ago

hello,

thank you very much for your feedback, I will take your problems into account and will resolve them in a future update.

Ilyes