How to print PDF file???

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
madhu
Forum Commoner
Posts: 82
Joined: Fri Mar 03, 2006 9:34 am

How to print PDF file???

Post 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]
User avatar
daedalus__
DevNet Resident
Posts: 1925
Joined: Thu Feb 09, 2006 4:52 pm

Post 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.
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

Moved to Client Side
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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.
Post Reply