feat(pdf-tools): add sanitize-pdf tool for comprehensive document cleaning

Implement a new PDF sanitization tool that allows users to remove various potentially sensitive elements from PDFs including metadata, annotations, JavaScript, embedded files, and more. The tool provides configurable options through checkboxes to selectively remove different types of content while preserving the core document structure.

Extract reusable utility functions from existing tools (remove-metadata, remove-annotations, flatten) to support the new sanitization feature. The tool handles edge cases gracefully and provides feedback when no changes are made.
This commit is contained in:
abdullahalam123
2025-10-22 13:15:22 +05:30
parent 11ba3fe81b
commit e0e5d50240
9 changed files with 830 additions and 285 deletions

View File

@@ -38,6 +38,7 @@ export const singlePdfLoadTools = [
'posterize',
'remove-blank-pages',
'add-attachments',
'sanitize-pdf',
];
export const simpleTools = [

View File

@@ -412,6 +412,12 @@ export const categories = [
icon: 'lock',
subtitle: 'Add a password to protect your PDF.',
},
{
id: 'sanitize-pdf',
name: 'Sanitize PDF',
icon: 'shield-alert',
subtitle: 'Remove metadata, annotations, scripts, and more.',
},
{
id: 'decrypt',
name: 'Decrypt PDF',