Table of Contents

Method Fill

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

Fill(string, PdfFormFillRequest, CancellationToken)

Fills the form of the PDF at inputPath and returns the filled bytes together with the report.

public static PdfFormFillResult Fill(string inputPath, PdfFormFillRequest request, CancellationToken cancellationToken = default)

Parameters

inputPath string

File-system path to the source PDF.

request PdfFormFillRequest

The values to write and the flatten option.

cancellationToken CancellationToken

Cancellation token.

Returns

PdfFormFillResult

The filled PDF bytes and the report of what was written.

Exceptions

ArgumentException

Thrown when the path is null or whitespace.

ArgumentNullException

Thrown when request is null.

FileNotFoundException

Thrown when inputPath does not exist.

PdfDocumentException

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

Fill(byte[], PdfFormFillRequest, CancellationToken)

Fills the form of in-memory PDF bytes and returns the filled bytes together with the report.

public static PdfFormFillResult Fill(byte[] pdfData, PdfFormFillRequest request, CancellationToken cancellationToken = default)

Parameters

pdfData byte[]

The complete PDF file.

request PdfFormFillRequest

The values to write and the flatten option.

cancellationToken CancellationToken

Cancellation token.

Returns

PdfFormFillResult

The filled PDF bytes and the report of what was written.

Exceptions

ArgumentNullException

Thrown when pdfData or request is null.

PdfDocumentException

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

Fill(Attachment, PdfFormFillRequest, CancellationToken)

Fills the form of the PDF carried by attachment and returns the filled bytes together with the report.

public static PdfFormFillResult Fill(Attachment attachment, PdfFormFillRequest request, CancellationToken cancellationToken = default)

Parameters

attachment Attachment

The attachment carrying the PDF.

request PdfFormFillRequest

The values to write and the flatten option.

cancellationToken CancellationToken

Cancellation token.

Returns

PdfFormFillResult

The filled PDF bytes and the report of what was written.

Exceptions

ArgumentNullException

Thrown when attachment or request is null.

PdfDocumentException

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

Share