Skip to main content

Convert Images to PDF Online Convert one or more images into a multi-page PDF document with layout options.

Image to PDF illustration
🖼️

Image to PDF

Convert one or more images into a multi-page PDF document with layout options.

1

Add Images

Drop or select images — add as many as you need for the PDF.

2

Choose Layout

Select page size: A4, Letter, or Fit to Image.

3

Generate PDF

Click Generate to create and download the multi-page PDF.

Loading tool...

What Is Image to PDF?

An Image to PDF is a tool that combines one or more images into a properly formatted PDF document, allowing users like graphic designers and digital photographers to easily convert images to pdf. It solves the specific problem of having multiple image files in formats like jpg or png that need to be shared or printed as a single document. The tool achieves this by generating each image as a separate page, centered and scaled to fit the chosen page size, which can be set to A4, US Letter, or Fit-to-Image sizing.

Developers use it because it provides fine-grained control over the output, including the ability to embed images as JPEG streams with DCTDecode compression for efficient file sizes. What makes this tool different is its ability to construct the PDF binary format manually in the browser, eliminating the need for server-side processing or external libraries. It also allows users to preview and remove individual images before generating the pdf, making it easy to convert photos to pdf or create a photo to pdf document.

The code implements features like a FileDropzone component that accepts image files, a page size selector, and a generate button that triggers the PDF creation process. When generating the PDF, it uses a canvas element to scale and center each image, then embeds the resulting JPEG streams into the PDF document using DCTDecode compression. This results in efficient file sizes for the output pdf, whether converting images from png to pdf or other formats.

Why Use Image to PDF?

  • Combine multiple images into one organized PDF
  • A4, Letter, or custom fit-to-image page sizes
  • Images centered and scaled to fit without distortion
  • PDF generated entirely client-side — images stay private

Common Use Cases

Document Scanning

Combine scanned pages into a single PDF document.

Photo Albums

Create shareable PDF photo albums from image collections.

Portfolios

Compile artwork or design screenshots into a PDF portfolio.

Receipts

Combine receipt photos into a single PDF for expense reports.

Technical Guide

Under the hood, it uses a combination of browser APIs and manual file format construction to achieve its functionality. When an image is added via the FileDropzone component, it creates a URL object for that image using `URL.createObjectURL`, allowing it to be loaded into an `Image` element. The `generate` function then scales and centers each image on a canvas element, which is referenced by the `canvasRef`. This scaled image is converted to a JPEG stream using `Canvas.toBlob` with a quality setting of 0.92. Each JPEG stream is embedded in the PDF document as an XObject resource with DCTDecode compression filter.

The tool manually constructs the PDF binary format according to the PDF 1.4 specification, including the catalog, page tree, page objects, content streams, and cross-reference table. The `TextEncoder` API is used to encode strings into Uint8Arrays for inclusion in the PDF document. Content streams use the cm operator to position and scale images on the page, with coordinates specified in points (1/72 inch). Each page object references its corresponding XObject resource, which contains the JPEG stream. After generating all page objects and content streams, it creates a cross-reference table and trailer to complete the PDF structure.

This manual construction approach allows for fine-grained control over the output PDF document, including the ability to embed images with specific compression filters and scaling factors. By using `Canvas.toBlob` and `TextEncoder`, it avoids relying on external libraries or server-side processing, making it a self-contained solution for converting images to PDF documents in the browser. When generating the final PDF, it creates a Blob object from the concatenated Uint8Arrays and triggers a download via an anchor element, resulting in a properly formatted PDF document that can be opened by any compatible viewer.

Tips & Best Practices

  • 1
    Add images in the order you want them in the PDF
  • 2
    Use Fit to Image for photos that should not be cropped
  • 3
    Remove unwanted images before generating
  • 4
    A4 is standard for documents, Letter for US formats

Related Tools

Frequently Asked Questions

Q How many images can I add?
No hard limit — depends on browser memory. Works well with dozens of images.
Q What image quality is used?
Images are embedded as 92% quality JPEG for good quality-to-size ratio.
Q How is page order determined?
Pages appear in the order images are added. Reorder before generating.
Q What affects the PDF file size?
Depends on image sizes. JPEG compression keeps PDFs reasonably small.
Q Can I set margins?
Images are centered with automatic margins based on page size.

About This Tool

Image to PDF is a free online tool by FreeToolkit.ai. All processing happens directly in your browser — your data never leaves your device. No registration or installation required.