ByteScout Data Extraction Suite - C# - Reduce cpu usage with barcode reader sdk - ByteScout

ByteScout Data Extraction Suite – C# – Reduce cpu usage with barcode reader sdk

  • Home
  • /
  • Articles
  • /
  • ByteScout Data Extraction Suite – C# – Reduce cpu usage with barcode reader sdk

How to reduce cpu usage with barcode reader sdk in C# with ByteScout Data Extraction Suite

Learning is essential in computer world and the tutorial below will demonstrate how to reduce cpu usage with barcode reader sdk in C#

We made thousands of pre-made source code pieces for easy implementation in your own programming projects. What is ByteScout Data Extraction Suite? It is the set that includes 3 SDK products for data extraction from PDF, scans, images and from spreadsheets: PDF Extractor SDK, Data Extraction SDK, Barcode Reader SDK. It can help you to reduce cpu usage with barcode reader sdk in your C# application.

These C# code samples for C# guide developers to speed up coding of the application when using ByteScout Data Extraction Suite. IF you want to implement the functionality, just copy and paste this code for C# below into your code editor with your app, compile and run your application. Check C# sample code samples to see if they respond to your needs and requirements for the project.

You can download free trial version of ByteScout Data Extraction Suite from our website with this and other source code samples for C#.

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 System; using Bytescout.BarCodeReader; namespace ReduceCPUUsage { class Program { static void Main() { // Barcode reader instance Reader reader = new Reader(); reader.RegistrationName = "demo"; reader.RegistrationKey = "demo"; /* If you are reading barcodes from PDF then you may reduce CPU and RAM load using the following approach: - instead of using All1D or All2D barcode types, set it to the specific types you have in your documents like PDF417 or Code 39. You may set multiple barcode types if you need to - reduce PDF rendering resolution to 200-150 dpi (depends on your document) - set specific pages to read barcodes from. If you have barcodes on 2 first pages only then change the code to read barcodes from first 2 pages only. - if barcodes are always located / printed in the same corner then also specify the area to read from instead of whole page for scanning */ // Input filename string inputFileName = "barcode_multipage.pdf"; // Set specific barcode type to read reader.BarcodeTypesToFind.Code128 = true; // Reduce PDF rendering resolution reader.PDFRenderingResolution = 150; // Set specific area to read from reader.CustomAreaLeft = 407; reader.CustomAreaTop = 494; reader.CustomAreaHeight = 605; reader.CustomAreaWidth = 999; // Set specific page to read from along with filename reader.ReadFromPdfFilePage(inputFileName, 1, 1); // Get all found barcodes FoundBarcode[] barcodes = reader.FoundBarcodes; // Display found barcodes Console.WriteLine("Reading barcode(s) from PDF file..."); foreach (FoundBarcode barcode in barcodes) { Console.WriteLine("Found Barcode - Type: '{0}', Value: '{1}'", barcode.Type, barcode.Value); } // Cleanup reader.Dispose(); Console.WriteLine(); Console.WriteLine("Press any key to continue."); Console.ReadKey(); } } }

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