When PDFNet opens a corrupted PDF document, it will fix the PDF and set the IsModified flag to true. When you save the modified PDF it saves the fixed version, so it no longer needs to be fixed (modified) when it is opened again, which is why your workaround works. Corrupt PDF documents are quite common, so this is likely the reason why you are seeing IsModified set to true immediately after you’ve loaded it.
James
I’m not aware of any product that simply checks a PDF’s validity. The PDF spec is over 1000 pages large, and does at times contain ambiguity, so it would be impossible to be 100% “correct” in any case. If you are worried that the file is being corrupted during the file transfer process you could take the MD5 (or similar) hash of the file on the server and then again on the iPad, and verify they are the same.
James
I will test this with some different documents. Do you know of a PDF validator or something so I could test the source PDF’s validity, so I can ensure it is actually the PDF thats corrupt, rather than the code I am using to download it from the server and save it in my iPad app?
Thanks,
Mike
On Wednesday, 17 April 2013 17:30:26 UTC+1, James wrote:
Hi Mike,
When PDFNet opens a corrupted PDF document, it will fix the PDF and set the IsModified flag to true. When you save the modified PDF it saves the fixed version, so it no longer needs to be fixed (modified) when it is opened again, which is why your workaround works. Corrupt PDF documents are quite common, so this is likely the reason why you are seeing IsModified set to true immediately after you’ve loaded it.
I'm experiencing the same behavior. When opening a local file it immediately sets the IsModified flag to true. When saving the file and opening again it keeps telling me the document is modified. What could be wrong?
I’m experiencing the same behavior. When opening a local file it immediately sets the IsModified flag to true. When saving the file and opening again it keeps telling me the document is modified. What could be wrong?
As mentioned above, this usually means that the file is corrupt and that PDFNet managed to recover some information.