Class CleanerScanResult
Contains the results of a PDF security scan, indicating detected threats and malware signatures. Returned by ScanPdf(PdfDocument, String[]) and related scanning methods.
Example - Check scan results:
var pdf = PdfDocument.FromFile("untrusted.pdf");
var result = Cleaner.ScanPdf(pdf);
if (result.IsDetected)
{
Console.WriteLine($"THREATS FOUND: {result.Risks.Count}");
foreach (var risk in result.Risks)
Console.WriteLine($" - {risk}");
// Do not process this PDF
}
else
{
Console.WriteLine("PDF is clean");
// Safe to process
}
Inheritance
Namespace: IronPdf
Assembly: IronPdf.dll
Syntax
public class CleanerScanResult : Object
Remarks
Key Properties:
Related Resources:
Properties
IsDetected
Gets whether any security threats or malware signatures were detected in the PDF.
Returns true if Risks contains any items.
Example:
if (result.IsDetected)
throw new SecurityException("Malicious PDF detected");
Declaration
public bool IsDetected { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
|
Risks
Gets the list of detected security risks and malware signature names. Empty list if no threats were found.
Example:
foreach (var threat in result.Risks)
_logger.LogWarning($"PDF threat: {threat}");
Declaration
public List<string> Risks { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.List<System.String> | List of threat identifiers/names. Empty if clean. |
Methods
ToString()
A text summary of CleanerScanResult
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| System.String | A text summary of CleanerScanResult |