Data to document
Edit the CSV source
Change records, quoted values, or columns, then generate a fresh PDF table. The preview uses the locally hosted PDF.js renderer.
CSVEditable source
TableDocument model
PDFPDF.js preview
Ready to tryUse the controls above to interact with this demo.
What this demonstrates
Turn exchange data into a document
CSV is ideal for moving tabular data, but it has no pagination, repeating headers, borders, or layout. This demo parses CSV on the server, constructs a real TX Text Control table, and exports it directly to Adobe PDF.
Key members
Create the table
ServerTextControl.Tables.Add
Repeat table headers
TableRow.IsHeader
Export Adobe PDF
ServerTextControl.Save
Render with PDF.js
TXDocumentViewer.loadDocument
How it works
The importer creates a header row and one styled template data row. It then inserts all remaining rows in a single operation so they inherit the template formatting. The header is marked with IsHeader, allowing it to repeat automatically across PDF pages.
TextFieldParser handles quoted commas and malformed rows before document creation. The finished PDF remains in memory and is returned as Base64 for the Document Viewer.
textControl.Tables.Add(2, columnCount);
table.Rows[1].IsHeader = true;
table.Cells[2, 1].Select();
textControl.Selection.Length = 0;
table.Rows.Add(TableAddPosition.After, dataRowCount - 1);
textControl.Save(out byte[] pdf, BinaryStreamType.AdobePDF);
NuGet packages
TXTextControl.TextControl.Core.SDK
34.0.4
Provides the core document model and server-side document processing APIs.
dotnet add package TXTextControl.TextControl.Core.SDK --version 34.0.4
Displays supported document and PDF formats in the browser.
dotnet add package TXTextControl.Web.DocumentViewer --version 34.2.0