ByteScout Invoice Parser SDK - C# - Parse Simple Invoice - ByteScout

ByteScout Invoice Parser SDK – C# – Parse Simple Invoice

  • Home
  • /
  • Articles
  • /
  • ByteScout Invoice Parser SDK – C# – Parse Simple Invoice

How to parse simple invoice in C# with ByteScout Invoice Parser SDK

The tutorial below will demonstrate how to parse simple invoice in C#

With this source code sample you may quickly learn how to parse simple invoice in C#. ByteScout Invoice Parser SDK is the automatic invoice parsing engine and data extraction SDK. Relies on the built-in database and supports thousands of vendors out of the box! Can work offline and can detects and extract company name, invoice number, date, total amount to be paid and other fields. The database of supported invoices is updated on regular basis. Data output can be exported in JSON, XML, CSV formats or directly integrated with other apps. It can be used to parse simple invoice using C#.

C# code samples for C# developers help to speed up coding of your application when using ByteScout Invoice Parser SDK. 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.

Our website provides trial version of ByteScout Invoice Parser SDK for free. It also includes documentation and source code samples.

Try it today: Get 60 Day Free Trial or sign up for Web API

GeneralExample.csproj
      
<?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <ProjectGuid>{A73776C6-D2B2-4E37-B852-06C6454D1B5B}</ProjectGuid> <OutputType>Exe</OutputType> <RootNamespace>GeneralExample</RootNamespace> <AssemblyName>GeneralExample</AssemblyName> <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> <FileAlignment>512</FileAlignment> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PlatformTarget>AnyCPU</PlatformTarget> <DebugSymbols>true</DebugSymbols> <DebugType>full</DebugType> <Optimize>false</Optimize> <OutputPath>bin\Debug\</OutputPath> <DefineConstants>DEBUG;TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PlatformTarget>AnyCPU</PlatformTarget> <DebugType>pdbonly</DebugType> <Optimize>true</Optimize> <OutputPath>bin\Release\</OutputPath> <DefineConstants>TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> </PropertyGroup> <ItemGroup> <Reference Include="ByteScout.InvoiceParser, Version=1.0.0.100, Culture=neutral, PublicKeyToken=f7dd1bd9d40a50eb, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> <HintPath>c:\Program Files\ByteScout Invoice Parser SDK\net40\ByteScout.InvoiceParser.dll</HintPath> </Reference> <Reference Include="ByteScout.InvoiceParser.Templates, Version=1.0.0.100, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> <HintPath>c:\Program Files\ByteScout Invoice Parser SDK\net40\ByteScout.InvoiceParser.Templates.dll</HintPath> </Reference> <Reference Include="System" /> <Reference Include="System.Core" /> <Reference Include="System.Xml.Linq" /> <Reference Include="System.Data" /> <Reference Include="System.Xml" /> </ItemGroup> <ItemGroup> <Compile Include="Program.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> </ItemGroup> <ItemGroup> <Content Include="..\..\DigitalOcean.pdf"> <Link>DigitalOcean.pdf</Link> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </Content> <Content Include="..\..\AmazonAWS.pdf"> <Link>AmazonAWS.pdf</Link> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </Content> </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> </Project>

Try it today: Get 60 Day Free Trial or sign up for Web API

GeneralExample.sln
      
Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 VisualStudioVersion = 15.0.27703.2018 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GeneralExample", "GeneralExample.csproj", "{A73776C6-D2B2-4E37-B852-06C6454D1B5B}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {A73776C6-D2B2-4E37-B852-06C6454D1B5B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {A73776C6-D2B2-4E37-B852-06C6454D1B5B}.Debug|Any CPU.Build.0 = Debug|Any CPU {A73776C6-D2B2-4E37-B852-06C6454D1B5B}.Release|Any CPU.ActiveCfg = Release|Any CPU {A73776C6-D2B2-4E37-B852-06C6454D1B5B}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {7E6DAA79-020B-421A-844A-5FE05EFC9B15} EndGlobalSection EndGlobal

Try it today: Get 60 Day Free Trial or sign up for Web API

Program.cs
      
using System; using ByteScout.InvoiceParser; // This example demonstrates invoice data parsing to JSON and YAML formats. namespace GeneralExample { class Program { static void Main(string[] args) { string inputDocument1 = @".\DigitalOcean.pdf"; string inputDocument2 = @".\AmazonAWS.pdf"; // Create InvoiceParser instance using (InvoiceParser invoiceParser = new InvoiceParser("demo", "demo")) { Console.WriteLine({code}quot;Parsing \"{inputDocument1}\"..."); Console.WriteLine(); // Parse invoice data in JSON format string jsonString = invoiceParser.ParseDocument(inputDocument1, OutputFormat.JSON); // Display parsed data in console Console.WriteLine("Parsing results in JSON format:"); Console.WriteLine(); Console.WriteLine(jsonString); Console.WriteLine(); Console.WriteLine({code}quot;Parsing \"{inputDocument2}\"..."); Console.WriteLine(); // Parse invoice data in YAML format string yamlString = invoiceParser.ParseDocument(inputDocument2, OutputFormat.YAML); // Display parsed data in console Console.WriteLine("Parsing results in YAML format:"); Console.WriteLine(); Console.WriteLine(yamlString); } Console.WriteLine(); Console.WriteLine("Press any key to continue..."); Console.ReadLine(); } } }

Try it today: Get 60 Day Free Trial or sign up for Web API

MORE INFORMATION

Get 60 Day Free Trial or Visit ByteScout Invoice Parser SDK page

Explore ByteScout Invoice Parser SDK documentation

WEB API VERSION

Sign Up for free Web API key

Explore Web API Documentation

prev
next