1. Fabrik 3.8.1 has been released. It is mostly bug fixes and feature enhancements, but does include two new plugins (push notifications, and the sequence element). As usual we strongly recommend testing the new release on a sandbox if your application is mission critical, and always do an Akeeba backup before updating.
    Dismiss Notice

Pdf template for email plugin attachment

Discussion in 'Standard Support' started by smalldragoon, Mar 14, 2018.

  1. smalldragoon

    smalldragoon Member

    Level: Standard
    Hi,
    I found this Thread
    http://fabrikar.com/forums/index.php?threads/email-form-plugin-attach-as-pdf.48232/ which sounds to mean that there is a problem with the layout of PDF generated with the email plugin ?

    For now, whatever the pdf template I choose ( bootstrap, bootsrap_with tabs or Wellington ) , I have layout on 1 line only ( pdf attached to the post)
    I tried to change manually the "wellington" but I don't really see any changes in the output.

    Thx !
     

    Attached Files:

    • 26.pdf
      File size:
      4.2 KB
      Views:
      27
  2. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    Wellington shouldn't be there, it was just a test (which is identical to the main bootstrap template) that got included in a realase at some point.

    Looking at some PDF issues is on my list for this week.

    -- hugh
     
  3. smalldragoon

    smalldragoon Member

    Level: Standard
    Ah ok ! So will wait then !
    Thanks
     
  4. smalldragoon

    smalldragoon Member

    Level: Standard
    Hello ! did you get a chance to look at the pdf generation ?
    Thx
     
  5. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    If you do a full github update, there should now be an option in the Fabrik global options for "PDF Library", with a choice of DOMPDF and mpdf. Try using mpdf.

    I'm still playing around with finding the best PDF library. Going to try TCPDF next. My experience so far that there isn't a "best" one, rather each one has strengths and weaknesses. For instance, mpdf is great for rendering forms, more reliable with better CSS support than DOMPDF ... but it's a bit sketchy for lists (well, anything with long tables that span more than one page).

    -- hugh
     
  6. smalldragoon

    smalldragoon Member

    Level: Standard
    mm.. don't know how to do a github update, but I will check ! :p
    My needs are pretty basic for this form : send by pdf data entered + the signature gathered with the signature plugin ....
    Thx !
     
  7. smalldragoon

    smalldragoon Member

    Level: Standard
    Hi Hugh,
    Update done, DomPDF chosen from the options ...
    I have a PDF generated but the content needs some formatting I guess
    How / where can I configure it ?
    for ref, the PDF attached
    Other question : I can define the "key" to be able to bypass the ACL when generating the pdf ... where should I fill it on the DomPDF side ? I see salesforce, gmail but nothing for pdf
    Thx !
     

    Attached Files:

    • -32.pdf
      File size:
      1.9 KB
      Views:
      32
    Last edited: Mar 21, 2018
  8. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    That latest PDF ... are you doing that from a popup (like an AJAX-ified form link)?

    -- hugh
     
  9. smalldragoon

    smalldragoon Member

    Level: Standard
    Not sure what you mean : I'm using the email plugin in a form
    I have all the field in my email body ( using bootstrap , no article template) and I checked the pdf option, to have same info in the PDF
     
  10. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    I'm trying to work out why you PDF is in JSON format. Which usually happens if you try and generate a PDF in an AJAX context - like from a form in a content plugin, or in a popup window (if you've "AJAXified" the list links).

    -- hugh
     
  11. smalldragoon

    smalldragoon Member

    Level: Standard
    If you need access to the site , no problems, tell me .. it is not live yet so no big deal ...
     
  12. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    Unfortunately won't tell me much, as I need to actually get inside the code to debug it. I'll try and replicate it here.

    I will however check your setup. Which form is it on?

    -- hugh
     
  13. smalldragoon

    smalldragoon Member

    Level: Standard
  14. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    OK, as I said:

    ... and indeed, you are using a form in a content plugin.

    Try just using a normal Fabrik menu item link to the form.

    Unfortunately, this isn't something I can work round, it's a limitation of the Joomla framework. The email plugin runs during form submission, in the the form "view" context. And to generate a PDF of the form, we have to run a display of it in a form view context. But because, during AJAX submission, the view type is set to "format=raw" (meaning it returns JSON rather than HTML), when we run the display of the form for generating the PDF, that "raw" format overrides the normal "html" format, and you get that JSON view of it.

    And because the way J!'s MVC (Model, View, Controller) system works, there's no way for me to set the format back to html, run the PDF view, then set it back to raw. The format is "private" (in the PHP variable sense).

    So email PDF attachments can't be generated from form views that submit via AJAX - specifically, from content plugins, or if you have "AJAXified" your list and are submitting the form from a popup.

    -- hugh
     
  15. smalldragoon

    smalldragoon Member

    Level: Standard
    Hi ,
    I think I understand the limitation for the PDF with the AJAX.
    Thx
    the fac to use the content plugin was an attemp when the PDF generation was not working at all.
    Define a normal link now and it works !
    Thx !
     
    Last edited: Mar 27, 2018

Share This Page