Re: Named Destination support in FOP 0.94

2007-09-13 Thread Paul Vinkenoog
Hello Tai,

> Thanks so much for your help. I downloaded both flower.fo and link.fo and
> tranform them with FOP 0.94. They are woking in my environment. I tried
>
> http://localhost/flower.pdf#intro
>
> It did jump to the correct section. I don't have FireFox installed in my
> development environment. So I couldn't verify that. I think it is really
> something wrong with my xsl files then. I used XSLT to tranform XML directly
> into PDF. But anyway, since this is for a production environment, I couldn't
> use this if it is not 100% working. But I really appreciate all your help!

You're welcome! Please note that the destinations as such are working 100%.
It's just that browsers still seem to have a thing or two to learn in this
area. But then, named destinations weren't invented for web browsing. Their 
purpose is to allow remote GoTos between documents viewed in a PDF reader.
And that works perfectly. But if your documents are meant for online browsing,
you can't count on them to work flawlessly - or even consistently, alas!


Cheers,
Paul Vinkenoog

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Named Destination support in FOP 0.94

2007-09-13 Thread Tai Hu
Hi Paul,
Thanks so much for your help. I downloaded both flower.fo and link.fo and 
tranform them with FOP 0.94. They are woking in my environment. I tried

http://localhost/flower.pdf#intro

It did jump to the correct section. I don't have FireFox installed in my 
development environment. So I couldn't verify that. I think it is really 
something wrong with my xsl files then. I used XSLT to tranform XML directly 
into PDF. But anyway, since this is for a production environment, I couldn't 
use this if it is not 100% working. But I really appreciate all your help!

Tai

- Original Message 
From: Paul Vinkenoog <[EMAIL PROTECTED]>
To: fop-users@xmlgraphics.apache.org
Sent: Thursday, September 13, 2007 9:59:18 AM
Subject: Re: Named Destination support in FOP 0.94


I wrote:

> ON THE WEB
> --
> (...)
> In Firefox, the GoToRs always work (surprise!), and so do the URI
> links (this time at least).

Playing a bit more with this, I now get all kinds of wrong results
(i.e. landings on the wrong dest) with GoToRs in Firefox. Sometimes
it jumps to the wrong destination, sometimes it even jumps to a
destination if I click on flowers.pdf in the web directory, so it
should go top-of-file (I suppose it had the dest cached).

Bottom line: don't trust any browser to work 100% correctly with
named destinations.


Cheers,
Paul Vinkenoog

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Named Destination support in FOP 0.94

2007-09-13 Thread Paul Vinkenoog
I wrote:

> ON THE WEB
> --
> (...)
> In Firefox, the GoToRs always work (surprise!), and so do the URI
> links (this time at least).

Playing a bit more with this, I now get all kinds of wrong results
(i.e. landings on the wrong dest) with GoToRs in Firefox. Sometimes
it jumps to the wrong destination, sometimes it even jumps to a
destination if I click on flowers.pdf in the web directory, so it
should go top-of-file (I suppose it had the dest cached).

Bottom line: don't trust any browser to work 100% correctly with
named destinations.


Cheers,
Paul Vinkenoog

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Named Destination support in FOP 0.94

2007-09-13 Thread Paul Vinkenoog
Hi Tai,

> Thanks so much for your help. However, I tried exactly as you
> describe. It doesn't work for me. The PDF always open at the top of
> document. I am using FOP 0.94, JDK 5, Windows 2000, Acrobat Reader
> 8.1, and IE6. Do you have any idea why this is not working? Is that
> because my combination of software cause this problem?

I don't know, but I've uploaded some files that may help you find out:
- flowers.fo contains the following named destinations: intro, roses, tulips, 
daisies
- links.fo contains links to all of them (one URI and one GoToR to each 
destination)

I've also added the two PDFs, built here with a freshly installed FOP 0.94

On my system (Win2000, Acrobat Reader 7.0.0, MSIE 6.0, Firefox
2.0.0.6) I get the following results:

LOCAL
-
In Acrobat Reader, the GoToRs work 100% correctly.
In MSIE, the GoToRs don't work (this is as expected), the URI links
work 2 or 3 times out of ten.
In Firefox, I can't open them locally (it immediately asks me if I
want to save it or open it in Acrobat Reader).

ON THE WEB
--
In MSIE, the GoToRs don't work (this is as expected), the URI links
work 5 times out of ten.
In Firefox, the GoToRs always work (surprise!), and so do the URI
links (this time at least).


I suggest that you try the generated PDFs both online
(http://vinkenoog.nl/test/) and on your local computer.

If they don't work for you in Acrobat Reader, it must have something
to do with the version (8.1 vs. 7.0.0). If they do work, rebuild both
PDFs on your computer and see what results you get then.


BTW, I've deliberately placed the fox:destinations in flowers.fo in
all kinds of spots, just to show that the location doesn't matter as
long as daddy is a fo:block. Of course I don't suggest that you should
scatter your destinations all over the place like that in a serious
project!


Please let us know your results!


Kind regards,
Paul Vinkenoog

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Named Destination support in FOP 0.94

2007-09-13 Thread Tai Hu
Hi Paul,
Thanks so much for your help. However, I tried exactly as you describe. It 
doesn't work for me. The PDF always open at the top of document. I am using FOP 
0.94, JDK 5, Windows 2000, Acrobat Reader 8.1, and IE6. Do you have any idea 
why this is not working? Is that because my combination of software cause this 
problem?

Thanks,

Tai

- Original Message 
From: Paul Vinkenoog <[EMAIL PROTECTED]>
To: fop-users@xmlgraphics.apache.org
Sent: Wednesday, September 12, 2007 6:34:33 PM
Subject: Re: Named Destination support in FOP 0.94


> Now if you build flowers.fo -> flowers.fop, the named destinations will be 
> present in the PDF.

Sorry, I meant "flowers.fo -> flowers.pdf" of course.

Paul

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Named Destination support in FOP 0.94

2007-09-12 Thread Paul Vinkenoog
> Now if you build flowers.fo -> flowers.fop, the named destinations will be 
> present in the PDF.

Sorry, I meant "flowers.fo -> flowers.pdf" of course.

Paul

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Named Destination support in FOP 0.94

2007-09-12 Thread Paul Vinkenoog
Hello Tai Hu,

> I want to find a way to add a named destination into PDF file by using FOP 
> 0.94. Then later on, I could open a pdf file by pass in #nameddest= destination> on URL to jump to a particular section. I checked 0.94 change 
> history which states that Named Destination support is added for version 
> 0.94. However, I couldn't find any document on how to use it. Could anyone 
> show me an example of usage of this feature? Thanks!

Let's say your target document is called flowers.pdf, and you want certain 
sections to be reachable from outside the document. To do that, first declare 
this namespace in flowers.fo:

  xmlns:fox="http://xmlgraphics.apache.org/fop/extensions";

And declare the destinations like this:

  
  
  
  

Notes:
- "intro", "tulips", "roses" and "daisies" must be existing ids in flowers.fo;
- the declaration order of the destinations is unimportant, and they don't have 
to be all together either. Just make sure that each  is the 
direct child of a . Any block will do, it doesn't have to be the 
block that bears the corresponding id.

Now if you build flowers.fo -> flowers.fop, the named destinations will be 
present in the PDF.


In the referring document, you can link to flower.pdf's named destinations in 
two ways:

1) URI-style (using a relative or absolute *URL*):

 Surf to relative 
Tulips!
 http://www.nature.com/botany/flowers.pdf#tulips";>Surf to 
absolute Tulips!

   If you're reading flowers.pdf with e.g. Acrobat Reader on your local 
computer and it encounters this type of link, it will launch a web browser and 
pass it the URL. The target file will be opened in the browser.

2) GoToR-style (using a relative or absolute *file path*):

 GoToR to 
relative Tulips!
 GoToR to relative 
Tulips!

   GoToRs work via the local filesystem. Acrobat Reader will open the target 
document itself if the link is a GoToR.
   GotToRs "should not" work across the Web, but in practice FOP-built relative 
GoToRs often did, because of a bug in the source code which generated a URL 
link instead of a GoToR. That bug has been fixed, so I suppose this "feature" 
stopped working in 0.94 (if it didn't, don't count on it to keep working 
forever).


You should also know that web browsers sometimes (Firefox) or often (MSIE) 
screw up if you add a named destination to a URL. They always open the target 
document, but they don't always jump to the targeted named destination 
(however, even if they don't, they do show the named dest in the address bar). 
A lot of investigation and testing has been done in April/May and the PDF 
objects generated by the FOP named destination code are absolutely, 
one-hundred-percentedly compliant with the formal PDF specification. Still 
these errors occur, but they are very erratic: clicking on the same destination 
ten times may get you to the right spot eight times and to top-of-document two 
times. Or the other way round, depending on the browser.


Hope this helps!
Paul Vinkenoog

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Named Destination support in FOP 0.94

2007-09-12 Thread Tai Hu
Hi,
I want to find a way to add a named destination into PDF file by using FOP 
0.94. Then later on, I could open a pdf file by pass in #nameddest= on URL to jump to a particular section. I checked 0.94 change 
history which states that Named Destination support is added for version 0.94. 
However, I couldn't find any document on how to use it. Could anyone show me an 
example of usage of this feature? Thanks!

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]