Interface IPdfRedactionService
Keeps a list of pending redactions and applies them, which removes the content under them.
public interface IPdfRedactionService
Methods
AddPendingRedactionAsync(IPdfDocument, RedactionArea, CancellationToken)
Marks an area for redaction. Nothing is removed until ApplyRedactionsAsync(IPdfDocument, string, IReadOnlyList<RedactionArea>, CancellationToken).
ValueTask AddPendingRedactionAsync(IPdfDocument document, RedactionArea redaction, CancellationToken cancellationToken = default)
Parameters
documentIPdfDocumentAn open document of this engine.
redactionRedactionAreaThe area to redact.
cancellationTokenCancellationTokenCancels the operation.
Returns
ApplyRedactionsAsync(IPdfDocument, string, IReadOnlyList<RedactionArea>, CancellationToken)
Writes a copy of the document with the content under redactions removed.
ValueTask ApplyRedactionsAsync(IPdfDocument document, string targetPath, IReadOnlyList<RedactionArea> redactions, CancellationToken cancellationToken = default)
Parameters
documentIPdfDocumentAn open document of this engine.
targetPathstringThe file to write.
redactionsIReadOnlyList<RedactionArea>The areas to redact.
cancellationTokenCancellationTokenCancels the operation.
Returns
GetPendingRedactionsAsync(IPdfDocument, CancellationToken)
Gets the redactions marked on the document but not applied yet.
ValueTask<IReadOnlyList<RedactionArea>> GetPendingRedactionsAsync(IPdfDocument document, CancellationToken cancellationToken = default)
Parameters
documentIPdfDocumentAn open document of this engine.
cancellationTokenCancellationTokenCancels the operation.