473,379 Members | 1,187 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

Printable Output

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?
Nov 16 '07 #1
10 1506
On Fri, 16 Nov 2007 10:15:33 +0100, Alan M Dunsmuir
<al**@moonrake.demon.co.ukwrote:
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?
Yes, create a pdf. There are different packages for this, most of them
pretty easy to use.
--
Rik Wasmus
Nov 16 '07 #2
Rik Wasmus wrote:
On Fri, 16 Nov 2007 10:15:33 +0100, Alan M Dunsmuir
<al**@moonrake.demon.co.ukwrote:
>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?

Yes, create a pdf. There are different packages for this, most of them
pretty easy to use.
Or postcript.

I settled on that because a few tests showed that a linux CUPS sysem
could take postcript and fire it straight at a postcript printer very
efficiently.

If printing on the server, consider that. If printing from users
browsers, use PDF.
Nov 16 '07 #3
Rik Wasmus wrote:
On Fri, 16 Nov 2007 10:15:33 +0100, Alan M Dunsmuir
<al**@moonrake.demon.co.ukwrote:
>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?

Yes, create a pdf. There are different packages for this, most of them
pretty easy to use.
Which packages would you suggest I look at?
Nov 16 '07 #4
"Alan M Dunsmuir" <al**@moonrake.demon.co.ukwrote in message
news:fh*******************@news.demon.co.uk...
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?
Nearly EVERY web page is "printable quality".
Beyond that - you can use CSS's @ functions to specify how to handle printed
output.

Could you be more specific?

btw - cross-posting to both PHP groups is a bit of a no-no.


Nov 16 '07 #5
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

Nov 16 '07 #6
Sanders Kaufman wrote:
>
Nearly EVERY web page is "printable quality".
Beyond that - you can use CSS's @ functions to specify how to handle printed
output.
That view seems to miss the point rather badly.

Apart from a number of basic deficiencies stemming from the underlying
specification of HTML/CSS, there are the problems caused by varying
renderings on differing PC/Mac configurations and by the use of
different browsers.

A pre-formatted PDF sidesteps these problems neatly.
Nov 17 '07 #7
Ian Hobson wrote:
>The library is public domain and can be found at http://www.ros.co.nz/pdf/

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.
Nov 17 '07 #8
"Alan M Dunsmuir" <al**@moonrake.demon.co.ukwrote in message
news:fh*******************@news.demon.co.uk...
Rik Wasmus wrote:
>Yes, create a pdf. There are different packages for this, most of them
pretty easy to use.

Which packages would you suggest I look at?
If you search the PHP docs for "pdf" you'll find that there is some pretty
decent stuff built-in.
It may require that a module of some kind be compiled into the installation,
but I understand that's a relatively simple thing to do.
Nov 17 '07 #9
"Alan M Dunsmuir" <al**@moonrake.demon.co.ukwrote in message
news:fh*******************@news.demon.co.uk...
Sanders Kaufman wrote:
>>
Nearly EVERY web page is "printable quality".
Beyond that - you can use CSS's @ functions to specify how to handle
printed output.

That view seems to miss the point rather badly.

Apart from a number of basic deficiencies stemming from the underlying
specification of HTML/CSS, there are the problems caused by varying
renderings on differing PC/Mac configurations and by the use of different
browsers.

A pre-formatted PDF sidesteps these problems neatly.
Yeah - it's very feature rich... to the point of being bloated.
That's why PDF and RTF are third-party plug-ins, and why their features were
not included in HTML specifications.

There was some discussion about it during the drafting phase - but it became
readily apparent that trying to make every browser page into a feature-rich
desktop publishing application was just too much.

Nov 17 '07 #10
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 <al**@moonrake.demon.co.ukwrote:
Ian Hobson wrote:
The library is public domain and can be found at http://www.ros.co.nz/pdf/
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: kr***************@arcada.fi *
Nov 20 '07 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Pascal | last post by:
Hello, What's the best way to delete or replace no-printable characters in a string. i.e.: "\x08toto\x00titi" -> "tototiti" or " toto titi"
2
by: Daniel Alexandre | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi there, I'm using the following method in my program to check whether a message received is printable or not and to strip the non-printable...
5
by: moondaddy | last post by:
I'm going to use an aspx page to display an invoice that customers can print from. Sometimes when I go to a site and navigate to a page I want to print, they will have a button that says something...
1
by: Steve Podradchik | last post by:
Hi, Our app likes to print data-rich output that fills the page width of the printer. Unfortunately, we've found that the printable area of each printer is a little different, making it a bit...
2
by: Bryan | last post by:
Apologies if this is a noob question, but I've been struggling with this for quite a while... I'm trying to convert a byte array (encrypted authorization code) into a *screen-printable* string...
19
by: Serman D. | last post by:
Hi, I have very limited C knowledge. I want to convert to output from a MD5 hash algorithm to printable ascii similar to the output of the md5sum in GNU coreutils. Any help on how to do the...
7
by: active | last post by:
I want to remove all non-printable characters - including nulls. I could extend the following by adding as many printable characters as I can think of. But I wonder if there isn't something...
4
by: sklett | last post by:
I've developed an ERP application that we use internally and works quite well. I receiving more and more requests from users to print various transactions, order forms, search results, etc. I...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.