Click here to Skip to main content
15,909,518 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hi,

on my webpage i have header section and Iframe section.In Iframe i am opening PDF file.
On Header i have print button on click of that i want to print PDF file contents which is in iframe. So how to to do that?
I tried on google but i not got any effective solution.
<embed src="vehinvc.pdf" id = "Pdf1" name="Pdf1" hidden>
<a  önClick="document.getElementById('Pdf1').printWithDialog()"> 
and

<OBJECT id = "Pdf2" name="Pdf2" CLASSID="clsid:CA8A9780-280D-11CF-A24D-444553540000" WIDTH="364" HEIGHT="290">
     <PARAM NAME='SRC' VALUE="file.pdf">
</OBJECT>
<a  önClick="document.Pdf2.printWithDialog()">Print file</a> 

It is not working.
If anybody know then plz help..

Thanks.
Posted
Updated 18-Jul-12 21:08pm
v3

I am not sure that you can, because Adobe ends up opening the PDF inside your browser, so you can't use javascript to call print() like you can for a web page.

Have you tried calling print() in javascript ? I doubt it will work, but if it does not, you can't do it.
 
Share this answer
 
 
Share this answer
 
Comments
Manisha Tambade 19-Jul-12 4:16am    
thanks for reply,
I able to print complete window means complete page using window.print but i don't want that instead only iframe content which is my PDF content.
Manisha Tambade 19-Jul-12 8:04am    
in found solution at -http://forums.asp.net/t/1648196.aspx/1
but it printing button also.is there any way to avoid that?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900