Merge from Control File

Overview

Merge from Control File merges PDF files listed in a plain text control file into a single output PDF. Each line of the control file specifies one PDF file path. This is ideal for scripted or automated workflows where the list of files to merge is generated by another process.

Video: Merge from Control File shown step by step, with narration.
The Merge from Control File dialog
The Merge from Control File dialog.

Note

Only PDF files are merged: other file types listed in the control file are skipped (use Merge Documents to convert them). Transfer source bookmarks and Fix up internal links are on by default.

Control file format

The control file is a plain text file (.txt) with one entry per line:

path[,pageRange[,bookmarkTitle[,pageFilter]]]

Only the path is required, so a file listing one PDF path per line — the original control-file format — still works unchanged. The three optional columns are the same ones the Merge Documents dialog imports and exports, so a list exported there can be used as a control file as-is: pageRange is a range such as 1-5,7 (a range running past the end of that file is cut at its last page and listed in the summary; the file is skipped only if none of the range exists in it), bookmarkTitle overrides the bookmark text for that file, and pageFilter is 0 for all pages, 1 for odd only or 2 for even only (or the words all, odd and even; blank means all pages); a line whose page filter is none of these is not merged, and the summary lists it. Wrap a field in double quotes if it contains a comma. Lines beginning with # are treated as comments and ignored. Blank lines are also ignored, and so is a header row whose first column is just FilePath, such as the one an export from Merge Documents starts with. File paths can be absolute or relative to the control file's directory. The file may be saved as ANSI or UTF-8 text (with or without a byte-order mark). The reverse also works: Import CSV in Merge Documents reads a control file with these same rules.

# Cover pages
C:\Documents\cover.pdf
C:\Documents\toc.pdf

# Main content, with per-file page ranges and bookmark titles
C:\Documents\chapter1.pdf,1-20,"Chapter 1 - Introduction"
C:\Documents\chapter2.pdf
C:\Documents\chapter3.pdf

# Appendices
C:\Documents\appendix.pdf

How to use

  1. Create a text file listing the PDF files to merge, one per line.
  2. Go to Plug-Ins > Merge & Rename > Merge from Control File.
  3. Set the Control file path to your text file.
  4. Set the Output file path for the merged PDF.
  5. Optionally enable Add bookmark for each merged file to create a bookmark for each source file.
  6. Click OK to perform the merge.

Options

OptionDescription
Control file Path to the text file listing the PDFs to merge. Click Browse to select the file. The file must exist when you click OK.
Output file Path for the merged output PDF. If the file already exists you are asked whether to replace it when you click OK. A progress window shows each listed file as it is merged; Cancel stops and nothing is written.
Transfer source bookmarks Copies the existing bookmark tree from each listed file into the merged output.
Fix up internal links Adjusts GoTo link destinations so they point at the correct pages in the output.
Keep links and bookmarks to pages that are not merged Decides what happens to a bookmark or link whose target page is left out of the merge by a page range or an odd/even filter in the control file. Off (the default): it is removed, and the result message says how many were left out. On: it is kept, but with no target, so the bookmark stays as a title and the link stays on its page, and neither opens anything.
Generate table of contents page Inserts a TOC page at the front listing each source file and its starting page.
Add bookmark for each merged file When enabled, a bookmark is automatically created for each source file using the file name (without extension) as the bookmark title.
Open output after creation When enabled, the merged PDF is opened in Acrobat after the operation completes.

Tip

Use comments in the control file (lines starting with #) to organize and document your merge list. This makes it easy to temporarily exclude files by commenting them out.

Note

If a file listed in the control file cannot be found, the merge will continue with the remaining files and the missing file will be reported in the results summary.

See also