We provide the .NET Core interface for development on the Windows, Linux, and Mac operating systems, all 64-bit. The .NET Core features a single class library, but the native dependencies are spread out across multiple libraries specific to these three Operating System platforms.
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 you follow to deploy your application may differ based on how you created that application. You need to publish your application and then deploy that application with the required dependencies.
For example, 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:
This will create 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 where you want to deploy to. These scripts are .bat files for Windows and .sh files for Linux and macOS. To deploy to Linux, we 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. 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 the Adobe PDF Library to run the sample application. Extract this tar file to the MyApp folder. The dependencies will depend on your deployment Operating System:
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, which will create 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:
If you are working with a Licensed Managed version of the Adobe PDF Library, you will need to 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.
macOS Locale Exception
When working with a .NET Core application referencing the PDF Library while using Visual Studio for macOS 2019, you may see an error message:
Failed to initialize locale
Which is a System.ApplicationException and is a known issue with Visual Studio for macOS.
From the Visual Studio menu, select Preferences.
Look on the lower left side of the dialog. In the Other section, select Terminal, and then uncheck “Enable integrated terminal” option.
If this doesn’t work, you may need to set a pair of environmental variables in the project options.
Click the Project menu, and select your Project’s Options. Under the Run section on the left of the dialog, under Configurations, select your active Configuration.
Click the Add button beneath the Environmental Variables section and add the following variables and values:
Press OK. Running the application should no longer result in the exception.