ByteScout Data Extraction Suite - C# - TextExtractor Progress Indication with PDF Extractor SDK - ByteScout

ByteScout Data Extraction Suite – C# – TextExtractor Progress Indication with PDF Extractor SDK

  • Home
  • /
  • Articles
  • /
  • ByteScout Data Extraction Suite – C# – TextExtractor Progress Indication with PDF Extractor SDK

textextractor progress indication with PDF extractor SDK in C# using ByteScout Data Extraction Suite

Build textextractor progress indication with PDF extractor SDK in C#

:

Step-by-step instructions on how to do textextractor progress indication with PDF extractor SDK in C#

The example source codes on this page will display you how to make textextractor progress indication with PDF extractor SDK in C#. Textextractor progress indication with PDF extractor SDK in C# can be applied with ByteScout Data Extraction Suite. ByteScout Data Extraction Suite is the bundle that includes three SDK tools for data extraction from PDF, scans, images and from spreadsheets: PDF Extractor SDK, Data Extraction SDK, Barcode Reader SDK.

Save time on writing and testing code by using the code below and use it in your application. Just copy and paste this C# sample code to your C# application’s code editor, add a reference to ByteScout Data Extraction Suite (if you haven’t added yet) and you are ready to go! Enjoy writing a code with ready-to-use sample C# codes to add textextractor progress indication with PDF extractor SDK functions using ByteScout Data Extraction Suite in C#.

If you want to try other samples for C# then free trial version of ByteScout Data Extraction Suite is available on our website.

On-demand (REST Web API) version:
 Web API (on-demand version)

On-premise offline SDK for Windows:
 60 Day Free Trial (on-premise)

Program.cs
      
using Bytescout.PDFExtractor; using System; namespace TextExtractorProgressChangedEvent { class Program { static void Main(string[] args) { try { //Read all file content... using (TextExtractor extractor = new TextExtractor()) { // Load document extractor.LoadDocumentFromFile("sample.png"); // Extractor Progress event Console.WriteLine("Text Extraction in progress: \n"); extractor.ProgressChanged += Extractor_ProgressChanged; // Set option to repair text extractor.OCRMode = OCRMode.TextFromImagesAndVectorsAndRepairedFonts; // Enable Optical Character Recognition (OCR) // in .Auto mode (SDK automatically checks if needs to use OCR or not) extractor.OCRMode = OCRMode.Auto; // Set the location of OCR language data files extractor.OCRLanguageDataFolder = @"c:\Program Files\Bytescout PDF Extractor SDK\ocrdata\"; // Set OCR language extractor.OCRLanguage = "eng"; // "eng" for english, "deu" for German, "fra" for French, "spa" for Spanish etc - according to files in "ocrdata" folder // Find more language files at https://github.com/bytescout/ocrdata // Set PDF document rendering resolution extractor.OCRResolution = 300; //Read all text var allExtractedText = extractor.GetText(); Console.WriteLine("\n\nExtracted Text:\n\n{0}", allExtractedText); } } catch (Exception ex) { Console.WriteLine(ex.Message); } Console.WriteLine("Press enter key to exit..."); Console.ReadLine(); } /// <summary> /// Handle progress change event /// </summary> private static void Extractor_ProgressChanged(object sender, OngoingOperation ongoingOperation, double progress, ref bool cancel) { drawTextProgressBar(Convert.ToInt32(progress), 100); } /// <summary> /// Display progress bar /// </summary> private static void drawTextProgressBar(int progress, int total) { //draw empty progress bar Console.CursorLeft = 0; Console.Write("["); //start Console.CursorLeft = 32; Console.Write("]"); //end Console.CursorLeft = 1; float onechunk = 30.0f / total; //draw filled part int position = 1; for (int i = 0; i < onechunk * progress; i++) { Console.BackgroundColor = ConsoleColor.Green; Console.CursorLeft = position++; Console.Write(" "); } //draw unfilled part for (int i = position; i <= 31; i++) { Console.BackgroundColor = ConsoleColor.Gray; Console.CursorLeft = position++; Console.Write(" "); } //draw totals Console.CursorLeft = 35; Console.BackgroundColor = ConsoleColor.Black; Console.Write(progress.ToString() + " of " + total.ToString() + " "); //blanks at the end remove any excess } } }

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout Data Extraction Suite Home Page

Explore ByteScout Data Extraction Suite Documentation

Explore Samples

Sign Up for ByteScout Data Extraction Suite Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

VIDEO

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout Data Extraction Suite Home Page

Explore ByteScout Data Extraction Suite Documentation

Explore Samples

Sign Up for ByteScout Data Extraction Suite Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

Tutorials:

prev
next