Method Fill
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
inputPathstringFile-system path to the source PDF.
requestPdfFormFillRequestThe values to write and the flatten option.
cancellationTokenCancellationTokenCancellation 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
requestis null.- FileNotFoundException
Thrown when
inputPathdoes 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
pdfDatabyte[]The complete PDF file.
requestPdfFormFillRequestThe values to write and the flatten option.
cancellationTokenCancellationTokenCancellation token.
Returns
- PdfFormFillResult
The filled PDF bytes and the report of what was written.
Exceptions
- ArgumentNullException
Thrown when
pdfDataorrequestis 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
attachmentAttachmentThe attachment carrying the PDF.
requestPdfFormFillRequestThe values to write and the flatten option.
cancellationTokenCancellationTokenCancellation token.
Returns
- PdfFormFillResult
The filled PDF bytes and the report of what was written.
Exceptions
- ArgumentNullException
Thrown when
attachmentorrequestis null.- PdfDocumentException
Thrown when the source cannot be parsed or is password protected.