Table of Contents

Method GetFields

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

GetFields(string, CancellationToken)

Reads the form fields of the PDF at inputPath.

public static PdfFormSnapshot GetFields(string inputPath, CancellationToken cancellationToken = default)

Parameters

inputPath string

File-system path to the source PDF.

cancellationToken CancellationToken

Cancellation token.

Returns

PdfFormSnapshot

A snapshot of every form field widget; empty when the document carries no form.

Exceptions

ArgumentException

Thrown when the path is null or whitespace.

FileNotFoundException

Thrown when inputPath does not exist.

PdfDocumentException

Thrown when the source cannot be parsed or is password protected.

GetFields(byte[], CancellationToken)

Reads the form fields of in-memory PDF bytes.

public static PdfFormSnapshot GetFields(byte[] pdfData, CancellationToken cancellationToken = default)

Parameters

pdfData byte[]

The complete PDF file.

cancellationToken CancellationToken

Cancellation token.

Returns

PdfFormSnapshot

A snapshot of every form field widget; empty when the document carries no form.

Exceptions

ArgumentNullException

Thrown when pdfData is null.

PdfDocumentException

Thrown when the source cannot be parsed or is password protected.

GetFields(Attachment, CancellationToken)

Reads the form fields of the PDF carried by attachment.

public static PdfFormSnapshot GetFields(Attachment attachment, CancellationToken cancellationToken = default)

Parameters

attachment Attachment

The attachment carrying the PDF.

cancellationToken CancellationToken

Cancellation token.

Returns

PdfFormSnapshot

A snapshot of every form field widget; empty when the document carries no form.

Exceptions

ArgumentNullException

Thrown when attachment is null.

PdfDocumentException

Thrown when the source cannot be parsed or is password protected.

Share