Class Cleaner
The Cleaner class can be used to scan or sanitize (remove any potentially harmful content) PDF document.
Inheritance
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 Pdf
Declaration
public static PdfDocument SanitizeWithBitmap(PdfDocument pdfDocument)
Parameters
Type | Name | Description |
---|---|---|
Pdf |
pdfDocument | An Pdf |
Returns
Type | Description |
---|---|
Pdf |
SanitizeWithBitmap(String)
Sanitize PDF by convert PDF To an Bitmap image and convert it back to PDF.
Returns a new Pdf
Declaration
public static PdfDocument SanitizeWithBitmap(string pdfFilePath)
Parameters
Type | Name | Description |
---|---|---|
System. |
pdfFilePath | A PDF File path. |
Returns
Type | Description |
---|---|
Pdf |
SanitizeWithSvg(PdfDocument)
Sanitize PDF by convert PDF To an SVG image and convert it back to PDF.
Returns a new Pdf
- Quicker than Sanitize
With Bitmap(Pdf Document) - Resulted as a serachable PDF
- Layout might be inconsistency.
Declaration
public static PdfDocument SanitizeWithSvg(PdfDocument pdfDocument)
Parameters
Type | Name | Description |
---|---|---|
Pdf |
pdfDocument | An Pdf |
Returns
Type | Description |
---|---|
Pdf |
SanitizeWithSvg(String)
Sanitize PDF by convert PDF To an SVG image and convert it back to PDF.
Returns a new Pdf
- Quicker than Sanitize
With Bitmap(Pdf Document) - Resulted as a serachable PDF
- Layout might be inconsistency.
Declaration
public static PdfDocument SanitizeWithSvg(string pdfFilePath)
Parameters
Type | Name | Description |
---|---|---|
System. |
pdfFilePath | A PDF File path. |
Returns
Type | Description |
---|---|
Pdf |
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 |
---|---|---|
Pdf |
pdfDocument | a PdfDocument object |
System. |
yaraFiles | Optional external yara rule files, this will override the default yara rules |
Returns
Type | Description |
---|---|
Cleaner |
scan result as an Cleaner |
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. |
pdfBytes | a PDF bytes |
System. |
yaraFiles | Optional external yara rule files, this will override the default yara rules |
Returns
Type | Description |
---|---|
Cleaner |
scan result as an Cleaner |
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. |
pdfFilePath | A PDF File path |
System. |
yaraFiles | Optional external yara rule files, this will override the default yara rules |
Returns
Type | Description |
---|---|
Cleaner |
scan result as an Cleaner |