TX Text Control .NET for Windows Forms

PDF Processing

Topic

Invoices sent to customers, contracts kept in an archive, forms that come back filled in: many documents leave a Windows Forms application as PDF, and many arrive as PDF. TX Text Control .NET for Windows Forms saves the document in the TextControl as PDF, loads PDF files back into the editor and reads their text, form values, attachments and metadata, without Adobe Acrobat or another PDF library. Beyond a first PDF, the tasks range from conversion options and the limits of the import to PDF/A, fonts, forms, attachments, text extraction, metadata and passwords.

A first PDF, a PDF form and a signed PDF are built step by step in Getting Started: PDF Processing. Signing is covered in depth in Digital Signatures.

How TX Text Control Handles PDF

PDF is an output and an input format of the same document engine:

  • Saving. TextControl.Save with StreamType.AdobePDF writes the document of the editor, laid out in pages, and StreamType.AdobePDFA writes PDF/A for archiving. Links, form fields and headers and footers become part of the PDF, and since version 34.0, every PDF carries the tagged structure of an accessible document. A ServerTextControl saves documents the user doesn't see in the same way.
  • Loading. A PDF loaded with StreamType.AdobePDF becomes a document that TX Text Control reconstructs from the pages. Depending on the import settings, the result keeps the layout or only the text. PDF/A is a format for saving only.
  • Reading without the editor. Classes of the TXTextControl.DocumentServer.PDF namespaces read the text lines, the form field values and the attachments of a PDF file directly.
  • User interface. The Save As dialog box offers a button for a PDF password, and the DocumentSettings panel of the sidebar lets users edit the document properties and the attachments that go into the PDF.

The options of a PDF are properties of SaveSettings and LoadSettings, which your code passes to Save and Load. PDF export and import are part of the Professional and Enterprise editions; PDF/A, PDF/UA and form fields are part of the Enterprise edition, as Editions and Feature Availability lists.

Find the Right Page

If you want toRead
Choose what a PDF contains, run JavaScript when it opens, create and validate an accessible PDF, add a watermark or convert documentsPDF Creation and Conversion
Open PDF files in the editor or convert them to DOCX, and know what the import can't rebuildPDF Import and Its Limitations
Create documents for long-term archiving and electronic invoicesPDF/A
Control which fonts a PDF uses and which font replaces a missing oneFont Embedding and Substitution
Create fillable forms, read the values users entered or flatten a formPDF Forms
Embed files such as the XML of an electronic invoice, let users manage them and extract them againAttachments
Show the text of a PDF, search it with regular expressions or read a value from an area of a pageText Extraction
Set, read and let users edit the title, author, keywords and custom propertiesDocument Metadata
Protect a PDF with passwords and permissions, or open a protected PDFPasswords and Access Permissions
Sign a PDF with a certificateDigital Signatures

Where to Start

  1. Getting Started: PDF Processing, if you haven't saved a PDF with TX Text Control yet.
  2. PDF Creation and Conversion: what a PDF keeps from the document and which options the save offers.
  3. PDF/A and Font Embedding and Substitution, when documents are archived or must look the same on every machine.
  4. PDF Import and Its Limitations, before you promise users that they can edit any PDF.