Skip to main content

DocumentAccessMode Enum

Lists values that specify the access level for a PDF document.

Declaration

public enum DocumentAccessMode extends Enum<DocumentAccessMode> implements IIntEnum

Members

Name Description
OWNER

The document is encrypted and can only be opened with the owner’s password.

UNENCRYPTED

The document is unencrypted and can be opened without a password.

USER

The document is encrypted and can only be opened with the user’s password.

fromValue(int value)

Returns the enum item with the specified integer value.

getName()

Returns the enum item name.

getValue()

Returns the integer value.

toString()

Returns the string representation.

valueOf(String name)

Returns the enum constant with the specified name.

values()

Returns available constants.

Remarks

Use the PdfDocument.getAccessMode() method to obtain the document access mode.

The following code snippet opens an encrypted PDF document, verifies the current access mode, and inspects document permissions:

try (InputStream documentStream =
             Files.newInputStream(Path.of("Document.pdf"));
     PdfDocument pdfDocument =
             new PdfDocument(documentStream, "YOUR_PASSWORD")) {

    // Display the current access mode and document permissions.
    System.out.println(
            "Access mode: " + pdfDocument.getAccessMode() +
            "\nData extraction permissions: " + pdfDocument.getDataExtractionPermissions() +
            "\nModification permissions: " + pdfDocument.getModificationPermissions() +
            "\nInteractivity permissions: " + pdfDocument.getInteractivityPermissions());
}

Refer to the following help topic for additional information: Encrypt PDF Documents.

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
DocumentAccessMode