Important alert: (current site time 7/15/2013 10:40:26 PM EDT)
 

winzip icon

Create Printer Friendly Version of Webpage

Email
Submitted on: 1/16/2009 9:07:16 AM
By: PortJump Pete  
Level: Advanced
User Rating: By 16 Users
Compatibility: ASP (Active Server Pages), HTML, VbScript (browser/client side)
Views: 49901
 
     This code allows you to make a print friendly version of you existing web page with minimal fuss by simply inserting a few tags, and passing the page to the print.asp script. I included a demo page so you can actually see where the tags were placed in the code and how it affects the output. There is a demo page and a readme included. Read the text file, upload the demo pages to your server and all questions shall be answered. And if there not, just email me. Don't forget to vote and feedback is always welcome!
 
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
'**************************************
' for :Create Printer Friendly Version of Webpage
'**************************************
Free to use, although any credit you would like to give is appreciated.
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.


Other 4 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Advanced category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments
9/21/2002 10:37:51 AM

This is just what I have been looking for. Great script and easy to install.

Great Job PortJump Pete

Thank you
(If this comment was disrespectful, please report it.)

 
11/26/2002 2:12:01 AM

Here's my problem.
I wanna let users print the results page from a submission form in asp.
Something like:
Name:
<%
Dim fName
fName = Request.Form ("strFirst")
Response.Write fName
%>
Address:
<%
Dim address1
address1 = Request.Form ("strAddress1")
Response.Write address1
%>
And so on.
But when click on printer friendly version, only "Name:" "Address:" etc appears with no input.
Is there a solution for that or your script won't work in that scenario?

Thanks

LC
(If this comment was disrespectful, please report it.)

 
11/27/2002 8:18:12 AM

Hey LC it may be because after you produce that inbfo and then click the "print Friendly" button it sends you to a another page. You need to make hidden form elements to capture the info so you can pass is it from form_results.asp to print.asp
(If this comment was disrespectful, please report it.)

 
8/13/2003 7:50:49 AM

Can you help I need to create a print friendly version of a result page that pull it's data from an SQL database and displays it in repeat rows down the page.

I've done all the steps explained from the download and it works fine except I'm not retaining the data. Obviously I need to capture the data querystring or such like but can't figure out how? Any suggestions.
(If this comment was disrespectful, please report it.)

 
8/14/2003 5:17:47 AM

Please ignor email of yesterday I think I've worked out how to pass the data. I've added these lines to the printlink.asp page:

myParent = request.querystring("myParent")
myChild = request.QueryString("myChild")
aURL=request.serverVariables("PATH_INFO")
pDom=requ est.servervariables("HOST")

pPath=pDom&aUrl&"?myParent="&myParent
& "&myChild=" &myChild

However now I get the following error:

Server.MapPath() error 'ASP 0173 : 80004005'

Invalid Path Character

/tna/REPORTS/print.asp, line 22

An invalid character was specified in the Path parameter for the MapPath method.

Line 22 is:

text = filesys.openTextfile(server.mappath(page)).readall

Is it because I need to open a dynamic file and this line calls a text one?

Any help would be greatly appreciated.

thanks in anticipation.

TA
(If this comment was disrespectful, please report it.)

 
3/23/2004 10:39:45 AM

Its great script and helped me lot. But one problem is when I view printer friendley version in IE it looks fine but in Netscape it show all vbscript code as well. Is there any solution???
Thanks
(If this comment was disrespectful, please report it.)

 
2/15/2005 4:59:35 AM

Script is very good
(If this comment was disrespectful, please report it.)

 
10/8/2005 2:14:46 AMMarshalls

hi.. i have a problem with my page.. this code only gets the text in the page but not the informations coming from the database.. can you help me with this one? thank you in advance..
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.