[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] fo:basic-link to non-pdf file


Subject: Re: [xsl] fo:basic-link to non-pdf file
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Sat, 23 Feb 2013 22:32:45 -0500

You are correctly specifying the HTML file from you XSL-FO, Mark.

Based on your evidence, I suspect the problem is with your reader supplying a base-uri that is different than the current directory in which the PDF file is being opened.

The following works for me, formatting it with Antenna House and opening it in Acrobat Reader:

<?xml version="1.0" encoding="US-ASCII"?><!--basic-link3.fo-->
<root xmlns="http://www.w3.org/1999/XSL/Format"
      font-family="Times" font-size="20pt">

  <layout-master-set>
    <simple-page-master master-name="frame"
                        page-height="297mm" page-width="210mm"
                        margin-top="15mm" margin-bottom="15mm"
                        margin-left="15mm" margin-right="15mm">
      <region-body region-name="frame-body"/>
    </simple-page-master>
  </layout-master-set>

<page-sequence master-reference="frame">
<flow flow-name="frame-body" xmlns="http://www.w3.org/1999/XSL/Format">
<block>This is a <basic-link external-destination="hello.htm">link test</basic-link>.</block>
</flow>
</page-sequence>
</root>


When I click on "link test", Firefox opens up and shows the "hello.htm" file.

I hope this helps.

. . . . . . . . Ken

At 2013-02-23 16:08 -0700, Mark Wilson wrote:
Hello,
I have been linking PDFs together for some time now, using both internal- and external- destination attributes. Is it possible to go from a pdf document to an html file in the same directory? I've tried several variations, but when I hold my cursor over the link in the PDF document, it always reports as the address:
resource://pdf.js/web/
and it does nothing when clicked.


My target is:
    concat(lower-case(@file-by), '.htm')

I have formulated the external-destination as:
<fo:basic-link>
<xsl:attribute name="external-destination" select="concat(lower-case(@file-by), '.htm')"/>
<xsl:value-of select="@data"/>
</fo:basic-link>


and as (the method I use to connect to another PDF document):
<fo:basic-link>
    <xsl:attribute name="external-destination">
           <xsl:text>url("</xsl:text>
           <xsl:value-of select="concat(@file-by, '.htm')"/>
            <xsl:text>")</xsl:text>
      </xsl:attribute>
    <xsl:value-of select="@data"/>
</fo:basic-link>

What is the correct method, if any?
Thanks,
Mark

--
Mark Wilson
Knihtisk Publishing


--
Public XSLT, XSL-FO, UBL and code list classes in Europe -- Apr 2013 |
Contact us for world-wide XML consulting and instructor-led training |
Free 5-hour lecture: http://www.CraneSoftwrights.com/links/udemy.htm |
Crane Softwrights Ltd.            http://www.CraneSoftwrights.com/s/ |
G. Ken Holman                   mailto:gkholman@xxxxxxxxxxxxxxxxxxxx |
Google+ profile: https://plus.google.com/116832879756988317389/about |
Legal business disclaimers:    http://www.CraneSoftwrights.com/legal |


Current Thread
Keywords