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
╰ TXTextControl Namespace
╰ TextFrame Class
An instance of the TextFrame class represents a text frame in a Text Control document. is inserted into a header and positioned FixedOnPage and AboveTheText using the Text
╰ TXTextControl Namespace
╰ TXTextControl Enumerations Enumerations
╰ TextFrameInsertionMode Enumeration Enumeration
Determines how a TextFrame can be inserted in the text. . This way, the TextFrame is part of the header and is repeated on each page and overlaps the main text in the left page margin area.
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 ╰ TX Text Control .NET for Windows Forms
╰ Drawing Namespace
╰ Shape Class
The Drawing.Shape class represents a shape which can be displayed inside the TX Drawing Control. .
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
╰ TXTextControl Namespace
╰ ParagraphStyle Class
The ParagraphStyle class defines a formatting style for paragraphs. objects: One for the main text and one for the line numbering that is inherited from the main style.
(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.