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 almost working, what's the problem?

server side printing almost working, what's the problem?

Scheduled Pinned Locked Moved ASP.NET
asp-netcsharphtmlcomsysadmin
2 Posts 1 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

    Further to my last post in here, I've been doing some playing around with various bits of ActiveX and all sorts of other things in an effort to get my app to print nicely rendered text when handed a bunch of HTML. I think I'm pretty close. I managed to get all the bugs I can see ironed out, but now I've got what's either silent failure or a different kind of success than I was expecting. Bear with me while I try to explain what I've done, it's a little unconventional. To test with I've set up a page on which the page load event sends some HTML to my print routine. My print routine consists of a new class which inherits System.Windows.Forms.Form (I know, but bear with me). This class creates an ActiveX object (the MS DHTML editor control), passes the HTML string to it as its content, and then asks it to print. I found that, while there are all sorts of problems with printing without displaying the print dialog from a web browser control, the DHTML editor doesn't seem to mind and gives exactly the same result. Anyway, after a lot of messing around with this (as you can imagine, including a windows form in an ASP.NET app caused me a little confusion), I've got to the point where I can load my page, and no errors arise, but I don't get anything out of the printer either. The ActiveX control is being called fine, there are no errors there, but the printout just doesn't arrive. The app has identity impersonate set to true, so I figured it would use the logged on user's default printer, but that doesn't seem to be the case. My next thought was that it might be using the aspnet process's default printer, if such a creature exists, but I don't know how to test for that. Anyone have any ideas on how to resolve this? I feel like I'm really, really close and just need a bit of a nudge.

    O 1 Reply Last reply
    0
    • O orinoco77

      Further to my last post in here, I've been doing some playing around with various bits of ActiveX and all sorts of other things in an effort to get my app to print nicely rendered text when handed a bunch of HTML. I think I'm pretty close. I managed to get all the bugs I can see ironed out, but now I've got what's either silent failure or a different kind of success than I was expecting. Bear with me while I try to explain what I've done, it's a little unconventional. To test with I've set up a page on which the page load event sends some HTML to my print routine. My print routine consists of a new class which inherits System.Windows.Forms.Form (I know, but bear with me). This class creates an ActiveX object (the MS DHTML editor control), passes the HTML string to it as its content, and then asks it to print. I found that, while there are all sorts of problems with printing without displaying the print dialog from a web browser control, the DHTML editor doesn't seem to mind and gives exactly the same result. Anyway, after a lot of messing around with this (as you can imagine, including a windows form in an ASP.NET app caused me a little confusion), I've got to the point where I can load my page, and no errors arise, but I don't get anything out of the printer either. The ActiveX control is being called fine, there are no errors there, but the printout just doesn't arrive. The app has identity impersonate set to true, so I figured it would use the logged on user's default printer, but that doesn't seem to be the case. My next thought was that it might be using the aspnet process's default printer, if such a creature exists, but I don't know how to test for that. Anyone have any ideas on how to resolve this? I feel like I'm really, really close and just need a bit of a nudge.

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

      If it helps at all, I can now discount the notion that it's going to the wrong printer. I set the default printer programmatically and it still doesn't print anything. Any help would be appreciated, particularly from those of you more familiar with COM and ActiveX than I am.

      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