Convert an image to PDF, privately
Wrap a photo, scan, or screenshot into a single-page PDF sized exactly to the image — useful for emailing a receipt, archiving a document scan, attaching a photo to a form that requires PDF, or turning a screenshot into a printable file. Everything happens locally, so sensitive documents never leave your device.
How it works under the hood
The image is drawn onto a <canvas> and exported as JPEG bytes at your chosen
quality. Those bytes are then embedded as a DCTDecode image XObject inside a
minimal but fully spec-valid PDF structure built directly in JavaScript:
- Catalog object — required root of the PDF object tree
- Page object — sized in PDF points (1/72 inch) from pixel dimensions ÷ DPI
- Content stream — a single
Dooperator drawing the image at page coordinates - Image XObject — the raw JPEG bytes with the DCTDecode filter
The result opens correctly in every standard PDF reader. Because JPEG has no alpha channel, any transparent regions in the source image are flattened onto a white background.
DPI explained — choosing the right setting
DPI (dots per inch) sets how the pixel dimensions map to physical page size in the PDF. It does not add or remove detail; it only controls the printed size:
| Source image | DPI | Page width | Physical size |
|---|---|---|---|
| 1500 × 1000 px | 72 | 1500 pts | ≈ 20.8 × 13.9 in (screen) |
| 1500 × 1000 px | 150 | 720 pts | 10 × 6.67 in |
| 1500 × 1000 px | 300 | 360 pts | 5 × 3.33 in (print quality) |
72 DPI — a PDF page that matches the screen pixel size. Good for purely digital documents where printing is unlikely.
150 DPI — a reasonable middle ground: a comfortable reading size and adequate print quality for most everyday documents.
300 DPI — standard print resolution. The page size becomes smaller (because more dots are packed into each inch), producing a sharp, publication-quality print from a sufficiently large source image.
Common use cases
- Receipts and invoices: photograph the receipt, convert to PDF, attach to an expense form.
- ID and passport scans: convert a JPG photo of the document to PDF for submission to services that require PDF format. Because this tool runs locally, your ID is never sent anywhere.
- Screenshot-as-document: capture an on-screen form or confirmation, convert to PDF for your records.
- Photo archiving: consolidate individual photos into a named PDF — though for multi-page books, convert each image individually and merge them afterward using a PDF merge tool.
The PDF is assembled entirely in your browser and your file is never uploaded.