# How to Install Html2Pdf [back](./README.md) ## Composer and Packagist You must use Composer to install Html2Pdf. If you do not know what is Composer, you have a few years late... It is used by all the modern PHP applications (Magento2, Drupal, EasyPlatform, Symfony, ...). You can read all the pages on https://getcomposer.org/doc/ You can find all the available packages on https://packagist.org/ For example, you can find Html2Pdf: https://packagist.org/packages/spipu/html2pdf You have to commit the `composer.json` and `composer.lock` files, but **never** commit the `vendor` folder. If you do not understand why, it is because you have not read the Composer documentation... ## Install You have just to launch the following command on the root folder of your project: ```bash composer require spipu/html2pdf ``` ### First Test Here is a HelloWorld example, that you can put on the root folder of your project. ```php require __DIR__.'/vendor/autoload.php'; use Spipu\Html2Pdf\Html2Pdf; $html2pdf = new Html2Pdf(); $html2pdf->writeHTML('