PDF Processing
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.SavewithStreamType.AdobePDFwrites the document of the editor, laid out in pages, andStreamType.AdobePDFAwrites 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. AServerTextControlsaves documents the user doesn't see in the same way. - Loading. A PDF loaded with
StreamType.AdobePDFbecomes 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.PDFnamespaces 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 to | Read |
|---|---|
| Choose what a PDF contains, run JavaScript when it opens, create and validate an accessible PDF, add a watermark or convert documents | PDF Creation and Conversion |
| Open PDF files in the editor or convert them to DOCX, and know what the import can't rebuild | PDF Import and Its Limitations |
| Create documents for long-term archiving and electronic invoices | PDF/A |
| Control which fonts a PDF uses and which font replaces a missing one | Font Embedding and Substitution |
| Create fillable forms, read the values users entered or flatten a form | PDF Forms |
| Embed files such as the XML of an electronic invoice, let users manage them and extract them again | Attachments |
| Show the text of a PDF, search it with regular expressions or read a value from an area of a page | Text Extraction |
| Set, read and let users edit the title, author, keywords and custom properties | Document Metadata |
| Protect a PDF with passwords and permissions, or open a protected PDF | Passwords and Access Permissions |
| Sign a PDF with a certificate | Digital Signatures |
Where to Start
- Getting Started: PDF Processing, if you haven't saved a PDF with TX Text Control yet.
- PDF Creation and Conversion: what a PDF keeps from the document and which options the save offers.
- PDF/A and Font Embedding and Substitution, when documents are archived or must look the same on every machine.
- PDF Import and Its Limitations, before you promise users that they can edit any PDF.