PDFlib TET – Text Extraction Toolkit


The PDFlib Text Extraction Toolkit (TET) is software for reliably extracting text information from any PDF file. It is available as a library/component and as a command-line tool. TET makes available the text contents of a PDF as Unicode strings or structured XML, plus detailed glyph and font information. With TET you can retrieve the corresponding Unicode values for text in a PDF document, as well as its position on the page.

In addition to low-level text retrieval TET contains advanced content analysis algorithms for determining word boundaries, removing redundant duplicate text (such as shadows and artificial bold). Using the auxiliary pCOS interface you can retrieve arbitrary objects from the PDF, such as metadata, hypertext, etc.

Fully functional evaluation versions of TET including documentation and samples are available from the TET download page for all supported platforms. Purchasing a license and applying the license key will fully enable the evaluation version for production deployment.


With PDFlib TET you can:

extract text from PDF, e.g. to store it in a database

implement a search engine for processing PDF

convert the text content of PDF pages to XML for processing with other tools

process PDFs based on their contents


Supported PDF input

PDFlib TET supports all relevant flavors of PDF input:

all PDF versions up to PDF 1.7 (Acrobat 8)

all font and encoding types: base 14 fonts, TrueType, PostScript, OpenType, CID fonts

encrypted PDF with 40- and 128-bit encryption (appropriate permission settings or password required)


Unicode

Although text in PDF is usually not encoded in Unicode, PDFlib TET will normalize the text from a PDF document to Unicode:

TET converts all text contents to Unicode. In C the text will be returned in the UTF-8 or UTF-16 formats, and as native Unicode strings in all other language bindings.

Ligatures and other multi-character glyphs will be decomposed into a sequence of their constituent Unicode characters.

Vendor-specific Unicode assignments (Private Use Area, PUA) are identified, and mapped to characters in the common Unicode area if possible.

Glyphs without appropriate Unicode mappings are identified as such, and are mapped to a configurable replacement character.


Full CJK support

TET includes full support for extracting Chinese, Japanese, and Korean text. All predefined CJK CMaps (encodings) are recognized; horizontal and vertical writing modes are supported.


Content analysis and word identification

TET can be used to retrieve low-level glyph information, but also includes advanced algorithms for content analysis:

Detect word boundaries to retrieve words instead of characters.

Recombine the parts of hyphenated words.

Remove duplicate instances of text, e.g. shadow and artificial bold text.

Recombine paragraphs into reading order.

Reorder text which is scattered over the page.

Reconstruct lines of text.


Geometry

TET provides precise metrics for the text, such as the position on the page, glyph widths, text direction. Specific areas on the page can be excluded or included in the text extraction, e.g. to ignore headers and footers or margins.


pCOS interface for simple access to PDF objects

TET includes the pCOS (PDFlib Comprehensive Object System) interface for retrieving arbitrary PDF objects. With pCOS you can retrieve PDF metadata, hypertext, or any other information outside the actual page descriptions with a simple query interface without the need for low-level programming.


Programming and performance

TET has been developed with portability, performance, and robustness in mind. TET is thread-safe for deployment in multi-threaded server applications. The core library is written in highly optimized C code for maximum performance and minimum overhead. Additional language bindings are available for COM, C, C++, Java, and .NET.


TET command-line tool and TET library

TET is available as a programming library (component) for various development environments, and as a command-line tool for batch operations. Both offer the same base functionality, but are suitable for different deployment tasks. Here are some guidelines for choosing among both TET flavors:

The TET programming library can be used for integration into your desktop or server application. Examples for using the library with all supported language bindings are included in the TET package.

The TET command-line tool is suited for batch processing PDF documents. It doesn’t require any programming, but offers command-line options which can be used to integrate it into complex workflows. The TET command-line tool can be used to convert PDF page content to an XML document with Unicode text, with or without character metrics.


TET plugin

PDFlib TET Plugin is a free plugin for extracting Text out of PDF documents. The TET Plugin provides easy access to the PDFlib Text Extraction Toolkit (TET). Although the TET Plugin runs as an Acrobat plugin, the underlying text extraction does not use Acrobat functions, but is completely based on TET. The TET Plugin is provided as a technology study to demonstrate the power of PDFlib TET.