Re: Opening PDF at specified page
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.javascript archive

Re: Opening PDF at specified page

From: Thomas 'PointedEars' Lahn <PointedEars@web.de>
Date: Tue Apr 25 2006 - 14:24:26 CEST

Andrew Poulos wrote:

> Thanks for the help (lesson?) in JavaScript.

You are welcome. You may see it as a lesson if you think you have learned
something from it :)

> Unfortunately I think the problem is more "serious". I can get a PDF to
> open at a specified page from my computer. I have a second computer on
> which I have loaded IE 6, with the latest updates, and Acrobat 7.07,
> which I downloaded today, installed.
>
> On the second computer any content in the query string of the URL gets
> ignored. That is, I cannot set pagemode, destination, page...

Hmmm.
 
> Of course it works correctly (or appears to) in FF 1.5. I wonder if it's
> some new security feature of IE/Windows?

Unlikely. It is rather an incompatibility between IE and the plugin. In
my previous job at the IBM Help Desk, we encountered strange problems with
the Adobe Reader plugin when IE was updated (with security patches), such
as that no PDF documents were displayed anymore. Reinstalling Adobe Reader
(any version above 5.0) fixed these problems. Maybe that works for you,
too.

But reviewing your code a second time, this line could be a problem:

   newPDF = window.open(url+"#pagemode=bookmarks&page="+page,

Either "&page="+page is part of the query component of the URI, or it is
part of its fragment component (since you want to show a specific page of
the PDF document, the latter is more likely). If the former, it must be
placed before the first "#" (but after the first "?") and can be used as
is (provided that `page' is a decimal number); if the latter, it must be
placed after the first "#" and must be encoded with encodeURIComponent(),
especially the "&". See also RFC3986 "Uniform Resource Identifier (URI):
Generic Syntax", section 3 et seqq.

HTH

PointedEars

-- 
The name of God: J-E-H-O-V-A.  "J"...argh!
[crashes right through the "J"-slab, hanging over a hidden abyss
...eventually pulls himself out of the trap]  Oh boy, what a fool
I am???!!! In Latin, Jehova starts with an "I"!  -- Indiana Jones
Received on Mon May 1 05:20:07 2006