PdfSaveSanitizer Class
Repairs harmless issues of a file that some readers handle badly (PdfSanitizerRepairKind), with one incremental update that keeps the bytes of the file: a file that has none of the issues is returned as it is.
public static class PdfSaveSanitizerMethods
| Name | Description |
|---|---|
| Sanitize(ReadOnlyMemory<byte>, PdfReadOptions?) | Repairs a file. |
Sanitize(ReadOnlyMemory<byte>, PdfReadOptions?)
PdfSaveSanitizer.csRepairs a file.
public static PdfSanitizationResult Sanitize(ReadOnlyMemory<byte> file, PdfReadOptions? options = null)Parameters
fileReadOnlyMemory<byte>- The file.
optionsPdfReadOptions?- The options to read the file with, or
nullfor the default options.
Returns
PdfSanitizationResult The repaired file and the repairs.
Exceptions
PdfException- The file cannot be read.
InvalidOperationException- The file needs repairs, and is damaged: the reader repaired its structure, so it cannot be updated incrementally.