Improve company productivity with a Business Account.Sign Up

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 818
  • Last Modified:

Access is denied when trying to print a frame

I'm getting an access is denied error in Internet Explorer when trying to print a frame.
The reason I need to print the frame and not the window is because I wan't to trigger Adobe Readers print function instead of IEs.
The script works fine if the html file is started from a directory and not on a web server.

Below is the code, if you try to change src of the frame to an object on your on harddrive the script will work.

<SCRIPT LANGUAGE="javascript">
function PrintFrame()

<FRAME name="ContentFrame" SRC="" onLoad='javascript:setTimeout("PrintFrame()", 500)'>
<!-- Increase the Timeout amount if no printing occurs -->

  • 4
  • 2
1 Solution
ZvonkoSystems architectCommented:
You cannot print a frame which is other internet domain then the window where your print command is comming from.
I suppose your window is NOT  * domain.

Also if it  would be the same domain, so far my test go, I did not succeed in telling the pdf to print the window.
I got always the empty print page where pdf document was embedded.

ZvonkoSystems architectCommented:
So the answer is: that cannot be done.
PCK1978Author Commented:
That's true, when my file resides in a directory where my web server can access it my scripts work correct .
this frame works perfect if my page is i.e.
<FRAME name="ContentFrame" SRC="" onLoad='javascript:setTimeout("PrintFrame()", 500)'>

Thx Zvonko
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

ZvonkoSystems architectCommented:
Why then do you not access it realtive to server root?

<FRAME name="ContentFrame" SRC="/images/test.pdf" onLoad='javascript:setTimeout("PrintFrame()", 500)'>

PCK1978Author Commented:
I used the server address because I tried different servers
ZvonkoSystems architectCommented:
Why the grading B???
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now