Making Labels from python
Irmen de Jong
irmen.NOSPAM at xs4all.nl
Sun Mar 9 23:27:16 CET 2014
On 9-3-2014 22:29, Ulrich Goebel wrote:
> has anybody an idea how to make small formated documents redy to print with python?
> I would like to print address labels as
> firstname lastname
> street and number
> cip and city
> The best should be to form a PDF and send it to the label printer. So the PDF could be
> given the pagesize (labelsize) and a minimum format (boldface). But may be there is
> another light-weight-format besides PDF?
> Any idea?
If generating PDF is too heavy for your liking, you could generate some simple HTML
instead and use appropriate CSS (page-break etc) to make it suitable for correct
printing (which you can do from your web browser). I've used this technique rather
successfully myself and generating the HTML for address labels should be fairly trivial.
Getting the css right can be a bit of trial and error depending on the browser you're using.
More information about the Python-list