public final class HiddenDataSanitizationOptions extends Object
Represents the configuration options for sanitizing hidden data within a document.
| Constructor and Description |
|---|
HiddenDataSanitizationOptions() |
| Modifier and Type | Method and Description |
|---|---|
static HiddenDataSanitizationOptions |
all()
Creates a new instance of the
HiddenDataSanitizationOptions class with all options set for sanitization. |
boolean |
getConvertPagesToImages()
Gets the option to convert pages to images.
|
boolean |
getFlattenForms()
Gets a value indicating whether forms in the document
should be flattened during the sanitization process.
|
boolean |
getFlattenLayers()
Gets the option to flatten the layers in the PDF document.
|
ImageCompressionOptions |
getImageCompressionOptions()
Gets the document image conversion option.
|
int |
getImageDpi()
Gets the option to resolve page images during conversion.
|
boolean |
getRemoveAnnotations()
Gets a value indicating whether to remove annotations from the document.
|
boolean |
getRemoveAttachments()
Gets the option to remove all attached files from the document.
|
boolean |
getRemoveJavaScriptsAndActions()
Gets a value indicating whether JavaScript and associated actions should be removed from the document.
|
boolean |
getRemoveMetadata()
Gets an option to remove metadata from the document.
|
boolean |
getRemoveSearchIndexAndPrivateInfo()
Gets a value indicating whether the search index and private information should be removed from the document.
|
void |
setConvertPagesToImages(boolean value)
Sets the option to convert pages to images.
|
void |
setFlattenForms(boolean value)
Sets a value indicating whether forms in the document
should be flattened during the sanitization process.
|
void |
setFlattenLayers(boolean value)
Sets the option to flatten the layers in the PDF document.
|
void |
setImageCompressionOptions(ImageCompressionOptions value)
Sets the document image conversion option.
|
void |
setImageDpi(int value)
Sets the option to resolve page images during conversion.
|
void |
setRemoveAnnotations(boolean value)
Sets a value indicating whether to remove annotations from the document.
|
void |
setRemoveAttachments(boolean value)
Sets the option to remove all attached files from the document.
|
void |
setRemoveJavaScriptsAndActions(boolean value)
Sets a value indicating whether JavaScript and associated actions should be removed from the document.
|
void |
setRemoveMetadata(boolean value)
Sets an option to remove metadata from the document.
|
void |
setRemoveSearchIndexAndPrivateInfo(boolean value)
Sets a value indicating whether the search index and private information should be removed from the document.
|
public final ImageCompressionOptions getImageCompressionOptions()
Gets the document image conversion option.
The option must be enabled manually when using the #All() method if it is required.
public final void setImageCompressionOptions(ImageCompressionOptions value)
Sets the document image conversion option.
The option must be enabled manually when using the #All() method if it is required.
value - the document image conversion option.public final boolean getConvertPagesToImages()
Gets the option to convert pages to images.
If this option is enabled, the ImageCompressionOptions option will be ignored.
The option must be enabled manually when using the #All() method if it is required.
The conversion of pages to images will occur after clearing the main hidden data, which is controlled by other options.
public final void setConvertPagesToImages(boolean value)
Sets the option to convert pages to images.
If this option is enabled, the ImageCompressionOptions option will be ignored.
The option must be enabled manually when using the #All() method if it is required.
The conversion of pages to images will occur after clearing the main hidden data, which is controlled by other options.
value - the option to convert pages to images.public final int getImageDpi()
Gets the option to resolve page images during conversion.
public final void setImageDpi(int value)
Sets the option to resolve page images during conversion.
value - the option to resolve page images during conversion.public final boolean getRemoveAnnotations()
Gets a value indicating whether to remove annotations from the document. When enabled, all annotations present in the document will be removed during the sanitization process. Redact annotations will be applied.
public final void setRemoveAnnotations(boolean value)
Sets a value indicating whether to remove annotations from the document. When enabled, all annotations present in the document will be removed during the sanitization process. Redact annotations will be applied.
value - a value indicating whether to remove annotations from the document.public final boolean getRemoveSearchIndexAndPrivateInfo()
Gets a value indicating whether the search index and private information should be removed from the document. Enables the removal of embedded search indices and private data to enhance document security and privacy.
public final void setRemoveSearchIndexAndPrivateInfo(boolean value)
Sets a value indicating whether the search index and private information should be removed from the document. Enables the removal of embedded search indices and private data to enhance document security and privacy.
value - a value indicating whether the search index and private information should be removed from the document.public final boolean getFlattenForms()
Gets a value indicating whether forms in the document should be flattened during the sanitization process. Flattening forms converts interactive form fields into static content, making them non-editable or fillable.
public final void setFlattenForms(boolean value)
Sets a value indicating whether forms in the document should be flattened during the sanitization process. Flattening forms converts interactive form fields into static content, making them non-editable or fillable.
value - a value indicating whether forms in the document
should be flattened during the sanitization process.public final boolean getFlattenLayers()
Gets the option to flatten the layers in the PDF document. When enabled, all layers in the document are merged into a single layer, removing their separate structure. This option is useful for sanitizing documents by simplifying their content and ensuring no hidden data resides within layers.
public final void setFlattenLayers(boolean value)
Sets the option to flatten the layers in the PDF document. When enabled, all layers in the document are merged into a single layer, removing their separate structure. This option is useful for sanitizing documents by simplifying their content and ensuring no hidden data resides within layers.
value - the option to flatten the layers in the PDF document.public final boolean getRemoveJavaScriptsAndActions()
Gets a value indicating whether JavaScript and associated actions should be removed from the document. This option is useful to eliminate potential security vulnerabilities introduced by embedded scripts.
public final void setRemoveJavaScriptsAndActions(boolean value)
Sets a value indicating whether JavaScript and associated actions should be removed from the document. This option is useful to eliminate potential security vulnerabilities introduced by embedded scripts.
value - a value indicating whether JavaScript and associated actions should be removed from the document.public final boolean getRemoveMetadata()
Gets an option to remove metadata from the document. If set to true, metadata such as document properties and additional embedded metadata information will be removed during sanitization.
public final void setRemoveMetadata(boolean value)
Sets an option to remove metadata from the document. If set to true, metadata such as document properties and additional embedded metadata information will be removed during sanitization.
value - an option to remove metadata from the document.public final boolean getRemoveAttachments()
Gets the option to remove all attached files from the document. When enabled, it ensures that any attachments within the PDF are eliminated during the sanitation process.
public final void setRemoveAttachments(boolean value)
Sets the option to remove all attached files from the document. When enabled, it ensures that any attachments within the PDF are eliminated during the sanitation process.
value - the option to remove all attached files from the document.public static HiddenDataSanitizationOptions all()
Creates a new instance of the HiddenDataSanitizationOptions class with all options set for sanitization.
This includes enabling the removal of annotations, JavaScript, metadata, attachments, search index, private information,
flattening of forms and layers, while disabling the option to convert pages to images.
Optional configurations like ImageCompressionOptions(getImageCompressionOptions()/setImageCompressionOptions(com.aspose.pdf.optimization.ImageCompressionOptions)) or ConvertPagesToImages(getConvertPagesToImages()/setConvertPagesToImages(boolean)) can be manually modified
after obtaining the instance, as they are not active by default.
HiddenDataSanitizationOptions instance with all sanitization options preconfigured.Copyright © 2026 Aspose. All Rights Reserved.