Method RemoveAsync
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
sourceAttachmentThe PDF document.
optionsPdfWatermarkOptionsWhich pages, signature consent and password; defaults when
null.cancellationTokenCancellationTokenCancels the operation between pages.
Returns
- Task<PdfWatermarkResult>
The cleared document and how many watermark copies were removed.
Exceptions
- ArgumentNullException
sourceisnull.- 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.