rafaels88 / py2docx

A python module to create DOCX documents
MIT License
16 stars 7 forks source link

something wrong with the IMAGE #1

Open lqyp0420 opened 10 years ago

lqyp0420 commented 10 years ago

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.

rafaels88 commented 10 years ago

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!

lqyp0420 commented 10 years ago

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')

lqyp0420 commented 10 years ago

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')

rafaels88 commented 10 years ago

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')