<?php
require __DIR__.'/../../../vendor/autoload.php';
use Dompdf\Dompdf; use Dompdf\Options;

$html='<!doctype html><html><head><meta charset="utf-8"><style>@page{size:101mm 34mm;margin:0}html,body{margin:0;padding:0;height:34mm;overflow:hidden}.box{width:101mm;height:34mm;padding:2mm;box-sizing:border-box;background:#eee;font:12px DejaVu Sans,Arial}</style></head><body><div class="box">ONE PAGE TEST</div></body></html>';

$opt=new Options(); $opt->set('isHtml5ParserEnabled',true);
$d=new Dompdf($opt);
$d->setPaper([0,0,101*2.83465,34*2.83465],'portrait');
$d->loadHtml($html,'UTF-8'); $d->render();
$pdf=$d->output();
header('Content-Type: application/pdf');
header('Content-Length: '.strlen($pdf));
echo $pdf;
