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 John Brown <jo...@hotmail.com> on 2008/05/21 17:16:31 UTC

Named destination: hyperlink to target in external PDF jumps to first page

Hello All,

I am trying to use named destinations to create a file f1.pdf with
a hyperlink to targets in another file f2.pdf. The hyperlink jumps
to the first page in f2.pdf. I found a message in another newsgroup
that said that this feature does not work for local PDF files; it works
only for PDFs served by a web server. 

1) Is this true?

2) Is there a way to specify a relative path (current directory) with
file:// syntax? file:f2.pdf does not work. I get a message box saying:
"The file or folder smb://f2.pdf/#hello does not exist."
I have to write file:///path/to/f2.pdf, which would not be meaningful
on another computer.

I am currently on Kubuntu Hardy Heron (8.10), although the PDFs
are being created for Windows users. I am using fop-trunk 653186.




  
    
      
    
  
  
    
      Hello World!
         Hello, Book 2
      
    
  





  
    
      
    
  
  
    
      Hello World!
    
  
  
    
      
        
      
      This is the Hello World that I want!
    
  


_________________________________________________________________
Make every e-mail and IM count. Join the i’m Initiative from Microsoft.
http://im.live.com/Messenger/IM/Join/Default.aspx?source=EML_WL_ MakeCount
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Named destination: hyperlink to target in external PDF jumps to first page

Posted by John Brown <jo...@hotmail.com>.
Andreas Delmelle <andreas.delmelle <at> telenet.be> writes:

> 
> On May 21, 2008, at 17:26, John Brown wrote:
> 
> 
> >> 2) Is there a way to specify a relative path (current directory) with
> >> file:// syntax? file:f2.pdf does not work.

<snip/>

> Depending on the answer to my above question, you could try:
> 
> file://./f2.pdf#hello
> 
> HTH!
> 
> Cheers
> 
> Andreas
> 

I got a different error.when I clicked the hyperlink, it immediately
displayed "Timeout on server". Anyway, a post in this mailing-list
(http://article.gmane.org/gmane.text.xml.fop.user/25889) says that
file: urls are always absolute, so it seems that I am out of luck.




---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Named destination: hyperlink to target in external PDF jumps to first page

Posted by Andreas Delmelle <an...@telenet.be>.
On May 21, 2008, at 17:26, John Brown wrote:

Hi John

>>
>> I am trying to use named destinations to create a file f1.pdf with
>> a hyperlink to targets in another file f2.pdf. The hyperlink jumps
>> to the first page in f2.pdf. I found a message in another newsgroup
>> that said that this feature does not work for local PDF files; it  
>> works
>> only for PDFs served by a web server.
>>
>> 1) Is this true?

I haven't checked myself, but it seems possible...
That is: I cannot say off-hand whether fragment identifiers are also  
supposed to work in URIs using the file:// protocol.
I only know for certain that http:// supports them.

Anyone?

>> 2) Is there a way to specify a relative path (current directory) with
>> file:// syntax? file:f2.pdf does not work. I get a message box  
>> saying:
>> "The file or folder smb://f2.pdf/#hello does not exist."
>> I have to write file:///path/to/f2.pdf, which would not be meaningful
>> on another computer.

Depending on the answer to my above question, you could try:

file://./f2.pdf#hello


HTH!

Cheers

Andreas

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Named destination: hyperlink to target in external PDF jumps to first page

Posted by John Brown <jo...@hotmail.com>.
John Brown <johnbrown105 <at> hotmail.com> writes:

> 
> 
> Hello All,
> 
> I am trying to use named destinations to create a file f1.pdf with
> a hyperlink to targets in another file f2.pdf. The hyperlink jumps
> to the first page in f2.pdf. I found a message in another newsgroup
> that said that this feature does not work for local PDF files; it works
> only for PDFs served by a web server. 
> 
> 1) Is this true?
> 
> 2) Is there a way to specify a relative path (current directory) with
> file:// syntax? file:f2.pdf does not work. I get a message box saying:
> "The file or folder smb://f2.pdf/#hello does not exist."
> I have to write file:///path/to/f2.pdf, which would not be meaningful
> on another computer.
> 
> I am currently on Kubuntu Hardy Heron (8.10), although the PDFs
> are being created for Windows users. I am using fop-trunk 653186.
> 

Sorry - I keep forgetting that Hotmail strips out all XML.
I was trying top include my FO files.

<!-- f1.fo -->
<?xml version="1.0" encoding="UTF-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:fox="http://xmlgraphics.apache.org/fop/extensions" font-family="Cambria">
  <fo:layout-master-set>
    <fo:simple-page-master master-name="A4" page-height="29.7cm"
page-width="21cm" margin="2cm">
      <fo:region-body/>
    </fo:simple-page-master>
  </fo:layout-master-set>
  <fo:page-sequence master-reference="A4">
    <fo:flow flow-name="xsl-region-body">
      <fo:block id="hello">Hello World!
         <fo:basic-link external-destination="url('file:f2.pdf#hello')">Hello,
Book 2</fo:basic-link>
      </fo:block>
    </fo:flow>
  </fo:page-sequence>
</fo:root>


<!-- f2.fo -->
<?xml version="1.0" encoding="UTF-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:fox="http://xmlgraphics.apache.org/fop/extensions" font-family="Cambria">
  <fo:layout-master-set>
    <fo:simple-page-master master-name="A4" page-height="29.7cm"
page-width="21cm" margin="2cm">
      <fo:region-body/>
    </fo:simple-page-master>
  </fo:layout-master-set>
  <fo:page-sequence master-reference="A4">
    <fo:flow flow-name="xsl-region-body">
      <fo:block id="page1">Hello World!</fo:block>
    </fo:flow>
  </fo:page-sequence>
  <fo:page-sequence master-reference="A4">
    <fo:flow flow-name="xsl-region-body">
      <fo:block>
        <fox:destination internal-destination="hello"/>
      </fo:block>
      <fo:block id="hello">This is the Hello World that I want!</fo:block>
    </fo:flow>
  </fo:page-sequence>
</fo:root>



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org