Signature not exporting after applying digital signature

Product: @pdftron/webviewer in React, FullAPI enabled

Product Version: 8.12.0

Please give a brief summary of your issue:
Signature not exporting after applying digital signature

Please describe your issue and provide steps to reproduce it:

Context:

  • We’re using @pdftron/webviewer: 8.12.0 with React
  • We changed our process for digital signatures: we flatten documents with filled in data (e.g. their name and a date), import the signature annotations as XFDF, and then certify the document. The document validity all shows up correctly in Adobe.
  • We then open the newly certified document in a Signing Page. We can successfully hide/mark as read only signatures not meant for the user. After a user adds their signature, we can successfully apply a Digital Signature, and save the document. Again, the validations are all working in Adobe.

Problem:

However, the actual signature isn’t included in the document.

// Open an existing PDF

const doc = await (instance as WebViewerInstance).Core.documentViewer
    .getDocument()
    .getPDFDoc();

doc.initSecurityHandler();
doc.lock();

// Retrieve the unsigned approval signature field.
const found_approval_field = await doc.getField(in_approval_field_name);
const found_approval_signature_digsig_field =
    await PDFNet.DigitalSignatureField.createFromField(found_approval_field);

// Prepare the signature and signature handler for signing.
await found_approval_signature_digsig_field.signOnNextSaveFromURL(
    in_private_key_file_path,
    in_keyfile_password
);

// The actual approval signing will be done during the following incremental save operation.
const docbuf = await doc.saveMemoryBuffer(
  PDFNet.SDFDoc.SaveOptions.e_incremental
);

In this example, the signature annotation with name in_approval_field_name is not being saved/exported in saveMemoryBuffer call

We’ve tried a few things:

  1. Creating another digital signature field for each signature field (for example Signature1 and Signature1-Digital). This still doesn’t export the actual signature field.
  2. Using one field for everything and trying to generate an image of the signature itself. This also does not work.

Other notes:

  • We are using the SigningModes.APPEARANCE signing mode.
  • We are using a mix of document viewer calls (instance.Core.documentViewer…) and PDFNet calls. Could this lead to the actual signature annotation not being exported?

Please provide a link to a minimal sample where the issue is reproducible: see above

Hello Zack,

Thank you for contacting WebViewer support and for all the explanations.

To investigate your case, we need the other parts of the code you mentioned. It is difficult to investigate your problem with these missing parts, for example, the flattening of the document and the definitions of the variables.
If you don’t want to send us the whole project, I’d suggest you get our react sample and make a runnable application that you can reproduce the issue and send us.
You can create a new private ticket here, copying what you already added to this ticket and adding the sample project or you can send it to me by email: dnavarro@apryse.com.

Best,
Dandara Navarro