py2docx
py2docx copied to clipboard
something wrong with the IMAGE
there is something wrong with the IMAGE, when i change the suffix docx to zip, i found that there is no pictures in the media file. so it can't import the pictures, also, if i want to put two pictures in a line, how can i do it? thank you for your package, i think it is the best one in control the office word now in python with xml.
About the problem, could you send me the type and the size of the image? I tried with some pictures here and it worked. =/ Probably I need to test a specific case. Or, could you try another picture? By now it is not possible to do this. What you can do is build a table with no border and put 2 cells in a row, and then the pictures. Because the element Image is inside a paragraph. To do this without the table, you should put an absolute position on the picture, and the module don't do this for now, sorry.. Thank you for the contribution!
I just used the sample you listed in your introduction, and changed the image in my own picture Image(r"C:\material-gui\post-dat\2.png", document=doc, align='center')
I just used the sample you listed in your introduction, and changed the image in my own picture Image(r"C:\material-gui\post-dat\2.png", document=doc, align='center')
Could you try putting and relative path? Like put the image in the same folder of the script, and put the path like Image('2.png', document=doc, align='center')