Available for: UI for ASP.NET MVC | UI for ASP.NET AJAX | UI for Blazor | UI for WPF | UI for WinForms | UI for Silverlight | UI for Xamarin | UI for WinUI | UI for ASP.NET Core | UI for .NET MAUI

New to Telerik Document Processing? Download free 30-day trial

Form

Form is a content element, which contains a form source and represents a Form XObject. The Form XObjects enables you to describe objects (text, images, vector elements, etc.) within a PDF file and reuse this content among the document.

Creating and Inserting a Form

The Form class exposes a default public constructor to allow you create instances of it. Form is a content element and you can add such an object to the Content collection of an IContainerElement such as RadFixedPage.

Example 1 shows how to initialize a Form object and add it to a previously defined container.

Example 1: Create a form and add it to an IContainerElement

Form form = new Form(); 
container.Content.Add(form); 

Example 2 demonstrates how to use one of the factory methods of the ContentElementCollection to create a new form and insert it into the respective container.

Example 2: Add a form to a container

Form form = container.Content.AddForm(); 
Form formWithSource = container.Content.AddForm(formSource); 

There are other methods that allow adding a form to a document by passing it size and source. They could be used through the FixedContentEditor class.

You can add content to the form by setting its FormSource property. The API allows you also to directly pass the FormSource to a method which will automatically generate a form in the document content. For more information on this topic, check the FormSource article.

Form Properties

You can modify a Form element using the properties the class exposes. The properties are listed below.

  • FormSource: Specifies the content that will be visualized in the Form object. It is of type FormSource.

  • Clipping: Gets or sets the clipping of the form object.

  • Width: The width of the form.

  • Height: The height of the form.

  • Position: The Position of the form inside the IContainerElement.

  • Parent: Allows you to obtain the parent page of the form.

See Also

In this article