public bool HasBom { get; }
@property (nonatomic, assign, readonly) BOOL hasBom;
public boolean HasBom()
public:
property bool HasBom {
bool get();
}
HasBom # get (CodecsImageInfo)
true if the file contains a BOM; false, otherwise. The default value is false.
If this property is false and the source file contains text, the file will be assumed to have an encoding indicated by CodecsTxtLoadOptions.DefaultEncoding.
using Leadtools;
using Leadtools.Codecs;
using Leadtools.ImageProcessing.Core;
// This C# example shows you how to load a file called "Ansi.txt" that contains ANSI text.
public void CodecsTxtLoadOptionsDefaultEncoding_Example()
{
using (RasterCodecs codecs = new RasterCodecs())
{
string srcFile = @"Ansi.txt";
using (CodecsImageInfo info = codecs.GetInformation(srcFile, false))
{
if (!info.HasBom)
codecs.Options.Txt.Load.DefaultEncoding = CodecsTxtEncoding.Ansi; /* Load as Ansi. Here you can bring up a message box asking the user to select the encoding */
codecs.Options.Load.AllPages = true;
using (RasterImage image = codecs.Load(srcFile))
{
codecs.Save(image, srcFile + ".tif", RasterImageFormat.TifLzw, 0);
}
}
}
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document