Merge Multiple Images

Merge multiple images into one to save the result in PDF or image format using Wordize. Merge JPG images into one.
What is this page about?
This page explains how to merge multiple images into a single Wordize document, preserving layout, order, and formatting.

Sometimes it is necessary to merge multiple documents into a single file. Combining image files is particularly useful when digitizing paper documents — for example, when you have photographed or scanned individual pages and want to create a single, continuous PDF for easier viewing, sharing, or archiving.

Merge Multiple Images Before Saving to PDF

If you need to combine multiple images and save each image as a separate page in PDF, use the Merge method and the following code example:

Merger.Merge("DocumentOut.pdf", new string[] { "MultiFrameIn.tiff", "DocumentIn.png" });

You can also merge multiple images using Fluent API and the Create method:

Merger.Create()
    .From("MultiFrameIn.tiff")
    .From("DocumentIn.png")
    .To("DocumentOut.pdf")
    .Execute();

Merge Multiple Images Into One

You can also merge multiple images into one by arranging them:

  • vertically
  • horizontally
  • or in a grid

Сustomize the layout to render multiple pages in a single output using the MultiPageLayout class.

The following code example shows how to combine multiple images into a single image, placing each image or frame in a grid layout:

ImageSaveOptions opt = new ImageSaveOptions(SaveFormat.Png);
opt.PageLayout = MultiPageLayout.Grid(2, 10, 10);
opt.PageLayout.BorderColor = Color.Black;
opt.PageLayout.BorderWidth = 1;

Merger.Create()
    .From("MultiFrameIn.tiff")
    .From("DocumentIn.png")
    .To("DocumentOut.png", opt)
    .Execute();

FAQ

  1. Q: Can I merge images of different formats (e.g., TIFF, PNG, JPEG) together?
    A: Yes. The Merger API accepts any image format that Wordize supports. You can pass a mixed list of file paths to Merger.Merge or the Fluent API, and the library will convert each source image to the format you specify for the output.

  2. Q: How do I control the layout when merging images into a single image file?
    A: Use ImageSaveOptions together with MultiPageLayout. Set PageLayout to Grid, Horizontal, or Vertical and adjust spacing, borders, and page size via the options before calling Execute().

  3. Q: How can I create a PDF where each image appears on its own page?
    A: Call Merger.Merge (or the Fluent API) with a PDF file name as the target and do not supply ImageSaveOptions. The library automatically creates one PDF page per input image.

  4. Q: What should I do if the merged PDF is blank or missing images?
    A: Verify that all source image files exist, are accessible, and are in a supported format. Also ensure the output path is writable and that no other process is locking the target file.

  5. Q: Is there a limit to the number of images I can merge in a single operation?
    A: There is no hard‑coded limit, but merging a very large number of high‑resolution images can consume significant memory. If you encounter OutOfMemory exceptions, consider merging the images in smaller batches or increasing the process’s memory allocation.