Bash convert pdf to jpg
Get via App Store Read this post in our app!
Bash convert to pdf
How can I use both ls and convert to transform all images files in a directory to a pdf ? Also I need to put the files in a certain order for example files like AA1.png,AA11.png need to respect this logical order.
Update (ls) and (convert) are available , but how can I used them together ?
To convert to a single PDF can be done in a single command:
Remember to include the -compress jpeg flag, or it'll store the images uncompressed and result in a massive PDF.
ImageMagick (via convert) requires Ghostscript (gs) to be installed in order to process PDFs I believe. Beware of memory issues if you are adding a lot of JPEGs at once.
As for your logical ordering, you can use ls in combination with convert to get the list in order.
Something along the lines of:
See ls --help for the various sorting options available.