Free Support Forum - aspose.com

How to check if content is availvle in word page or not

How to check if content is available in page or not. If content is there then we start with new page else not. I have scenario with lots of table data is there, some might be empty. I find a difficult to manage PageBreak. Can you provide condition to check data is present on word page or not.

Note : Dont consider Header and footer as Data.

Thanks,

@sakhan14,

Thanks for your inquiry. Please refer to the following article.
Find and Replace

In your case, we suggest you following solution.

  1. Please implement IReplacingCallback interface.
  2. In IReplacingCallback.Replacing method, move the cursor to the matched node. You can get matched node using ReplacingArgs.MatchNode proeprty.
  3. Insert the page break.

If you still face problem, please ZIP and attach your input and expected output documents here for our reference. We will then provide you more information about your query along with code.