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

Free Support Forum - aspose.com

PageSetup.RestartPageNumbering=true insert blank pages

Hi,
I’m using Aspose.Words 14.10 (we are planning to update to the latest version in the near future though).
I’m joining multiple files in the same word file, the result is a single word file with a section for each joined documents.
This works well and the resulting document is a 25 pages word file.
If I do something like

foreach (Section section in outputDoc)
{
section.PageSetup.RestartPageNumbering = true;
}

The result is a 31 pages word files with 6 pages hidden (Word says 31 pages but only 25 are shown).
If I then export in PDF I obtain a PDF file with 6 blank pages.
Is this a known bug I can resolve by updating Aspose.Words?
Is there a workaround for that?

Thanks in advance.

Hi Matteo,

Thanks for your inquiry. To ensure a timely and accurate response, please attach the following resources here for testing:

  • Your input Word documents.
  • Please attach the output Word file that shows the undesired behavior.
  • Please create a standalone console application (source code without compilation errors) that helps us to reproduce your problem on our end and attach it here for testing.

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

Hi tahir.manzoor,
Thanks for your response.
I’ve created a github public repo containing all the info you requested (code is taken from the real project, I couldn’t, for obvious reasons, include my .lic in the project so you will need to provide a valid one for the project to correctly run)

Let me know if you need something more.
Thanks in advance.

Matteo

Hi Matteo,

Thanks for sharing the detail. We have tested the scenario and have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET-15538. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

Hi,
as a follow-up I discovered that by setting
section.PageSetup.OddAndEvenPagesHeaderFooter = false;
the bug does not appear.
Not sure if it can help identifying the bug but this is, at least, the workaround I’ve found (I’ve tested this with Aspose 17.6 btw).

Matteo

@Sapo84

It is nice to hear from you that you have found the workaround of this issue. We have logged this detail in our issue tracking system. We will inform you once this issue is resolved.

Best Regards,
Tahir Manzoor

@Sapo84

Thanks for your patience. It is to inform you that the issue which you are facing is actually not a bug in Aspose.Words. So, we have closed this issue (WORDSNET-15538) as ‘Not a Bug’.

You can use Section.PageSetup.OddAndEvenPagesHeaderFooter = false to resolve the issue.