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 sizePage in pointsWhat happens to the image
A4 (default)595.28 x 841.89Scaled up or down to fill the area inside the margins
US Letter612 x 792Same, on a Letter page
Fit to Imageimage pixels + 2 x marginKept 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.

ImagePage direction (Auto)Printed sizePixels per inch
Phone screenshot 1,170 x 2,532Portrait5.2 x 11.2 inabout 226
Desktop screenshot 1,920 x 1,080Landscape11.2 x 6.3 inabout 172
A4 scan at 300 DPI, 2,480 x 3,508Portrait7.8 x 11.0 inabout 319
Logo 300 x 200Landscape11.2 x 7.5 inabout 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):

PNGPNG sizePDF sizeWhat the PDF holds
Phone screenshot, 1,170 x 2,532, RGB16,076 bytes17,128 bytesAn 8-bit RGB image with the same pixels
A4 scan at 300 DPI, 2,480 x 3,508, greyscale18,745 bytes37,798 bytesThe same grey values stored as RGB, which doubled the size here
Logo, 300 x 200, with a transparent background1,207 bytes3,019 bytesRGB plus a separate transparency mask (soft mask) with the same alpha values
64-colour palette image, 800 x 6001,339 bytes5,009 bytesThe colours written out as full RGB
16-bit RGB gradient, 320 x 240389,404 bytes216,518 bytesAn 8-bit image: the extra precision is dropped
Animated PNG, two frames1,777 bytesNoneConversion failed. Please make sure all files are valid PNG images.
A JPEG file renamed to .png45,292 bytesNoneThe 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 settingsPageImage drawn at
Desktop screenshot 1,920 x 1,080, A4, Auto, Small841.89 x 595.28 (landscape)805.89 x 453.31
The same, A4, Portrait, Small595.28 x 841.89559.28 x 314.6, about 37% of the page height
The same, US Letter, Auto, Big792 x 612684 x 384.75
The same, Fit to Image, None1,920 x 1,080 (26.7 x 15 inches)1,920 x 1,080
Phone screenshot 1,170 x 2,532, A4, Landscape, Small841.89 x 595.28258.44 x 559.28, a narrow strip in the middle
The same, Fit to Image, Small1,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 PNGChrome 156Chromium 153Firefox 155WebKit build
256 x 256 colour ramp, opaque, no colour profile0000
The same ramp with transparency from 0 to 25553,130 changed, by up to 42 levels53,130, up to 4264,103, up to 25453,115, up to 42
The same ramp tagged with the Display P3 colour profile65,480 changed, by up to 118 levels65,480, up to 118065,482, up to 118
16-bit RGB gradient, 320 x 2400045,669, by 1 level60,039 to 60,491, up to 2
64-colour palette image, 800 x 6000000

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

  1. 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.

  2. 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.

  3. 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.

Related Tools