ByteScout PDF Extractor SDK – C# – ZUGFeRD Invoice Extraction

  • Home
  • /
  • Articles
  • /
  • ByteScout PDF Extractor SDK – C# – ZUGFeRD Invoice Extraction

ByteScout PDF Extractor SDK – C# – ZUGFeRD Invoice Extraction

Program.cs

using System;
using Bytescout.PDFExtractor;

namespace ExtractZUGFeRD
{
class Program
{
static void Main(string[] args)
{
// Create Bytescout.PDFExtractor.AttachmentExtractor instance
AttachmentExtractor extractor = new AttachmentExtractor();
extractor.RegistrationName = “demo”;
extractor.RegistrationKey = “demo”;

// Load sample PDF document
extractor.LoadDocumentFromFile(@”.\ZUGFeRD-invoice.pdf”);

// Extract the XML invoice that is stored as an attachment
for (int i = 0; i < extractor.Count; i++) { Console.WriteLine("Saving XML invoice attachment: " + extractor.GetFileName(i)); // Save file to current folder extractor.Save(i, extractor.GetFileName(i)); Console.WriteLine("Done."); } // Cleanup extractor.Dispose(); Console.WriteLine(); Console.WriteLine("Press any key..."); Console.ReadLine(); } } } [/csharp]


  Click here to get your Free Trial version of the SDK

prev
next