Convert Word to PDF and Avoid Blank Pages | C# .NET

We have upgraded our license file and *.dll’s files Aspose.Words for .NET to the latest version 21.8.0. We are not getting any errors while processing pdf file. Problem we have now is a single violation with 12 offenses/items in collection is printing 140 pages

First page looks good has first 3 offenses/items. After that we get 138 blank pages, then on page 139 we get the last 3 offense/items and other 6 offense/items are gone nowhere to be found. Not sure what’s going on here or what i can try next

@zracic,

Please compress the following resources into ZIP format and attach the .zip file here for testing:

  • A simplified source Word document
  • Aspose.Words v21.8 generated (PDF) file showing the undesired behavior
  • Your expected (PDF) file showing the desired output. You can create this output file by using old version of Aspose.Words.
  • Provide information about the exact Aspose.Words’ old version number for which there were no problems on your side previously.
  • Please also create a standalone simplified Console Application (source code without compilation errors) that helps us to reproduce this 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 then start investigation into your particular scenario and provide you more information.

This is the pdf file as a results it produces from the app: Results.pdf (536.0 KB)
This is the template that is used to produce the results from the app: PostHearingDocketTemplate.docx (43.9 KB)

Here is the link to download console application and re-producing the problem
https://violations.exavault.com/share/view/2msyn-e1fqu91c

@zracic,

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

We have a paid support now, i would like to get this resolved ASAP.

@zracic,

We tested the scenario and have managed to reproduce the same problem on our end. For the sake of any corrections in Aspose.Words API, we have logged this problem in our issue tracking system with ID WORDSNET-22662. We will further look into the details of this problem and will keep you updated here on the status of linked issue. We apologize for your inconvenience.

@zracic,

Please post a query in our Paid Support Helpdesk/) to be able to raise the priority of WORDSNET-22662.

I did post this in paid support, our system is down because of this we can’t wait too long

@zracic,

I have verified the status of WORDSNET-22662 from our internal issue tracking system; we have already escalated this issue to the priority support level and are currently doing detailed analysis of this issue. We will keep you posted here on further updates and let you know when this issue will get resolved.

@zracic,

Regarding WORDSNET-22662, we have completed the work on this issue and concluded to close this issue with “not a bug” status. The template document contains table with another table inside. The nested table is surrounded by mail merge region:

┌────────────────────────────────┐
│                                │
│ { MERGEFIELD TableStart:Table} │
│ ┌────────────────────────────┐ │
│ │ { MERGEFIELD field }       │ │
│ └────────────────────────────┘ │
│ { MERGEFIELD TableEnd:Table}   │
│                                │
└────────────────────────────────┘

During mail merge Aspose.Words clones nested tables for each data source record. So generated document contains one topmost tables with multiple nested table within single cell:

┌────────────────────────────────┐
│ ┌────────────────────────────┐ │
│ │ { MERGEFIELD field }       │ │
│ └────────────────────────────┘ │
│ ┌────────────────────────────┐ │
│ │ { MERGEFIELD field }       │ │
│ └────────────────────────────┘ │
│ ┌────────────────────────────┐ │
│ │ { MERGEFIELD field }       │ │
│ └────────────────────────────┘ │
│  ...                           │
│ ┌────────────────────────────┐ │
│ │ { MERGEFIELD field }       │ │
│ └────────────────────────────┘ │
└────────────────────────────────┘

However, MS Word and Aspose.Words render this structure in weird way. There is a shape (thick horizontal line) inside document footer. The shape does not fit footer boundary and overlaps the document body a little bit (see 1.png (2.0 KB)).

For unknown reason, sometimes MS Word and Aspose.Words render body content in narrow gap between shape and footer boundary (see 2.png (1.7 KB)).

The same behavior appears when the nested table is copy-pasted few times in MS Word (please see MS.docx (54.4 KB)).

You should modify the template (move the shape downward) to get expected output (please see modified.docx (46.9 KB), expected.docx (42.1 KB) and expected.pdf (223.9 KB)).