OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [docbook-apps] PDF olinking and FOP


Hi Bob,

  Thanks for your interest !
  You actually need two patches:
1. Fix the url mangling
2. Fix the declaration of named destinations

I could patch the first one with a very ugly patch:

diff -ru /tmp/docbook-xsl-1.75.2+dfsg/fo/xref.xsl
/usr/share/xml/docbook/stylesheet/docbook-xsl/fo/xref.xsl
--- /tmp/docbook-xsl-1.75.2+dfsg/fo/xref.xsl	2009-06-08 07:09:03.000000000 +0200
+++ /usr/share/xml/docbook/stylesheet/docbook-xsl/fo/xref.xsl	2010-07-13
17:47:53.000000000 +0200
@@ -1199,6 +1199,16 @@
         </xsl:when>
         <xsl:when test="$href != ''">
           <xsl:choose>
+            <xsl:when test="$fop1.extensions != 0">
+              <xsl:variable name="mybeg" select="substring-before($href,'#')"/>
+              <xsl:variable name="myend" select="substring-after($href,'#')"/>
+              <fo:basic-link
external-destination="url({concat($mybeg,'#dest=',$myend)})"
+                             xsl:use-attribute-sets="olink.properties">
+                <xsl:copy-of select="$hottext"/>
+              </fo:basic-link>
+              <xsl:copy-of select="$olink.page.citation"/>
+              <xsl:copy-of select="$olink.docname.citation"/>
+            </xsl:when>
             <xsl:when test="$xep.extensions != 0">
               <fo:basic-link external-destination="url({$href})"
                              xsl:use-attribute-sets="olink.properties">

Clearly a filename could contains a # so the patch may not work in all
cases, but I did not feel comfortable patching the make.olink.href
function...

The second one is trickier, as it involve generating each
fox:destination right after the fo:bookmark-tree

diff -ru /tmp/docbook-xsl-1.75.2+dfsg/fo/docbook.xsl
/usr/share/xml/docbook/stylesheet/docbook-xsl/fo/docbook.xsl
--- /tmp/docbook-xsl-1.75.2+dfsg/fo/docbook.xsl	2009-04-23
04:00:30.000000000 +0200
+++ /usr/share/xml/docbook/stylesheet/docbook-xsl/fo/docbook.xsl	2010-07-13
18:20:56.000000000 +0200
@@ -283,6 +283,20 @@
           <xsl:copy-of select="$bookmarks"/>
         </fo:bookmark-tree>
       </xsl:if>
<!-- insert fox:destination -->

  I do not know how to iterate over
$bookmarks/fo:bookmark[@internal-destination]
  So I am stuck right now. Any advice, would be greatly appreciated !

Thanks,

On Tue, Jul 13, 2010 at 6:32 PM, Bob Stayton <bobs@sagehill.net> wrote:
> Hi,
> When FOP was updated to 0.95, the old fox:outline extension element (and its
> descendant elements) for bookmarks was replaced with the XSL-FO 1.1 standard
> fo:bookmark element and its children.  The old fox:outline contained the
> fox:destination elements, but they are not needed in the new bookmarks so
> they were not retained.
>
> However, if they are needed for olink destinations, then they should be
> restored.  I'm not sure where to do that, though.  In the old fop.xsl, they
> were all contained in the fox:outline structure, and were not placed on the
> destination fo:blocks.  I guess the id on the destination block was
> sufficient for connecting a reference through the fox:destination element.
>  Putting them all in the fox:outline was easy, as it could all be done in
> one place.
>
> Can fox:destination be put into the fo:bookmark structure without generating
> errors? If not, can a fox:outline structure still be added along side the
> fo:bookmark structure and not produce errors?  Or does each fox:destination
> have to be placed on the destination block itself?  If the latter, then that
> requires making changes in many places in the stylesheet for all the
> elements that might need them.
>
> Bob Stayton
> Sagehill Enterprises
> bobs@sagehill.net
>
>
> ----- Original Message ----- From: "Mathieu Malaterre"
> <mathieu.malaterre@gmail.com>
> To: "DocBook Apps" <docbook-apps@lists.oasis-open.org>
> Sent: Monday, July 12, 2010 8:31 AM
> Subject: [docbook-apps] PDF olinking and FOP
>
>
>> Hi,
>>
>>  I am wondering if anyone has a complete setup of docbook + pdf +
>> olinking working. After some research pdf olinking is documented as
>> not working with fop:
>>
>> http://www.sagehill.net/docbookxsl/OlinkPrintOutput.html
>>
>>  I believe this is incorrect. I could get it working by patching
>> directly the output fo file to use the following syntax:
>>
>>  <fo:basic-link external-destination="url(my.pdf#dest=myid)">
>>
>> to get the page syntax working:
>>
>>  <fo:basic-link external-destination="url(my.pdf#page=7)">
>>
>> The corresponding my.fo should contains fox:destination named destinations
>> (*):
>>
>> <fox:destination internal-destination="myid"/>
>>
>> I found out that the old fop.xsl was exporting fox:destination
>> elements, but not the new fop1.xsl...
>>
>> Could someone please shed some light on the actual support of named
>> destinations in PDF using fop + docbook 1.75 ?
>>
>> Thanks !
>> --
>> Mathieu
>> (*)
>> http://xmlgraphics.apache.org/fop/0.95/extensions.html#named-destinations
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
>> For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org
>>
>>
>>
>
>



-- 
Mathieu


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]