-
Install PHP 7.4.20 (ppa:ondrej/php), PHP GD, PHP XML, Composer and Ghostscript
sudo apt get install php7.4 php7.4-gd php7.4-xml composer ghostscript
-
Do composer update
-
Install Garamond (https://stackoverflow.com/a/45977159) font (https://www.wfonts.com/font/garamond) with
php load_font.php Garamond fonts/GARA.TTF
-
Run script in cli and check output.pdf
php create_pdf.php
Tested with ubuntu-20.04.2.0-desktop-amd64