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 Sven <tz...@gmx.de> on 2005/10/18 12:33:34 UTC

basic-link internal-destination - problem

  Hi there,
i read about FOP's problem, not being able to display leaders & co as 
links. In my case i have just simple text that is used as an internal 
hyperlink. FOP renders the page successfully without any warning about 
missing referenced IDs, so i have to assume everything works fine. But 
indeed none of the links is "clickable".
I am using the latest trunk from repository (revision 325900). Am i 
missing something important? Thanks for help :)


<?xml version="1.0" encoding="utf-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
    <fo:layout-master-set>
        <fo:simple-page-master margin="4.5cm" page-width="21cm"
            page-height="29.7cm" master-name="titlepage">
            <fo:region-body />
        </fo:simple-page-master>
        <fo:simple-page-master margin="2.5cm" page-width="21cm"
            page-height="29.7cm" master-name="default">
            <fo:region-body margin-bottom="1cm" margin-top="1cm" />
        </fo:simple-page-master>
    </fo:layout-master-set>
    <fo:page-sequence master-reference="titlepage">
        <fo:flow flow-name="xsl-region-body">
            <fo:block space-after="12pt" space-before="4em"
                font-weight="bold" font-size="14pt" font-family="Helvetica">
                <fo:basic-link internal-destination="Einleitung">
                Inhaltsverzeichnis
                </fo:basic-link>
            </fo:block>
            <fo:list-block line-height="1.5em" font-size="12pt"
                font-family="Times">
                <fo:list-item>
                    <fo:list-item-label end-indent="label-end()">
                        <fo:block>1.</fo:block>
                    </fo:list-item-label>
                    <fo:list-item-body start-indent="body-start()">
                        <fo:block>
                            <fo:basic-link
                                internal-destination="Einleitung">
                                Einleitung
                            </fo:basic-link>
                            <fo:leader leader-length.optimum="100%"
                                leader-pattern="dots" />
                            <fo:page-number-citation
                                ref-id="Einleitung" />
                        </fo:block>
                    </fo:list-item-body>
                </fo:list-item>
                <fo:list-item>
                    <fo:list-item-label end-indent="label-end()">
                        <fo:block>2.</fo:block>
                    </fo:list-item-label>
                    <fo:list-item-body start-indent="body-start()">
                        <fo:block>
                            <fo:basic-link
                                internal-destination="Zusammenfassung 
und Ausblick">
                                Zusammenfassung und Ausblick
                            </fo:basic-link>
                            <fo:leader leader-length.optimum="100%"
                                leader-pattern="dots" />
                            <fo:page-number-citation
                                ref-id="Zusammenfassung und Ausblick" />
                        </fo:block>
                    </fo:list-item-body>
                </fo:list-item>
            </fo:list-block>
        </fo:flow>
    </fo:page-sequence>
    <fo:page-sequence master-reference="default">
        <fo:flow flow-name="xsl-region-body">
            <fo:block space-after="0.5em" space-before="1em"
                id="Einleitung" font-weight="bold" font-size="14pt"
                font-family="Helvetica">
                1. Einleitung
            </fo:block>
            <fo:block text-align="justify" font-size="12pt"
                font-family="Times">
                Obwohl die agentenorientierte Softwareentwicklung im
                vergangenen
            </fo:block>
        </fo:flow>
    </fo:page-sequence>
    <fo:page-sequence master-reference="default">
        <fo:flow flow-name="xsl-region-body">
            <fo:block space-after="0.5em" space-before="1em"
                id="Zusammenfassung und Ausblick" font-weight="bold"
                font-size="14pt" font-family="Helvetica">
                2. Zusammenfassung und Ausblick
            </fo:block>
            <fo:block text-align="justify" font-size="12pt"
                font-family="Times">
                Darüber hinaus soll ein Ausblick auf weitere
                Integrationsmöglichkeiten gemacht werden.
            </fo:block>
        </fo:flow>
    </fo:page-sequence>
</fo:root>


Re: basic-link internal-destination - problem

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
I see. Fixing that will take a little longer and I have higher
priorities right now (like pushing for the release). At least you
currently land on the right page when clicking a link. I'll see to it
that this issue doesn't get forgotten.

If anyone wants to try to implement the missing functionality, here you
have a few pointers:
- See BasicLinkLayoutManager, LinkResolver and
PDFRenderer.renderInlineParent().
- PDF Reference 1.4, Chapter 8.5.3 "Action Types", see Go-To Actions.
Looks like this in the PDF:
45 0 obj
<< /Type /Action
/S /GoTo
/D [24 0 R /XYZ 0.0 841.889 null]
>>
endobj

- The idReferences Map in PageViewport is already there but not filled.
That's where the information about the location of a target could be
stored. Since the Renderer determines the absolute coordinates of a mark
on a page, it's the renderer which will supply the location information
to the PageViewport.
- This whole thing should probably be looked at in concert with the old
fox:destination extension object which we need to bring back to FOP
Trunk at some point.

On 20.10.2005 14:38:49 Sven wrote:
> Well, it almost works  :)
> Just on thing: As far as i remember, PDFs are able not only to link at a 
> given page, but within an anchor in a page. I have attached another 
> document (sorry, its a bit larger this time, but without enough text you 
> can not reproduce the bug), that shows what i mean. Clicking in the 
> summary on one of the subchapter will lead you to the beginning of the 
> page, that contains the the subchapter, not to the subchapter itself on 
> the page.
> 
> Thanks for your quick reply
> 
> Sven
> 
> > I've done a change that should fix the bug for you. Would you please
> > update your working copy and retry? Please let me know if it works.
> > Thanks for preparing the example FO file in the first place! That helped
> > a lot.
> >
> > This is the fix:
> > http://svn.apache.org/viewcvs?rev=326133&view=rev
> >
> > On 18.10.2005 13:00:25 Jeremias Maerki wrote:
> >  
> >
> >> Looks like you hit a bug in FOP Trunk. I'll need to investigate this a
> >> bit more closely. I will get back to you.
> >>
> >> For the fop-devs: The internal-destination is properly set on the area
> >> tree but the PDFRenderer doesn't find the right pageReference in
> >> renderInlineParent() and thus skips generating the PDFLink object. Maybe
> >> there's a general problem with forward references there.
> >>
> >> On 18.10.2005 12:33:34 Sven wrote:
> >>   
> >>
> >>>  Hi there,
> >>> i read about FOP's problem, not being able to display leaders & co 
> >>> as links. In my case i have just simple text that is used as an 
> >>> internal hyperlink. FOP renders the page successfully without any 
> >>> warning about missing referenced IDs, so i have to assume everything 
> >>> works fine. But indeed none of the links is "clickable".
> >>> I am using the latest trunk from repository (revision 325900). Am i 
> >>> missing something important? Thanks for help :)
> >>>     
> >>
> >
> > <snip/>
> >
> >
> > Jeremias Maerki
> >  
> 



Jeremias Maerki


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


Re: basic-link internal-destination - problem

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
I've done a change that should fix the bug for you. Would you please
update your working copy and retry? Please let me know if it works.
Thanks for preparing the example FO file in the first place! That helped
a lot.

This is the fix:
http://svn.apache.org/viewcvs?rev=326133&view=rev

On 18.10.2005 13:00:25 Jeremias Maerki wrote:
> Looks like you hit a bug in FOP Trunk. I'll need to investigate this a
> bit more closely. I will get back to you.
> 
> For the fop-devs: The internal-destination is properly set on the area
> tree but the PDFRenderer doesn't find the right pageReference in
> renderInlineParent() and thus skips generating the PDFLink object. Maybe
> there's a general problem with forward references there.
> 
> On 18.10.2005 12:33:34 Sven wrote:
> >   Hi there,
> > i read about FOP's problem, not being able to display leaders & co as 
> > links. In my case i have just simple text that is used as an internal 
> > hyperlink. FOP renders the page successfully without any warning about 
> > missing referenced IDs, so i have to assume everything works fine. But 
> > indeed none of the links is "clickable".
> > I am using the latest trunk from repository (revision 325900). Am i 
> > missing something important? Thanks for help :)

<snip/>


Jeremias Maerki


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


Re: fox:destination in FOP Trunk

Posted by Andreas L Delmelle <a_...@pandora.be>.
> On 18.10.2005 20:03:54 Glen Mazza wrote:
>
>> One more issue:  there is an old fox:destination (or something like
>> that) not *yet* in trunk, but I'm unsure if it needs to be--it may  
>> have
>> a 1.1WD replacement.  IIRC fox:destination is for having external
>> bookmarks to a PDF document, so you can go to specific pages of the
>> document with a URL with an anchor (below, "#chapter4"):
>>
>> http://www.mycompany.com/companydoc.pdf#chapter4
>>
>> The 1.1 WD now provides bookmarks, but unfortunately doesn't seem to
>> have a replacement for fox:destination, strange because of its close
>> relationship to them.

At most the XSL-FO spec could have something analogous to HTML's  
anchors. In a way it already has this with the 'id' property. Named  
destinations as such OTOH, are more PDF-specific. At least, that's  
the impression I get...
On our extensions page, there is a warning about possibly all FOs  
with an id property generating named-destinations 'in some future  
version'. I guess that would indeed make the most sense, together  
with a port of fox:destination to the trunk, but *as an extension* to  
deal with the PDF-renderer specific parameters (like zoom settings,  
open-in-new-window etc.)

Cheers,

Andreas


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


Re: fox:destination in FOP Trunk

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
Bugzilla issue created for this: http://issues.apache.org/bugzilla/show_bug.cgi?id=37157

On 18.10.2005 20:03:54 Glen Mazza wrote:
> One more issue:  there is an old fox:destination (or something like 
> that) not *yet* in trunk, but I'm unsure if it needs to be--it may have 
> a 1.1WD replacement.  IIRC fox:destination is for having external 
> bookmarks to a PDF document, so you can go to specific pages of the 
> document with a URL with an anchor (below, "#chapter4"):
> 
> http://www.mycompany.com/companydoc.pdf#chapter4
> 
> The 1.1 WD now provides bookmarks, but unfortunately doesn't seem to 
> have a replacement for fox:destination, strange because of its close 
> relationship to them.
> 
> Glen


Jeremias Maerki


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


Re: basic-link internal-destination - problem

Posted by Glen Mazza <gm...@apache.org>.
Jeremias Maerki wrote:

> Looks like you hit a bug in FOP Trunk. I'll need to investigate this a
> bit more closely. I will get back to you.
> 
> For the fop-devs: The internal-destination is properly set on the area
> tree but the PDFRenderer doesn't find the right pageReference in
> renderInlineParent() and thus skips generating the PDFLink object. Maybe
> there's a general problem with forward references there.
> 

One more issue:  there is an old fox:destination (or something like 
that) not *yet* in trunk, but I'm unsure if it needs to be--it may have 
a 1.1WD replacement.  IIRC fox:destination is for having external 
bookmarks to a PDF document, so you can go to specific pages of the 
document with a URL with an anchor (below, "#chapter4"):

http://www.mycompany.com/companydoc.pdf#chapter4

The 1.1 WD now provides bookmarks, but unfortunately doesn't seem to 
have a replacement for fox:destination, strange because of its close 
relationship to them.

Glen

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


Re: basic-link internal-destination - problem

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
Looks like you hit a bug in FOP Trunk. I'll need to investigate this a
bit more closely. I will get back to you.

For the fop-devs: The internal-destination is properly set on the area
tree but the PDFRenderer doesn't find the right pageReference in
renderInlineParent() and thus skips generating the PDFLink object. Maybe
there's a general problem with forward references there.

On 18.10.2005 12:33:34 Sven wrote:
>   Hi there,
> i read about FOP's problem, not being able to display leaders & co as 
> links. In my case i have just simple text that is used as an internal 
> hyperlink. FOP renders the page successfully without any warning about 
> missing referenced IDs, so i have to assume everything works fine. But 
> indeed none of the links is "clickable".
> I am using the latest trunk from repository (revision 325900). Am i 
> missing something important? Thanks for help :)
> 
> 
> <?xml version="1.0" encoding="utf-8"?>
> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
>     <fo:layout-master-set>
>         <fo:simple-page-master margin="4.5cm" page-width="21cm"
>             page-height="29.7cm" master-name="titlepage">
>             <fo:region-body />
>         </fo:simple-page-master>
>         <fo:simple-page-master margin="2.5cm" page-width="21cm"
>             page-height="29.7cm" master-name="default">
>             <fo:region-body margin-bottom="1cm" margin-top="1cm" />
>         </fo:simple-page-master>
>     </fo:layout-master-set>
>     <fo:page-sequence master-reference="titlepage">
>         <fo:flow flow-name="xsl-region-body">
>             <fo:block space-after="12pt" space-before="4em"
>                 font-weight="bold" font-size="14pt" font-family="Helvetica">
>                 <fo:basic-link internal-destination="Einleitung">
>                 Inhaltsverzeichnis
>                 </fo:basic-link>
>             </fo:block>
>             <fo:list-block line-height="1.5em" font-size="12pt"
>                 font-family="Times">
>                 <fo:list-item>
>                     <fo:list-item-label end-indent="label-end()">
>                         <fo:block>1.</fo:block>
>                     </fo:list-item-label>
>                     <fo:list-item-body start-indent="body-start()">
>                         <fo:block>
>                             <fo:basic-link
>                                 internal-destination="Einleitung">
>                                 Einleitung
>                             </fo:basic-link>
>                             <fo:leader leader-length.optimum="100%"
>                                 leader-pattern="dots" />
>                             <fo:page-number-citation
>                                 ref-id="Einleitung" />
>                         </fo:block>
>                     </fo:list-item-body>
>                 </fo:list-item>
>                 <fo:list-item>
>                     <fo:list-item-label end-indent="label-end()">
>                         <fo:block>2.</fo:block>
>                     </fo:list-item-label>
>                     <fo:list-item-body start-indent="body-start()">
>                         <fo:block>
>                             <fo:basic-link
>                                 internal-destination="Zusammenfassung 
> und Ausblick">
>                                 Zusammenfassung und Ausblick
>                             </fo:basic-link>
>                             <fo:leader leader-length.optimum="100%"
>                                 leader-pattern="dots" />
>                             <fo:page-number-citation
>                                 ref-id="Zusammenfassung und Ausblick" />
>                         </fo:block>
>                     </fo:list-item-body>
>                 </fo:list-item>
>             </fo:list-block>
>         </fo:flow>
>     </fo:page-sequence>
>     <fo:page-sequence master-reference="default">
>         <fo:flow flow-name="xsl-region-body">
>             <fo:block space-after="0.5em" space-before="1em"
>                 id="Einleitung" font-weight="bold" font-size="14pt"
>                 font-family="Helvetica">
>                 1. Einleitung
>             </fo:block>
>             <fo:block text-align="justify" font-size="12pt"
>                 font-family="Times">
>                 Obwohl die agentenorientierte Softwareentwicklung im
>                 vergangenen
>             </fo:block>
>         </fo:flow>
>     </fo:page-sequence>
>     <fo:page-sequence master-reference="default">
>         <fo:flow flow-name="xsl-region-body">
>             <fo:block space-after="0.5em" space-before="1em"
>                 id="Zusammenfassung und Ausblick" font-weight="bold"
>                 font-size="14pt" font-family="Helvetica">
>                 2. Zusammenfassung und Ausblick
>             </fo:block>
>             <fo:block text-align="justify" font-size="12pt"
>                 font-family="Times">
>                 Darüber hinaus soll ein Ausblick auf weitere
>                 Integrationsmöglichkeiten gemacht werden.
>             </fo:block>
>         </fo:flow>
>     </fo:page-sequence>
> </fo:root>
> 



Jeremias Maerki


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