Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
A PDF document may contain various hidden data that could compromise confidentiality or pose potential threats when the file is shared.
By using the HiddenDataSanitizer class, you can remove the hidden data you choose.
You can flexibly configure the sanitization process using the HiddenDataSanitizerOptions class.
This class configures the sanitization process for hidden data in a PDF document.
It allows centralized enabling and configuration of the removal of potentially sensitive, invisible, or unwanted information (annotations, scripts, metadata, attachments, indexes, etc.),
as well as controlling page rasterization and image compression parameters.
It is suitable for scenarios such as:
ImageCompressionOptions: ImageCompressionOptions
Image compression settings for optimization. Ignored if page rasterization is enabled. Not automatically activated by the All() method — configure manually if needed.
ConvertPagesToImages: bool
Converts pages to raster images. When enabled, ImageCompressionOptions is ignored. Executed after cleaning the main hidden content by other options. Not automatically activated by the All() method.
ImageDpi: int (default 150)
Resolution (DPI) used when converting pages to images.
RemoveAnnotations: bool
Removes all document annotations. Redact annotations will be applied.
RemoveSearchIndexAndPrivateInfo: bool
Removes embedded search indexes and private information.
FlattenForms: bool
Flattens forms: interactive fields become static, non-editable content.
FlattenLayers: bool
Flattens layers: all layers are merged into one, simplifying structure and removing hidden layer data.
RemoveJavaScriptsAndActions: bool
Removes JavaScript and related actions to eliminate potential vulnerabilities.
RemoveMetadata: bool
Removes metadata (document properties and additional embedded info).
RemoveAttachments: bool
Removes all embedded files.
static All(): HiddenDataSanitizationOptionsRemoveAnnotations, RemoveJavaScriptsAndActions, RemoveMetadata, RemoveAttachments, RemoveSearchIndexAndPrivateInfo, FlattenForms, FlattenLayers;ConvertPagesToImages = false) and image processing (ImageCompressionOptions = null) disabled.ImageCompressionOptions and ConvertPagesToImages after calling All().The HiddenDataSanitizer class provides functions for cleaning PDF documents of hidden data (metadata, attachments, annotations, JavaScript, private information, etc.).
It uses a set of options defined in HiddenDataSanitizationOptions to flexibly control the sanitization process.
SanitizeAllToImagespublic static void SanitizeAllToImages(Document document, int dpi = 150)
Converts all PDF document pages to images and then removes any remaining hidden data. This method is useful when you need to completely “seal” a document as raster images, eliminating all hidden elements.
Sanitizepublic void Sanitize(Document document)
Performs the PDF sanitization according to the options provided in the constructor.
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.