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 Jeff Powanda <jp...@vocera.com> on 2007/07/05 19:51:29 UTC

collapsing PDF bookmarks

By default, when you use FOP to generate a PDF file, the bookmarks in
the file are expanded. I'd like to collapse the bookmarks. 

 

In the FOP FAQ
(http://xmlgraphics.apache.org/fop/faq.html#pdf-bookmark-display), it
says that FOP doesn't currently allow you to control bookmark display.
However, it does mention that you could use PDF post-processing to
control bookmarks. Has anyone on this list done that and would you be
willing to share the solution?

 

Regards,

Jeff Powanda


RE: collapsing PDF bookmarks

Posted by Jeff Powanda <jp...@vocera.com>.
Thanks, Paul. You were right. I updated my DocBook stylesheet so that
fo:bookmark sets the starting-state="hide" attribute. When I open the
resulting PDF, bookmarks are collapsed.

Thanks for your help.

Regards,
Jeff Powanda

-----Original Message-----
From: Paul Vinkenoog [mailto:paul@vinkenoog.nl] 
Sent: Thursday, July 05, 2007 6:02 PM
To: fop-users@xmlgraphics.apache.org
Subject: Re: collapsing PDF bookmarks

Hi again,

>> (http://xmlgraphics.apache.org/fop/faq.html#pdf-bookmark-display), it
>> says that FOP doesn't currently allow you to control bookmark
display.
>
> I'm not so sure if that's still correct (not home right now, so I
> can't check). I think if you set the starting-state="hide" attribute
> on a fo:bookmark, FOP will nicely render it as initially collapsed.

Home, checked, yes: FOP fully supports the starting-state attribute
("show" or omit to expand, "hide" to collapse).


Cheers,
Paul Vinkenoog

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


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


Re: collapsing PDF bookmarks

Posted by Andreas L Delmelle <a_...@pandora.be>.
On Jul 7, 2007, at 00:38, Paul Vinkenoog wrote:

> <snip />
>> Interesting. I haven't needed the feature myself, so was unaware
>> that this was implemented. Just one question: is this already true
>> for FOP 0.93, or only for Trunk?
>
> I just gave it a try with 0.93 and it's fully functional in that
> version.

OK, thanks. Right after posting that, I noticed Jeremias already took  
care of the documentation update earlier today.

Nice to know, in any case ;-)

Cheers

Andreas


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


Re: collapsing PDF bookmarks

Posted by Paul Vinkenoog <pa...@vinkenoog.nl>.
Hello Andreas,

>> Home, checked, yes: FOP fully supports the starting-state attribute
>> ("show" or omit to expand, "hide" to collapse).

> Interesting. I haven't needed the feature myself, so was unaware
> that this was implemented. Just one question: is this already true
> for FOP 0.93, or only for Trunk?

I just gave it a try with 0.93 and it's fully functional in that
version.


Greetings,
Paul Vinkenoog

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


Re: collapsing PDF bookmarks

Posted by Andreas L Delmelle <a_...@pandora.be>.
On Jul 6, 2007, at 03:01, Paul Vinkenoog wrote:


Hi Paul

>>> (http://xmlgraphics.apache.org/fop/faq.html#pdf-bookmark- 
>>> display), it
>>> says that FOP doesn't currently allow you to control bookmark  
>>> display.
>>
>> I'm not so sure if that's still correct (not home right now, so I
>> can't check). I think if you set the starting-state="hide" attribute
>> on a fo:bookmark, FOP will nicely render it as initially collapsed.
>
> Home, checked, yes: FOP fully supports the starting-state attribute
> ("show" or omit to expand, "hide" to collapse).

Interesting. I haven't needed the feature myself, so was unaware that  
this was implemented. Just one question: is this already true for FOP  
0.93, or only for Trunk?
In the first case, we could immediately update the FAQ so it reflects  
the correct situation the next time the site is refreshed.

Cheers

Andreas

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


Re: collapsing PDF bookmarks

Posted by Paul Vinkenoog <pa...@vinkenoog.nl>.
Hi again,

>> (http://xmlgraphics.apache.org/fop/faq.html#pdf-bookmark-display), it
>> says that FOP doesn't currently allow you to control bookmark display.
>
> I'm not so sure if that's still correct (not home right now, so I
> can't check). I think if you set the starting-state="hide" attribute
> on a fo:bookmark, FOP will nicely render it as initially collapsed.

Home, checked, yes: FOP fully supports the starting-state attribute
("show" or omit to expand, "hide" to collapse).


Cheers,
Paul Vinkenoog

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


Re: collapsing PDF bookmarks

Posted by Paul Vinkenoog <pa...@vinkenoog.nl>.
Hi Jeff,

> By default, when you use FOP to generate a PDF file, the bookmarks
> in the file are expanded. I'd like to collapse the bookmarks.

> In the FOP FAQ
> (http://xmlgraphics.apache.org/fop/faq.html#pdf-bookmark-display), it
> says that FOP doesn't currently allow you to control bookmark display.

I'm not so sure if that's still correct (not home right now, so I
can't check). I think if you set the starting-state="hide" attribute
on a fo:bookmark, FOP will nicely render it as initially collapsed.

Notice that "hide" is a little misleading: the bookmark itself isn't
hidden, only its children are. Please give it a try; chances are that
you won't need any post-processing tools.


HTH,
Paul Vinkenoog

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


Re: collapsing PDF bookmarks

Posted by Andreas L Delmelle <a_...@pandora.be>.
On Jul 5, 2007, at 19:51, Jeff Powanda wrote:

Hi Jeff
> In the FOP FAQ (http://xmlgraphics.apache.org/fop/faq.html#pdf- 
> bookmark-display), it says that FOP doesn’t currently allow you to  
> control bookmark display. However, it does mention that you could  
> use PDF post-processing to control bookmarks. Has anyone on this  
> list done that and would you be willing to share the solution?

Never did it myself, but there is an example of post-processing with  
iText using Java:

http://xmlgraphics.apache.org/fop/0.93/output.html#pdf-postprocess

It is for a different purpose, and well, it seems there is a caveat  
preventing the use of bookmarks. That was so for older FOP versions,  
but I have no idea whether this has changed in the meantime... It  
would be cool if someone could check this out.

At http://www.lowagie.com/iText/docs.html, you should find the  
necessary info to tell iText to collapse the bookmarks (if it does  
not swallow them, hopefully...)

I had a quick glance at the iText API docs and I think you need to  
play with com.lowagie.text.pdf.PdfOutline.setOpen(). You can pass a  
boolean flag to indicate whether the children of a given node should  
be visible by default.


HTH!

Cheers,

Andreas


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