Adobe Acrobar Reader cannot open pdf

I’m loading and saving a pdf document, but Adobe Acrobat Reader cannot open it. It says the file is damaged.

To load and upload I’m using streams to read and write.

When I tried to not use streams and instead save using the filename it worked fine.

The problem is, I need my program to work with streams, because I’ll have to return binary data in the end.

I tried versions 19.4 (original one I had) and 19.8. I cannot try 19.9 because I don’t have a license that allows me to use it.

Adobe Acrobat Reader version is the latest, 19.012.20040.

The saved pdf, when using streams, works ok in Google Chrome and Mozilla Firefox.

What could be the problem?

@Pinho

Thank you for contacting support.

Would you please share source and generated files along with SSCCE code so that we may try to reproduce and investigate it in our environment. Moreover, Aspose offers free 30-days temporary license for evaluation purposes if your license limits you to certain version.