Server side printing
-
Hi all, I've got a small issue I need to figure out and I thought someone might have the answer. I need to send a print job (HTML page) to a networked printer connected to the web server, rather than the client's printer. Essentially this is a letter printing exercise for a corporate application. The letters are written with a wysiwyg, web-based HTML editor. They can then either be printed (for posting to the recipient) or emailed (which is, as you would expect, a doddle). Printing is causing some issues in that, while it's extremely simple to get a print job to a client-side printer, printing to a printer connected to the server is a bit of a nonsense. I thought of creating an instance of a web browser control on the server side and programmatically filling it with the HTML and asking it to print, but apparently this will pop up a dialog on the server, which is less than desirable. At the moment my solution is to do some fairly arcane transformations on the HTML in order to turn it into postscript, fire the postscript at a printer (which is relatively easy), and hope to god the printer understands it. Most of ours are HP printers and cope admirably with being given raw postscript, but it's not really a future-proof solution. If the users end up getting a new printer that doesn't understand postscript natively, they'll just be printing what will look like complete gibberish. If anyone's got a nice, slick answer to this, I'd appreciate it. The postscript solution has a certain raw charm, but it's nowhere near as elegant as it should be. Something I can actually show my boss without being slapped round the back of the head would be good.
-
Hi all, I've got a small issue I need to figure out and I thought someone might have the answer. I need to send a print job (HTML page) to a networked printer connected to the web server, rather than the client's printer. Essentially this is a letter printing exercise for a corporate application. The letters are written with a wysiwyg, web-based HTML editor. They can then either be printed (for posting to the recipient) or emailed (which is, as you would expect, a doddle). Printing is causing some issues in that, while it's extremely simple to get a print job to a client-side printer, printing to a printer connected to the server is a bit of a nonsense. I thought of creating an instance of a web browser control on the server side and programmatically filling it with the HTML and asking it to print, but apparently this will pop up a dialog on the server, which is less than desirable. At the moment my solution is to do some fairly arcane transformations on the HTML in order to turn it into postscript, fire the postscript at a printer (which is relatively easy), and hope to god the printer understands it. Most of ours are HP printers and cope admirably with being given raw postscript, but it's not really a future-proof solution. If the users end up getting a new printer that doesn't understand postscript natively, they'll just be printing what will look like complete gibberish. If anyone's got a nice, slick answer to this, I'd appreciate it. The postscript solution has a certain raw charm, but it's nowhere near as elegant as it should be. Something I can actually show my boss without being slapped round the back of the head would be good.
with dotnet framework 2 , it will always ask for that print dialog. it was possible with framework 1.1.
-
with dotnet framework 2 , it will always ask for that print dialog. it was possible with framework 1.1.
-
i tried that with js but no luck U can go throw http://codingforums.com/archive/index.php?t-224.html[^] or type "window.print + no dialog" and check for results.
-
i tried that with js but no luck U can go throw http://codingforums.com/archive/index.php?t-224.html[^] or type "window.print + no dialog" and check for results.
So... it might be possible to run a web browser instance on the server, insert the HTML I want to print, and tack the javascript on the end? That's kind of intriguing, I'm going to take a look at that. I suspect some of the posts further down that page mean that I'm not likely to get very far, since MS seem to have locked that functionality down in XP, but... the server in question is running 2000... Hmmm... Thanks, I'll look into this and see how far I get.