←Select platform

FillFormFields Method

Summary

Fills the PDF form document.

Syntax

C#
C++/CLI
Python
public void FillFormFields( 
   IList<PDFFormField> fields, 
   string destinationFileName 
) 
public:  
   void FillFormFields( 
      IList<PDFFormField^>^ fields, 
      String^ destinationFileName 
   ) 
def FillFormFields(self,fields,destinationFileName): 

Parameters

fields

A List of PDFFormField to fill. This must not be null and a list of 1 or more items. An empty list (count is zero) will throw an exception.

destinationFileName

Name of the destination PDF document to be created. If the value of this parameter is null, then the filename set in FileName will be updated.

Remarks

You can use FillFormFields to fill PDF form documents.

LEADTOOLS supports loading all form fields from a PDF file. Due to the nature and complexity of PDF form fields, especially the prevalent use of PDF files that contain many custom and user-defined fields, LEADTOOLS reads the data as is and sets it in PDFFormField without any modification. Refer to the PDF Form Fields Demo for an example of parsing data to generate a live, editable PDF file.

Example

C#
using Leadtools.WinForms; 
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.Controls; 
using Leadtools.Drawing; 
using Leadtools.ImageProcessing; 
using Leadtools.Pdf; 
using Leadtools.Svg; 
 
 
public void PDFFillFormFieldsExample(string fileName, string name, string value, int type) 
{ 
   PDFFile file = new PDFFile(fileName); 
   IList<PDFFormField> fields = new List<PDFFormField>(); 
   PDFFormField field = new PDFFormField(); 
   field.Name = name; 
   field.Contents = new List<String>(); 
   field.Contents.Add(value); 
   field.ContentType = type; 
 
   fields.Add(field); 
   file.FillFormFields(fields, null); 
} 

Requirements

Target Platforms

See Also

PDFFile Class

PDFFile Members

Leadtools.Pdf Namespace

Help Version 22.0.2023.7.10
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Pdf Assembly

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.