以下は、C#のプロジェクトファイルと簡単なプログラミング例です。
① プロジェクトファイル例
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<UseWindowsForms>true</UseWindowsForms>
<ApplicationIcon></ApplicationIcon>
<StartupObject />
<Platforms>x64;x86</Platforms>
<Win32Resource />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>
<ItemGroup>
<Reference Include="TblAHPDFtoCellsInterface">
<HintPath>"C:\Program Files\Antenna House\tbl10\bin\TblAHPDFtoCellsInterface.dll"</HintPath>
</Reference>
<PackageReference Include="DocumentFormat.OpenXml" Version="2.12.3" />
<PackageReference Include="System.Drawing.Common" Version="5.0.2" />
</ItemGroup>
</Project>
② ソースコード例
using System;
using AHPDFtoCellsInterface;
using System.Collections.Generic;
namespace AHPDFtoCellsExample
{
class Program
{
static void Main(string[] args)
{
PdfToCellsObj pdfToCellsObj = new PdfToCellsObj();
pdfToCellsObj.SetEnvironment("C:\Program Files\Antenna House\tbl10\bin");
pdfToCellsObj.SetDocumentPath(args[0]);
pdfToCellsObj.SetOutputFilePath(args[1]);
pdfToCellsObj.SetFormatType("@XLSX");
try
{
pdfToCellsObj.DoConvert();
var list = new List<WarningMessage>();
pdfToCellsObj.GetConvertingError(list);
foreach (var e in list)
{
Console.WriteLine("Warning!!:" + e. GetErrorCode()+ "\n" + e. GetErrorMessage());
}
}
catch (PtCException e)
{
Console.WriteLine("Error!!:" + e. GetErrorCode()+ "\n" + e. GetErrorMessage());
}
}
}
}