ByteScout PDF Extractor SDK - C# - Batch check folder agianst JSON settings - ByteScout
Announcement
Our ByteScout SDK products are sunsetting as we focus on expanding new solutions.
Learn More Open modal
Close modal
Announcement Important Update
ByteScout SDK Sunsetting Notice
Our ByteScout SDK products are sunsetting as we focus on our new & improved solutions. Thank you for being part of our journey, and we look forward to supporting you in this next chapter!

ByteScout PDF Extractor SDK – C# – Batch check folder agianst JSON settings

  • Home
  • /
  • Articles
  • /
  • ByteScout PDF Extractor SDK – C# – Batch check folder agianst JSON settings

batch check folder agianst JSON settings in C# with ByteScout PDF Extractor SDK

batch check folder agianst JSON settings in C#

We’ve created and updating regularly our sample code library so you may quickly learn batch check folder agianst JSON settings and the step-by-step process in C#. ByteScout PDF Extractor SDK was made to help with batch check folder agianst JSON settings in C#. ByteScout PDF Extractor SDK is the Software Development Kit (SDK) that is designed to help developers with data extraction from unstructured documents like pdf, tiff, scans, images, scanned and electronic forms. The library is powered by OCR, computer vision and AI to provide unique functionality like table detection, automatic table structure extraction, data restoration, data restructuring and reconstruction. Supports PDF, TIFF, PNG, JPG images as input and can output CSV, XML, JSON formatted data. Includes full set of utilities like pdf splitter, pdf merger, searchable pdf maker.

The SDK samples like this one below explain how to quickly make your application do batch check folder agianst JSON settings in C# with the help of ByteScout PDF Extractor SDK. Follow the instruction from the scratch to work and copy and paste code for C# into your editor. This basic programming language sample code for C# will do the whole work for you in implementing batch check folder agianst JSON settings in your app.

Trial version can be obtained from our website for free. It includes 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 BatchCheckFolderAgainstJsonSettings; using Bytescout.PDFExtractor; using Newtonsoft.Json; using System; using System.IO; namespace FindUsAddressRegex { class Program { static void Main(string[] args) { try { // Get all settings VM var allSettings = GetSettingsVM("settings.json"); // Create Bytescout.PDFExtractor.TextExtractor instance TextExtractor extractor = new TextExtractor(); extractor.RegistrationName = "demo"; extractor.RegistrationKey = "demo"; foreach (var fileName in Directory.GetFiles("InputFiles")) { // Load sample PDF document extractor.LoadDocumentFromFile(fileName); // Enable regex search extractor.RegexSearch = true; // Get Number of pages PDF contains int pageCount = extractor.GetPageCount(); for (int iPage = 0; iPage < pageCount; iPage++) { // Loop through all search settings foreach (var itmSearchSetting in allSettings.Settings) { // If found, then copy file to sub-category folder if(extractor.Find(iPage, itmSearchSetting.regex, false)) { // If Directory does not exists, then create them if (!Directory.Exists({code}quot;{allSettings.MainFolderName}/{itmSearchSetting.category}")) { Directory.CreateDirectory({code}quot;{allSettings.MainFolderName}/{itmSearchSetting.category}"); } // Copy File File.Copy(fileName, {code}quot;{allSettings.MainFolderName}/{itmSearchSetting.category}/{Path.GetFileName(fileName)}", true); } } } } // Cleanup extractor.Dispose(); } catch (Exception ex) { Console.WriteLine("Error: " + ex.Message); } Console.WriteLine(); Console.WriteLine("Press enter key to continue..."); Console.ReadLine(); } /// <summary> /// Get Settings VM /// </summary> private static SettingsVM GetSettingsVM(string settingsFileName) { var allJson = File.ReadAllText(settingsFileName); return JsonConvert.DeserializeObject<SettingsVM>(allJson); } } }

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout PDF Extractor SDK Home Page

Explore ByteScout PDF Extractor SDK Documentation

Explore Samples

Sign Up for ByteScout PDF Extractor SDK Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

SettingsVM.cs
      
using System; using System.Collections.Generic; using System.Text; namespace BatchCheckFolderAgainstJsonSettings { public class SettingsVM { public string MainFolderName { get; set; } public List<Settings> Settings { get; set; } } public class Settings { public string category { get; set; } public string regex { get; set; } } }

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout PDF Extractor SDK Home Page

Explore ByteScout PDF Extractor SDK Documentation

Explore Samples

Sign Up for ByteScout PDF Extractor SDK Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

packages.config
      
<?xml version="1.0" encoding="utf-8"?> <packages> <package id="Newtonsoft.Json" version="12.0.2" targetFramework="net20" /> </packages>

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout PDF Extractor SDK Home Page

Explore ByteScout PDF Extractor SDK Documentation

Explore Samples

Sign Up for ByteScout PDF Extractor SDK 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 PDF Extractor SDK Home Page

Explore ByteScout PDF Extractor SDK Documentation

Explore Samples

Sign Up for ByteScout PDF Extractor SDK Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

Tutorials:

prev
next