View Full Version : Print in A4 Format for Any Sizes of Pages

05-31-2004, 04:44 AM
Hi all, I am using PHP to pull results from MySQL databases, i.e. I will have an output page that shows a table with all rows and columns.

The problem with this is that if your results page is huge and you use the Internet Explorer print, it will print out exactly the size you see on your browser...so half of the page of results will not be printed if I choose A4 size (while the whole page of results can only be seen in A3 or so...)

Is there anyway of making a PHP function such that you can resize whatever sizes of tables into A4 format? Any references will be of great help, thanks!

06-01-2004, 09:32 PM
Do you mean the table is too wide or too tall/long?

If it's too wide, then just set the width of the table to however many pixels an A4 page is.

If it's too tall/long, then you may want to use page breaks. However, if you can't control the results from being too huge, then you're sort of out of luck here..

Another option could be to use headers to open this results page in Word (if your audience will be using IE for sure)... if that helps any.


06-02-2004, 03:06 AM
Thanks for your suggestion. I think you're right, there is no luck in trying this "print A4" idea. I have searched through many sources and also no luck. The only way now is too restrict the table size to A4 format.

I have another idea though. Since PHP can generate image on the fly, maybe I can try this method too.