Re: [Tutor] printing in python 3.x

2010-12-05 Thread Alan Gauld


"Monte Milanuk"  wrote

... I was under the impression that controlling exactly layout via 
html was kind of difficult and somewhat fragile.


Absolutely true, especially compared to PDF. But its much
better than it was say 10-15 years ago. But if you can construct
the page such that precision layout is not required that isn't
too big a problem.

perhaps less so as one could make some fairly concrete assumptions 
about the paper size being used in this situation.  Is it common to 
use HTML for formatting printed reports?!?  Could you give an 
example of how you'd control the layout of specific fields on a 
printed report?


Its not unknown. It depends on how precise it needs to be.
But if you use tables extensively, with fixed widths etc you can
get fairly good control. Also use CSS stylesheets to control fonts 
etc.

HTML for printing is almost the opposite of HTML for browser display
- you avoid all the flexible size settings etc and use fixed sixes and 
fonts.


The great thing about HTML is that you can very quickly
try things out manually before committing the effort of generating
it by code. If you are in control of the printed output then you 
should

be able to get precision good enough. If not then PDF may be your
best bet. One option is to get the HTML working well then print
to a PDF printer file. Then you can ship the PDF file with its
precise layout but retain the ease of production of the HTML.

--
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] printing in python 3.x

2010-12-04 Thread Monte Milanuk

Alan,

Perhaps this is a silly question (and possibly not strictly 
python-related) but I was under the impression that controlling exactly 
layout via html was kind of difficult and somewhat fragile.  The latter 
perhaps less so as one could make some fairly concrete assumptions about 
the paper size being used in this situation.  Is it common to use HTML 
for formatting printed reports?!?  Could you give an example of how 
you'd control the layout of specific fields on a printed report?


Thanks,

Monte

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] printing in python 3.x

2010-12-03 Thread Alan Gauld


"Rance Hall"  wrote



But shop owner wants to do something nicer with the customer 
receipts.

He is talking shop logos and pdf files.


The simplest technique is probably to generate an HTML file and then
get the OS to print that for you via the default browser.

Google keeps bringing up ReportLib and the python imaging library, 
but

neither have a 3.x compatible version yet.


THats much harder work IMHO than using an HTML file as a template.


Shop owner is talking about eventually being able to save customer
check in tickets and check out tickets on a web site where clients 
can

log in and check on their work.


And HTML woyuld definitely be easier here!


My thought is that this is perfect for PDF files, but they aren't
available on 3.x yet.


Well you could hand crank them, they are just text files after all.
But HTML is much easier to generate by hand!

I looked at word integration and openoffice integration and they 
dont

look ready for 3.x yet either.


The Pywin32 and ctypes modules all work on Python 3 so you
could use COM integration, or even WSH. But HTML stioll gets
my vote.

HTH,


--
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] printing in python 3.x

2010-12-02 Thread Rance Hall
I've been working on this cli based python 3.x app for a friends shop.
 So far, everything is working well.  We are now ready to start
development on a new module of my code.

The shop is a repair shop, and I've already done the code for client
management and employee management and all the framework and
supporting stuff, but now its time to check  in broken items for
repair and print a reciept for the customer and a shop ticket for the
item.

shop tickets are easy to do *we think*, we think all we need to do is
create a "template" text file, and open that text file, sub markers
for real data, and create a temp file then send that to the printer
with the functions of the underlying OS.  In my tests on windows this
worked fine.

But shop owner wants to do something nicer with the customer receipts.
 He is talking shop logos and pdf files.

I have several issues.

Google keeps bringing up ReportLib and the python imaging library, but
neither have a 3.x compatible version yet.

Shop owner is talking about eventually being able to save customer
check in tickets and check out tickets on a web site where clients can
log in and check on their work.

My thought is that this is perfect for PDF files, but they aren't
available on 3.x yet.

What other options do I have?

I looked at word integration and openoffice integration and they dont
look ready for 3.x yet either.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor