1

I have UIElement(Grid) with many components on it. I want to save it as XPS document but without seeing any popup windows like SaveDialog Window.
How to do that?

I have for now something like this:

System.Printing.PrintQueue queue; //as "Microsoft XPS Document Writer"
System.Windows.Xps.XpsDocumentWriter writer = 
       PrintQueue.CreateXpsDocumentWriter(queue);
writer.Write(myUielement);
Jonas
  • 109,920
  • 93
  • 295
  • 369
liriann
  • 13
  • 1
  • 3
  • possible duplicate of [Convert WPF (XAML) Control to XPS Document](http://stackoverflow.com/questions/502198/convert-wpf-xaml-control-to-xps-document) – OJ. Feb 23 '11 at 10:00

1 Answers1

3

You can write any UI element directly to an XPS document without using the "print" functionality. Use the XpsDocument and XpsDocumentWriter classes as dictated here.

Community
  • 1
  • 1
OJ.
  • 28,259
  • 5
  • 53
  • 70