Click here to Skip to main content
15,886,362 members
Articles / Product Showcase
Article

Developing and Deploying Applications with .NET Core and the Adobe PDF Library

12 Nov 2020CPOL4 min read 4K   1  
In this article, you will learn how APDFL works with .NET Core, along with instructions for how to deploy your applications using APDFL on .NET Core.

This article is in the Product Showcase section for our sponsors at CodeProject. These articles are intended to provide you with information on products and services that we consider useful and of value to developers.

Datalogics Inc. now offers .NET Core support for the Adobe PDF Library (APDFL), our powerful PDF SDK built upon trusted Adobe technology. Now, users can unlock the power of APDFL on the .NET Core development platform.

About .NET Core

.NET Core is the next generation of the .NET development platform and is the open-source successor to the .NET framework. .NET Core works on Linux and Mac, which allows for cross-platform development using a .NET language (C#, for example). It includes support for a variety of things such Windows Forms Applications, Console applications, Class Libraries, ASP.NET, and WPF.

You may remember that during the release of .NET Core v1.0 from Microsoft, there was not much interest from the development community, due to gaps in the APIs and slow performance. Since the release of v2.0 and v3.0, a majority of those gaps are now filled, and performance has improved, which has helped gain interest from the development community and commercial users alike. For the first time, using .NET is now an option for Linux and Mac for Enterprise users, which is supported by Microsoft.

Using the Adobe PDF Library on .NET Core

Datalogics now offers a .NET Core Class Library that targets v3.1 of .NET Core, which will allow users to develop their .NET applications on Linux and know it’s going to work on Windows or Mac. It also allows users to write their application on Mac and know it’s going to work on Linux or Windows. They can also write their application on Windows and know it’s going to work on Mac or Linux. Users can now leverage the mature, time-tested functionality of the Adobe PDF Library, using the simplicity of the .NET interface in one application that works on Windows, Linux, or Mac.

Developing with .NET Core

All of the dependencies for the Operating System you are developing on are found in the DotNETCore/Binaries directory of your installation package. For the other two Operating Systems where you could deploy your application, the dependencies are included in archive files. For example, if you installed APDFL on a Windows system, two archive files will appear in the DotNETCore/Binaries directory for Linux and macOS, Linux_Dependencies.tar.gz and macOS_Dependencies.zip.

Deploying your .NET Core Application

The process to deploy your application may differ based on how you created that application, so you’ll need to publish your application and then deploy that application with the required dependencies. The steps to do so are as follows.

Deployment Steps

We offer the steps to deploy one of the sample programs (MergePDF) from a Windows system, where the Adobe PDF Library was installed, to a Linux system.

Change to the DotNETCore/Sample_Source/ContentModification/MergePDF directory and issue the publish command:

dotnet publish

This creates a publish folder in the DotNETCore/Binaries folder with some .NET Core dependencies for that sample program. The dependencies can vary depending on the sample.

Then, include the dependencies. Run the deployment script (in the DotNETCore/Binaries folder) that corresponds to the Operating System you want to deploy to. These scripts are .bat files for Windows and .sh files for Linux and macOS. To deploy to Linux, you will use the script bat. This will add the remaining dependencies to the publish folder. The scripts include:

PublishToLinux.bat or .sh
PublishtoMac.bat or .sh
PublishToWindows.bat or .sh

You can edit these scripts as needed, and the comments provided in each script will help you determine the dependencies you need for your application.

More Information about Deploying your Application

Following the previous instructions to deploy the contents of the publish folder to your targeted system, if you were to deploy to a folder called MyApp on Linux, the Linux Dependencies.tar.gz file would be stored in the MyApp folder. This holds the necessary libraries for APDFL to run the sample application. Extract this tar file to the MyApp folder. The dependencies will depend on your deployment Operating System:

Linux_Dependencies.tar.gz
Windows_Dependencies.zip
macOS_Dependencies.zip
To decompress the archive on Linux:

tar xzvf ./Linux_Dependencies.tar.gz

To decompress the archive on Windows, right click on the Windows Dependencies.zip file and select Extract All. Remove "Windows Dependencies" from the end of the path name and click OK. This will allow the file to unzip to the same folder where it was published.

For macOS, double-click the macOS_Dependencies.zip file, thus creating a folder called macOS_Dependencies. Drag the contents of that folder to the folder containing the published app.

Then, run the sample application from the MyApp folder:

dotnet MergePDF.dll

If you are working with a Licensed Managed version of the Adobe PDF Library, activate the software with the key provided to you. You can’t simply move the apdfl18.lic license file from the Operating System where you created your application. In this example, we deployed the MergePDF sample, so the first time you run this program it will ask for the activation key. A new apdfl18.lic file will be created to use on the deployment machine. Copy this license file to the same directory where your application executable is found.

The .NET Core Library ships with new .NET Core sample applications and new documentation. If you’d like to get started with the Adobe PDF Library using .NET Core, visit our website.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Help desk / Support Datalogics
United States United States
Chicago-based Datalogics, Inc., the premier source for PDF and digital publishing technologies, has dedicated 50 years to delivering the highest quality software. Datalogics offers solutions that include a wide range of powerful PDF technologies for .NET, Java, and C/C++ developers. Datalogics is a member of the PDF Association, the International Digital Publishing Forum (IDPF) and the Readium Foundation. For more information, please visit www.datalogics.com.
This is a Organisation (No members)


Comments and Discussions

 
-- There are no messages in this forum --