Printing asp.net pages

  • Thread starter Thread starter King Coffee
  • Start date Start date
Hi,

Can some one tell me how I can programmatically print a web pages.

Thanks,
King

Adding a JavaScript print button is fairly easy. There are plenty of
examples you can Google.

Making the page look good on print is as easy as creating a secondary
CSS for print.

Mark's option of creating a PDF of the page also works. You have the
button create the PDF in a "temp" location and then redirect the user to
the file created.

peace and grace,

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

*******************************************
| Think outside the box! |
*******************************************
 
And the javascript will be windows.print()

But it will open the Print dialog box, in the same way as when you click
browser's Print command.


--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://blogs.microsoft.co.il/blogs/egoldin
http://msmvps.com/blogs/egoldin


Gregory A. Beamer said:
Adding a JavaScript print button is fairly easy. There are plenty of
examples you can Google.

Making the page look good on print is as easy as creating a secondary
CSS for print.

Mark's option of creating a PDF of the page also works. You have the
button create the PDF in a "temp" location and then redirect the user to
the file created.

peace and grace,

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

*******************************************
| Think outside the box! |
*******************************************

__________ Information from ESET NOD32 Antivirus, version of virus
signature database 4367 (20090825) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com


__________ Information from ESET NOD32 Antivirus, version of virus signature database 4367 (20090825) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com
 
That's correct. The OP is looking (IMO) for a way to print directly to
a client-side printer bypassing the print dialog, which is why I
advised him to forget it...

Oops! I guess I did not pay attention to the "I don't want to give my
users a choice" part of the post. ;-)

peace and grace,


--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

*******************************************
| Think outside the box! |
*******************************************
 
Back
Top