I am working on an filter for producing accessible html. I need to generate
an HTML page for each document page.
My current approach is to iterate through the document from the last page to
the first page inserting bookmarks as pagebreak markers at the start of each
page (as shown in the following snippet).
....
while (pageNumber > 1)
{
xPageCursor->jumpToPage((sal_Int16)pageNumber);
Reference<XTextViewCursor> xTextViewCursor =
xTextViewCursorSupplier->getViewCursor();
xTextRange = xTextViewCursor->getStart();
Reference<XText> xText = xTextRange->getText();
// Create a book mark to use as a page break marker.
Reference <XInterface> xBookMark =
xMultiServiceFactory->createInstance(OUString::createFromAscii("com.sun.star.text.Bookmark"));
Reference <XNamed> xNamed (xBookMark, UNO_QUERY);
xNamed->setName(OUString::createFromAscii(m_pagebreakMarker.c_str()));
Reference <XTextContent> xTextContent (xBookMark, UNO_QUERY);
// Insert the page break bookmark.
xText->insertTextContent(pagebreakXTextRange,
xTextContent,true);
--pageNumber;
}
...
This scheme breaks if there is a graphic, embedded object etc, at the start
of the page. How do I detect graphics, embedded objects, etc in the first
paragraph of a page?
(I tried testing the xTextRange above for the property TextPortionType =
"Frame", however this throws an exception).
Any advice, suggestions or alternatives are greatly appreciated.
--
View this message in context:
http://www.nabble.com/inserting-book-marks-as-page-breaks-tf3680948.html#a10287097
Sent from the openoffice - api dev mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]