ByteScout PDF Extractor SDK - C# - Extract PDF text To Stream - ByteScout

ByteScout PDF Extractor SDK – C# – Extract PDF text To Stream

  • Home
  • /
  • Articles
  • /
  • ByteScout PDF Extractor SDK – C# – Extract PDF text To Stream

How to extract PDF text to stream in C# with ByteScout PDF Extractor SDK

This code in C# shows how to extract PDF text to stream with this how to tutorial

Extract PDF text to stream is easy to implement in C# if you use these source codes below. ByteScout PDF Extractor SDK can extract PDF text to stream. 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.

This code snippet below for ByteScout PDF Extractor SDK works best when you need to quickly extract PDF text to stream in your C# application. Just copy and paste the code into your C# application’s code and follow the instruction. Implementing C# application typically includes multiple stages of the software development so even if the functionality works please test it with your data and the production environment.

Download free trial version of ByteScout PDF Extractor SDK 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 System.IO; using System.Diagnostics; using Bytescout.PDFExtractor; namespace ExtractToStream { class Program { static void Main(string[] args) { // Create Bytescout.PDFExtractor.TextExtractor instance TextExtractor extractor = new TextExtractor(); extractor.RegistrationName = "demo"; extractor.RegistrationKey = "demo"; // Load sample PDF document extractor.LoadDocumentFromFile(@".\sample1.pdf"); // Get page count int pageCount = extractor.GetPageCount(); for (int i = 0; i < pageCount; i++) { // Create new stream. You can use MemoryStream or any other System.IO.Stream inheritor. FileStream stream = new FileStream(@".\page" + i + ".txt", FileMode.Create); // Save text from page to the file stream extractor.SavePageTextToStream(i, stream); // Close stream stream.Dispose(); } // Cleanup extractor.Dispose(); // Open first output file in default associated application ProcessStartInfo processStartInfo = new ProcessStartInfo(@".\page1.txt"); processStartInfo.UseShellExecute = true; Process.Start(processStartInfo); } } }

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