PDFTron for .NET Core

In this document
chevron_rightCreating your app

linkRunning sample projects

  1. Install the .NET Core SDK: https://www.microsoft.com/net/learn/get-started/linux/
  2. Download PDFTron SDK
A demo license key or a commercial license key is required to proceed. If you have not yet received a license key, please obtain a license key here before continuing to read this documentation.
  1. Navigate into a sample project, for example /Samples/AddImageTest/CS
  2. Run dotnet run

linkCreating your app

  1. Install the .NET Core SDK: https://www.microsoft.com/net/learn/get-started/linux/
  2. Download PDFTron SDK
A demo license key or a commercial license key is required to proceed. If you have not yet received a license key, please obtain a license key here before continuing to read this documentation.
  1. Create a new project
> dotnet new console -o myApp
> cd myApp
  1. Unzip PDFTron SDK package, copy /Lib/libPDFNetC.so, /Lib/libPDFNetC.so.6.8.5 and /Lib/PDFNetDotNetCore.dll into myApp folder.
  2. Open myApp.csproj in your favorite text editor, add:
<ItemGroup>
  <Content Include="libPDFNetC.so">
    <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
  </Content>
</ItemGroup>

<ItemGroup>
  <Reference Include="PDFNetDotNetCore">
    <HintPath>PDFNetDotNetCore.dll</HintPath>
  </Reference>
</ItemGroup>
  1. Open Program.cs in your favorite text editor, add:
static void Main(string[] args)
{
    Console.WriteLine("Hello World!");
    pdftron.PDFNet.Initialize();
}
  1. Run the project:
> dotnet run

Now you have made a .NET Core project with PDFTron SDK!

Hello World!

PDFNet is running in demo mode.