Table of Contents

Property Password

Namespace
LMKit.Data
Assembly
LM-Kit.NET.dll

Password

Gets or sets the password used to decrypt password-protected documents.

public string Password { get; set; }

Property Value

string

Examples

using LMKit.Data;

var attachment = new Attachment("protected.pdf") { Password = "secret" };
string text = attachment.GetText();

Remarks

Currently applies to PDF documents. For unprotected documents, leave this property at its default value (Empty); assigning null is treated as an empty string.

The password is applied the next time the underlying document is loaded. Setting this property after the document has already been materialised (for example, after a call to GetText(CancellationToken)) invalidates the cached document so that it is reopened with the new password on subsequent access.

A wrong or missing password surfaces as a PdfDocumentException (with PasswordRequired) on the first API call that materialises the document.

Share