We are using another tool that creates an image from a scanner from our web application. That image is then passed from the client to the server and to our Aspose logic as a stream. Then we create an Aspose Pdf document from the stream, add a FreeTextAnnotation and save the file to disk. Out of the 4,000 or so documents we have created, around 10 have been corrupt and we are unable to open with Adobe reader for example. We did find that Chrome was able to view the documents though. After some debugging using itextsharp, we see the error PDF Header signature not found. When we open up the documents in notepad, the first few bytes look off. Generally the first few characters in the pdf file begin with something like “%PDF-1.6” (without the quotes). The corrupt files are missing the version number and look something like “%PDF “.
Just wondering if you have any ideas on why the files would be missing the needed header information. Aspose pdf was able to open up the corrupt files and then we copied the pages to a new pdf document and saved and everything is good.