public final class HiddenDataSanitizer extends Object
Represents a class for sanitizing hidden data.
| Constructor and Description |
|---|
HiddenDataSanitizer(HiddenDataSanitizationOptions options)
Provides functionality to sanitize hidden data from a PDF document, ensuring that sensitive or unnecessary
information such as metadata, annotations, JavaScripts, or private content is removed or transformed.
|
| Modifier and Type | Method and Description |
|---|---|
void |
sanitize(Document document)
Sanitizes a given PDF document by removing or transforming hidden data.
|
static void |
sanitizeAllToImages(Document document)
Replaces page content with images and removes other hidden data.
|
static void |
sanitizeAllToImages(Document document,
int dpi)
Replaces page content with images and removes other hidden data.
|
public HiddenDataSanitizer(HiddenDataSanitizationOptions options)
Provides functionality to sanitize hidden data from a PDF document, ensuring that sensitive or unnecessary information such as metadata, annotations, JavaScripts, or private content is removed or transformed.
options - The options to use for sanitization.public static void sanitizeAllToImages(Document document)
Replaces page content with images and removes other hidden data. Allows you to remove hidden text with a background color, as well as text hidden under images. Also, completely removes all interactive elements. The document is converted to images as is, and then cleared of any remaining hidden data. If you need to clear first and then convert, use the main class method.
document - The docunent object.public static void sanitizeAllToImages(Document document, int dpi)
Replaces page content with images and removes other hidden data. Allows you to remove hidden text with a background color, as well as text hidden under images. Also completely removes all interactive elements. The document is converted to images as is, and then cleared of any remaining hidden data. If you need to clear first and then convert, use the main class method.
document - The docunent object.dpi - The dpi of pages' images.public final void sanitize(Document document)
Sanitizes a given PDF document by removing or transforming hidden data.
document - The PDF document to be sanitized.Copyright © 2026 Aspose. All Rights Reserved.