Email plugin - Attach as PDF

andyo

Member
I'm struggling with some domPDF issues. When I use the PDF button to download a PDF from the details view all the values on my form is diplayed correct. But when I try to use the 'Email plugin / Attach as PDF', the attached pdf is missing values. Especially the dropdown fields are missing.
Are the 2 PDF's generated in 2 different ways?
 
Code:
Are the 2 PDF's generated in 2 different ways?

Short version, Yes.

Long version ... J! is built around the MVC methodology - Model, View, Controller, where each page load runs a given view (like a Fabrik form view, or a J! article view, etc). So a component runs, loads a "view". This works great when all you need to do is render one view ... the CMS itself sets up everything for the "model" and the document, the view, etc and rendering is very straight forward ... but in the case of generating (say) a PDF view of a document, while you are already inside another "view" of the same form, is like trying to hammer a square peg into a round hole.

So we have to kind of emulate the entire process of what happens when you click that PDF button for a "normal" PDF view, within the code for the email generation.

That said, it's possible that your issue is not to do with the PDF generation, but something with the formatting of the data.

If you can tell me which form this is, I can take a look, although i can't promise anything. PDF document generation is a huge problem in J!, as Joomla itself doesn't provide it, and we rely on 3rd party libraries to do it.

-- hugh
 
Hi Hugh,
Thanks a lot for you answer. I will test some more and come back to you one this topic later.
My workaround is to add a download link in the email , instead of attaching the PDF to the email directly.
This works for now.
 
Probably the best bet. Until there's a "standard" for PDF generation in J!, our PDF rendering is always going to be "best effort". Most things work, some don't, but the problems are almost always outside of our control, within the 3rd party DOMPDF library.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top