title: Printing PDF documents from Windows 8 App
body: <p>I'm trying to print a PDF file from my Windows 8 app to connected printer.  I'm coding with WinJS, and know that I have to create a print task to initiate printing from a Windows 8 app.  So, after reviewing the documentation, I have this code:</p>
  
  <pre><code> onPrintTaskRequested: function (e) {
          var self = Application.navigator.pageControl,
              printTask = e.request.createPrintTask("Print Test Doc", function (args) {
                  args.setSource(MSApp.getHtmlPrintDocumentSource(document));
  
                  // Register the handler for print task completion event
                  printTask.oncompleted = self.onPrintTaskCompleted;
              });
      }
  </code></pre>
  
  <p><a href="http://msdn.microsoft.com/en-us/library/windows/apps/hh831251.aspxhttp://msdn.microsoft.com/en-us/library/windows/apps/hh831251.aspx" rel="nofollow">According to the documentation, the MSApp.getHhtmlPrintDocumentSource method</a> accepts a specific set of data types.  As stated in the documentation:</p>
  
  <blockquote>
    <p>This can be the root document, the document in an IFrame, a document
    fragment, or a SVG document. Be aware that htmlDoc must be a document,
    not an element.</p>
  </blockquote>
  
  <p>Apparently I cannot simply set the argument for getHtmlPrintDocumentSource to a .PDF or .PNG binary.  So, I'm curious:  does the WinJS library offer a method for printing so that I can implement the printing of a PDF file to a connected printer?  Can anybody offer some tips to implement?</p>