Discussion:
Printing documents to Microsoft XPS Document Writer without user i
(too old to reply)
GoldTree@home.com
2008-05-23 16:58:00 UTC
Permalink
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
Nico
2008-05-24 08:50:57 UTC
Permalink
Post by ***@home.com
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
2008-05-27 16:40:01 UTC
Permalink
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
Post by Nico
Post by ***@home.com
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
Nico
2008-05-27 21:33:13 UTC
Permalink
Post by ***@home.com
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..

Loading...