wordTopdf

Convert selected DOCX files to PDF using Microsoft Word on Windows.

Function

wordTopdf(output_file=None, source=None)

Parameters

output_file

Type: str or None

Optional PDF filename. Used only when exactly one DOCX is selected.

source

Type: path, iterable of paths, or None

Optional DOCX input. When omitted, every `.docx` in the current folder is discovered.

Returns

A `Path` for one conversion or a list of `Path` objects for multiple conversions; `None` when no DOCX files are found.

Examples

Convert all DOCX files

wordTopdf()

Convert one DOCX

wordTopdf(source="report.docx", output_file="report.pdf")

Notes

Requires Windows, Microsoft Word, and the `toolvix[windows]` extra (`pywin32`).

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