pdf specifying a language - German - and ignore zone comprising a sidebar image Try ' A) Open the. OCRModule.ImageToPDF (doc, input_path + "multi_lang.jpg", opts ) ' D) Check the resultĭoc.Save (output_path + "multi_lang.pdf", _remove_unused )Ĭonsole.WriteLine ( "Example 2: multi_lang.jpg" ) End Using Catch e As PDFNetExceptionĬonsole.WriteLine (e.Message ) End Try '- ' Example 3) Process a. Opts.AddLang ( "eng" ) ' C) Run OCR on the. Using doc As PDFDoc = New PDFDoc ( ) ' B) Setup options with multiple target languages, English will always be considered as secondary language Dim opts As OCROptions = New OCROptions ( ) If useOCR Then opts.SetOCREngine ( "iris" ) OCRModule.ImageToPDF (doc, input_path + "psychomachia_excerpt.png", opts ) ' D) Check the resultĭoc.Save (output_path + "psychomachia_excerpt.pdf", _remove_unused )Ĭonsole.WriteLine ( "Example 1: psychomachia_excerpt.png" ) End Using Catch e As PDFNetExceptionĬonsole.WriteLine (e.Message ) End Try '- ' Example 2) Process document using multiple languages Try ' A) Setup empty destination doc. Using doc As PDFDoc = New PDFDoc ( ) ' B) Set English as the language of choice Dim opts As OCROptions = New OCROptions ( ) If useOCR Then opts.SetOCREngine ( "iris" ) Dim input_path As String = "././././TestFiles/OCR/" Dim output_path As String = "././././TestFiles/Output/" '- ' Example 1) Process image Try ' A) Setup empty destination doc. If you have already downloaded this" )Ĭonsole.WriteLine ( "module, ensure that the SDK is able to find the required files" )Ĭonsole.WriteLine ( "using the PDFNet.AddResourceSearchPath() function." )Ĭonsole.WriteLine ( "" ) Return End If ' Relative path to the folder containing test files. PDFNet.AddResourceSearchPath ( "./././././Lib/" ) Dim useOCR As Boolean = OCRModule.IsIRISModuleAvailable ( ) If Not OCRModule.IsModuleAvailable ( ) ThenĬonsole.WriteLine ( "Unable to run OCRTest: Apryse SDK OCR module not available." )Ĭonsole.WriteLine ( "-" )Ĭonsole.WriteLine ( "The OCR module is an optional add-on, available for download" )Ĭonsole.WriteLine ( "at. Key ) ' Can optionally set path to the OCR module The library is usually ' initialized only once, but calling Initialize() multiple times is also fine. Sub Main ( ) ' The first step in every application using PDFNet is to initialize the ' library and set the path to common PDF resources. PdfNetLoader = ( ) End Sub ' The main entry point for the application. ' '- ' The following sample illustrates how to use OCR module '- ' Module OCRTestVB ' Consult legal.txt regarding legal and license information. ocr-result.xml) and download to the same folder as the XML file.'- ' Copyright (c) 2001-2023 by Apryse Software Inc. Asprise OCR and Barcode Recognition High performance, royalty-free OCR and barcode recognition on Windows, Linux, Mac OS PDF Output Formats Remarks PDF Asprise Searchable PDF ( Ocr.OUTPUT_FORMAT_PDF) and user editable RTF ( Ocr.OUTPUT_FORMAT_RTF). Other supported output formats are: XML ( AspriseOCR.OUTPUT_FORMAT_XML), The Recognize method of the AspriseOCR class recognizes all the characters and barcodes from the image and output The list of languages supported can be found Languages Supported. The evaluation version is able to recognize English (eng), Spanish (spa), Portuguese (por), German (deu) and French (fra).įor other languages, please contact us. Lines 4 & 5: Creates a new Ocr engine that recognizes English in fastest speed setting Line 3: performs one-time setup if it has not been done WriteLine ( "OCR Result: " & s ) ' process more images here. Imports asprise_ocr_api Private ocr As AspriseOCR AspriseOCR.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |