ByteScout PDF Extractor SDK - C# - Reduce Memory Usage for PDF to Text - ByteScout

ByteScout PDF Extractor SDK – C# – Reduce Memory Usage for PDF to Text

  • Home
  • /
  • Articles
  • /
  • ByteScout PDF Extractor SDK – C# – Reduce Memory Usage for PDF to Text

How to reduce memory usage for PDF to text in C# using ByteScout PDF Extractor SDK

The tutorial below will demonstrate how to reduce memory usage for PDF to text in C#

The sample source codes on this page shows how to reduce memory usage for PDF to text in C#. ByteScout PDF Extractor SDK can reduce memory usage for PDF to text. It can be used from C#. ByteScout PDF Extractor SDK is the SDK that helps developers to extract data from unstructured documents, pdf, images, scanned and electronic forms. Includes AI functions like automatic table detection, automatic table extraction and restructuring, text recognition and text restoration from pdf and scanned documents. Includes PDF to CSV, PDF to XML, PDF to JSON, PDF to searchable PDF functions as well as methods for low level data extraction.

The SDK samples like this one below explain how to quickly make your application do reduce memory usage for PDF to text in C# with the help of ByteScout PDF Extractor SDK. Just copy and paste the code into your C# application’s code and follow the instruction. Further enhancement of the code will make it more vigorous.

ByteScout free trial version is available for download from our website. It includes all these programming tutorials along with source code samples.

Try ByteScout PDF Extractor SDK today: Get 60 Day Free Trial or sign up for Web API

Program.cs
      
using System; using System.IO; using System.Diagnostics; using Bytescout.PDFExtractor; namespace ReduceMemoryUsage { class Program { static void Main(string[] args) { // When processing huge PDF documents you may run into OutOfMemoryException. // This example demonstrates a way to spare the memory by disabling page data caching. // Create Bytescout.PDFExtractor.TextExtractor instance using (TextExtractor extractor = new TextExtractor("demo", "demo")) { try { // Load sample PDF document extractor.LoadDocumentFromFile("sample2.pdf"); // Disable page data caching, so processed pages wiil be disposed automatically extractor.PageDataCaching = PageDataCaching.None; // Save extracted text to file extractor.SaveTextToFile("output.txt"); } catch (PDFExtractorException exception) { Console.Write(exception.ToString()); } } // Open result document in default associated application (for demo purpose) ProcessStartInfo processStartInfo = new ProcessStartInfo("output.txt"); processStartInfo.UseShellExecute = true; Process.Start(processStartInfo); } } }

Try ByteScout PDF Extractor SDK today: 60 Day Free Trial (on-premise version) or sign up for Web API (on demand version)

VIDEO

ON-PREMISE VERSION

Get 60 Day Free Trial or Visit ByteScout PDF Extractor SDK page

Explore ByteScout PDF Extractor SDK documentation

WEB API

Sign Up for free Web API key

Explore Web API Documentation

Tutorials:

prev
next