Advice on printing formatted stuff...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
kirilisa
Forum Commoner
Posts: 28
Joined: Fri Dec 05, 2003 4:41 pm

Advice on printing formatted stuff...

Post 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
User avatar
Skara
Forum Regular
Posts: 703
Joined: Sat Mar 12, 2005 7:13 pm
Location: US

Post by Skara »

word? no. pdf? yes.

No matter how hard you try, it will always print differently if you rely on html/css.
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post 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.
kirilisa
Forum Commoner
Posts: 28
Joined: Fri Dec 05, 2003 4:41 pm

Post by kirilisa »

But I need all sorts of mad formatting (ick ick!!) How can you do that with rtf?
Post Reply