Free Support Forum - aspose.com

Convert Stream to PDF file

Hi,

Can I convert Stream (Like MemoryStream or FileStream) to PDF file using Aspose.Pdf.Kit or Aspose.Pdf ?

Thanks,

Q.

Hi Quentin,

Please share whether you have PDF compliant data in the MemoryStream which you would like to save to a PDF file or there is some other type of data in the stream which you want to convert to PDF.

Kindly share a little more details so we would be able to help you out.
Regards,

Hi,

Excuse me, I didn’t mention it…
Yes, I have PDF data in the stream and I want to convert it to a PDF file.

Thanks,

Q.

Hi Quentin,

You can use PdfFileInfo class to achieve this goal. You can read a PDF from a file or memory stream using PdfFileInfo Constructor and then you can use SaveNewInfo method to save the PDF in a file. You don’t necessarily have to change any information, if you don’t want to; just load a file from memory and then save it to the file. You can also find an example on this link.

I hope this helps. If you have any further questions, please do let us know.
Regards,