dompdf page size in mm

This commit is contained in:
Yuri Kuznetsov
2024-02-21 11:23:52 +02:00
parent ee294f889c
commit befd48d053
2 changed files with 37 additions and 1 deletions
@@ -38,6 +38,8 @@ class DompdfInitializer
{
private string $defaultFontFace = 'DejaVu Sans';
private const PT = 2.83465;
public function __construct(
private Config $config
) {}
@@ -51,7 +53,7 @@ class DompdfInitializer
$pdf = new Dompdf($options);
$size = $template->getPageFormat() === Template::PAGE_FORMAT_CUSTOM ?
[0.0, 0.0, $template->getPageWidth(), $template->getPageHeight()] :
[0.0, 0.0, $template->getPageWidth() * self::PT, $template->getPageHeight() * self::PT] :
$template->getPageFormat();
$orientation = $template->getPageOrientation() === Template::PAGE_ORIENTATION_PORTRAIT ?