Thanks,
I translated the macro to C++ and the approach seems to work quite well. I
first iterate from the end to the start of the document inserting pagebreak
markers (ie. pagebreak bookmarks) with paragraphs. Then I iterate forwards
checking the properties of the paragraph to find the start of a new page.
This works well for paragraphs. However, there is a problem with tables. If
a paragraph is a table and I insert a book mark is the bookmark a property
of the table "paragraph" or the table cell containing a paragraph?
This is an issue since a table can span the page break (ie. a table accross
mutiple pages.)
Ian
Frank Meies - Sun Germany - Development - Software Engineer wrote:
>
> 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]
>
>
>
--
View this message in context:
http://www.nabble.com/Finding-automatic-page-breaks-tf3333417.html#a9328498
Sent from the openoffice - dev mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]