TextDevice
Overview
TextDevice is a class in Aspose.Pdf FOSS for Java.
Extracts text from a PDF page and writes it to an output stream.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
extractionOptions | TextExtractionOptions | Read | Returns the current extraction options. |
encoding | Charset | Read | Returns the current output encoding. |
DEFAULT_ENCODING | Charset | Read | {@link Charset} matching .NET {@code Encoding.Unicode} (UTF-16 little-endian, no BOM). |
Methods
| Signature | Description |
|---|---|
TextDevice() | Creates a TextDevice with default options ({@code Pure} mode) and Unicode encoding. |
TextDevice(encoding: Charset) | Creates a TextDevice with the given encoding and default options ({@code Pure} mode). |
TextDevice(options: TextExtractionOptions) | Creates a TextDevice with the given options and default Unicode encoding. |
TextDevice(options: TextExtractionOptions, encoding: Charset) | Creates a TextDevice with the given options and encoding. |
getExtractionOptions() → TextExtractionOptions | Returns the current extraction options. |
setExtractionOptions(options: TextExtractionOptions) | Sets the extraction options (null is replaced with the default {@code Pure} options). |
getEncoding() → Charset | Returns the current output encoding. |
setEncoding(encoding: Charset) | Sets the output encoding (null is replaced with the default Unicode/UTF-16LE). |
process(page: Page, output: OutputStream) | Extracts text from a page and writes it to the output stream using the |
| configured encoding. | |
process(page: Page, outputFile: String) | Extracts text from a page and writes it to the file at {@code outputFile} |
| using the configured encoding. |