How to use it
- Drop your images onto the box or choose them. Thumbnails show the page order with the page number.
- Pick a page size, orientation and margin. “Auto” turns each page to match its image; “Fit to image” removes the white border entirely.
- Drag the thumbnails to reorder, or use the arrows. Remove any image with the ✕ button.
- Press “Create PDF” and download the file. The file name is taken from the first image.
Example
A 4000 × 3000 px photo on portrait A4 with 10 mm margins: the printable area is 190 × 277 mm, so the picture is scaled to 190 × 142.5 mm (538.6 × 403.9 pt) and centred, leaving equal white space above and below. With “Auto” orientation the same photo gets a landscape page and fills 253 × 190 mm instead. With “Fit to image” and no margin the page itself becomes 3000 × 2250 pt (4000 px at 96 px/in).
How the pages are built
Each image is placed on its own page with pdf-lib. The scale is the largest that fits the printable area, never enlarging beyond the page:
scale = min((pageW − 2·margin) / imgW, (pageH − 2·margin) / imgH)A4 is 595.28 × 841.89 pt, Letter 612 × 792 pt (1 pt = 1/72 in, 1 mm = 2.835 pt). For “fit to image” the page is the image size at 96 pixels per inch (0.75 pt per pixel) plus margins. JPEGs go in via embedJpg, PNGs via embedPng; the EXIF Orientation tag of a JPEG is read from the file header and the image is drawn rotated by 90°, 180° or 270° so it appears upright without re-encoding. Mirrored orientations and formats pdf-lib cannot embed (WebP, GIF, BMP, AVIF, some 16-bit PNGs, CMYK JPEGs) are drawn on a canvas and stored as PNG.
Limits
- Transparent PNGs keep their transparency; transparent WebP/GIF become PNG with transparency too.
- Animated GIF/WebP contribute their first frame only.
- Images above 16 megapixels that need the canvas path are downscaled to that size; JPEG/PNG embedding has no such limit.
- Very large batches are bounded by browser memory; a few hundred phone photos is normally fine on a desktop.
Sources: pdf-lib – embedJpg / embedPng, ISO 216 paper sizes, EXIF 2.32 – Orientation tag.
Questions
- Does converting JPG to PDF reduce the image quality?
- No. JPEG files are embedded byte for byte, so the PDF shows exactly the same pixels. Only formats the PDF standard cannot hold directly (WebP, GIF, BMP, AVIF) are re-encoded, and that is done losslessly as PNG.
- Why is my PDF so large?
- Because the images are not recompressed. A PDF made from ten 4 MB photos is about 40 MB. Run it through the PDF Compressor afterwards, or resize the photos first, if you need a smaller file.
- Can I make the page exactly the size of the picture?
- Yes – choose "Fit to each image". The page then has no white border and its size equals the image at 96 pixels per inch.
- Can I add pages to an existing PDF?
- Create the PDF from the images first, then combine it with the existing document in the PDF Merger.