LEADTOOLS Support
Document
Document SDK Examples
HOWTO: Converting Raster Files to Document Format
#1
Posted
:
Friday, September 1, 2017 11:15:08 AM(UTC)
Groups: Registered, Tech Support, Administrators
Posts: 163
Was thanked: 9 time(s) in 9 post(s)
The LEADTOOLS Document Converter can convert document formats to other document formats, such as MS Word .doc files to Adobe .pdf files. However, it can also be used to convert raster formats such as .PNG and multi-page TIFF files to document formats as well. This does require Optical Character Recognition to be applied to the input images.
A DocumentConverter can have an OCR engine assigned to it by using the DocumentConverter.SetOcrEngineInstance() call. The call accepts two parameters:
IOcrEngine instance -- a started OCR engine. A value of
null can also be passed to unassign a previously set OCR engine.
bool dispose -- a boolean value that determines whether the DocumentConverter should dispose of the OCR engine along with the converter. If this value is false, it will be necessary for the engine to be disposed normally in code.
https://www.leadtools.com/help/leadtools/v19m/dh/doxc/documentconverter-setocrengineinstance.htmlCode:
DocumentConverter converter = new DocumentConverter();
IOcrEngine engine = OcrEngineManager.CreateEngine(OcrEngineType.Advantage, false);
engine.Startup(null, null, null, null);
converter.SetOcrEngineInstance(engine, false);
Once this call has been made, the assigned instance can be accessed via the DocumentConverter.OcrEngineInstance property to have its settings adjusted. Note that attempting to convert raster formats without an OCR engine assigned will cause an exception. From here, the DocumentConverter can be used to process jobs.
Nick Crook
Developer Support Engineer
LEAD Technologies, Inc.
LEADTOOLS Support
Document
Document SDK Examples
HOWTO: Converting Raster Files to Document Format
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.