Skip to main content

CertificationLevel Enum

Lists certification levels of a signature.

Declaration

public enum CertificationLevel extends Enum<CertificationLevel> implements IIntEnum

Members

Name Description
FILL_FORMS

The signature certifies the document and allows users to fill in forms and sign the document.

FILL_FORMS_AND_ANNOTATE

The signature certifies the document and allows users to fill in forms, sign the document, and create, edit, or delete annotations.

NO_CERTIFICATION

The signature does not certify the document.

NO_CHANGES_ALLOWED

The signature certifies the document and does not allow changes.

fromValue(int value)

Returns the CertificationLevel enumeration constant with the specified integer value.

getName()

Returns the name of the CertificationLevel enumeration constant.

getValue()

Returns the integer value of the CertificationLevel enumeration constant.

toString()

Returns the string representation of the CertificationLevel enumeration constant.

valueOf(String name)

Returns the CertificationLevel enumeration constant with the specified name.

values()

Returns an array of all CertificationLevel enumeration constants.

Remarks

Call the SignatureOptions.getCertificationLevel() method to get the certification level of a signature. Call the SignatureOptions.setCertificationLevel(value) method to specify whether a signature certifies the document and which changes the signature allows.

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

Example

Certify a PDF Document and Lock Form Fields

The following code snippet certifies a document, allows users to fill in forms and sign the document, and locks the Amount and Date form fields:

import java.io.*;
import java.nio.file.*;
import java.util.List;
import com.devexpress.docs.pdf.*;
import com.devexpress.system.drawing.*;

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);
             InputStream certificateStream = Files.newInputStream(Path.of("certificate.pfx"))) {
            // Create a signature field and bind it to a widget on the first page.
            SignatureField signatureField = new SignatureField("ManagerSignature");
            pdfDocument.getFields().add(signatureField);
            pdfDocument.getPages().getFirst().getAnnotations().add(
                    new SignatureWidgetAnnotation(signatureField, new RectangleF(20, 400, 200, 60)));

            // Lock the "Amount" and "Date" fields after the field is signed.
            signatureField.setLock(FieldLockInfo.createInclude(List.of("Amount", "Date")));

            // Certify the document.
            SignatureOptions options = new SignatureOptions();
            options.setCertificate(certificateStream, "CERTIFICATE_PASSWORD");
            options.setCertificationLevel(CertificationLevel.FILL_FORMS);

            pdfDocument.addSignature(signatureField, options);

            Files.createDirectories(Path.of("output"));
            try (OutputStream outputStream = Files.newOutputStream(Path.of("output", "Document.pdf"))) {
                pdfDocument.save(outputStream);
            }
        }
    }
}

Implements

com.devexpress.java.enums.IIntEnum

Inherited Members

java.lang.Enum.<T>valueOf(java.lang.Class<T>,java.lang.String)
java.lang.Enum.clone()
java.lang.Enum.compareTo(E)
java.lang.Enum.describeConstable()
java.lang.Enum.equals(java.lang.Object)
java.lang.Enum.finalize()
java.lang.Enum.getDeclaringClass()
java.lang.Enum.hashCode()
java.lang.Enum.name()
java.lang.Enum.ordinal()
java.lang.Enum.toString()
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
java.lang.Enum
CertificationLevel