Table of Contents

Method RedactToFile

Namespace
LMKit.Document.Pdf
Assembly
LM-Kit.NET.dll

RedactToFile(string, string, PdfRedactionRequest, PdfRedactionOptions, CancellationToken)

Redacts the PDF at inputPath and writes the result to outputPath.

public static PdfRedactionReport RedactToFile(string inputPath, string outputPath, PdfRedactionRequest request, PdfRedactionOptions options = null, CancellationToken cancellationToken = default)

Parameters

inputPath string

File-system path to the source PDF.

outputPath string

Destination path for the redacted document.

request PdfRedactionRequest

What to redact.

options PdfRedactionOptions

Optional redaction options; defaults are used when null.

cancellationToken CancellationToken

Cancellation token.

Returns

PdfRedactionReport

A report describing what was removed.

Exceptions

ArgumentException

Thrown when a path is null or whitespace.

ArgumentNullException

Thrown when request is null.

FileNotFoundException

Thrown when inputPath does not exist.

PdfDocumentException

Thrown when the source cannot be parsed, the password is wrong, or a page could not be processed.

RedactToFile(byte[], string, PdfRedactionRequest, PdfRedactionOptions, CancellationToken)

Redacts in-memory PDF bytes and writes the result to outputPath.

public static PdfRedactionReport RedactToFile(byte[] pdfData, string outputPath, PdfRedactionRequest request, PdfRedactionOptions options = null, CancellationToken cancellationToken = default)

Parameters

pdfData byte[]
outputPath string
request PdfRedactionRequest
options PdfRedactionOptions
cancellationToken CancellationToken

Returns

PdfRedactionReport

RedactToFile(Stream, string, PdfRedactionRequest, PdfRedactionOptions, CancellationToken)

Redacts the PDF read from inputStream and writes the result to outputPath.

public static PdfRedactionReport RedactToFile(Stream inputStream, string outputPath, PdfRedactionRequest request, PdfRedactionOptions options = null, CancellationToken cancellationToken = default)

Parameters

inputStream Stream
outputPath string
request PdfRedactionRequest
options PdfRedactionOptions
cancellationToken CancellationToken

Returns

PdfRedactionReport

RedactToFile(Attachment, string, PdfRedactionRequest, PdfRedactionOptions, CancellationToken)

Redacts the PDF carried by attachment and writes the result to outputPath.

public static PdfRedactionReport RedactToFile(Attachment attachment, string outputPath, PdfRedactionRequest request, PdfRedactionOptions options = null, CancellationToken cancellationToken = default)

Parameters

attachment Attachment
outputPath string
request PdfRedactionRequest
options PdfRedactionOptions
cancellationToken CancellationToken

Returns

PdfRedactionReport
Share