Hi, I need to generate XPS file by programmatically printing from WebBrowser control in C#. The "Save the file as" dialog will popup. There is a solution in the link below by Fen Yuan. http://blogs.msdn.com/fyuan/archive/2007/02/24/printing-documents-to-microsoft-xps-document-writer-without-user-interaction.aspx It is kind of a hack as one comment said. It is not robust. Is there a more elegant way? Thanks, GoldTree
GoldTree@home.com wrote: > Hi, > > I need to generate XPS file by programmatically printing from WebBrowser > control in C#. The "Save the file as" dialog will popup. There is a solution > in the link below by Fen Yuan. > > http://blogs.msdn.com/fyuan/archive/2007/02/24/printing-documents-to-microsoft-xps-document-writer-without-user-interaction.aspx > > It is kind of a hack as one comment said. It is not robust. > > Is there a more elegant way? > If you want to print html, see PrintHtml() function in this thread http://tinyurl.com/3fx5na
Hi, I have no problem printing the HTML. The problem is bypassing the "Save the file as" dialog when printing programatically. I later found a thread discussing the same issue in another thread: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1732872&SiteID=1 It seems that there is no easy solution. Regards, GoldTree "Nico" wrote: > GoldTree@home.com wrote: > > Hi, > > > > I need to generate XPS file by programmatically printing from WebBrowser > > control in C#. The "Save the file as" dialog will popup. There is a solution > > in the link below by Fen Yuan. > > > > http://blogs.msdn.com/fyuan/archive/2007/02/24/printing-documents-to-microsoft-xps-document-writer-without-user-interaction.aspx > > > > It is kind of a hack as one comment said. It is not robust. > > > > Is there a more elegant way? > > > > If you want to print html, see PrintHtml() function in this thread > http://tinyurl.com/3fx5na >
GoldTree@home.com wrote: > Hi, > > I have no problem printing the HTML. The problem is bypassing the "Save the > file as" dialog when printing programatically. I don't get any "save as" dialog, except for pdf..