How to print iFrame content
I want to get a print the content from an iFrame, whereas my Content of the iFrame is just another HTML Page.Earlier i was able to get printout by using window.print() method at that time everything was working fine.But now the print function of the current frame is not allowing me to get printouts.Can anyone help me out with this issue.
Re: How to print iFrame content
To get printout of content from iFrame you need to right click in the iFrame and select Print option this will print the page inside the iFrame or you can select click here to print.In the iFrame page also put this code too.
Code:
<a href="#" onClick="print(); return false;">click here to print this page</a>
Re: How to print iFrame content
Try to use the following code i am sure it will work for you.
Code:
<script>
function iprint(ptarget)
{
ptarget.focus();
ptarget.print();
}
</script>
<body>
<iframe name="theiframe" id="theiframe" width="500" height="200" src="some.file"></iframe>
<input type="button" value="print iframe" onclick="iprint(theiframe);" />
</body>