Hi all I’, trying to convert a document word to Pdf but have an error “file does not begin with ’ pdf-’ local ewh” I’m using.
public static byte[] convertDoctoPdfByte(byte[] document)
{
MemoryStream stream = new MemoryStream(document);
Document pdfDocument = new Aspose.Words.Document(stream);
stream.Close();
MemoryStream pdfStream = new MemoryStream();
pdfDocument.Save(pdfStream,Aspose.Words.SaveFormat.AsposePdf);
return pdfStream.ToArray();
}
Any suggestion please, thanks.