Free Support Forum -

Differences between .pdf and .docx file - Aspose.Words - save method


I’m trying to generate pdf from attached DOCX template.
To do it Im using Save(string fileName) method.
But after saving the pdf document doesn’t look like I expected.
There is a problem with dividing row in table. One data row is printed twice when it can’t be fitted at the end of page.

When I’m saving document as doc, it looks good.
I would be satisfied results from DOC but I need to save it as PDF or print it(print method).

Do you have any ideas to help me solve this problem?


var doc = new Document(“Test.docx”);

var dataTable = new DataTable(“data”);
var dataColumn = new DataColumn(“description”, typeof(string));

for (int i = 0; i < 20; i++)
DataRow dataRow = dataTable.NewRow();
dataRow[“description”] = string.Format("{0} - {1}", “Description”, i);

var dataSet = new DataSet();


var fieldNames = new String[]
“header” //1
,“dataheader” //2
,“sum” //3
var fieldValues = new Object[]
“header” //1
,“results” //2
,dataTable.Rows.Count //3

doc.MailMerge.Execute(fieldNames, fieldValues);



Thanks for your inquiry. Perhaps you’re using an older version of Aspose.Words; as with Aspose.Words for .NET version 13.2.0, I was unable to reproduce this issue on my side. I would suggest you please upgrade to the latest version of Aspose.Words 13.2.0. You can download it from here:

Moreover, I have attached the PDF document that is generated on my side here for your reference.

Best regards,