Page 1 of 1

Advice on printing formatted stuff...

Posted: Mon May 23, 2005 12:19 pm
by kirilisa
I'm not sure of where the best place is to post this but here goes:

I am looking for some advice on printing. I have a Postgres/PHP app set up that has to (among many other things) print invoices. I am not sure what is the best way to handle formatting-related issues like printing from PHP. Right now, I just have it set up so that you print the invoice from the browser print button, and I have attempted to set CSS styles etc. to make it format properly.

Of course, given that I am not so good with CSS, I am having serious format/font compatibilty issues what with Mac vs. PC and different printers and such. I am having a big problem formatting soemthing properly such that when you fold the paper the address will end up showing in the little clear envelope window as well.

My question is, can anyone give me advice on what my strategy should be? Should I, for instance, try to generate a PDF of my invoice instead of messing with CSS and making it print from browser? Or generate some other kind of doc? Is it even possible to generate Word/PDF/whatever other doc from PHP and if so can someone point me in the right direction?

Any comments or advice would be welcomed enthusiastically.

Thanks,

Elise

Posted: Mon May 23, 2005 12:36 pm
by Skara
word? no. pdf? yes.

No matter how hard you try, it will always print differently if you rely on html/css.

Posted: Mon May 23, 2005 1:56 pm
by onion2k
Word is a lot easier than you'd think. Generate an RTF file, save it with a .doc extension and 99% of people can't tell the difference.

Posted: Mon May 23, 2005 2:00 pm
by kirilisa
But I need all sorts of mad formatting (ick ick!!) How can you do that with rtf?