Page 1 of 1

How to print PDF file???

Posted: Tue Jul 18, 2006 12:04 am
by madhu
Pimptastic | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: :arrow: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


hi all , 

am trying to print PDF file using PHP.

am using JAVASCRIPT to call the function when we click on the button.

Code: Select all

<html>
<head>
<script language="javascript">
function myprint()
{
window.parent.framename.focus(); (i have 4 frames.)
window.print();
}
</script>
</head>

<body>
<img name=\"print\" src=\"images/icon_print.gif\"  onClick=\"javascript:myprint()\">
</body>
now problem is , it is printing the entire frame that contains the file.

am trying to print only the pdf file in the frame.

please suggest how to print pdf file.........

waiting for your valuable replies...............

Thanks and regards
Madhu


Pimptastic | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: :arrow: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Posted: Tue Jul 18, 2006 12:24 am
by daedalus__
Since you are calling a JavaScript (not PHP) function, have that function display: none everything on the page that isn't the PDF.

Posted: Tue Jul 18, 2006 4:39 am
by JayBird
Moved to Client Side

Posted: Tue Jul 18, 2006 10:09 am
by feyd
It is possible to add a print button to the PDF. Of course, if the user knows much, they'll notice the print button that Acrobat has in the toolbar it shows with the PDF.

I don't remember the specifics of how to add the button, but you should be able to dig it up fairly easily via google.