Legal Documents: Combining Line Numbering, Form Fields and Document Protection
TX Text Control provides a sophisticated interface to create legal documents. Legal line numbering can be added dynamically to a document and combined with document permissions and form fields, it provides the perfect environment to create court filings and other legal documents.

TX Text Control provides a sophisticated interface to create legal documents. Legal line numbering can be added dynamically to a document and combined with document permissions and form fields, it provides the perfect environment to create court filings and other legal documents.
Legal documents have very specific requirements when it comes to line numbering on left page margin, line spacing and visible double lines that divide the numbers from the body text. For example, California state courts require filings to use double line spacing, 12-point font size, and line numbers in the left margin.
Headers and Footers and Drawings
In order to insert the line numbers, a Text
The extension method in this sample calculates the position of the TextFrame based on the available page height and margins, the used font size and header text distances. Additionally, two vertical lines are added using the integrated TX Text Control Shapes.
The extension class also provides a method to insert a legal style with a fixed font and double (exact) line spacing.
Using the Extension Method
The extension methods can be easily used by adding the file LegalPageNumbering.cs to your application and by including the extension TXTextControl.LegalExtensions.
The first extension method AddLegalStyles is adding two new Paragraph
(extension) void TextControl.AddLegalStyles(
string styleName,
[string fontName = "Courier New"],
[int fontSize = 240],
[Color? foreColor = null],
[int lineSpacing = 200])
The second method AddLegalLineNumbering inserts the actual TextFrame and the optional double line drawings to the header of the document.
(extension) void TextControl.AddLegalLineNumbering(
string paragraphStyle,
[int textDistance = 100],
[bool doubleLines = true])
In your application, a typical call of the extension methods would look similar to this:
// set the line width to 30 twips and line color to blue
LegalExtensions.LineWidth = 30;
LegalExtensions.LineColor = Color.Blue;
// insert a default style
textControl1.AddLegalStyles("CourtFilings");
// add the numbering with lines using the default style
// and a distance of 200 twips to the text
textControl1.AddLegalLineNumbering(LegalExtensions.StyleName, 200, true);
Live Demo
In a live demo, we combined the line numbering and other helpful features for legal document processing applications. The document contains line numbers in the left margin, form fields and editable regions. The complete document is protected, so that users can only fill out form fields and modify the body text of the document:
Live Demo
See how line numbering, form fields and protected documents can be combined to provide a sophisticated UI to create legal documents.
Download the extension class as part of the sample application from our GitHub repository.
Download and Fork This Sample on GitHub
We proudly host our sample code on github.com/TextControl.
Please fork and contribute.
Requirements for this sample
- TX Text Control .NET for Windows Forms 30.0
- Visual Studio 2019 or better
Related Posts
TX Text Control 33.0 SP3 is Now Available: What's New in the Latest Version
TX Text Control 33.0 Service Pack 3 is now available, offering important updates and bug fixes for all platforms. If you use TX Text Control in your document processing applications, this service…
TX Text Control 33.0 SP2 is Now Available: What's New in the Latest Version
TX Text Control 33.0 Service Pack 2 is now available, offering important updates and bug fixes for all platforms. If you use TX Text Control in your document processing applications, this service…
Document Lifecycle Optimization: Leveraging TX Text Control's Internal Format
Maintaining the integrity and functionality of documents throughout their lifecycle is paramount. TX Text Control provides a robust ecosystem that focuses on preserving documents in their internal…
Expert Implementation Services for Legacy System Modernization
We are happy to officially announce our partnership with Quality Bytes, a specialized integration company with extensive experience in modernizing legacy systems with TX Text Control technologies.
Service Pack Releases: What's New in TX Text Control 33.0 SP1 and 32.0 SP5
TX Text Control 33.0 Service Pack 1 and TX Text Control 32.0 Service Pack 5 have been released, providing important updates and bug fixes across platforms. These service packs improve the…