title: Print XPS document directly in WinRT Windows Store App
body: <p><strong>Question:</strong> Is there any way to print an XPS document in a WinRT app?</p>
  
  <p><strong>Background</strong>: I would like to print an XPS document from my XAML based Windows Store App, but this seems to be impossible. The standard desktop method <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/dd374437(v=vs.85).aspx" rel="nofollow noreferrer">StartXpsPrintJob</a> is not available for Windows Store Apps. The WinRT specific <a href="http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.printing" rel="nofollow noreferrer">Windows.UI.Xaml.Printing</a>/<a href="http://msdn.microsoft.com/en-us/library/windows/apps/br226489.aspx" rel="nofollow noreferrer">Windows.Graphics.Printing</a> methods require an actual UIElement, but WinRT XAML does not support all XPS features, such as non-rectangular clipping paths, opacity masks, etc. (It also does not appear to support <a href="https://stackoverflow.com/questions/15776488/how-to-print-glyph-elements-in-winrt">printing Glyph elements</a>, but that's another story.) So, am I missing something or is there no way to directly print an XPS document from WinRT? Because Windows uses XPS as its print path it seems odd that there is no way to directly provide XPS data for printing.</p>
  
  <p><strong>Update</strong>: I have spent more time trying to print XPS documents directly. Direct2D provides a printing interface, however its APIs only <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/hh847998%28v=vs.85%29.aspx" rel="nofollow noreferrer">accept Direct2D commands</a>. I would like to send XPS data directly, but <a href="http://msdn.microsoft.com/en-ca/library/windows/desktop/hh973242%28v=vs.85%29.aspx" rel="nofollow noreferrer">this page</a> says that "The Windows Print Sub-System and Printer components are ... completely hidden from Direct2D apps."  Currently the only way I can see to print XPS documents would be to convert them into a series of Direct2D commands, which would then be immediately converted back into XPS by the <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/hh847997%28v=vs.85%29.aspx" rel="nofollow noreferrer">PrintControl</a>. This seems unnecessary and inefficient.</p>