You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by "Kutz Clemens (PEA-FE2/BA-T)" <Cl...@de.bosch.com> on 2002/07/15 14:28:30 UTC

fo:basic-link to external file?

Is there any possibility to create a link to an external file?

I need something like that:
<fo:basic-link external-destination="docs/spec.pdf">...</fo:basic-link>

I know it works with 
<fo:basic-link
external-destination="file:///c:/fop/test/docs/spec.pdf">...</fo:basic-link>
but I have to use relative links.

thx
Clemens Kutz

Re: fo:basic-link to external file?

Posted by Ralf Steppacher <st...@esteam.de>.
Hello Clemens,

> I need something like that:
> <fo:basic-link external-destination="docs/spec.pdf">...</fo:basic-link>

Are you using FOP in a JSP or Servlet and do you use XSL-Transformation 
to produce your FO?


Ralf


Re: fo:basic-link to external file?

Posted by Tobias Haamel <th...@multilink.de>.
Kutz Clemens (PEA-FE2/BA-T) wrote:

>Hi Ralf,
>
>src="file:./docs/spec.pdf" (or src="file:///./docs/spec.pdf")
>doesn't work.
>
>with src="file://docs/spec.pdf" IE looks for an network ressource
>\\docs\spec.pdf. For this reason this could be a solution in a network
>environment.
>
>Unfortunately I would like to avoid the use of a network environment...
>

Yes same for me, this was one of my first solutions. I'm getting the 
following message:

    "There was an error opening this document. No such file or directory."

>
>-----Urspr�ngliche Nachricht-----
>Von: Ralf Steppacher [mailto:steppacher@esteam.de]
>Gesendet: Dienstag, 16. Juli 2002 10:18
>An: fop-user@xml.apache.org
>Betreff: Re: fo:basic-link to external file?
>
>
>Hi Tobias.
>
>  
>
>>But with an relative path, my Acrobat Reader tries to resolve an 
>>internet domain, which is something like "www.docs.com/...".
>>    
>>
>
>Have you tried src="file:./docs/spec.pdf"?
>  
>
>>My next problem is that fop generates the link but the area you can 
>>click on lies above the representing text. In my document TOC 
>>(internal-link) this does not happen.
>>    
>>
>
>I had the same problem with a TOC some time ago and I found out that 
>vertically mispositioned link areas occur depending on the way of how I 
>generate additional space (margins, space-before/-after, padding, etc.). 
>The problem disappeared when I only used space-before/-after on blocks.
>Remove all properties for additional space from your fo and check if the 
>link area is in place.
>  
>

Thanks for that tip. I'll try this and see what happens.


Tobias



Re: fo:basic-link to external file?

Posted by Ralf Steppacher <st...@esteam.de>.
Hi Tobias.

> But with an relative path, my Acrobat Reader tries to resolve an 
> internet domain, which is something like "www.docs.com/...".

Have you tried src="file:./docs/spec.pdf"?


> My next problem is that fop generates the link but the area you can 
> click on lies above the representing text. In my document TOC 
> (internal-link) this does not happen.

I had the same problem with a TOC some time ago and I found out that 
vertically mispositioned link areas occur depending on the way of how I 
generate additional space (margins, space-before/-after, padding, etc.). 
The problem disappeared when I only used space-before/-after on blocks.
Remove all properties for additional space from your fo and check if the 
link area is in place.


HTH
Ralf


Re: fo:basic-link to external file?

Posted by Tobias Haamel <th...@multilink.de>.

Christian Geisert wrote:

> Kutz Clemens (PEA-FE2/BA-T) schrieb:
>
>> Is there any possibility to create a link to an external file?
>>
>> I need something like that:
>> <fo:basic-link external-destination="docs/spec.pdf">...</fo:basic-link>
>
>
> It's as simple as that ;-)
>
> Christian
>
Sorry Christian,

but it is not as simple as this. (maybe a reference to a pdf file is, 
but I want to link every kind of file)
I tried this after I saw that an absolute path declaration works from 
within my generated pdf file.
But with an relative path, my Acrobat Reader tries to resolve an 
internet domain, which is something like "www.docs.com/...".


My next problem is that fop generates the link but the area you can 
click on lies above the representing text. In my document TOC 
(internal-link) this does not happen.


<xsl:template match="script">
    <xsl:variable name="file"><xsl:value-of select="@file"/></xsl:variable>
    <fo:table-cell number-columns-spanned="3" border-width="0.5mm" 
border-style="solid" padding-left="2pt" padding-right="2pt" 
padding-top="2pt" padding-bottom="2pt">
        <fo:block font-size="10pt" font-family="sans-serif" 
line-height="13pt" text-align="justify">
            <fo:basic-link external-destination="{$file}" color="blue" 
show-destination="new"><xsl:value-of select="."/></fo:basic-link>
        </fo:block>
    </fo:table-cell>
</xsl:template>



Regards

    Tobias




Re: fo:basic-link to external file?

Posted by Christian Geisert <ch...@isu-gmbh.de>.
Kutz Clemens (PEA-FE2/BA-T) schrieb:
> Is there any possibility to create a link to an external file?
> 
> I need something like that:
> <fo:basic-link external-destination="docs/spec.pdf">...</fo:basic-link>

It's as simple as that ;-)

Christian