This is the mail archive of the docbook-apps@lists.oasis-open.org mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [docbook-apps] PDF named destinations using FOP


Well, in my testing, you can get a relative path to work from HTML to PDF,
but not from PDF to PDF, even when it is on the HTTP server.
If I put this in an HTML file:

<a href="myfile.pdf#frag">

and put it in the same directory as the PDF file on the server, then the
link from the HTML to the PDF file works, including opening it to the right
page.  That's nice.

But if the link is from another PDF file, FOP outputs PDF syntax like /URL
(myfile.pdf#frag) for a link.
Then the Adobe Reader control in the browser seems to send an HTTP request
that looks like:

http://myfile.pdf# frag

That is, it doesn't send a relative path, it converts it to an absolute
path, so it won't work.  So I think the problem is with the Adobe Reader
control in the browser messing with the request.

The only exception I have found for relative linking between PDF files is to
use XEP's pseudo protocol "file:" extension, which it uses to form a
different link syntax in the PDF.

Bob Stayton
Sagehill Enterprises
DocBook Consulting
bobs@sagehill.net


----- Original Message ----- 
From: "Jirka Kosek" <jirka@kosek.cz>
To: "Bob Stayton" <bobs@sagehill.net>
Cc: <tim@enigmatec.net>; <docbook-apps@lists.oasis-open.org>
Sent: Wednesday, April 20, 2005 1:41 AM
Subject: Re: [docbook-apps] PDF named destinations using FOP


Bob Stayton wrote:

> But I'm still a bit discouraged with how poorly supported linking
> between PDF files is with the current PDF readers.  I could not get
> links between local PDF files working if they included fragment
> identifiers.  If there is a fragment identifier, then the PDF output
> has "/URI (myfile.pdf#frag)". If you try to browse this locally with
> Acrobat Reader, it thinks you want http://myfile.pdf#frag, which does
> not work.  I tried various combinations of file: protocols, but none
> worked for me on Windows XP.  I could only get fragment identifiers
> to work if I used an absolute URL to a file I installed at that
> address on my website.  Not very flexible.

AFAIK fragment identifiers work only if you are browsing PDF files using
Acrobat Reader Control which is placed inside browser windows. This is
usual behaviour when you follow PDF link from web-page. This works also
on local machine, probably because web browser created absolute URI from
relative one and this passes to Acrobat Reader.

Using this behaviour it is quite simple to implement things like link
from HTML chunk to corresponding part in PDF version of same DocBook
document.

-- 
------------------------------------------------------------------
   Jirka Kosek     e-mail: jirka@kosek.cz     http://www.kosek.cz
------------------------------------------------------------------
   Profesionální ¹kolení a poradenství v oblasti technologií XML.
      Podívejte se na ná¹ novì spu¹tìný web http://DocBook.cz
        Podrobný pøehled ¹kolení http://xmlguru.cz/skoleni/
------------------------------------------------------------------




---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]