Articles in this section
Category / Section

How to do Form Filling in WinForms using PdfViewerControl?

2 mins read

How to do Form Filling in WindowsForms using PdfViewerControl?

At Present we do not have support for Form Filling in Windows Forms using PdfViewerControl. However we have created a workaround to perform the same action in Windows Forms.

The following code snippet from the attached sample is an example to add a Field at particular location.

C#

        /// <summary>
        /// Adds the Fields for particular page
        /// </summary>
        /// <param name="index">Index of the page</param>     
        public void AddFields(int index)
        {
            //FormFilesDictionary contans all the fields of particlar PDF page
            foreach (var currentField in FormFilesDictionary[index])
            {
                PdfPageBase page = ((PdfField)currentField).Page;
                //Adds a textbox if the current Field is Textbox
                if (currentField is PdfLoadedTextBoxField)
                {
                    PdfLoadedTextBoxField txtField = currentField as PdfLoadedTextBoxField;
                    TextBox txtBlock = new TextBox();                    
                    txtBlock.Text = txtField.Text;                  
                    // Textbox will get added to the Page
                    panel1.Controls.Add(txtBlock);
                }                               
            }
        }

Sample:


https://www.syncfusion.com/downloads/support/directtrac/general/ze/FillableForm-1443353139

 


Conclusion

I hope you enjoyed learning how to do Form Filling in WinForms using PdfViewerControl.

You can refer to our WinForms PdfViewer feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our WinForms PdfViewer example to understand how to create and manipulate data.

For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied