This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using var tx = new ServerTextControl(); | |
| tx.Create(); | |
| tx.Text = """ | |
| This document contains RegEx styled text samples. | |
| Contact: | |
| Jane Doe (jane.doe@acme.com) | |
| Support: support@contoso.io |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| tx.Selection.Start = h.Start; | |
| tx.Selection.Length = h.Length; | |
| tx.Selection.FormattingStyle = h.StyleName; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Start: p.Start + m.Index - 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| foreach (Paragraph p in tx.Paragraphs) | |
| { | |
| string pText = p.Text ?? string.Empty; | |
| ... | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var style = new InlineStyle(def.Name); | |
| ApplyStyleDefinition(style, def); | |
| tx.InlineStyles.Add(style); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "name": "Email address", | |
| "pattern": "\\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,}\\b", | |
| "inlineStyleName": "Email", | |
| "priority": 20, | |
| "startOffset": 0 | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using TXTextControl; | |
| const string csvPath = "sample-data.csv"; | |
| const string pdfPath = "test.pdf"; | |
| using var tx = new ServerTextControl(); | |
| tx.Create(); | |
| var importer = new CsvToTextControlTableImporter(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| for (int r = 0; r < dataRowCount; r++) | |
| { | |
| int targetRow = templateDataRow + r; | |
| var record = records[dataStartRowIndexInRecords + r]; | |
| for (int c = 1; c <= columnCount; c++) | |
| { | |
| string value = (c - 1) < record.Count ? record[c - 1] : string.Empty; | |
| table.Cells[targetRow, c].Text = value; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| table.Cells[templateDataRow, 1].Select(); | |
| tx.Selection.Length = 0; | |
| table.Rows.Add(TableAddPosition.After, dataRowCount - 1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| table.Rows[templateDataRow].CellFormat = new TableCellFormat() | |
| { | |
| BottomBorderWidth = 10, | |
| TopBorderWidth = 10, | |
| RightBorderWidth = 10, | |
| LeftBorderWidth = 10 | |
| }; |
NewerOlder