Home > Archive > PHP Language > November 2007 > Printable Output
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
| Alan M Dunsmuir 2007-11-16, 4:29 am |
| 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?
| |
| Ian Hobson 2007-11-16, 7:00 pm |
| Alan M Dunsmuir wrote:
> 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?
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 http://www.ros.co.nz/pdf/
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.
Regards
Ian
| |
| Alan M Dunsmuir 2007-11-17, 4:00 am |
| Ian Hobson wrote:
>
>
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.
| |
| Krister Karlstrom 2007-11-20, 8:00 am |
| I've been using the library for a few years now. It's really buggy, but if
you know how to handle the bugs and how to work around them then this PDF
library has (almost) everything you need... It's small and great! :)
Let's hope that the developer will pick up the project again, as he
mentioned on the website that he will do for over a year ago... We're all
waiting for a new release! Come on! :)
/Krister
Alan M Dunsmuir <alan@moonrake.demon.co.uk> wrote:
> Ian Hobson wrote:
> 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.
--
* Ing. Krister Karlstrom, Zend Certified Engineer *
* Systemutvecklare, IT-Centralen *
* Arcada - Nylands Svenska Yrkeshogskola *
* Jan-Magnus Janssons plats 1, 00550 Helsingfors, Finland *
* Tel: +358(20)7699699 GSM: +358(50)5328390 *
* E-mail: krister.karlstrom@arcada.fi *
|
|
|
|
|