Bug 336592 - XslfoDocumentBuilder should be able to generate a bookmark tree
Summary: XslfoDocumentBuilder should be able to generate a bookmark tree
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 1.6.0   Edit
Assignee: Torkild Resheim CLA
QA Contact: David Green CLA
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2011-02-08 03:42 EST by Torkild Resheim CLA
Modified: 2011-07-26 11:24 EDT (History)
0 users

See Also:


Attachments
Patch for XslfoDocumentBuilder to generate XSL:FO bookmarks (5.86 KB, patch)
2011-02-08 08:20 EST, Torkild Resheim CLA
greensopinion: iplog+
Details | Diff
mylyn/context/zip (13.59 KB, application/octet-stream)
2011-02-08 08:20 EST, Torkild Resheim CLA
no flags Details
mylyn/context/zip (5.50 KB, application/octet-stream)
2011-07-25 21:30 EDT, David Green CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Torkild Resheim CLA 2011-02-08 03:42:52 EST
XSL:FO and PDF both have a feature that allows you to build a document tree or table of contents. In the rendering application this usually shows up as a tree structure that can be used for navigation. The XslfoDocumentBuilder should be able to generate the code for this if a table of contents is available. See http://www.w3.org/TR/xsl/#d0e14206 for more information.
Comment 1 Torkild Resheim CLA 2011-02-08 08:17:18 EST
Have a patch for this. Reassigning to myself.
Comment 2 Torkild Resheim CLA 2011-02-08 08:20:19 EST
Created attachment 188513 [details]
Patch for XslfoDocumentBuilder to generate XSL:FO bookmarks

If a root outline item is set on the builder prior to document building taking place it will generate XSL:FO bookmarks at the beginning of the resulting document. This will in turn show up as an outline when the document is converted to PDF.
Comment 3 Torkild Resheim CLA 2011-02-08 08:20:21 EST
Created attachment 188514 [details]
mylyn/context/zip
Comment 4 Torkild Resheim CLA 2011-06-01 07:46:26 EDT
I consider this issue fixed. The patch just needs to be applied if there is any interest.
Comment 5 David Green CLA 2011-06-06 14:28:17 EDT
Thanks Torkild, your patch looks good.  So far WikiText has taken care of this need by emitting generating content as in-document links (ie: hash-tags) before it gets to the document builder.  Is this patch for use by WikiText, or are you integrating the XslfoDocumentBuilder directly in your code?
Comment 6 Torkild Resheim CLA 2011-06-06 15:42:19 EDT
Hi David,

The patch is for XslfoDocumentBuilder to emit XSL:FO Bookmarks based on the outline generated by WikiText. The end result (after having the FO processed by Apache FOP) is pretty much a table of contents. This is an example where I used WikiText, pages from a MediaWiki instance, Bugzilla queries and JUnit test results to generate release notes in PDF. Depending on your PDF viewer you should be seeing an outline to the left or right of the main content: http://distribute.atmel.no/tools/avr32/beta/as4e-ide-2.7.0.851-readme.pdf (you may have to save the file to disk and open it from there to get the full PDF viewer working).

I only did a few adjustments to various parts of WikiText, all filed as patches in the Eclipse Bugzilla. Then used the "wikitext-to-xslfo" Ant task to generate the XSL:FO.
Comment 7 David Green CLA 2011-07-25 21:30:29 EDT
Patch applied with modifications.  Strengthended the assert in the unit test, also added option to @org.eclipse.mylyn.wikitext.core.util.anttask.MarkupToXslfoTask@ and documentation, so that users of the Ant task can have bookmarks in their PDFs.
Comment 8 David Green CLA 2011-07-25 21:30:32 EDT
Created attachment 200322 [details]
mylyn/context/zip