Free Support Forum - aspose.com

Get the pagenumber of Node

Hi Aspose Team:
We have some problems when getting the pagenumber of the Node in document. I’ve tried the following code but need to use plenty of times and it cost much time.Is there any quicker way to get the pagenum or can you reduce the time of this method? It will helps us a lot.

LayoutCollector lc = new LayoutCollector(doc);
int pageNumber = lc.GetStartPageIndex(node);

@ChangYuan,

To ensure a timely and accurate response, please ZIP and attach the following resources here for testing:

  • Your simplified input Word document
  • Please also create a standalone simple Console application (source code without compilation errors) that helps us to reproduce your current problem on our end and attach it here for testing. Please do not include Aspose.Words DLL files in it to reduce the file size.

As soon as you get these pieces of information ready, we will start investigation into your scenario and provide you more information. Thanks for your cooperation.

It meets our requirements by reducing the initialization of LayoutCollector, however we still have problem when we use this method to get the pageindex. This zip file contains a docx file which has 15 pages in total, but the return value of GetStartPageIndex can be 17.
GetPageIndexDemo.zip (208.4 KB)

@ChangYuan,

We are working on your query and will get back to you soon.