Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Server side printing

Server side printing

Scheduled Pinned Locked Moved ASP.NET
htmlcsssysadminhelpcareer
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • O Offline
    O Offline
    orinoco77
    wrote on last edited by
    #1

    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.

    S 1 Reply Last reply
    0
    • O orinoco77

      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.

      S Offline
      S Offline
      subrata jana
      wrote on last edited by
      #2

      with dotnet framework 2 , it will always ask for that print dialog. it was possible with framework 1.1.

      O 1 Reply Last reply
      0
      • S subrata jana

        with dotnet framework 2 , it will always ask for that print dialog. it was possible with framework 1.1.

        O Offline
        O Offline
        orinoco77
        wrote on last edited by
        #3

        Fortunately I'm still in a 1.1 world! How do I get around the print dialog?

        S 1 Reply Last reply
        0
        • O orinoco77

          Fortunately I'm still in a 1.1 world! How do I get around the print dialog?

          S Offline
          S Offline
          subrata jana
          wrote on last edited by
          #4

          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.

          O 1 Reply Last reply
          0
          • S subrata jana

            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.

            O Offline
            O Offline
            orinoco77
            wrote on last edited by
            #5

            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.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups