CalcBuilder Forum

mpdf.pdf file creation

Usuario moon_1209 2013-10-27 22:25:01

I looking for the code where the pdf is made,
I want a diverent name for the pdf file is is now mpdf.pdf but like an other name
cant find the the creation of the file in the code

Moonsoft support 2013-10-28 09:59:54

the mpdf.pdf default name is created by mpdf library, you can find it here:


//line 5668



Usuario moon_1209 2013-10-28 16:12:14

I see

if(is_bool($dest)) $dest=$dest ? 'D' : 'F';
if($dest=='') {
if($name=='') {
else { $dest='F'; }

but where can I fount the call to this function in the calc builder code.

I want to save the PDF on the server and store the unic name in the session info
so i can tranfer the data to rf form for e-mailing

Moonsoft support 2013-10-28 16:32:11

you won't find that specific call at calcbuilder code, mpdf is a library and only the main class is instanciated, all the handling is coded here:


Here some information about mpdf library, so you can check the options available:

but we'd suggest instead to download the example from customer area:

Send Email with PDF

it shows the code needed to create a pdf file from calcbuilder code in order to attach it to an email, so you won't need to modify core code from mpdf.

Hope this helps, regards

Usuario moon_1209 2013-10-28 21:33:58

I look at the sample but lookt to me like al lot of work to make a pdf that way from about 35 checkbox fields

so I look for the trigger of the pdf lib

there shout be a call to it after pressing calc of press the pdf button after the calc?

it lookes like ajax so it might be in som java file but i can't find it

Moonsoft support 2013-10-29 09:29:55

Hi, not sure of which point are you looking for, we think the best option is to write your custom code inside the calculator code, so here you have the path to pdf creation, every component is built using joomla mvc.

Starts at the module:


line 238

if ($utility) {

And then passes through the controller, to the view


Hope this helps, regards
Moonsoft Team

Usuario moon_1209 2013-10-31 00:59:17

And then passes through the controller, to the view


I just make the folder:

and copy the pdf.php in it

change the last line of this file from

and I am happy

In my calculation I got a var Name_1 how can I use it in the override

I want: $mpdf->Output(value(Name_1),'D');

I think i need somline like this

but what is the correct programcode

Edited by moon_1209 - 31.10.2013 08:19

Moonsoft support 2013-10-31 09:42:29

great it worked. At the layout you can't access variables calculated at previous layer, because they are already replaced at the content that's sent as the pdf output. If you don't want to track variables through all layers to add a new one, you can also use session to share values among different parts of your code.

Here official info about sessions in joomla:

Hope this helps, regards

Usuario moon_1209 2013-10-31 09:52:17



Create dynamic calculators

Buy now!
List Manager

Build different lists for your site

Buy now!