0

I have made a small web app in Python that, at one point, needs to generate an editable Word document consisting of a set of ID cards (it has to be editable, and in Word, as the users are not familiar with any other mode of editing and some degree of manual editing is unfortunately likely to be necessary). What would be the best way of doing this:

  • I could output Markdown or RestructuredText and convert it with Pandoc. However, I'm not sure about how to handle spacing and borders with this approach. I need to have blank space between each card so they can be cut out of the printout.

  • I could use of one of the many Python templating engines, but I have no experience with any of them, and not sure how easy it is to generate a Word document with them.

  • I could directly output into RTF, but this seems like it might be an unnecessary headache.

Please let me know what you think of these options, with reasons?

ShankarG
  • 1,105
  • 11
  • 26
  • Did you look at this: [How can I create a Word document using Python?](http://stackoverflow.com/q/1035183/222914) – Janne Karila Mar 12 '12 at 12:30
  • No, I didn't, as I was wrongly focused on finding the correct markup / templating language rather than on creating a Word / RTF document directly (I've just come to Python from other languages and forgot the "batteries included" philosophy :) ). Thanks for this link, it is helpful, though I still need to see if pyRTF can do the requisite formatting. – ShankarG Mar 12 '12 at 15:09

1 Answers1

0

You dont precise the Word format (doc/docx ?).

Have you searched the web ? http://www.blog.pythonlibrary.org/2010/07/16/python-and-microsoft-office-using-pywin32/

Finally, which people is familiar with Word editing without being familiar with htmleditors that you can cross all over the web ?

QuidNovi
  • 609
  • 6
  • 20
  • I am aware of pywin32, but I neglected to mention that I am using Linux, so that won't work. As for people famiiliar with Word editing, these are people who hardly ever use a computer, and if so only use Microsoft Office. – ShankarG Mar 12 '12 at 15:08