Recently I have been playing/fooling/struggling around with the creation and modification of Word documents using a combination of MSWordStylers and the Python docx library, called from a PythonCaller. A very instructive journey :-)
To make sure I don't forget immediately everything I've learned, I have decided to summarize my findings in a template. And because a lot of input has come from this community I will share the results here. Please see the zip file attached: images-to-table-python-docx.zip
It starts by reading Parcel information from a database (gpkg) and it creates a summary table in a word document, including a little image with the parcel plotted on an aerial image.
Inspiration has been taken from these to discussions:
- How to pull a raster from an ESRI basemap to use within FME workbench, especially the answer given by @nielsgerrits
- MSWordStyler how to include picture in table? with the Python example by @ebygomm
With some slight modifications I have integrated these two examples in my own workflow.
What do you think?
Cheers,
Egge-Jan
Edit 2024-04-05: attachment added again in zip file format (apparently the new community environment does not support the uploading of fmwt files).