🐧 Create a PDF from Multiple Images in Linux

πŸ”§ Step 1: Install img2pdf

Open the terminal and run:

  • sudo apt install img2pdf

πŸ“‚ Step 2: Go to Your Image Folder

Navigate to the folder containing your `.jpg` images:

  • cd /path/to/image-folder

πŸ“„ Create PDF β€” Random/Directory Order

To convert all JPG images into a PDF:

  • img2pdf *.jpg -o filename.pdf
  • img2pdf *.jpg -o images.pdf

πŸ”’ Create PDF β€” Name/Natural Order

If you want the images processed according to their filename/natural numeric order:

  • img2pdf $(ls -1v *.jpg) -o output.pdf

( For example: text
1.jpg
2.jpg
3.jpg
10.jpg
11.jpg

will be processed in the expected numeric order.

  • img2pdf *.jpg -o output.pdf

πŸš€ Quick Summary

Purpose Command

Install toolΒ  sudo apt install img2pdf
Convert JPGsΒ  img2pdf *.jpg -o output.pdf
Natural filename order img2pdf $(ls -1v *.jpg) -o output.pdf

Linux Tip:- No GUI required β€” create your PDF directly from the terminal! πŸ§πŸ’»