c# set printer to print WebBrowser to

Posted on 2011-05-02
Last Modified: 2012-05-11
I have a webbrowser control on my form and I would like it to print to the Microsoft XPS document Writer automatically at a click of a button without the user having to change default printers using C#.

Can this be done?
Question by:davidfy
    LVL 18

    Expert Comment

    by:Dennis Aries
    As far as I know, you cannot do this. There are several reasons, but they all revert back to being a security-related issue.

    LVL 2

    Expert Comment

    not possible in web page project
    LVL 18

    Accepted Solution

    If you are hosting a webbrowser contol in a WinForms form, you can change the default printer through API function calls


    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Bit flags and bit flag manipulation is perhaps one of the most underrated strategies in programming, likely because most programmers developing in high-level languages rely too much on the high-level features, and forget about the low-level ones. Th…
    Introduction                                                 Was the var keyword really only brought out to shorten your syntax? Or have the VB language guys got their way in C#? What type of variable is it? All will be revealed.   Also called…
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now