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

Free Support Forum - aspose.com

Convert Aspose.Pdf.Document to byte[]

Good morning,


I have pdf document that is saved in the DB as byte[] .

I convert it to Aspose.Pdf.Document as following:

Aspose.Pdf.Document pdfDocument = new Aspose.Pdf.Document(new MemoryStream(pdfDocumentByte));

Then after work on it using Aspose.Pdf.Document I want to save it back to the DB as byte[].

How can I Convert Aspose.Pdf.Document to byte[]?Was my Initial conversion from byte[] to Aspose.Pdf.Document was correct?

Thanks in advance,
Ortal

Hi Ortal,


Thanks for contacting support.

Aspose.Pdf for .NET supports the feature to load PDF file and other supported file formats from Stream instance or load it using specific file path over system. Furthermore, you can save the resultant file to Stream instance or save the output on specific path over file system.

Now concerning to saving the output in byte array, save the output in Stream instance (MemoryStream) and then save it to Byte array.

Should you have any further query, please feel free to contact.