We are using the following code to convert Word documents into PDF documents.
using (FileStream wordFile = file.OpenRead())
{
Aspose.Words.Document document = new Aspose.Words.Document(wordFile);
using (MemoryStream pdfStream = new MemoryStream())
{
document.Save(pdfStream, SaveFormat.Doc);
pdfStream.Seek(0, SeekOrigin.Begin);
using (MemoryStream pdfStream2 = new MemoryStream())
{
Aspose.Words.Document document2 = new Aspose.Words.Document(pdfStream);
document2.Save(pdfStream2, SaveFormat.Pdf);
pdfStream2.Seek(0, SeekOrigin.Begin);
doc.Read(pdfStream2);
}
}
}
This has been working for us without issue for awhile now but we encountered some word content from one of our customers that is causing some unwanted formatting.
The attached document ‘DownloadAttachment (6).docx’ has a table with some content with bullets within.
After conversion the content is missing the first letter and is on a newline.