Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open Acrobat Reader/Writer through Javacript code

Status
Not open for further replies.

kishorkar

Programmer
Aug 12, 2003
26
IN
Hi all,


How to open a Acrobat reader/writer through JavaScript code.

Also is it possible to activate the open dialog box through javascript code?

Please reply.

Thanks and Regards,
Kishore
 
kishorkar said:
How to open a Acrobat reader/writer through JavaScript code.
Just open a new window (using the [tt]window.open()[/tt] method) with a URL pointing to a PDF document. This will work as long as the user has PDF documents mapped to Acrobat in their browser.
kishorkar said:
Also is it possible to activate the open dialog box through javascript code?
From within a browser, the answer is no. For good security and privacy reasons, you can't control other applications in this way.

[tt]_______________________________________
Roger [pc2]
The Eileens are out there[/tt]
 
Within your HTML page create a window event like described below.

Code:
<body onLoad="[URL unfurl="true"]http://domain.com/[/URL][i]my_file[/i].pdf">

This will force the browser to used the default program for this MIME type.

Note: If the user doesn't have the Acrobat Plugin the browser will prompt the user to download the file instead.

M. Brooks
 
It's still not working...
Is there any other way to call a acrobat reader using javascript code?

Regards,
Kishore
 
The examples given above are the only way to open a PDF using the Acrobat plugin.

Does your browser have the PDF plugin and if so is it enabled?

M. Brooks
 
I want to open Acrobat Reader through javascript. How will i open it?

What's the syntax or parameter to be used in Window.Open().
 
EXAMPLE:
window.open( URL, name [ , features [, replace ] ] )
Code:
window.open('[URL unfurl="true"]http://domain.com/my_file.pdf','win',[/URL]
'left=20,top=20,width=500,height=500,toolbar=1,resizable=0');
Unfortunately if what I posted before doesn't work. This won't either. You need to make sure the PDF MIME type in your browser is associated with the Acrobat program itself.

M. Brooks
 
I dont want to opent the PDF file in a acrobat reader instead the acrobat reader itself...
 
You want to open the reader without a document?
Why?
From JavaScript within the browser, you can't open other applications (think what would be possible if you could).

[tt]_______________________________________
Roger [pc2]
The Eileens are out there[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top