Search Results for

    Show / Hide Table of Contents

    Class Cleaner

    The Cleaner class can be used to scan or sanitize (remove any potentially harmful content) PDF document.

    Inheritance
    System.Object
    Cleaner
    Namespace: IronPdf
    Assembly: IronPdf.dll
    Syntax
    public static class Cleaner : Object

    Methods

    SanitizeWithBitmap(PdfDocument)

    Sanitize PDF by convert PDF To an Bitmap image and convert it back to PDF. Returns a new PdfDocument object.

    Declaration
    public static PdfDocument SanitizeWithBitmap(PdfDocument pdfDocument)
    Parameters
    Type Name Description
    PdfDocument pdfDocument

    An PdfDocument of document.

    Returns
    Type Description
    PdfDocument

    SanitizeWithBitmap(String)

    Sanitize PDF by convert PDF To an Bitmap image and convert it back to PDF. Returns a new PdfDocument object.

    Declaration
    public static PdfDocument SanitizeWithBitmap(string pdfFilePath)
    Parameters
    Type Name Description
    System.String pdfFilePath

    A PDF File path.

    Returns
    Type Description
    PdfDocument

    SanitizeWithSvg(PdfDocument)

    Sanitize PDF by convert PDF To an SVG image and convert it back to PDF. Returns a new PdfDocument object.

    • Quicker than SanitizeWithBitmap(PdfDocument)
    • Resulted as a serachable PDF
    • Layout might be inconsistency.
    Declaration
    public static PdfDocument SanitizeWithSvg(PdfDocument pdfDocument)
    Parameters
    Type Name Description
    PdfDocument pdfDocument

    An PdfDocument of document.

    Returns
    Type Description
    PdfDocument

    SanitizeWithSvg(String)

    Sanitize PDF by convert PDF To an SVG image and convert it back to PDF. Returns a new PdfDocument object.

    • Quicker than SanitizeWithBitmap(PdfDocument)
    • Resulted as a serachable PDF
    • Layout might be inconsistency.
    Declaration
    public static PdfDocument SanitizeWithSvg(string pdfFilePath)
    Parameters
    Type Name Description
    System.String pdfFilePath

    A PDF File path.

    Returns
    Type Description
    PdfDocument

    ScanPdf(PdfDocument, String[])

    Scan for any risk that might exists in a PDF.

    Declaration
    public static CleanerScanResult ScanPdf(PdfDocument pdfDocument, string[] yaraFiles = null)
    Parameters
    Type Name Description
    PdfDocument pdfDocument

    a PdfDocument object

    System.String[] yaraFiles

    Optional external yara rule files, this will override the default yara rules

    Returns
    Type Description
    CleanerScanResult

    scan result as an CleanerScanResult object

    ScanPdf(Byte[], String[])

    Scan for any risk that might exists in a PDF.

    Declaration
    public static CleanerScanResult ScanPdf(byte[] pdfBytes, string[] yaraFiles = null)
    Parameters
    Type Name Description
    System.Byte[] pdfBytes

    a PDF bytes

    System.String[] yaraFiles

    Optional external yara rule files, this will override the default yara rules

    Returns
    Type Description
    CleanerScanResult

    scan result as an CleanerScanResult object

    ScanPdf(String, String[])

    Scan for any risk that might exists in a PDF.

    Declaration
    public static CleanerScanResult ScanPdf(string pdfFilePath, string[] yaraFiles = null)
    Parameters
    Type Name Description
    System.String pdfFilePath

    A PDF File path

    System.String[] yaraFiles

    Optional external yara rule files, this will override the default yara rules

    Returns
    Type Description
    CleanerScanResult

    scan result as an CleanerScanResult object

    ☀
    ☾
    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.