pdfMerge

Merge selected PDFs into one PDF, or automatically merge every PDF in the current working folder when source is omitted.

Function

pdfMerge(output_file="Merged.pdf", source=None)

Parameters

output_file

Type: str, default "Merged.pdf"

Name of the merged PDF. The file is written inside the `merged pdf` output folder. A path is reduced to its filename.

source

Type: path, iterable of paths, or None

Optional explicit input. Pass one PDF path or an iterable of PDF paths. If omitted, all `.pdf` files in the current working folder are discovered.

Returns

A `Path` pointing to the merged PDF, or `None` when no PDFs are found.

Examples

Merge every PDF in the current folder

pdfMerge()

Choose the output filename

pdfMerge(output_file="final.pdf")

Merge selected PDFs

pdfMerge(source=["chapter1.pdf", "chapter3.pdf"])

Use the result in another function

pdfToword(pdfMerge())

Notes

The output is created in `merged pdf/`. Explicit `source` enables deterministic nesting and prevents unrelated PDFs in the current folder from being processed.

Dynamic input behavior

When source is omitted, Toolvix discovers matching files in the current working folder. When source is supplied, only the supplied files are processed. This makes nested pipelines deterministic.

Back to function index · Nesting and chaining