bggann
Active Member
I've got a complex form that needs to generate a pdf upon submission for the email plugin.
I've created a custom template to format it - and that template is being used both when the PDF button on the form is pressed and for the pdf attachement in the email.
The pdf renders correctly when I press the PDF button on the form.
The pdf does not render correctly when created by the email plugin and attached to the email.
Both use dompdf.
Both use the same template (I have a tag in that template that prints in both so I can see it is running through the template code).
It does not appear to be a template problem, but a problem with how the code is rendering the html to dompdf.
I've looked carefully at the code that sends to DomPDF from the form button press and the email, they are different in detail, but not in concept.
I believe the issue is related to how the html stream is created for input to domPDF.
In pdf render code (components/com_fabrik/pdf/pdf.php about line 130) the data is created by
$data = parent::render();
That is converted using mb_convet_encoding.
Then it is sent to dompdf $pdf=>load_html($data);
In the email plugin it appears the data from a "model" (There is a comment from Hugh about stuffing our model in there with already formatted data).
It is then put in an output buffer
It is then sent to dompdf with the decode built in
Roughly
$controller->display();
$html = ob_get_contents();
$domPdf->load_html(utf8_decode($html));
About line 490 in plugins/fabrik_form/email/email.php
I've tried to look at the html in the log file for dompdf - but it is huge and there is no obvious problem
----------
What I need - the email attached pdf needs to "work".
I don't know if we can substitute the code from the pdf button in there somehow - or what.
Even if I could create the pdf from the button and attach that, it would be fine.
I'm happy to provide login information to the site as well as the cpanel if needed.
I attached example pdf's to here with some data redacted (privacy). Look at the FMO Name and FMO Email. The label is there, but the data missing.
Look at the "Type" in the table. The label "Type" is there, but the data bellow it in the table is missing.
IGNORE other differences they are the result of my redacting probably. Only FMO name, FMO Email and Type are wrong.
Forgot. Current Fabrik and Joomla. Pulled Joomla from github.
-Bob
BTW:
- you may have seen this in community forum. I just got the authorization to sign up for pro support. I expect that to continue for a while at least (some months).
- Hugh - you and I have worked together on Scottish Terrier Club forms in the past- you may remember.
I've created a custom template to format it - and that template is being used both when the PDF button on the form is pressed and for the pdf attachement in the email.
The pdf renders correctly when I press the PDF button on the form.
The pdf does not render correctly when created by the email plugin and attached to the email.
Both use dompdf.
Both use the same template (I have a tag in that template that prints in both so I can see it is running through the template code).
It does not appear to be a template problem, but a problem with how the code is rendering the html to dompdf.
I've looked carefully at the code that sends to DomPDF from the form button press and the email, they are different in detail, but not in concept.
I believe the issue is related to how the html stream is created for input to domPDF.
In pdf render code (components/com_fabrik/pdf/pdf.php about line 130) the data is created by
$data = parent::render();
That is converted using mb_convet_encoding.
Then it is sent to dompdf $pdf=>load_html($data);
In the email plugin it appears the data from a "model" (There is a comment from Hugh about stuffing our model in there with already formatted data).
It is then put in an output buffer
It is then sent to dompdf with the decode built in
Roughly
$controller->display();
$html = ob_get_contents();
$domPdf->load_html(utf8_decode($html));
About line 490 in plugins/fabrik_form/email/email.php
I've tried to look at the html in the log file for dompdf - but it is huge and there is no obvious problem
----------
What I need - the email attached pdf needs to "work".
I don't know if we can substitute the code from the pdf button in there somehow - or what.
Even if I could create the pdf from the button and attach that, it would be fine.
I'm happy to provide login information to the site as well as the cpanel if needed.
I attached example pdf's to here with some data redacted (privacy). Look at the FMO Name and FMO Email. The label is there, but the data missing.
Look at the "Type" in the table. The label "Type" is there, but the data bellow it in the table is missing.
IGNORE other differences they are the result of my redacting probably. Only FMO name, FMO Email and Type are wrong.
Forgot. Current Fabrik and Joomla. Pulled Joomla from github.
-Bob
BTW:
- you may have seen this in community forum. I just got the authorization to sign up for pro support. I expect that to continue for a while at least (some months).
- Hugh - you and I have worked together on Scottish Terrier Club forms in the past- you may remember.