How to print PDF or an image from a page
<p>I have an ASP.NET app (it uses DevExpress v 10.2). There is a button called PRINT on a page. When the button is clicked the application should:
1. extract a file from its DB. The file is either PDF or JPEG (the application knows its type in runtime only) 
2. TO PRINT OUT the file. Some ‘preview’ should be shown to user during this</p>

<p>The question is – how to implement this (the item ‘2’)? There is a well-known method to print out an image using JavaScript like the following:</p>

<pre><code>function DisplayPrintPopup(html) {
    var win = window.open('', 'popup', 'toolbar=no,menubar=no,width=500,height=500,scrollbars=yes');
            self.focus();
            win.document.open();
            win.document.write('&lt;head&gt;&lt;style&gt;&lt;/style&gt;&lt;/head&gt;&lt;body&gt;' + html + '&lt;style&gt;&lt;/style&gt;&lt;/head&gt;&lt;body&gt;');
            win.document.close();
            win.print();
            win.close();
}
</code></pre>

<p>This could be Ok for me. But what to do when a file is  PDF?</p>
