python - How to generate image thumbnails from .docx documents using pywin32 -


i using mark hammond's pywin32 extensions microsoft word 2013. goal simple: need -first- page of given .docx file , save jpeg file (or other image file) generating thumbnail.

how should go it?

this progress far:

from time import sleep import win32com.client win32  def word():     word = win32.gencache.ensuredispatch('word.application')     doc = word.documents.open("myfile.docx")     word.visible = false     sleep(1)     ...     ## code need ##     ...     doc.close(false)     word.application.quit()  if __name__ == '__main__':     word() 

thanks in advance.

the ms office's documents saved in ooxml format zipped archive of "different files".

to extract thumb, in zip (ok, docx) archive file named "thumbnail" whatever extension. (currently either thumbnail.emf (for docx), wmf (for xlsx) , jpeg (for pptx)). also, advised thumb (the file) can missing if user chose when save file word/excel/powerpoint not include thumbnail.


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

How to get multiresult with multicondition in Sql Server -