Available Now: Explore our latest release with enhanced accessibility and powerful IDP features
By Ryan Barr | 2014 Sep 10
2 min
Tags
.NET
release
PDF SDK
Recently we added PDFNet to the Nuget gallery. For our .Net users this is a great new way to keep up on the latest PDFNet releases.
This package includes all of our .Net releases, for .Net 2.0 – 3.5 and .Net 4.0 +, and the corresponding 32 and 64 bit assemblies. When you install the package it of course picks the appropriate version and sets everything up for you.
A common pain that our .Net users have had was using both our 32- and 64-bit assemblies in an AnyCPU project. While an installer would normally take care of this, it was still frustrating for developers. To address this issue, our Nuget package includes a new assembly, PDFNetLoader, that at runtime will pick the correct version of PDFNet. The source code for the loader is available on GitHub, and the latest binaries here.
If you install the nuget package, then all of this is setup for you. Before calling any PDFNet methods, insert the following line of code in the main class of your project.
private static pdftron.PDFNetLoader loader = pdftron.PDFNetLoader.Instance();
You can also change the load path for the PDFNet assemblies by appending the code above with:
Path("path_to_pdfnet_folder_containing_32_and_64_bit_PDFNet_libs")
For example:
private static pdftron.PDFNetLoader loader = pdftron.PDFNetLoader.Instance().Path(@"..\res");
On the other hand, if you are already using PDFNet, or don’t want to use the Nuget package, here are the manual steps to set up your project to use PDFNet and AnyCPU.
First, let us assume your output dir (where your exe is created) is ‘bin’.
private static pdftron.PDFNetLoader loader = pdftron.PDFNetLoader.Instance();
You are now ready to run your project in AnyCPU.
The project references to PDFNet and PDFNetLoader allow you to code normally. At runtime though, the following will happen:
We hope our .Net users find this useful, and as always you can ask questions in PDFNet Forum on Stackoverflow.
Tags
.NET
release
PDF SDK
Ryan Barr
Related Products
Share this post
PRODUCTS
Enterprise
Small Business
Popular Content