What the JPG to PDF does
JPG to PDF accepts one or more JPG, PNG or WebP files and produces a single PDF named images.pdf with one page per image. Each page is A4: 595 by 842 points for an upright image, 842 by 595 points when the image is wider than it is tall. The image is scaled to fit inside a 24-point margin on every side, keeps its proportions, and is centred.
JPEG and PNG files are embedded directly with pdf-lib, which means the pixel data in the PDF is the same data that was in the file. Nothing is recompressed, so a sharp 12-megapixel photo stays a sharp 12-megapixel photo; only its displayed size on the page is set. WebP is handled differently, because pdf-lib has no WebP decoder: the browser draws it to a canvas and the result is embedded as PNG.
Pages follow the order in which your file dialog returned the files, listed by name under the drop area before you convert. There is no reordering on the page; selecting again adds to the end of the list, and each entry has a remove button. Numbering file names before you start is the dependable way to control the sequence.
How to use it
Choose your images
Select one or many JPG, PNG or WebP files in one go. Their names appear in the order they will become pages.
Create the PDF
Press Convert. Each image is embedded, a portrait or landscape A4 page is added for it, and the image is placed in the centre.
Save images.pdf
The page reports how many pages images.pdf contains and offers it in a result card; press Download to save it. Rename the file if you need something more descriptive.
How each image is fitted to the page
The tool compares the image's pixel width and height. Wider than tall means a landscape page of 842 by 595 points; otherwise, including square images, a portrait page of 595 by 842 points. It then finds the largest scale at which the image fits inside the page minus 48 points in each direction, applies it to both dimensions, and places the image so the margins are equal.
Fitting works in both directions. A large photo is shrunk to fit; a small image, such as a 200-pixel icon, is enlarged to fill the available width or height. Enlarging does not add detail, so small images will look soft or blocky when the page is printed. The pixels are not changed either way; the PDF simply states how large to draw them.
What the output looks like and what changes
Every image lands on a white A4 page with even margins; there are no captions, no file names and no cropping. A PNG with transparency keeps its alpha channel in the PDF, so transparent areas show the white page behind them. The PDF is saved with object streams, and its size is close to the sum of the embedded images, since JPEG and PNG data is stored as it was.
WebP files are the exception. Decoding them depends on your browser's WebP support, and the canvas step re-encodes them as PNG, which is lossless but usually larger than the WebP original. A page made from a WebP photo can therefore be several times the size of the source file. If size matters, convert the WebP to JPG first with the WebP to JPG tool and feed the JPG in.
Photos from phones and orientation
pdf-lib places the pixels as they are stored in the JPEG and does not read the EXIF orientation tag that cameras use to mark a photo as rotated. A phone photo that looks upright in your gallery only because of that tag can appear sideways in the PDF. If that happens, run the result through Rotate PDF and turn the affected pages by 90 or 270 degrees, which costs nothing in quality.
Limits to know before you rely on it
- Page size is fixed at A4 with 24-point margins; there are no letter, fit-to-image or custom sizes.
- No reordering, rotating or cropping on the page; the order comes from your file dialog.
- WebP input is re-encoded as PNG, which can make the PDF much larger than the WebP files were.
- EXIF orientation is ignored, so some phone photos come out sideways.
- Small images are enlarged to fill the page and will look soft when printed.
- Many large images at once can exceed browser memory; convert in batches if the tool fails.
Questions people ask about the JPG to PDF
Can I mix JPG, PNG and WebP in the same PDF?
Yes. Select them together and each becomes a page in the order listed. JPG and PNG are embedded directly; WebP goes through a canvas and is stored as PNG.
Does converting to PDF reduce the resolution of my photos?
No. For JPG and PNG the original bytes are embedded unchanged. The tool sets how large the image is drawn on the page, which is a display instruction, not a resample. Zoom in on the PDF and you will see the original pixels.
Why is my PDF much larger than my images?
Most likely the sources were WebP, which the tool re-encodes as lossless PNG before embedding. Convert those to JPG first if size matters. JPG and PNG inputs produce a PDF close to their combined size.
Why is a photo sideways in the PDF?
The JPEG stores its pixels sideways and relies on an EXIF orientation tag that pdf-lib does not read. Open images.pdf in Rotate PDF, select the affected pages and turn them by 90 or 270 degrees.
Can I choose a page size other than A4?
No. The tool always uses A4 at 595 by 842 points, switching to landscape for wide images. If a portal requires US Letter, create the PDF here and print it to Letter with scale-to-fit in your PDF viewer.
Is anything uploaded when I create the PDF?
No. pdf-lib runs inside the page, the images are read from your device into memory, and images.pdf is delivered through a temporary browser URL that is revoked shortly after the download begins.
Sources and further reading
- pdf-lib API reference for PDFDocument: embedJpg, embedPng and addPage, used to place each image
- pdf-lib API reference for PDFPage: drawImage with x, y, width and height, which centres the image
- MDN Web Docs: the Canvas API, the route WebP images take before being embedded as PNG
- MDN Web Docs image file type guide: how JPEG, PNG and WebP store pixels and where each is lossy or lossless