Why is it so challenging to achieve? I've dedicated 48 hours to research this, yet it seems impossible!
Although recent Chrome versions allow the parent window to access PDFs in iframes, both FF and IE prevent any interaction with the iframe that displays an "application/pdf".
The code snippet is straightforward:
<iframe id="pdfFrame" src="/mydomain/document.pdf"></iframe>
If I try to execute:
pdfFrame.contentWindow.print();
FF throws:
Error: Permission denied to access property 'print'
While IE returns:
SCRIPT65535: Invalid calling object
Has anyone encountered a similar scenario? Any solutions to share? Or perhaps alternative suggestions? All I want is to smoothly download a PDF from my domain and send it directly to the printer.
I experimented with CSS @media to format my document but encountered issues. Despite setting the frame to 100%, only half of the content gets printed.
Appreciate any insights or advice! Thank you!