Link Search Menu Expand Document

Download and Process file - C#

PDF Extractor SDK sample in C# demonstrating ‘Download and Process file’

using System.Diagnostics;
using System.IO;
using Bytescout.PDFExtractor;

namespace ExtractText
    class Program
        static void Main(string[] args)
            // Create Bytescout.PDFExtractor.TextExtractor instance
            TextExtractor extractor = new TextExtractor();
            extractor.RegistrationName = "demo";
            extractor.RegistrationKey = "demo";

            // Input file Url
            var inputUrl = @"";

            // Get Input Stream
            var inpStream = GetStreamFromUrl(inputUrl);

            // Load sample PDF document

            // Save extracted text to file

            // Cleanup

            // Open result file in default associated application
            ProcessStartInfo processStartInfo = new ProcessStartInfo(@".\result.txt");
            processStartInfo.UseShellExecute = true;

        /// <summary>
        /// Get stream from Url
        /// </summary>
        private static Stream GetStreamFromUrl(string url)
            byte[] oData = null;

            using (var wc = new System.Net.WebClient())
                oData = wc.DownloadData(url);

            return new MemoryStream(oData);


Download Source Code (.zip)

Return to the previous page Explore PDF Extractor SDK