Class DocumentSaveOptions
-
- All Implemented Interfaces:
public class DocumentSaveOptions
Configures options for saving a document. Use those when saving a document via save or related save methods.
-
-
Field Summary
Fields Modifier and Type Field Description public String
password
public EnumSet<DocumentPermissions>
permissions
public PdfVersion
pdfVersion
-
Constructor Summary
Constructors Constructor Description DocumentSaveOptions(String password, EnumSet<DocumentPermissions> permissions, boolean incremental, PdfVersion pdfVersion)
Advanced options for saving a processed document.
-
Method Summary
Modifier and Type Method Description String
getPassword()
Returns the password that'll be set on the document if these options are used. void
setPassword(@Nullable() String password)
Sets the password to a document saving options. EnumSet<DocumentPermissions>
getPermissions()
Returns the permissions that'll be set on the document if saved using these options. void
setPermissions(@Nullable() EnumSet<DocumentPermissions> permissions)
Sets the permissions that'll be set on the document if saved using these options. PdfVersion
getPdfVersion()
Returns the PDF version of the document that'll be saved using these options. void
setPdfVersion(@Nullable() PdfVersion pdfVersion)
Sets the PDF version of the document that'll be saved using these options. boolean
isIncremental()
Indicates whether the saving is set to be incremental or not. boolean
shouldApplyRedactions()
Indicates whether com.pspdfkit.annotations.RedactionAnnotations are applied as part of the save process. boolean
shouldRewriteAndOptimizeFileSize()
Indicates whether when saving unnecessary data should be removed from the document causing smaller file sizes. void
setIncremental(boolean incremental)
Sets whether the saving will be incremental or not. void
setApplyRedactions(boolean applyRedactions)
Sets whether saving will apply redactions or not. void
setRewriteAndOptimizeFileSize(boolean rewriteAndOptimizeFileSize)
Sets whether when saving unnecessary data should be removed from the document causing smaller file sizes. -
-
Constructor Detail
-
DocumentSaveOptions
DocumentSaveOptions(String password, EnumSet<DocumentPermissions> permissions, boolean incremental, PdfVersion pdfVersion)
Advanced options for saving a processed document.- Parameters:
password
- Password in the output PDF document.permissions
- Permission flags on output document, a set of flags from .incremental
- Iftrue
, PSPDFKit will attempt to only append incremental changes to the document instead of rewriting it.pdfVersion
- Version of PDF to generate.
-
-
Method Detail
-
getPassword
@Nullable() String getPassword()
Returns the password that'll be set on the document if these options are used.
- Returns:
Password set to these save options.
-
setPassword
void setPassword(@Nullable() String password)
Sets the password to a document saving options. This password will be set to the document if saved using these options.
- Parameters:
password
- Password to be set.
-
getPermissions
@NonNull() EnumSet<DocumentPermissions> getPermissions()
Returns the permissions that'll be set on the document if saved using these options.
- Returns:
Permissions to be set on the document.
-
setPermissions
void setPermissions(@Nullable() EnumSet<DocumentPermissions> permissions)
Sets the permissions that'll be set on the document if saved using these options.
- Parameters:
permissions
- Permissions to be set on the document.
-
getPdfVersion
@NonNull() PdfVersion getPdfVersion()
Returns the PDF version of the document that'll be saved using these options.
- Returns:
PDF version of saved document.
-
setPdfVersion
void setPdfVersion(@Nullable() PdfVersion pdfVersion)
Sets the PDF version of the document that'll be saved using these options.
- Parameters:
pdfVersion
- PDF version of saved document,null
default to the latest PDF version.
-
isIncremental
boolean isIncremental()
Indicates whether the saving is set to be incremental or not.
- Returns:
true
if saving is incremental,false
otherwise
-
shouldApplyRedactions
boolean shouldApplyRedactions()
Indicates whether com.pspdfkit.annotations.RedactionAnnotations are applied as part of the save process.
- Returns:
true
if they are applied,false
otherwise.
-
shouldRewriteAndOptimizeFileSize
boolean shouldRewriteAndOptimizeFileSize()
Indicates whether when saving unnecessary data should be removed from the document causing smaller file sizes. This is incompatible with incremental saving. This is slower than incremental saving or a regular rewrite and will increase the time saving takes.
- Returns:
true
if the file size will be optimized,false
otherwise.
-
setIncremental
void setIncremental(boolean incremental)
Sets whether the saving will be incremental or not. Setting this to
true
will disable shouldRewriteAndOptimizeFileSize.- Parameters:
incremental
-true
to make saving incremental,false
otherwise.
-
setApplyRedactions
void setApplyRedactions(boolean applyRedactions)
Sets whether saving will apply redactions or not.
- Parameters:
applyRedactions
-true
if redactions should be applied,false
otherwise.
-
setRewriteAndOptimizeFileSize
void setRewriteAndOptimizeFileSize(boolean rewriteAndOptimizeFileSize)
Sets whether when saving unnecessary data should be removed from the document causing smaller file sizes. Setting this to
true
will automatically disable incremental saving. When set totrue
this will lead to smaller file sizes than incremental saving or a regular rewrite at the expense of the saving process taking longer.- Parameters:
rewriteAndOptimizeFileSize
-true
if the file size should be optimized,false
otherwise.
-
-
-
-