Applying Software License Keys

Using IronPdf License Keys

If you decide to purchase a license for IronPDF, you will instantly receive a license key as soon as your payment has cleared. This License will be displayed on the checkout screen and also be sent by email.

Setting your IronPdf license key using Code

Add this code to the startup of your application, your before IronPDF is used. This method is universally effective and straight forwards. It works for .Net Core and also for .Net Framework applications.

IronPdf.License.LicenseKey = "IRONPDF-MYLICENSE-KEY-1EF01";
IronPdf.License.LicenseKey = "IRONPDF-MYLICENSE-KEY-1EF01"
VB   C#

You can validate that your software is licensed using either IronPdf.License.IsValidLicense(string LicenseKey) or theIronPdf.License.IsLicensed property.

Setting your IronPdf license key using Web.Config or App.Config in .Net Framework Applications

To apply a key globally to your application using Web.Config or App.Config, add the following key to your config file in appSettings.

<configuration>
   ....
   <appSettings>
      <add key="IronPdf.LicenseKey" value="IRONPDF-MYLICENSE-KEY-1EF01"/>
   </appSettings>
   ....
</configuration>

Ensure that IronPdf.License.IsLicensed returns true to verify.

Setting your IronPdf license key using a .Net Core appsettings.json file

To apply a key globally to your application to a .Net Core:

  • Add a JSON file to your project called appsettings.json in the root directory of your project
  • Add a 'IronPdf.LicenseKey' key to your JSON config file. The value should be your license key.
  • Ensure that the file properties include Copy to Output Directory: Copy always
  • Ensure that IronPdf.License.IsLicensed returns true to verify.

File: appsettings.json

{

    "IronPdf.LicenseKey":"IRONPDF-MYLICENSE-KEY-1EF01"

}  

Test if your key has been installed correctly

// Check if a given license key string is valid.
bool result = IronPdf.License.IsValidLicense("IRONPDF-MYLICENSE-KEY-1EF01");

// Check if IronPdf Is Licensed
bool is_licensed = IronPdf.License.IsLicensed;
' Check if a given license key string is valid.
Dim result As Boolean = IronPdf.License.IsValidLicense("IRONPDF-MYLICENSE-KEY-1EF01")

' Check if IronPdf Is Licensed
Dim is_licensed As Boolean = IronPdf.License.IsLicensed
VB   C#

Note: After adding a license always remember to clean and republish you application to avoid potential mistakes in deployment.