This example demonstrates simple field substitution with DocxFactory Python bindings.
- Compiles
input_test_template.docxintohello_world.dfw - Merges XML payload from
payload.xml - Produces
out/hello_world.docx
The template fields in input_test_template.docx are:
{first_name}{last_name}
- Build DocxFactory with Python enabled (
DOCXFACTORY_BUILD_PYTHON=ON) - Ensure one of these build folders exists:
build/macos-releasebuild/linux-releasebuild/win-vs2022
From repository root:
python3 examples/python/hello_world/run_hello_world.pyOptional overrides:
DOCXFACTORY_BUILD_DIR=build/macos-release \
DOCXFACTORY_TEMPLATE=input_test_template.docx \
python3 examples/python/hello_world/run_hello_world.py