Link Search Menu Expand Document

PDF To JSON With Images - C#

PDF Extractor SDK sample in C# demonstrating ‘PDF To JSON With Images’

using System;
using Bytescout.PDFExtractor;

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

            // Load sample PDF document

            // Uncomment this line to get rid of empty nodes in JSON
            //extractor.PreserveFormattingOnTextExtraction = false;

            // Set output image format
            extractor.ImageFormat = OutputImageFormat.PNG;
            // Save images to external files
            extractor.SaveImages = ImageHandling.OuterFile;
            extractor.ImageFolder = "images"; // Folder for external images

            // Embed images into JSON as Base64 encoded string
            extractor.SaveImages = ImageHandling.Embed;

            // Cleanup

Download Source Code (.zip)

Return to the previous page Explore PDF Extractor SDK