Integrate into .NET
This guide explains how to integrate GdPicture.NET SDK into your application.
About GdPicture.NET SDK
GdPicture.NET SDK is a cross-platform developer solution for building intelligent PDF and document processing applications. This toolkit enables you to compose, display, capture, edit, and print documents. You can build applications using GdPicture.NET SDK with numerous development environments and deploy these applications to different platforms.
The diagram below displays how GdPicture.NET integrates into different platforms and development environments.

Prerequisites
Before you follow the procedure in this guide, complete these steps:
-
Ensure you develop your application on a Windows machine. Currently, you can only develop applications using GdPicture.NET on Windows systems.
-
Install Visual Studio and the workloads or components that are necessary for the type of application you want to build. For more information, see the Microsoft documentation.
For more information on the supported frameworks and operating systems, see the system compatibility guide.
Installing GdPicture.NET SDK
Once downloaded, follow the installation wizard, which will guide you through the installation process.
It’s recommended to install the toolkit at a destination such as C:\GdPicture.NET\
.
Getting a Trial License Key
A trial license lets you try the GdPicture.NET software package for free for 60 days. This includes full access and technical support.
To get a trial license key, follow these steps:
-
Go to the folder where you installed GdPicture.NET.
-
Run licenseManager.exe.
-
Click Request a trial key.
-
Enter your email address and a password.
-
Click Send Request. You’ll receive a trial license key by email.
![]()
If you don’t immediately receive a key via email, or if the application can’t be run on a system that allows web requests, contact our Sales team.
Adding GdPicture to Your Application
This section explains how to add GdPicture.NET to your application.
Adding a Reference to the NuGet Package
First, add a reference to the GdPicture.API NuGet package by following these steps:
-
In Visual Studio, create a new project or open the code of your existing application. For more information on creating a new project, see the Microsoft documentation. It’s recommended to create a project that runs on .NET 6.0 or newer.
-
Select Project > Manage NuGet Packages.
-
In the Package source field, select nuget.org.
-
Click the Browse tab, and then search for GdPicture.
-
Select one of the following options:
-
Recommended: If your application runs on .NET 6.0 or newer, select GdPicture.API, and then click Install.
-
If your application runs on .NET 4.6.2 or .NET Core 3.1, select GdPicture, and then click Install.
-
Alternatively, add a reference to the GdPicture DLL file.
Importing GdPicture.NET to Your Application
Import GdPicture.NET to your application by referencing it in the beginning of all the code files where you use GdPicture.NET SDK:
using GdPicture14;
Imports GdPicture14;
For more information on the using
directive in C#, see the Microsoft documentation.
Activating the Trial License
To activate a trial license, follow these steps:
-
In Visual Studio, create a
LicenseManager
object in the code file where the application loads before using any of the methods of GdPicture.NET. -
Pass the license key to the
RegisterKEY
method of theLicenseManager
object. -
Repeat this process for all the code files where you use GdPicture.NET SDK.
LicenseManager licenseManager = new LicenseManager(); licenseManager.RegisterKEY("LICENSE_KEY");
Dim licenseManager As New LicenseManager licenseManager.RegisterKEY("LICENSE_KEY")
CLicenseManager licenseManager; licenseManager.CreateDispatch(L"GdPicture14.LicenseManager"); licenseManager.RegisterKEY(L"LICENSE_KEY");
BSTR bstrLicense = ::SysAllocString(L"LICENSE_KEY"); if (bstrLicense != NULL) { _LicenseManagerPtr licenseManager(__uuidof(LicenseManager)); VARIANT_BOOL result = licenseManager->RegisterKEY(bstrLicense); ::SysFreeString(bstrLicense); }
BSTR bstrLicense = ::SysAllocString(L"LICENSE_KEY"); if (bstrLicense != NULL) { _LicenseManagerPtr licenseManager; licenseManager = (_LicenseManagerPtr)CreateComObject(CLSID_LicenseManager); licenseManager->RegisterKEY(bstrLicense); ::SysFreeString(bstrLicense); bstrLicense = NULL; }
var LicenseManager1: Variant; begin LicenseManager1 := CreateOleObject('GdPicture14.LicenseManager'); LicenseManager1.RegisterKey('LICENSE_KEY');
var licenseManager; licenseManager = new ActiveXObject("GdPicture14.LicenseManager"); licenseManager.RegisterKey("LICENSE_KEY");
long ll_result OLEObject licenseManager licenseManager = CREATE OLEObject ll_result = licenseManager.ConnectToNewObject("GdPicture14.LicenseManager") licenseManager.RegisterKey("LICENSE_KEY")
Dim licenseManager As New LicenseManager Call licenseManager.RegisterKEY("LICENSE_KEY")
Dim licenseManager As New GdPicture_NET_14.LicenseManager licenseManager.RegisterKey ("LICENSE_KEY")
This activates your trial license for 60 days. Once you purchase a commercial license, you might need to change this trial key. For more information on activating a commercial license, refer to our guide on activating GdPicture.NET for development.
Converting a Word Document to a PDF
In this example, convert a Word document to a PDF by following these steps:
-
Create a
GdPictureDocumentConverter
object. -
Load the source Word document by passing its path to the
LoadFromFile
method of theGdPictureDocumentConverter
object. -
Convert the source document to PDF by passing the path of the output file to the
SaveAsPDF
method of theGdPictureDocumentConverter
object.
using GdPictureDocumentConverter gdpictureDocumentConverter = new GdPictureDocumentConverter(); gdpictureDocumentConverter.LoadFromFile(@"C:\temp\source.docx"); gdpictureDocumentConverter.SaveAsPDF(@"C:\temp\output.pdf");
Using gdpictureDocumentConverter As GdPictureDocumentConverter = New GdPictureDocumentConverter() gdpictureDocumentConverter.LoadFromFile("C:\temp\source.docx") gdpictureDocumentConverter.SaveAsPDF("C:\temp\output.pdf")
With this example, you can batch convert multiple Word files.
After installation, look at our code samples to see some examples of how to use GdPicture.NET.