How to Dynamically Create Word / DOCX files with unique images using Python | 1 docx file per image

preview_player
Показать описание
#docx #template #automation

Multiple images : Create 1 word/docx file per image (from local folder).

This code will insert the image into a template docx file and then create a new file from it. My code loops through every image in the "/images" folder.

Making the files 7:30

Next : Make graphs from data (1 per row) in a CSV, save as image, and insert image into the DOCX file using same method I have used here.....

Рекомендации по теме
Комментарии
Автор

Great series of videos on docxtpl, thank you for this. One question, when I download the code and run the test case from docxtpl github (here they have a pre-existing template with a placeholder image they replace), it works fine. The issue I am having is inserting the placeholder. When I then try to replace this image I get the error "ValueError: Picture not found in the docx template". What was the process for you to insert the red and green apples image? I am guessing I am missing some link between template and original image. Many thanks.

matthewmarr
Автор

Sir we have products with different outer colour... Is there anyway to insert picture based on conditions of colour of the product

nagendravishwamitra
visit shbcf.ru