Table of Contents

Method RemoveAsync

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

RemoveAsync(Attachment, PdfWatermarkOptions, CancellationToken)

Removes the watermarks laid by Apply(Attachment, Watermark, PdfWatermarkOptions, CancellationToken) (and any other content marked as a pagination artifact of subtype Watermark) from the pages of the PDF in source. ReplaceExisting is ignored.

public static Task<PdfWatermarkResult> RemoveAsync(Attachment source, PdfWatermarkOptions options = null, CancellationToken cancellationToken = default)

Parameters

source Attachment

The PDF document.

options PdfWatermarkOptions

Which pages, signature consent and password; defaults when null.

cancellationToken CancellationToken

Cancels the operation between pages.

Returns

Task<PdfWatermarkResult>

The cleared document and how many watermark copies were removed.

Exceptions

ArgumentNullException

source is null.

ArgumentOutOfRangeException

A page index is outside the document.

PdfSignatureInvalidationException

The document is signed and the options do not consent to invalidating it.

PdfDocumentException

The source is not a readable PDF, the password is wrong, or a page could not be written.

Share