...

View Full Version : Print iFrame Content



C-Bass
06-18-2002, 04:47 PM
Does anybody of u know how to print the content of an iFrame? The Content of the iFrame is just another HTML Page!!!

Thanx and Cheers,
Sepp

QuackHead
06-18-2002, 04:54 PM
right click in the IFrame and select "Print"

this will print the page inside the iframe.


Alternately you could have a button that says "click here to print" or something like that... try this:

In the page that's inside the iframe put this:



<a href="#" onClick="print(); return false;">click here to print this page</a>


that should work.

C-Bass
06-18-2002, 08:52 PM
don't want to put it INSIDE the iFrame!!!!

That's my problem!

Thanx anyway!

QuackHead
06-18-2002, 08:54 PM
whoa, settle down!!!

Explain exactly what you want to do then...

~Quack

Zvona
06-19-2002, 09:28 AM
Brief:
<script type="text/javascript">
function zPrint(oTgt)
{
oTgt.focus();
oTgt.print();
}
</script>

.
.
.
<body>
<iframe name="myFrame" id="myFrame" width="600" height="400" src="about:mozilla></iframe>
<input type="button" value="Print IFRAME" onclick="zPrint(myFrame);" />
</body>

C-Bass
06-19-2002, 02:18 PM
I exactly wanted to do what ZVONA did offer me!!!!
Thanx man :thumbsup:

foof
01-26-2007, 09:27 AM
What if I only want my frame to be printed if I press ctrl+p or if I choose print in the menu, how can I do that?

Mikersson
03-21-2010, 06:55 PM
Brief:
<script type="text/javascript">
function zPrint(oTgt)
{
oTgt.focus();
oTgt.print();
}
</script>

.
.
.
<body>
<iframe name="myFrame" id="myFrame" width="600" height="400" src="about:mozilla></iframe>
<input type="button" value="Print IFRAME" onclick="zPrint(myFrame);" />
</body>



How could you fix same csolution using this code? for me it doesn´t work
I wanna print pictures iframe from the header iframe
<div id="wrapper">
<div id="header">
<iframe id="header" src="header.html" ></iframe>

</div>
<div id="content">
<iframe id="pictures" src="arm001.html" Scrolling="no"> </iframe>

</div>
<div id="footer"><iframe id="footer" src="footer.html" > </iframe></div>
</div>
</body>

check the look here:
http://www.pixelperu.net/iframe/iframe.jpg

barbw
11-20-2010, 05:23 PM
I have used above to print a pdf document in an iframe successfully on firefox, but it doesn't seem to work on IE8. The print dialog comes up, but nothing prints.

Anybody else experienced this, or know how to make it work.

dcmike
09-11-2014, 08:11 PM
Zvona - thanks for the hack!! It is one of the very few I ever found on a coder blog that I just dropped in and it worked



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum