pdfToword

Convert selected PDFs to DOCX, or convert every PDF in the current working folder when source is omitted.

Function

pdfToword(output_file=None, source=None)

Parameters

output_file

Type: str or None

Optional DOCX filename. It is used only when exactly one PDF is selected; otherwise each DOCX uses the source PDF's stem.

source

Type: path, iterable of paths, or None

Optional explicit PDF input. A single path converts one PDF; an iterable converts those PDFs only. When omitted, all PDFs in the current folder are discovered.

Returns

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

Examples

Convert all PDFs

pdfToword()

Convert one PDF

pdfToword(source="report.pdf")

Name one output

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

Pipeline from merge

pdfToword(pdfMerge())

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