 |

07-26-2006, 01:47 PM
|
|
WebProWorld Pro
|
|
Join Date: Jul 2004
Location: Irvine, CA
Posts: 120
|
|
Printer Friendly Website Script
Hi guys, I'm looking for a script that when the user clicks a print icon, a printer friendly version will be shown that will allow the user to print the page successfully on letter size paper.
I'm using a tableless design with DIV tags and CSS, so I was thinking all I need to do is remove the stylesheet from each page. Is this the best way to go? Do you have any other ideas?
|

07-26-2006, 05:21 PM
|
|
WebProWorld Pro
|
|
Join Date: Jul 2004
Location: Irvine, CA
Posts: 120
|
|
Thanks Speed that is exactly what I was looking for!
|

07-26-2006, 06:23 PM
|
|
WebProWorld New Member
|
|
Join Date: Oct 2005
Location: Greenfield MA USA
Posts: 6
|
|
You might also consider creating a PDF file for the user to download.
__________________
Simon Peter Alciere - affiliate program manager - Simon's Stamps
|

07-26-2006, 07:29 PM
|
|
WebProWorld Pro
|
|
Join Date: Jul 2004
Location: Irvine, CA
Posts: 120
|
|
OK scratch that, I'm having some trouble getting this print thing to work properly. Basically my webpage is 900px wide, with a 200px sidebar on the left. I'm making all the images, menus, and sidebar with the display:none property with no problems. The problem is that the text is not wrapping properly, several words get cut off and if I decrease the font I just can fit more words on the line but it still gets cut off! grrrrrrr
My CSS is pretty complicated, I have a mix of relative and absolute DIVs to achieve the look that my company wants. Any advice?
|

07-26-2006, 09:49 PM
|
|
WebProWorld New Member
|
|
Join Date: Sep 2003
Location: Hilton Head Island, SC
Posts: 21
|
|
It's easy - for print pages, I create a "print" style sheet in addition to the "screen" media style page. Usually, I make a copy of the screen style page. And, I set "display:none" for any elements that I don't want on the printed page, such as the navigation bar. I also make minor adjustments in the width(s) to make the content fit a printed page. For example, I make certain the page size fits the dimensions of a print page (around 660px in width for a portrait page).
You've indicated that your web pages are 900px, which means some of your text will not fit on a print page in portrait format. The result is some of the text is "cut off". I don't have your CSS style sheet to confirm my guess, but I suspect you need to reset the widths to fit the typical print page (around 660px).
You should find it fairly easy to tailor the screen style sheet to create a print style sheet, with a few changes.
Ron Baker
www.apex-systems.net
www.hilton-head-property.com
www.hilton-head-real-estate.biz
|

07-26-2006, 11:00 PM
|
 |
WebProWorld 1,000+ Club
|
|
Join Date: Oct 2003
Location: Encinitas, CA
Posts: 1,908
|
|
Your web page and your printer-friendly page should be from separate sources. As someone mentioned, converting it to a PDF is a good option.
You need to realize that the print world is far different from the virtual world.
__________________
DrTandem's San Diego Web Page Design, drtandem.com
|

07-26-2006, 11:45 PM
|
|
WebProWorld New Member
|
|
Join Date: Jun 2006
Location: Nebraska, USA
Posts: 13
|
|
Re: Printer Friendly Website Script
Quote:
|
Originally Posted by spenland
Hi guys, I'm looking for a script that when the user clicks a print icon, a printer friendly version will be shown that will allow the user to print the page successfully on letter size paper.
I'm using a tableless design with DIV tags and CSS, so I was thinking all I need to do is remove the stylesheet from each page. Is this the best way to go? Do you have any other ideas?
|
++++++++++++++++
Another thought would be to use 3 pages. A Server-Side Include page with the text, a Style 1 page with the SSI page that would display the way you want for your site layout, and a Style 2 page with the same SSI page with CSS set just for printing. That way you make text changes to the SSI page and never have to touch the layout for either...
|

07-27-2006, 04:21 AM
|
|
WebProWorld Veteran
|
|
Join Date: Aug 2003
Location: Cornwall, UK
Posts: 833
|
|
Quote:
|
Originally Posted by spenland
OK scratch that, I'm having some trouble getting this print thing to work properly. Basically my webpage is 900px wide, with a 200px sidebar on the left. I'm making all the images, menus, and sidebar with the display:none property with no problems. The problem is that the text is not wrapping properly, several words get cut off and if I decrease the font I just can fit more words on the line but it still gets cut off! grrrrrrr
My CSS is pretty complicated, I have a mix of relative and absolute DIVs to achieve the look that my company wants. Any advice?
|
Assuming printing the web page is still what you want to do, without seeing the page in question it's hard to be specific, but as well as using display: none for the bit's you don't want, also change your containers width from 900px to 90%.
Using a % width should make the text wrap to fit but this does depend on what else you have on the page, i.e. a 900px wide image will probably scupper this.
Do you need to absolutely positioned items on the print version? I'm guessing you could leave them in the flow as in your first post you mentioned just removing the style sheet?
|

07-27-2006, 06:41 AM
|
|
WebProWorld 1,000+ Club
|
|
Join Date: Jul 2003
Location: United Kingdom
Posts: 1,765
|
|
Print out , Hard copy, code Javascript
Print out , Hard copy, code Javascript, Just do the page as-is)
Code:
To Print: <a href="javascript:if (window.print != null) { window.print(); }
else { alert('Your browser does not support this method of printing.
Please select Print/File from your Browser Menu.'); }">Click here</a>
or Select File/Print from your Browser Menu.
PDF could mean they keep a harddrive copy, pass-it on, (Viral Marketing) as well.
|

08-04-2006, 04:04 PM
|
|
WebProWorld Pro
|
|
Join Date: Jul 2004
Location: Irvine, CA
Posts: 120
|
|
Cool thanks for the ideas, I've gotten it to work pretty good except for in IE of course, where it tends to still chop off a bit of text.
|

08-20-2006, 01:04 AM
|
 |
WebProWorld 1,000+ Club
|
|
Join Date: Aug 2003
Location: Worldwide
Posts: 7,399
|
|
Should the company logo be included in the print version?
|

08-20-2006, 08:03 AM
|
|
WebProWorld 1,000+ Club
|
|
Join Date: Jul 2003
Location: United Kingdom
Posts: 1,765
|
|
Should the company logo be included in the print version?
Quote:
|
Should the company logo be included in the print version?
|
Why not?
and make sure you add a full URL e.g.
http://www.acomputerportal.com
As tags cannot link to website from hard copies.
Some print-outs allow Water-Marks, a faint background image.
|

08-20-2006, 09:29 AM
|
 |
WebProWorld 1,000+ Club
|
|
Join Date: Aug 2003
Location: Worldwide
Posts: 7,399
|
|
Re: Should the company logo be included in the print version
Quote:
|
Originally Posted by TrafficProducer
|
That is not true! Did you try to print a page of ours?
Check a print review of your pages, e.g http://www.webnauts.net
Quote:
|
Originally Posted by TrafficProducer
Some print-outs allow Water-Marks, a faint background image.
|
I prefer this option instead of a logo. That is just 2 minutes work.
Thanks.
|

08-20-2006, 01:55 PM
|
|
WebProWorld 1,000+ Club
|
|
Join Date: Jul 2003
Location: United Kingdom
Posts: 1,765
|
|
print review of your pages, e.g http://www.webnauts.net
print review of your pages, e.g http://www.webnauts.net
I see a footer with the complete, (of the page to be printed), URL. No other URL's within the page are fully printed.
(This works for other sites as well)
Have you tried this with filenames with underscores in the name e.g. page_two.html etc??
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|