File Formats: Text file format (TXT)

LEADTOOLS supports loading text files, and displaying them as raster or SVG images.

The default extension used by this format is: TXT.

Multipage files are supported.

LEADTOOLS supports loading this format as a raster image or an SVG (Scalable Vector Graphics) document.

The following file constants are associated with this file format:

Constant Read Support Write Support Description
Txt 24 BPP * Unsupported Text format

The following text formats are supported:

Text files do not have a signature, therefore, LEADTOOLS will check the extension of the file name and if it is .txt or .text, then it will automatically use the text filter to load the file.

When loading from a stream or to load files with extensions that are not .txt or .text, such as .xml, LEADTOOLS will not use the text filter to load the image data and an invalid file format error is returned. The following code snippet will show how to force LEADTOOLS to load a stream (or a file without the .text or .text extension) using the text filter:

C#
// Either set CodecsLoadOptions.Format to Txt to ignore the RasterCodecs that the image data is text: 
rasterCodecs.Options.Load.Format = RasterImageFormat.Txt; 
// Or set CodecsLoadOptions.Name to anything.txt to trick RasterCodecs into thinking the file name has .txt extension: 
rasterCodecs.Options.Load.Name = "anything.txt"; 
 
// Now load or get information about the image ... 
// This an example on using a stream 
CodecsImageInfo info = rasterCodecs.GetInformation(stream, true); 
RasterImage image = rasterCodecs.Load(stream, 1); 
 
// Or a file with an extension other than .txt, such as .xml: 
CodecsImageInfo info = rasterCodecs.GetInformation("file.xml", true); 
RasterImage image = rasterCodecs.Load("file.xml", 1); 

Required DLL: Leadtools.Codecs.Txt.Dll. For a listing of the exact DLLs needed, based on the toolkit version, refer to Files To Be Included With Your Application .

* When the TXT format is rasterized, it will generate a 24 BPP bitmap.

Related Formats: File Formats CSV File Format CSV, RTF - Rich Text Format

Platform Support

Extension Module Value Win32 Win64 Net32 Net64 Linux Android Apple UWP MimeType Friendly Name
Txt TXT 316 text/plain Text Format

For a complete list for supported file formats, see Summary of All Supported File Formats.

For details of the file formats supported across products and platforms, refer to File Format Comparison Chart.

NOTE: LEADTOOLS supports writing the TXT file format using the LEADTOOLS Document Writers. For more information on the LEADTOOLS Document Writers SDK, refer to Introduction

Help Version 23.0.2024.8.27
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Imaging, Medical, and Document
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.