Installing the Magento 2 Extension
Download and Extract the Extension#
Download the latest release of the extension from the releases page of its GitHub repository (the source code ZIP of the most recent version tag) and extract it locally to any folder. The extracted folder contains the module files, with registration.php in its root.
Upload Files to Server#
Connect to your server using SSH, SFTP or FTP.
Create the directory app/code/PluginCompany/ProductPdf in your Magento 2 root directory and copy the extracted files into it, so that app/code/PluginCompany/ProductPdf/registration.php exists. The docs/ folder and the Markdown files (README.md, CHANGELOG.md) are not needed and can be left out.
Enable the Extension#
Enable the extension using the following command:
php bin/magento module:enable PluginCompany_ProductPdfUpdate the Database#
Run the following upgrade command:
php bin/magento setup:upgradeClean the Magento Cache#
Clean the cache using the following command:
php bin/magento cache:cleanRemove auto-generated classes#
Remove all auto-generated classes using the following command:
rm -Rf ./generated/*Or in Magento 2.0 and 2.1:
rm -Rf ./var/generation/*Run the Compiler#
Run the dependency injection compilation command:
php bin/magento setup:di:compileDeploy Static View Files#
Run the static content generation command:
php bin/magento setup:static-content:deployInstall the mPDF library using composer#
Run the following command in your Magento root folder to install mPDF on your system. This library is used for rendering the PDFs in the browser:
php ./vendor/bin/composer require mpdf/mpdfor:
composer require mpdf/mpdfNow make sure that the web server user can write to the following directory:
vendor/mpdfFor example, if your web server runs as www-data, give that user ownership of the directory (use your own web server user and group):
chown -R www-data:www-data ./vendor/mpdfAvoid making the directory world-writable (chmod 777).
The mPDF QR Code library is also required, which you can install using the following command:
php ./vendor/bin/composer require mpdf/qrcodeor:
composer require mpdf/qrcodeInstall the mPDF library through the Magento admin area#
Depending on your configuration you might prefer to install the mPDF library directly in the Magento admin area. We have added an automatic installer to the extension for this purpose. Please note that the automatic installer might not work on all systems, so if you can install the library using the command line please do that instead.
mPDF installation using the user interface#
If the mPDF library isn't installed, you will see the following message in the admin panel:

Please click on the link and follow the steps to install the library.