Images to PDF Converter: Combine JPG & PNG into One PDF
Convert images to PDF in your browser with jsPDF. Each JPG, PNG, GIF, or WebP gets its own A4 page locally. Nothing uploaded.
Upload local JPG, PNG, GIF, or WebP files, reorder them with Up and Down buttons, then click Generate PDF. The page uses jsPDF to write one image per A4 portrait page, scaled to fit within 10 mm margins while keeping aspect ratio, and centered. Output file is images.pdf. This tool does not merge existing PDFs, put several photos on one page, or run OCR. For the complete guide, see How to Convert JPG & PNG Images to PDF. Nothing is uploaded.
No images uploaded
How it works
- Upload images — Click the button and select one or more image files (JPG, PNG, GIF, WebP). Each image is read locally and shown as a preview. Nothing is sent to any server.
- Reorder as needed — Use the Up/Down buttons to arrange images in the order you want them in the PDF. Remove any images you don't need.
- Generate PDF — Click the button to create the PDF. Each image gets its own A4 page, scaled to fit within margins while maintaining aspect ratio, and centered.
- Download — The PDF file
images.pdfdownloads automatically to your device.
Images to PDF in Node
Generate PDF on this page is jsPDF 2.5 (new jsPDF() defaults to A4 portrait in millimeters). Node can run that same constructor. There is no POSIX images-to-PDF converter, and CPython has no stdlib writer — Pillow, ReportLab, and the PyPI img2pdf module are other libraries, not this page. img2pdf CLI samples are in Images to PDF in the shell below. For the browser walkthrough, see How to Convert JPG & PNG Images to PDF.
Node.js with jsPDF 2.5
Confirmed here with jsPDF 2.5.2. pageSize.getWidth() / getHeight() are 210 mm × 297 mm. This page then loads a FileReader data URL into new Image() to read pixel size. Node has no HTML Image — pass the bytes and the pixel size yourself. The snippet uses the same fit (keep aspect inside a 10 mm margin) and center math, then addImage and save('images.pdf'):
const { jsPDF } = require('jspdf');
const fs = require('fs');
const pdf = new jsPDF(); // A4 portrait, mm
const bytes = new Uint8Array(fs.readFileSync('photo.jpg'));
const imgWidth = 200; // JPEG pixel size
const imgHeight = 100;
const pdfWidth = pdf.internal.pageSize.getWidth();
const pdfHeight = pdf.internal.pageSize.getHeight();
const imgRatio = imgWidth / imgHeight;
const pageRatio = pdfWidth / pdfHeight;
let width;
let height;
if (imgRatio > pageRatio) {
width = pdfWidth - 20;
height = width / imgRatio;
} else {
height = pdfHeight - 20;
width = height * imgRatio;
}
const x = (pdfWidth - width) / 2;
const y = (pdfHeight - height) / 2;
// 200×100 landscape → 190×95 mm at (10, 101)
pdf.addImage(bytes, 'JPEG', x, y, width, height);
pdf.save('images.pdf');A second image needs pdf.addPage() before the next addImage, the same as this page. jsPDF sniffs JPEG vs PNG from the bytes or data URL: a JPEG stays DCTDecode; a PNG stays FlateDecode even when the format argument is JPEG(this page always passes that string). GIF and WebP become DCTDecode in jsPDF 2.5. An empty document still writes a one-page A4 PDF; this page does not call Generate PDF with zero images. save in Node writes images.pdf in the working directory. This is not a collage, not landscape, and not OCR. Stamping a drawn signature belongs on the PDF signer.
Images to PDF in the shell
There is no POSIX images-to-PDF converter. img2pdf 0.5.1 (Debian img2pdf / python3-img2pdf) writes one page per raster image. Default page size is the image at 96 DPI when the file has no DPI tag — a 200×100 JPEG becomes 150×75 pt, not A4. That is a different layout from Generate PDF. img2pdf is not POSIX. For the jsPDF snippet, see Images to PDF in Node above.
img2pdf (Linux / pip)
Confirmed here with img2pdf 0.5.1. --pagesize A4 plus --border 10mm keeps aspect ratio inside a 10 mm margin on A4 portrait — the same fit Generate PDF uses on a 200×100 landscape JPEG (190×95 mm, centered). JPEG bytes stay DCTDecode(no re-encode). Write with -o; stdout is the default:
# Closest to this page (A4, 10 mm margin, keep aspect) img2pdf --pagesize A4 --border 10mm photo.jpg -o images.pdf # Default: page equals the image at 96 DPI (not A4) img2pdf photo.jpg -o images.pdf # 200×100 JPEG → MediaBox 150×75 pt # One page per file, each page still image-sized img2pdf photo.jpg portrait.jpg -o images.pdf
--pagesize A4 without a border fills the page width (a 2:1 JPEG touches the left and right edges). --border 10mm without --pagesize grows that 96 DPI page by 10 mm on each side — still not A4. PNG stays FlateDecode. GIF and WebP are accepted through PIL and stored as FlateDecode; jsPDF 2.5 writes those as DCTDecode. Empty stdin exits 1. A missing file exits 2. ImageMagick convert rasterizes and is a different converter — not cloned as a second card. img2pdf does not merge existing PDFs and does not run OCR. A page-1 visual stamp belongs on the PDF signer. The complete browser guide is How to Convert JPG & PNG Images to PDF.
FAQ
- Does this tool upload my images?
- No. Upload images, Up, Down, Remove, Generate PDF, and Clear run in your browser with jsPDF. The page does not send the images or the PDF to a server.
- What file does Generate PDF create?
- The tool creates images.pdf. Each image gets its own A4 page, scaled to fit within 10 mm margins while keeping aspect ratio, and centered. This page does not merge existing PDFs, put several photos on one page, or run OCR. For PDF signing, see /pdf-signer/.
- How do I change the page order?
- Each image preview has Up, Down, and Remove buttons. Up swaps the image with the one above it; Down swaps with the one below. Pages export in the order shown, first to last. There is no drag-and-drop.
- Can I change the page size or put several photos on one page?
- No. Portrait A4 only. One image per page. There is no collage layout, no landscape page, and no page-size control.
- Does this merge existing PDFs or run OCR?
- No. The picker accepts JPG, PNG, GIF, or WebP. There is no PDF upload and no OCR.