Click to See Complete Forum and Search --> : Print iframes content pdf file using javascript in safari browser


bganesan
May 13th, 2009, 02:53 AM
<HTML>
<script Language="javascript">

function printfile()
{
window.frames['objAdobePrint'].focus();
window.frames['objAdobePrint'].print();
}

</script>
<BODY>

<iframe src="Test.pdf" id="objAdobePrint" name="objAdobePrint" height="250" width="100%" frameborder=0></iframe><br>

<input type="button" value="Print" onclick="javascript: printfile();">

</BODY>
</HTML>

the above code working in Firefox browser, but its not working in safari browser.

if i try to print this pdf file in safari browser i am getting empty page print out.

if i open any pdf file in firefox browser, i can print that pdf file from toolbar File->Print option,
but its not working for safari browser.

any one can help me for above issue?

PeejAvery
May 13th, 2009, 07:51 AM
Is your Safari set to load PDFs in the browser? If not, then it will just download it and your iframe will be blank anyway.

bganesan
May 19th, 2009, 12:33 AM
yes, my safari browser its loading pdf file, but its not printing

PeejAvery
May 19th, 2009, 02:56 PM
Where exactly does it fail to print? Does the preview show correctly? Does it just not send to the printer? Does the printer dialog show up? Can you be more specific?

Because the code works perfectly fine for me.