Friday, November 6, 2026 · Asia/KarachiFree tools · No signup · Runs in your browser

JPG to PDF

bars-32x16.jpg is a 32 by 16 JPEG. The page made from it is 32 points wide and 16 points tall, and the file is 1.2 KB. photo-400.jpg is 400 by 267. Put after the small one, the PDF has two pages, widths 32 then 400, and the file is 2.7 KB. pdf-lib embeds the JPEG bytes it was given. It does not decode them and encode them again, so a clean photo does not pick up a second generation of JPEG blocks.

New

Each JPEG becomes its own page at one point per pixel (72 pixels per inch). PNG and WebP are refused here. The JPEG is embedded, not recompressed.

How to use

  1. Embed bars-32x16.jpg when you want a 32 by 16 point page.
  2. Add photo-400.jpg after it when you want a second page 400 points wide.
  3. Reject a PNG here and convert that PNG on its own page first.

Formula / how it works

bars-32x16.jpg is a 32 by 16 JPEG. The page made from it is 32 points wide and 16 points tall, and the file is 1.2 KB. photo-400.jpg is 400 by 267. Put after the small one, the PDF has two pages, widths 32 then 400, and the file is 2.7 KB. pdf-lib embeds the JPEG bytes it was given. It does not decode them and encode them again, so a clean photo does not pick up a second generation of JPEG blocks.

The rule on the page is one point per pixel, which is 72 pixels to an inch. A 32-pixel image is a tiny page. A 400-pixel image is a bit over five inches wide. That is deliberate. Fitting every photo onto A4 would scale and sometimes resample. Here the page is the image. If you need A4, place the PDF into a layout tool after, or render from a JPEG that is already the size you want.

PNG is refused. The error names the file. WebP is refused. A file that merely ends in .jpg but does not start with the JPEG marker is refused. The check is the bytes, not the name. Two files become two pages in the order the picker returned them.

Because the JPEG is embedded, transparency does not exist on the page. JPEG never had an alpha channel. A white fringe you see was already in the JPEG. The PNG to JPG page is the one that paints transparent pixels white before the encode, and that step is lossy. Doing it there, and embedding here, keeps the two losses in the place you chose.

Bookmarks are not created. One image, one page, no outline. The PDF merge tool is the one that stacks existing PDFs and can take a page range. This page only starts from JPEGs. A scan you already have as PDF should go to the compressor or the splitter, not through a JPEG again, unless you want the extra generation of loss.

A 4000 pixel photo would be a 4000 point page, a little over 55 inches wide. That is the consequence of refusing to fit the picture onto A4. Fit it yourself, before you embed it, if the page must be a standard sheet.

Paint a transparent PNG onto white first with PNG to JPG. Stack finished PDFs with PDF merge.

Worked examples

One small JPEG

Inputs: j2p-f: bars-32x16.jpg

On this page, take bars-32x16.jpg and press Make PDF. Check the page width matches the pixel width.

Result: JPG to PDF: 1 page. Each page is the image pixel size in points, so 72 pixels become one inch. T… bars-32x16.jpg 32×16 File 1.2 KB

Small JPEG then a 400 pixel photo

Inputs: j2p-f: bars-32x16.jpg, photo-400.jpg

On this page, take bars-32x16.jpg, photo-400.jpg and press Make PDF. Check the page width matches the pixel width.

Result: JPG to PDF: 2 pages. Each page is the image pixel size in points, so 72 pixels become one inch. … bars-32x16.jpg 32×16 photo-400.jpg 400×267 File 2.7 KB

Use cases

  • Keeping the original JPEG bytes inside the PDF instead of recompressing them.
  • Making a 1.2 KB one-page file from the 32 by 16 bars.
  • Making a 2.7 KB two-page file when the 400 by 267 photo follows.
  • Refusing a file that only pretends to be JPEG.

Tips & limitations

  • One point per pixel means 72 pixels to an inch.
  • A 32-pixel page is tiny on paper. That is the size you asked for.
  • Page order follows the picker order.
  • There is no outline and no bookmark.

FAQ

Why is the first page 32 points wide?

bars-32x16.jpg is 32 pixels wide and the page uses one point per pixel.

Why is the second page 400 points wide?

photo-400.jpg is 400 by 267 and it was not fitted onto A4.

Are the JPEG bytes encoded again?

No. pdf-lib embeds them. A second generation of blocks is not added.

Why is a PNG refused?

This button only embeds JPEG markers. Paint the PNG to JPEG on the PNG page first.

How big were the two sample PDFs?

1.2 KB for the bars alone, and 2.7 KB when the 400-pixel photo was added.

Do the pages get bookmarks?

No. One image, one page, no outline.

The 32-point page is bars-32x16.jpg. A 4000-pixel photo becomes a large page, not an A4 sheet.