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

Free Support Forum - aspose.com

Extra page rendered when converting from Word to PDF

When converting the attached Word document to PDF using the following code I get an extra page on the resultant PDF file. I am using Words 5.2.2, PDF 3.7. Can you tell me what can be done to get rid of the extra page?

Document doc = new Document(wordDocTextBox.Text);

DataSet testDataSet = new DataSet();
DataTable OtherText = new DataTable("EventParameters");
OtherText.Columns.Add("SortName");
OtherText.Columns.Add("SSNLast4");
OtherText.Columns.Add("HireDate");
OtherText.Columns.Add("BirthDate");
DataRow row = OtherText.NewRow();
row["SortName"] = "Mr. Jones (and me)";
row["SSNLast4"] = "1234";
row["HireDate"] = "1/1/2000";
row["BirthDate"] = "1/1/2000";
OtherText.Rows.Add(row);

testDataSet.Tables.Add(OtherText);

doc.MailMerge.ExecuteWithRegions(testDataSet);

MemoryStream mergedStream = new MemoryStream();
// save to special pdf/xml format
doc.Save(mergedStream, SaveFormat.AsposePdf);

//Seek to the beginning so it can be read by XmlDocument.
mergedStream.Seek(0, SeekOrigin.Begin);

//Load the document into an XmlDocument
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(mergedStream);

//Load the XML document into Aspose.Pdf
Aspose.Pdf.Pdf pdf = new Aspose.Pdf.Pdf();
//Make sure the images that were saved by Aspose.Words into Windows temporary
//folder are automatically deleted by Aspose.Pdf when they are no longer needed.
pdf.IsImagesInXmlDeleteNeeded = true;
pdf.BindXML(xmlDoc, null);

//*** Aspose.Pdf font cache, see comments below.
pdf.IsTruetypeFontMapCached = false;

//If you convert to PDF multiple files in your application,
//uncomment the following lines to improve the speed of conversion.
//pdf.IsTruetypeFontMapCached = true;
//pdf.TruetypeFontMapPath =

//Now produce the PDF file.
pdf.Save(Path.ChangeExtension(wordDocTextBox.Text, ".pdf"));

In addition to the extra page rendering. It appears that the Section 2 table is moved to the right some on the converted PDF. I need to get that to hold its position.

Thanks for the help.

Hi,

Thank you for considering Aspose.

I can reproduce this problem. We will investigate this issue and reply to you soon.

Hi,

Thanks for your inquiry.
I am the developer in charge of this issue. I will fix it and send you an update in about one week.

Best regards.

Is there any update on this issue available? Thank you.

Hi,

Sorry for the delay. We have found a solution for it and the fix will be available in two or three day. Thanks for your patience.

Best regards.

Hi,

The bug has been fixed. Please try our new release Aspose.Pdf 3.8.0.0. Thank you very much for your patience.

Best regards.