Click here to Skip to main content
15,898,036 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I use this function in the 'onClientClick' of an 'ASP:ImageButton'
HTML
<script type="text/javascript">

    function PrintIframe() {

        window.frames["FrameXps"].focus();
        window.frames["FrameXps"].print();
    }

</script>

to print the content of an iframe named "FrameXps":
ASP.NET
<iframe ID="FrameXps" name="FrameXps"  runat="server" src='' style="width: 100%; height: 100%"></iframe>

in which I show dinamically a Xps document. When I press the button to print, I see the print dialog, but when I choose a printer nothing happens! Everything works right if I try to print a bitmap as content of the iframe instead of a xps document.

There is another way to print Xps documents?

Any help would be pleasant!
Posted
Comments
Marc Gabrie 26-Nov-13 16:16pm    
XPS is not a format supported by web browsers (maybe IE is the only which may display it, not sure)
And to print that format, some XPS software (like the XPS Viewer) needs to be installed at the client machine. Why are you trying to print XPS format? Don't you have any other way to use PDF or an image instead?
Sara Noemi 27-Nov-13 5:59am    
I need to use XPS format because the document is generated by a printing from the XPS Microsoft Document Writer virtual printer and there is no way to convert it in PDF or image because I can't use external tool, like GhostScript for example.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900