On 03/05/07 08:44, Frank Meies - Sun Germany - Development - Software
Engineer wrote:
On 03/02/07 13:45, ianmcr wrote:
I'm fairly new to OOo. I'm working on an export filter to produce
accessible
html. I'm iterating over the text and identifying paragraphs, tables etc.
However, I need a reliable method of identifing soft page breaks.
(At the minute I use the page cursor to insert a marker string at the
end of
each page. However, this causes problems with renumbering lists, headings
etc).
maybe you should use bookmarks instead of strings to mark the end of
each page.
This little macro inserts bookmarks at the positions of the automatic
page breaks. This way, the automatic page break can be identified in the
content.xml file. Note that the document needs to have a layout,
otherwise the page cursor cannot work correctly.
Sub MarkPageBreaks
xDoc = thiscomponent
xText = xDoc.getText
xController = xDoc.getcurrentcontroller
xViewCursor = xController.getViewCursor
xViewCursor.jumpToFirstPage
xViewCursor.jumpToEndOfPage
Dim args2() as new com.sun.star.beans.PropertyValue
pages = xdoc.getrenderercount( xDoc, args2() )
for j = 0 to pages - 1
xbookmark =
xdoc.createinstance("com.sun.star.text.Bookmark")
xbookmark.Name = "PageBreakMark"
xText.inserttextcontent(xViewCursor, xbookmark,true)
xViewCursor.jumpToNextPage
xViewCursor.jumpToEndOfPage
next j
End Sub
Best regards,
Frank
Best regards,
Frank
--
Frank Meies (fme) - OpenOffice.org Writer
OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Sun Microsystems GmbH Frank Meies
Nagelsweg 55 Software Engineer
20097 Hamburg, Germany Phone: (+49 40)23646 671
http://www.sun.de mailto:[EMAIL PROTECTED]
--
Frank Meies (fme) - OpenOffice.org Writer
OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]