Print From Webservice

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • guxiyou
    New Member
    • Oct 2008
    • 3

    Print From Webservice

    I've seen many posts asking how to print from a webservice. However, I've never seen a clear example / how-to or even set of instructions on how to do it. Has anyone seen something like this? I am trying to create a webservice that prints rtf documents (would only be used on a LAN, it obviously wouldn't be available over the internet). I'm trying to do this in C#. Is this possible? Are there any resources that any of you know about to accomplish this task?
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    Have you looked at the PrintDocument class?
    Also, I *think* if the RTF filetype is registered with the system (like you can right click on it and say "print" ) you can do something with the Process class, to just have it print using the program configured to normally handle RTF documents.

    Comment

    • guxiyou
      New Member
      • Oct 2008
      • 3

      #3
      Originally posted by Plater
      Have you looked at the PrintDocument class?
      Also, I *think* if the RTF filetype is registered with the system (like you can right click on it and say "print" ) you can do something with the Process class, to just have it print using the program configured to normally handle RTF documents.
      I agree that the Process class should be helpful, but I don't think it works without a User Profile. When the Process command executes from the webservice will there be a default printer? When it executes will the system know that there is a program configured to handle rtf documents?

      Comment

      • Plater
        Recognized Expert Expert
        • Apr 2007
        • 7872

        #4
        Originally posted by guxiyou
        I agree that the Process class should be helpful, but I don't think it works without a User Profile. When the Process command executes from the webservice will there be a default printer? When it executes will the system know that there is a program configured to handle rtf documents?
        Good point, did not even think of that. I suppose that is the reason you do not have access to the printers ?

        Comment

        • guxiyou
          New Member
          • Oct 2008
          • 3

          #5
          Originally posted by Plater
          Good point, did not even think of that. I suppose that is the reason you do not have access to the printers ?
          That is my only guess. I've setup impersonation: I know that I have sufficient security. I've checked that the printer is installed (I created a log file and printed out the list of all installed printers). I even have gone so far as to allow anon-users to print on the printer. I've verified that my code works when it is NOT in a webservice and it seems to work just fine. Nothing... I always get an error stating that "Settings to access printer 'printer name' are not valid"

          Comment

          • Plater
            Recognized Expert Expert
            • Apr 2007
            • 7872

            #6
            Is there anywhere in the code that that you rely on like "default" settings(whethe r you know it or not?)? Maybe they just don't exist and that is the problem?

            Comment

            Working...