+ parent::__construct($pageOrientation, 'pt', $pageSize);//, $uni, $enc);
+ $this->SetLang($lang);
+ $this->setPrintHeader(false);
+ $this->setPrintFooter(false);
+ $this->setPDFVersion("1.3");
+ $this->setAutoPageBreak(0);
+ $this->SetLineWidth(1);
+ $this->cMargin = 0;
+ }
+ /*
+ Set lamguage for next report
+ */
+ function SetLang($code=null)
+ {
+ global $installed_languages, $dflt_lang, $path_to_root, $local_path_to_root, $GetText;
+
+ if (!$code)
+ $code = $dflt_lang;
+ else
+ install_hooks($code);
+
+ $lang = array_search_value($code, $installed_languages, 'code');
+ $GetText->set_language($lang['code'], strtoupper($lang['encoding']));
+
+ // $local_path_to_root is set inside find_custom_file.
+ // Select extension domain if po file is provided
+ // otherwise use global translation.
+ if (file_exists($local_path_to_root.'/lang/'.$lang['code'].'/LC_MESSAGES/'.$lang['code'].'.po'))
+ $GetText->add_domain($lang['code'], $local_path_to_root . "/lang");
+ else
+ $GetText->add_domain($lang['code'], $path_to_root . "/lang", @$lang['version']);
+ // re-read translated sys names.
+ include($path_to_root.'/includes/sysnames.inc');
+
+ $l = array('a_meta_charset' => strtoupper($lang['encoding']),
+ 'a_meta_dir' => @$lang['rtl'] ? 'rtl' : 'ltr',
+ 'a_meta_language' => $code, 'w_page' => 'page');
+