TCPDF

Create a PDF from a ChronoForms submission with custom formatting.

Overview

The user needs to generate a PDF document that mirrors the form's layout and includes dynamic data.
Use the TCPDF action with an HTML template containing data shortcodes. For complex data, employ a PHP action to return variables in an array and reference them in the template, or use an HTML view with PHP enabled to build the output.

Answered
ChronoForms v8
pe pedrorodrigues123 15 Sep, 2023
Hello.

I was wondering if its possible to receive the information of the forms in a pdf document, with the same format of the actual form.
If yes, could you please give me instructions on how to do it.
Thank you.
Max_admin Max_admin 16 Sep, 2023
Answer
The TCPDF action will let you use an HTML template for the output file, build the HTML and use the data shortcodes to get the data filled in the form:
<h1>{data:name}</h1>
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Max_admin Max_admin 09 Apr, 2024
the latest v8 update has demo form for TCPDF
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
we websiteguy 18 Apr, 2024
Hi! Can you add custom php code to TCpdf ? thanks

I tried but it's not working like chronoform 5 ? Why?
Max_admin Max_admin 18 Apr, 2024
You can use a PHP action then call the results in your TCPDF template, here is how:

How to use PHP data anywhere in your form - ChronoForms8
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
we websiteguy 18 Apr, 2024
Ok thanks, but my pdf has many "vars", so i have to create those many "vars", take some time, would it better and easier just put php to the tcpdf ? but it's ok, 

Thanks for your help!
Max_admin Max_admin 18 Apr, 2024
Answer
you can return multiple vars inside an array:

return ["var1" => "111", "var2" => "222"];

then use this syntax in tcpdf:

{var:php_name.var1}
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Max_admin Max_admin 21 May, 2024

another solution in v8.0.21 is to use an HTML view with PHP behavior enabled, build your output with that HTML view, then disable it using the "Wizard Settings" behavior then call it inside your TCPDF content using:

{view.output:html_view_name}
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.