Hi all.
I have noticed something kind of interesting about how FOP is treating
links to other PDF files.
Here is my FO:
<?xml version="1.0" encoding="UTF-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master master-name="first" margin-left="2cm"
margin-right="2cm" margin-bottom="0.5cm" margin-top="0.75cm"
page-width="21cm" page-height="29.7cm">
<fo:region-body/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="first">
<fo:flow flow-name="xsl-region-body" font-size="14pt"
line-height="14pt">
<fo:block font-size="36pt" text-align="center" line-height="40pt"
space-before="0.5cm" space-after="1.0cm">File 1</fo:block>
<fo:block font-size="36pt" text-align="center" line-height="40pt"
space-before="0.5cm" space-after="1.0cm">
<fo:basic-link external-destination="../File%202/file2.pdf"
text-decoration="underline" color="blue">Link to File 2</fo:basic-link>
</fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>
In the sibling "File 2" directory there is an identical file with 1 and
2 reversed.
Feeding this through FOP generates a PDF file where the link does not
work (using any version of Adobe Reader I have tried so far.)
However, if I change the link to this (i.e. if I forget to encode the URL):
<fo:basic-link external-destination="../File 2/file2.pdf"
text-decoration="underline" color="blue">Link to File 2</fo:basic-link>
The link to the PDF now works, and takes you to File 2.
Is this a bug, a feature, or my misunderstanding the spec?
I thought external-destination was supposed to contain a URL, which I
would expect to be encoded as a URL. Yet when I encode it as a URL, the
link doesn't work, and when I "forget" to encode it as a URL, it works.
Another odd thing about this is that if the file it links to is an HTML
file, the encoded URL appears to work as expected. This must be some
kind of "feature" in Adobe Reader itself.
Daniel
--
Daniel Noll Forensic and eDiscovery Software
Senior Developer The world's most advanced
Nuix email data analysis
http://nuix.com/ and eDiscovery software
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]