Add PDF functionality with WinForms
This guide explains how to integrate Nutrient .NET SDK (formerly known as GdPicture.NET SDK) into your application.
About Nutrient .NET SDK
Nutrient .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 Nutrient .NET SDK with numerous development environments and deploy these applications to different platforms.
Prerequisites
Before proceeding with this guide, ensure your development environment meets the following requirements.
.NET 8.0 or higher (cross-platform)
- .NET SDK 8.0 or higher — Install the latest stable version from the Microsoft website(opens in a new tab).
- Supported operating systems — Windows, macOS, and Linux.
- Development tools — Visual Studio 2022 (17.6+) or Visual Studio Code with C# extension.
- Command-line tools — Ensure the .NET CLI is available and configured in your system path.
.NET Framework 4.6.2 or higher (Windows)
- .NET Framework 4.6.2+ — Preinstalled on Windows or available from the official Microsoft Download Center.
- Supported operating systems — Windows 10 or later.
- Development tools — Visual Studio 2019 (or newer) with the .NET framework development workload installed.
For more information on the supported frameworks and operating systems, refer to our system compatibility guide.
Installing Nutrient .NET SDK
The best way to install Nutrient .NET SDK is through NuGet repositories. To view a list of available packages, refer to the download Nutrient .NET guide.
Alternatively, use our ready-made bootstrap project for new setups.
Download example projectAdding Nutrient .NET SDK to your application
This section explains how to integrate Nutrient .NET SDK (formerly GdPicture.NET SDK) into your project.
Adding a reference to the NuGet package
From Visual Studio:
- Open Visual Studio and create a new project or load an existing one. To create a new project, refer to the Microsoft documentation(opens in a new tab). We recommend using .NET 8.0 or higher.
- In Solution Explorer, right-click your project.
- Select Manage NuGet Packages.
- Set the Package source to nuget.org.
- Select GdPicture, and click Install.
From the command line:
(Optional) Create a new project:
dotnet new console -n <ProjectName>Add the
GdPicture.API
package to the project:dotnet add <ProjectName>.csproj package GdPicture.API
Importing Nutrient .NET SDK to your application
To use Nutrient .NET SDK, add a reference at the beginning of each code file where you implement its features:
using GdPicture14;
Imports GdPicture14;
For more information on the using
directive in C#, refer to the Microsoft documentation(opens in a new tab).
Activating the trial license
To activate a trial license, follow the steps below:
- In Visual Studio, create a
LicenseManager
object in the code file where the application loads before using any of the methods of Nutrient .NET SDK. - Pass the license key to the
RegisterKEY
method of theLicenseManager
object.
Set the license using the
LicenseManager
once before making any calls to the SDK. This activates the license for the entire assembly. Make sure your application initializes and sets the license only once.
LicenseManager licenseManager = new LicenseManager();licenseManager.RegisterKEY("");
Dim licenseManager As New LicenseManagerlicenseManager.RegisterKEY("")
CLicenseManager licenseManager;licenseManager.CreateDispatch(L"GdPicture14.LicenseManager");licenseManager.RegisterKEY(L"");
BSTR bstrLicense = ::SysAllocString(L"");if (bstrLicense != NULL){ _LicenseManagerPtr licenseManager(__uuidof(LicenseManager)); VARIANT_BOOL result = licenseManager->RegisterKEY(bstrLicense); ::SysFreeString(bstrLicense);}
BSTR bstrLicense = ::SysAllocString(L"");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('');
var licenseManager;licenseManager = new ActiveXObject("GdPicture14.LicenseManager");licenseManager.RegisterKey("");
long ll_resultOLEObject licenseManagerlicenseManager = CREATE OLEObjectll_result = licenseManager.ConnectToNewObject("GdPicture14.LicenseManager")licenseManager.RegisterKey("")
Dim licenseManager As New LicenseManagerCall licenseManager.RegisterKEY("")
Dim licenseManager As New GdPicture_NET_14.LicenseManagerlicenseManager.RegisterKey ("")
Leaving the license key as an empty string activates the SDK in trial mode. After purchasing a commercial license, replace the empty string with your license key.
Starting from version 14.2.94, a trial key is no longer required. As shown in the examples above, setting the key to an empty string ("") enables trial mode.