skip navigation
  • Product Bundles

    DevCraft

    All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:

    • AI Coding Assistants
    • Embedded Reporting
    • Document Processing Libraries
    • SSO Account Sign-in

    Web

    Kendo UI UI for Angular UI for Vue UI for jQuery KendoReact UI for Blazor UI for ASP.NET Core UI for ASP.NET MVC UI for ASP.NET AJAX

    Mobile

    UI for .NET MAUI

    Document Management

    Telerik Document Processing

    Desktop

    UI for .NET MAUI UI for WinUI UI for WinForms UI for WPF

    Reporting

    Telerik Reporting Telerik Report Server

    Testing & Mocking

    Test Studio Telerik JustMock

    CMS

    Sitefinity

    AI Productivity Tools

    AI Coding Assistants

    UI/UX Tools

    ThemeBuilder Design System Kit Templates and Building Blocks

    Debugging

    Fiddler Fiddler Everywhere Fiddler Classic Fiddler Everywhere Reporter FiddlerCore

    Free Tools

    KendoReact Free VB.NET to C# Converter Testing Framework
    View all products
  • Overview
  • Demos
    • What's New
    • Roadmap
    • Release History
  • Support and Learning

    • Support and Learning Hub
    • First Steps
    • Docs
    • Demos
    • Virtual Classroom
    • Forums
    • Videos
    • Blogs
    • Accessibility
    • Submit a Ticket

    Productivity and Design Tools

    • Visual Studio Extensions
    • Visual Studio Templates
    • Embedded Reporting
  • Pricing
  • Shopping cart
    • Account Overview
    • Your Licenses
    • Downloads
    • Support Center
    • Forum Profile
    • Payment Methods
    • Edit Profile
    • Log out
  • Login
  • Contact Us
  • Try now

Class FormSource

Reusable PDF form (XObject) content container owning a ContentElementCollection; instantiate once and place via multiple Form instances to avoid duplicating drawing operations.

Inheritance
System.Object
FormSource
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Telerik.Windows.Documents.Fixed.Model.Resources
Assembly: Telerik.Windows.Documents.Fixed.dll

Syntax

public class FormSource : IContentRootElement, IContainerElement, IFixedDocumentElement, IInstanceIdOwner

Constructors

FormSource()

Initialize an empty form ready to accept content elements.

Declaration
public FormSource()

Properties

Annotations

Annotation collection (not supported for form content and will throw).

Declaration
public AnnotationCollection Annotations { get; }
Property Value
AnnotationCollection

Implements
IContentRootElement.Annotations

Content

Collection of child drawing elements composing the form’s appearance.

Declaration
public ContentElementCollection Content { get; }
Property Value
ContentElementCollection

The content.

Implements
IContainerElement.Content

DefaultStructureRoot

Root structure element used as the starting point when auto‑tagging is active.

Declaration
public StructureElement DefaultStructureRoot { get; }
Property Value
StructureElement

The default structure root.

Implements
IContentRootElement.DefaultStructureRoot

Parent

Parent content element (always null because a form source is a root entity).

Declaration
public IFixedDocumentElement Parent { get; }
Property Value
IFixedDocumentElement

Implements
IFixedDocumentElement.Parent

Size

Logical width and height bounding the form’s coordinate space.

Declaration
public Size Size { get; set; }
Property Value
System.Windows.Size

Implements
IContentRootElement.Size

StructureStack

Stack tracking nested structure elements while building tagged content.

Declaration
public Stack<StructureElement> StructureStack { get; }
Property Value
System.Collections.Generic.Stack<StructureElement>

The structure stack.

Implements
IContentRootElement.StructureStack

SupportsAnnotations

Indicates support for annotations (always false for forms).

Declaration
public bool SupportsAnnotations { get; }
Property Value
System.Boolean

Implements
IContentRootElement.SupportsAnnotations

SupportsAutoTagging

Indicates whether automatic tagging is supported (forms do not support it).

Declaration
public bool SupportsAutoTagging { get; }
Property Value
System.Boolean

True if the element supports auto tagging.

Implements
IContentRootElement.SupportsAutoTagging

Methods

From2DBarcode(Symbology2DType, String)

Create a reusable form (XObject) from a 2D barcode (e.g., QR, Swiss QR) using a default size of 100x100 DIPs.

Declaration
public static FormSource From2DBarcode(Symbology2DType symbology, string value)
Parameters
Symbology2DType symbology

The 2D barcode symbology. See Symbology2DType.

System.String value

The data to encode in the 2D barcode.

Returns
FormSource

Remarks

If value is null or empty, no modules are generated and the returned form will have a size of 0x0.

From2DBarcode(Symbology2DType, String, Int32, Int32)

Create a reusable form (XObject) from a 2D barcode with explicit target size in DIPs.

Declaration
public static FormSource From2DBarcode(Symbology2DType symbology, string value, int width, int height)
Parameters
Symbology2DType symbology

The 2D barcode symbology. See Symbology2DType.

System.String value

The data to encode in the 2D barcode.

System.Int32 width

Target barcode width in DIPs.

System.Int32 height

Target barcode height in DIPs.

Returns
FormSource

Remarks

Modules are sized to fit within the provided width and height. Sizing snaps to whole DIP units to preserve crisp edges.

FromBarcode(Symbology1DType, String)

Create a reusable form (XObject) from a 1D barcode value using the specified symbology and default size of 100x100 DIPs.

Declaration
public static FormSource FromBarcode(Symbology1DType symbology, string value)
Parameters
Symbology1DType symbology

The 1D barcode symbology to use. See Symbology1DType.

System.String value

The data to encode in the barcode.

Returns
FormSource

A FormSource representing the barcode content.

Remarks

Units are device‑independent pixels (DIPs), where 96 DIPs = 1 inch. The returned form may be drawn on any page using DrawForm(FormSource) or wrapped in a Form and added to the page content.

If value is null or empty, no bars are generated. The returned form will have zero width and the default height.

To show human‑readable text under the bars, use an overload accepting showText.

FromBarcode(Symbology1DType, String, Boolean)

Create a reusable form (XObject) from a 1D barcode using the specified symbology and default size, optionally rendering human‑readable text.

Declaration
public static FormSource FromBarcode(Symbology1DType symbology, string value, bool showText)
Parameters
Symbology1DType symbology

The 1D barcode symbology to use. See Symbology1DType.

System.String value

The data to encode in the barcode.

System.Boolean showText

True to render the human‑readable value centered below the bars.

Returns
FormSource

A FormSource representing the barcode content.

Remarks

Text is rendered using Helvetica. Alignment is centered horizontally and aligned to the bottom of the form.

FromBarcode(Symbology1DType, String, Int32, Int32)

Create a reusable form (XObject) from a 1D barcode with explicit target size in DIPs.

Declaration
public static FormSource FromBarcode(Symbology1DType symbology, string value, int width, int height)
Parameters
Symbology1DType symbology

The 1D barcode symbology to use. See Symbology1DType.

System.String value

The data to encode in the barcode.

System.Int32 width

Target barcode width in DIPs.

System.Int32 height

Target barcode height in DIPs.

Returns
FormSource

A FormSource representing the barcode content.

Remarks

When drawn at a different size than width x height, the form is scaled. For crisp output, draw at the measured size or pass the same size to DrawForm(FormSource, Double, Double).

If value is null or empty, no bars are generated. The returned form width will be 0 and height equals the requested height.

FromBarcode(Symbology1DType, String, Int32, Int32, Boolean)

Create a reusable form (XObject) from a 1D barcode with explicit size and optional human‑readable text.

Declaration
public static FormSource FromBarcode(Symbology1DType symbology, string value, int width, int height, bool showText)
Parameters
Symbology1DType symbology

The 1D barcode symbology to use. See Symbology1DType.

System.String value

The data to encode in the barcode.

System.Int32 width

Target barcode width in DIPs.

System.Int32 height

Target barcode height in DIPs.

System.Boolean showText

True to render the human‑readable value centered below the bars.

Returns
FormSource

A FormSource representing the barcode content.

Remarks

Editing strategy: to "edit" a barcode already placed on a page, generate a new FormSource with the updated value and assign it to the existing FormSource or remove/redraw using FixedContentEditor. Barcode content is generated at creation time and is not mutable afterward.

FromSvg(Byte[])

Create a form from raw SVG bytes (UTF‑8 encoded XML expected).

Declaration
public static FormSource FromSvg(byte[] svgData)
Parameters
System.Byte[] svgData

The byte array containing the SVG file data.

Returns
FormSource

A FormSource object representing the SVG content.

FromSvg(Stream)

Create a form whose drawing commands are produced from an SVG stream.

Declaration
public static FormSource FromSvg(Stream stream)
Parameters
System.IO.Stream stream

The stream containing the SVG file data.

Returns
FormSource

A FormSource object representing the SVG content.

FromSvg(String)

Create a form from SVG XML text.

Declaration
public static FormSource FromSvg(string xml)
Parameters
System.String xml

The SVG XML string representing the form.

Returns
FormSource

A FormSource object representing the SVG content.

Extension Methods

SvgExtentions.Traverse<T>(T, Func<T, IEnumerable<T>>)
SvgExtentions.TraverseDepthFirst<T>(T, Func<T, IEnumerable<T>>)
Getting Started
  • Install Now
  • Demos
  • Step-by-Step Tutorial
  • Sample Applications
  • SDK Samples
  • Visual Studio Extensions
Support Resources
  • Code Library
  • Knowledge Base
  • Videos
Community
  • Forums
  • Blogs
  • Feedback Portal
  • Document Processing Feedback Portal

Copyright © 2018 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.