barryvdh / laravel-dompdf

A DOMPDF Wrapper for Laravel
MIT License
6.74k stars 972 forks source link

rootDir option is not working, completely ignored #819

Closed olegtoptal closed 2 years ago

olegtoptal commented 3 years ago

Describe the bug

The documentation on the main github page claims:

Available options and their defaults:
    rootDir: "{app_directory}/vendor/dompdf/dompdf"

But if you look at the code, it's completely ignored.

        $pdf = new Pdf(['rootDir' => '/']);
        var_dump($pdf->getOptions()->getRootDir());

In fact, if you try to move dompdf_font_family_cache.dist.php out of the vendor directory (whose location is determined by rootDir), the constructor will fail:

require(/var/www/html/vendor/dompdf/dompdf/lib/fonts/dompdf_font_family_cache.dist.php): Failed to open stream: No such file or directory

To Reproduce

move dompdf_font_family_cache.dist.php out of the vendor and try to specify its path by changing rootDir.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Any issues with PDF rendering itself that are not directly related to this package, should be reported on https://github.com/dompdf/dompdf instead. When having doubts, please try to reproduce the issue with just dompdf. If you believe this is an actual issue with the latest version of laravel-dompdf, please reply to this issue so we can investigate further. Thank you for your contribution! Apologies for any delayed response on our side.