Digital Signature invalid signature when signing multiple signatures on a pdf version 1.3

Adding multiple signatures on a pdf version 1.3 causes the first signature to become invalid.

i tested on higher versions 1.4,1.6 & 1.7 ... all are working fine.

Please check attached files

Note that this issue does not happen if i add the signatures using adobe reader.

Hope you fix it in next weekly release.

Image_6321_1709213831002


Attachment: pdfv1.3_ffb59816.zip


18 Replies 1 reply marked as answer

JT Jeyalakshmi Thangamarippandian Syncfusion Team March 1, 2024 10:21 AM UTC

Hi,

As per the PDF specification, PDF versions 1.3 or below do not support incremental updates (revisions). For multiple signatures, incremental updates are necessary. So, if incremental support is not available in version 1.3, this problem arises during restructuring. Therefore, this is the expected behavior. If you need to have multiple signatures, you should upgrade your document to a version above 1.3 or the latest version. Please refer to the KB documentation for further details:

https://support.syncfusion.com/kb/article/8369/how-to-change-the-pdf-version-using-c-and-vb-net

image


Regards,

Jeyalakshmi T



JA Jacobs replied to Jeyalakshmi Thangamarippandian March 3, 2024 10:40 AM UTC

thanks for your clarification ... i found that adobe reader automatically changes the pdf version to 1.6 when adding a signature to a pdf file of version less than 1.6 (1.5,1.4,1.3)

Can you do a similar behaviour in PdfLoadedDocument.Save syncfusion function ... in order to fix this issue and handle all pdf versions ?



JT Jeyalakshmi Thangamarippandian Syncfusion Team March 4, 2024 11:38 AM UTC

Hi Jacobs,

We don't have direct support to change the PDF version. However, we can achieve this using our PDF library. We have prepared the sample and attached for your reference, we request you to try this on your end and let us know if need any further assistance.

 

PdfLoadedDocument loadedDocument = new PdfLoadedDocument("../../Sample.pdf");

var fileStructureVersion = loadedDocument.FileStructure.Version;

if (fileStructureVersion< PdfVersion.Version1_6)

{

   loadedDocument.FileStructure.Version = PdfVersion.Version1_6;

    loadedDocument.FileStructure.IncrementalUpdate = false;

   loadedDocument.Save("Output.pdf");

   loadedDocument.Close(true);

}


Regards,

Jeyalakshmi T



JA Jacobs replied to Jeyalakshmi Thangamarippandian March 10, 2024 11:22 AM UTC

Thanks ... but your proposed workaround (changing pdf version) will only work if the original file does not contain any signatures, i.e. If the file is of version 1.3 and already have signatures  ... then after converting to 1.7 (syncfusion proposed workaround) the old signatures become invalid.


Note that this behaviour does not happen when signing with adobe reader, adobe can add multiple signatures to a v1.3 file that already contains signatures without corrupting any existing signatures and also upgrades the file to 1.6.

check attached files 

Image_3663_1710069553345

Image_8681_1710069649646


Attachment: pdfv1.3_onesignature_then_75ebada8.zip



JT Jeyalakshmi Thangamarippandian Syncfusion Team March 11, 2024 08:53 AM UTC

Currently, we are analyzing this and will update further details on March 13, 2024.



JT Jeyalakshmi Thangamarippandian Syncfusion Team March 13, 2024 02:57 PM UTC

Thank you for your patience,

 

As per the PDF specification 1.7, the PDF version 1.4 earlier, does not support incremental updates. So, we have followed to maintain the same in our PDF library. Therefore, an existing signature becomes invalid due to incremental is not done. However, to address the problem we request to apply incremental updates as highlighted below if the PDF version is 1.3 at the sample level.



Marked as answer

JA Jacobs replied to Jeyalakshmi Thangamarippandian March 13, 2024 05:08 PM UTC

Can you assist in providing a way to do the same behavior as adobe .... upgrade pdf version + support incremental updates for any version less than 1.6?

I need to handle all pdf versions same as adobe.

Knowing that while signing a v1.3 pdf file  ... when i use your previous provided code Incremetalupdate= true along with setting pdfversion = 1.7 ... the existing signature stays valid without any corruption but the pdf version is not upgraded to 1.7 and stays 1.3.

Waiting for your reply.



JT Jeyalakshmi Thangamarippandian Syncfusion Team March 14, 2024 02:12 PM UTC

Upon further analysis, we found that adobe only shows the PDF version as 1.6 for this document. Because of Adobe doesn’t change the PDF version 1.6 instead of it adding version number to PDF document catalog entry. We have also cross-checked this with Foxit Reader application and the version is remained the same as 1.3, similar to our PDF library. You can refer the following screenshot for further details.

Foxit reader:


Adobe:

Before Incremental update


After Incremental Update

 

However, currently, we are analyzing to add the version to the catalog as like Adobe on our end and we will update further details on March 19,2024.



JT Jeyalakshmi Thangamarippandian Syncfusion Team March 19, 2024 04:13 PM UTC

Upon further analysis and consultation with other viewers, Adobe displays the PDF version of this document as 1.6. This occurs because Adobe does not alter the PDF version to 1.6; instead, it appends the version number to the PDF document catalog entry. We have verified this with another viewer application, where the version remains consistent at 1.3, aligning with our PDF library. Please confirm if you require this fix to be implemented mandatorily. If yes, then we will include it in our upcoming weekly release on 2nd April 2024.




JA Jacobs March 20, 2024 09:11 AM UTC

yes please ... i need to handle signatures for all pdf versions same as adobe 



JT Jeyalakshmi Thangamarippandian Syncfusion Team March 21, 2024 02:54 PM UTC

We have confirmed the issue “Version is not updated after signing the pdf version 1.3" as a defect in our product and we will include the fix in weekly release on 2nd April 2024. 

 

Please use the below feedback link to track the status of the reported bug.

https://www.syncfusion.com/feedback/51982/version-is-not-updated-after-signing-the-pdf-version-1-3

 

Note: If you require a patch for the reported issue in any of our Essential Studio Main or SP release version, then kindly let us know the version, so that we can provide a patch in that version based on our SLA policy.

 

Disclaimer: “Inclusion of this solution in the weekly release may change due to other factors including but not limited to QA checks and works reprioritization.”



JT Jeyalakshmi Thangamarippandian Syncfusion Team April 2, 2024 01:35 PM UTC

We have included the fix for this issue Version is not updated after signing the pdf version 1.3fix in our latest weekly release (25.1.38).Please download the Nuget from the below link

Nuget Link: NuGet Gallery | Syncfusion.Pdf.Net.Core 25.1.38

Root Cause:

We noticed that there is an issue with version is not updated after signing the pdf version 1.3 and less than versions. This is causing the problem.



JA Jacobs replied to Jeyalakshmi Thangamarippandian April 3, 2024 07:13 AM UTC

Thanks .... can you please specify if there is any special code that i should write such as checking on certain pdf version or setting Incremetalupdate= true ... or will it work automatically without adding extra code ?



RS RaashithAhamed SahulHameed Syncfusion Team April 4, 2024 11:11 AM UTC

On our further analysis, you need not to check the file version just enable incremental update to updating the file version.



JA Jacobs replied to RaashithAhamed SahulHameed April 4, 2024 11:29 AM UTC

Why should i set the incrementalupdate ... i just need to add the signature to the document and if version is 1.3 or less ... it should be upgrade automatically like adobe.

Note that i have tested on the pdf 1.3 with onesignature in my first reply and used incrementalupdate= true ... the pdf version is still not updated ... however i expected that you will fix this issue internally in the nuget without the need of writing any extra code to handle all types of versions .... same as adobe 



RS RaashithAhamed SahulHameed Syncfusion Team April 4, 2024 12:30 PM UTC

As we informed earlier, As per the PDF specification 1.7, the PDF version 1.4 earlier, does not support incremental updates. So, we have followed to maintain the same in our PDF library. Therefore, an existing signature becomes invalid due to incremental is not done.In our latest version, we have fixed to update the 1.3 and less than version to 1.6 version like as Adobe only if enabling the incremental update




JA Jacobs replied to RaashithAhamed SahulHameed April 22, 2024 06:36 PM UTC

Thanks , i am confirming that your suggested solution is working fine .... pdf version is upgraded to 1.6 by only setting incrementalupdate= true for pdf versions less than 1.4



RS RaashithAhamed SahulHameed Syncfusion Team April 23, 2024 12:12 PM UTC

We are glad to hear that issue has been resolved on your end. please let us know if you need any other assistance.


Loader.
Up arrow icon