Detecting page breaks in DOC files

Hi,

I created a simple file that has 2 pages that were created using OpenOffice.org (see attachment). These pages were created by inserting a page break at the end of the first paragraph.

I haven’t been able to detect these pages programatically using Aspose.Words. I had implemented a DOC file parser on my own and I think the problem is that these kind of page breaks are associated with the paragraph properties and there is no control character inserted in the text.

Per the MS specifications, the paragraph property modifier (sprm PAP) at byte offset 0x2407 (sprmPFPageBreakBefore) will be set to 1 if the paragraph has a page break before it.

Is there any way I can extract this kind of page break programatically using Aspose.Words for Java?

Look forward to hearing from you.
Thanks.

Hi
Thanks for your request. Yes, you are right; page break in your document is specified by “Page Break Before” property of the second paragraph. Please see the attached screenshot. You can find this property in ParagraphFormat:
https://reference.aspose.com/words/java/com.aspose.words/paragraphformat/#getPageBreakBefore
Hope this helps. Please let me know if you need more assistance, I will be glad to help you.
Best regards,

Thanks a lot Alexey. This was exactly what I was looking for.

Take care.