java.lang.Object
com.aspose.words.PdfPermissions
public class PdfPermissions
- extends java.lang.Object
Utility class containing constants.
Specifies the operations that are allowed to a user on an encrypted PDF document.
Example:
Shows how to set permissions on a saved PDF document.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.writeln("Hello world!");
// Extend permissions to allow the editing of annotations.
PdfEncryptionDetails encryptionDetails =
new PdfEncryptionDetails("password", "", PdfPermissions.MODIFY_ANNOTATIONS | PdfPermissions.DOCUMENT_ASSEMBLY);
// Create a "PdfSaveOptions" object that we can pass to the document's "Save" method
// to modify how that method converts the document to .PDF.
PdfSaveOptions saveOptions = new PdfSaveOptions();
// Enable encryption via the "EncryptionDetails" property.
saveOptions.setEncryptionDetails(encryptionDetails);
// When we open this document, we will need to provide the password before accessing its contents.
doc.save(getArtifactsDir() + "PdfSaveOptions.EncryptionPermissions.pdf", saveOptions);
|
Field Summary |
static final int | DISALLOW_ALL = 0 | |
|
Disallows all operations on the PDF document.
This is the default value.
|
static final int | ALLOW_ALL = 65535 | |
|
Allows all operations on the PDF document.
|
static final int | CONTENT_COPY = 16 | |
|
Copy or otherwise extract text and graphics from the document by operations other than that controlled
by CONTENT_COPY_FOR_ACCESSIBILITY.
|
static final int | CONTENT_COPY_FOR_ACCESSIBILITY = 512 | |
|
Extract text and graphics (in support of accessibility to users with disabilities or for other purposes).
|
static final int | MODIFY_CONTENTS = 8 | |
|
Modify the contents of the document by operations other than those controlled by
MODIFY_ANNOTATIONS, FILL_IN, and DOCUMENT_ASSEMBLY.
|
static final int | MODIFY_ANNOTATIONS = 32 | |
|
Add or modify text annotations, fill in interactive form fields, and, if MODIFY_CONTENTS is
also set, create or modify interactive form fields (including signature fields).
|
static final int | FILL_IN = 256 | |
|
Fill in existing interactive form fields (including signature fields), even if MODIFY_CONTENTS
is clear.
|
static final int | DOCUMENT_ASSEMBLY = 1024 | |
|
Assemble the document (insert, rotate, or delete pages and create document outline items or thumbnail
images), even if MODIFY_CONTENTS is clear.
|
static final int | PRINTING = 4 | |
|
Print the document (possibly not at the highest quality level, depending on whether
HIGH_RESOLUTION_PRINTING is also set).
|
static final int | HIGH_RESOLUTION_PRINTING = 2052 | |
|
Print the document to a representation from which a faithful digital copy of the PDF content could be
generated, based on an implementation-dependent algorithm. When this flag is clear (and
PRINTING is set), printing shall be limited to a low-level representation of the appearance,
possibly of degraded quality.
|
DISALLOW_ALL = 0 | |
public static final int DISALLOW_ALL |
-
Disallows all operations on the PDF document.
This is the default value.
ALLOW_ALL = 65535 | |
public static final int ALLOW_ALL |
-
Allows all operations on the PDF document.
CONTENT_COPY = 16 | |
public static final int CONTENT_COPY |
-
Copy or otherwise extract text and graphics from the document by operations other than that controlled
by CONTENT_COPY_FOR_ACCESSIBILITY.
CONTENT_COPY_FOR_ACCESSIBILITY = 512 | |
public static final int CONTENT_COPY_FOR_ACCESSIBILITY |
-
Extract text and graphics (in support of accessibility to users with disabilities or for other purposes).
MODIFY_CONTENTS = 8 | |
public static final int MODIFY_CONTENTS |
-
Modify the contents of the document by operations other than those controlled by
MODIFY_ANNOTATIONS, FILL_IN, and DOCUMENT_ASSEMBLY.
MODIFY_ANNOTATIONS = 32 | |
public static final int MODIFY_ANNOTATIONS |
-
Add or modify text annotations, fill in interactive form fields, and, if MODIFY_CONTENTS is
also set, create or modify interactive form fields (including signature fields).
FILL_IN = 256 | |
public static final int FILL_IN |
-
Fill in existing interactive form fields (including signature fields), even if MODIFY_CONTENTS
is clear.
DOCUMENT_ASSEMBLY = 1024 | |
public static final int DOCUMENT_ASSEMBLY |
-
Assemble the document (insert, rotate, or delete pages and create document outline items or thumbnail
images), even if MODIFY_CONTENTS is clear.
PRINTING = 4 | |
public static final int PRINTING |
-
Print the document (possibly not at the highest quality level, depending on whether
HIGH_RESOLUTION_PRINTING is also set).
HIGH_RESOLUTION_PRINTING = 2052 | |
public static final int HIGH_RESOLUTION_PRINTING |
-
Print the document to a representation from which a faithful digital copy of the PDF content could be
generated, based on an implementation-dependent algorithm. When this flag is clear (and
PRINTING is set), printing shall be limited to a low-level representation of the appearance,
possibly of degraded quality.
See Also:
Aspose.Words Documentation - the home page for the Aspose.Words Product Documentation.
Aspose.Words Support Forum - our preferred method of support.