public int TextTemplateType {get; set;}
@property (nonatomic, assign) NSUInteger textTemplateType;
public int getTextTemplateType()
public void setTextTemplateType(int templateType)
TextTemplateType # get and set (CodecsJbig2SaveOptions)
An integer value that specifies which template-based arithmetic encoder to use when encoding a text area. Currently, LEADTOOLS supports the following templates:
Value | Description |
---|---|
0 | Three lines with a 16-pixel template. 0 . |
1 | Three lines with a 13-pixel template. |
2 | Three lines with a 10-pixel template. |
3 | Two lines with a 10-pixel template. |
using Leadtools;
using Leadtools.Codecs;
using Leadtools.ImageProcessing.Core;
public void CodecsJbig2OptionsExample()
{
RasterCodecs codecs = new RasterCodecs();
string srcFileName = Path.Combine(LEAD_VARS.ImagesDir, "ocr1.tif");
RasterImage srcImage = codecs.Load(srcFileName);
codecs.Options.Jbig2.Load.LoadOldFiles = false; // CodecsJbig2Options & CodecsJbig2LoadOptions reference
// Save as JBIG2 with Template #3
// CodecsJbig2SaveOptions reference. All properties are set to default values.
codecs.Options.Jbig2.Save.RemoveMarker = true;
codecs.Options.Jbig2.Save.EnableDictionary = true;
codecs.Options.Jbig2.Save.RemoveHeaderSegment = true;
codecs.Options.Jbig2.Save.RemoveEopSegment = true;
codecs.Options.Jbig2.Save.RemoveEofSegment = true;
codecs.Options.Jbig2.Save.ImageTypicalPredictionOn = true;
codecs.Options.Jbig2.Save.ImageTemplateType = 3;
codecs.Options.Jbig2.Save.ImageQualityFactor = 0; // Lossless image compression
codecs.Options.Jbig2.Save.ImageGbatX1 = -1;
codecs.Options.Jbig2.Save.ImageGbatX2 = -1;
codecs.Options.Jbig2.Save.ImageGbatX3 = -2;
codecs.Options.Jbig2.Save.ImageGbatX4 = -2;
codecs.Options.Jbig2.Save.ImageGbatY1 = -3;
codecs.Options.Jbig2.Save.ImageGbatY2 = 2;
codecs.Options.Jbig2.Save.ImageGbatY3 = -2;
codecs.Options.Jbig2.Save.ImageGbatY4 = 0;
codecs.Options.Jbig2.Save.TextDifferentialThreshold = 30;
codecs.Options.Jbig2.Save.TextGbatX1 = 3;
codecs.Options.Jbig2.Save.TextGbatX2 = -3;
codecs.Options.Jbig2.Save.TextGbatX3 = 2;
codecs.Options.Jbig2.Save.TextGbatX4 = -2;
codecs.Options.Jbig2.Save.TextGbatY1 = -1;
codecs.Options.Jbig2.Save.TextGbatY2 = -1;
codecs.Options.Jbig2.Save.TextGbatY3 = -2;
codecs.Options.Jbig2.Save.TextGbatY4 = -2;
codecs.Options.Jbig2.Save.TextKeepAllSymbols = true;
codecs.Options.Jbig2.Save.TextMaximumSymbolArea = 2000;
codecs.Options.Jbig2.Save.TextMaximumSymbolHeight = 200;
codecs.Options.Jbig2.Save.TextMaximumSymbolWidth = 200;
codecs.Options.Jbig2.Save.TextMinimumSymbolArea = 50;
codecs.Options.Jbig2.Save.TextMinimumSymbolHeight = 1;
codecs.Options.Jbig2.Save.TextMinimumSymbolWidth = 1;
codecs.Options.Jbig2.Save.TextQualityFactor = 0; // Lossless. 0 is the default value. Lossy is > 0
codecs.Options.Jbig2.Save.TextRemoveUnrepeatedSymbol = false;
codecs.Options.Jbig2.Save.TextTemplateType = 0;
codecs.Options.Jbig2.Save.XResolution = 150;
codecs.Options.Jbig2.Save.YResolution = 150;
codecs.Save(srcImage, Path.Combine(LEAD_VARS.ImagesDir, "jbig2.jb2"), RasterImageFormat.Jbig2, 1);
// Clean up
srcImage.Dispose();
codecs.Dispose();
}
static class LEAD_VARS
{
public const string ImagesDir = @"C:\LEADTOOLS22\Resources\Images";
}
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
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.