title: Custom DocumentPaginator and DocumentViewer WPF
body: <p>I have a custom <code>DocumentPaginator</code>, that creates a table with some values and repeats table header in the beginning of every page. (Similar as <a href="http://tech.pro/tutorial/888/wpf-printing-part-2-pagination" rel="nofollow">here</a>.)
  How can i show pages generated by it in <code>DocumentViewr</code>?</p>
  
  <p>I believe first i need to create an <code>XpsDocument</code>.
  So i tried to use <code>XpsDocumentWriter</code>:</p>
  
  <pre><code>var xpsw = XpsDocument.CreateXpsDocumentWriter(xpsDocument);
  xpsw.Write(paginator);
  </code></pre>
  
  <p>But it doesn't work.
  Does someone have any ideas how to do it?</p>