python-docx-template
python-docx-template copied to clipboard
Image broken when using subdoc on template
Hi,
When I try the following code:
from docxtpl import Subdoc, DocxTemplate
tpl = DocxTemplate('template.docx')
subdoc = Subdoc(tpl, 'test.docx')
context = {
'scope': subdoc
}
tpl.render(context)
tpl.save('output.docx')
If the test.docx has an image, I get the following result:
I attach all the required files to reproduce this error.
I'm using the following versions:
docxtpl==0.5.17
python-docx==0.8.7
Hello,
I have to check but I think medias in subdocument loaded from docx file are not supported
Le mar. 26 févr. 2019 à 15:29, Leonardo Lazzaro [email protected] a écrit :
Hi,
When I try the following code:
from docxtpl import Subdoc, DocxTemplate
tpl = DocxTemplate('template.docx')
subdoc = Subdoc(tpl, 'test.docx') context = { 'scope': subdoc } tpl.render(context) tpl.save('output.docx')
If the test.docx has an image, I get the following result:
[image: erorr_img] https://user-images.githubusercontent.com/568181/53419883-6d7aad00-39b9-11e9-9dc9-d6b0c5f57ec0.png
I attach all the required files to reproduce this error.
test.docx https://github.com/elapouya/python-docx-template/files/2905953/test.docx template.docx https://github.com/elapouya/python-docx-template/files/2905954/template.docx
I'm using the following versions:
docxtpl==0.5.17 python-docx==0.8.7
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/elapouya/python-docx-template/issues/181, or mute the thread https://github.com/notifications/unsubscribe-auth/AA2N7JM9ADOY3e_kJ2HOtwtczH--yXPrks5vRUSvgaJpZM4bSTU0 .
Any news on this?
Actually, only textual subdocument is supported. Media are not taken into account. I flag that as a RFE, but I seems very difficult to develop.
pic subdocument should be supported i think.hope it.
please...:( I really hope this issue will be solved someday......