Table of Contents

Method RedactToFile

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

RedactToFile(string, string, OfficeRedactionRequest, OfficeRedactionOptions, CancellationToken)

Redacts the Office document at inputPath and writes the result to outputPath. The format is taken from the input path's extension and is preserved in the output.

public static OfficeRedactionReport RedactToFile(string inputPath, string outputPath, OfficeRedactionRequest request, OfficeRedactionOptions options = null, CancellationToken cancellationToken = default)

Parameters

inputPath string

File-system path to the source document.

outputPath string

Destination path for the redacted document.

request OfficeRedactionRequest

What to redact.

options OfficeRedactionOptions

Optional redaction options; defaults are used when null.

cancellationToken CancellationToken

Cancellation token.

Returns

OfficeRedactionReport

A report describing what was overwritten.

Exceptions

ArgumentException

Thrown when a path is null or whitespace.

ArgumentNullException

Thrown when request is null.

FileNotFoundException

Thrown when inputPath does not exist.

NotSupportedException

Thrown when the input path's extension names a format other than .docx, .xlsx or .pptx.

Share