Exception in DigitalSignatureTest example

Hi,
why i have the exception
pdftron.Common.PDFNetException: Exception:Message:
The dictionary Does not contain required key: Subtype
Conditional expression:
false Filename: Dict.cpp
Function: trn SDF :: :: Dict :: Get
Linenumber: 84
in pdftron.PDF.Annot.RefreshAppearance ()
running the example class “DigitalSignatureTest” in “SignPDF” method?

As I have to modify the class to make it work?

Thank you

Are you getting this with one particular PDF file? This typically means the PDF file is malformed. If so, please send it to support.

If you are getting this using our unmodified SDK sample project, then please let us know the environment you are running in.

Hello, I apologize for the delayed response, but I was up the trial period of the license … I tried again to take the test and continues to give me the same error. I tried with several PDF documents, but the situation does not change.
Below changed lines
Original
Dim sigField As Field = doc.GetField(“Signature1”)
Modification
Dim sigField As Field = doc.FieldCreate(“Signature1”, Field.Type.e_signature)

The method is called SignPDF ()

The development environment is vb.netVisual Studio 2015
framework 4.5.2
Il giorno venerdì 9 dicembre 2016 23:37:37 UTC+1, Ryan ha scritto:

Are you getting this with one particular PDF file? This typically means the PDF file is malformed. If so, please send it to support.

If you are getting this using our unmodified SDK sample project, then please let us know the environment you are running in.

This is because there is no Widget annotation attached to the field.

Fields can have 1 or more Widgets representing how they appear visually.

RefreshAppearance can only be called on an Annotation, not a Field itself (though they are often the same “object” in the PDF)

Though for Digital Signatures RefreshAppearance will not do anything, as there is no default appearance for signatures, you need to create your own and call SetAppearance.