Closed pumatertion closed 8 years ago
Okay, mpdf doesn't only looks dirty, it is dirty ;)
I know, mpdf is like a sleazy gangster bar you normally wouldn't ever consider entering, yet it's the best free PDF from html library I'm aware of. Excluding webkit2html based ones, which require webkit2html obviously and handle multi page spanning elements like tables and such really crappy.
PHPPdf looks OK on first glance, yet I kinda like doing it through html. And that library comes with a lot additional required libraries from zend and others.
Don't get me wrong, I'm open to changing the rendering library, but so far mpdf is the best option I tested as long as you keep your eyes shut while looking at its source. Maybe weg could gather the pro and cons of the available options, (fpdf, mpdf, PHPPdf, wk2html, etx)
BTW, you can now use any PDF Library that you want :) I Introduced an PdfGeneratorInterface that you can implement and a option inside the Settings.yaml to set the defaultGenerator className. I also added a optional alternative WebkitGenerator using the "knplabs/knp-snappy" package.
https://github.com/mneuhaus/Famelo.PDF/commit/52eabaf13eb1f909b1475e9e49751e4f471a9a55
this seems to be a great package! How can I create Header and Footer? There is a viewhelper. I tried {namespace fm=Famelo\PDF\ViewHelpers} < fm:header >< p >My Header< /p >< /fm:header > How can I assign objects, e.g. $myobject=$this->someRepository->findAll();, to templates?
Hey @regioadmin,
you can add as many variables to the document as you like like this:
$document = new \Famelo\PDF\Document('My.Package:SomeDocument');
$document->assign('someVariable', 'foobar');
$document->assign('myobject', $this->someRepository->findAll());
Header + Footer ViewHelpers are currently only supported with the webkit generator.
i'm closing this for now as a won't fix, sorry :)
This mpdf stuff looks so dirty :/ What do you think about https://github.com/psliwa/PHPPdf You dont give it html, you give it xmlcontent, xmlstyles, xmlcolorpalettes. And its DDD. What do you think?