How can I convert a series of images to a PDF from the command line on linux?

ImageBashPdf

Image Problem Overview


I have a scanning server I wrote in cgi/bash and want to be able to convert a bunch of images (all in one folder) to a pdf from the command line. How can that be done?

Image Solutions


Solution 1 - Image

Using imagemagick, you can try:

convert page.png page.pdf

Or for multiple images:

convert page*.png mydoc.pdf

Solution 2 - Image

Use convert from http://www.imagemagick.org. (Readily supplied as a package in most Linux distributions.)

10 years later...

Agreed with Robert and others here. Use something like img2pdf instead.

Usage:

img2pdf img1.png img2.jpg -o out.pdf

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJakob WeisblatView Question on Stackoverflow
Solution 1 - ImageMarvin PintoView Answer on Stackoverflow
Solution 2 - ImageziesemerView Answer on Stackoverflow