PNG to PDF
Published Updated
Place PNG images on A4, US Letter or image-sized pages, with your choice of margins, page order and rotation.
The three page sizes
Screenshots and scans rarely match a paper size, so this tool scales each image to fit the page and centres it, keeping its proportions. The page size choice decides what that page is:
| Page size | Page in points | What happens to the image |
|---|---|---|
| A4 (default) | 595.28 x 841.89 | Scaled up or down to fill the area inside the margins |
| US Letter | 612 x 792 | Same, on a Letter page |
| Fit to Image | image pixels + 2 x margin | Kept at one point per pixel; the page wraps the image |
Worked examples on A4 with Small margins
Scale factor = the smaller of (space across / image width) and (space down / image height). Effective print resolution is the image width in pixels divided by its printed width in inches.
| Image | Page direction (Auto) | Printed size | Pixels per inch |
|---|---|---|---|
| Phone screenshot 1,170 x 2,532 | Portrait | 5.2 x 11.2 in | about 226 |
| Desktop screenshot 1,920 x 1,080 | Landscape | 11.2 x 6.3 in | about 172 |
| A4 scan at 300 DPI, 2,480 x 3,508 | Portrait | 7.8 x 11.0 in | about 319 |
| Logo 300 x 200 | Landscape | 11.2 x 7.5 in | about 27 |
Anything under about 150 pixels per inch can look soft on paper. For small graphics, Fit to Image avoids the stretch.
What ends up in the PDF for each kind of PNG
We ran the site's own PNG to PDF component in Google Chrome 156, Chromium 153 (Playwright build, not Google Chrome), Firefox 155 and Playwright's WebKit build (not the Safari app) with generated PNGs (Pillow 11.3.0, one 16-bit file written by hand), converted each one alone with the default settings, and read the image back from the PDF with pdf-lib 1.17.1, comparing its pixels with the PNG decoded by @pdf-lib/upng, the decoder the tool's PDF library uses. Every engine stored the same image; file sizes differed by at most one byte between engines (Firefox 155 figures):
| PNG | PNG size | PDF size | What the PDF holds |
|---|---|---|---|
| Phone screenshot, 1,170 x 2,532, RGB | 16,076 bytes | 17,128 bytes | An 8-bit RGB image with the same pixels |
| A4 scan at 300 DPI, 2,480 x 3,508, greyscale | 18,745 bytes | 37,798 bytes | The same grey values stored as RGB, which doubled the size here |
| Logo, 300 x 200, with a transparent background | 1,207 bytes | 3,019 bytes | RGB plus a separate transparency mask (soft mask) with the same alpha values |
| 64-colour palette image, 800 x 600 | 1,339 bytes | 5,009 bytes | The colours written out as full RGB |
| 16-bit RGB gradient, 320 x 240 | 389,404 bytes | 216,518 bytes | An 8-bit image: the extra precision is dropped |
| Animated PNG, two frames | 1,777 bytes | None | Conversion failed. Please make sure all files are valid PNG images. |
| A JPEG file renamed to .png | 45,292 bytes | None | The same Conversion failed message |
Transparent areas showed the white page in pdf.js 5.4.624: a transparent corner of the logo rendered as 255, 255, 255 and the half-transparent blue bar as a light blue blend (142, 157, 237 in three engines, 143, 158, 238 in Firefox 155). Choosing a PNG together with a JPEG added only the PNG, with no message about the JPEG; choosing only the JPEG gave Please choose PNG images. Pressing the rotate button of the animated PNG let it convert, as one still page made from its first frame, because the rotated copy is drawn on a canvas.
Page size, direction and margins, measured
Page sizes and the drawn image box come from the PDFs the tool made in the same runs, in points (1/72 inch); the values were identical in Chrome 156, Chromium 153, Firefox 155 and the WebKit build:
| Image and settings | Page | Image drawn at |
|---|---|---|
| Desktop screenshot 1,920 x 1,080, A4, Auto, Small | 841.89 x 595.28 (landscape) | 805.89 x 453.31 |
| The same, A4, Portrait, Small | 595.28 x 841.89 | 559.28 x 314.6, about 37% of the page height |
| The same, US Letter, Auto, Big | 792 x 612 | 684 x 384.75 |
| The same, Fit to Image, None | 1,920 x 1,080 (26.7 x 15 inches) | 1,920 x 1,080 |
| Phone screenshot 1,170 x 2,532, A4, Landscape, Small | 841.89 x 595.28 | 258.44 x 559.28, a narrow strip in the middle |
| The same, Fit to Image, Small | 1,206 x 2,568 (16.75 x 35.67 inches) | 1,170 x 2,532 |
Fit to Image keeps one point per pixel, so a phone screenshot becomes a page almost three feet tall. Margins add 18 points (Small) or 54 points (Big) on every side, also in Fit to Image.
Rotating a page: what the canvas does to the pixels
Pixels of the rotated image in the PDF compared with the PNG turned in code, for a 256 x 256 test image in three versions and the 16-bit gradient, pressing the rotate button once, twice and three times (one run each in Chrome 156, Chromium 153, Firefox 155 and the WebKit build):
| Test PNG | Chrome 156 | Chromium 153 | Firefox 155 | WebKit build |
|---|---|---|---|---|
| 256 x 256 colour ramp, opaque, no colour profile | 0 | 0 | 0 | 0 |
| The same ramp with transparency from 0 to 255 | 53,130 changed, by up to 42 levels | 53,130, up to 42 | 64,103, up to 254 | 53,115, up to 42 |
| The same ramp tagged with the Display P3 colour profile | 65,480 changed, by up to 118 levels | 65,480, up to 118 | 0 | 65,482, up to 118 |
| 16-bit RGB gradient, 320 x 240 | 0 | 0 | 45,669, by 1 level | 60,039 to 60,491, up to 2 |
| 64-colour palette image, 800 x 600 | 0 | 0 | 0 | 0 |
Each cell counts pixels whose stored colour differs from the PNG turned in code (out of 65,536, or 76,800 and 480,000 for the last two files); the counts were the same for 90, 180 and 270 degrees except the 16-bit file in the WebKit build. For the half-transparent ramp only pixels that are not fully transparent are counted, and its transparency mask matched in every engine. Those colour changes come from the canvas, which works with colours multiplied by their opacity: the HTML standard's canvas section speaks of "the lossy nature of converting ... to and from premultiplied alpha color values". How much of this shows on a white page was not measured. The Display P3 ramp was converted to plain RGB by the canvas in three engines but not in Firefox 155, while a page that is not rotated keeps the PNG's own numbers in every engine; the 16-bit file differed by one or two levels where an engine reduces 16-bit values to 8 bits differently from the PDF library.
Several files at once: the page order
When several PNGs are chosen at once, the pages follow the order in which they were chosen. In our test a 2,600 x 2,600 PNG of noise (about 17 MB, the slowest to read) chosen before a 64 x 64 and a 900 x 900 PNG stayed first in the list and in the PDF in all four engines. Twenty 1,600 x 1,200 screenshot-like pages (208,794 bytes of PNG) became a PDF of 221,203 to 221,204 bytes in 2,299 ms in Chrome 156, 2,022 ms in Chromium 153, 2,576 ms in Firefox 155 and 1,728 ms in the WebKit build. Images added later with Add More Images go after the pages already in the list, and the arrows move a page up or down (dragging was not tested).
Building the PDF
Step 1
Add PNG files
Files that are not PNG are left out, and if none of the chosen files is a PNG the page says so. Each PNG becomes one page, in the order you chose them, and you can add more at any time.
Step 2
Arrange pages and choose the layout
Use the arrows or drag to reorder, rotate any page in 90 degree steps, then pick page size, orientation and margins.
Step 3
Convert
The images are scaled to fit the page and centred, and the result downloads as images-to-pdf.pdf.
Order, rotation and what stays sharp
Pages can be moved with the up and down arrows or by dragging, and each one has its own rotate button. Rotating a page draws it again, turned, onto a canvas and stores the result as a new PNG. For ordinary 8-bit PNGs without transparency or a colour profile, the pixels stored in the PDF matched the original in our tests, rotated or not, so text in screenshots stays as crisp as the original pixels allow. The exceptions, measured below, are 16-bit PNGs, half-transparent pixels and colour profiles.
For JPG photos use JPG to PDF, and to add PNG pages to an existing document use PDF Merge. If the result is too large to send, Compress PDF to Size can bring it under a limit.
PNG to PDF questions
Does PNG transparency survive?
Yes. The PNG is embedded with its alpha channel, so transparent areas show the white page underneath rather than a black box.
Why does my small logo look blurry in the PDF?
On A4 or US Letter every image is scaled to fill the space inside the margins, including small ones. A 300 x 200 pixel logo is stretched to about 11.2 inches wide, roughly 27 pixels per inch, which looks soft when printed. Pick Fit to Image to keep it at its own size.
What do Auto, Portrait and Landscape do?
They set the page direction for A4 and US Letter. Auto makes a page landscape when the image is wider than it is tall, page by page, so one PDF can mix both. Fit to Image ignores this setting.
How wide are the margins?
None is 0, Small is 18 points (a quarter inch, about 6 mm) and Big is 54 points (three quarters of an inch, about 19 mm). Small is the default.
Does rotating a page reduce quality?
Not for ordinary PNGs: in our tests an opaque 8-bit PNG and a palette PNG turned 90, 180 or 270 degrees kept every pixel in all four engines we ran. Two kinds can change, because the turned copy is drawn on a canvas and saved as a new PNG: half-transparent pixels changed colour slightly (their transparency did not), and a PNG with a colour profile was converted to plain RGB in Chrome 156, Chromium 153 and the WebKit build. Pages you do not rotate are stored from the PNG's own pixel values.
Can I add JPG files?
No, this tool filters out anything that is not a PNG. JPG to PDF takes JPG and PNG files together, but every page then takes the size of its image.
Why is the PDF bigger than my PNG files?
The PDF library stores every image as full RGB. A greyscale A4 scan went from 18,745 bytes as PNG to 37,798 bytes as PDF, and a 64-colour palette image from 1,339 to 5,009 bytes, because each pixel is written out in three colour channels. Ordinary RGB screenshots grew only a little (16,076 to 17,128 bytes), and a 16-bit PNG shrank because it was stored with 8 bits per channel.
Can I convert an animated PNG?
Not as it is: a two-frame animated PNG gave Conversion failed. Please make sure all files are valid PNG images. in all four engines. After pressing that page's rotate button it converted, as one still page from the first frame, turned 90 degrees.
Are the pages in the order I selected the files?
Yes. Three PNGs chosen as large, tiny, medium stayed in that order in the list and in the PDF in Chrome 156, Chromium 153, Firefox 155 and the WebKit build, although the large one took longest to read. Pages can then be moved with the arrows.
Does a colour profile in the PNG carry over?
No. The PDF image is plain RGB without the profile. A PNG tagged with the Display P3 profile was stored with its original numbers when not rotated, and with numbers converted to plain RGB by the browser when rotated in Chrome 156, Chromium 153 and the WebKit build, so the same image can look slightly different on a rotated page. Firefox 155 did not convert it.