LEADTOOLS supports loading text files, and displaying them as raster or SVG images.
The default extension used by this format is: TXT.
Multi-page 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:
// 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.
Platforms: .NET 4, .NET Standard
Medical Web Viewer .NET
.NET, Java, Android, and iOS/macOS Assemblies
C API/C++ Class Libraries