We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Detecting Page Changes

Hi there

I have a requirement for parsing a Word document, whereby I’d like to know if the current paragraph being parsed is on a different page to the previous, in other words, page transition detection.
Is there a property from which this can be inferred in the Aspose.Words namespace? I had a look through the Aspose.Words helpfile but I couldn’t see anything that would do this in the Paragraph class If you could let me know if it is indeed possible, I’d be very grateful, thanks!

Eric

Hi Eric,

Thanks for your request. MS Word document is flow document and does not contain any information about its layout into lines and pages. So there is no way to determine on which page and where on the page some particular node is located.

In Aspose.Words we use our own Rendering Engine, which layouts Word document into pages. Using this Rendering Engine it is possible to determine position of the particular node. But currently there is no public API to achieve this.

Could you please tell me why you need to determine whether paragraph is spanned into few pages? Maybe there is an easier way to achieve what you need.

Best regards.

Hi there

We would like this ability to match a node to a page, as we are building a thumbnail-based navigation feature for a new release of of our document localisation package.

A little background first - basically, we read all the paragraphs in a Word document into an ArrayList using Aspose.Words, and present the paragraphs sequentially in a specially numbered, scrollable, “string view.” At the same time, I’m using the Aspose.Words rendering engine to generate individual thumbnails of each page in the Word doc, which we present to the user in our software’s UI.

What we want to do is allow a user to click on a thumbnail, and our string viewer will automatically scroll up or down to the first paragraph for the page being previewed in the selected thumbnail.

I have implemented this for Powerpoint documents, as Powerpoint does have the notion of a page (slide) and it is trivial to reconcile a paragraph with a particular slide. But, as you mentioned, Word does not really associate paragraphs with pages, so it’s difficult for us to implement this feature for Word. Ideally there would be some Paragraph property in the Aspose.Words namespace which gives the number of the page containing the current paragraph, but maybe there is an alternative to this.

Thanks

Eric

Hi Eric,

Thank you for additional information. We have plans to expose layout information of nodes. I linked your request to the appropriate issue. You will be notified as soon as this feature is supported.

Best regards.

Hi Alexey

Thanks for replying. That would be excellent if you exposed layout information of nodes on a page
One question - is there any other property that can be used to infer the page number? For instance, is there a pagebreak field for every page, such that we count the number of occurrances of such fields to derive the current page number?

Thanks

Eric

Hi Eric,

Thanks for your request. Unfortunately, I cannot suggest you any workaround of this issue at the moment. As I mentioned earlier, MS Word document does not contain any information about its layout into pages.

Best regards.

The issues you have found earlier (filed as WORDSNET-2978) have been fixed in this .NET update and this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.
(91)