Question

I have seen examples of printing from a windows application but I have not been able to find a good example of any way of doing this.

Was it helpful?

Solution

I've used the print style sheet

here's and article http://alistapart.com/stories/goingtoprint/ that will go through the way to set that up. Rather than setting up a special page that would need to be maintained as well.

OTHER TIPS

If you just need to print your web page from the client-side use window.print(). Sample could be found here: http://www.javascriptkit.com/howto/newtech2.shtml. I would suggest preparing a special version of your page first with no dynamic content and with a layout which would look nice on print.

If you need to send something to printer on the server-side that would be a little bit more complicated. Check out this MSDN article on how to do the basic printing.

The browser prints your pages. If you need to tweak the page so it looks better on the printer, use CSS @media selectors.

Restating what others have said, you just need to call window.print() in javascript. That and build a separate css for print.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top