PHP to create Printable format

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
rajsekar2u
Forum Commoner
Posts: 71
Joined: Thu Nov 20, 2008 4:23 am

PHP to create Printable format

Post by rajsekar2u »

Hi all..

Right now, I am trying to do generation of report using PHP in which the
report should be in a printable format later on.

Is there any solution to use PHP to accomplish such task??

The report is viewed in a web browser and how should I create a navigation
link or something whereby user can click on it to view it in a printable
format and print it ??
User avatar
McInfo
DevNet Resident
Posts: 1532
Joined: Wed Apr 01, 2009 1:31 pm

Re: PHP to create Printable format

Post by McInfo »

If you structure your HTML properly, you can use different stylesheets for printing and normal viewing. You can use the media attribute of the style tag or link tag to notify the browser that the style rules apply to "print" or "screen". Or you can Javascript to switch between stylesheets. Another option is to have a different HTML page altogether that has a layout specifically for print.

Edit: This post was recovered from search engine cache.
Post Reply