Combine PDFs
Combines PDFs into one file: all of them, one per folder (such as an email and its attachments), or one per document family by file name, with a bookmark for each document.
Combine PDFs joins PDFs into combined files written to the run's files folder. It can make one file from every PDF in the input, one file per folder, or one file per family, where a family is a parent such as ABC0001.pdf and the files whose names start with it, such as ABC0001_1.pdf or ABC0001.0001.pdf.
Documents are added in natural name order, so doc2 comes before doc10; in a family the parent always comes first. By default each document gets a bookmark (its file name) at its first page, with the document's own bookmarks underneath. Links are kept only when they lead to a page in the same document. Each combined file is checked after it is built to make sure it holds exactly the expected pages; if it does not, it is not written.
Use it when
- An email has been converted to PDF with its attachments in the same folder and the family should be one PDF.
- A production has parents and attachments named by Bates or document ID (
ABC0001.pdf,ABC0001_1.pdf) and each family should be a single PDF. - A set of documents needs to be served, filed or sent as one bookmarked PDF.
How to run it
- Choose the folder of PDFs as Input and an Output folder outside it. Only
.pdffiles are used. - Choose Combine:
All,PerFolderorByName. - For
All, type the Combined file name. - Leave Bookmark each document on unless the combined file should have no bookmarks.
- Decide on Leave out unreadable PDFs (see below).
- Click Run, read the notes, then click Open report to see where each document landed.
Settings
Every setting has the same help beside it in the app. On the command line, pass each as --name value; ltk help combine-pdfs lists them.
Settings
| Setting | What it does | Type and default |
|---|---|---|
Combine--mode |
All: every PDF into one. PerFolder: one PDF per folder. ByName: one PDF per family, where a file joins the one whose name it starts with, followed by _ . - or a space (ABC0001.pdf with ABC0001_1.pdf).PerFolder names each combined file after its folder and puts it in that folder's parent: mail\email1\ becomes mail\email1.pdf. PDFs at the top of the input go into _top level.pdf. ByName works within each folder: a file joins the shortest name it starts with, when the next character is _, ., - or a space. ABC00010.pdf does not join ABC0001.pdf, because no separator follows. Each family file is named after its parent. |
choice: All, PerFolder, ByNameAll |
Combined file name--name |
Name of the combined PDF when combining all..pdf is added if you leave it off. If the name is empty the run stops before it starts.Shown when mode = All |
textCombined |
Bookmark each document--bookmarks |
Add a bookmark for each PDF (its file name) at its first page, with its own bookmarks under it. The document's own bookmarks are copied under its entry and point to the right pages in the combined file. |
yes/notrue |
Leave out unreadable PDFs--skip-unreadable |
Off (default): if any PDF of a combined file cannot be read (damaged or password-protected), that combined file is not written. On: it is written without them, and they are reported. A PDF is unreadable if it is damaged or password-protected. Off (default): the whole combined file it belongs to is not written, and every document in it is reported as Not written. On: the combined file is written without it, and it is reported as Not included. If no PDF in a group can be read, nothing is written either way. |
yes/nofalse |
Common settings
| Setting | What it does | Type and default |
|---|---|---|
Input required--input |
Folder (or single file) to read. It is opened read-only and never modified. | folder empty |
Output required--output |
Folder for reports. Must not be inside the input folder. Each run gets its own sub-folder. | folder empty |
Recurse--recurse |
Include sub-folders. | yes/notrue |
Extensions--extensions |
Only process these extensions (e.g. .pdf, .docx). Empty means the tool's default set. | list empty |
Parallelism--parallelism |
Files processed at once. Use 1-2 for spinning disks or network shares. | number4 |
What you get
Each run creates its own folder inside the output folder, with the report combine-pdfs.csv, errors.csv and manifest.json (see Run folders and manifests).
files\Combined.pdf …: The combined PDFs, named as described under Combine.combine-pdfs.csv: One row per input PDF: Status (Combined, Not included or Not written), CombinedFile, FirstPage and LastPage in the combined file, Pages, Destination, MD5 and Notes. Unreadable PDFs are reported here with the reason, rather than inerrors.csv.
Report columns
RelativePathFileNameStatusCombinedFileFirstPageLastPagePagesDestinationMD5NotesSourcePath
Check the result
- Read the notes: they give how many PDFs went into how many files, and how many combined files were not written.
- Filter the report on Status. Fix or decrypt any
Not writtenorNot includedPDFs and run again, or turn on Leave out unreadable PDFs if leaving them out is acceptable. - Read the Notes column: it says when links leading outside a document were removed, and when a document had form fields.
- Open a combined file and check the order and the bookmarks.
- Order follows file names, not dates. In
PerFoldermodeattachment.pdfsorts beforemessage.pdf; if the email must come first, rename the files or useByNamewith family names. - Use FirstPage and LastPage from the report to cite where each document sits in the combined file.
- If documents contain fillable forms, run Flatten PDFs first: form fields in the combined file are not interactive.
- Password-protected PDFs cannot be combined. Remove the password first (for example with Decrypt) if you are entitled to.
- Combine PDFs is a Pro tool. The free edition combines up to 25 documents per run.
From the command line
The command line is part of LitTechKit Pro. See Command line.
ltk run combine-pdfs --input "D:\Matter\Production\PDF" --output "D:\Matter\Work" --mode ByName
Related tools
- Convert To PDF: Converts Word, Excel, PowerPoint, RTF, text, email (.eml, .msg) and image files (including multi-page TIFFs) to PDF using the Microsoft Office on this PC, from read-only working copies with macros and external links disabled, keeping saved values and showing hidden content, and reports the page count of each PDF. AutoCAD drawings (.dwg, .dxf, R14 and later) are converted without AutoCAD, one page per layout.
- Extract Attachments: Extracts attachments (and attached emails, recursively) from .msg and .eml files into a new folder, with family IDs, verified hashes and safe file names.
- Flatten PDFs: Bakes form fields, comments and other annotations into the page so they can no longer be edited, hidden or deleted, writing flattened copies. Links are kept unless you choose otherwise. Annotations with nothing to draw, or not shown on screen, are left and reported. Comment text that is not shown on the page is saved to comments.csv.
- Split PDFs: Splits PDFs into parts no larger than a file size (for court upload limits) or of a set number of pages, named name_001.pdf… or by Bates number. Bookmarks are kept in the part they point to.