Apryse SDK's Sanitizer ensures that if specified content categories are present in a document, the content is permanently destroyed and is not simply disabled or obscured. This prevents leakage of sensitive data such as authoring details, editing history, private identifiers, residual form entries, and neutralizes scripts or attachments.
Sanitization is recommended prior to external sharing with clients, partners, or regulatory bodies. It helps align with privacy policies and compliance requirements by permanently removing any potentially sensitive hidden data.
Document sanitization is an irreversible action, so it is recommended to create backups of any documents before use.
The sanitization process in the Apryse SDK consists of two parts:
1. Content Detection: A user calls pdftron.PDF.Sanitizer.GetSanitizableContent() to retrieve a SanitizeOptions object outlining the sanitizable content groups present within the document. For each content group that exists within the provided document, the corresponding category is automatically enabled. This can be used to get an understanding on how sanitization will modify the document and make informed decisions on content groups to remove.
2. Document Sanitization: Using pdftron.PDF.Sanitizer.SanitizeDocument(),the user instructs to permanently strip the specified content from the document. When called without an options parameter, all sanitizable content present within the document is removed.
The user can optionally provide a SanitizeOptions object to control exactly which content categories are removed. For example, remove only metadata, form data, and bookmarks while leaving other content intact by enabling the corresponding categories within the SanitizeOptions object.
To sanitize content from a PDF document use the following code:
We also have a full code sample for PDF sanitization which shows how to use pdftron.PDF.Sanitizer to permanently remove sensitive hidden content within PDF documents. Code sample is available in C++, C#, Java, Python, Go, PHP, Ruby, VB, and Obj-C.
Did you find this helpful?
Trial setup questions?
Ask experts on DiscordNeed other help?
Contact SupportPricing or product questions?
Contact Sales