How to install your premium Gravity PDF extension
You've purchased a premium extension/plugin through the online store. The next step is to install it on your website.
Before you begin, ensure you have Gravity Forms and Gravity PDF plugins installed and activated on your WordPress website.
Install Steps
Once you've completed your purchase you'll receive an email containing a link to your plugin zip file. The email also contains your product key which will give you access to support and one-click updates: keep it safe!
If your browser auto-extracts zip files when downloaded, you'll need to temporarily disable this functionality to prevent issues during installation. See how to disable this in Safari.
-
Open the Shop Receipt email you received and locate the Your download(s) section. Click the link to download the plugin zip package.
-
Navigate to the
Plugins -> Add Pluginpage in your WordPress admin area and select theUpload Pluginbutton. An upload box will appear. -
Drag and drop the plugin zip file over the upload setting, or click the
Browsebutton and choose the zip file.
-
Select the
Install Nowbutton and wait for the upload to complete. -
Once installed, select the
Activate Pluginlink. -
To enable one-click updates, locate the newly-installed plugin in the plugins list and follow the "Register your copy of PLUGIN_NAME" link.
-
On the page that loads, enter your license key (found in your Receipt email or in your GravityPDF.com account) and save. A success or error message will be displayed next to the license key to signify how the registration went. See common license activation errors and how to fix.
-
Jump on over to the documentation for your specific extension to finish setting up the plugin.
One Click Updates
Extensions will periodically check GravityPDF.com for updates. If there is a new version and your license has been registered, you can one-click update the software on the Dashboard Updates Screen or the Plugins page.
Register the License Key in Code
Instead of using the admin area, you can define your license key(s) with the GPDF_LICENSE_KEY constant in wp-config.php (above the /* That's all, stop editing! */ line). This feature was added to Gravity PDF 6.16.0.
If a license includes multiple products, or you are only using one paid product, you can enter it as a string:
define( 'GPDF_LICENSE_KEY', 'jZ9FQiX9xHoKaRgV4ZmqniqnrDT6PesD' );
The license will get applied to all installed Gravity PDF extensions, and these extensions are auto-activated the next time you visit the WordPress admin area.
If you purchased extensions individually use an array keyed by the extension slug. A wildcard * key is also supported and will be used for any installed extensions not explicit listed in the array:
define( 'GPDF_LICENSE_KEY', [
'gravity-pdf-core-booster' => 'DFoDzNAKuFjvWtDTuLBEAJJnjcG9j2iW',
'gravity-pdf-previewer' => 'apvfZLp3udnWif8MDYg9VN4TnbrPLLtb',
'*' => 'jZ9FQiX9xHoKaRgV4ZmqniqnrDT6PesD',
] );
The slug matches the extension's plugin folder name, and is the same value used in the Composer {slug}@{license} syntax.
When a key is set this way, the matching field on the License settings page becomes read-only and its Deactivate License button is hidden. Remove the constant from wp-config.php to go back to managing the key in the admin area.
Licensing on Multisite
Network Activated
When Gravity PDF is network-activated the primary site owns licensing for the whole network:
- License checks with GravityPDF.com are only run by the primary site
- The
Forms -> Settings -> PDF -> Licenseadmin page is only shown on the primary site - A license key set in code is only activated by the primary site.
Activated Per-Site
When Gravity PDF is activated on individual sites (not network activated), each site manages its own license key on its own License settings page. To avoid every site making the same request to GravityPDF.com, update information is cached and shared at the network level.
Install and Update Extensions with Composer
For developers, you can use Composer to install and update Gravity PDF extensions. Basic HTTP authentication is used with a Site URL (username) and license key (password) to verify extensions are only installed by customers with active license keys.
Before you begin you need to locate your license key(s). This can be found in your Purchase Receipt email, or from your GravityPDF.com account. Got them? Great. Let's go:
- Create an
auth.jsonfile in the same directory as yourcomposer.jsonfile. - Open
auth.jsonand copy/paste the following :
{
"http-basic": {
"composer.gravitypdf.com": {
"username": "https://{WORDPRESS_HOME_URL}",
"password": "{LICENSE_KEY}"
}
}
}
- Replace
{WORDPRESS_HOME_URL}with your site's domain name (e.g.example.com) and{LICENSE_KEY}with your 32-character key.
If a license includes multiple products, the single license allows you to install these products with Composer.
If you have multiple license keys use the alternate syntax {slug1}@{license1}, {slug2}@{license2} in the password field:
{
"http-basic": {
"composer.gravitypdf.com": {
"username": "https://example.com",
"password": "gravity-pdf-core-booster@NpMmzRwVpkudnXQRfuEdk7wEi2W88Fz6, gravity-pdf-previewer@6NZMdPGmwUTgzfUh6qmfVgGp4kZA7jQ4"
}
}
}
You can repeat the {slug}@{license} syntax as many times as needed, separating each entry with a comma (,).
- Save and close
auth.jsononce you've added your credentials - Open your
composer.jsonfile and add the Gravity PDF repository:
"repositories": [
{
"type": "composer",
"url": "https://composer.gravitypdf.com",
"only": [
"gravitypdf/*"
]
}
]
- From your CLI, add the Gravity PDF extensions you want installed with these commands:
composer require gravitypdf/gravity-pdf-bulk-generator
composer require gravitypdf/gravity-pdf-core-booster
composer require gravitypdf/gravity-pdf-enhanced-download
composer require gravitypdf/gravity-pdf-previewer
composer require gravitypdf/gravity-pdf-reports-for-gfchart
composer require gravitypdf/gravity-pdf-watermark
composer require gravitypdf/pdf-for-gravityview
- If the CLI prompts you about the
composer/installerspackage choose yes (y). The package ensures Gravity PDF packages are automatically installed to/wp-content/plugins/, and not the/vendor/directory.
Troubleshooting Composer
Invalid credentials (HTTP 401) for 'https://composer.gravitypdf.com/gravity-pdf-bulk-generator-3.0.0.zip', aborting.
A 401 authentication error can occur for a number of reasons, but Composer only shows the HTTP status code when an error occurs. To get a better understanding of why a download failed you can make a cURL request from the CLI:
# Replace the username and password with the values in your auth.json file
curl --user "https://example.com:NpMmzRwVpkudnXQRfuEdk7wEi2W88Fz6" https://composer.gravitypdf.com/gravity-pdf-bulk-generator-3.0.0.zip
The API will respond with license key is: {status}. Refer to the common license activation errors and how to fix them.