Making one PDF from photos, under a form's size limit
How to combine photos into one PDF that fits an upload limit such as 200 KB, what that limit means in bytes, and how quality, pixels and page size trade against each other.
Last reviewed · 1,372 words
In short
- Choose the form's limit, not a guess. Under 200 KB here means 2,00,000 bytes or fewer, which passes a checker that counts 1,000 bytes to the KB and one that counts 1,024.
- Each photo becomes one page, in the order shown. Put the pages in order before you make the PDF, for example the front of a card before the back.
- Under a limit the tool balances JPEG quality against pixel size, keeping quality at 30% or more where it can, and shows both in the result so you can judge it.
- Many photos in a small limit cost quality. If the result looks blurred, choose a bigger limit or fewer photos rather than squeezing harder.
- Nothing is uploaded. The photos are read and compressed in your browser tab, which matters for ID cards and certificates.
Upload forms often ask for a single PDF that holds several pictures, such as both sides of an ID card, a few pages of a marksheet or a photo and a signature, and then refuse it if it is over a size like 100 KB or 200 KB. Phone photos are usually 2 to 5 MB each, so the job is really two jobs: putting the pictures on pages in the right order, and making the whole file small enough. This page explains how both are done, and what to check before you upload.
What the size limit means in bytes
A file's size is a count of bytes, and "KB" is counted two ways. Windows and many upload checks use 1,024 bytes to a KB; Android's file manager, macOS and a check written as "200000" use 1,000. A file of 2,01,000 bytes is under 200 KB by the first count and over it by the second.
So the limit is met under both readings at once. Under 200 KB means 2,00,000 bytes or fewer: that is 195.3 KB to a checker counting 1,024, and exactly 200 KB to one counting 1,000, so neither can call it too big. The same rule gives 1,00,000 bytes for 100 KB and 3,00,000 bytes for 300 KB. The result panel shows the exact number of bytes beside the size, so you can compare it with what the form says.
If a form gives a range, such as 50 KB to 200 KB, choose the upper limit here. A PDF of a few document photos rarely comes out below 50 KB, and if it ever did, the Increase PDF Size tool can raise it to a minimum without changing a page.
How the pictures are fitted under the limit
A PDF made from photos is almost entirely the photos. Each picture goes into the file as a JPEG, unchanged, and the pages, their order and the index around them add only a few kilobytes. That makes the size controllable by two levers: the JPEG quality, and the number of pixels.
The tool first shares the limit between the pictures in proportion to their pixel counts, so a full-page scan gets more room than a small photo beside it and both come out at about the same quality. For each picture it then finds the highest JPEG quality that fits its share, by halving the range of qualities a few times, the same way you would find a word in a dictionary. It starts with the picture at 1,800 pixels on its long side. If the quality that fits is below 30%, where JPEG's blocks start to smear small print, the picture is made a fifth smaller and tried again, because a slightly smaller picture at a decent quality reads better than a large one full of blocks.
It stops at 500 pixels on the long side, because below that a page of text stops being readable. If even that does not reach 30%, it keeps the best result it found, and the result panel warns you to check it.
When every picture fits, the finished PDF is measured. If the small overhead of the PDF itself pushed it over the limit, the budget is reduced by the overshoot and the pictures are done again. The file you download has been measured, not estimated.
Choosing a limit, and how many photos fit
The tighter the limit and the more photos, the smaller and more compressed each photo becomes. In our tests with 12-megapixel phone photos of a printed page, each about 2.9 MB as the camera saved it:
| Limit | Photos | Long side of each picture in the PDF | JPEG quality |
|---|---|---|---|
| Under 100 KB | 1 | 922 px | 37% |
| Under 100 KB | 2 | 590 px | 38% |
| Under 200 KB | 3 | 738 px | 33% |
| Under 300 KB | 6 | 590 px | 40% |
| Under 500 KB | 10 | 590 px | 40% |
Your photos will differ: a plain white form compresses far better than a busy certificate with a coloured border or a photo taken in dim light, whose grain costs bytes. The result panel shows the pixel size and quality of your own PDF. When pictures had to go below 800 pixels or 35% quality it says so, and you should open the PDF and zoom in on the smallest text before uploading.
With no limit, each picture keeps a quality of 90% and up to 2,480 pixels on its long side, which is an A4 page at 300 DPI, enough to print sharply. Larger photos are scaled down to that, so a 12-megapixel phone photo does not make a 5 MB page.
Page size, orientation and margins
A4 is 210 × 297 mm, the paper size used for almost every Indian form and certificate, and the default here. Letter is the North American size. Same as the picture makes each page exactly the shape of its photo, drawn at 150 DPI, so a 1,240-pixel-wide picture makes a page 21 cm wide.
Orientation set to "Match each picture" turns each page to suit its photo: a landscape photo of a two-page spread gets a landscape page instead of being drawn small in the middle of a portrait one. Choose Portrait or Landscape to force every page the same way.
Margin leaves a white border round each picture. Small is about 6 mm, Normal 12.7 mm (half an inch), and None puts the picture edge to edge. The picture is always scaled to fit inside the margin with its proportions kept and centred, so nothing is cropped or stretched.
Putting the pages in order
Pages follow the list. Choose several photos at once and they are added in the order your device gives them, which is usually by name; add more later and they go at the end. The arrows move a picture up or down one place, and the cross removes it.
Check the order before you make the PDF. A form that asks for "front and back" expects the front first, and a marksheet is easier to verify when its pages run in sequence. Up to 60 pictures can go into one PDF.
Photos the browser cannot open
JPG, PNG and WebP pictures all work. iPhone photos saved as HEIC open only in browsers that support that format, and most do not. On the iPhone, share the photo as JPEG, or set Camera, Formats to Most Compatible so new photos are saved as JPEG, and add it again.
A PNG with a transparent background is laid on white, which is how it would print. Pictures larger than 30 MB are refused: no phone photo is that large, so such a file is usually a scan saved at a very high resolution, and it is better reduced first.
What happens to your photos
Everything happens inside the browser tab. The photos are read from your device, drawn on a canvas, encoded as JPEG by the browser's own encoder, and placed on PDF pages with pdf-lib, an open-source PDF library that runs in the page. No photo is sent to a server, because this page has no server to send it to.
Only one picture is held at full size at a time, and its memory is released before the next is read. That keeps a phone from running out of memory with twenty photos, at the cost of a little time; making a PDF from many large photos under a tight limit can take several seconds on an older phone, and the progress bar shows how far it has got.
What this tool assumes
- The limit is a maximum. The PDF is made as large as the limit allows at the best quality that fits, not as small as possible.
- Each picture becomes exactly one page. To put two photos on one page, such as a photo and a signature, join them first with the Merge Photo and Signature tool.
- The text in your photos is not made searchable. The PDF holds pictures of pages, as a scan does.
- Whether a portal accepts the file is decided by its own rules on size, type, page count and content. Check those on the portal before you upload.
Sources
- ISO 32000-2:2020 — Portable document format, Part 2 (PDF 2.0)
- pdf-lib — the library that builds the PDF in the browser
- MDN — HTMLCanvasElement.toBlob(), the browser's JPEG encoder and its quality setting
- ISO 216 — the A series of paper sizes, including A4 at 210 × 297 mm
- Mozilla — PDF.js, used in our tests to re-open every PDF the tool makes