Skip to content

JPG to PDF: How to Combine Images into PDFs (Free Methods)

· 2 min read · Imagic AI Team

Combine JPG images into PDF documents for portfolios, reports, presentations - with and without code.

JPG to PDF: How to Combine Images into PDFs

Combine images into PDF documents. For portfolios, reports, presentations - here's how to do it.


Why Combine Images into PDF?

Common uses:

  • Photo albums and portfolios
  • Business reports with images
  • Presentations
  • Product catalogs
  • Document scanning
  • Archiving

Method 1: Online Tools (Fastest)

Imagic AI

Try Imagic AI

Upload images, reorder, download PDF. Free, no install.

iLovePDF

  1. Go to ilovepdf.com
  2. Select "JPG to PDF"
  3. Upload images
  4. Arrange order
  5. Create PDF

Method 2: Python (Best for Automation)

Install

pip install pillow

Combine Images to PDF

from PIL import Image
from pathlib import Path

def images_to_pdf(image_dir, output_pdf, order='name'):
    image_path = Path(image_dir)

    extensions = ('.jpg', '.jpeg', '.png', '.webp')
    images = [f for f in image_path.iterdir() 
              if f.suffix.lower() in extensions]

    if order == 'name':
        images.sort()

    print(f"Combining {len(images)} images...")

    pdf_images = []
    for img_file in images:
        img = Image.open(img_file)

        if img.mode != 'RGB':
            img = img.convert('RGB')

        pdf_images.append(img)

    if pdf_images:
        pdf_images[0].save(
            output_pdf,
            save_all=True,
            append_images=pdf_images[1:]
        )

        print(f"✓ PDF created: {output_pdf}")

images_to_pdf('./photos', 'album.pdf')

With Custom Page Size

from PIL import Image
from pathlib import Path

def images_to_pdf_a4(image_dir, output_pdf, page_size=(210, 297)):
    page_width, page_height = page_size
    dpi = 72
    px_width = int(page_width / 25.4 * dpi)
    px_height = int(page_height / 25.4 * dpi)

    image_path = Path(image_dir)
    images = [f for f in image_path.iterdir() if f.suffix.lower() in ('.jpg', '.png')]

    pdf_images = []
    for img_file in images:
        img = Image.open(img_file)

        img.thumbnail((px_width, px_height), Image.Resampling.LANCZOS)

        background = Image.new('RGB', (px_width, px_height), 'white')
        x = (px_width - img.width) // 2
        y = (px_height - img.height) // 2
        background.paste(img, (x, y))

        pdf_images.append(background)

    if pdf_images:
        pdf_images[0].save(output_pdf, save_all=True, append_images=pdf_images[1:])
        print(f"✓ A4 PDF created: {output_pdf}")

images_to_pdf_a4('./photos', 'album_a4.pdf')

Method 3: macOS Preview

  1. Select all images in Finder
  2. Right-click → Open with Preview
  3. Select all thumbnails (Cmd+A)
  4. Edit → Select All
  5. File → Export as PDF

Method 4: Windows Print to PDF

  1. Select images
  2. Right-click → Print
  3. Select "Microsoft Print to PDF"
  4. Multiple pages option
  5. Print

Summary

  1. Online tools for quick, one-time jobs
  2. Python scripts for automation
  3. macOS Preview for simple needs
  4. Windows Print for quick PDF creation

Tools

Tool Purpose
Imagic AI Quick PDF creation
iLovePDF Online PDF tools
Python Pillow Programmatic PDF creation

Created 500+ PDFs from images. Questions? Leave a comment.

Try these tools

Image Compressor

Related articles

Convert JPG to PDF: Free Methods and When You Actually Need ItConvert RAW to JPG: Complete Guide to Camera RAW File Conversion in 20HEIC to JPG Guide: What I Learned Converting 1000+ Photos