Skip to main content

ApprovalSignatureInfo Class

Contains information about an approval signature.

Declaration

public class ApprovalSignatureInfo extends SignatureInfo

Remarks

An approval signature confirms that the signer approves the document. Unlike a certification signature (AuthoringSignatureInfo), a document can contain multiple approval signatures.

Refer to the following help topic for additional information: Sign PDF Documents — PDF Document API for Java.

Example

Get Information About Signatures in a PDF Document

The following code snippet displays information about all signatures in a document:

import java.io.*;
import java.nio.file.*;
import com.devexpress.docs.pdf.*;

public class Main {
    public static void main(String[] args) throws Exception {
        try (InputStream inputStream = Files.newInputStream(Path.of("Document.pdf"));
             PdfDocument pdfDocument = new PdfDocument(inputStream)) {
            for (SignatureInfo signature : pdfDocument.getSignatures()) {
                System.out.println("Field: " + signature.getField().getName());
                System.out.println("Signer: " + signature.getSignerName()
                        + ", signed at: " + signature.getSigningTime());

                switch (signature) {
                    case AuthoringSignatureInfo authoring ->
                        System.out.println("Certification signature. Allowed changes: "
                                + authoring.getPermission());
                    case ApprovalSignatureInfo approval ->
                        System.out.println("Approval signature. Lock action: "
                                + (approval.getFieldLock() != null ? approval.getFieldLock().getAction() : null));
                    case TimestampSignatureInfo timestamp ->
                        System.out.println("Document-level timestamp");
                    default -> { }
                }
            }
        }
    }
}

Inherited Members

com.devexpress.system.JavaObject.clone()
com.devexpress.system.JavaObject.equals(java.lang.Object)
com.devexpress.system.JavaObject.hashCode()
com.devexpress.system.JavaObject.memberwiseClone()
com.devexpress.system.JavaObject.toString()
java.lang.Object.finalize()
java.lang.Object.getClass()
java.lang.Object.notify()
java.lang.Object.notifyAll()
java.lang.Object.wait()
java.lang.Object.wait(long)
java.lang.Object.wait(long,int)

Inheritance

Object
JavaObject
SignatureInfo
ApprovalSignatureInfo
See Also

Methods

getFieldLock() Method

Returns form fields that the signature locks.

Declaration

public FieldLockInfo getFieldLock()

Returns

Type Description
FieldLockInfo

An object that specifies locked form fields; null if the signature does not lock form fields.

Remarks

Users cannot modify locked fields in the signed document. To lock form fields when you sign a document, call the SignatureField.setLock(value) method.

getPermission() Method

Returns changes that the signature allows in the document.

Declaration

public @Nullable SignaturePermission getPermission()

Returns

Type Description
SignaturePermission

Allowed changes; null if the signature does not restrict changes.

Remarks

The getPermission() method returns the permission stored in the signature field lock dictionary. An approval signature can only restrict changes that previous signatures allow.

When you sign a field, the SignatureOptions.setCertificationLevel(value) method specifies the permission.