Skip to content
TrueScalers

Convert images to PDF

Converting images to PDF places each image on its own page in a new document. Page geometry is measured in PDF points, where 72 points equal one inch, so an A4 page is 595 × 842 points and US Letter is 612 × 792. JPEG images are embedded directly without re-encoding, so photo quality is preserved exactly.

Loading tool…

How to convert images to PDF

  1. 01

    Add your images

    Drag JPG, PNG or WebP files onto the drop zone. They are added to the PDF in the order shown in the list.

  2. 02

    Choose a page size

    Pick A4, US Letter, Legal or A3 for a uniform document, or choose "Fit each image" to size every page to its own image.

  3. 03

    Set a margin

    Enter a margin in points, where 72 points equal one inch. A 24-point margin is about a third of an inch on every side.

  4. 04

    Create and download

    Press Create PDF and download the result. Every image was embedded in this page without being uploaded anywhere.

The formula

scale = min((W − 2m) ÷ w, (H − 2m) ÷ h);   x = (W − w·scale) ÷ 2,  y = (H − h·scale) ÷ 2
W, H
Page width and height in PDF points — 595 × 842 for A4, 612 × 792 for US Letter.
w, h
The pixel dimensions of the image being placed.
m
The margin in points applied on every side of the page.
scale
The largest factor that fits the image inside the printable area without distortion.
x, y
The offsets that centre the scaled image on the page.

Because a single scale factor is applied to both dimensions, images are never stretched. Choosing "Fit each image" instead sets each page to the exact pixel dimensions of its image, which produces a PDF with pages of differing sizes but no margins and no scaling at all.

Worked example

Images
3 photographs, each 4032 × 3024 pixels
Page size
A4 — 595 × 842 points
Margin
24 points
Result
images.pdf — 3 pages, one photograph per page

The printable area is 595 − 48 = 547 points wide and 842 − 48 = 794 points tall. The scale factor is the smaller of 547 ÷ 4032 = 0.1357 and 794 ÷ 3024 = 0.2626, so 0.1357 governs. The drawn image is 4032 × 0.1357 = 547 points wide and 3024 × 0.1357 = 410 points tall. It is centred with an x offset of (595 − 547) ÷ 2 = 24 points and a y offset of (842 − 410) ÷ 2 = 216 points.

Frequently asked questions

How do you convert JPG images to a PDF?

Add the images, choose a page size, and press Create PDF. Each image is placed on its own page, scaled to fit inside the margins while preserving its aspect ratio, and centred. JPEG files are embedded byte-for-byte without re-encoding, so a photograph inside the resulting PDF is pixel-identical to the file that went in.

Does converting images to PDF reduce their quality?

JPEG images are embedded directly with no re-encoding, so no quality is lost at all. PNG images are also embedded losslessly. Other formats such as WebP, GIF and BMP have no native PDF representation and are re-encoded to JPEG at 92% quality first, which is visually lossless for photographs but is a genuine re-encode.

What is a PDF point and how does it relate to inches?

A PDF point is exactly 1/72 of an inch, inherited from typographic measurement. That makes A4 595 × 842 points, US Letter 612 × 792 points, and a one-inch margin exactly 72 points. Because points are physical rather than pixel units, a PDF prints at the same size regardless of the screen it was made on.

Should page size be A4, Letter, or fit-to-image?

Choose A4 or US Letter when the document will be printed or emailed, since a uniform page size is what recipients and printers expect — A4 outside North America, Letter within it. Choose fit-to-image for screen-only use such as an image archive or comic, where matching each page to its image avoids both margins and scaling.

Why is the resulting PDF larger than the images it contains?

A PDF adds structural overhead: a page tree, a cross-reference table, resource dictionaries and metadata. For a handful of large photographs this overhead is a fraction of a percent. It is only noticeable when embedding many very small images, where the per-page structure can rival the image data itself.

Are the images uploaded to make the PDF?

No. Images are read from local disk into browser memory and embedded into a document assembled by the pdf-lib library running as JavaScript in this page. The finished PDF is handed straight to the browser as a download. This site has no server-side code that could receive an image, so personal photographs never leave the device.

Sources

Last reviewed: · Formula and sources verified by Syed Aqeel Ahmad Gillani. See the methodology for how every calculation is derived.