Forum


Replies: 10   Views: 144
Using dompdf with the native conversion plugin

Posted by Damian Rousseau  · 28-10-2024 - 10:38

Hello.

I meet a problem with Dompdf when i try to transform docx to pdf.

First i create docx form template, then i replace variable by word fragment and text, save it to .docx.

Than i wanted to transform it to pdf before download it by the users :

// Here PDF => Barryvdh\DomPDF\Facade::class

$dompdf = new PDF();
$transform = new \Phpdocx\Transform\TransformDocAdvNative();
$transform->transformDocument(public_path('contrats').'/contrat_formate.docx', public_path('contrats').'/contrat_formate_pdf.pdf', array('dompdf' => $dompdf));

But i meet this error :

Undefined property: Barryvdh\DomPDF\Facade\Pdf::$version

Thanks for the help !