Search code examples
javapdfbox

pdfBox: how to get signing name from signature field


Using itext I can get the signing name (Signed By) like this:

fields = reader.getAcroFields();

pk = fields.verifySignature(FieldName);

name = pk.getSignName();

How do I get the signing name using pdfBox?


Solution

  • document.getSignatureDictionaries() gets the signatures, and PDSignature.getName() gets the name. To see more, have a look at the ShowSignature.java example from the source code download in the examples subproject.