Looking for PHP code for printing function

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • galivio
    New Member
    • Sep 2006
    • 2

    #1

    Looking for PHP code for printing function

    I have a site project and one of the required features is to be able to print contents (only texts) on the page. It's just like a one click button and the text will be printed. My idea before was to open the text file in adobe reader and there the user can print using the adobe reader print button, but this is not a good way since the contents to be printed is only short, its actually an information of a certain furniture. So I need a PHP or Javascript code for that one-click-print-button. The contents to be printed may be specified by the "table", "div" or "form".
  • ronverdonk
    Recognized Expert Specialist
    • Jul 2006
    • 4259

    #2
    You cannot print using PHP (server-side program). But from PHP you can issue a JavaScript "window.print() " command to print your window (the entire window).

    If you want only part(s) of it printed, you can accomplish that using a CSS (external) stylesheet with the "media=prin t" attribute.

    Ronald :cool:

    Comment

    Working...