Is there a way to print a web page via a SWF?
In my web app, I would like to print a web page via a real, physical pr开发者_运维问答inter using Flash. I want to do this so that typical page headers added by the browser (eg. the URL and "Page x of y") do not get added to the printout.
Perhaps I could generate a PDF and pass it to the SWF, or perhaps I could just send raw HTML ann CSS to the SWF, and then I could call some .print() method via Javascript against the SWF.
So, 1) is this possible? and 2) is there a library (on GitHub perhaps) somewhere that would let me do this?
I would ping a server-side script (php) which would snap shot the page you want and display the image which flash can then print using flash's printjob functionality. Hope that helps!
steps:
- 1) load the page that will display the url snapshot (snapshot taken with php) using a Loader class. Make sure the headers are correct on the php page (so browsers think it's an image).
- 2) use the flash printjob to print the image
精彩评论