PDF Editing Issues

How to Combine JPEG Files into a PDF with Filenames in Headers

Amos GikundaAmos Gikunda Nov 3, 2026 869 views

Question details

The user wants to merge multiple JPEG image files into a single PDF document and automatically display each image's original filename in the header or footer of its corresponding page.

How to Combine JPEG Files into a PDF with Filenames in Headers
Product
PDF Editor
Device & OS
not provided
Scenario
Merging multiple scanned JPEG images into a unified PDF document while ensuring the source file identification is retained visibly on each page.
Observed behavior
Standard PDF editors combine the image files but do not automatically stamp the original filenames into the headers or footers without the use of custom scripts or third-party add-ons.
Before you start

Ensure all your JPEG files are appropriately named and organized in a single folder, as these filenames will be extracted to create the bookmarks and headers.

Solution 1Recommended

Use Adobe Acrobat with a Custom JavaScript Action

Combine the images, generate bookmarks from the filenames, and use a specialized JavaScript tool to stamp the bookmark names onto the headers.

Standard PDF editors, including Acrobat, can combine JPEG files seamlessly. However, automatically stamping each original filename into the page header or footer is not a built-in, one-click feature.

To achieve this, you must rely on a two-step workaround: first generating bookmarks based on the filenames, and then running a script to convert those bookmarks into visible headers.

1
Combine JPEG files

Open Acrobat, go to the 'Tools' menu, and select 'Combine Files'. Add all your target JPEG images to the workspace.

2
Ensure bookmarks are created

Before finalizing the merge, check the options to ensure the setting 'Add Bookmarks to Adobe PDF' is enabled. This will generate a bookmark for every page using the original JPEG filename.

3
Run a header script

Use a custom Acrobat JavaScript or download a specialized PDF scripting tool (such as a Bookmark-to-Footer Action script). Run the script to extract the names of the bookmarks and automatically place them in the header or footer of the corresponding pages.

Use Adobe Acrobat with a Custom JavaScript Action
Scripting Requirement: Since this workflow is not natively supported out of the box, you will need a basic understanding of Acrobat Action Wizard and JavaScript, or you may need to purchase a third-party script designed specifically for stamping bookmarks.
Efficient PDF Management

Combine JPEGs to PDF and Add Custom Headers with WPS Office

WPS PDF provides a user-friendly and efficient way to merge multiple images into a high-quality PDF document. Once combined, you can quickly navigate to the page setup settings to batch-add custom headers, footers, and page numbers.

  1. 1. Import JPEGs into WPS Office: Open WPS Office, navigate to the 'PDF' section, and select the 'Picture to PDF' tool to import your JPEG files.
  2. 2. Convert and merge: Arrange your images in the desired order and click 'Convert' to merge the selected pictures into a single PDF document.
  3. 3. Access Header and Footer settings: Go to the 'Insert' tab on the top ribbon and click on 'Header and Footer', then choose 'Add Header and Footer'.
  4. 4. Add custom text: Type your desired labels or filenames into the header fields. Apply the settings to specific page ranges as needed.
  5. 5. Save the document: Review your updated PDF pages and click 'Save' or press Ctrl+S to export the final file.
Easily merge multiple JPEG and PNG images into a single PDF file with customizable layouts.Batch add custom text, headers, footers, and page numbers to your combined PDF pages.Fully compatible with standard PDF formats from Adobe Acrobat and Microsoft Office.Lightweight software with a comprehensive suite of advanced PDF editing and markup tools.
microsoft office alternative - wps office

Frequently Asked Questions

Can I combine JPEGs to PDF without losing image quality?

Yes. Most professional PDF editors, including WPS PDF and Adobe Acrobat, offer settings to retain the original resolution of your images during the merging process. Look for 'High Quality', 'Original Size', or 'Lossless' options before initiating the conversion.

Is there a completely automated way to stamp filenames without scripts?

Currently, standard PDF editors do not offer a native one-click function to map source filenames to page headers during a merge. Custom scripting or specialized third-party batch processors are typically required for full automation.

Why don't my merged PDFs automatically show the original JPEG names?

Standard PDF merging tools compile only the visual data of the images and discard external file metadata (like the filename) from the visible page layout to keep the document clean. The filenames are only retained as bookmarks if that specific option is checked.