Thank you black_beard for your informative post.
firstly i want to repeat.
you never use these definitions in makepdf.php files so why you require them?
if (is_file(XOOPS_ROOT_PATH.'/Frameworks/tcpdf/config/lang/'.$xoopsConfig['language'].'.php')) {
require_once( XOOPS_ROOT_PATH.'/Frameworks/tcpdf/config/lang/'.$xoopsConfig['language'].'.php');
} else {
require_once( XOOPS_ROOT_PATH.'/Frameworks/tcpdf/config/lang/english.php');
}
So i think we safely can remove the above. i dont have access to my pc right now. I will test and inform you.
Quote:
The idea is attractive but TCPDF is natively designed for UTF-8. All these files are in UTF-8. TCPDF manages and displays the ISO charset automatically.
Global.php file can be in UTF-8 but also by ISO. The fact inject ISO files in the configuration of TCPDF disturbs the automatic detection and causes display bugs (we return to the original problem)
IMO no problem.
You already inject _CHARSET from XOOPS global.php into TCPDF when you create new tcpdf class in makepdf.php
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, _CHARSET, false);
So we can use _RTL as the same. furthermore, _RTL is a 1/0 value and i think numbers are free from UTF-8 and ISO.
IMO our problem in the past came from the tcpdf itself.
black_beard:
there is an important to do list for newbb to create pdf from a topic.
this is very needed and honestly creating pdf from a single post is useless.
but im worry about memory consumption when it creates pdf from a topic that have 3000 posts. (in my website)
Quote:
Optimization is my priority. The choices I made in adapting the code I was allowed to reduce memory consumption by 56% and reduce execution time by 36% (baseline version VS version 1.03 of tcpdf_for_xoops)
This is vital.
my server admin suspended me because of makepdf.php in news 1.57. i now update to 1.68 but i still fear to turn the pdf option on.
how can i be sure that they dont suspend me again?
Also what is your idea about this?
Quote:
IMO you can create a new class or new function (im not a coder) as a connection between xoops and tcpdf.
currently makepdf.php files in modules directly access the tcpdf functions but it can be changed to a xoops class or function.
I mean now makepdf.php files directly access the tcpdf and there are many similar lines between them. eg: between news/makepdf.php and newbb/makepdf.php
If you write a new class in xoops those lines will be moved to that class so it will be like this in makefile.php.
$pdf = new TCPDF_for_XOOPS(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, _CHARSET, false);
the above is just an example. it can get more input variables. Also it will guarantee that there would be no problem with XOOPS ISO and TCPDF UTF-8.