ScanPdf
IsSafePdf
SanitizePdf
No API keys or external services are required.
Each action accepts:
application/pdf
The declared content type is compared with the file’s actual byte signature. Do not determine file validity from its filename alone.
Call the scanner in a server action immediately after receiving an uploaded file and before saving or processing it.
Recommended flow:
IsSafe
True
FullySanitized
Scans the uploaded file and returns a detailed JSON report.
Inputs
FileContent
FileName
DeclaredContentType
Output
ScanResultJson
The JSON report contains validation status, detected content type, JavaScript status, executable-content status, findings, and error information.
Provides a simplified result suitable for controlling an upload flow.
Outputs
Code
Message
Only store or process the original file when IsSafe is True.
Attempts to neutralize supported executable PDF content.
SanitizedFileContent
WasModified
Only use SanitizedFileContent when FullySanitized is True.
CLEAN
EXECUTABLE_CONTENT_DETECTED
EMPTY_UPLOAD
INVALID_FILE_SIGNATURE
MIME_TYPE_MISMATCH
The extension detects:
General file signatures such as PDF, PNG, JPEG, and ZIP are recognized. Advanced embedded-content scanning and sanitization currently apply to PDF files.
This extension provides signature validation and heuristic security scanning. It does not replace antivirus software, malware sandboxing, or enterprise Content Disarm and Reconstruction services.
Reject or quarantine files when:
IsValidUpload
False