This is a tool generating a PDF document from a DOCX document.
How to import
from generate_document import replace_docx
How to use
replace_docx(src, dest, replace_list)
src is path of the template DOCX file\n
dest is path of the output PDF file\n
replace_list is the list of texts you want to change... like below.
[['original text 1', 'new text 1'], ['original text 2', 'new textg 2'], ...]
※ Caution : path of template file must be full-path like 'C:\Users...\template.docx'
- python-docx
- MS Office Word on Windows
- pywin32 (for module 'wincom32')