Hello,
Please find below the code and a test document.
Any help will be appreciated.
Barsana
Conversion Code is as follows:
using (MemoryStream itemDocumentStream = new MemoryStream())
{
using (MemoryStream itemPDFStream = new MemoryStream())
{
Document itemDocument = AsposeWordsHelper.ConvertBytesToWordDocument(item.GeneratedDocument.Content);
itemDocument.Save(itemDocumentStream, SaveFormat.AsposePdf);
//Create a new pdf converter object
Aspose.Pdf.Pdf pdfConverter = new Aspose.Pdf.Pdf();
// Bind content from the document stream
pdfConverter.BindXML(itemDocumentStream, null);
//This code is needed to ensure performance for documents with bullet points and other formatting
//Fix suggested by aspose.
pdfConverter.IsTruetypeFontMapCached = true;
pdfConverter.TruetypeFontMapPath = _asposeTempPath;
// Save the result to stream
pdfConverter.Save(itemPDFStream);
//Now convert the document to byte[]
byte[] documentToReturn = itemPDFStream.ToArray();
return documentToReturn;
}
}