473,800 Members | 2,383 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1532
On Fri, 16 Nov 2007 10:15:33 +0100, Alan M Dunsmuir
<al**@moonrake. demon.co.ukwrot e:
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.ukwrot e:
>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.ukwrot e:
>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.ukwrot e in message
news:fh******** ***********@new s.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.ukwrot e in message
news:fh******** ***********@new s.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.ukwrot e in message
news:fh******** ***********@new s.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

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

Similar topics

3
2493
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
5478
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 characters: CheckPrintable(self,message): printablemessage = ""
5
346
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 like "Show Printable Version". Other than taking out all of the gui stuff and making a simple clean page for printing, is there any other design considerations for making a page good for printing? I'm using frames and all of my content shows in...
1
2500
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 of a guess to set the left/right print margins which seem additive to the printable area start. I don't believe that .Net directly supports providing the printable area but I seem to remember someone, > 1 year ago, posting some C code to find the...
2
3594
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 that is displayed in a text box. Once displayed, the text will be copied, transmitted and then pasted (all manually by humans) into a second utility where the string must then be reverse-engineered into the *original* byte array. The byte array will...
19
11427
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 conversion is appreciated. $ gcc -o test test.c md5.c $ ./test "J?n??CBW? ?}"
7
34644
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 better. Like a \something that does it all? Return Regex.Replace(oStr, "", "").Trim
4
3679
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 haven't decided what the best way to do this is because I don't have much experience with generating printable forms. Early on I knew one of my modules would need to print a clear report so I used the open source SharpPDF library to generate the...
0
9691
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10505
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10253
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9090
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7580
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5471
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5606
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4149
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2945
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.