Click here to Skip to main content
15,908,112 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Am new to PHP and i want to be able to code for the printer.
Want to be able to Print form my web page and others also from the database.
Posted

1 solution

PHP does not directly interact with printers. Your options are to use a library to create a PDF for download which offers the most control or to use css to create a stylesheet for printer html pages, however in the case of print css you will not have control over headers and footers as that will be client side in the browser.

If you opt to go the PDF route the best pdf library for PHP is probably fpdf which is a free download from here http://www.fpdf.org/[^]

If you want to go the css route then you need to create a stylesheet for the print media type to find out more about that hit w3schools here http://www.w3schools.com/css/css_mediatypes.asp[^]

Hope that helps.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900