Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > PHP How-To
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
PHP How-To Post your "How do I do this with PHP?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP How-To section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 11th, 2004, 05:45 AM
Authorized User
 
Join Date: Oct 2003
Location: KL, wilayah persekutuan, Malaysia.
Posts: 91
Thanks: 0
Thanked 0 Times in 0 Posts
Default print out on a paper

i would like to print a php page on a paper. I want the page to be printed exactly like what is on the screen. The page has textbox, table, buttons and etc. Is it possible? Can someone please show me how to code?

Reply With Quote
  #2 (permalink)  
Old February 11th, 2004, 01:53 PM
Friend of Wrox
Points: 2,570, Level: 21
Points: 2,570, Level: 21 Points: 2,570, Level: 21 Points: 2,570, Level: 21
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: San Diego, CA, USA
Posts: 836
Thanks: 0
Thanked 0 Times in 0 Posts
Default

If you're viewing a web page generated by PHP, your browser should be able to print it properly. You might have problems if the width of the web page is wider than your paper. In that case, try setting your paper to "landscape" orientation instead of "portrait".


Take care,

Nik
http://www.bigaction.org/
Reply With Quote
  #3 (permalink)  
Old February 11th, 2004, 03:28 PM
richard.york's Avatar
Wrox Author
Points: 5,506, Level: 31
Points: 5,506, Level: 31 Points: 5,506, Level: 31 Points: 5,506, Level: 31
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Camby, IN, USA.
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

You can also use CSS to explicitly tell the browser how the printed page should look..

<style type='text/css' media='print'>

/* normal CSS definitions altered for print */

</style>
<style type='text/css' media='screen'>

/* CSS definitions for the screen */

</style>

Use the print preview feature to see changes made to the print style sheet.

: )
Rich

:::::::::::::::::::::::::::::::::
Smiling Souls
http://www.smilingsouls.net
:::::::::::::::::::::::::::::::::
Reply With Quote
  #4 (permalink)  
Old February 11th, 2004, 04:10 PM
Friend of Wrox
Points: 2,570, Level: 21
Points: 2,570, Level: 21 Points: 2,570, Level: 21 Points: 2,570, Level: 21
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: San Diego, CA, USA
Posts: 836
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Careful though -- I don't think a lot of browsers fully support the CSS print directives...


Take care,

Nik
http://www.bigaction.org/
Reply With Quote
  #5 (permalink)  
Old February 11th, 2004, 04:58 PM
richard.york's Avatar
Wrox Author
Points: 5,506, Level: 31
Points: 5,506, Level: 31 Points: 5,506, Level: 31 Points: 5,506, Level: 31
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Camby, IN, USA.
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

Well the older browsers perhaps,
I've used it with IE 6, NS 7 and Opera 7, with no troubles.. haven't tested on anything older so I couldn't say.

My DHTML book says support began in NS 6 and IE 4.

Browsers which aren't able to interpret it probably don't have very good CSS support anyway.

: )
Rich

:::::::::::::::::::::::::::::::::
Smiling Souls
http://www.smilingsouls.net
:::::::::::::::::::::::::::::::::
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to print image at center of paper EXACTLY guntank C# 2005 1 September 24th, 2006 04:43 AM
How Generate Paper ? aunjizaza Visual Basic 2005 Basics 0 August 25th, 2006 04:03 PM
No print button on the paper with NETSCAPE elisabeth Javascript How-To 11 October 14th, 2004 02:59 AM
Printing reports to paper Imre BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003 2 September 27th, 2003 02:43 PM



All times are GMT -4. The time now is 02:33 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.