Remove Empty pages while Generating Report

HI Team , I am using Aspose words to generate a report and saving it as pdf into an stream object ,
the issue is I have conditional blocks in my template , so if the condition is false I am not showing the section, but in that case empty page gets added into the final saved document.
I also referred to : Remove Empty Pages from the Document - Free Support Forum - aspose.com but even that is not helping

codeN.docx (13.6 KB)
Template.docx (16.3 KB)

In the template I need a page break before showing the Price details for each of the item inside my data object. but a new empty page gets added at the end .

I have attached the code doc and the test template i am using .
Let me know if you need any other information

This topic has been moved to the related forum: How to Remove Empty Pages of Document using .NET - Free Support Forum - aspose.com