Integrate the PSPDFKit .NET Library Manually
It’s highly recommended that you integrate the PSPDFKit .NET Library with the package hosted on the public NuGet repository. However, if you don’t have access to the internet on your development machine, or if you have strict CI requirements, then it’s possible to download the PSPDFKit .NET Library from the PSPDFKit servers and integrate it in your .NET project manually.
Download the PSPDFKit .NET Library
Existing Customers
- Access the PSPDFKit Customer Portal.
- Navigate to the PSPDFKit Libraries section and click Download PSPDFKit Libraries.
- When the dialog pops up, click on the button to download the version required.
- Unzip the files into a known location.
Trial Customers
- Click the link in the email you received, which takes you to the Download Trial page.
- Click the box that reads PSPDFKit .NET Library.
- Click the advanced integration link toward the bottom of the dialog.
- Click Download to download the zipped binary containing all the related PSPDFKit .NET Library files.
- Unzip the files into a known location.
Create the PSPDFKit NuGet Source
Rather than targeting a package held at nuget.org, you’ll have to set up a configuration to point to a local package you have just downloaded in the PSPDFKit .NET Library binary.
The local configuration is described by a file named nuget.config
, which is placed next to the solution file (e.g Test.sln
).
The contents of the file should contain an XML element, packageSources
, which describes where to find NuGet packages — as a child of a root node named configuration
.
If nuget.config Already Exists
If nuget.config
already exists, add the extra packageSources
entry shown below:
1 2 3 4 5 6 7 | <configuration> <packageSources> ... <add key="PSPDFKitSource" value="path/to/directoryContainingNupkg" /> ... </packageSources> </configuration> |
If There Is No nuget.config File Present
If there is no nuget.config
file present, create the nuget.config
file next to your solution file and copy and paste the following source into the newly created file:
1 2 3 4 5 6 | <?xml version="1.0" encoding="utf-8"?> <configuration> <packageSources> <add key="PSPDFKitSource" value="path/to/directoryContainingNupkg" /> </packageSources> </configuration> |
Edit the value of the contents to correctly refer to the location of the directory containing the PSPDFKit.NET-*.*.*.nupkg
package — for example, /Users/me/nugetPackages
. These packages can be found in the unzipped binary downloaded earlier in the nuget
directory.
Add the PSPDFKit NuGet Package
Using the dotnet Command Line Application
Now that you have the NuGet source, you can add the package to the project:
cd
into your project solution.- Add the package by running
dotnet add <PROJECT_NAME> package PSPDFKit.NET --version 1.3.0
, replacing<PROJECT_NAME>
with the project you want to add the package to. - Now restore all the newly added packages with
dotnet restore
. You’ll need an internet connection to retrieve the dependency projects.
You have set up your project to use the PSPDFKit .NET package. Now all you need to do is initialize the library with your license key.
Using Visual Studio on Windows
It’s possible to add the PSPDFKit .NET Library within the Visual Studio GUI if you’re working in Windows. Please see the Microsoft guide on installing packages in Visual Studio Windows for instructions on how to add a package, and use PSPDFKit.NET when searching for the package. Ensure you’re searching the newly created NuGet configuration, PSPDFKitSource, defined earlier in the nuget.config
file, when locating the package.
Now all you need to do is initialize the library with your license key.
Other Package Installation Options
It should be noted that there are a variety of ways to add a package to a project:
Please refer to the relevant link above for more specific information.