I noticed that simply opening and saving a PDF file results in a modified file.
In filePath there is a signed PDF. Opening with Acrobat Reader validate the signature.
GdPicturePDF _oGdPicturePDF = new GdPicturePDF();
_oGdPicturePDF.SaveToFile(newPath, false, true);
The saved file seems to be changed and the signature is not verified by Acrobat Reader.
I tried with linearize parameter true or false.
Am I doing something wrong?
Thank you very much
Using SaveToFileInc did the work.
This is correct behavior. GdPicture needs to parse the document upon loading it. In some cases in order to open the file we need to repair the files. Because of that saving the file will automatically reconstruct the PDF file. Digital signatures make sure there have not been any modifications in the file. Even single different byte will lead to invalid signature because the document hash will be different.
You have correctly used the SaveToFileInc. This method keeps the document data unchanged and any modifications are appended at the end of the file. This is a feature of PDF format. Without any modification the document and file data will be unchanged and the Digital Signature will be valid. In case there are modifications the file will hold separate document versions and the Digital Signature will be able to verify the version that was signed.
GdPicture Dev Team
Who is online
Users browsing this forum: No registered users and 0 guests