Printable Output

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Is there a standard technique, in a PHP/MySQL Web Application, for users  
to be provided with printable-quality output - e.g. business invoices -  
created for them on the fly?

Re: Printable Output

Alan M Dunsmuir wrote:
Quoted text here. Click to load it

I don't know about "standard", but for one customer I am creating .pdf  
files on the fly. He can then forward them by email or print them as he  
wishes, using the integration of Adobe and Outlook Express (windows).

The library is public domain and can be found at

You will not like how page throws are handled! You can't know you need  
to take a new page, until you over stepped the bottom of the page. The  
work around is ugly - you detect that you are now on a new page, discard  
  back to the last check point, head the new page, and then output the  
stuff you threw away again. Yeuk, but it works.

I ended up writing an adapter pattern so I could write lots of

do {
    $text = "Please find below q.... ": // build a paragraph in $text
    $text .= ".\n";
    $pdf->ezText($text,$size,$opts);   // add it
} while ($pdf->endsOnNewPage($this,'headpage'));

loops to send out the bits between possible break points.

It means I can forget all about driving printers, fax machines, or  
emailing the results. I have included his (colour) letterhead, with its  
image, so he prints on plain paper, with no line-up problems. The code  
even get the addresses to appear in the window of the envelope every time.



Re: Printable Output

Ian Hobson wrote:
Quoted text here. Click to load it
Thanks. That seems to be exactly what I'm looking for, with the added  
advantage of my not having to trouble my Web Server Host by asking him  
to load additional software for me.

Site Timeline