Is not possible to sign a document with embedded signature

Product: Apryse SDK .NET Core

Product Version: 11.5.0

Please give a brief summary of your issue:
(Think of this as an email subject)

We need to create a signature without any appearance, but it appears that the library does not provide a way to do this.

Please describe your issue and provide steps to reproduce it:
(The more descriptive your answer, the faster we are able to help you)

Dear Support,

We are using the Apryse SDK with .NET Core and have encountered an issue when attempting to add an embedded signature to a PDF document.
We need to create a signature without any appearance, but it appears that the library does not provide a way to do this.

we got this:

with this code:

        // create signatureField embedded with generic name
        Page page1 = doc.GetPage(1);

        // Create a digital signature field and associated widget.
        DigitalSignatureField digsig_field = doc.CreateDigitalSignatureField(Guid.NewGuid().ToString());
        SignatureWidget widgetAnnot = SignatureWidget.Create(doc, new Rect(143, 287, 219, 306), digsig_field);
        page1.AnnotPushBack(widgetAnnot);

        // Sign field logic here

But our need is to get this:

but with this code:

        // Create a digital signature field
        DigitalSignatureField digsig_field = doc.CreateDigitalSignatureField(Guid.NewGuid().ToString());

        // Sign field logic here

is not possible, because the class and library expected a widget annotation

is there another way to implement embedded signature without appearance with your SDK ?

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

Hello, I’m AiRon, an automated tech support bot :robot:
While you wait for one of our customer support representatives, I can help you with your question.

It sounds like you’re attempting to add a digital signature to a PDF without displaying a visual widget annotation. Apryse’s SDK does indeed allow you to create digital signatures without visible appearances, though it typically involves a widget annotation. However, you can create a signature field that does not display by not associating it with a visible widget.

Some things you can try:


  • Create the digital signature field without associating it with a visible widget. This means you set the signature field but do not push a widget annotation to the page.

  • Ensure that the signature field is still properly configured and signed using the SDK’s signing methods.

  • Check the appearance settings of the signature field to ensure it’s set to be invisible.



Here are some resources that might help you:


Hopefully, this helps you solve your problem while you wait for a human to get back to you.

Hello,

Thanks for providing your sample code. Adding onto the response provide to you, since you are using a SignatureWidget, it inherits from Annot which exposes the ability to set a flag. You can call SetFlag and use the e_hidden value to ensure it does not display for a user.

You should need to do something like this:
widgetAnnot.SetFlag(Annot.Flag.e_hidden, true);

Please let us know how these suggestions work for you.

Thanks,

1 Like

Apryse requires a widget for any signature, but you can still create an invisible embedded signature by placing the widget off page bounds or giving it zero size with no appearance stream. This keeps the signature valid and unseen.

1 Like

While there are a few ways to add an “invisible” signature, some of these ways might not work as intended with different PDF tools.

The best, most compliant, way to add a signature that is not visible is to add an Author/Certification signature, which can be thought of as a document wide signature added by the original document author. These can have be given a widget on page 1 with zero width and height, and no appearance. Other PDF readers should treat this as you expect.

Note, there can only be one author/certification signature, and it must be the first signature.

See the CertifyPDF function in the following sample, and just change the following line of code

SignatureWidget widgetAnnot = SignatureWidget.Create(doc, new Rect(143, 287, 219, 306), certification_sig_field);

to

SignatureWidget widgetAnnot = SignatureWidget.Create(doc, new Rect(0, 0, 0, 0), certification_sig_field);

and comment out this part

// (OPTIONAL) Add an appearance to the signature field.
Image img = Image.Create(doc, in_appearance_image_path);
widgetAnnot.CreateSignatureAppearance(img);
1 Like