[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: Mark Wilson <mark@xxxxxxxxxxxx>
Date: Sun, 24 Feb 2013 01:55:47 -0700

Hi Ken,
Your surmise was correct.

The PDF document containing the link was opened by using a link on an HTML page served up by my ISS 8 localhost. When I clicked on the link in the opened PDF, I got that strange "resource://pdf.js/web/ ".

However, opening it with Adobe Reader gave me an almost correct URL: ///C:/Czechout%20Index/builder/work/htm/hello.htm. The three'///' at the beginning of the URL appear to be just the start of my problems.

I suspect one cannot open a PDF file from an HTML page in a browser, then return from that PDF document to an HTML page in the same original directory using a base-uri constructed by <fo:basic-link external-destination> in an XSLT stylesheet (under these conditions).

Thanks for helping me to (maybe) understand this.

Regards,
Mark


On 23/02/2013 20:32, G. Ken Holman wrote:
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 |





-- Mark Wilson Knihtisk Publishing


Current Thread
Keywords