Dear Sir,
How to include external php libraries such as mpdf in lianja and use them in lianja. Kindly explain with example code.
Kind Regards,
Kandarp Mistry.
Dear Sir,
How to include external php libraries such as mpdf in lianja and use them in lianja. Kindly explain with example code.
Kind Regards,
Kandarp Mistry.
Last edited by barrymavin; 2014-12-23 at 22:44.
In the same way you would do it normal PHP code.
Copy your PHP library into either the app directory (use drag and drop) or the library directory, then reference it using require() in the code for your PHP webview section.
and then mylib.php contains:Code:<html> <body> <?php require("mylib.php"); echo "Hello world"; ?> </body> </html>
and the result is:Code:<html> <body> <?php echo "Hello world from mylib</br>"; ?> </body> </html>
![]()
Last edited by barrymavin; 2014-10-06 at 01:22.
Principal developer of Lianja, Recital and other products
Follow me on:
Twitter: http://twitter.com/lianjaInc
Facebook: http://www.facebook.com/LianjaInc
LinkedIn: http://www.linkedin.com/in/barrymavin
Also note that on windows the php.ini file is in:
c:\Lianja\scriptinglanguages\php\conf\php.ini
You can edit the include_path to include directories containing your PHP libraries or else add ..\library\ to the include_path so that require() will look in the Lianja library directory as well as the App directory.
Principal developer of Lianja, Recital and other products
Follow me on:
Twitter: http://twitter.com/lianjaInc
Facebook: http://www.facebook.com/LianjaInc
LinkedIn: http://www.linkedin.com/in/barrymavin
Dear Sir,
I have included the mpdf library as instructed in my app directory as well as library directory. I have typed the following sample code
$page1_section8_section = Lianja::createObject("Section");
include("MPDF54\mpdf\mpdf.php");
$mpdf=new mPDF();
$mpdf->WriteHTML('<p>Hallo World</p>');
$mpdf->Output();
$returnvalue = $page1_section8_section;
in the custom php section.
but in the pages view i am getting the following error : "Error - mPDF requires mb_string functions. Ensure that PHP is compiled with php_mbstring.dll enabled."
I have checked in the php.ini that php mbstring extension is enabled but it still shows the above error. Kindly help.
Regards,
Kandarp Mistry.
If all you want to do is generate a PDF file, do you realize that any HTML that is formatted in a WebView can be saved as a PDF file? This is all built-in.
Principal developer of Lianja, Recital and other products
Follow me on:
Twitter: http://twitter.com/lianjaInc
Facebook: http://www.facebook.com/LianjaInc
LinkedIn: http://www.linkedin.com/in/barrymavin
Dear Sir,
Thank you for that information.
Regards,
Kandarp Mistry.
Bookmarks