We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Document word to Pdf

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);

MemoryStream pdfStream = new MemoryStream();
return pdfStream.ToArray();

Any suggestion please, thanks.


Thanks for your inquiry. Could you please attach your input Word document you’re getting this problem with here for testing? We will investigate the issue on our end and provide you more information.

Best regards,

Of course, I attached my example file.

I have the version of Aspose.Words and version of Aspose.Pdf

Thanks for your inquiry. After an initial test with Aspose.Words for .NET 17.2.0, we were unable to reproduce this issue on our end (see attached 17.2.0.pdf). We would suggest you please upgrade to the latest version of Aspose.Words. You can download it from the following link:

Hope, this helps.

Best regards,