i want to learn how many pages will be converted with ImageMagick command.
convert -density 150 -quality 100 -resize 800x "new.pdf" "pdtoimg.jpg"
It returns 6 pages with name of pdtoimg-0.jpg to pdtoimg-5.jpg.
is there any way to learn how many pages are in a pdf, or can I make it write the converted page names to an array?
If I want to take folder size, I have to wait all processing has ended.
You could use
identify. This is also one of the ImageMagick commands.But for PDFs, this can be quite slow (because ImageMagick needs to use Ghostscript as a delegate for PDF processing, and Ghostscript needs to do a complete interpretation of the PDF before IM will be able to spit out the info you are interested in).
So much faster would be to use an external tool, which does not read in the complete PDF, but only evaluates its metadata object:
pdfinfois a tool available as part of the XPDF package or as part of the Poppler utilities (both available for Linux, Mac OS X and Windows).