473,386 Members | 1,652 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Open Acrobat Reader with javascript

A webpage has the following js:
function openPDF(PDFdoc)

{

// Open a blank window and target PDFdoc into it.

// PDFdoc = web address (URL) of the PDF document to present in a pop-up
window
var new_window = window.open("","pdf",parameters);

new_window.document.location = PDFdoc;

}

The issue is it works OK on Win2kSP4 IE 6.0.2800.1106 Acrobar Reader 6.0.0,
but on Win XP SP1 IE 6.0.2800.1106 Acrobat Reader 6.0.2 it pops up the
window without starting AR. Security settings are the same on both IE.

Please help.

Thank you all.
Jul 23 '05 #1
2 16649
Did you try new_window.location.href = PDFDoc?

Michael wrote:
A webpage has the following js:
function openPDF(PDFdoc)

{

// Open a blank window and target PDFdoc into it.

// PDFdoc = web address (URL) of the PDF document to present in a pop-up
window
var new_window = window.open("","pdf",parameters);

new_window.document.location = PDFdoc;

}

The issue is it works OK on Win2kSP4 IE 6.0.2800.1106 Acrobar Reader 6.0.0,
but on Win XP SP1 IE 6.0.2800.1106 Acrobat Reader 6.0.2 it pops up the
window without starting AR. Security settings are the same on both IE.

Please help.

Thank you all.


Jul 23 '05 #2
Michael wrote:
A webpage has the following js:
function openPDF(PDFdoc) <snip> var new_window = window.open("","pdf",parameters);

new_window.document.location = PDFdoc;


It is bizarre to be doing that (assigning to a location object) as:-

var new_window = window.open(PDFdoc, "pdf", parameters);

- should do much the same without the potential timing issues that
follow from the fact that window opening is asynchronous (so the -
document - could not necessarily be expected to exist mere milliseconds
after the - window.open - call).

Also, - document.location - is usually a reference to the - location -
object on the window's global object, and it is generally considered
preferable to be using that global - location - object directly:-

new_window.location = PDFdoc;

- but not when the URL is used as the first argument to the -
window.open - call.

Richard.
Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Chris | last post by:
Hello all, I wish to automate printing of PDF documents in a C# application. Is there an Adobe .net object? I tried to create a reference to the COM Object Adobe Type Library, but I get error...
4
by: dixie | last post by:
I need to be able to open a pdf file by clicking a button on a form in Access 2000. All computers will have the latest Acrobat Reader already installed on their network. Is there a reference to...
2
by: jimfortune | last post by:
I have modified my GetAcroPath function to: Function GetAcroDir() As String Const LatestVer = 7 Dim strAcroDir(LatestVer - 2) As String Dim I As Integer strAcroDir(1) = "C:\Program...
4
by: Jedi10180 | last post by:
I am making a CD for the non-profit organization I work for. The CD contains all of the publications that we publish and will contain a GUI to access them. When the user clicks on a publication...
0
by: sandeepk84 | last post by:
Hi all.. I have a need to print a pdf file..i was able to open data in the form of pdf file...and that is enough for my problem...but there is a problem.. the code is, //code ...
5
by: CDMAPoster | last post by:
I have changed how I get the shell path for Acrobat Reader based on code posted by John deKrafft. Does anyone see any problems with this code running on various Windows OS's? '--Begin Module...
6
by: Filips Benoit | last post by:
Dear All, All 3 codes, copied from internet, triggers error 429 : ActiveX component can't create object ! No compile error. I have the reference set to Adobe Acrobat 7.0 Type Library I do not...
6
by: Andrew Poulos | last post by:
I'm testing the embedding of a PDF in a page <embed src="test.pdf" style="position:absolute; left:10px; top:10px; width:290px; height:390px;"> </embed> I installed acrobat reader version...
0
by: =?Utf-8?B?QWxoYW1icmEgRWlkb3MgRGVzYXJyb2xsbw==?= | last post by:
Hi all people, everybody, We have multiple versions of Acrobat Reader from 5.x to 8.x, I want to create a method in C# or VB.NET to check to see if the registry key for the versions...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.