I'm trying to convert my Word to PDF code from using Aspose.PDF to using the new .WordToPDF method.
When I save the attached Word document to PDF using the new .WordToPDF method to a MemoryStream (and then save it to the DB), I get the attached PDF. Opening the PDF, Adobe Reader gives the following message:
"There was an error opening this document. The file is damaged and could not be repaired."
If I use the old method with Aspose.PDF, it works fine.
The code I use to convert the Word document is:
Dim stream As New IO.MemoryStream
masterDoc.SaveToPdf(0, masterDoc.PageCount, stream, Nothing)
'convert stream to byte array...
Dim length As Integer = stream.Length
Dim bytes() As Byte = stream.GetBuffer()
'store in DB