Why it can't be done? I spent 2 days researching it. It's just not possible to do it!
Recent versions of Chrome does let parent window access PDF's iframe. But neither FF or IE let me touch the iframe that contains "application/pdf" on it.
The code is simple:
<iframe id="pdfFrame" src="/mydomain/document.pdf"></iframe>
If I call:
pdfFrame.contentWindow.print();
FF says:
Error: Permission denied to access property 'print'
IE says:
SCRIPT65535: Invalid calling object
Has anyone faced the same situation before? Has anyone managed to solve it? Does anyone have a different suggestion? I just want to download a PDF from my own domain and send it gracefully to the printer.
I tried formatting my document with CSS @media. But it's a mess. Only print half of the document no matter what I setup the frame to be 100% everthing.
Thanks!!