Re: [xep-support] DocBook olink in PDF

From: <mdamkier@versant.com>
Date: Mon Jul 06 2009 - 03:58:37 PDT

Hi Bob,
Thank you very much for your reply. (And thank you, too, for your book. I
really think that I could not have set up our environment without it.)
I experimented some more and the problem was that I had used <dir>
elements in the site map. For PDF, it turns out that the site map must be
"flat" and, as you said, the baseuri of the <document> element defines the
relative path.

That is, instead of, e.g., this:

    <sitemap>
        <dir name="doc">
            <dir name="a">
                <document targetdoc="AUsersGuide" baseuri="
file:AUsersGuide.pdf">
                    &AUsersGuideTargets; </document>
            </dir>
            <dir name="w">
                <document targetdoc="WUsersGuide" baseuri="
file:WUsersGuide.pdf">
                    &WUsersGuideTargets; </document>
            </dir>
        </dir>
    </sitemap>

I need this:

    <sitemap>
        <dir name="doc">
            <document targetdoc="AUsersGuide" baseuri="
file:../a/AUsersGuide.pdf">
                &AUsersGuideTargets; </document>
            <document targetdoc="WUsersGuide" baseuri="
file:../w/WUsersGuide.pdf">
                &WUsersGuideTargets; </document>
        </dir>
    </sitemap>

Now everything is working. Very cool!

A couple of observations...

It also worked without the top-level <dir> element but the transformation
had the following error:
Olink error: cannot locate targetdoc WUsersGuide in sitemap
This error was not there with the top-level <dir> element.

Also, for complex directory heirarchies, this is not as flexible. For
example, consider this:
doc
    |
    |--a
    | |
    | |--b
    |
    |--w
I have a PDF in each of the directories a, b, and w. To link to the PDF in
'w' from the PDF in 'a' requires a different relative path for the 'w' PDF
than a link to the 'w' PDF from the PDF in 'b'. I can get around that by
having different <document> elements, e.g., WUsersGuideFromA and
WUsersGuideFromB. But I could be missing something.

Michael Damkier
mdamkier@versant.com

Think Outside the Grid!
http://www.versant.com

Versant GmbH is incorporated in Germany.
Company registration number: HRB 54723, Amtsgericht Hamburg.
Registered Office: Wiesenkamp 22b, 22359 Hamburg, Germany.
Geschäftsführer: Jochen Witte.

From:
"Bob Stayton" <bobs@sagehill.net>
To:
<xep-support@renderx.com>
Date:
03.07.2009 23:36
Subject:
Re: [xep-support] DocBook olink in PDF
Sent by:
owner-xep-support@renderx.com

Hi,
As far as I can tell, XEP can form PDF-to-PDF links when the reference
begins with "file:" and is a relative path, not an absolute path. I can't

explain it, but that seems to work. Your goal is to have the FO file
contain something like this:

<fo:basic-link external-destination="url(file:booktest.pdf#chap1)"

In order to get the above result, the DocBook target database <document>
element should have an attribute like:

baseuri="file:booktest.pdf"

When this is working, the cursor in Adobe Reader appears as a plain hand.
When it is a browser link, the hand has a "w" on it.

What I don't get in your setup is where the file:///C:\Documents\ part is
coming from, as it seems to get tacked on before the baseuri value. Does
that show up in the FO file in the external-destination, or only in the
hover display?

Bob Stayton
Sagehill Enterprises
bobs@sagehill.net

----- Original Message -----
From: <mdamkier@versant.com>
To: <xep-support@renderx.com>
Sent: Thursday, July 02, 2009 8:19 AM
Subject: [xep-support] DocBook olink in PDF

> Hello all,
> I am using DocBook 4.5 and 1.32.0 XSL (and 1.51.1) with XEP 4.9. My
system
> is Windows XP.
> I have just started to experiement with cross-document links in PDFs
using
> <olink>. (Following the instructions in Bob Stayton's DocBook XSL book.)
> Everything seems to be working fine. The targets.db files seem to be
> correctly created and the links do show up in the PDF.
> But I cannot get the Acrobat reader to open the link as a PDF. Rather it
> insists on opening the browser. I can control whether the PDF opens in
the
> browser or the browser asks to open in Acrobat, but that is not right. I
> want to open the PDF directly in Acrobat.
> When I hover on the link in the PDF, it has the correct path with the
> file: protocol tacked on, e.g., file:///C:\Documents\Doc1.pdf#fragmentid
.
> If I add the file: protocol to the baseuri attribute in the targetset's
> <document> tag (as mentioned in Stayton) then the PDF link is
> file:///C:\Documents\file:Doc1.pdf#idfragment.
> Hopefully, someone has worked this out and can let me know what I am
doing
> wrong.
> Thank you in advance!
>
> Michael Damkier
> mdamkier@versant.com
>
> Think Outside the Grid!
> http://www.versant.com
>
> Versant GmbH is incorporated in Germany.
> Company registration number: HRB 54723, Amtsgericht Hamburg.
> Registered Office: Wiesenkamp 22b, 22359 Hamburg, Germany.
> Geschäftsführer: Jochen Witte.
>
>
> -------------------
> (*) To unsubscribe, send a message with words 'unsubscribe xep-support'
> in the body of the message to majordomo@renderx.com from the address
> you are subscribed from.
> (*) By using the Service, you expressly agree to these Terms of Service
> http://www.renderx.com/terms-of-service.html
>
>

-------------------
(*) To unsubscribe, send a message with words 'unsubscribe xep-support'
in the body of the message to majordomo@renderx.com from the address
you are subscribed from.
(*) By using the Service, you expressly agree to these Terms of Service
http://www.renderx.com/terms-of-service.html

-------------------
(*) To unsubscribe, send a message with words 'unsubscribe xep-support'
in the body of the message to majordomo@renderx.com from the address
you are subscribed from.
(*) By using the Service, you expressly agree to these Terms of Service http://www.renderx.com/terms-of-service.html
Received on Mon Jul 6 04:38:57 2009

This archive was generated by hypermail 2.1.8 : Mon Jul 06 2009 - 04:39:05 PDT