Aspose.OCR.Examples.CSharp.PerformingandManagingOCR.OCROnMultipageTIFF.Run C# (CSharp) Метод

Run() публичный статический Метод

public static Run ( ) : void
Результат void
        public static void Run()
        {
            // ExStart:OCROnMultipageTIFF   
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_OCR() + "SampleTiff.tiff";

            // Create an initialize an instance of OcrEngine
            OcrEngine engine = new OcrEngine();

            // Set the OcrEngine.Image property by loading a multipage TIFF from disk, memory or URL
            engine.Image = ImageStream.FromFile(dataDir);

            // Set OcrEngine.ProcessAllPages to true in order to process all pages of TIFF in single run
            engine.ProcessAllPages = true;

            // Call OcrEngine.Process method to perform OCR operation
            if (engine.Process())
            {
                // Retrieve the list of Pages
                Page[] pages = engine.Pages;

                // Iterate over the list of Pages
                foreach (Page page in pages)
                {
                    // Display the recognized text from each Page
                    Console.WriteLine(page.PageText);
                }
            }
            // ExStart:OCROnMultipageTIFF   
        }
    }
OCROnMultipageTIFF