# Installing DOMPDF library

**URL:** https://discourse.roots.io/t/installing-dompdf-library/5779
**Category:** bedrock
**Tags:** composer
**Created:** 2016-01-27T07:41:14Z
**Posts:** 7

## Post 1 by @aitor — 2016-01-27T07:41:14Z

Hi, I’m trying to install this library to convert HTML to PDF :

> **[GitHub - dompdf/dompdf: HTML to PDF converter for PHP](https://github.com/dompdf/dompdf)**
>
> HTML to PDF converter for PHP. Contribute to dompdf/dompdf development by creating an account on GitHub.

Just running composer command the library was installed into vendor directory but in the requirements page are some other things to install:

> **[Requirements · dompdf/dompdf Wiki](https://github.com/dompdf/dompdf/wiki/Requirements)**
>
> HTML to PDF converter for PHP. Contribute to dompdf/dompdf development by creating an account on GitHub.

[PDFlib](http://www.pdflib.com/)  
[php-font-lib 0.4.x](https://github.com/PhenX/php-font-lib)  
[php-svg-lib 0.1.x](https://github.com/PhenX/php-svg-lib)

What is the correct way to install it? Should I run usual apt-get commands?

Thank you!

---

## Post 2 by @Foxaii — 2016-01-27T10:46:42Z

If you’re using Trellis then the PHP extensions required should be enabled by default.

The other requirements you link to are in the `composer.json` file for dompdf, so they should be installed automatically by composer.

Have you tried using the library?

---

## Post 3 by @aitor — 2016-01-27T12:04:40Z

Not yet! then, maybe it works. I’ll go to try it.

And, yes PHP extension are enabled. I can see it at info.php file.

---

## Post 4 by @aitor — 2016-01-27T16:02:20Z

I had to run composer again inside `vendor/dompdf/` and third party libraries were installed in `vendor/dompdf/vendor` directoy. Installation was succesfull.

Thank you very much for the help.

---

## Post 5 by @kalenjohnson — 2016-01-27T17:24:40Z

That shouldn’t be necessary, since Composer should also get all requirements from a package you are installing…

---

## Post 6 by @aitor — 2016-01-28T18:12:32Z

I did it again to check that, with same results. My steps:

1. I did run `composer require dompdf/dompdf:0.7.x@beta` from bedrock project folder
2. **dompdf** was added to `composer.json` and this folder structure was created inside vendor folder:  
-dompdf  
–dompdf  
—composer.json  
—some other stuff…  
(without third party libraries)
3. I did run `composer update` from `vendor/dompdf/dompdf` and another vendor folder was created inside with third party libraries: `vendor/dompdf/dompdf/vendor/third-party-libraries`

What a mess! Anyway I will try the library as is. I had no time to do it by the moment.

---

## Post 7 by @ben — 2022-02-26T03:08:44Z


