Printing an HTML document

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • C#Schroeder

    Printing an HTML document

    I am creating a print preview screen that will take information from a
    windows application and allow the user to see it as an HTML page. I
    have two buttons on that page. A Save As and a Print button. I have
    the Save As button working, but can't seem to get the Print button to
    work. I want the user to be able to print the HTML page as they see
    it, not as xml code. I am using PrintDialog and PrintDocument and
    know that I need to create a PrintDocument_P rintPage control, however
    I don't know what needs to go into that PrintDocument_P rintPage
    contorl. If someone could point me in the right direction I would
    greatly appreciate it.

    Thanks

  • Nicholas Paldino [.NET/C# MVP]

    #2
    Re: Printing an HTML document

    You really don't want to go that route. If you use a PrintDocument
    class instance, you will basically have to render the HTML yourself, and I
    don't think you want to do that.

    Rather, you will want to have Internet Explorer do it. There are two
    options, one will be by loading the HTML through the WebBrowser control, the
    other is to invoke IE to do it. For more information, check out the
    following archived thread:



    Hope this helps.


    --
    - Nicholas Paldino [.NET/C# MVP]
    - mvp@spam.guard. caspershouse.co m

    "C#Schroede r" <Anthony.Schroe der@gray-research.comwro te in message
    news:1174316377 .386975.150820@ l75g2000hse.goo glegroups.com.. .
    >I am creating a print preview screen that will take information from a
    windows application and allow the user to see it as an HTML page. I
    have two buttons on that page. A Save As and a Print button. I have
    the Save As button working, but can't seem to get the Print button to
    work. I want the user to be able to print the HTML page as they see
    it, not as xml code. I am using PrintDialog and PrintDocument and
    know that I need to create a PrintDocument_P rintPage control, however
    I don't know what needs to go into that PrintDocument_P rintPage
    contorl. If someone could point me in the right direction I would
    greatly appreciate it.
    >
    Thanks
    >

    Comment

    Working...