Images to PDF
Convert photos and images (PNG, JPG, WebP, GIF, BMP, SVG) into a single PDF document with page size, orientation, and margin controls.
The link keeps what is on screen.
Selected imagesDrop images (PNG, JPG, WebP, GIF, BMP, SVG) or click to add
How is it calculated?
PNG and JPEG images are embedded directly as PDF XObjects via pdf-lib. Other browser-supported formats (WebP, GIF, BMP, SVG) are converted locally on an offscreen <canvas> before building the document. Pages are sized in typographic points (1 pt = 1/72 in).
See the code ↗Processed in your browser; nothing is sent.
⌨️ Use from the terminal (PDF)
This tool also runs outside the site: the cli.js script renders the invoice PDF in the terminal, from the same JSON as this page's share link. Use format=json to get just the data and totals.
Deno
deno run -q "https://thecodecodex.com/cli.js?tool=image-to-pdf" > image-to-pdf.pdf
Node.js / Bun
curl -s https://thecodecodex.com/cli.js | node --input-type=module - image-to-pdf > image-to-pdf.pdf size=…
| Parameter | Description | Default |
|---|---|---|
| size | a4 | letter | legal | fit | a4 |
| orient | auto | portrait | landscape | auto |
| fit | contain | cover | stretch | contain |
| margin | margem em pt (0-144) | 24 |
| bg | white | black | transparent | white |
| title | título do PDF | — |
| author | autor do PDF | — |
| in | imagens PNG/JPEG em Base64 separadas por vírgula (vazio = imagens de exemplo) | exemplo |
| format | pdf | json |
Requires Deno, Node.js or Bun. With Deno the script runs with no permissions: it cannot read files or access the network. Central Bank indicators are from the day the site was published.