Completed
Last Updated: 18 May 2023 06:25 by ADMIN
Release R2 2023
ADMIN
Tanya
Created on: 21 Feb 2018 15:20
Category: PdfProcessing
Type: Bug Report
4
PdfProcessing: ArgumentException is thrown when trying to clone document containing SignatureField

Trying to clone the Signature of a SignatureField leads to InvalidOperationException as the FieldName of the cloned signature is already set.

Workaround: Remove the signatures before the merging of the document:

private static void RemoveSignatures(RadFixedDocument document)
{
	List<FormField> signatures = document.AcroForm.FormFields.Where(ff => ff.FieldType == FormFieldType.Signature).ToList();
	if (signatures.Count > 0)
	{
		foreach (FormField signature in signatures)
		{
			document.AcroForm.FormFields.Remove(signature);
		}
	}

	List<SignatureWidget> signatureWidgets = document.Annotations.Where(a => a.Type == AnnotationType.Widget && a.GetType() == typeof(SignatureWidget)).Cast<SignatureWidget>().ToList();
	if (signatureWidgets.Count > 0)
	{
		foreach (var signatureWidget in signatureWidgets)
		{
			foreach (RadFixedPage page in document.Pages)
			{
				if (page.Annotations.Contains(signatureWidget))
				{
					page.Annotations.Remove(signatureWidget);
				}
			}
		}
	}
}

3 comments
ADMIN
Georgi
Posted on: 09 Oct 2019 13:11

Hello,

Thank you for sharing your feedback. Each feedback is important for us in order to improve our products.

Indeed, the digital signature is designed to validate the PDF content and any changes to the document would invalidate it. In order to track such scenarios when merging, the PDF documents can be observed if contain any signed signature fields. If so, the signature of the signature fields can be set to null before the merge and the resultant document can be signed after the merge is completed. This way the document content may be merged without producing any invalid signature. I will write your suggestions in the internal item as notes to make sure they will be considered when the development of the item is started.

Each item is prioritized by customer demand and we review our backlog on a regular base. This way we ensure that the most demanded items will be delivered to the customers. Currently, this item is not scheduled for implementation for the upcoming release and I am afraid that I cannot commit to a specific time-frame when it will be delivered. Please, make sure to click the Follow button to be notified when the status of the item changes.

Regards,
Georgi
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
GuiGuiGui
Posted on: 02 Oct 2019 16:03

Thinking about this issue, I'm not sure if it will be easily resolvable as my understanding is files with a signature can't be edited. Merging with another document using PDFProcessing counts as editing and that is how we encountered this issue.

Perhaps a way in PDFProcessing code or otherwise to detect a file with a signature before attempting editing? Or at least a specific exception that is thrown when a file with a signature is encountered so that event could be easily trapped.

More and more people/businesses are signing their documents these days so handling these documents is becoming increasingly important.

Brenna
Posted on: 02 Oct 2019 15:23
Is there any progress on this issue?