How to use
- Embed bars-32x16.png for a single 32-point page.
- Add bars-32x16.jpg after it for a second 32-point page.
- Convert WebP or GIF only if you accept a redraw and, for GIF, the first frame.
Formula / how it works
bars-32x16.png becomes a one-page PDF, 32 points wide, about 965 bytes. Adding bars-32x16.jpg makes a second page, also 32 points wide, and the file is about 1.5 KB. The PNG is embedded with embedPng. The JPEG is embedded with embedJpg. Neither is drawn through a canvas first, so the PNG keeps its exact pixels and the JPEG keeps the bytes it already had.
WebP, GIF and BMP take the other road. The browser decodes them, the canvas redraws them as PNG, and that PNG is embedded. A GIF contributes the frame the browser returns, which is the first frame. An animated GIF does not become a flipbook. The note on the page says so before you press the button.
Page size is one point per pixel, the same rule as the JPEG-only page. A 32-pixel image is a tiny page. A 4000-pixel image is a huge page. Nothing here fits the picture onto A4. Do that before you arrive, if A4 is the requirement.
Two files become two pages in picker order. The mix sample is the PNG first and the JPEG second, and the page widths are 32 then 32. There is no outline. The merge tool is for PDFs you already have. This tool starts from images.
The PNG page and the JPEG page are both 32 points wide because both pictures are 32 pixels wide. The PNG is stored with embedPng and the JPEG with embedJpg, so neither sample is drawn through a canvas. A WebP or a BMP would be redrawn first, and a GIF would contribute one frame. There is no A4 fitting step. A 4000 pixel picture would be a 4000 point page, and you would resize it before you arrived if that were too large.
If the picker returns the JPEG before the PNG, the pages swap. The sample forced the PNG first and the JPEG second, which is why the message lists the PNG line and then the JPEG line. Neither page was fitted to Letter or A4. You can still merge this PDF with another later, but the merge will not invent margins around a 32-point page. Count the pages in the download before you send it on.
The one-page sample is only the PNG. The two-page sample is the PNG and then the JPEG. Read those names in the result line before you assume the picker used a different order.
JPEG-only embedding is JPG to PDF. Stacking PDFs you already have is PDF merge.
Worked examples
PNG bars as one page
Inputs: i2p-f: bars-32x16.png
On this page, take bars-32x16.png and press Make PDF. Expect one point per pixel and no A4 fit.
Result: Images to PDF: 1 page. JPEG and PNG are embedded as they are. WebP, GIF and BMP are redrawn to P…
bars-32x16.png 32×16 PNG
File 0.9 KB
PNG bars then JPEG bars
Inputs: i2p-f: bars-32x16.png, bars-32x16.jpg
On this page, take bars-32x16.png, bars-32x16.jpg and press Make PDF. Expect one point per pixel and no A4 fit.
Result: Images to PDF: 2 pages. JPEG and PNG are embedded as they are. WebP, GIF and BMP are redrawn to …
bars-32x16.png 32×16 PNG
bars-32x16.jpg 32×16 JPEG
File 1.5 KB
Use cases
- Embedding a PNG without a second encode.
- Embedding a JPEG without a second encode.
- Turning a BMP or a WebP into a PDF page via a PNG redraw.
- Refusing to pretend an animation became many pages.
Tips & limitations
- One point per pixel.
- Picker order is page order.
- No outline is written.
- A huge pixel size becomes a huge page.
FAQ
Why are both sample pages 32 points wide?
The PNG and the JPEG are both 32 pixels wide, and the page uses one point per pixel.
Is the PNG recompressed?
No. embedPng stores that PNG. The JPEG uses embedJpg and keeps its existing bytes.
What happens to a GIF?
The decoded frame, usually the first, is redrawn as PNG and embedded. Later frames are not pages.
Will this fit a photo onto A4?
No. Fit or crop the image first if the page must be A4.
How do I merge existing PDFs?
Use the merge tool. This page starts from images.
Are bookmarks created?
No. One image, one page.
The 32-point pages are the bar images. A camera photo will not be scaled down to a letter sheet here.