By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,609 Members | 1,164 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,609 IT Pros & Developers. It's quick & easy.

converting a text file to image

P: n/a
i am looking for python code to convert a textfile(.txt) to an
image(preferrably Tiff).I believe it involves some scanning and
conversion using some font table and probably compression using
huffman encoding..is there an open source code doing this?can someone
give a pointer?
jim
Jun 27 '08 #1
Share this Question
Share on Google+
2 Replies

P: n/a
On Jun 20, 9:15*am, jimgardener <jimgarde...@gmail.comwrote:
i am looking for python code to convert a textfile(.txt) to an
image(preferrably Tiff).I believe it involves some scanning *and
conversion using some font table and probably compression using
huffman encoding..is there an open source code doing this?can someone
give a pointer?
jim
Do you have a text file (toto.txt) and you want to render it as an
image ?
Never done that but my first thought is to use PIL (http://
www.pythonware.com/products/pil/).

Examples:
http://aspn.activestate.com/ASPN/Coo.../Recipe/483756
http://blog.foozia.com/blog/2007/nov...o-template-tag
Jun 27 '08 #2

P: n/a
jimgardener wrote:
i am looking for python code to convert a textfile(.txt) to an
image(preferrably Tiff).I believe it involves some scanning and
conversion using some font table and probably compression using
huffman encoding..is there an open source code doing this?can someone
give a pointer?
jim
You can use PIL to do this. I have a small class that I wrote that does this
using PIL. Supports background TIF image (e.g. form). I used it to generate
TIFF images of a client's Invoices for them. If you are interested, drop me an
email and I'll forward it to you. It does also depend on netpbm because PIL
doesn't support outputting of compressed TIFF images.

-Larry
Jun 27 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.