ByteScout PDF To HTML SDK - C# - .NET Core 2.0 - PDF To HTML - ByteScout

ByteScout PDF To HTML SDK – C# – .NET Core 2.0 – PDF To HTML

  • Home
  • /
  • Articles
  • /
  • ByteScout PDF To HTML SDK – C# – .NET Core 2.0 – PDF To HTML

ByteScout PDF To HTML SDK – C# – .NET Core 2.0 – PDF To HTML

Program.cs

using System.Diagnostics;
using Bytescout.PDF2HTML;

namespace PdfToHtml
{
    class Program
    {
        static void Main(string[] args)
        {
            // Create Bytescout.PDF2HTML.HTMLExtractor instance
            HTMLExtractor extractor = new HTMLExtractor();
            extractor.RegistrationName = "demo";
            extractor.RegistrationKey = "demo";

            // Set HTML with CSS extraction mode
            extractor.ExtractionMode = HTMLExtractionMode.HTMLWithCSS;

            // Load sample PDF document
            extractor.LoadDocumentFromFile(@".\sample2.pdf");

            // Save extracted HTML to file
            extractor.SaveHtmlToFile(@".\output.html");

            // Cleanup
            extractor.Dispose();

            // Open output file in default associated application
            Process.Start(new ProcessStartInfo("output.html") { UseShellExecute = true });
        }
    }
}


  Click here to get your Free Trial version of the SDK

Tutorials:

prev
next