Page 1 of 1

Create Bookmarks from XHTML

PostPosted: Wed Mar 05, 2014 6:34 am
by Roil
Hello,

To make a long story short, I am combining a bunch of snippets of XHTML into one giant string. After I have the string, I am sending it to the XHTMLImporterImpl.convert, and it is converting just fine.

However, when combining the snippets of text inside the loop, there is occasionally a heading that gets inserted based on some criteria. My client has requested that I make these headings into bookmarks within the final Word document to use within the Navigation pane. Is there some way that the convert can recognize a h1, h2, h3, etc tag as a heading through the XHTML and wrap it in a bookmark automatically?

I guess the alternative is to piece out the loop and convert every snippet and add it to the document instead of the one giant string. I can then add the headers in dynamically within the loop, but this would require rather extensive changes to the current code that I would like to avoid if possible.

Thanks in advance.

Re: Create Bookmarks from XHTML

PostPosted: Thu Mar 06, 2014 5:29 pm
by jason
named anchors (<a name="blagh">) automatically get converted to bookmarks.

Does that help?