You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
maybe somebody besides me is searching for a solution on how to generate pdf files on server side. Here is a small example that works for me. Maybe it finds its way to the readme. :)
$pdfView = new ViewModel();
# When the action can be found at:
# MyModule/MyController/mypdf
# the path to the according template would be:
# my-module/my-controller/mypdf
$pdfView->setTemplate('my-module/my-controller/mypdf');
$pdfView->setVariables(array(
'somevar' => $somevar,
));
$pdfRenderer = $this->getServiceLocator()->get('ViewPdfRenderer');
$html = $pdfRenderer->getHtmlRenderer()->render($pdfView);
$pdfEngine = $pdfRenderer->getEngine();
$pdfEngine->load_html($html);
$pdfEngine->render();
$pdfContent = $pdfEngine->output();
# make sure to create public/pdf before
file_put_contents(getcwd().'/public/pdf/mypdf.pdf', $pdfContent);
greetings
Andi
P.S.: This is more an enhancement for the readme than a real issue, but I don't know how to change the issue type on github, yet.
The text was updated successfully, but these errors were encountered:
We set the option directly inside of the pdfEngine. There are still some errors in this code and some duplicate statements. The interesting part starts at line 348 where $paperSize is used again.
As you've noticed DOMPDFModule hasn't received the time and attention it deserves. I understand how frustrating this is and I'm sorry you've had to deal with this frustration 😢
I'm currently taking steps to stabilize DOMPDFModule which includes code updates as well as creating a backlog that will ensure its continued success.
You can follow project Phoneix to see what immediate work is being prioritized.
Hi,
maybe somebody besides me is searching for a solution on how to generate pdf files on server side. Here is a small example that works for me. Maybe it finds its way to the readme. :)
greetings
Andi
P.S.: This is more an enhancement for the readme than a real issue, but I don't know how to change the issue type on github, yet.
The text was updated successfully, but these errors were encountered: