views:

903

answers:

6

How can we print using print document so that we can control the printer paper size?

  • It must be controlled after web hosting is done without the print dialog popup or javascript popup.
  • It should print on the client's printer after webhosting without the print dialog option and setting the paper size.
  • It should be done in C# .net
+3  A: 

As a user I don't want that when I enter a site someone to change my printer's settings or to take control over my printer.

For security reasons I hope this is not possible.

dexter
+2  A: 

The only way that I've been able to have this amount of control over the printer client side is to create an ActiveX component that would handling the printing interface and go from there. It's not cross-broswer not the cleanest solution; however, it's the only way that I've been able to manage paper size. I looked into a CSS @print options but was not able to find one that could truly control the size.

The only other possibility is to look to see what printing capabilities something like Flash or Silverlight have. I'm not familiar enough to say if they do or don't have what you're looking for; however, it may be another option.

JamesEggers
+1  A: 

I believe a Java applet has the ability to set paper size if you grant it the proper privileges. I think your users will almost certainly have to jump through hoops for this to work...

Eli
A: 

I have looked into this before, and the only way to force things like portrait/landscape etc, is to get the user to install an ActiveX control (or similar).

Javascript or CSS alone cannot do it.

Magnus Smith
+3  A: 

Your best option is to generate PDF-files with the appropriate siez in it. A printer should choose the correct page-size based on that unless the user manually changes it in the print-dialog.

Cirrcumventing the print-dialog is a security-restriction, ActiveX or a firefox-extension is your only alternative then, which might be okay on an intranet-based webapplication.

jishi