Skip to content

Image PDF Mail Merge

Dynamically insert photos, logos, and signatures into your merged PDFs. Map image filenames in your spreadsheet to files in Media Albums for personalized documents.

What is Image PDF Mail Merge?

Image PDF mail merge lets you dynamically insert photos, logos, and signatures into merged PDFs based on spreadsheet data. Instead of manually placing images one at a time, you upload them to a Media Album and reference them by filename in your spreadsheet. Each row produces a PDF with the correct image embedded automatically.

This turns static PDF templates into visually rich, personalized documents — employee ID cards with photos, product catalogs with item images, contracts with authorized signatures, and branded letters with client logos.

Who uses this?


How to Add Images to Merged PDFs

Step 1 — Upload Images to a Media Album

Go to Assets → Media Albums and create an album (or use an existing one). Upload your PNG or JPEG images. Each image’s filename becomes its lookup key during the merge.

Naming convention

Use a consistent naming convention that matches your spreadsheet data. For example, if your spreadsheet has employee IDs like EMP001, name the corresponding photo EMP001.png. This makes matching reliable and easy to maintain.

Step 2 — Prepare Your Spreadsheet

Add a column containing image filenames. You can include or omit the file extension:

Spreadsheet ValueMatches Album Image
photo1photo1.png, photo1.jpg
Photo1.JPGphoto1.jpg
EMP001.pngEMP001.png

Matching is case-insensitive with stem fallback — so Photo1, photo1, and PHOTO1.PNG all resolve to the same album image.

In the editor’s Media tab, select the album to link. This tells Mergram which album to search when resolving image field values. Each template links to one album at a time.

Step 4 — Place an Image Field

Drag the image filename column from the sidebar onto your PDF canvas. Click the field and change its render type to Image. Resize the bounding box to control how large the image appears.

Step 5 — Preview and Generate

Use the row selector to preview individual rows with real images. Verify sizing, alignment, and matching before running the full merge.

Preview is local

Single-row previews run entirely in your browser — your images and data don’t leave your machine until you trigger a bulk merge.


How Image Scaling Works

Images are rendered to cover the bounding box width, maintaining their original aspect ratio:

The bounding box height does not control the image height — the image’s aspect ratio determines that. Adjust the bounding box width to make images larger or smaller.

Aspect ratio

Portrait and landscape images render differently in the same-sized bounding box. A tall headshot will extend further down than a wide logo. Test with representative images from your dataset before generating the full batch.


Common Use Cases

Employee ID Cards and Badges

Upload headshots to a Media Album named by employee ID. Your spreadsheet has columns for name, department, title, and photo filename. Each row generates a complete ID card with the employee’s photo embedded.

Product Catalogs

Upload product photos to an album. Your spreadsheet lists product names, descriptions, prices, and image filenames. Generate a multi-page catalog where each product page shows the correct product image.

Contract Signatures

Upload scanned signatures (PNG with transparent background works best). Your contract spreadsheet includes a column for the signer’s signature image filename. Each generated contract has the correct signature embedded.

Branded Documents with Client Logos

Upload partner or client logos to an album. Your spreadsheet includes a logo filename column. Generate branded letters, proposals, or reports with each recipient’s logo automatically placed.


Best Practices

  1. Use consistent naming — Match image filenames exactly to your spreadsheet values to avoid unmatched fields
  2. Optimize images before upload — Resize to approximate display dimensions and compress to keep file sizes manageable
  3. Use JPEG for photos — JPEGs are smaller than PNGs for photographic content
  4. Use PNG for logos and graphics — PNGs support transparency and render sharp edges
  5. Test with previews — Preview a few rows to verify image sizing and positioning before running a full merge
  6. Organize albums by project — Keep images in separate albums per template or project rather than one massive collection
  7. Use the copy filename button — In the Media tab sidebar, copy exact filenames to your spreadsheet to eliminate typos

Limitations


Get Started

Upload your images, connect your spreadsheet, and generate personalized PDFs with dynamic images in minutes. No desktop software, no plugins — everything runs in your browser.

Try Mergram free and create your first image-enriched mail merge today.

Step-by-step guide

  1. 1

    Upload Images to a Media Album

    Go to Assets → Media Albums, create or select an album, and upload your PNG or JPEG images. Use clear, consistent filenames that match your spreadsheet data.

  2. 2

    Prepare Your Spreadsheet

    Add a column containing image filenames (with or without file extension). For example, if your album has photo1.png, the cell can be photo1 or photo1.png.

  3. 3

    Link the Album to Your Template

    In the editor's Media tab, select the album to link. This tells Mergram which album to search when resolving image field values during the merge.

  4. 4

    Place an Image Field

    Drag a column header onto the canvas, then change its render type to Image. Resize the bounding box to control the image dimensions.

  5. 5

    Preview and Generate

    Use the row selector to preview images with real data. When satisfied, generate your merged PDFs — individual files, a combined document, or email delivery.

Frequently asked questions

How do I add images to a merged PDF?
Upload your images to a Media Album in Mergram, add a column with image filenames to your spreadsheet, set the field render type to Image, and link the album to your template. During the merge, each row's filename is matched to an album image and embedded into the PDF.
What image formats are supported?
Only PNG and JPEG images are supported in image fields. This is a limitation of the PDF rendering engine (pdf-lib). SVG, GIF, BMP, WebP, and TIFF files are not supported. Convert your images to PNG or JPEG before uploading.
How does filename matching work?
Matching is case-insensitive with stem fallback. A spreadsheet cell containing photo1, Photo1, photo1.png, or PHOTO1.PNG will all match an album image named photo1.png. If no match is found, the field is skipped with a warning — the merge does not fail.
Can I use different images for each row?
Yes. Each spreadsheet row specifies its own image filename. During the merge, Mergram resolves each row's filename against the linked Media Album independently. Row 1 can use photo-a.png while Row 2 uses photo-b.jpg.
How are images scaled and positioned?
Images scale to cover the bounding box width, maintaining aspect ratio. They are aligned to the top-left corner of the field bounding box. You can add an optional margin for padding inside the box.
What happens if an image is missing?
If no matching image is found in the linked album, the image field is skipped with a warning. The merge continues — it does not fail. The field area is left blank in the output PDF for that row.

Ready to try it yourself?

Start merging PDFs in minutes — free account required, no credit card needed.

Related articles