customise printing from ASP or HTML?

Some one ask me how to customise printing from .ASP or HTML or .ASPX page.I got very nice link from aspfaq.com.It says...

Printing happens on the CLIENT. Therefore, you can only control anything to do with printing, from the client... and not from ASP. Changing margins, header & footer, hiding some things on your page from printing, forcing page breaks, and even initiating the printer at all are tasks that can only be accomplished from the CLIENT side. Please keep in mind that you can't (and shouldn't want to) FORCE the user to print your page, or do so without telling them (i.e. allowing them to confirm) that you're about to send data to your printer.
 
This article does a good job of exposing print templates (assuming clients of IE 5.5+): 
   
http://www.webreference.com/js/column89/
 
Mead Co. provides an effective solution which adds the ability to control many of IE's printing features from scripting, such as headers/footers/margins/landscape: 
   
http://www.meadroid.com/scriptx/index.htm
 
HTMLPrinting.com also has a product that allows you to control printer settings: 
   
http://www.htmlprinting.com/
 
Heidi Housten demonstrates a way to invoke the Print dialog: 
   
http://members.tripod.com/~housten/printing.html
 
You can hide things from printing by using a different style sheet setting for screen and print media types: 
   
http://www.w3.org/TR/REC-CSS2/media.html
 
And you can force a page break at certain points in your document: 
   
http://www.w3.org/TR/REC-CSS2/page.html
 
A couple of other useful printing articles can be found here: 
   
http://msdn.microsoft.com/workshop/author/script/dhtmlprint.asp 

   
http://www.htmlgoodies.com/beyond/css_print.html
 

Suresh Behera

No Comments