When I convert my Word document to PDF using the following code, some of the lines do not show up and most of the boxes do not show up. Is my conversion code incorrect, or is there a bug? The Word document after mail merge has the boxes and lines correct, so I think the problem is with the conversion to PDF. Thanks. I would attach the files for you, but I don’t see an option to do that.
Document doc = new Document(stream);
doc.MailMerge.ExecuteWithRegions(dataSet);
doc.Save(@"c:\temp.doc");
MemoryStream mergedStream = new MemoryStream();
// save to special pdf/xml format
doc.Save(mergedStream, SaveFormat.FormatAsposePdf);
//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
Pdf pdf = new 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 =
MemoryStream pdfStream = new MemoryStream();
//Now produce the PDF file.
pdf.Save(pdfStream);