Forum


Calc Builder Support

Calc Builder support
Forums
Public write access is disabled. Please login

mpdf.pdf file creation 27.10.2013 22:25

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

Re: mpdf.pdf file creation 28.10.2013 09:59

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

joomla\components\com_calcbuilder\views\calcbuilder\mpdf\mpdf.php


//line 5668

$name='mpdf.pdf';



Regards
Moonsoft Team
www.moonsoft.es

Re: mpdf.pdf file creation 28.10.2013 16:12

I see


if(is_bool($dest)) $dest=$dest ? 'D' : 'F';
$dest=strtoupper($dest);
if($dest=='') {
if($name=='') {
$name='mpdf.pdf';
$dest='I';
}
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

Re: mpdf.pdf file creation 28.10.2013 16:32

Hi,
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:

joomla\components\com_calcbuilder\views\calcbuilder\tmpl\pdf.php

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

http://mpdf1.com/manual/index.php?tid=125

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
Moonsoft Team
www.moonsoft.es

Re: mpdf.pdf file creation 28.10.2013 21:33

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

Re: mpdf.pdf file creation 29.10.2013 09:29

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:

joomla\modules\mod_calcbuilder\tmpl\user.php

line 238

if ($utility['front_pdf']) {


And then passes through the controller, to the view

joomla\components\com_calcbuilder\views\calcbuilder\tmpl\pdf.php

Hope this helps, regards
Moonsoft Team
Moonsoft Team
www.moonsoft.es

Re: mpdf.pdf file creation 31.10.2013 00:59


And then passes through the controller, to the view

joomla\components\com_calcbuilder\views\calcbuilder\tmpl\pdf.php


I just make the folder:
/templates/"my_template"/html/com_calcbuilder/calcbuilder

and copy the pdf.php in it

change the last line of this file from
$mpdf->Output();
to
$mpdf->Output('invoice.pdf','D');

and I am happy

http://mpdf1.com/manual/index.php?tid=125


==========================================
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
$mpdf->Output($this->calculo['Name_1'],'D');

but what is the correct programcode

Edited by moon_1209 - 31.10.2013 08:19

Re: mpdf.pdf file creation 31.10.2013 09:42

Hi,
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:

http://docs.joomla.org/JFactory/getSession



Hope this helps, regards
Moonsoft Team
www.moonsoft.es

Re: mpdf.pdf file creation 31.10.2013 09:52

¡gracias
Are you satisfied with our products/services/support?
Please help us to keep improving, add a review at  joomla extensions site and  magento connect
FaLang translation system by Faboba

Our clients' feedback