tag:blogger.com,1999:blog-6692866151143183230.post122467436384942259..comments2024-03-19T16:22:18.277+05:30Comments on jugad2 - Vasudev Ram on software innovation: PyRTF, Python library to create RTF documentsVasudev Ramhttp://www.blogger.com/profile/13568740634188042591noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-6692866151143183230.post-49454592167307239102013-03-21T08:45:07.600+05:302013-03-21T08:45:07.600+05:30Actually, I have just been looking into doing this...Actually, I have just been looking into doing this too. And pyrtf-ng (http://code.google.com/p/pyrtf-ng/) is the old version. There is a newer version of the pyrtf-ng code base on launchpad. https://launchpad.net/pyrtfUnknownhttps://www.blogger.com/profile/01841435223835698742noreply@blogger.comtag:blogger.com,1999:blog-6692866151143183230.post-26309894812944647072013-02-15T20:11:48.713+05:302013-02-15T20:11:48.713+05:30@Mark: Thanks for the tip about PyRTF not being up...@Mark: Thanks for the tip about PyRTF not being updated nowadays. But yes, that does not prevent us from using it for stuff it already supports well.<br /><br />Yes, raw RTF is not hard to write. In fact I mentioned in the post that I did that, in that Java project I worked on earlier. IIRC, I did look at the RTF spec but it was not too user-friendly, which is why I resorted to reverse-engineering the format by creating an RTF doc incrementally in Word (having first just a single letter as the content, then adding a word, a word in bold, then a paragraph, etc.) and then looking at it in a hex editor. This enabled me to figure out what characters were used as RTF markup for different types of content, such as a paragraph, bold text, italic text, etc. The rest was straightforward: just intersperse that markup as needed with the content pulled from the DB via Java.<br /><br />Will check out the RTF Pocket Guide, thanks.<br /><br />@Ricardo: Thanks for the tip about rtf-ng. Will check it out.<br /><br /> <br />Vasudev Ramhttps://www.blogger.com/profile/13568740634188042591noreply@blogger.comtag:blogger.com,1999:blog-6692866151143183230.post-20477489039257618152013-02-15T15:33:13.852+05:302013-02-15T15:33:13.852+05:30Nice post. If you want unicode support, you can ta...Nice post. If you want unicode support, you can take a look at <a href="http://code.google.com/p/pyrtf-ng/" rel="nofollow">pyrtf-ng</a>.Ricardo Duartehttp://ricardoduarte.net/blognoreply@blogger.comtag:blogger.com,1999:blog-6692866151143183230.post-71475121867597456452013-02-15T13:40:25.061+05:302013-02-15T13:40:25.061+05:30PyRTF hasn't been updated since 2005, which, w...PyRTF hasn't been updated since 2005, which, whilst not a problem, suggests you'd be pretty much on your own using it.<br /><br />It turns out raw RTF isn't that hard to write, and the specs are readily available, as is a useful <a href="http://tinyurl.com/rtfguide" rel="nofollow">pocket guide</a>. My app churns out RTF exports which can be potentially hundreds of pages long with a fair bit of structure by using an RTF Django template.Marknoreply@blogger.com