Search Results for

    Show / Hide Table of Contents

    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
    System.Object
    CleanerScanResult
    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

    true if threats detected; false if PDF is clean.

    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

    See Also

    Cleaner
    ☀
    ☾
    Downloads
    • Download with Nuget
    • Start for Free
    In This Article
    Back to top
    Install with Nuget
    Want to deploy IronPDF to a live project for FREE?
    What’s included?
    30 days of fully-functional product
    Test and share in a live environment
    No watermarks in production
    Get your free 30-day Trial Key instantly.
    No credit card or account creation required
    Your Trial License Key has been emailed to you.
    Download IronPDF free to apply
    your Trial Licenses Key
    Install with NuGet View Licenses
    Licenses from $499. Have a question? Get in touch.