diff --git a/main/admin/legal_add.php b/main/admin/legal_add.php
index fb033fffd6..b0fd4652ab 100755
--- a/main/admin/legal_add.php
+++ b/main/admin/legal_add.php
@@ -122,7 +122,7 @@ if (isset($_POST['language'])) {
//$form->addElement('html_editor', 'content', null, null, array('ToolbarSet' => 'Basic', 'Width' => '100%', 'Height' => '250'));
$form->addElement('static', $_POST['language']);
$form->addElement('hidden', 'language',$_POST['language']);
- $form->add_html_editor('content', get_lang('Content'), true, false, array('ToolbarSet' => 'simple', 'Width' => '100%', 'Height' => '250'));
+ $form->add_html_editor('content', get_lang('Content'), true, false, array('ToolbarSet' => 'terms_and_conditions', 'Width' => '100%', 'Height' => '250'));
//$form->addElement('textarea', 'content', get_lang('Content'),array('cols'=>'120','rows'=>'10'));
$form->addElement('radio', 'type', '', get_lang('HTMLText') ,'0');
$form->addElement('radio', 'type', '', get_lang('PageLink') ,'1');
diff --git a/main/admin/settings.php b/main/admin/settings.php
index 9ca8b291e2..d8ea29e497 100755
--- a/main/admin/settings.php
+++ b/main/admin/settings.php
@@ -374,7 +374,7 @@ $action_images['plugins'] = 'plugin.gif';
$action_images['stylesheets'] = 'theme.gif';
$action_images['templates'] = 'template.gif';
$action_images['search'] = 'search.gif';
-
+$action_images['editor'] = 'html.png';
// grabbing the categories
//$selectcategories = "SELECT DISTINCT category FROM ".$table_settings_current." WHERE category NOT IN ('stylesheets','Plugins')";
diff --git a/main/document/document.inc.php b/main/document/document.inc.php
index 01479f5167..24b08a8578 100755
--- a/main/document/document.inc.php
+++ b/main/document/document.inc.php
@@ -165,6 +165,7 @@ function create_document_link($www, $title, $path, $filetype, $size, $visibility
if (!$show_as_icon)
{
//build download link (icon)
+
$forcedownload_link=($filetype=='folder')?api_get_self().'?'.api_get_cidreq().'&action=downloadfolder&path='.$url_path.$req_gid:api_get_self().'?'.api_get_cidreq().'&action=download&id='.$url_path.$req_gid;
//folder download or file download?
$forcedownload_icon=($filetype=='folder')?'folder_zip.gif':'filesave.gif';
@@ -220,7 +221,18 @@ function create_document_link($www, $title, $path, $filetype, $size, $visibility
if (!$show_as_icon)
{
- $force_download_html = ($size==0)?'':''.Display::return_icon($forcedownload_icon, get_lang('Download'),array('height'=>'16', 'width' => '16')).'';
+ if($filetype=="folder")
+ {
+ if(api_is_allowed_to_edit() || api_is_platform_admin() || api_get_setting('students_download_folders') == 'true')
+ {
+ $force_download_html = ($size==0)?'':''.Display::return_icon($forcedownload_icon, get_lang('Download'),array('height'=>'16', 'width' => '16')).'';
+ }
+ }
+ else
+ {
+ $force_download_html = ($size==0)?'':''.Display::return_icon($forcedownload_icon, get_lang('Download'),array('height'=>'16', 'width' => '16')).'';
+ }
+
return ''.$title.''.$force_download_html;
}
else
diff --git a/main/document/document.php b/main/document/document.php
index 4453a260ea..aa4b4ec7ca 100755
--- a/main/document/document.php
+++ b/main/document/document.php
@@ -144,7 +144,7 @@ $group_member_with_upload_rights = false;
if(isset($_SESSION['_gid']) && $_SESSION['_gid']!='')
{
//needed for group related stuff
- include_once(api_get_path(LIBRARY_PATH) . 'groupmanager.lib.php');
+ require_once(api_get_path(LIBRARY_PATH) . 'groupmanager.lib.php');
//get group info
$group_properties = GroupManager::get_group_properties($_SESSION['_gid']);
$noPHP_SELF=true;
@@ -283,9 +283,9 @@ if (isset($_GET['action']) && $_GET['action']=="download")
//-------------------------------------------------------------------//
//download of an completed folder
-if(isset($_GET['action']) && $_GET['action']=="downloadfolder")
-{
- include('downloadfolder.inc.php');
+if(isset($_GET['action']) && $_GET['action']=="downloadfolder" && (api_get_setting('students_download_folders') == 'true' || api_is_allowed_to_edit() || api_is_platform_admin()))
+{
+ require('downloadfolder.inc.php');
}
//-------------------------------------------------------------------//
@@ -405,7 +405,7 @@ if($is_allowed_to_edit || $group_member_with_upload_rights) // TEACHER ONLY
}
}
- include_once(api_get_path(LIBRARY_PATH) . 'fileManage.lib.php');
+ require_once(api_get_path(LIBRARY_PATH) . 'fileManage.lib.php');
//this is needed for the update_db_info function
//$dbTable = $_course['dbNameGlu']."document";
$dbTable = Database::get_course_table(TABLE_DOCUMENT);
@@ -448,7 +448,7 @@ if($is_allowed_to_edit || $group_member_with_upload_rights) // TEACHER ONLY
}
}
- include_once(api_get_path(LIBRARY_PATH) . 'fileManage.lib.php');
+ require_once(api_get_path(LIBRARY_PATH) . 'fileManage.lib.php');
if(DocumentManager::delete_document($_course,$_GET['delete'],$base_work_dir))
{
@@ -504,7 +504,7 @@ if($is_allowed_to_edit || $group_member_with_upload_rights) // TEACHER ONLY
if(isset($_POST['create_dir']) && $_POST['dirname']!='')
{
//needed for directory creation
- include_once(api_get_path(LIBRARY_PATH) . 'fileUpload.lib.php');
+ require_once(api_get_path(LIBRARY_PATH) . 'fileUpload.lib.php');
$post_dir_name=Security::remove_XSS($_POST['dirname']);
if ($post_dir_name=='../' || $post_dir_name=='.' || $post_dir_name=='..')
@@ -843,7 +843,7 @@ $column_show=array();
}
if ($docs_and_folders!=null) {
global $total_size;
- if ($total_size!=0){ ?>
+ if ($total_size!=0 && (api_get_setting('students_download_folders') == 'true' || api_is_allowed_to_edit() || api_is_platform_admin())){ ?>
(ZIP)" alt="" /> (ZIP)
@@ -851,7 +851,7 @@ $column_show=array();
}
}
// Slideshow by Patrick Cool, May 2004
- include("document_slideshow.inc.php");
+ require("document_slideshow.inc.php");
if ($image_present)
{
echo " ". get_lang('ViewSlideshow') . "";
diff --git a/main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/inc/class.upload.php b/main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/inc/class.upload.php
index a24cf61130..8180ebb37b 100755
--- a/main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/inc/class.upload.php
+++ b/main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/inc/class.upload.php
@@ -204,7 +204,7 @@ class Upload
{
$this->fileBaseName = $fileBaseName;
}
- $this->fileBaseName=disable_dangerous_file(replace_dangerous_char(str_replace(' ','_',$this->fileBaseName)));// Juan Carlos Raña replace space by _ because fix long names. See: ajaxfilemanager/inc/class.manager.php. And add cleaning from dokeos replace_dangerous_char() and disable_dangerous_file()
+ $this->fileBaseName=disable_dangerous_file(replace_dangerous_char(str_replace(' ','_',$this->fileBaseName),'strict'));// Juan Carlos Raña replace space by _ because fix long names. See: ajaxfilemanager/inc/class.manager.php. And add cleaning from dokeos replace_dangerous_char() and disable_dangerous_file()
$fileName = $this->fileBaseName . $this->fileExtension;
$filePath = $dest . $fileName;
diff --git a/main/inc/lib/fckeditor/editor/plugins/asciimath/asciimath.gif b/main/inc/lib/fckeditor/editor/plugins/asciimath/asciimath.gif
index 86d68e1e22..61db5905cc 100755
Binary files a/main/inc/lib/fckeditor/editor/plugins/asciimath/asciimath.gif and b/main/inc/lib/fckeditor/editor/plugins/asciimath/asciimath.gif differ
diff --git a/main/inc/lib/fckeditor/editor/plugins/asciimath/lang/es.js b/main/inc/lib/fckeditor/editor/plugins/asciimath/lang/es.js
index c5bbf667f2..2afef98d98 100755
--- a/main/inc/lib/fckeditor/editor/plugins/asciimath/lang/es.js
+++ b/main/inc/lib/fckeditor/editor/plugins/asciimath/lang/es.js
@@ -3,20 +3,20 @@
* asciimath plugin Spanish language file.
* Encoding: UTF-8.
*
- * Author:
+ * Author: Juan Carlos Raña Trabado
*/
-FCKLang["DlgAsciiMath"] = 'AsciiMath Formula Input' ;
-FCKLang["DlgAsciiMathFormulaEditor"] = 'Formula Editor' ;
-FCKLang["DlgAsciiMathInput"] = 'Input' ;
-FCKLang["DlgAsciiMathClear"] = 'Clear' ;
-FCKLang["DlgAsciiMathDelete"] = 'Delete' ;
-FCKLang["DlgAsciiMathPreview"] = 'Preview' ;
-FCKLang["DlgAsciiMathBasedOn"] = 'Based on ASCIIMathML by ' ;
-FCKLang["DlgAsciiMathForMoreInfo"] = 'For more information on AsciiMathML visit this page: ' ;
-FCKLang["DlgAsciiMathShowMathML"] = 'Show MathML' ;
-FCKLang["DlgAsciiMathFormulaPreview"] = 'Formula Preview' ;
-FCKLang["DlgAsciiIncompatibleBrowser"] = 'Your browser is not able to show mathematical formulas. Please, use %s1 or Internet Explorer with %s2 plugin.' ;
-FCKLang["DlgAsciiMathOldIE"] = 'Your browser is not able to show mathematical formulas. You need to upgrade to Internet Explorer 6.0+. Then you need to install the MathPlayer 2 plugin for Internet Explorer. Please, see %s for more information.' ;
-FCKLang["DlgAsciiMathInstallMathPlayer"] = 'Your browser is not able to show mathematical formulas. You need to install the MathPlayer 2 plugin for Internet Explorer. Please, see %s for more information.' ;
-FCKLang["DlgAsciiMathOldMathPlayer"] = 'Your browser is not able to show mathematical formulas. You need to upgrade the MathPlayer plugin for Internet Explorer to version 2. Please, see %s for more information.' ;
+FCKLang["DlgAsciiMath"] = 'Insertar una fórmula ASCIIMath' ;
+FCKLang["DlgAsciiMathFormulaEditor"] = 'Editor de ecuaciones' ;
+FCKLang["DlgAsciiMathInput"] = 'Insertar' ;
+FCKLang["DlgAsciiMathClear"] = 'Limpiar' ;
+FCKLang["DlgAsciiMathDelete"] = 'Eliminar' ;
+FCKLang["DlgAsciiMathPreview"] = 'Previsualización' ;
+FCKLang["DlgAsciiMathBasedOn"] = 'Basado en ASCIIMathML por ' ;
+FCKLang["DlgAsciiMathForMoreInfo"] = 'Para más información sobre AsciiMathML visite esta página: ' ;
+FCKLang["DlgAsciiMathShowMathML"] = 'Mostrar MathML' ;
+FCKLang["DlgAsciiMathFormulaPreview"] = 'Previsualización de la ecuación' ;
+FCKLang["DlgAsciiIncompatibleBrowser"] = 'Su navegador no puede mostrar fórmulas matemáticas. Use %s1 o Internet Explorer con el plugin %s2 ' ;
+FCKLang["DlgAsciiMathOldIE"] = 'Su navegador no puede mostrar fórmulas matemáticas. Actualícese a Internet Explorer 6.0+. Tras esto, tendra que instalar el plugin MathPlayer 2 para Internet Explorer. Para más información vea %s' ;
+FCKLang["DlgAsciiMathInstallMathPlayer"] = 'Su navegador no puede mostrar fórmulas matemáticas. Necesita instalar el plugin MathPlayer 2 para Internet Explorer. Para más información vea %s' ;
+FCKLang["DlgAsciiMathOldMathPlayer"] = 'Su navegador no puede mostrar fórmulas matemáticas. Necesita actualizar el plugin MathPlayer para Internet Explorer a la version 2. Para más información vea %s' ;
\ No newline at end of file
diff --git a/main/inc/lib/fckeditor/myconfig.php b/main/inc/lib/fckeditor/myconfig.php
index 057f8835b7..eaf1824682 100755
--- a/main/inc/lib/fckeditor/myconfig.php
+++ b/main/inc/lib/fckeditor/myconfig.php
@@ -66,9 +66,20 @@
// Then, you may modify the newly copied toolbar definitions at your will, just keep correct php-syntax.
// It is not mandatory you to create custom files for all the toolbars. In case of missing file in the directory with the
// custom toobar definitions the system would read the correspondent "factory" toolbar definition (form 'default' directory).
-$config['ToolbarSets']['Directory'] = 'default';
-// You may try this provided example of custom toolbars:
-//$config['ToolbarSets']['Directory'] = 'extended';
+
+
+// This is the visible toolbar set when the editor is maximized.
+// If it has not been defined, then the toolbar set for the "normal" size is used.
+// if do you prefer configure for each toolbar edit main/inc/lib/fckeditor/toolbars/
+
+if ((api_get_setting('more_buttons_maximized_mode') == 'true'))
+{
+ $config['ToolbarSets']['Directory'] = 'extended';
+}
+else
+{
+ $config['ToolbarSets']['Directory'] = 'default';
+}
/*
@@ -119,8 +130,15 @@ $config['LoadPlugin'][] = 'fckEmbedMovies';
$config['LoadPlugin'][] = 'flvPlayer';
// youtube : Adds a dilog for inserting YouTube video-streams.
-if (api_is_allowed_to_edit() || api_is_platform_admin()) { // (not for students)
+if ((api_get_setting('youtube_for_students') == 'true')) {
+
$config['LoadPlugin'][] = 'youtube';
+
+}
+else{
+ if (api_is_allowed_to_edit() || api_is_platform_admin()) { // (not for students)
+ $config['LoadPlugin'][] = 'youtube';
+ }
}
// googlemaps : Adds a dilog for inserting Google maps.
@@ -136,8 +154,11 @@ $config['LoadPlugin'][] = 'googlemaps';
// mimetex : Adds a dilog for inserting mathematical formulas. In order this plugin to work prpoperly, preliminary changes
// in your server configuration have to be done. The MimeTex executable file has to be installed, see the installation guide.
//
-// Uncomment the line below (remove the double slash at the beginning) to enable the 'mimetex' plugin:
-//$config['LoadPlugin'][] = 'mimetex';
+if ((api_get_setting('math_mimetex') == 'true')) {
+
+ $config['LoadPlugin'][] = 'mimetex';
+}
+
//
// Some additional settings become active only when the 'mimetex' plugin has been enabled:
//
@@ -166,7 +187,11 @@ $config['MimetexExecutableDetectionTimeout'] = 0.05;
// After enabling it, this plugin is configured to work with full-page html documents out-of-the box.
// You may try it in the "Documents" and "Wiki" tools.
// Browser compatibility: Internet Explorer 6.0+ with MathPlayer plugin, Mozilla Firefox 2.0+, Opera 9.5+
-//$config['LoadPlugin'][] = 'asciimath';
+
+if ((api_get_setting('math_asciimathML') == 'true')) {
+
+ $config['LoadPlugin'][] = 'asciimath';
+}
// wikilink : Adds a dialog for inserting wiki-formatted links.
$config['LoadPlugin'][] = 'wikilink';
@@ -279,6 +304,15 @@ $config['FontFormats'] = 'p;h1;h2;h3;h4;h5'; // A reduced format list.
// for all browsers. You may disable or change it if you wish.
$config['EditorAreaStyles'] = 'body { background-color: #ffffff; }';
+// A setting for blocking copy/paste functions of the editor.
+// This setting activates on leaners only. For users with other statuses there is no blocking copy/paste.
+// if do you prefer configure for each toolbar edit main/inc/lib/fckeditor/toolbars/
+if ((api_get_setting('block_copy_paste_for_students') == 'true'))
+{
+
+ $config['BlockCopyPaste'] = true;
+}
+
/*
* Additional note:
* For debugging purposes the editor may run using original source versions of its javascripts, not the "compressed" versions.
diff --git a/main/inc/lib/fckeditor/toolbars/default/terms_and_conditions.php b/main/inc/lib/fckeditor/toolbars/default/terms_and_conditions.php
new file mode 100644
index 0000000000..e042af88c1
--- /dev/null
+++ b/main/inc/lib/fckeditor/toolbars/default/terms_and_conditions.php
@@ -0,0 +1,46 @@
+
diff --git a/main/inc/lib/fckeditor/toolbars/extended/admin_templates.php b/main/inc/lib/fckeditor/toolbars/extended/admin_templates.php
index e6e083b688..43d7e53926 100755
--- a/main/inc/lib/fckeditor/toolbars/extended/admin_templates.php
+++ b/main/inc/lib/fckeditor/toolbars/extended/admin_templates.php
@@ -9,17 +9,13 @@
// This is the visible toolbar set when the editor has "normal" size.
$config['ToolbarSets']['Normal'] = array(
- array('FitWindow','Save','Preview'),
+ array('NewPage','Templates','Save','Print','PageBreak','FitWindow','-','PasteWord','-','Undo','Redo','-','SelectAll','-','Find'),
array('Bold','Italic','Underline'),
- array('OrderedList','UnorderedList','-','Outdent','Indent'),
- array('JustifyLeft','JustifyCenter','JustifyRight'),
- array('Undo','Redo','-','Find','-','SelectAll','RemoveFormat'),
- array('Link','Unlink'),
- array('Image','Flash'),
- '/',
- array('Style','FontFormat','FontName','FontSize'),
- array('TextColor','BGColor'),
- array('Rule','Table','SpecialChar'),
+ array('Link','Unlink','Anchor'),
+ array('Image','flvPlayer','Flash','EmbedMovies','YouTube','MP3','mimetex','asciimath'),
+ array('Table','Smiley','SpecialChar','googlemaps'),
+ array('FontFormat','FontName','FontSize'),
+ array('JustifyLeft','JustifyCenter','JustifyRight','-','OrderedList','UnorderedList','-','Outdent','Indent','-','TextColor','BGColor'),
array('Source')
);
diff --git a/main/inc/lib/fckeditor/toolbars/extended/agenda.php b/main/inc/lib/fckeditor/toolbars/extended/agenda.php
index 007b9fc7cf..eadb79b114 100755
--- a/main/inc/lib/fckeditor/toolbars/extended/agenda.php
+++ b/main/inc/lib/fckeditor/toolbars/extended/agenda.php
@@ -9,15 +9,15 @@
// This is the visible toolbar set when the editor has "normal" size.
$config['ToolbarSets']['Normal'] = array(
- array('FitWindow','Save','Preview'),
- array('Bold','Italic','Underline'),
- array('OrderedList','UnorderedList','-','Outdent','Indent'),
- array('JustifyLeft','JustifyCenter','JustifyRight'),
- array('Undo','Redo','-','SelectAll','RemoveFormat'),
- array('Link','Unlink'),
- '/',
- array('Style','FontFormat','FontName','FontSize'),
- array('TextColor','BGColor')
+ array('FitWindow','PasteWord','-','Undo','Redo'),
+ array('Link','Unlink','Anchor'),
+ array('Image','flvPlayer','Flash','EmbedMovies','YouTube','MP3','mimetex'),
+ array('Table','SpecialChar'),
+ '/',
+ array('Style','FontFormat','FontName','FontSize'),
+ array('Bold','Italic','Underline'),
+ array('JustifyLeft','JustifyCenter','JustifyRight','-','OrderedList','UnorderedList','-','Outdent','Indent','-','TextColor','BGColor'),
+ array('Source')
);
// This is the visible toolbar set when the editor is maximized.
diff --git a/main/inc/lib/fckeditor/toolbars/extended/agenda_student.php b/main/inc/lib/fckeditor/toolbars/extended/agenda_student.php
index 60d9e40705..88a1ef1d69 100755
--- a/main/inc/lib/fckeditor/toolbars/extended/agenda_student.php
+++ b/main/inc/lib/fckeditor/toolbars/extended/agenda_student.php
@@ -9,15 +9,15 @@
// This is the visible toolbar set when the editor has "normal" size.
$config['ToolbarSets']['Normal'] = array(
- array('FitWindow','Save','Preview'),
- array('Bold','Italic','Underline'),
- array('OrderedList','UnorderedList','-','Outdent','Indent'),
- array('JustifyLeft','JustifyCenter','JustifyRight'),
- array('Undo','Redo','-','SelectAll','RemoveFormat'),
- array('Link','Unlink'),
- '/',
- array('Style','FontFormat','FontName','FontSize'),
- array('TextColor','BGColor')
+ array('Save','FitWindow','PasteWord','-','Undo','Redo'),
+ array('Link','Unlink','Anchor'),
+ array('Image','flvPlayer','Flash','EmbedMovies','YouTube','MP3','mimetex'),
+ array('Table','SpecialChar'),
+ '/',
+ array('FontFormat','FontName','FontSize'),
+ array('Bold','Italic','Underline'),
+ array('JustifyLeft','JustifyCenter','JustifyRight','-','OrderedList','UnorderedList','-','Outdent','Indent','-','TextColor','BGColor'),
+ array('ShowBlocks')
);
// This is the visible toolbar set when the editor is maximized.
diff --git a/main/inc/lib/fckeditor/toolbars/extended/announcements.php b/main/inc/lib/fckeditor/toolbars/extended/announcements.php
index fb0c777bf8..545696affe 100755
--- a/main/inc/lib/fckeditor/toolbars/extended/announcements.php
+++ b/main/inc/lib/fckeditor/toolbars/extended/announcements.php
@@ -9,15 +9,15 @@
// This is the visible toolbar set when the editor has "normal" size.
$config['ToolbarSets']['Normal'] = array(
- array('FitWindow','Save','Preview'),
- array('Bold','Italic','Underline'),
- array('OrderedList','UnorderedList','-','Outdent','Indent'),
- array('JustifyLeft','JustifyCenter','JustifyRight'),
- array('Undo','Redo','-','SelectAll','RemoveFormat'),
- array('Link','Unlink'),
- '/',
- array('Style','FontFormat','FontName','FontSize'),
- array('TextColor','BGColor')
+ array('Save','FitWindow','PasteWord','-','Undo','Redo'),
+ array('Link','Unlink','Anchor'),
+ array('Image','flvPlayer','Flash','EmbedMovies','YouTube','MP3','mimetex'),
+ array('Table','SpecialChar'),
+ array('OrderedList','UnorderedList','-','Outdent','Indent','-','TextColor','BGColor','-','Source'),
+ '/',
+ array('Style','FontFormat','FontName','FontSize'),
+ array('Bold','Italic','Underline'),
+ array('JustifyLeft','JustifyCenter','JustifyRight')
);
// This is the visible toolbar set when the editor is maximized.
diff --git a/main/inc/lib/fckeditor/toolbars/extended/announcements_student.php b/main/inc/lib/fckeditor/toolbars/extended/announcements_student.php
index db6976b2bc..a9c93489ab 100755
--- a/main/inc/lib/fckeditor/toolbars/extended/announcements_student.php
+++ b/main/inc/lib/fckeditor/toolbars/extended/announcements_student.php
@@ -9,15 +9,16 @@
// This is the visible toolbar set when the editor has "normal" size.
$config['ToolbarSets']['Normal'] = array(
- array('FitWindow','Save','Preview'),
- array('Bold','Italic','Underline'),
- array('OrderedList','UnorderedList','-','Outdent','Indent'),
- array('JustifyLeft','JustifyCenter','JustifyRight'),
- array('Undo','Redo','-','SelectAll','RemoveFormat'),
- array('Link','Unlink'),
- '/',
- array('Style','FontFormat','FontName','FontSize'),
- array('TextColor','BGColor')
+ array('Save','FitWindow','PasteWord','-','Undo','Redo'),
+ array('Link','Unlink','Anchor'),
+ array('Image','flvPlayer','Flash','EmbedMovies','YouTube','MP3','mimetex'),
+ array('Table','SpecialChar'),
+ array('OrderedList','UnorderedList','-','Outdent','Indent','-','TextColor','BGColor'),
+ '/',
+ array('Style','FontFormat','FontName','FontSize'),
+ array('Bold','Italic','Underline'),
+ array('JustifyLeft','JustifyCenter','JustifyRight'),
+ array('ShowBlocks')
);
// This is the visible toolbar set when the editor is maximized.
diff --git a/main/inc/lib/fckeditor/toolbars/extended/assessments_introduction.php b/main/inc/lib/fckeditor/toolbars/extended/assessments_introduction.php
index 21e7cb2b46..2de167c78a 100755
--- a/main/inc/lib/fckeditor/toolbars/extended/assessments_introduction.php
+++ b/main/inc/lib/fckeditor/toolbars/extended/assessments_introduction.php
@@ -9,18 +9,16 @@
// This is the visible toolbar set when the editor has "normal" size.
$config['ToolbarSets']['Normal'] = array(
- array('FitWindow','Save','Preview'),
- array('Bold','Italic','Underline'),
- array('OrderedList','UnorderedList','-','Outdent','Indent'),
- array('JustifyLeft','JustifyCenter','JustifyRight'),
- array('Undo','Redo','-','Find','-','SelectAll','RemoveFormat'),
- array('Link','Unlink'),
- array('Image','Flash'),
- '/',
- array('Style','FontFormat','FontName','FontSize'),
- array('TextColor','BGColor'),
- array('Rule','Table','SpecialChar'),
- array('Source')
+ array('Save','FitWindow','-','PasteWord','-','Undo','Redo'),
+ array('Link','Unlink','Anchor'),
+ array('Image','flvPlayer','Flash','EmbedMovies','YouTube','MP3','mimetex'),
+ array('Table','SpecialChar'),
+ array('OrderedList','UnorderedList','-','Outdent','Indent','-','TextColor','BGColor'),
+ '/',
+ array('Style','FontFormat','FontName','FontSize'),
+ array('Bold','Italic','Underline'),
+ array('Subscript','Superscript','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'),
+ array('Source')
);
// This is the visible toolbar set when the editor is maximized.
diff --git a/main/inc/lib/fckeditor/toolbars/extended/documents.php b/main/inc/lib/fckeditor/toolbars/extended/documents.php
index 8764f393fd..e0995b36d4 100755
--- a/main/inc/lib/fckeditor/toolbars/extended/documents.php
+++ b/main/inc/lib/fckeditor/toolbars/extended/documents.php
@@ -9,18 +9,15 @@
// This is the visible toolbar set when the editor has "normal" size.
$config['ToolbarSets']['Normal'] = array(
- array('FitWindow','Save','Preview'),
- array('Bold','Italic','Underline'),
- array('OrderedList','UnorderedList','-','Outdent','Indent'),
- array('JustifyLeft','JustifyCenter','JustifyRight'),
- array('Undo','Redo','-','Find','-','SelectAll','RemoveFormat'),
- array('Link','Unlink','Glossary'),
- array('Image','Flash'),
+ array('Save','FitWindow','PasteWord','-','Undo','Redo'),
+ array('Link','Unlink','Anchor','Glossary'),
+ array('Image','flvPlayer','Flash','EmbedMovies','YouTube','MP3','mimetex','asciimath'),
+ array('Table','SpecialChar'),
+ array('Outdent','Indent','-','TextColor','BGColor','-','OrderedList','UnorderedList','-','Source'),
'/',
array('Style','FontFormat','FontName','FontSize'),
- array('TextColor','BGColor'),
- array('Rule','Table','SpecialChar','mimetex','asciimath'),
- array('Source')
+ array('Bold','Italic','Underline'),
+ array('JustifyLeft','JustifyCenter','JustifyRight')
);
// This is the visible toolbar set when the editor is maximized.
diff --git a/main/inc/lib/fckeditor/toolbars/extended/documents_student.php b/main/inc/lib/fckeditor/toolbars/extended/documents_student.php
index 43fab324d9..0fa041e61a 100755
--- a/main/inc/lib/fckeditor/toolbars/extended/documents_student.php
+++ b/main/inc/lib/fckeditor/toolbars/extended/documents_student.php
@@ -9,17 +9,16 @@
// This is the visible toolbar set when the editor has "normal" size.
$config['ToolbarSets']['Normal'] = array(
- array('FitWindow','Save','Preview'),
- array('Bold','Italic','Underline'),
- array('OrderedList','UnorderedList','-','Outdent','Indent'),
- array('JustifyLeft','JustifyCenter','JustifyRight'),
- array('Undo','Redo','-','Find','-','SelectAll','RemoveFormat'),
- array('Link','Unlink','Glossary'),
- array('Image','Flash'),
+ array('Save','FitWindow','PasteWord','-','Undo','Redo'),
+ array('Link','Unlink','Anchor'),
+ array('Image','flvPlayer','Flash','EmbedMovies','YouTube','MP3','mimetex','asciimath'),
+ array('Table','SpecialChar'),
+ array('Outdent','Indent','-','TextColor','BGColor','-','OrderedList','UnorderedList'),
'/',
array('Style','FontFormat','FontName','FontSize'),
- array('TextColor','BGColor'),
- array('Rule','Table','SpecialChar','mimetex','asciimath')
+ array('Bold','Italic','Underline'),
+ array('JustifyLeft','JustifyCenter','JustifyRight'),
+ array('ShowBlocks')
);
// This is the visible toolbar set when the editor is maximized.
diff --git a/main/inc/lib/fckeditor/toolbars/extended/faq.php b/main/inc/lib/fckeditor/toolbars/extended/faq.php
index 874e6d13ad..83134dfee5 100755
--- a/main/inc/lib/fckeditor/toolbars/extended/faq.php
+++ b/main/inc/lib/fckeditor/toolbars/extended/faq.php
@@ -7,7 +7,16 @@
// For more information: http://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide/Configuration/Configuration_Options
// This is the visible toolbar set when the editor has "normal" size.
+
$config['ToolbarSets']['Normal'] = array(
+ array('Save','Preview','Source')
+);
+
+
+// This is the visible toolbar set when the editor is maximized.
+// If it has not been defined, then the toolbar set for the "normal" size is used.
+
+$config['ToolbarSets']['Maximized'] = array(
//array('FitWindow','Save'),
array('Save'),
array('Bold','Italic','Underline'),
@@ -16,13 +25,6 @@ $config['ToolbarSets']['Normal'] = array(
array('Link','Unlink')
);
-// This is the visible toolbar set when the editor is maximized.
-// If it has not been defined, then the toolbar set for the "normal" size is used.
-/*
-$config['ToolbarSets']['Maximized'] = array(
- array('FitWindow','-') // ...
-);
-*/
// Sets whether the toolbar can be collapsed/expanded or not.
// Possible values: true , false
diff --git a/main/inc/lib/fckeditor/toolbars/extended/forum.php b/main/inc/lib/fckeditor/toolbars/extended/forum.php
index 689dccb4b8..21cb1371fc 100755
--- a/main/inc/lib/fckeditor/toolbars/extended/forum.php
+++ b/main/inc/lib/fckeditor/toolbars/extended/forum.php
@@ -9,18 +9,15 @@
// This is the visible toolbar set when the editor has "normal" size.
$config['ToolbarSets']['Normal'] = array(
- array('FitWindow','Save','Preview'),
- array('Bold','Italic','Underline'),
- array('OrderedList','UnorderedList','-','Outdent','Indent'),
- array('JustifyLeft','JustifyCenter','JustifyRight'),
- array('Undo','Redo','-','Find','-','SelectAll','RemoveFormat'),
- array('Link','Unlink'),
- array('Image','Flash'),
- '/',
- array('Style','FontFormat','FontName','FontSize'),
- array('TextColor','BGColor'),
- array('Rule','Table','SpecialChar','mimetex'),
- array('Source')
+ array('Save','FitWindow','PasteWord','-','Undo','Redo'),
+ array('Link','Unlink','Anchor'),
+ array('Image','flvPlayer','Flash','EmbedMovies','YouTube','MP3','mimetex'),
+ array('Table','SpecialChar'),
+ array('OrderedList','UnorderedList','-','Outdent','Indent','-','TextColor','BGColor','Source'),
+ '/',
+ array('Style','FontFormat','FontName','FontSize'),
+ array('Bold','Italic','Underline'),
+ array('JustifyLeft','JustifyCenter','JustifyRight')
);
// This is the visible toolbar set when the editor is maximized.
diff --git a/main/inc/lib/fckeditor/toolbars/extended/forum_student.php b/main/inc/lib/fckeditor/toolbars/extended/forum_student.php
index bd4dc416ae..00c1017baf 100755
--- a/main/inc/lib/fckeditor/toolbars/extended/forum_student.php
+++ b/main/inc/lib/fckeditor/toolbars/extended/forum_student.php
@@ -9,17 +9,16 @@
// This is the visible toolbar set when the editor has "normal" size.
$config['ToolbarSets']['Normal'] = array(
- array('FitWindow','Save','Preview'),
- array('Bold','Italic','Underline'),
- array('OrderedList','UnorderedList','-','Outdent','Indent'),
- array('JustifyLeft','JustifyCenter','JustifyRight'),
- array('Undo','Redo','-','Find','-','SelectAll','RemoveFormat'),
- array('Link','Unlink'),
- array('Image','Flash'),
- '/',
- array('Style','FontFormat','FontName','FontSize'),
- array('TextColor','BGColor'),
- array('Rule','Table','SpecialChar','mimetex')
+ array('Save','FitWindow','PasteWord','-','Undo','Redo'),
+ array('Link','Unlink','Anchor'),
+ array('Image','flvPlayer','Flash','EmbedMovies','YouTube','MP3','mimetex'),
+ array('Table','SpecialChar'),
+ array('OrderedList','UnorderedList','-','Outdent','Indent','-','TextColor','BGColor'),
+ '/',
+ array('Style','FontFormat','FontName','FontSize'),
+ array('Bold','Italic','Underline'),
+ array('JustifyLeft','JustifyCenter','JustifyRight'),
+ array('ShowBlocks')
);
// This is the visible toolbar set when the editor is maximized.
diff --git a/main/inc/lib/fckeditor/toolbars/extended/global_agenda.php b/main/inc/lib/fckeditor/toolbars/extended/global_agenda.php
index 8cd665d505..1b7f74833a 100755
--- a/main/inc/lib/fckeditor/toolbars/extended/global_agenda.php
+++ b/main/inc/lib/fckeditor/toolbars/extended/global_agenda.php
@@ -9,15 +9,14 @@
// This is the visible toolbar set when the editor has "normal" size.
$config['ToolbarSets']['Normal'] = array(
- array('FitWindow','Save','Preview'),
- array('Bold','Italic','Underline'),
- array('OrderedList','UnorderedList','-','Outdent','Indent'),
- array('JustifyLeft','JustifyCenter','JustifyRight'),
- array('Undo','Redo','-','SelectAll','RemoveFormat'),
+ array('FitWindow','-','PasteWord','-','Undo','Redo'),
array('Link','Unlink'),
- '/',
- array('Style','FontFormat','FontName','FontSize'),
- array('TextColor','BGColor')
+ array('Image','flvPlayer','Flash','EmbedMovies','YouTube','MP3','mimetex'),
+ array('Table','SpecialChar','googlemaps'),
+ array('FontName','FontSize'),
+ array('Bold','Italic','Underline'),
+ array('OrderedList','UnorderedList','-','TextColor','BGColor'),
+ array('Source')
);
// This is the visible toolbar set when the editor is maximized.
diff --git a/main/inc/lib/fckeditor/toolbars/extended/glossary.php b/main/inc/lib/fckeditor/toolbars/extended/glossary.php
index 5fe491dabe..2caa4bdca1 100755
--- a/main/inc/lib/fckeditor/toolbars/extended/glossary.php
+++ b/main/inc/lib/fckeditor/toolbars/extended/glossary.php
@@ -9,18 +9,15 @@
// This is the visible toolbar set when the editor has "normal" size.
$config['ToolbarSets']['Normal'] = array(
- array('FitWindow','Save','Preview'),
- array('Bold','Italic','Underline'),
- array('OrderedList','UnorderedList','-','Outdent','Indent'),
- array('JustifyLeft','JustifyCenter','JustifyRight'),
- array('Undo','Redo','-','Find','-','SelectAll','RemoveFormat'),
- array('Link','Unlink'),
- array('Image','Flash'),
- '/',
- array('Style','FontFormat','FontName','FontSize'),
- array('TextColor','BGColor'),
- array('Rule','Table','SpecialChar','mimetex'),
- array('Source')
+ array('Save','FitWindow','PasteWord','-','Undo','Redo'),
+ array('Link','Unlink','Anchor'),
+ array('Image','flvPlayer','Flash','EmbedMovies','YouTube','MP3','mimetex'),
+ array('Table','SpecialChar'),
+ array('OrderedList','UnorderedList','-','Outdent','Indent','-','TextColor','BGColor','-','Source'),
+ '/',
+ array('Style','FontFormat','FontName','FontSize'),
+ array('Bold','Italic','Underline'),
+ array('JustifyLeft','JustifyCenter','JustifyRight')
);
// This is the visible toolbar set when the editor is maximized.
diff --git a/main/inc/lib/fckeditor/toolbars/extended/introduction.php b/main/inc/lib/fckeditor/toolbars/extended/introduction.php
index 89a6ae8573..655e594707 100755
--- a/main/inc/lib/fckeditor/toolbars/extended/introduction.php
+++ b/main/inc/lib/fckeditor/toolbars/extended/introduction.php
@@ -9,18 +9,15 @@
// This is the visible toolbar set when the editor has "normal" size.
$config['ToolbarSets']['Normal'] = array(
- array('FitWindow','Save','Preview'),
- array('Bold','Italic','Underline'),
- array('OrderedList','UnorderedList','-','Outdent','Indent'),
- array('JustifyLeft','JustifyCenter','JustifyRight'),
- array('Undo','Redo','-','Find','-','SelectAll','RemoveFormat'),
- array('Link','Unlink'),
- array('Image','Flash'),
+ array('NewPage','FitWindow','-','PasteWord','-','Undo','Redo','-','SelectAll'),
+ array('Link','Unlink','Anchor'),
+ array('Image','flvPlayer','Flash','EmbedMovies','YouTube','MP3','mimetex'),
+ array('Table','SpecialChar'),
+ array('OrderedList','UnorderedList','-','Outdent','Indent','-','TextColor','BGColor','-','Source'),
'/',
array('Style','FontFormat','FontName','FontSize'),
- array('TextColor','BGColor'),
- array('Rule','Table','SpecialChar'),
- array('Source')
+ array('Bold','Italic','Underline'),
+ array('JustifyLeft','JustifyCenter','JustifyRight')
);
// This is the visible toolbar set when the editor is maximized.
diff --git a/main/inc/lib/fckeditor/toolbars/extended/learning_path_author.php b/main/inc/lib/fckeditor/toolbars/extended/learning_path_author.php
index f5d2bbc484..bba97ea486 100755
--- a/main/inc/lib/fckeditor/toolbars/extended/learning_path_author.php
+++ b/main/inc/lib/fckeditor/toolbars/extended/learning_path_author.php
@@ -9,11 +9,7 @@
// This is the visible toolbar set when the editor has "normal" size.
$config['ToolbarSets']['Normal'] = array(
- array('FitWindow'),
- array('Bold','Italic','Underline'),
- array('Undo','Redo'),
- array('TextColor','BGColor'),
- array('Link','Unlink')
+ array('Link','Unlink','Bold','Italic','TextColor','BGColor','Source')
);
// This is the visible toolbar set when the editor is maximized.
diff --git a/main/inc/lib/fckeditor/toolbars/extended/learning_path_documents.php b/main/inc/lib/fckeditor/toolbars/extended/learning_path_documents.php
index ee9a183fed..a27e5701a5 100755
--- a/main/inc/lib/fckeditor/toolbars/extended/learning_path_documents.php
+++ b/main/inc/lib/fckeditor/toolbars/extended/learning_path_documents.php
@@ -9,19 +9,14 @@
// This is the visible toolbar set when the editor has "normal" size.
$config['ToolbarSets']['Normal'] = array(
- array('FitWindow','Save','Preview'),
- array('Bold','Italic','Underline'),
- array('OrderedList','UnorderedList','-','Outdent','Indent'),
- array('JustifyLeft','JustifyCenter','JustifyRight'),
- array('Undo','Redo','-','Find','-','SelectAll','RemoveFormat'),
- array('Link','Unlink','Glossary'),
- array('Image','Flash'),
+ array('PasteWord','-','Undo','Redo'),
+ array('Link','Unlink','Anchor','Glossary'),
+ array('Image','flvPlayer','Flash','EmbedMovies','YouTube','MP3','mimetex','asciimath','Table','SpecialChar'),
+ array('Outdent','Indent','TextColor','BGColor','-','OrderedList','UnorderedList','JustifyLeft','JustifyCenter','JustifyRight'),
'/',
array('Style','FontFormat','FontName','FontSize'),
- array('TextColor','BGColor'),
- array('Rule','Table','SpecialChar','mimetex','asciimath'),
- array('Source')
-);
+ array('Bold','Italic','Underline','-','Source'),
+);//save, FitWindow don't run well here
// This is the visible toolbar set when the editor is maximized.
// If it has not been defined, then the toolbar set for the "normal" size is used.
diff --git a/main/inc/lib/fckeditor/toolbars/extended/messages.php b/main/inc/lib/fckeditor/toolbars/extended/messages.php
index eccb9a83f3..7b32efc9c1 100755
--- a/main/inc/lib/fckeditor/toolbars/extended/messages.php
+++ b/main/inc/lib/fckeditor/toolbars/extended/messages.php
@@ -9,17 +9,15 @@
// This is the visible toolbar set when the editor has "normal" size.
$config['ToolbarSets']['Normal'] = array(
- array('FitWindow','Preview'),
- array('Bold','Italic','Underline'),
- array('OrderedList','UnorderedList','-','Outdent','Indent'),
- array('JustifyLeft','JustifyCenter','JustifyRight'),
- array('Undo','Redo','-','Find','-','SelectAll','RemoveFormat'),
- array('Link','Unlink'),
- array('Image','Flash'),
+ array('FitWindow','-','PasteWord','-','Undo','Redo'),
+ array('Link','Unlink','Anchor'),
+ array('Image','flvPlayer','Flash','EmbedMovies','YouTube','MP3','mimetex'),
+ array('Table','Smiley'),
'/',
- array('Style','FontFormat','FontName','FontSize'),
- array('TextColor','BGColor'),
- array('Rule','Table','SpecialChar','mimetex')
+ array('FontName','FontSize'),
+ array('Bold','Italic','Underline'),
+ array('JustifyLeft','JustifyCenter','-','OrderedList','UnorderedList','-','TextColor','BGColor'),
+ array('Source')
);
// This is the visible toolbar set when the editor is maximized.
diff --git a/main/inc/lib/fckeditor/toolbars/extended/notebook.php b/main/inc/lib/fckeditor/toolbars/extended/notebook.php
index 9cb2a53f50..2e93862a4e 100755
--- a/main/inc/lib/fckeditor/toolbars/extended/notebook.php
+++ b/main/inc/lib/fckeditor/toolbars/extended/notebook.php
@@ -9,18 +9,15 @@
// This is the visible toolbar set when the editor has "normal" size.
$config['ToolbarSets']['Normal'] = array(
- array('FitWindow','Save','Preview'),
- array('Bold','Italic','Underline'),
- array('OrderedList','UnorderedList','-','Outdent','Indent'),
- array('JustifyLeft','JustifyCenter','JustifyRight'),
- array('Undo','Redo','-','Find','-','SelectAll','RemoveFormat'),
- array('Link','Unlink'),
- array('Image','Flash'),
- '/',
- array('Style','FontFormat','FontName','FontSize'),
- array('TextColor','BGColor'),
- array('Rule','Table','SpecialChar','mimetex'),
- array('Source')
+ array('Save','FitWindow','-','PasteWord','-','Undo','Redo'),
+ array('Link','Unlink','Anchor'),
+ array('Image','flvPlayer','Flash','EmbedMovies','YouTube','MP3','mimetex'),
+ array('Table','SpecialChar'),
+ array('OrderedList','UnorderedList','-','Outdent','Indent','-','TextColor','BGColor','-','Source'),
+ '/',
+ array('Style','FontFormat','FontName','FontSize'),
+ array('Bold','Italic','Underline'),
+ array('JustifyLeft','JustifyCenter','JustifyRight')
);
// This is the visible toolbar set when the editor is maximized.
diff --git a/main/inc/lib/fckeditor/toolbars/extended/notebook_student.php b/main/inc/lib/fckeditor/toolbars/extended/notebook_student.php
index e96238bf44..8646a8d954 100755
--- a/main/inc/lib/fckeditor/toolbars/extended/notebook_student.php
+++ b/main/inc/lib/fckeditor/toolbars/extended/notebook_student.php
@@ -9,17 +9,16 @@
// This is the visible toolbar set when the editor has "normal" size.
$config['ToolbarSets']['Normal'] = array(
- array('FitWindow','Save','Preview'),
- array('Bold','Italic','Underline'),
- array('OrderedList','UnorderedList','-','Outdent','Indent'),
- array('JustifyLeft','JustifyCenter','JustifyRight'),
- array('Undo','Redo','-','Find','-','SelectAll','RemoveFormat'),
- array('Link','Unlink'),
- array('Image','Flash'),
- '/',
- array('Style','FontFormat','FontName','FontSize'),
- array('TextColor','BGColor'),
- array('Rule','Table','SpecialChar','mimetex')
+ array('Save','FitWindow','-','PasteWord','-','Undo','Redo'),
+ array('Link','Unlink','Anchor'),
+ array('Image','flvPlayer','Flash','EmbedMovies','YouTube','MP3','mimetex'),
+ array('Table','SpecialChar'),
+ array('OrderedList','UnorderedList','-','Outdent','Indent','-','TextColor','BGColor'),
+ '/',
+ array('Style','FontFormat','FontName','FontSize'),
+ array('Bold','Italic','Underline'),
+ array('JustifyLeft','JustifyCenter','JustifyRight'),
+ array('ShowBlocks')
);
// This is the visible toolbar set when the editor is maximized.
diff --git a/main/inc/lib/fckeditor/toolbars/extended/portal_home_page.php b/main/inc/lib/fckeditor/toolbars/extended/portal_home_page.php
index d61cee006b..634714bbb6 100755
--- a/main/inc/lib/fckeditor/toolbars/extended/portal_home_page.php
+++ b/main/inc/lib/fckeditor/toolbars/extended/portal_home_page.php
@@ -9,17 +9,14 @@
// This is the visible toolbar set when the editor has "normal" size.
$config['ToolbarSets']['Normal'] = array(
- array('FitWindow','Save','Preview'),
- array('Bold','Italic','Underline'),
- array('OrderedList','UnorderedList','-','Outdent','Indent'),
- array('JustifyLeft','JustifyCenter','JustifyRight'),
- array('Undo','Redo','-','Find','-','SelectAll','RemoveFormat'),
- array('Link','Unlink'),
- array('Image','Flash'),
+ array('NewPage','Templates','Save','Print','PageBreak','FitWindow','-','PasteWord','-','Undo','Redo','-','SelectAll','-','Find'),
+ array('Link','Unlink','Anchor'),
+ array('Image','flvPlayer','Flash','EmbedMovies','YouTube','MP3','mimetex'),
+ array('Table','Smiley','SpecialChar','googlemaps'),
'/',
- array('Style','FontFormat','FontName','FontSize'),
- array('TextColor','BGColor'),
- array('Rule','Table','SpecialChar'),
+ array('FontFormat','FontName','FontSize'),
+ array('Bold','Italic','Underline'),
+ array('JustifyLeft','JustifyCenter','JustifyRight','-','OrderedList','UnorderedList','-','Outdent','Indent','-','TextColor','BGColor'),
array('Source')
);
diff --git a/main/inc/lib/fckeditor/toolbars/extended/portal_news.php b/main/inc/lib/fckeditor/toolbars/extended/portal_news.php
index 5cfd2478e1..ac8ac67c89 100755
--- a/main/inc/lib/fckeditor/toolbars/extended/portal_news.php
+++ b/main/inc/lib/fckeditor/toolbars/extended/portal_news.php
@@ -9,18 +9,15 @@
// This is the visible toolbar set when the editor has "normal" size.
$config['ToolbarSets']['Normal'] = array(
- array('FitWindow','Save','Preview'),
- array('Bold','Italic','Underline'),
- array('OrderedList','UnorderedList','-','Outdent','Indent'),
- array('JustifyLeft','JustifyCenter','JustifyRight'),
- array('Undo','Redo','-','Find','-','SelectAll','RemoveFormat'),
- array('Link','Unlink'),
- array('Image','Flash'),
- '/',
- array('Style','FontFormat','FontName','FontSize'),
- array('TextColor','BGColor'),
- array('Rule','Table','SpecialChar'),
- array('Source')
+ array('Save','FitWindow','PasteWord','-','Undo','Redo'),
+ array('Link','Unlink','Anchor'),
+ array('Image','flvPlayer','Flash','EmbedMovies','YouTube','MP3','mimetex'),
+ array('Table','SpecialChar'),
+ array('OrderedList','UnorderedList','-','Outdent','Indent','-','TextColor','BGColor','-','Source'),
+ '/',
+ array('Style','FontFormat','FontName','FontSize'),
+ array('Bold','Italic','Underline'),
+ array('JustifyLeft','JustifyCenter','JustifyRight')
);
// This is the visible toolbar set when the editor is maximized.
diff --git a/main/inc/lib/fckeditor/toolbars/extended/profile.php b/main/inc/lib/fckeditor/toolbars/extended/profile.php
index 843ecca014..0427d8023e 100755
--- a/main/inc/lib/fckeditor/toolbars/extended/profile.php
+++ b/main/inc/lib/fckeditor/toolbars/extended/profile.php
@@ -9,13 +9,15 @@
// This is the visible toolbar set when the editor has "normal" size.
$config['ToolbarSets']['Normal'] = array(
- array('FitWindow'),
+ array('FitWindow','-','PasteWord','-','Undo','Redo'),
+ array('Link','Unlink','Anchor'),
+ array('Image','flvPlayer','Flash','EmbedMovies','YouTube','MP3','mimetex'),
+ array('Table','Smiley'),
+ '/',
+ array('FontName','FontSize'),
array('Bold','Italic','Underline'),
- array('OrderedList','UnorderedList'),
- array('JustifyLeft','JustifyCenter','JustifyRight'),
- array('Undo','Redo','-','SelectAll','RemoveFormat'),
- array('TextColor','BGColor'),
- array('Link','Unlink','SpecialChar')
+ array('JustifyLeft','JustifyCenter','-','OrderedList','UnorderedList','-','TextColor','BGColor'),
+ array('Source')
);
// This is the visible toolbar set when the editor is maximized.
diff --git a/main/inc/lib/fckeditor/toolbars/extended/project.php b/main/inc/lib/fckeditor/toolbars/extended/project.php
index ac29bd4c32..74ad295f56 100755
--- a/main/inc/lib/fckeditor/toolbars/extended/project.php
+++ b/main/inc/lib/fckeditor/toolbars/extended/project.php
@@ -9,15 +9,14 @@
// This is the visible toolbar set when the editor has "normal" size.
$config['ToolbarSets']['Normal'] = array(
- array('FitWindow','Save','Preview'),
+ array('FitWindow','-','PasteWord','-','Undo','Redo'),
+ array('Link','Unlink','Anchor'),
+ array('Image','flvPlayer','Flash','EmbedMovies','YouTube','MP3','mimetex'),
+ array('Table','googlemaps'),
+ array('FontName','FontSize'),
array('Bold','Italic','Underline'),
- array('OrderedList','UnorderedList','-','Outdent','Indent'),
- array('JustifyLeft','JustifyCenter','JustifyRight'),
- array('Undo','Redo','-','SelectAll','RemoveFormat'),
- array('Link','Unlink'),
- '/',
- array('Style','FontFormat','FontName','FontSize'),
- array('TextColor','BGColor')
+ array('JustifyLeft','JustifyCenter','-','OrderedList','UnorderedList','-','TextColor','BGColor'),
+ array('Source')
);
// This is the visible toolbar set when the editor is maximized.
diff --git a/main/inc/lib/fckeditor/toolbars/extended/project_comment.php b/main/inc/lib/fckeditor/toolbars/extended/project_comment.php
index 921c7db520..90c12dee83 100755
--- a/main/inc/lib/fckeditor/toolbars/extended/project_comment.php
+++ b/main/inc/lib/fckeditor/toolbars/extended/project_comment.php
@@ -9,15 +9,13 @@
// This is the visible toolbar set when the editor has "normal" size.
$config['ToolbarSets']['Normal'] = array(
- array('FitWindow','Save','Preview'),
- array('Bold','Italic','Underline'),
- array('OrderedList','UnorderedList','-','Outdent','Indent'),
- array('JustifyLeft','JustifyCenter','JustifyRight'),
- array('Undo','Redo','-','SelectAll','RemoveFormat'),
+ array('FitWindow','-','PasteWord','-','Undo','Redo'),
array('Link','Unlink'),
- '/',
- array('Style','FontFormat','FontName','FontSize'),
- array('TextColor','BGColor')
+ array('Image','flvPlayer','Flash','EmbedMovies','YouTube','MP3','mimetex'),
+ array('Table','googlemaps'),
+ array('Bold','Italic','Underline'),
+ array('JustifyLeft','JustifyCenter','-','OrderedList','UnorderedList','-','TextColor','BGColor'),
+ array('Source')
);
// This is the visible toolbar set when the editor is maximized.
diff --git a/main/inc/lib/fckeditor/toolbars/extended/project_comment_student.php b/main/inc/lib/fckeditor/toolbars/extended/project_comment_student.php
index bdb9e55436..854090519a 100755
--- a/main/inc/lib/fckeditor/toolbars/extended/project_comment_student.php
+++ b/main/inc/lib/fckeditor/toolbars/extended/project_comment_student.php
@@ -9,15 +9,13 @@
// This is the visible toolbar set when the editor has "normal" size.
$config['ToolbarSets']['Normal'] = array(
- array('FitWindow','Save','Preview'),
- array('Bold','Italic','Underline'),
- array('OrderedList','UnorderedList','-','Outdent','Indent'),
- array('JustifyLeft','JustifyCenter','JustifyRight'),
- array('Undo','Redo','-','SelectAll','RemoveFormat'),
+ array('FitWindow','-','PasteWord','-','Undo','Redo'),
array('Link','Unlink'),
- '/',
- array('Style','FontFormat','FontName','FontSize'),
- array('TextColor','BGColor')
+ array('Image','flvPlayer','Flash','EmbedMovies','YouTube','MP3','mimetex'),
+ array('Table','googlemaps'),
+ array('Bold','Italic','Underline'),
+ array('JustifyLeft','JustifyCenter','-','OrderedList','UnorderedList','-','TextColor','BGColor'),
+ array('ShowBlocks')
);
// This is the visible toolbar set when the editor is maximized.
diff --git a/main/inc/lib/fckeditor/toolbars/extended/project_student.php b/main/inc/lib/fckeditor/toolbars/extended/project_student.php
index 73abca9f8d..046520c592 100755
--- a/main/inc/lib/fckeditor/toolbars/extended/project_student.php
+++ b/main/inc/lib/fckeditor/toolbars/extended/project_student.php
@@ -9,15 +9,14 @@
// This is the visible toolbar set when the editor has "normal" size.
$config['ToolbarSets']['Normal'] = array(
- array('FitWindow','Save','Preview'),
+ array('FitWindow','-','PasteWord','-','Undo','Redo'),
+ array('Link','Unlink','Anchor'),
+ array('Image','flvPlayer','Flash','EmbedMovies','YouTube','MP3','mimetex'),
+ array('Table','googlemaps'),
+ array('FontName','FontSize'),
array('Bold','Italic','Underline'),
- array('OrderedList','UnorderedList','-','Outdent','Indent'),
- array('JustifyLeft','JustifyCenter','JustifyRight'),
- array('Undo','Redo','-','SelectAll','RemoveFormat'),
- array('Link','Unlink'),
- '/',
- array('Style','FontFormat','FontName','FontSize'),
- array('TextColor','BGColor')
+ array('JustifyLeft','JustifyCenter','-','OrderedList','UnorderedList','-','TextColor','BGColor'),
+ array('ShowBlocks')
);
// This is the visible toolbar set when the editor is maximized.
diff --git a/main/inc/lib/fckeditor/toolbars/extended/survey.php b/main/inc/lib/fckeditor/toolbars/extended/survey.php
index 5e6239d24a..e108df0624 100755
--- a/main/inc/lib/fckeditor/toolbars/extended/survey.php
+++ b/main/inc/lib/fckeditor/toolbars/extended/survey.php
@@ -10,14 +10,13 @@
// This is the visible toolbar set when the editor has "normal" size.
$config['ToolbarSets']['Normal'] = array(
array('FitWindow'),
- array('FontSize', 'Bold','Italic','Underline'),
- array('OrderedList','UnorderedList','-','Outdent','Indent'),
- array('JustifyLeft','JustifyCenter','JustifyRight'),
- array('Undo','Redo','-','SelectAll','RemoveFormat'),
- array('TextColor','BGColor'),
array('Link','Unlink'),
- array('Table','SpecialChar'),
- array('Image','Flash')
+ array('Image'),
+ array('Table'),
+ array('FontSize'),
+ array('Bold','Italic'),
+ array('OrderedList','UnorderedList','-','TextColor'),
+ array('Source')
);
// This is the visible toolbar set when the editor is maximized.
diff --git a/main/inc/lib/fckeditor/toolbars/extended/terms_and_conditions.php b/main/inc/lib/fckeditor/toolbars/extended/terms_and_conditions.php
new file mode 100644
index 0000000000..b28b2b60bf
--- /dev/null
+++ b/main/inc/lib/fckeditor/toolbars/extended/terms_and_conditions.php
@@ -0,0 +1,41 @@
+
diff --git a/main/inc/lib/fckeditor/toolbars/extended/test_answer_feedback.php b/main/inc/lib/fckeditor/toolbars/extended/test_answer_feedback.php
index 8e550c5fc3..4f7abd1e4f 100755
--- a/main/inc/lib/fckeditor/toolbars/extended/test_answer_feedback.php
+++ b/main/inc/lib/fckeditor/toolbars/extended/test_answer_feedback.php
@@ -9,11 +9,7 @@
// This is the visible toolbar set when the editor has "normal" size.
$config['ToolbarSets']['Normal'] = array(
- array('FitWindow'),
- array('Bold','Italic','Underline','-','Subscript','Superscript'),
- array('Undo','Redo'),
- array('TextColor','BGColor'),
- array('SpecialChar','mimetex')
+ array('Link','Unlink','Bold','Italic','TextColor','BGColor','mimetex')
);
// This is the visible toolbar set when the editor is maximized.
diff --git a/main/inc/lib/fckeditor/toolbars/extended/test_description.php b/main/inc/lib/fckeditor/toolbars/extended/test_description.php
index ddc36ca091..e372a7d20b 100755
--- a/main/inc/lib/fckeditor/toolbars/extended/test_description.php
+++ b/main/inc/lib/fckeditor/toolbars/extended/test_description.php
@@ -9,18 +9,15 @@
// This is the visible toolbar set when the editor has "normal" size.
$config['ToolbarSets']['Normal'] = array(
- array('FitWindow','Save','Preview'),
- array('Bold','Italic','Underline'),
- array('OrderedList','UnorderedList','-','Outdent','Indent'),
- array('JustifyLeft','JustifyCenter','JustifyRight'),
- array('Undo','Redo','-','Find','-','SelectAll','RemoveFormat'),
- array('Link','Unlink'),
- array('Image','Flash'),
- '/',
- array('Style','FontFormat','FontName','FontSize'),
- array('TextColor','BGColor'),
- array('Rule','Table','SpecialChar','mimetex'),
- array('Source')
+ array('FitWindow','-','PasteWord','-','Undo','Redo'),
+ array('Link','Unlink','Anchor'),
+ array('Image','flvPlayer','Flash','EmbedMovies','YouTube','MP3','mimetex'),
+ array('Table','SpecialChar'),
+ array('OrderedList','UnorderedList','-','Outdent','Indent','-','TextColor','BGColor','-','Source'),
+ '/',
+ array('Style','FontFormat','FontName','FontSize'),
+ array('Bold','Italic','Underline'),
+ array('JustifyLeft','JustifyCenter','JustifyRight')
);
// This is the visible toolbar set when the editor is maximized.
diff --git a/main/inc/lib/fckeditor/toolbars/extended/test_free_answer.php b/main/inc/lib/fckeditor/toolbars/extended/test_free_answer.php
index 65d96eb3cf..f611445ee1 100755
--- a/main/inc/lib/fckeditor/toolbars/extended/test_free_answer.php
+++ b/main/inc/lib/fckeditor/toolbars/extended/test_free_answer.php
@@ -9,11 +9,7 @@
// This is the visible toolbar set when the editor has "normal" size.
$config['ToolbarSets']['Normal'] = array(
- array('FitWindow'),
- array('Bold','Italic','Underline','-','Subscript','Superscript'),
- array('Undo','Redo'),
- array('TextColor','BGColor'),
- array('SpecialChar','mimetex')
+ array('FitWindow','Bold','Image','Link','PasteWord','MP3','mimetex','Table','Subscript','Superscript','ShowBlocks')
);
// This is the visible toolbar set when the editor is maximized.
diff --git a/main/inc/lib/fckeditor/toolbars/extended/test_proposed_answer.php b/main/inc/lib/fckeditor/toolbars/extended/test_proposed_answer.php
index ead03680b6..a7f8b03e7b 100755
--- a/main/inc/lib/fckeditor/toolbars/extended/test_proposed_answer.php
+++ b/main/inc/lib/fckeditor/toolbars/extended/test_proposed_answer.php
@@ -9,10 +9,7 @@
// This is the visible toolbar set when the editor has "normal" size.
$config['ToolbarSets']['Normal'] = array(
- array('FitWindow'),
- array('Bold','Italic','Underline','-','Subscript','Superscript'),
- array('Undo','Redo'),
- array('SpecialChar','mimetex')
+ array('FitWindow','Bold','Image','Link','PasteWord','MP3','mimetex','Table','Subscript','Superscript','Source')
);
// This is the visible toolbar set when the editor is maximized.
diff --git a/main/inc/lib/fckeditor/toolbars/extended/test_question_description.php b/main/inc/lib/fckeditor/toolbars/extended/test_question_description.php
index 0bcb17cf75..4bdd6d73ae 100755
--- a/main/inc/lib/fckeditor/toolbars/extended/test_question_description.php
+++ b/main/inc/lib/fckeditor/toolbars/extended/test_question_description.php
@@ -9,18 +9,15 @@
// This is the visible toolbar set when the editor has "normal" size.
$config['ToolbarSets']['Normal'] = array(
- array('FitWindow','Save','Preview'),
- array('Bold','Italic','Underline'),
- array('OrderedList','UnorderedList','-','Outdent','Indent'),
- array('JustifyLeft','JustifyCenter','JustifyRight'),
- array('Undo','Redo','-','Find','-','SelectAll','RemoveFormat'),
- array('Link','Unlink'),
- array('Image','Flash'),
- '/',
- array('Style','FontFormat','FontName','FontSize'),
- array('TextColor','BGColor'),
- array('Rule','Table','SpecialChar','mimetex'),
- array('Source')
+ array('FitWindow','-','PasteWord','-','Undo','Redo'),
+ array('Link','Unlink'),
+ array('Image','flvPlayer','Flash','EmbedMovies','YouTube','MP3','mimetex'),
+ array('Table','SpecialChar'),
+ array('OrderedList','UnorderedList','-','Outdent','Indent','-','TextColor','BGColor','-','Source'),
+ '/',
+ array('Style','FontFormat','FontName','FontSize'),
+ array('Bold','Italic','Underline'),
+ array('JustifyLeft','JustifyCenter','JustifyRight')
);
// This is the visible toolbar set when the editor is maximized.
diff --git a/main/inc/lib/fckeditor/toolbars/extended/training_description.php b/main/inc/lib/fckeditor/toolbars/extended/training_description.php
index 44050b1193..6a467c001a 100755
--- a/main/inc/lib/fckeditor/toolbars/extended/training_description.php
+++ b/main/inc/lib/fckeditor/toolbars/extended/training_description.php
@@ -9,18 +9,15 @@
// This is the visible toolbar set when the editor has "normal" size.
$config['ToolbarSets']['Normal'] = array(
- array('FitWindow','Save','Preview'),
- array('Bold','Italic','Underline'),
- array('OrderedList','UnorderedList','-','Outdent','Indent'),
- array('JustifyLeft','JustifyCenter','JustifyRight'),
- array('Undo','Redo','-','Find','-','SelectAll','RemoveFormat'),
- array('Link','Unlink'),
- array('Image','Flash'),
+ array('NewPage','Save','FitWindow','PasteWord','-','Undo','Redo'),
+ array('Link','Unlink','Anchor'),
+ array('Image','flvPlayer','Flash','EmbedMovies','YouTube','MP3','mimetex'),
+ array('Table','SpecialChar'),
+ array('OrderedList','UnorderedList','-','Outdent','Indent','-','TextColor','BGColor','Source'),
'/',
array('Style','FontFormat','FontName','FontSize'),
- array('TextColor','BGColor'),
- array('Rule','Table','SpecialChar'),
- array('Source')
+ array('Bold','Italic','Underline'),
+ array('JustifyLeft','JustifyCenter','JustifyRight')
);
// This is the visible toolbar set when the editor is maximized.
diff --git a/main/inc/lib/fckeditor/toolbars/extended/wiki.php b/main/inc/lib/fckeditor/toolbars/extended/wiki.php
index 71a4f73129..d35ea07212 100755
--- a/main/inc/lib/fckeditor/toolbars/extended/wiki.php
+++ b/main/inc/lib/fckeditor/toolbars/extended/wiki.php
@@ -9,17 +9,13 @@
// This is the visible toolbar set when the editor has "normal" size.
$config['ToolbarSets']['Normal'] = array(
- array('FitWindow','Save','Preview'),
+ array('NewPage','Templates','Save','PageBreak','Preview','FitWindow','-','PasteText','-','Undo','Redo','-','SelectAll','-','Find'),
+ array('Wikilink','Link','Unlink','Anchor'),
+ array('Image','flvPlayer','Flash','EmbedMovies','YouTube','MP3','mimetex','asciimath'),
+ array('Table','Smiley','SpecialChar','googlemaps'),
+ array('FontFormat','FontName','FontSize'),
array('Bold','Italic','Underline'),
- array('OrderedList','UnorderedList','-','Outdent','Indent'),
- array('JustifyLeft','JustifyCenter','JustifyRight'),
- array('Undo','Redo','-','Find','-','SelectAll','RemoveFormat'),
- array('Link','Unlink','Wikilink','Glossary'),
- array('Image','Flash'),
- '/',
- array('Style','FontFormat','FontName','FontSize'),
- array('TextColor','BGColor'),
- array('Rule','Table','SpecialChar','mimetex','asciimath'),
+ array('Subscript','Superscript','-','JustifyLeft','JustifyCenter','JustifyRight','-','OrderedList','UnorderedList','-','Outdent','Indent','-','TextColor','BGColor'),
array('Source')
);
diff --git a/main/inc/lib/fckeditor/toolbars/extended/wiki_student.php b/main/inc/lib/fckeditor/toolbars/extended/wiki_student.php
index 1c0d612c13..3c29126185 100755
--- a/main/inc/lib/fckeditor/toolbars/extended/wiki_student.php
+++ b/main/inc/lib/fckeditor/toolbars/extended/wiki_student.php
@@ -9,17 +9,14 @@
// This is the visible toolbar set when the editor has "normal" size.
$config['ToolbarSets']['Normal'] = array(
- array('FitWindow','Save','Preview'),
+ array('NewPage','Save','PageBreak','Preview','FitWindow','-','PasteText','-','Undo','Redo','-','SelectAll','-','Find'),
+ array('Wikilink','Link','Unlink','Anchor'),
+ array('Image','flvPlayer','Flash','EmbedMovies','YouTube','MP3','mimetex','asciimath'),
+ array('Table','Smiley','SpecialChar','googlemaps'),
+ array('FontFormat','FontName','FontSize'),
array('Bold','Italic','Underline'),
- array('OrderedList','UnorderedList','-','Outdent','Indent'),
- array('JustifyLeft','JustifyCenter','JustifyRight'),
- array('Undo','Redo','-','Find','-','SelectAll','RemoveFormat'),
- array('Link','Unlink','Wikilink','Glossary'),
- array('Image','Flash'),
- '/',
- array('Style','FontFormat','FontName','FontSize'),
- array('TextColor','BGColor'),
- array('Rule','Table','SpecialChar','mimetex','asciimath')
+ array('Subscript','Superscript','-','JustifyLeft','JustifyCenter','JustifyRight','-','OrderedList','UnorderedList','-','Outdent','Indent','-','TextColor','BGColor'),
+ array('ShowBlocks')
);
// This is the visible toolbar set when the editor is maximized.
diff --git a/main/inc/lib/fileUpload.lib.php b/main/inc/lib/fileUpload.lib.php
index b22e80b8f1..334e284ff3 100755
--- a/main/inc/lib/fileUpload.lib.php
+++ b/main/inc/lib/fileUpload.lib.php
@@ -248,8 +248,8 @@ function handle_uploaded_document($_course,$uploaded_file,$base_work_dir,$upload
}
else
{
- //clean up the name, only ASCII characters should stay.
- $clean_name = replace_dangerous_char($uploaded_file['name']);
+ //clean up the name, only ASCII characters should stay. (and strict)
+ $clean_name = replace_dangerous_char($uploaded_file['name'], 'strict');
//no "dangerous" files
$clean_name = disable_dangerous_file($clean_name);
if(!filter_extension($clean_name))
@@ -703,7 +703,7 @@ function treat_uploaded_file($uploadedFile, $baseWorkDir, $uploadPath, $maxFille
$fileName = trim($uploadedFile['name']);
// CHECK FOR NO DESIRED CHARACTERS
- $fileName = replace_dangerous_char($fileName);
+ $fileName = replace_dangerous_char($fileName, 'strict');
// TRY TO ADD AN EXTENSION TO FILES WITOUT EXTENSION
$fileName = add_ext_on_mime($fileName,$uploadedFile['type']);
@@ -1875,7 +1875,7 @@ $handle=opendir($path);
else
{
//rename
- $safe_file=disable_dangerous_file(replace_dangerous_char($file));
+ $safe_file=disable_dangerous_file(replace_dangerous_char($file, 'strict'));
@rename($base_work_dir.$current_path.'/'.$file,$base_work_dir.$current_path.'/'.$safe_file);
if(!DocumentManager::get_document_id($_course, $current_path.'/'.$safe_file))
diff --git a/main/inc/lib/html2pdf/_fpdf/font/courier.php b/main/inc/lib/html2pdf/_fpdf/font/courier.php
index 4c009f39b4..913f9a4533 100755
--- a/main/inc/lib/html2pdf/_fpdf/font/courier.php
+++ b/main/inc/lib/html2pdf/_fpdf/font/courier.php
@@ -1,7 +1,7 @@
-
+
diff --git a/main/inc/lib/html2pdf/_fpdf/font/helvetica.php b/main/inc/lib/html2pdf/_fpdf/font/helvetica.php
index 8fa7683e7c..ca94cdf21a 100755
--- a/main/inc/lib/html2pdf/_fpdf/font/helvetica.php
+++ b/main/inc/lib/html2pdf/_fpdf/font/helvetica.php
@@ -1,15 +1,15 @@
-278,chr(1)=>278,chr(2)=>278,chr(3)=>278,chr(4)=>278,chr(5)=>278,chr(6)=>278,chr(7)=>278,chr(8)=>278,chr(9)=>278,chr(10)=>278,chr(11)=>278,chr(12)=>278,chr(13)=>278,chr(14)=>278,chr(15)=>278,chr(16)=>278,chr(17)=>278,chr(18)=>278,chr(19)=>278,chr(20)=>278,chr(21)=>278,
- chr(22)=>278,chr(23)=>278,chr(24)=>278,chr(25)=>278,chr(26)=>278,chr(27)=>278,chr(28)=>278,chr(29)=>278,chr(30)=>278,chr(31)=>278,' '=>278,'!'=>278,'"'=>355,'#'=>556,'$'=>556,'%'=>889,'&'=>667,'\''=>191,'('=>333,')'=>333,'*'=>389,'+'=>584,
- ','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>278,';'=>278,'<'=>584,'='=>584,'>'=>584,'?'=>556,'@'=>1015,'A'=>667,
- 'B'=>667,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>500,'K'=>667,'L'=>556,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944,
- 'X'=>667,'Y'=>667,'Z'=>611,'['=>278,'\\'=>278,']'=>278,'^'=>469,'_'=>556,'`'=>333,'a'=>556,'b'=>556,'c'=>500,'d'=>556,'e'=>556,'f'=>278,'g'=>556,'h'=>556,'i'=>222,'j'=>222,'k'=>500,'l'=>222,'m'=>833,
- 'n'=>556,'o'=>556,'p'=>556,'q'=>556,'r'=>333,'s'=>500,'t'=>278,'u'=>556,'v'=>500,'w'=>722,'x'=>500,'y'=>500,'z'=>500,'{'=>334,'|'=>260,'}'=>334,'~'=>584,chr(127)=>350,chr(128)=>556,chr(129)=>350,chr(130)=>222,chr(131)=>556,
- chr(132)=>333,chr(133)=>1000,chr(134)=>556,chr(135)=>556,chr(136)=>333,chr(137)=>1000,chr(138)=>667,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>222,chr(146)=>222,chr(147)=>333,chr(148)=>333,chr(149)=>350,chr(150)=>556,chr(151)=>1000,chr(152)=>333,chr(153)=>1000,
- chr(154)=>500,chr(155)=>333,chr(156)=>944,chr(157)=>350,chr(158)=>500,chr(159)=>667,chr(160)=>278,chr(161)=>333,chr(162)=>556,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>260,chr(167)=>556,chr(168)=>333,chr(169)=>737,chr(170)=>370,chr(171)=>556,chr(172)=>584,chr(173)=>333,chr(174)=>737,chr(175)=>333,
- chr(176)=>400,chr(177)=>584,chr(178)=>333,chr(179)=>333,chr(180)=>333,chr(181)=>556,chr(182)=>537,chr(183)=>278,chr(184)=>333,chr(185)=>333,chr(186)=>365,chr(187)=>556,chr(188)=>834,chr(189)=>834,chr(190)=>834,chr(191)=>611,chr(192)=>667,chr(193)=>667,chr(194)=>667,chr(195)=>667,chr(196)=>667,chr(197)=>667,
- chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722,
- chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>500,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>556,chr(241)=>556,
- chr(242)=>556,chr(243)=>556,chr(244)=>556,chr(245)=>556,chr(246)=>556,chr(247)=>584,chr(248)=>611,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>500,chr(254)=>556,chr(255)=>500);
-?>
+278,chr(1)=>278,chr(2)=>278,chr(3)=>278,chr(4)=>278,chr(5)=>278,chr(6)=>278,chr(7)=>278,chr(8)=>278,chr(9)=>278,chr(10)=>278,chr(11)=>278,chr(12)=>278,chr(13)=>278,chr(14)=>278,chr(15)=>278,chr(16)=>278,chr(17)=>278,chr(18)=>278,chr(19)=>278,chr(20)=>278,chr(21)=>278,
+ chr(22)=>278,chr(23)=>278,chr(24)=>278,chr(25)=>278,chr(26)=>278,chr(27)=>278,chr(28)=>278,chr(29)=>278,chr(30)=>278,chr(31)=>278,' '=>278,'!'=>278,'"'=>355,'#'=>556,'$'=>556,'%'=>889,'&'=>667,'\''=>191,'('=>333,')'=>333,'*'=>389,'+'=>584,
+ ','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>278,';'=>278,'<'=>584,'='=>584,'>'=>584,'?'=>556,'@'=>1015,'A'=>667,
+ 'B'=>667,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>500,'K'=>667,'L'=>556,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944,
+ 'X'=>667,'Y'=>667,'Z'=>611,'['=>278,'\\'=>278,']'=>278,'^'=>469,'_'=>556,'`'=>333,'a'=>556,'b'=>556,'c'=>500,'d'=>556,'e'=>556,'f'=>278,'g'=>556,'h'=>556,'i'=>222,'j'=>222,'k'=>500,'l'=>222,'m'=>833,
+ 'n'=>556,'o'=>556,'p'=>556,'q'=>556,'r'=>333,'s'=>500,'t'=>278,'u'=>556,'v'=>500,'w'=>722,'x'=>500,'y'=>500,'z'=>500,'{'=>334,'|'=>260,'}'=>334,'~'=>584,chr(127)=>350,chr(128)=>556,chr(129)=>350,chr(130)=>222,chr(131)=>556,
+ chr(132)=>333,chr(133)=>1000,chr(134)=>556,chr(135)=>556,chr(136)=>333,chr(137)=>1000,chr(138)=>667,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>222,chr(146)=>222,chr(147)=>333,chr(148)=>333,chr(149)=>350,chr(150)=>556,chr(151)=>1000,chr(152)=>333,chr(153)=>1000,
+ chr(154)=>500,chr(155)=>333,chr(156)=>944,chr(157)=>350,chr(158)=>500,chr(159)=>667,chr(160)=>278,chr(161)=>333,chr(162)=>556,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>260,chr(167)=>556,chr(168)=>333,chr(169)=>737,chr(170)=>370,chr(171)=>556,chr(172)=>584,chr(173)=>333,chr(174)=>737,chr(175)=>333,
+ chr(176)=>400,chr(177)=>584,chr(178)=>333,chr(179)=>333,chr(180)=>333,chr(181)=>556,chr(182)=>537,chr(183)=>278,chr(184)=>333,chr(185)=>333,chr(186)=>365,chr(187)=>556,chr(188)=>834,chr(189)=>834,chr(190)=>834,chr(191)=>611,chr(192)=>667,chr(193)=>667,chr(194)=>667,chr(195)=>667,chr(196)=>667,chr(197)=>667,
+ chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722,
+ chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>500,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>556,chr(241)=>556,
+ chr(242)=>556,chr(243)=>556,chr(244)=>556,chr(245)=>556,chr(246)=>556,chr(247)=>584,chr(248)=>611,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>500,chr(254)=>556,chr(255)=>500);
+?>
diff --git a/main/inc/lib/html2pdf/_fpdf/font/helveticab.php b/main/inc/lib/html2pdf/_fpdf/font/helveticab.php
index a8473c94d7..276cfa8cb8 100755
--- a/main/inc/lib/html2pdf/_fpdf/font/helveticab.php
+++ b/main/inc/lib/html2pdf/_fpdf/font/helveticab.php
@@ -1,15 +1,15 @@
-278,chr(1)=>278,chr(2)=>278,chr(3)=>278,chr(4)=>278,chr(5)=>278,chr(6)=>278,chr(7)=>278,chr(8)=>278,chr(9)=>278,chr(10)=>278,chr(11)=>278,chr(12)=>278,chr(13)=>278,chr(14)=>278,chr(15)=>278,chr(16)=>278,chr(17)=>278,chr(18)=>278,chr(19)=>278,chr(20)=>278,chr(21)=>278,
- chr(22)=>278,chr(23)=>278,chr(24)=>278,chr(25)=>278,chr(26)=>278,chr(27)=>278,chr(28)=>278,chr(29)=>278,chr(30)=>278,chr(31)=>278,' '=>278,'!'=>333,'"'=>474,'#'=>556,'$'=>556,'%'=>889,'&'=>722,'\''=>238,'('=>333,')'=>333,'*'=>389,'+'=>584,
- ','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>333,';'=>333,'<'=>584,'='=>584,'>'=>584,'?'=>611,'@'=>975,'A'=>722,
- 'B'=>722,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>556,'K'=>722,'L'=>611,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944,
- 'X'=>667,'Y'=>667,'Z'=>611,'['=>333,'\\'=>278,']'=>333,'^'=>584,'_'=>556,'`'=>333,'a'=>556,'b'=>611,'c'=>556,'d'=>611,'e'=>556,'f'=>333,'g'=>611,'h'=>611,'i'=>278,'j'=>278,'k'=>556,'l'=>278,'m'=>889,
- 'n'=>611,'o'=>611,'p'=>611,'q'=>611,'r'=>389,'s'=>556,'t'=>333,'u'=>611,'v'=>556,'w'=>778,'x'=>556,'y'=>556,'z'=>500,'{'=>389,'|'=>280,'}'=>389,'~'=>584,chr(127)=>350,chr(128)=>556,chr(129)=>350,chr(130)=>278,chr(131)=>556,
- chr(132)=>500,chr(133)=>1000,chr(134)=>556,chr(135)=>556,chr(136)=>333,chr(137)=>1000,chr(138)=>667,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>278,chr(146)=>278,chr(147)=>500,chr(148)=>500,chr(149)=>350,chr(150)=>556,chr(151)=>1000,chr(152)=>333,chr(153)=>1000,
- chr(154)=>556,chr(155)=>333,chr(156)=>944,chr(157)=>350,chr(158)=>500,chr(159)=>667,chr(160)=>278,chr(161)=>333,chr(162)=>556,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>280,chr(167)=>556,chr(168)=>333,chr(169)=>737,chr(170)=>370,chr(171)=>556,chr(172)=>584,chr(173)=>333,chr(174)=>737,chr(175)=>333,
- chr(176)=>400,chr(177)=>584,chr(178)=>333,chr(179)=>333,chr(180)=>333,chr(181)=>611,chr(182)=>556,chr(183)=>278,chr(184)=>333,chr(185)=>333,chr(186)=>365,chr(187)=>556,chr(188)=>834,chr(189)=>834,chr(190)=>834,chr(191)=>611,chr(192)=>722,chr(193)=>722,chr(194)=>722,chr(195)=>722,chr(196)=>722,chr(197)=>722,
- chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722,
- chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>556,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>611,chr(241)=>611,
- chr(242)=>611,chr(243)=>611,chr(244)=>611,chr(245)=>611,chr(246)=>611,chr(247)=>584,chr(248)=>611,chr(249)=>611,chr(250)=>611,chr(251)=>611,chr(252)=>611,chr(253)=>556,chr(254)=>611,chr(255)=>556);
-?>
+278,chr(1)=>278,chr(2)=>278,chr(3)=>278,chr(4)=>278,chr(5)=>278,chr(6)=>278,chr(7)=>278,chr(8)=>278,chr(9)=>278,chr(10)=>278,chr(11)=>278,chr(12)=>278,chr(13)=>278,chr(14)=>278,chr(15)=>278,chr(16)=>278,chr(17)=>278,chr(18)=>278,chr(19)=>278,chr(20)=>278,chr(21)=>278,
+ chr(22)=>278,chr(23)=>278,chr(24)=>278,chr(25)=>278,chr(26)=>278,chr(27)=>278,chr(28)=>278,chr(29)=>278,chr(30)=>278,chr(31)=>278,' '=>278,'!'=>333,'"'=>474,'#'=>556,'$'=>556,'%'=>889,'&'=>722,'\''=>238,'('=>333,')'=>333,'*'=>389,'+'=>584,
+ ','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>333,';'=>333,'<'=>584,'='=>584,'>'=>584,'?'=>611,'@'=>975,'A'=>722,
+ 'B'=>722,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>556,'K'=>722,'L'=>611,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944,
+ 'X'=>667,'Y'=>667,'Z'=>611,'['=>333,'\\'=>278,']'=>333,'^'=>584,'_'=>556,'`'=>333,'a'=>556,'b'=>611,'c'=>556,'d'=>611,'e'=>556,'f'=>333,'g'=>611,'h'=>611,'i'=>278,'j'=>278,'k'=>556,'l'=>278,'m'=>889,
+ 'n'=>611,'o'=>611,'p'=>611,'q'=>611,'r'=>389,'s'=>556,'t'=>333,'u'=>611,'v'=>556,'w'=>778,'x'=>556,'y'=>556,'z'=>500,'{'=>389,'|'=>280,'}'=>389,'~'=>584,chr(127)=>350,chr(128)=>556,chr(129)=>350,chr(130)=>278,chr(131)=>556,
+ chr(132)=>500,chr(133)=>1000,chr(134)=>556,chr(135)=>556,chr(136)=>333,chr(137)=>1000,chr(138)=>667,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>278,chr(146)=>278,chr(147)=>500,chr(148)=>500,chr(149)=>350,chr(150)=>556,chr(151)=>1000,chr(152)=>333,chr(153)=>1000,
+ chr(154)=>556,chr(155)=>333,chr(156)=>944,chr(157)=>350,chr(158)=>500,chr(159)=>667,chr(160)=>278,chr(161)=>333,chr(162)=>556,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>280,chr(167)=>556,chr(168)=>333,chr(169)=>737,chr(170)=>370,chr(171)=>556,chr(172)=>584,chr(173)=>333,chr(174)=>737,chr(175)=>333,
+ chr(176)=>400,chr(177)=>584,chr(178)=>333,chr(179)=>333,chr(180)=>333,chr(181)=>611,chr(182)=>556,chr(183)=>278,chr(184)=>333,chr(185)=>333,chr(186)=>365,chr(187)=>556,chr(188)=>834,chr(189)=>834,chr(190)=>834,chr(191)=>611,chr(192)=>722,chr(193)=>722,chr(194)=>722,chr(195)=>722,chr(196)=>722,chr(197)=>722,
+ chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722,
+ chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>556,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>611,chr(241)=>611,
+ chr(242)=>611,chr(243)=>611,chr(244)=>611,chr(245)=>611,chr(246)=>611,chr(247)=>584,chr(248)=>611,chr(249)=>611,chr(250)=>611,chr(251)=>611,chr(252)=>611,chr(253)=>556,chr(254)=>611,chr(255)=>556);
+?>
diff --git a/main/inc/lib/html2pdf/_fpdf/font/helveticabi.php b/main/inc/lib/html2pdf/_fpdf/font/helveticabi.php
index 41379537dc..8d21774325 100755
--- a/main/inc/lib/html2pdf/_fpdf/font/helveticabi.php
+++ b/main/inc/lib/html2pdf/_fpdf/font/helveticabi.php
@@ -1,15 +1,15 @@
-278,chr(1)=>278,chr(2)=>278,chr(3)=>278,chr(4)=>278,chr(5)=>278,chr(6)=>278,chr(7)=>278,chr(8)=>278,chr(9)=>278,chr(10)=>278,chr(11)=>278,chr(12)=>278,chr(13)=>278,chr(14)=>278,chr(15)=>278,chr(16)=>278,chr(17)=>278,chr(18)=>278,chr(19)=>278,chr(20)=>278,chr(21)=>278,
- chr(22)=>278,chr(23)=>278,chr(24)=>278,chr(25)=>278,chr(26)=>278,chr(27)=>278,chr(28)=>278,chr(29)=>278,chr(30)=>278,chr(31)=>278,' '=>278,'!'=>333,'"'=>474,'#'=>556,'$'=>556,'%'=>889,'&'=>722,'\''=>238,'('=>333,')'=>333,'*'=>389,'+'=>584,
- ','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>333,';'=>333,'<'=>584,'='=>584,'>'=>584,'?'=>611,'@'=>975,'A'=>722,
- 'B'=>722,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>556,'K'=>722,'L'=>611,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944,
- 'X'=>667,'Y'=>667,'Z'=>611,'['=>333,'\\'=>278,']'=>333,'^'=>584,'_'=>556,'`'=>333,'a'=>556,'b'=>611,'c'=>556,'d'=>611,'e'=>556,'f'=>333,'g'=>611,'h'=>611,'i'=>278,'j'=>278,'k'=>556,'l'=>278,'m'=>889,
- 'n'=>611,'o'=>611,'p'=>611,'q'=>611,'r'=>389,'s'=>556,'t'=>333,'u'=>611,'v'=>556,'w'=>778,'x'=>556,'y'=>556,'z'=>500,'{'=>389,'|'=>280,'}'=>389,'~'=>584,chr(127)=>350,chr(128)=>556,chr(129)=>350,chr(130)=>278,chr(131)=>556,
- chr(132)=>500,chr(133)=>1000,chr(134)=>556,chr(135)=>556,chr(136)=>333,chr(137)=>1000,chr(138)=>667,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>278,chr(146)=>278,chr(147)=>500,chr(148)=>500,chr(149)=>350,chr(150)=>556,chr(151)=>1000,chr(152)=>333,chr(153)=>1000,
- chr(154)=>556,chr(155)=>333,chr(156)=>944,chr(157)=>350,chr(158)=>500,chr(159)=>667,chr(160)=>278,chr(161)=>333,chr(162)=>556,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>280,chr(167)=>556,chr(168)=>333,chr(169)=>737,chr(170)=>370,chr(171)=>556,chr(172)=>584,chr(173)=>333,chr(174)=>737,chr(175)=>333,
- chr(176)=>400,chr(177)=>584,chr(178)=>333,chr(179)=>333,chr(180)=>333,chr(181)=>611,chr(182)=>556,chr(183)=>278,chr(184)=>333,chr(185)=>333,chr(186)=>365,chr(187)=>556,chr(188)=>834,chr(189)=>834,chr(190)=>834,chr(191)=>611,chr(192)=>722,chr(193)=>722,chr(194)=>722,chr(195)=>722,chr(196)=>722,chr(197)=>722,
- chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722,
- chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>556,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>611,chr(241)=>611,
- chr(242)=>611,chr(243)=>611,chr(244)=>611,chr(245)=>611,chr(246)=>611,chr(247)=>584,chr(248)=>611,chr(249)=>611,chr(250)=>611,chr(251)=>611,chr(252)=>611,chr(253)=>556,chr(254)=>611,chr(255)=>556);
-?>
+278,chr(1)=>278,chr(2)=>278,chr(3)=>278,chr(4)=>278,chr(5)=>278,chr(6)=>278,chr(7)=>278,chr(8)=>278,chr(9)=>278,chr(10)=>278,chr(11)=>278,chr(12)=>278,chr(13)=>278,chr(14)=>278,chr(15)=>278,chr(16)=>278,chr(17)=>278,chr(18)=>278,chr(19)=>278,chr(20)=>278,chr(21)=>278,
+ chr(22)=>278,chr(23)=>278,chr(24)=>278,chr(25)=>278,chr(26)=>278,chr(27)=>278,chr(28)=>278,chr(29)=>278,chr(30)=>278,chr(31)=>278,' '=>278,'!'=>333,'"'=>474,'#'=>556,'$'=>556,'%'=>889,'&'=>722,'\''=>238,'('=>333,')'=>333,'*'=>389,'+'=>584,
+ ','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>333,';'=>333,'<'=>584,'='=>584,'>'=>584,'?'=>611,'@'=>975,'A'=>722,
+ 'B'=>722,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>556,'K'=>722,'L'=>611,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944,
+ 'X'=>667,'Y'=>667,'Z'=>611,'['=>333,'\\'=>278,']'=>333,'^'=>584,'_'=>556,'`'=>333,'a'=>556,'b'=>611,'c'=>556,'d'=>611,'e'=>556,'f'=>333,'g'=>611,'h'=>611,'i'=>278,'j'=>278,'k'=>556,'l'=>278,'m'=>889,
+ 'n'=>611,'o'=>611,'p'=>611,'q'=>611,'r'=>389,'s'=>556,'t'=>333,'u'=>611,'v'=>556,'w'=>778,'x'=>556,'y'=>556,'z'=>500,'{'=>389,'|'=>280,'}'=>389,'~'=>584,chr(127)=>350,chr(128)=>556,chr(129)=>350,chr(130)=>278,chr(131)=>556,
+ chr(132)=>500,chr(133)=>1000,chr(134)=>556,chr(135)=>556,chr(136)=>333,chr(137)=>1000,chr(138)=>667,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>278,chr(146)=>278,chr(147)=>500,chr(148)=>500,chr(149)=>350,chr(150)=>556,chr(151)=>1000,chr(152)=>333,chr(153)=>1000,
+ chr(154)=>556,chr(155)=>333,chr(156)=>944,chr(157)=>350,chr(158)=>500,chr(159)=>667,chr(160)=>278,chr(161)=>333,chr(162)=>556,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>280,chr(167)=>556,chr(168)=>333,chr(169)=>737,chr(170)=>370,chr(171)=>556,chr(172)=>584,chr(173)=>333,chr(174)=>737,chr(175)=>333,
+ chr(176)=>400,chr(177)=>584,chr(178)=>333,chr(179)=>333,chr(180)=>333,chr(181)=>611,chr(182)=>556,chr(183)=>278,chr(184)=>333,chr(185)=>333,chr(186)=>365,chr(187)=>556,chr(188)=>834,chr(189)=>834,chr(190)=>834,chr(191)=>611,chr(192)=>722,chr(193)=>722,chr(194)=>722,chr(195)=>722,chr(196)=>722,chr(197)=>722,
+ chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722,
+ chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>556,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>611,chr(241)=>611,
+ chr(242)=>611,chr(243)=>611,chr(244)=>611,chr(245)=>611,chr(246)=>611,chr(247)=>584,chr(248)=>611,chr(249)=>611,chr(250)=>611,chr(251)=>611,chr(252)=>611,chr(253)=>556,chr(254)=>611,chr(255)=>556);
+?>
diff --git a/main/inc/lib/html2pdf/_fpdf/font/helveticai.php b/main/inc/lib/html2pdf/_fpdf/font/helveticai.php
index d5bb6e094e..88bf4371bd 100755
--- a/main/inc/lib/html2pdf/_fpdf/font/helveticai.php
+++ b/main/inc/lib/html2pdf/_fpdf/font/helveticai.php
@@ -1,15 +1,15 @@
-278,chr(1)=>278,chr(2)=>278,chr(3)=>278,chr(4)=>278,chr(5)=>278,chr(6)=>278,chr(7)=>278,chr(8)=>278,chr(9)=>278,chr(10)=>278,chr(11)=>278,chr(12)=>278,chr(13)=>278,chr(14)=>278,chr(15)=>278,chr(16)=>278,chr(17)=>278,chr(18)=>278,chr(19)=>278,chr(20)=>278,chr(21)=>278,
- chr(22)=>278,chr(23)=>278,chr(24)=>278,chr(25)=>278,chr(26)=>278,chr(27)=>278,chr(28)=>278,chr(29)=>278,chr(30)=>278,chr(31)=>278,' '=>278,'!'=>278,'"'=>355,'#'=>556,'$'=>556,'%'=>889,'&'=>667,'\''=>191,'('=>333,')'=>333,'*'=>389,'+'=>584,
- ','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>278,';'=>278,'<'=>584,'='=>584,'>'=>584,'?'=>556,'@'=>1015,'A'=>667,
- 'B'=>667,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>500,'K'=>667,'L'=>556,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944,
- 'X'=>667,'Y'=>667,'Z'=>611,'['=>278,'\\'=>278,']'=>278,'^'=>469,'_'=>556,'`'=>333,'a'=>556,'b'=>556,'c'=>500,'d'=>556,'e'=>556,'f'=>278,'g'=>556,'h'=>556,'i'=>222,'j'=>222,'k'=>500,'l'=>222,'m'=>833,
- 'n'=>556,'o'=>556,'p'=>556,'q'=>556,'r'=>333,'s'=>500,'t'=>278,'u'=>556,'v'=>500,'w'=>722,'x'=>500,'y'=>500,'z'=>500,'{'=>334,'|'=>260,'}'=>334,'~'=>584,chr(127)=>350,chr(128)=>556,chr(129)=>350,chr(130)=>222,chr(131)=>556,
- chr(132)=>333,chr(133)=>1000,chr(134)=>556,chr(135)=>556,chr(136)=>333,chr(137)=>1000,chr(138)=>667,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>222,chr(146)=>222,chr(147)=>333,chr(148)=>333,chr(149)=>350,chr(150)=>556,chr(151)=>1000,chr(152)=>333,chr(153)=>1000,
- chr(154)=>500,chr(155)=>333,chr(156)=>944,chr(157)=>350,chr(158)=>500,chr(159)=>667,chr(160)=>278,chr(161)=>333,chr(162)=>556,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>260,chr(167)=>556,chr(168)=>333,chr(169)=>737,chr(170)=>370,chr(171)=>556,chr(172)=>584,chr(173)=>333,chr(174)=>737,chr(175)=>333,
- chr(176)=>400,chr(177)=>584,chr(178)=>333,chr(179)=>333,chr(180)=>333,chr(181)=>556,chr(182)=>537,chr(183)=>278,chr(184)=>333,chr(185)=>333,chr(186)=>365,chr(187)=>556,chr(188)=>834,chr(189)=>834,chr(190)=>834,chr(191)=>611,chr(192)=>667,chr(193)=>667,chr(194)=>667,chr(195)=>667,chr(196)=>667,chr(197)=>667,
- chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722,
- chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>500,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>556,chr(241)=>556,
- chr(242)=>556,chr(243)=>556,chr(244)=>556,chr(245)=>556,chr(246)=>556,chr(247)=>584,chr(248)=>611,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>500,chr(254)=>556,chr(255)=>500);
-?>
+278,chr(1)=>278,chr(2)=>278,chr(3)=>278,chr(4)=>278,chr(5)=>278,chr(6)=>278,chr(7)=>278,chr(8)=>278,chr(9)=>278,chr(10)=>278,chr(11)=>278,chr(12)=>278,chr(13)=>278,chr(14)=>278,chr(15)=>278,chr(16)=>278,chr(17)=>278,chr(18)=>278,chr(19)=>278,chr(20)=>278,chr(21)=>278,
+ chr(22)=>278,chr(23)=>278,chr(24)=>278,chr(25)=>278,chr(26)=>278,chr(27)=>278,chr(28)=>278,chr(29)=>278,chr(30)=>278,chr(31)=>278,' '=>278,'!'=>278,'"'=>355,'#'=>556,'$'=>556,'%'=>889,'&'=>667,'\''=>191,'('=>333,')'=>333,'*'=>389,'+'=>584,
+ ','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>278,';'=>278,'<'=>584,'='=>584,'>'=>584,'?'=>556,'@'=>1015,'A'=>667,
+ 'B'=>667,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>500,'K'=>667,'L'=>556,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944,
+ 'X'=>667,'Y'=>667,'Z'=>611,'['=>278,'\\'=>278,']'=>278,'^'=>469,'_'=>556,'`'=>333,'a'=>556,'b'=>556,'c'=>500,'d'=>556,'e'=>556,'f'=>278,'g'=>556,'h'=>556,'i'=>222,'j'=>222,'k'=>500,'l'=>222,'m'=>833,
+ 'n'=>556,'o'=>556,'p'=>556,'q'=>556,'r'=>333,'s'=>500,'t'=>278,'u'=>556,'v'=>500,'w'=>722,'x'=>500,'y'=>500,'z'=>500,'{'=>334,'|'=>260,'}'=>334,'~'=>584,chr(127)=>350,chr(128)=>556,chr(129)=>350,chr(130)=>222,chr(131)=>556,
+ chr(132)=>333,chr(133)=>1000,chr(134)=>556,chr(135)=>556,chr(136)=>333,chr(137)=>1000,chr(138)=>667,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>222,chr(146)=>222,chr(147)=>333,chr(148)=>333,chr(149)=>350,chr(150)=>556,chr(151)=>1000,chr(152)=>333,chr(153)=>1000,
+ chr(154)=>500,chr(155)=>333,chr(156)=>944,chr(157)=>350,chr(158)=>500,chr(159)=>667,chr(160)=>278,chr(161)=>333,chr(162)=>556,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>260,chr(167)=>556,chr(168)=>333,chr(169)=>737,chr(170)=>370,chr(171)=>556,chr(172)=>584,chr(173)=>333,chr(174)=>737,chr(175)=>333,
+ chr(176)=>400,chr(177)=>584,chr(178)=>333,chr(179)=>333,chr(180)=>333,chr(181)=>556,chr(182)=>537,chr(183)=>278,chr(184)=>333,chr(185)=>333,chr(186)=>365,chr(187)=>556,chr(188)=>834,chr(189)=>834,chr(190)=>834,chr(191)=>611,chr(192)=>667,chr(193)=>667,chr(194)=>667,chr(195)=>667,chr(196)=>667,chr(197)=>667,
+ chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722,
+ chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>500,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>556,chr(241)=>556,
+ chr(242)=>556,chr(243)=>556,chr(244)=>556,chr(245)=>556,chr(246)=>556,chr(247)=>584,chr(248)=>611,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>500,chr(254)=>556,chr(255)=>500);
+?>
diff --git a/main/inc/lib/html2pdf/_fpdf/font/makefont/makefont.php b/main/inc/lib/html2pdf/_fpdf/font/makefont/makefont.php
index 787a74a88b..13039326db 100755
--- a/main/inc/lib/html2pdf/_fpdf/font/makefont/makefont.php
+++ b/main/inc/lib/html2pdf/_fpdf/font/makefont/makefont.php
@@ -1,419 +1,419 @@
-Error: encoding not found: '.$enc);
- $cc2gn=array();
- foreach($a as $l)
- {
- if($l[0]=='!')
- {
- $e=preg_split('/[ \\t]+/',rtrim($l));
- $cc=hexdec(substr($e[0],1));
- $gn=$e[2];
- $cc2gn[$cc]=$gn;
- }
- }
- for($i=0;$i<=255;$i++)
- {
- if(!isset($cc2gn[$i]))
- $cc2gn[$i]='.notdef';
- }
- return $cc2gn;
-}
-
-function ReadAFM($file, &$map)
-{
- //Read a font metric file
- $a=file($file);
- if(empty($a))
- die('File not found');
- $widths=array();
- $fm=array();
- $fix=array('Edot'=>'Edotaccent','edot'=>'edotaccent','Idot'=>'Idotaccent','Zdot'=>'Zdotaccent','zdot'=>'zdotaccent',
- 'Odblacute'=>'Ohungarumlaut','odblacute'=>'ohungarumlaut','Udblacute'=>'Uhungarumlaut','udblacute'=>'uhungarumlaut',
- 'Gcedilla'=>'Gcommaaccent','gcedilla'=>'gcommaaccent','Kcedilla'=>'Kcommaaccent','kcedilla'=>'kcommaaccent',
- 'Lcedilla'=>'Lcommaaccent','lcedilla'=>'lcommaaccent','Ncedilla'=>'Ncommaaccent','ncedilla'=>'ncommaaccent',
- 'Rcedilla'=>'Rcommaaccent','rcedilla'=>'rcommaaccent','Scedilla'=>'Scommaaccent','scedilla'=>'scommaaccent',
- 'Tcedilla'=>'Tcommaaccent','tcedilla'=>'tcommaaccent','Dslash'=>'Dcroat','dslash'=>'dcroat','Dmacron'=>'Dcroat','dmacron'=>'dcroat',
- 'combininggraveaccent'=>'gravecomb','combininghookabove'=>'hookabovecomb','combiningtildeaccent'=>'tildecomb',
- 'combiningacuteaccent'=>'acutecomb','combiningdotbelow'=>'dotbelowcomb','dongsign'=>'dong');
- foreach($a as $l)
- {
- $e=explode(' ',rtrim($l));
- if(count($e)<2)
- continue;
- $code=$e[0];
- $param=$e[1];
- if($code=='C')
- {
- //Character metrics
- $cc=(int)$e[1];
- $w=$e[4];
- $gn=$e[7];
- if(substr($gn,-4)=='20AC')
- $gn='Euro';
- if(isset($fix[$gn]))
- {
- //Fix incorrect glyph name
- foreach($map as $c=>$n)
- {
- if($n==$fix[$gn])
- $map[$c]=$gn;
- }
- }
- if(empty($map))
- {
- //Symbolic font: use built-in encoding
- $widths[$cc]=$w;
- }
- else
- {
- $widths[$gn]=$w;
- if($gn=='X')
- $fm['CapXHeight']=$e[13];
- }
- if($gn=='.notdef')
- $fm['MissingWidth']=$w;
- }
- elseif($code=='FontName')
- $fm['FontName']=$param;
- elseif($code=='Weight')
- $fm['Weight']=$param;
- elseif($code=='ItalicAngle')
- $fm['ItalicAngle']=(double)$param;
- elseif($code=='Ascender')
- $fm['Ascender']=(int)$param;
- elseif($code=='Descender')
- $fm['Descender']=(int)$param;
- elseif($code=='UnderlineThickness')
- $fm['UnderlineThickness']=(int)$param;
- elseif($code=='UnderlinePosition')
- $fm['UnderlinePosition']=(int)$param;
- elseif($code=='IsFixedPitch')
- $fm['IsFixedPitch']=($param=='true');
- elseif($code=='FontBBox')
- $fm['FontBBox']=array($e[1],$e[2],$e[3],$e[4]);
- elseif($code=='CapHeight')
- $fm['CapHeight']=(int)$param;
- elseif($code=='StdVW')
- $fm['StdVW']=(int)$param;
- }
- if(!isset($fm['FontName']))
- die('FontName not found');
- if(!empty($map))
- {
- if(!isset($widths['.notdef']))
- $widths['.notdef']=600;
- if(!isset($widths['Delta']) && isset($widths['increment']))
- $widths['Delta']=$widths['increment'];
- //Order widths according to map
- for($i=0;$i<=255;$i++)
- {
- if(!isset($widths[$map[$i]]))
- {
- echo 'Warning: character '.$map[$i].' is missing ';
- $widths[$i]=$widths['.notdef'];
- }
- else
- $widths[$i]=$widths[$map[$i]];
- }
- }
- $fm['Widths']=$widths;
- return $fm;
-}
-
-function MakeFontDescriptor($fm, $symbolic)
-{
- //Ascent
- $asc=(isset($fm['Ascender']) ? $fm['Ascender'] : 1000);
- $fd="array('Ascent'=>".$asc;
- //Descent
- $desc=(isset($fm['Descender']) ? $fm['Descender'] : -200);
- $fd.=",'Descent'=>".$desc;
- //CapHeight
- if(isset($fm['CapHeight']))
- $ch=$fm['CapHeight'];
- elseif(isset($fm['CapXHeight']))
- $ch=$fm['CapXHeight'];
- else
- $ch=$asc;
- $fd.=",'CapHeight'=>".$ch;
- //Flags
- $flags=0;
- if(isset($fm['IsFixedPitch']) && $fm['IsFixedPitch'])
- $flags+=1<<0;
- if($symbolic)
- $flags+=1<<2;
- if(!$symbolic)
- $flags+=1<<5;
- if(isset($fm['ItalicAngle']) && $fm['ItalicAngle']!=0)
- $flags+=1<<6;
- $fd.=",'Flags'=>".$flags;
- //FontBBox
- if(isset($fm['FontBBox']))
- $fbb=$fm['FontBBox'];
- else
- $fbb=array(0,$desc-100,1000,$asc+100);
- $fd.=",'FontBBox'=>'[".$fbb[0].' '.$fbb[1].' '.$fbb[2].' '.$fbb[3]."]'";
- //ItalicAngle
- $ia=(isset($fm['ItalicAngle']) ? $fm['ItalicAngle'] : 0);
- $fd.=",'ItalicAngle'=>".$ia;
- //StemV
- if(isset($fm['StdVW']))
- $stemv=$fm['StdVW'];
- elseif(isset($fm['Weight']) && preg_match('/bold|black/i',$fm['Weight']))
- $stemv=120;
- else
- $stemv=70;
- $fd.=",'StemV'=>".$stemv;
- //MissingWidth
- if(isset($fm['MissingWidth']))
- $fd.=",'MissingWidth'=>".$fm['MissingWidth'];
- $fd.=')';
- return $fd;
-}
-
-function MakeWidthArray($fm)
-{
- //Make character width array
- $s="array(\n\t";
- $cw=$fm['Widths'];
- for($i=0;$i<=255;$i++)
- {
- if(chr($i)=="'")
- $s.="'\\''";
- elseif(chr($i)=="\\")
- $s.="'\\\\'";
- elseif($i>=32 && $i<=126)
- $s.="'".chr($i)."'";
- else
- $s.="chr($i)";
- $s.='=>'.$fm['Widths'][$i];
- if($i<255)
- $s.=',';
- if(($i+1)%22==0)
- $s.="\n\t";
- }
- $s.=')';
- return $s;
-}
-
-function MakeFontEncoding($map)
-{
- //Build differences from reference encoding
- $ref=ReadMap('cp1252');
- $s='';
- $last=0;
- for($i=32;$i<=255;$i++)
- {
- if($map[$i]!=$ref[$i])
- {
- if($i!=$last+1)
- $s.=$i.' ';
- $last=$i;
- $s.='/'.$map[$i].' ';
- }
- }
- return rtrim($s);
-}
-
-function SaveToFile($file, $s, $mode)
-{
- $f=fopen($file,'w'.$mode);
- if(!$f)
- die('Can\'t write to file '.$file);
- fwrite($f,$s,strlen($s));
- fclose($f);
-}
-
-function ReadShort($f)
-{
- $a=unpack('n1n',fread($f,2));
- return $a['n'];
-}
-
-function ReadLong($f)
-{
- $a=unpack('N1N',fread($f,4));
- return $a['N'];
-}
-
-function CheckTTF($file)
-{
- //Check if font license allows embedding
- $f=fopen($file,'rb');
- if(!$f)
- die('Error: Can\'t open '.$file);
- //Extract number of tables
- fseek($f,4,SEEK_CUR);
- $nb=ReadShort($f);
- fseek($f,6,SEEK_CUR);
- //Seek OS/2 table
- $found=false;
- for($i=0;$i<$nb;$i++)
- {
- if(fread($f,4)=='OS/2')
- {
- $found=true;
- break;
- }
- fseek($f,12,SEEK_CUR);
- }
- if(!$found)
- {
- fclose($f);
- return;
- }
- fseek($f,4,SEEK_CUR);
- $offset=ReadLong($f);
- fseek($f,$offset,SEEK_SET);
- //Extract fsType flags
- fseek($f,8,SEEK_CUR);
- $fsType=ReadShort($f);
- $rl=($fsType & 0x02)!=0;
- $pp=($fsType & 0x04)!=0;
- $e=($fsType & 0x08)!=0;
- fclose($f);
- if($rl && !$pp && !$e)
- echo 'Warning: font license does not allow embedding';
-}
-
-/*******************************************************************************
-* fontfile: path to TTF file (or empty string if not to be embedded0)
-* afmfile: path to AFM file
-* enc: font encoding (or empty string for symbolic fonts)
-* patch: optional patch for encoding
-* type: font type if fontfile is empty
-*******************************************************************************/
-function MakeFont($fontfile, $afmfile, $enc='cp1252', $patch=array(), $type='TrueType')
-{
- //Generate a font definition file
- if(get_magic_quotes_runtime())
- @set_magic_quotes_runtime(0);
- ini_set('auto_detect_line_endings','1');
- if($enc)
- {
- $map=ReadMap($enc);
- foreach($patch as $cc=>$gn)
- $map[$cc]=$gn;
- }
- else
- $map=array();
- if(!file_exists($afmfile))
- die('Error: AFM file not found: '.$afmfile);
- $fm=ReadAFM($afmfile,$map);
- if($enc)
- $diff=MakeFontEncoding($map);
- else
- $diff='';
- $fd=MakeFontDescriptor($fm,empty($map));
- //Find font type
- if($fontfile)
- {
- $ext=strtolower(substr($fontfile,-3));
- if($ext=='ttf')
- $type='TrueType';
- elseif($ext=='pfb')
- $type='Type1';
- else
- die('Error: unrecognized font file extension: '.$ext);
- }
- else
- {
- if($type!='TrueType' && $type!='Type1')
- die('Error: incorrect font type: '.$type);
- }
- //Start generation
- $s='Error: font file not found: '.$fontfile);
- if($type=='TrueType')
- CheckTTF($fontfile);
- $f=fopen($fontfile,'rb');
- if(!$f)
- die('Error: Can\'t open '.$fontfile);
- $file=fread($f,filesize($fontfile));
- fclose($f);
- if($type=='Type1')
- {
- //Find first two sections and discard third one
- $header=(ord($file[0])==128);
- if($header)
- {
- //Strip first binary header
- $file=substr($file,6);
- }
- $pos=strpos($file,'eexec');
- if(!$pos)
- die('Error: font file does not seem to be valid Type1');
- $size1=$pos+6;
- if($header && ord($file[$size1])==128)
- {
- //Strip second binary header
- $file=substr($file,0,$size1).substr($file,$size1+6);
- }
- $pos=strpos($file,'00000000');
- if(!$pos)
- die('Error: font file does not seem to be valid Type1');
- $size2=$pos-$size1;
- $file=substr($file,0,$size1+$size2);
- }
- if(function_exists('gzcompress'))
- {
- $cmp=$basename.'.z';
- SaveToFile($cmp,gzcompress($file),'b');
- $s.='$file=\''.$cmp."';\n";
- echo 'Font file compressed ('.$cmp.') ';
- }
- else
- {
- $s.='$file=\''.basename($fontfile)."';\n";
- echo 'Notice: font file could not be compressed (zlib extension not available) ';
- }
- if($type=='Type1')
- {
- $s.='$size1='.$size1.";\n";
- $s.='$size2='.$size2.";\n";
- }
- else
- $s.='$originalsize='.filesize($fontfile).";\n";
- }
- else
- {
- //Not embedded font
- $s.='$file='."'';\n";
- }
- $s.="?>\n";
- SaveToFile($basename.'.php',$s,'t');
- echo 'Font definition file generated ('.$basename.'.php'.') ';
-}
-?>
+Error: encoding not found: '.$enc);
+ $cc2gn=array();
+ foreach($a as $l)
+ {
+ if($l[0]=='!')
+ {
+ $e=preg_split('/[ \\t]+/',rtrim($l));
+ $cc=hexdec(substr($e[0],1));
+ $gn=$e[2];
+ $cc2gn[$cc]=$gn;
+ }
+ }
+ for($i=0;$i<=255;$i++)
+ {
+ if(!isset($cc2gn[$i]))
+ $cc2gn[$i]='.notdef';
+ }
+ return $cc2gn;
+}
+
+function ReadAFM($file, &$map)
+{
+ //Read a font metric file
+ $a=file($file);
+ if(empty($a))
+ die('File not found');
+ $widths=array();
+ $fm=array();
+ $fix=array('Edot'=>'Edotaccent','edot'=>'edotaccent','Idot'=>'Idotaccent','Zdot'=>'Zdotaccent','zdot'=>'zdotaccent',
+ 'Odblacute'=>'Ohungarumlaut','odblacute'=>'ohungarumlaut','Udblacute'=>'Uhungarumlaut','udblacute'=>'uhungarumlaut',
+ 'Gcedilla'=>'Gcommaaccent','gcedilla'=>'gcommaaccent','Kcedilla'=>'Kcommaaccent','kcedilla'=>'kcommaaccent',
+ 'Lcedilla'=>'Lcommaaccent','lcedilla'=>'lcommaaccent','Ncedilla'=>'Ncommaaccent','ncedilla'=>'ncommaaccent',
+ 'Rcedilla'=>'Rcommaaccent','rcedilla'=>'rcommaaccent','Scedilla'=>'Scommaaccent','scedilla'=>'scommaaccent',
+ 'Tcedilla'=>'Tcommaaccent','tcedilla'=>'tcommaaccent','Dslash'=>'Dcroat','dslash'=>'dcroat','Dmacron'=>'Dcroat','dmacron'=>'dcroat',
+ 'combininggraveaccent'=>'gravecomb','combininghookabove'=>'hookabovecomb','combiningtildeaccent'=>'tildecomb',
+ 'combiningacuteaccent'=>'acutecomb','combiningdotbelow'=>'dotbelowcomb','dongsign'=>'dong');
+ foreach($a as $l)
+ {
+ $e=explode(' ',rtrim($l));
+ if(count($e)<2)
+ continue;
+ $code=$e[0];
+ $param=$e[1];
+ if($code=='C')
+ {
+ //Character metrics
+ $cc=(int)$e[1];
+ $w=$e[4];
+ $gn=$e[7];
+ if(substr($gn,-4)=='20AC')
+ $gn='Euro';
+ if(isset($fix[$gn]))
+ {
+ //Fix incorrect glyph name
+ foreach($map as $c=>$n)
+ {
+ if($n==$fix[$gn])
+ $map[$c]=$gn;
+ }
+ }
+ if(empty($map))
+ {
+ //Symbolic font: use built-in encoding
+ $widths[$cc]=$w;
+ }
+ else
+ {
+ $widths[$gn]=$w;
+ if($gn=='X')
+ $fm['CapXHeight']=$e[13];
+ }
+ if($gn=='.notdef')
+ $fm['MissingWidth']=$w;
+ }
+ elseif($code=='FontName')
+ $fm['FontName']=$param;
+ elseif($code=='Weight')
+ $fm['Weight']=$param;
+ elseif($code=='ItalicAngle')
+ $fm['ItalicAngle']=(double)$param;
+ elseif($code=='Ascender')
+ $fm['Ascender']=(int)$param;
+ elseif($code=='Descender')
+ $fm['Descender']=(int)$param;
+ elseif($code=='UnderlineThickness')
+ $fm['UnderlineThickness']=(int)$param;
+ elseif($code=='UnderlinePosition')
+ $fm['UnderlinePosition']=(int)$param;
+ elseif($code=='IsFixedPitch')
+ $fm['IsFixedPitch']=($param=='true');
+ elseif($code=='FontBBox')
+ $fm['FontBBox']=array($e[1],$e[2],$e[3],$e[4]);
+ elseif($code=='CapHeight')
+ $fm['CapHeight']=(int)$param;
+ elseif($code=='StdVW')
+ $fm['StdVW']=(int)$param;
+ }
+ if(!isset($fm['FontName']))
+ die('FontName not found');
+ if(!empty($map))
+ {
+ if(!isset($widths['.notdef']))
+ $widths['.notdef']=600;
+ if(!isset($widths['Delta']) && isset($widths['increment']))
+ $widths['Delta']=$widths['increment'];
+ //Order widths according to map
+ for($i=0;$i<=255;$i++)
+ {
+ if(!isset($widths[$map[$i]]))
+ {
+ echo 'Warning: character '.$map[$i].' is missing ';
+ $widths[$i]=$widths['.notdef'];
+ }
+ else
+ $widths[$i]=$widths[$map[$i]];
+ }
+ }
+ $fm['Widths']=$widths;
+ return $fm;
+}
+
+function MakeFontDescriptor($fm, $symbolic)
+{
+ //Ascent
+ $asc=(isset($fm['Ascender']) ? $fm['Ascender'] : 1000);
+ $fd="array('Ascent'=>".$asc;
+ //Descent
+ $desc=(isset($fm['Descender']) ? $fm['Descender'] : -200);
+ $fd.=",'Descent'=>".$desc;
+ //CapHeight
+ if(isset($fm['CapHeight']))
+ $ch=$fm['CapHeight'];
+ elseif(isset($fm['CapXHeight']))
+ $ch=$fm['CapXHeight'];
+ else
+ $ch=$asc;
+ $fd.=",'CapHeight'=>".$ch;
+ //Flags
+ $flags=0;
+ if(isset($fm['IsFixedPitch']) && $fm['IsFixedPitch'])
+ $flags+=1<<0;
+ if($symbolic)
+ $flags+=1<<2;
+ if(!$symbolic)
+ $flags+=1<<5;
+ if(isset($fm['ItalicAngle']) && $fm['ItalicAngle']!=0)
+ $flags+=1<<6;
+ $fd.=",'Flags'=>".$flags;
+ //FontBBox
+ if(isset($fm['FontBBox']))
+ $fbb=$fm['FontBBox'];
+ else
+ $fbb=array(0,$desc-100,1000,$asc+100);
+ $fd.=",'FontBBox'=>'[".$fbb[0].' '.$fbb[1].' '.$fbb[2].' '.$fbb[3]."]'";
+ //ItalicAngle
+ $ia=(isset($fm['ItalicAngle']) ? $fm['ItalicAngle'] : 0);
+ $fd.=",'ItalicAngle'=>".$ia;
+ //StemV
+ if(isset($fm['StdVW']))
+ $stemv=$fm['StdVW'];
+ elseif(isset($fm['Weight']) && preg_match('/bold|black/i',$fm['Weight']))
+ $stemv=120;
+ else
+ $stemv=70;
+ $fd.=",'StemV'=>".$stemv;
+ //MissingWidth
+ if(isset($fm['MissingWidth']))
+ $fd.=",'MissingWidth'=>".$fm['MissingWidth'];
+ $fd.=')';
+ return $fd;
+}
+
+function MakeWidthArray($fm)
+{
+ //Make character width array
+ $s="array(\n\t";
+ $cw=$fm['Widths'];
+ for($i=0;$i<=255;$i++)
+ {
+ if(chr($i)=="'")
+ $s.="'\\''";
+ elseif(chr($i)=="\\")
+ $s.="'\\\\'";
+ elseif($i>=32 && $i<=126)
+ $s.="'".chr($i)."'";
+ else
+ $s.="chr($i)";
+ $s.='=>'.$fm['Widths'][$i];
+ if($i<255)
+ $s.=',';
+ if(($i+1)%22==0)
+ $s.="\n\t";
+ }
+ $s.=')';
+ return $s;
+}
+
+function MakeFontEncoding($map)
+{
+ //Build differences from reference encoding
+ $ref=ReadMap('cp1252');
+ $s='';
+ $last=0;
+ for($i=32;$i<=255;$i++)
+ {
+ if($map[$i]!=$ref[$i])
+ {
+ if($i!=$last+1)
+ $s.=$i.' ';
+ $last=$i;
+ $s.='/'.$map[$i].' ';
+ }
+ }
+ return rtrim($s);
+}
+
+function SaveToFile($file, $s, $mode)
+{
+ $f=fopen($file,'w'.$mode);
+ if(!$f)
+ die('Can\'t write to file '.$file);
+ fwrite($f,$s,strlen($s));
+ fclose($f);
+}
+
+function ReadShort($f)
+{
+ $a=unpack('n1n',fread($f,2));
+ return $a['n'];
+}
+
+function ReadLong($f)
+{
+ $a=unpack('N1N',fread($f,4));
+ return $a['N'];
+}
+
+function CheckTTF($file)
+{
+ //Check if font license allows embedding
+ $f=fopen($file,'rb');
+ if(!$f)
+ die('Error: Can\'t open '.$file);
+ //Extract number of tables
+ fseek($f,4,SEEK_CUR);
+ $nb=ReadShort($f);
+ fseek($f,6,SEEK_CUR);
+ //Seek OS/2 table
+ $found=false;
+ for($i=0;$i<$nb;$i++)
+ {
+ if(fread($f,4)=='OS/2')
+ {
+ $found=true;
+ break;
+ }
+ fseek($f,12,SEEK_CUR);
+ }
+ if(!$found)
+ {
+ fclose($f);
+ return;
+ }
+ fseek($f,4,SEEK_CUR);
+ $offset=ReadLong($f);
+ fseek($f,$offset,SEEK_SET);
+ //Extract fsType flags
+ fseek($f,8,SEEK_CUR);
+ $fsType=ReadShort($f);
+ $rl=($fsType & 0x02)!=0;
+ $pp=($fsType & 0x04)!=0;
+ $e=($fsType & 0x08)!=0;
+ fclose($f);
+ if($rl && !$pp && !$e)
+ echo 'Warning: font license does not allow embedding';
+}
+
+/*******************************************************************************
+* fontfile: path to TTF file (or empty string if not to be embedded0)
+* afmfile: path to AFM file
+* enc: font encoding (or empty string for symbolic fonts)
+* patch: optional patch for encoding
+* type: font type if fontfile is empty
+*******************************************************************************/
+function MakeFont($fontfile, $afmfile, $enc='cp1252', $patch=array(), $type='TrueType')
+{
+ //Generate a font definition file
+ if(get_magic_quotes_runtime())
+ @set_magic_quotes_runtime(0);
+ ini_set('auto_detect_line_endings','1');
+ if($enc)
+ {
+ $map=ReadMap($enc);
+ foreach($patch as $cc=>$gn)
+ $map[$cc]=$gn;
+ }
+ else
+ $map=array();
+ if(!file_exists($afmfile))
+ die('Error: AFM file not found: '.$afmfile);
+ $fm=ReadAFM($afmfile,$map);
+ if($enc)
+ $diff=MakeFontEncoding($map);
+ else
+ $diff='';
+ $fd=MakeFontDescriptor($fm,empty($map));
+ //Find font type
+ if($fontfile)
+ {
+ $ext=strtolower(substr($fontfile,-3));
+ if($ext=='ttf')
+ $type='TrueType';
+ elseif($ext=='pfb')
+ $type='Type1';
+ else
+ die('Error: unrecognized font file extension: '.$ext);
+ }
+ else
+ {
+ if($type!='TrueType' && $type!='Type1')
+ die('Error: incorrect font type: '.$type);
+ }
+ //Start generation
+ $s='Error: font file not found: '.$fontfile);
+ if($type=='TrueType')
+ CheckTTF($fontfile);
+ $f=fopen($fontfile,'rb');
+ if(!$f)
+ die('Error: Can\'t open '.$fontfile);
+ $file=fread($f,filesize($fontfile));
+ fclose($f);
+ if($type=='Type1')
+ {
+ //Find first two sections and discard third one
+ $header=(ord($file[0])==128);
+ if($header)
+ {
+ //Strip first binary header
+ $file=substr($file,6);
+ }
+ $pos=strpos($file,'eexec');
+ if(!$pos)
+ die('Error: font file does not seem to be valid Type1');
+ $size1=$pos+6;
+ if($header && ord($file[$size1])==128)
+ {
+ //Strip second binary header
+ $file=substr($file,0,$size1).substr($file,$size1+6);
+ }
+ $pos=strpos($file,'00000000');
+ if(!$pos)
+ die('Error: font file does not seem to be valid Type1');
+ $size2=$pos-$size1;
+ $file=substr($file,0,$size1+$size2);
+ }
+ if(function_exists('gzcompress'))
+ {
+ $cmp=$basename.'.z';
+ SaveToFile($cmp,gzcompress($file),'b');
+ $s.='$file=\''.$cmp."';\n";
+ echo 'Font file compressed ('.$cmp.') ';
+ }
+ else
+ {
+ $s.='$file=\''.basename($fontfile)."';\n";
+ echo 'Notice: font file could not be compressed (zlib extension not available) ';
+ }
+ if($type=='Type1')
+ {
+ $s.='$size1='.$size1.";\n";
+ $s.='$size2='.$size2.";\n";
+ }
+ else
+ $s.='$originalsize='.filesize($fontfile).";\n";
+ }
+ else
+ {
+ //Not embedded font
+ $s.='$file='."'';\n";
+ }
+ $s.="?>\n";
+ SaveToFile($basename.'.php',$s,'t');
+ echo 'Font definition file generated ('.$basename.'.php'.') ';
+}
+?>
diff --git a/main/inc/lib/html2pdf/_fpdf/font/symbol.php b/main/inc/lib/html2pdf/_fpdf/font/symbol.php
index b556ed84cf..43b50e4511 100755
--- a/main/inc/lib/html2pdf/_fpdf/font/symbol.php
+++ b/main/inc/lib/html2pdf/_fpdf/font/symbol.php
@@ -1,15 +1,15 @@
-250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250,
- chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>333,'"'=>713,'#'=>500,'$'=>549,'%'=>833,'&'=>778,'\''=>439,'('=>333,')'=>333,'*'=>500,'+'=>549,
- ','=>250,'-'=>549,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>278,';'=>278,'<'=>549,'='=>549,'>'=>549,'?'=>444,'@'=>549,'A'=>722,
- 'B'=>667,'C'=>722,'D'=>612,'E'=>611,'F'=>763,'G'=>603,'H'=>722,'I'=>333,'J'=>631,'K'=>722,'L'=>686,'M'=>889,'N'=>722,'O'=>722,'P'=>768,'Q'=>741,'R'=>556,'S'=>592,'T'=>611,'U'=>690,'V'=>439,'W'=>768,
- 'X'=>645,'Y'=>795,'Z'=>611,'['=>333,'\\'=>863,']'=>333,'^'=>658,'_'=>500,'`'=>500,'a'=>631,'b'=>549,'c'=>549,'d'=>494,'e'=>439,'f'=>521,'g'=>411,'h'=>603,'i'=>329,'j'=>603,'k'=>549,'l'=>549,'m'=>576,
- 'n'=>521,'o'=>549,'p'=>549,'q'=>521,'r'=>549,'s'=>603,'t'=>439,'u'=>576,'v'=>713,'w'=>686,'x'=>493,'y'=>686,'z'=>494,'{'=>480,'|'=>200,'}'=>480,'~'=>549,chr(127)=>0,chr(128)=>0,chr(129)=>0,chr(130)=>0,chr(131)=>0,
- chr(132)=>0,chr(133)=>0,chr(134)=>0,chr(135)=>0,chr(136)=>0,chr(137)=>0,chr(138)=>0,chr(139)=>0,chr(140)=>0,chr(141)=>0,chr(142)=>0,chr(143)=>0,chr(144)=>0,chr(145)=>0,chr(146)=>0,chr(147)=>0,chr(148)=>0,chr(149)=>0,chr(150)=>0,chr(151)=>0,chr(152)=>0,chr(153)=>0,
- chr(154)=>0,chr(155)=>0,chr(156)=>0,chr(157)=>0,chr(158)=>0,chr(159)=>0,chr(160)=>750,chr(161)=>620,chr(162)=>247,chr(163)=>549,chr(164)=>167,chr(165)=>713,chr(166)=>500,chr(167)=>753,chr(168)=>753,chr(169)=>753,chr(170)=>753,chr(171)=>1042,chr(172)=>987,chr(173)=>603,chr(174)=>987,chr(175)=>603,
- chr(176)=>400,chr(177)=>549,chr(178)=>411,chr(179)=>549,chr(180)=>549,chr(181)=>713,chr(182)=>494,chr(183)=>460,chr(184)=>549,chr(185)=>549,chr(186)=>549,chr(187)=>549,chr(188)=>1000,chr(189)=>603,chr(190)=>1000,chr(191)=>658,chr(192)=>823,chr(193)=>686,chr(194)=>795,chr(195)=>987,chr(196)=>768,chr(197)=>768,
- chr(198)=>823,chr(199)=>768,chr(200)=>768,chr(201)=>713,chr(202)=>713,chr(203)=>713,chr(204)=>713,chr(205)=>713,chr(206)=>713,chr(207)=>713,chr(208)=>768,chr(209)=>713,chr(210)=>790,chr(211)=>790,chr(212)=>890,chr(213)=>823,chr(214)=>549,chr(215)=>250,chr(216)=>713,chr(217)=>603,chr(218)=>603,chr(219)=>1042,
- chr(220)=>987,chr(221)=>603,chr(222)=>987,chr(223)=>603,chr(224)=>494,chr(225)=>329,chr(226)=>790,chr(227)=>790,chr(228)=>786,chr(229)=>713,chr(230)=>384,chr(231)=>384,chr(232)=>384,chr(233)=>384,chr(234)=>384,chr(235)=>384,chr(236)=>494,chr(237)=>494,chr(238)=>494,chr(239)=>494,chr(240)=>0,chr(241)=>329,
- chr(242)=>274,chr(243)=>686,chr(244)=>686,chr(245)=>686,chr(246)=>384,chr(247)=>384,chr(248)=>384,chr(249)=>384,chr(250)=>384,chr(251)=>384,chr(252)=>494,chr(253)=>494,chr(254)=>494,chr(255)=>0);
-?>
+250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250,
+ chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>333,'"'=>713,'#'=>500,'$'=>549,'%'=>833,'&'=>778,'\''=>439,'('=>333,')'=>333,'*'=>500,'+'=>549,
+ ','=>250,'-'=>549,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>278,';'=>278,'<'=>549,'='=>549,'>'=>549,'?'=>444,'@'=>549,'A'=>722,
+ 'B'=>667,'C'=>722,'D'=>612,'E'=>611,'F'=>763,'G'=>603,'H'=>722,'I'=>333,'J'=>631,'K'=>722,'L'=>686,'M'=>889,'N'=>722,'O'=>722,'P'=>768,'Q'=>741,'R'=>556,'S'=>592,'T'=>611,'U'=>690,'V'=>439,'W'=>768,
+ 'X'=>645,'Y'=>795,'Z'=>611,'['=>333,'\\'=>863,']'=>333,'^'=>658,'_'=>500,'`'=>500,'a'=>631,'b'=>549,'c'=>549,'d'=>494,'e'=>439,'f'=>521,'g'=>411,'h'=>603,'i'=>329,'j'=>603,'k'=>549,'l'=>549,'m'=>576,
+ 'n'=>521,'o'=>549,'p'=>549,'q'=>521,'r'=>549,'s'=>603,'t'=>439,'u'=>576,'v'=>713,'w'=>686,'x'=>493,'y'=>686,'z'=>494,'{'=>480,'|'=>200,'}'=>480,'~'=>549,chr(127)=>0,chr(128)=>0,chr(129)=>0,chr(130)=>0,chr(131)=>0,
+ chr(132)=>0,chr(133)=>0,chr(134)=>0,chr(135)=>0,chr(136)=>0,chr(137)=>0,chr(138)=>0,chr(139)=>0,chr(140)=>0,chr(141)=>0,chr(142)=>0,chr(143)=>0,chr(144)=>0,chr(145)=>0,chr(146)=>0,chr(147)=>0,chr(148)=>0,chr(149)=>0,chr(150)=>0,chr(151)=>0,chr(152)=>0,chr(153)=>0,
+ chr(154)=>0,chr(155)=>0,chr(156)=>0,chr(157)=>0,chr(158)=>0,chr(159)=>0,chr(160)=>750,chr(161)=>620,chr(162)=>247,chr(163)=>549,chr(164)=>167,chr(165)=>713,chr(166)=>500,chr(167)=>753,chr(168)=>753,chr(169)=>753,chr(170)=>753,chr(171)=>1042,chr(172)=>987,chr(173)=>603,chr(174)=>987,chr(175)=>603,
+ chr(176)=>400,chr(177)=>549,chr(178)=>411,chr(179)=>549,chr(180)=>549,chr(181)=>713,chr(182)=>494,chr(183)=>460,chr(184)=>549,chr(185)=>549,chr(186)=>549,chr(187)=>549,chr(188)=>1000,chr(189)=>603,chr(190)=>1000,chr(191)=>658,chr(192)=>823,chr(193)=>686,chr(194)=>795,chr(195)=>987,chr(196)=>768,chr(197)=>768,
+ chr(198)=>823,chr(199)=>768,chr(200)=>768,chr(201)=>713,chr(202)=>713,chr(203)=>713,chr(204)=>713,chr(205)=>713,chr(206)=>713,chr(207)=>713,chr(208)=>768,chr(209)=>713,chr(210)=>790,chr(211)=>790,chr(212)=>890,chr(213)=>823,chr(214)=>549,chr(215)=>250,chr(216)=>713,chr(217)=>603,chr(218)=>603,chr(219)=>1042,
+ chr(220)=>987,chr(221)=>603,chr(222)=>987,chr(223)=>603,chr(224)=>494,chr(225)=>329,chr(226)=>790,chr(227)=>790,chr(228)=>786,chr(229)=>713,chr(230)=>384,chr(231)=>384,chr(232)=>384,chr(233)=>384,chr(234)=>384,chr(235)=>384,chr(236)=>494,chr(237)=>494,chr(238)=>494,chr(239)=>494,chr(240)=>0,chr(241)=>329,
+ chr(242)=>274,chr(243)=>686,chr(244)=>686,chr(245)=>686,chr(246)=>384,chr(247)=>384,chr(248)=>384,chr(249)=>384,chr(250)=>384,chr(251)=>384,chr(252)=>494,chr(253)=>494,chr(254)=>494,chr(255)=>0);
+?>
diff --git a/main/inc/lib/html2pdf/_fpdf/font/times.php b/main/inc/lib/html2pdf/_fpdf/font/times.php
index b9be1b21d6..837c706e08 100755
--- a/main/inc/lib/html2pdf/_fpdf/font/times.php
+++ b/main/inc/lib/html2pdf/_fpdf/font/times.php
@@ -1,15 +1,15 @@
-250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250,
- chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>333,'"'=>408,'#'=>500,'$'=>500,'%'=>833,'&'=>778,'\''=>180,'('=>333,')'=>333,'*'=>500,'+'=>564,
- ','=>250,'-'=>333,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>278,';'=>278,'<'=>564,'='=>564,'>'=>564,'?'=>444,'@'=>921,'A'=>722,
- 'B'=>667,'C'=>667,'D'=>722,'E'=>611,'F'=>556,'G'=>722,'H'=>722,'I'=>333,'J'=>389,'K'=>722,'L'=>611,'M'=>889,'N'=>722,'O'=>722,'P'=>556,'Q'=>722,'R'=>667,'S'=>556,'T'=>611,'U'=>722,'V'=>722,'W'=>944,
- 'X'=>722,'Y'=>722,'Z'=>611,'['=>333,'\\'=>278,']'=>333,'^'=>469,'_'=>500,'`'=>333,'a'=>444,'b'=>500,'c'=>444,'d'=>500,'e'=>444,'f'=>333,'g'=>500,'h'=>500,'i'=>278,'j'=>278,'k'=>500,'l'=>278,'m'=>778,
- 'n'=>500,'o'=>500,'p'=>500,'q'=>500,'r'=>333,'s'=>389,'t'=>278,'u'=>500,'v'=>500,'w'=>722,'x'=>500,'y'=>500,'z'=>444,'{'=>480,'|'=>200,'}'=>480,'~'=>541,chr(127)=>350,chr(128)=>500,chr(129)=>350,chr(130)=>333,chr(131)=>500,
- chr(132)=>444,chr(133)=>1000,chr(134)=>500,chr(135)=>500,chr(136)=>333,chr(137)=>1000,chr(138)=>556,chr(139)=>333,chr(140)=>889,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>333,chr(146)=>333,chr(147)=>444,chr(148)=>444,chr(149)=>350,chr(150)=>500,chr(151)=>1000,chr(152)=>333,chr(153)=>980,
- chr(154)=>389,chr(155)=>333,chr(156)=>722,chr(157)=>350,chr(158)=>444,chr(159)=>722,chr(160)=>250,chr(161)=>333,chr(162)=>500,chr(163)=>500,chr(164)=>500,chr(165)=>500,chr(166)=>200,chr(167)=>500,chr(168)=>333,chr(169)=>760,chr(170)=>276,chr(171)=>500,chr(172)=>564,chr(173)=>333,chr(174)=>760,chr(175)=>333,
- chr(176)=>400,chr(177)=>564,chr(178)=>300,chr(179)=>300,chr(180)=>333,chr(181)=>500,chr(182)=>453,chr(183)=>250,chr(184)=>333,chr(185)=>300,chr(186)=>310,chr(187)=>500,chr(188)=>750,chr(189)=>750,chr(190)=>750,chr(191)=>444,chr(192)=>722,chr(193)=>722,chr(194)=>722,chr(195)=>722,chr(196)=>722,chr(197)=>722,
- chr(198)=>889,chr(199)=>667,chr(200)=>611,chr(201)=>611,chr(202)=>611,chr(203)=>611,chr(204)=>333,chr(205)=>333,chr(206)=>333,chr(207)=>333,chr(208)=>722,chr(209)=>722,chr(210)=>722,chr(211)=>722,chr(212)=>722,chr(213)=>722,chr(214)=>722,chr(215)=>564,chr(216)=>722,chr(217)=>722,chr(218)=>722,chr(219)=>722,
- chr(220)=>722,chr(221)=>722,chr(222)=>556,chr(223)=>500,chr(224)=>444,chr(225)=>444,chr(226)=>444,chr(227)=>444,chr(228)=>444,chr(229)=>444,chr(230)=>667,chr(231)=>444,chr(232)=>444,chr(233)=>444,chr(234)=>444,chr(235)=>444,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>500,chr(241)=>500,
- chr(242)=>500,chr(243)=>500,chr(244)=>500,chr(245)=>500,chr(246)=>500,chr(247)=>564,chr(248)=>500,chr(249)=>500,chr(250)=>500,chr(251)=>500,chr(252)=>500,chr(253)=>500,chr(254)=>500,chr(255)=>500);
-?>
+250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250,
+ chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>333,'"'=>408,'#'=>500,'$'=>500,'%'=>833,'&'=>778,'\''=>180,'('=>333,')'=>333,'*'=>500,'+'=>564,
+ ','=>250,'-'=>333,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>278,';'=>278,'<'=>564,'='=>564,'>'=>564,'?'=>444,'@'=>921,'A'=>722,
+ 'B'=>667,'C'=>667,'D'=>722,'E'=>611,'F'=>556,'G'=>722,'H'=>722,'I'=>333,'J'=>389,'K'=>722,'L'=>611,'M'=>889,'N'=>722,'O'=>722,'P'=>556,'Q'=>722,'R'=>667,'S'=>556,'T'=>611,'U'=>722,'V'=>722,'W'=>944,
+ 'X'=>722,'Y'=>722,'Z'=>611,'['=>333,'\\'=>278,']'=>333,'^'=>469,'_'=>500,'`'=>333,'a'=>444,'b'=>500,'c'=>444,'d'=>500,'e'=>444,'f'=>333,'g'=>500,'h'=>500,'i'=>278,'j'=>278,'k'=>500,'l'=>278,'m'=>778,
+ 'n'=>500,'o'=>500,'p'=>500,'q'=>500,'r'=>333,'s'=>389,'t'=>278,'u'=>500,'v'=>500,'w'=>722,'x'=>500,'y'=>500,'z'=>444,'{'=>480,'|'=>200,'}'=>480,'~'=>541,chr(127)=>350,chr(128)=>500,chr(129)=>350,chr(130)=>333,chr(131)=>500,
+ chr(132)=>444,chr(133)=>1000,chr(134)=>500,chr(135)=>500,chr(136)=>333,chr(137)=>1000,chr(138)=>556,chr(139)=>333,chr(140)=>889,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>333,chr(146)=>333,chr(147)=>444,chr(148)=>444,chr(149)=>350,chr(150)=>500,chr(151)=>1000,chr(152)=>333,chr(153)=>980,
+ chr(154)=>389,chr(155)=>333,chr(156)=>722,chr(157)=>350,chr(158)=>444,chr(159)=>722,chr(160)=>250,chr(161)=>333,chr(162)=>500,chr(163)=>500,chr(164)=>500,chr(165)=>500,chr(166)=>200,chr(167)=>500,chr(168)=>333,chr(169)=>760,chr(170)=>276,chr(171)=>500,chr(172)=>564,chr(173)=>333,chr(174)=>760,chr(175)=>333,
+ chr(176)=>400,chr(177)=>564,chr(178)=>300,chr(179)=>300,chr(180)=>333,chr(181)=>500,chr(182)=>453,chr(183)=>250,chr(184)=>333,chr(185)=>300,chr(186)=>310,chr(187)=>500,chr(188)=>750,chr(189)=>750,chr(190)=>750,chr(191)=>444,chr(192)=>722,chr(193)=>722,chr(194)=>722,chr(195)=>722,chr(196)=>722,chr(197)=>722,
+ chr(198)=>889,chr(199)=>667,chr(200)=>611,chr(201)=>611,chr(202)=>611,chr(203)=>611,chr(204)=>333,chr(205)=>333,chr(206)=>333,chr(207)=>333,chr(208)=>722,chr(209)=>722,chr(210)=>722,chr(211)=>722,chr(212)=>722,chr(213)=>722,chr(214)=>722,chr(215)=>564,chr(216)=>722,chr(217)=>722,chr(218)=>722,chr(219)=>722,
+ chr(220)=>722,chr(221)=>722,chr(222)=>556,chr(223)=>500,chr(224)=>444,chr(225)=>444,chr(226)=>444,chr(227)=>444,chr(228)=>444,chr(229)=>444,chr(230)=>667,chr(231)=>444,chr(232)=>444,chr(233)=>444,chr(234)=>444,chr(235)=>444,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>500,chr(241)=>500,
+ chr(242)=>500,chr(243)=>500,chr(244)=>500,chr(245)=>500,chr(246)=>500,chr(247)=>564,chr(248)=>500,chr(249)=>500,chr(250)=>500,chr(251)=>500,chr(252)=>500,chr(253)=>500,chr(254)=>500,chr(255)=>500);
+?>
diff --git a/main/inc/lib/html2pdf/_fpdf/font/timesb.php b/main/inc/lib/html2pdf/_fpdf/font/timesb.php
index c3eb9fa75b..09cff86ac4 100755
--- a/main/inc/lib/html2pdf/_fpdf/font/timesb.php
+++ b/main/inc/lib/html2pdf/_fpdf/font/timesb.php
@@ -1,15 +1,15 @@
-250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250,
- chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>333,'"'=>555,'#'=>500,'$'=>500,'%'=>1000,'&'=>833,'\''=>278,'('=>333,')'=>333,'*'=>500,'+'=>570,
- ','=>250,'-'=>333,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>333,';'=>333,'<'=>570,'='=>570,'>'=>570,'?'=>500,'@'=>930,'A'=>722,
- 'B'=>667,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>778,'I'=>389,'J'=>500,'K'=>778,'L'=>667,'M'=>944,'N'=>722,'O'=>778,'P'=>611,'Q'=>778,'R'=>722,'S'=>556,'T'=>667,'U'=>722,'V'=>722,'W'=>1000,
- 'X'=>722,'Y'=>722,'Z'=>667,'['=>333,'\\'=>278,']'=>333,'^'=>581,'_'=>500,'`'=>333,'a'=>500,'b'=>556,'c'=>444,'d'=>556,'e'=>444,'f'=>333,'g'=>500,'h'=>556,'i'=>278,'j'=>333,'k'=>556,'l'=>278,'m'=>833,
- 'n'=>556,'o'=>500,'p'=>556,'q'=>556,'r'=>444,'s'=>389,'t'=>333,'u'=>556,'v'=>500,'w'=>722,'x'=>500,'y'=>500,'z'=>444,'{'=>394,'|'=>220,'}'=>394,'~'=>520,chr(127)=>350,chr(128)=>500,chr(129)=>350,chr(130)=>333,chr(131)=>500,
- chr(132)=>500,chr(133)=>1000,chr(134)=>500,chr(135)=>500,chr(136)=>333,chr(137)=>1000,chr(138)=>556,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>667,chr(143)=>350,chr(144)=>350,chr(145)=>333,chr(146)=>333,chr(147)=>500,chr(148)=>500,chr(149)=>350,chr(150)=>500,chr(151)=>1000,chr(152)=>333,chr(153)=>1000,
- chr(154)=>389,chr(155)=>333,chr(156)=>722,chr(157)=>350,chr(158)=>444,chr(159)=>722,chr(160)=>250,chr(161)=>333,chr(162)=>500,chr(163)=>500,chr(164)=>500,chr(165)=>500,chr(166)=>220,chr(167)=>500,chr(168)=>333,chr(169)=>747,chr(170)=>300,chr(171)=>500,chr(172)=>570,chr(173)=>333,chr(174)=>747,chr(175)=>333,
- chr(176)=>400,chr(177)=>570,chr(178)=>300,chr(179)=>300,chr(180)=>333,chr(181)=>556,chr(182)=>540,chr(183)=>250,chr(184)=>333,chr(185)=>300,chr(186)=>330,chr(187)=>500,chr(188)=>750,chr(189)=>750,chr(190)=>750,chr(191)=>500,chr(192)=>722,chr(193)=>722,chr(194)=>722,chr(195)=>722,chr(196)=>722,chr(197)=>722,
- chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>389,chr(205)=>389,chr(206)=>389,chr(207)=>389,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>570,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722,
- chr(220)=>722,chr(221)=>722,chr(222)=>611,chr(223)=>556,chr(224)=>500,chr(225)=>500,chr(226)=>500,chr(227)=>500,chr(228)=>500,chr(229)=>500,chr(230)=>722,chr(231)=>444,chr(232)=>444,chr(233)=>444,chr(234)=>444,chr(235)=>444,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>500,chr(241)=>556,
- chr(242)=>500,chr(243)=>500,chr(244)=>500,chr(245)=>500,chr(246)=>500,chr(247)=>570,chr(248)=>500,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>500,chr(254)=>556,chr(255)=>500);
-?>
+250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250,
+ chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>333,'"'=>555,'#'=>500,'$'=>500,'%'=>1000,'&'=>833,'\''=>278,'('=>333,')'=>333,'*'=>500,'+'=>570,
+ ','=>250,'-'=>333,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>333,';'=>333,'<'=>570,'='=>570,'>'=>570,'?'=>500,'@'=>930,'A'=>722,
+ 'B'=>667,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>778,'I'=>389,'J'=>500,'K'=>778,'L'=>667,'M'=>944,'N'=>722,'O'=>778,'P'=>611,'Q'=>778,'R'=>722,'S'=>556,'T'=>667,'U'=>722,'V'=>722,'W'=>1000,
+ 'X'=>722,'Y'=>722,'Z'=>667,'['=>333,'\\'=>278,']'=>333,'^'=>581,'_'=>500,'`'=>333,'a'=>500,'b'=>556,'c'=>444,'d'=>556,'e'=>444,'f'=>333,'g'=>500,'h'=>556,'i'=>278,'j'=>333,'k'=>556,'l'=>278,'m'=>833,
+ 'n'=>556,'o'=>500,'p'=>556,'q'=>556,'r'=>444,'s'=>389,'t'=>333,'u'=>556,'v'=>500,'w'=>722,'x'=>500,'y'=>500,'z'=>444,'{'=>394,'|'=>220,'}'=>394,'~'=>520,chr(127)=>350,chr(128)=>500,chr(129)=>350,chr(130)=>333,chr(131)=>500,
+ chr(132)=>500,chr(133)=>1000,chr(134)=>500,chr(135)=>500,chr(136)=>333,chr(137)=>1000,chr(138)=>556,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>667,chr(143)=>350,chr(144)=>350,chr(145)=>333,chr(146)=>333,chr(147)=>500,chr(148)=>500,chr(149)=>350,chr(150)=>500,chr(151)=>1000,chr(152)=>333,chr(153)=>1000,
+ chr(154)=>389,chr(155)=>333,chr(156)=>722,chr(157)=>350,chr(158)=>444,chr(159)=>722,chr(160)=>250,chr(161)=>333,chr(162)=>500,chr(163)=>500,chr(164)=>500,chr(165)=>500,chr(166)=>220,chr(167)=>500,chr(168)=>333,chr(169)=>747,chr(170)=>300,chr(171)=>500,chr(172)=>570,chr(173)=>333,chr(174)=>747,chr(175)=>333,
+ chr(176)=>400,chr(177)=>570,chr(178)=>300,chr(179)=>300,chr(180)=>333,chr(181)=>556,chr(182)=>540,chr(183)=>250,chr(184)=>333,chr(185)=>300,chr(186)=>330,chr(187)=>500,chr(188)=>750,chr(189)=>750,chr(190)=>750,chr(191)=>500,chr(192)=>722,chr(193)=>722,chr(194)=>722,chr(195)=>722,chr(196)=>722,chr(197)=>722,
+ chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>389,chr(205)=>389,chr(206)=>389,chr(207)=>389,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>570,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722,
+ chr(220)=>722,chr(221)=>722,chr(222)=>611,chr(223)=>556,chr(224)=>500,chr(225)=>500,chr(226)=>500,chr(227)=>500,chr(228)=>500,chr(229)=>500,chr(230)=>722,chr(231)=>444,chr(232)=>444,chr(233)=>444,chr(234)=>444,chr(235)=>444,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>500,chr(241)=>556,
+ chr(242)=>500,chr(243)=>500,chr(244)=>500,chr(245)=>500,chr(246)=>500,chr(247)=>570,chr(248)=>500,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>500,chr(254)=>556,chr(255)=>500);
+?>
diff --git a/main/inc/lib/html2pdf/_fpdf/font/timesbi.php b/main/inc/lib/html2pdf/_fpdf/font/timesbi.php
index 161f6302c8..b4e38d763b 100755
--- a/main/inc/lib/html2pdf/_fpdf/font/timesbi.php
+++ b/main/inc/lib/html2pdf/_fpdf/font/timesbi.php
@@ -1,15 +1,15 @@
-250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250,
- chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>389,'"'=>555,'#'=>500,'$'=>500,'%'=>833,'&'=>778,'\''=>278,'('=>333,')'=>333,'*'=>500,'+'=>570,
- ','=>250,'-'=>333,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>333,';'=>333,'<'=>570,'='=>570,'>'=>570,'?'=>500,'@'=>832,'A'=>667,
- 'B'=>667,'C'=>667,'D'=>722,'E'=>667,'F'=>667,'G'=>722,'H'=>778,'I'=>389,'J'=>500,'K'=>667,'L'=>611,'M'=>889,'N'=>722,'O'=>722,'P'=>611,'Q'=>722,'R'=>667,'S'=>556,'T'=>611,'U'=>722,'V'=>667,'W'=>889,
- 'X'=>667,'Y'=>611,'Z'=>611,'['=>333,'\\'=>278,']'=>333,'^'=>570,'_'=>500,'`'=>333,'a'=>500,'b'=>500,'c'=>444,'d'=>500,'e'=>444,'f'=>333,'g'=>500,'h'=>556,'i'=>278,'j'=>278,'k'=>500,'l'=>278,'m'=>778,
- 'n'=>556,'o'=>500,'p'=>500,'q'=>500,'r'=>389,'s'=>389,'t'=>278,'u'=>556,'v'=>444,'w'=>667,'x'=>500,'y'=>444,'z'=>389,'{'=>348,'|'=>220,'}'=>348,'~'=>570,chr(127)=>350,chr(128)=>500,chr(129)=>350,chr(130)=>333,chr(131)=>500,
- chr(132)=>500,chr(133)=>1000,chr(134)=>500,chr(135)=>500,chr(136)=>333,chr(137)=>1000,chr(138)=>556,chr(139)=>333,chr(140)=>944,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>333,chr(146)=>333,chr(147)=>500,chr(148)=>500,chr(149)=>350,chr(150)=>500,chr(151)=>1000,chr(152)=>333,chr(153)=>1000,
- chr(154)=>389,chr(155)=>333,chr(156)=>722,chr(157)=>350,chr(158)=>389,chr(159)=>611,chr(160)=>250,chr(161)=>389,chr(162)=>500,chr(163)=>500,chr(164)=>500,chr(165)=>500,chr(166)=>220,chr(167)=>500,chr(168)=>333,chr(169)=>747,chr(170)=>266,chr(171)=>500,chr(172)=>606,chr(173)=>333,chr(174)=>747,chr(175)=>333,
- chr(176)=>400,chr(177)=>570,chr(178)=>300,chr(179)=>300,chr(180)=>333,chr(181)=>576,chr(182)=>500,chr(183)=>250,chr(184)=>333,chr(185)=>300,chr(186)=>300,chr(187)=>500,chr(188)=>750,chr(189)=>750,chr(190)=>750,chr(191)=>500,chr(192)=>667,chr(193)=>667,chr(194)=>667,chr(195)=>667,chr(196)=>667,chr(197)=>667,
- chr(198)=>944,chr(199)=>667,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>389,chr(205)=>389,chr(206)=>389,chr(207)=>389,chr(208)=>722,chr(209)=>722,chr(210)=>722,chr(211)=>722,chr(212)=>722,chr(213)=>722,chr(214)=>722,chr(215)=>570,chr(216)=>722,chr(217)=>722,chr(218)=>722,chr(219)=>722,
- chr(220)=>722,chr(221)=>611,chr(222)=>611,chr(223)=>500,chr(224)=>500,chr(225)=>500,chr(226)=>500,chr(227)=>500,chr(228)=>500,chr(229)=>500,chr(230)=>722,chr(231)=>444,chr(232)=>444,chr(233)=>444,chr(234)=>444,chr(235)=>444,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>500,chr(241)=>556,
- chr(242)=>500,chr(243)=>500,chr(244)=>500,chr(245)=>500,chr(246)=>500,chr(247)=>570,chr(248)=>500,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>444,chr(254)=>500,chr(255)=>444);
-?>
+250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250,
+ chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>389,'"'=>555,'#'=>500,'$'=>500,'%'=>833,'&'=>778,'\''=>278,'('=>333,')'=>333,'*'=>500,'+'=>570,
+ ','=>250,'-'=>333,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>333,';'=>333,'<'=>570,'='=>570,'>'=>570,'?'=>500,'@'=>832,'A'=>667,
+ 'B'=>667,'C'=>667,'D'=>722,'E'=>667,'F'=>667,'G'=>722,'H'=>778,'I'=>389,'J'=>500,'K'=>667,'L'=>611,'M'=>889,'N'=>722,'O'=>722,'P'=>611,'Q'=>722,'R'=>667,'S'=>556,'T'=>611,'U'=>722,'V'=>667,'W'=>889,
+ 'X'=>667,'Y'=>611,'Z'=>611,'['=>333,'\\'=>278,']'=>333,'^'=>570,'_'=>500,'`'=>333,'a'=>500,'b'=>500,'c'=>444,'d'=>500,'e'=>444,'f'=>333,'g'=>500,'h'=>556,'i'=>278,'j'=>278,'k'=>500,'l'=>278,'m'=>778,
+ 'n'=>556,'o'=>500,'p'=>500,'q'=>500,'r'=>389,'s'=>389,'t'=>278,'u'=>556,'v'=>444,'w'=>667,'x'=>500,'y'=>444,'z'=>389,'{'=>348,'|'=>220,'}'=>348,'~'=>570,chr(127)=>350,chr(128)=>500,chr(129)=>350,chr(130)=>333,chr(131)=>500,
+ chr(132)=>500,chr(133)=>1000,chr(134)=>500,chr(135)=>500,chr(136)=>333,chr(137)=>1000,chr(138)=>556,chr(139)=>333,chr(140)=>944,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>333,chr(146)=>333,chr(147)=>500,chr(148)=>500,chr(149)=>350,chr(150)=>500,chr(151)=>1000,chr(152)=>333,chr(153)=>1000,
+ chr(154)=>389,chr(155)=>333,chr(156)=>722,chr(157)=>350,chr(158)=>389,chr(159)=>611,chr(160)=>250,chr(161)=>389,chr(162)=>500,chr(163)=>500,chr(164)=>500,chr(165)=>500,chr(166)=>220,chr(167)=>500,chr(168)=>333,chr(169)=>747,chr(170)=>266,chr(171)=>500,chr(172)=>606,chr(173)=>333,chr(174)=>747,chr(175)=>333,
+ chr(176)=>400,chr(177)=>570,chr(178)=>300,chr(179)=>300,chr(180)=>333,chr(181)=>576,chr(182)=>500,chr(183)=>250,chr(184)=>333,chr(185)=>300,chr(186)=>300,chr(187)=>500,chr(188)=>750,chr(189)=>750,chr(190)=>750,chr(191)=>500,chr(192)=>667,chr(193)=>667,chr(194)=>667,chr(195)=>667,chr(196)=>667,chr(197)=>667,
+ chr(198)=>944,chr(199)=>667,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>389,chr(205)=>389,chr(206)=>389,chr(207)=>389,chr(208)=>722,chr(209)=>722,chr(210)=>722,chr(211)=>722,chr(212)=>722,chr(213)=>722,chr(214)=>722,chr(215)=>570,chr(216)=>722,chr(217)=>722,chr(218)=>722,chr(219)=>722,
+ chr(220)=>722,chr(221)=>611,chr(222)=>611,chr(223)=>500,chr(224)=>500,chr(225)=>500,chr(226)=>500,chr(227)=>500,chr(228)=>500,chr(229)=>500,chr(230)=>722,chr(231)=>444,chr(232)=>444,chr(233)=>444,chr(234)=>444,chr(235)=>444,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>500,chr(241)=>556,
+ chr(242)=>500,chr(243)=>500,chr(244)=>500,chr(245)=>500,chr(246)=>500,chr(247)=>570,chr(248)=>500,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>444,chr(254)=>500,chr(255)=>444);
+?>
diff --git a/main/inc/lib/html2pdf/_fpdf/font/timesi.php b/main/inc/lib/html2pdf/_fpdf/font/timesi.php
index de171fd19e..0ba2b7773d 100755
--- a/main/inc/lib/html2pdf/_fpdf/font/timesi.php
+++ b/main/inc/lib/html2pdf/_fpdf/font/timesi.php
@@ -1,15 +1,15 @@
-250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250,
- chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>333,'"'=>420,'#'=>500,'$'=>500,'%'=>833,'&'=>778,'\''=>214,'('=>333,')'=>333,'*'=>500,'+'=>675,
- ','=>250,'-'=>333,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>333,';'=>333,'<'=>675,'='=>675,'>'=>675,'?'=>500,'@'=>920,'A'=>611,
- 'B'=>611,'C'=>667,'D'=>722,'E'=>611,'F'=>611,'G'=>722,'H'=>722,'I'=>333,'J'=>444,'K'=>667,'L'=>556,'M'=>833,'N'=>667,'O'=>722,'P'=>611,'Q'=>722,'R'=>611,'S'=>500,'T'=>556,'U'=>722,'V'=>611,'W'=>833,
- 'X'=>611,'Y'=>556,'Z'=>556,'['=>389,'\\'=>278,']'=>389,'^'=>422,'_'=>500,'`'=>333,'a'=>500,'b'=>500,'c'=>444,'d'=>500,'e'=>444,'f'=>278,'g'=>500,'h'=>500,'i'=>278,'j'=>278,'k'=>444,'l'=>278,'m'=>722,
- 'n'=>500,'o'=>500,'p'=>500,'q'=>500,'r'=>389,'s'=>389,'t'=>278,'u'=>500,'v'=>444,'w'=>667,'x'=>444,'y'=>444,'z'=>389,'{'=>400,'|'=>275,'}'=>400,'~'=>541,chr(127)=>350,chr(128)=>500,chr(129)=>350,chr(130)=>333,chr(131)=>500,
- chr(132)=>556,chr(133)=>889,chr(134)=>500,chr(135)=>500,chr(136)=>333,chr(137)=>1000,chr(138)=>500,chr(139)=>333,chr(140)=>944,chr(141)=>350,chr(142)=>556,chr(143)=>350,chr(144)=>350,chr(145)=>333,chr(146)=>333,chr(147)=>556,chr(148)=>556,chr(149)=>350,chr(150)=>500,chr(151)=>889,chr(152)=>333,chr(153)=>980,
- chr(154)=>389,chr(155)=>333,chr(156)=>667,chr(157)=>350,chr(158)=>389,chr(159)=>556,chr(160)=>250,chr(161)=>389,chr(162)=>500,chr(163)=>500,chr(164)=>500,chr(165)=>500,chr(166)=>275,chr(167)=>500,chr(168)=>333,chr(169)=>760,chr(170)=>276,chr(171)=>500,chr(172)=>675,chr(173)=>333,chr(174)=>760,chr(175)=>333,
- chr(176)=>400,chr(177)=>675,chr(178)=>300,chr(179)=>300,chr(180)=>333,chr(181)=>500,chr(182)=>523,chr(183)=>250,chr(184)=>333,chr(185)=>300,chr(186)=>310,chr(187)=>500,chr(188)=>750,chr(189)=>750,chr(190)=>750,chr(191)=>500,chr(192)=>611,chr(193)=>611,chr(194)=>611,chr(195)=>611,chr(196)=>611,chr(197)=>611,
- chr(198)=>889,chr(199)=>667,chr(200)=>611,chr(201)=>611,chr(202)=>611,chr(203)=>611,chr(204)=>333,chr(205)=>333,chr(206)=>333,chr(207)=>333,chr(208)=>722,chr(209)=>667,chr(210)=>722,chr(211)=>722,chr(212)=>722,chr(213)=>722,chr(214)=>722,chr(215)=>675,chr(216)=>722,chr(217)=>722,chr(218)=>722,chr(219)=>722,
- chr(220)=>722,chr(221)=>556,chr(222)=>611,chr(223)=>500,chr(224)=>500,chr(225)=>500,chr(226)=>500,chr(227)=>500,chr(228)=>500,chr(229)=>500,chr(230)=>667,chr(231)=>444,chr(232)=>444,chr(233)=>444,chr(234)=>444,chr(235)=>444,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>500,chr(241)=>500,
- chr(242)=>500,chr(243)=>500,chr(244)=>500,chr(245)=>500,chr(246)=>500,chr(247)=>675,chr(248)=>500,chr(249)=>500,chr(250)=>500,chr(251)=>500,chr(252)=>500,chr(253)=>444,chr(254)=>500,chr(255)=>444);
-?>
+250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250,
+ chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>333,'"'=>420,'#'=>500,'$'=>500,'%'=>833,'&'=>778,'\''=>214,'('=>333,')'=>333,'*'=>500,'+'=>675,
+ ','=>250,'-'=>333,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>333,';'=>333,'<'=>675,'='=>675,'>'=>675,'?'=>500,'@'=>920,'A'=>611,
+ 'B'=>611,'C'=>667,'D'=>722,'E'=>611,'F'=>611,'G'=>722,'H'=>722,'I'=>333,'J'=>444,'K'=>667,'L'=>556,'M'=>833,'N'=>667,'O'=>722,'P'=>611,'Q'=>722,'R'=>611,'S'=>500,'T'=>556,'U'=>722,'V'=>611,'W'=>833,
+ 'X'=>611,'Y'=>556,'Z'=>556,'['=>389,'\\'=>278,']'=>389,'^'=>422,'_'=>500,'`'=>333,'a'=>500,'b'=>500,'c'=>444,'d'=>500,'e'=>444,'f'=>278,'g'=>500,'h'=>500,'i'=>278,'j'=>278,'k'=>444,'l'=>278,'m'=>722,
+ 'n'=>500,'o'=>500,'p'=>500,'q'=>500,'r'=>389,'s'=>389,'t'=>278,'u'=>500,'v'=>444,'w'=>667,'x'=>444,'y'=>444,'z'=>389,'{'=>400,'|'=>275,'}'=>400,'~'=>541,chr(127)=>350,chr(128)=>500,chr(129)=>350,chr(130)=>333,chr(131)=>500,
+ chr(132)=>556,chr(133)=>889,chr(134)=>500,chr(135)=>500,chr(136)=>333,chr(137)=>1000,chr(138)=>500,chr(139)=>333,chr(140)=>944,chr(141)=>350,chr(142)=>556,chr(143)=>350,chr(144)=>350,chr(145)=>333,chr(146)=>333,chr(147)=>556,chr(148)=>556,chr(149)=>350,chr(150)=>500,chr(151)=>889,chr(152)=>333,chr(153)=>980,
+ chr(154)=>389,chr(155)=>333,chr(156)=>667,chr(157)=>350,chr(158)=>389,chr(159)=>556,chr(160)=>250,chr(161)=>389,chr(162)=>500,chr(163)=>500,chr(164)=>500,chr(165)=>500,chr(166)=>275,chr(167)=>500,chr(168)=>333,chr(169)=>760,chr(170)=>276,chr(171)=>500,chr(172)=>675,chr(173)=>333,chr(174)=>760,chr(175)=>333,
+ chr(176)=>400,chr(177)=>675,chr(178)=>300,chr(179)=>300,chr(180)=>333,chr(181)=>500,chr(182)=>523,chr(183)=>250,chr(184)=>333,chr(185)=>300,chr(186)=>310,chr(187)=>500,chr(188)=>750,chr(189)=>750,chr(190)=>750,chr(191)=>500,chr(192)=>611,chr(193)=>611,chr(194)=>611,chr(195)=>611,chr(196)=>611,chr(197)=>611,
+ chr(198)=>889,chr(199)=>667,chr(200)=>611,chr(201)=>611,chr(202)=>611,chr(203)=>611,chr(204)=>333,chr(205)=>333,chr(206)=>333,chr(207)=>333,chr(208)=>722,chr(209)=>667,chr(210)=>722,chr(211)=>722,chr(212)=>722,chr(213)=>722,chr(214)=>722,chr(215)=>675,chr(216)=>722,chr(217)=>722,chr(218)=>722,chr(219)=>722,
+ chr(220)=>722,chr(221)=>556,chr(222)=>611,chr(223)=>500,chr(224)=>500,chr(225)=>500,chr(226)=>500,chr(227)=>500,chr(228)=>500,chr(229)=>500,chr(230)=>667,chr(231)=>444,chr(232)=>444,chr(233)=>444,chr(234)=>444,chr(235)=>444,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>500,chr(241)=>500,
+ chr(242)=>500,chr(243)=>500,chr(244)=>500,chr(245)=>500,chr(246)=>500,chr(247)=>675,chr(248)=>500,chr(249)=>500,chr(250)=>500,chr(251)=>500,chr(252)=>500,chr(253)=>444,chr(254)=>500,chr(255)=>444);
+?>
diff --git a/main/inc/lib/html2pdf/_fpdf/font/zapfdingbats.php b/main/inc/lib/html2pdf/_fpdf/font/zapfdingbats.php
index f2bdfd5c94..1f926a8c3f 100755
--- a/main/inc/lib/html2pdf/_fpdf/font/zapfdingbats.php
+++ b/main/inc/lib/html2pdf/_fpdf/font/zapfdingbats.php
@@ -1,15 +1,15 @@
-0,chr(1)=>0,chr(2)=>0,chr(3)=>0,chr(4)=>0,chr(5)=>0,chr(6)=>0,chr(7)=>0,chr(8)=>0,chr(9)=>0,chr(10)=>0,chr(11)=>0,chr(12)=>0,chr(13)=>0,chr(14)=>0,chr(15)=>0,chr(16)=>0,chr(17)=>0,chr(18)=>0,chr(19)=>0,chr(20)=>0,chr(21)=>0,
- chr(22)=>0,chr(23)=>0,chr(24)=>0,chr(25)=>0,chr(26)=>0,chr(27)=>0,chr(28)=>0,chr(29)=>0,chr(30)=>0,chr(31)=>0,' '=>278,'!'=>974,'"'=>961,'#'=>974,'$'=>980,'%'=>719,'&'=>789,'\''=>790,'('=>791,')'=>690,'*'=>960,'+'=>939,
- ','=>549,'-'=>855,'.'=>911,'/'=>933,'0'=>911,'1'=>945,'2'=>974,'3'=>755,'4'=>846,'5'=>762,'6'=>761,'7'=>571,'8'=>677,'9'=>763,':'=>760,';'=>759,'<'=>754,'='=>494,'>'=>552,'?'=>537,'@'=>577,'A'=>692,
- 'B'=>786,'C'=>788,'D'=>788,'E'=>790,'F'=>793,'G'=>794,'H'=>816,'I'=>823,'J'=>789,'K'=>841,'L'=>823,'M'=>833,'N'=>816,'O'=>831,'P'=>923,'Q'=>744,'R'=>723,'S'=>749,'T'=>790,'U'=>792,'V'=>695,'W'=>776,
- 'X'=>768,'Y'=>792,'Z'=>759,'['=>707,'\\'=>708,']'=>682,'^'=>701,'_'=>826,'`'=>815,'a'=>789,'b'=>789,'c'=>707,'d'=>687,'e'=>696,'f'=>689,'g'=>786,'h'=>787,'i'=>713,'j'=>791,'k'=>785,'l'=>791,'m'=>873,
- 'n'=>761,'o'=>762,'p'=>762,'q'=>759,'r'=>759,'s'=>892,'t'=>892,'u'=>788,'v'=>784,'w'=>438,'x'=>138,'y'=>277,'z'=>415,'{'=>392,'|'=>392,'}'=>668,'~'=>668,chr(127)=>0,chr(128)=>390,chr(129)=>390,chr(130)=>317,chr(131)=>317,
- chr(132)=>276,chr(133)=>276,chr(134)=>509,chr(135)=>509,chr(136)=>410,chr(137)=>410,chr(138)=>234,chr(139)=>234,chr(140)=>334,chr(141)=>334,chr(142)=>0,chr(143)=>0,chr(144)=>0,chr(145)=>0,chr(146)=>0,chr(147)=>0,chr(148)=>0,chr(149)=>0,chr(150)=>0,chr(151)=>0,chr(152)=>0,chr(153)=>0,
- chr(154)=>0,chr(155)=>0,chr(156)=>0,chr(157)=>0,chr(158)=>0,chr(159)=>0,chr(160)=>0,chr(161)=>732,chr(162)=>544,chr(163)=>544,chr(164)=>910,chr(165)=>667,chr(166)=>760,chr(167)=>760,chr(168)=>776,chr(169)=>595,chr(170)=>694,chr(171)=>626,chr(172)=>788,chr(173)=>788,chr(174)=>788,chr(175)=>788,
- chr(176)=>788,chr(177)=>788,chr(178)=>788,chr(179)=>788,chr(180)=>788,chr(181)=>788,chr(182)=>788,chr(183)=>788,chr(184)=>788,chr(185)=>788,chr(186)=>788,chr(187)=>788,chr(188)=>788,chr(189)=>788,chr(190)=>788,chr(191)=>788,chr(192)=>788,chr(193)=>788,chr(194)=>788,chr(195)=>788,chr(196)=>788,chr(197)=>788,
- chr(198)=>788,chr(199)=>788,chr(200)=>788,chr(201)=>788,chr(202)=>788,chr(203)=>788,chr(204)=>788,chr(205)=>788,chr(206)=>788,chr(207)=>788,chr(208)=>788,chr(209)=>788,chr(210)=>788,chr(211)=>788,chr(212)=>894,chr(213)=>838,chr(214)=>1016,chr(215)=>458,chr(216)=>748,chr(217)=>924,chr(218)=>748,chr(219)=>918,
- chr(220)=>927,chr(221)=>928,chr(222)=>928,chr(223)=>834,chr(224)=>873,chr(225)=>828,chr(226)=>924,chr(227)=>924,chr(228)=>917,chr(229)=>930,chr(230)=>931,chr(231)=>463,chr(232)=>883,chr(233)=>836,chr(234)=>836,chr(235)=>867,chr(236)=>867,chr(237)=>696,chr(238)=>696,chr(239)=>874,chr(240)=>0,chr(241)=>874,
- chr(242)=>760,chr(243)=>946,chr(244)=>771,chr(245)=>865,chr(246)=>771,chr(247)=>888,chr(248)=>967,chr(249)=>888,chr(250)=>831,chr(251)=>873,chr(252)=>927,chr(253)=>970,chr(254)=>918,chr(255)=>0);
-?>
+0,chr(1)=>0,chr(2)=>0,chr(3)=>0,chr(4)=>0,chr(5)=>0,chr(6)=>0,chr(7)=>0,chr(8)=>0,chr(9)=>0,chr(10)=>0,chr(11)=>0,chr(12)=>0,chr(13)=>0,chr(14)=>0,chr(15)=>0,chr(16)=>0,chr(17)=>0,chr(18)=>0,chr(19)=>0,chr(20)=>0,chr(21)=>0,
+ chr(22)=>0,chr(23)=>0,chr(24)=>0,chr(25)=>0,chr(26)=>0,chr(27)=>0,chr(28)=>0,chr(29)=>0,chr(30)=>0,chr(31)=>0,' '=>278,'!'=>974,'"'=>961,'#'=>974,'$'=>980,'%'=>719,'&'=>789,'\''=>790,'('=>791,')'=>690,'*'=>960,'+'=>939,
+ ','=>549,'-'=>855,'.'=>911,'/'=>933,'0'=>911,'1'=>945,'2'=>974,'3'=>755,'4'=>846,'5'=>762,'6'=>761,'7'=>571,'8'=>677,'9'=>763,':'=>760,';'=>759,'<'=>754,'='=>494,'>'=>552,'?'=>537,'@'=>577,'A'=>692,
+ 'B'=>786,'C'=>788,'D'=>788,'E'=>790,'F'=>793,'G'=>794,'H'=>816,'I'=>823,'J'=>789,'K'=>841,'L'=>823,'M'=>833,'N'=>816,'O'=>831,'P'=>923,'Q'=>744,'R'=>723,'S'=>749,'T'=>790,'U'=>792,'V'=>695,'W'=>776,
+ 'X'=>768,'Y'=>792,'Z'=>759,'['=>707,'\\'=>708,']'=>682,'^'=>701,'_'=>826,'`'=>815,'a'=>789,'b'=>789,'c'=>707,'d'=>687,'e'=>696,'f'=>689,'g'=>786,'h'=>787,'i'=>713,'j'=>791,'k'=>785,'l'=>791,'m'=>873,
+ 'n'=>761,'o'=>762,'p'=>762,'q'=>759,'r'=>759,'s'=>892,'t'=>892,'u'=>788,'v'=>784,'w'=>438,'x'=>138,'y'=>277,'z'=>415,'{'=>392,'|'=>392,'}'=>668,'~'=>668,chr(127)=>0,chr(128)=>390,chr(129)=>390,chr(130)=>317,chr(131)=>317,
+ chr(132)=>276,chr(133)=>276,chr(134)=>509,chr(135)=>509,chr(136)=>410,chr(137)=>410,chr(138)=>234,chr(139)=>234,chr(140)=>334,chr(141)=>334,chr(142)=>0,chr(143)=>0,chr(144)=>0,chr(145)=>0,chr(146)=>0,chr(147)=>0,chr(148)=>0,chr(149)=>0,chr(150)=>0,chr(151)=>0,chr(152)=>0,chr(153)=>0,
+ chr(154)=>0,chr(155)=>0,chr(156)=>0,chr(157)=>0,chr(158)=>0,chr(159)=>0,chr(160)=>0,chr(161)=>732,chr(162)=>544,chr(163)=>544,chr(164)=>910,chr(165)=>667,chr(166)=>760,chr(167)=>760,chr(168)=>776,chr(169)=>595,chr(170)=>694,chr(171)=>626,chr(172)=>788,chr(173)=>788,chr(174)=>788,chr(175)=>788,
+ chr(176)=>788,chr(177)=>788,chr(178)=>788,chr(179)=>788,chr(180)=>788,chr(181)=>788,chr(182)=>788,chr(183)=>788,chr(184)=>788,chr(185)=>788,chr(186)=>788,chr(187)=>788,chr(188)=>788,chr(189)=>788,chr(190)=>788,chr(191)=>788,chr(192)=>788,chr(193)=>788,chr(194)=>788,chr(195)=>788,chr(196)=>788,chr(197)=>788,
+ chr(198)=>788,chr(199)=>788,chr(200)=>788,chr(201)=>788,chr(202)=>788,chr(203)=>788,chr(204)=>788,chr(205)=>788,chr(206)=>788,chr(207)=>788,chr(208)=>788,chr(209)=>788,chr(210)=>788,chr(211)=>788,chr(212)=>894,chr(213)=>838,chr(214)=>1016,chr(215)=>458,chr(216)=>748,chr(217)=>924,chr(218)=>748,chr(219)=>918,
+ chr(220)=>927,chr(221)=>928,chr(222)=>928,chr(223)=>834,chr(224)=>873,chr(225)=>828,chr(226)=>924,chr(227)=>924,chr(228)=>917,chr(229)=>930,chr(230)=>931,chr(231)=>463,chr(232)=>883,chr(233)=>836,chr(234)=>836,chr(235)=>867,chr(236)=>867,chr(237)=>696,chr(238)=>696,chr(239)=>874,chr(240)=>0,chr(241)=>874,
+ chr(242)=>760,chr(243)=>946,chr(244)=>771,chr(245)=>865,chr(246)=>771,chr(247)=>888,chr(248)=>967,chr(249)=>888,chr(250)=>831,chr(251)=>873,chr(252)=>927,chr(253)=>970,chr(254)=>918,chr(255)=>0);
+?>
diff --git a/main/inc/lib/html2pdf/_fpdf/fpdf.php b/main/inc/lib/html2pdf/_fpdf/fpdf.php
index ae10e3dc2a..d14c8d7505 100755
--- a/main/inc/lib/html2pdf/_fpdf/fpdf.php
+++ b/main/inc/lib/html2pdf/_fpdf/fpdf.php
@@ -1,1734 +1,1736 @@
-_dochecks();
- //Initialization of properties
- $this->page=0;
- $this->n=2;
- $this->buffer='';
- $this->pages=array();
- $this->PageSizes=array();
- $this->state=0;
- $this->fonts=array();
- $this->FontFiles=array();
- $this->diffs=array();
- $this->images=array();
- $this->links=array();
- $this->InHeader=false;
- $this->InFooter=false;
- $this->lasth=0;
- $this->FontFamily='';
- $this->FontStyle='';
- $this->FontSizePt=12;
- $this->underline=false;
- $this->DrawColor='0 G';
- $this->FillColor='0 g';
- $this->TextColor='0 g';
- $this->ColorFlag=false;
- $this->ws=0;
- //Standard fonts
- $this->CoreFonts=array('courier'=>'Courier', 'courierB'=>'Courier-Bold', 'courierI'=>'Courier-Oblique', 'courierBI'=>'Courier-BoldOblique',
- 'helvetica'=>'Helvetica', 'helveticaB'=>'Helvetica-Bold', 'helveticaI'=>'Helvetica-Oblique', 'helveticaBI'=>'Helvetica-BoldOblique',
- 'times'=>'Times-Roman', 'timesB'=>'Times-Bold', 'timesI'=>'Times-Italic', 'timesBI'=>'Times-BoldItalic',
- 'symbol'=>'Symbol', 'zapfdingbats'=>'ZapfDingbats');
- //Scale factor
- if($unit=='pt')
- $this->k=1;
- elseif($unit=='mm')
- $this->k=72/25.4;
- elseif($unit=='cm')
- $this->k=72/2.54;
- elseif($unit=='in')
- $this->k=72;
- else
- $this->Error('Incorrect unit: '.$unit);
- //Page format
- $this->PageFormats=array('a3'=>array(841.89,1190.55), 'a4'=>array(595.28,841.89), 'a5'=>array(420.94,595.28),
- 'letter'=>array(612,792), 'legal'=>array(612,1008));
- if(is_string($format))
- $format=$this->_getpageformat($format);
- $this->DefPageFormat=$format;
- $this->CurPageFormat=$format;
- //Page orientation
- $orientation=strtolower($orientation);
- if($orientation=='p' || $orientation=='portrait')
- {
- $this->DefOrientation='P';
- $this->w=$this->DefPageFormat[0];
- $this->h=$this->DefPageFormat[1];
- }
- elseif($orientation=='l' || $orientation=='landscape')
- {
- $this->DefOrientation='L';
- $this->w=$this->DefPageFormat[1];
- $this->h=$this->DefPageFormat[0];
- }
- else
- $this->Error('Incorrect orientation: '.$orientation);
- $this->CurOrientation=$this->DefOrientation;
- $this->wPt=$this->w*$this->k;
- $this->hPt=$this->h*$this->k;
- //Page margins (1 cm)
- $margin=28.35/$this->k;
- $this->SetMargins($margin,$margin);
- //Interior cell margin (1 mm)
- $this->cMargin=$margin/10;
- //Line width (0.2 mm)
- $this->LineWidth=.567/$this->k;
- //Automatic page break
- $this->SetAutoPageBreak(true,2*$margin);
- //Full width display mode
- $this->SetDisplayMode('fullwidth');
- //Enable compression
- $this->SetCompression(true);
- //Set default PDF version number
- $this->PDFVersion='1.3';
-}
-
-function SetMargins($left, $top, $right=null)
-{
- //Set left, top and right margins
- $this->lMargin=$left;
- $this->tMargin=$top;
- if($right===null)
- $right=$left;
- $this->rMargin=$right;
-}
-
-function SetLeftMargin($margin)
-{
- //Set left margin
- $this->lMargin=$margin;
- if($this->page>0 && $this->x<$margin)
- $this->x=$margin;
-}
-
-function SetTopMargin($margin)
-{
- //Set top margin
- $this->tMargin=$margin;
-}
-
-function SetRightMargin($margin)
-{
- //Set right margin
- $this->rMargin=$margin;
-}
-
-function SetAutoPageBreak($auto, $margin=0)
-{
- //Set auto page break mode and triggering margin
- $this->AutoPageBreak=$auto;
- $this->bMargin=$margin;
- $this->PageBreakTrigger=$this->h-$margin;
-}
-
-function SetDisplayMode($zoom, $layout='continuous')
-{
- //Set display mode in viewer
- if($zoom=='fullpage' || $zoom=='fullwidth' || $zoom=='real' || $zoom=='default' || !is_string($zoom))
- $this->ZoomMode=$zoom;
- else
- $this->Error('Incorrect zoom display mode: '.$zoom);
- if($layout=='single' || $layout=='continuous' || $layout=='two' || $layout=='default')
- $this->LayoutMode=$layout;
- else
- $this->Error('Incorrect layout display mode: '.$layout);
-}
-
-function SetCompression($compress)
-{
- //Set page compression
- if(function_exists('gzcompress'))
- $this->compress=$compress;
- else
- $this->compress=false;
-}
-
-function SetTitle($title, $isUTF8=false)
-{
- //Title of document
- if($isUTF8)
- $title=$this->_UTF8toUTF16($title);
- $this->title=$title;
-}
-
-function SetSubject($subject, $isUTF8=false)
-{
- //Subject of document
- if($isUTF8)
- $subject=$this->_UTF8toUTF16($subject);
- $this->subject=$subject;
-}
-
-function SetAuthor($author, $isUTF8=false)
-{
- //Author of document
- if($isUTF8)
- $author=$this->_UTF8toUTF16($author);
- $this->author=$author;
-}
-
-function SetKeywords($keywords, $isUTF8=false)
-{
- //Keywords of document
- if($isUTF8)
- $keywords=$this->_UTF8toUTF16($keywords);
- $this->keywords=$keywords;
-}
-
-function SetCreator($creator, $isUTF8=false)
-{
- //Creator of document
- if($isUTF8)
- $creator=$this->_UTF8toUTF16($creator);
- $this->creator=$creator;
-}
-
-function AliasNbPages($alias='{nb}')
-{
- //Define an alias for total number of pages
- $this->AliasNbPages=$alias;
-}
-
-function Error($msg)
-{
- //Fatal error
- die('FPDF error: '.$msg);
-}
-
-function Open()
-{
- //Begin document
- $this->state=1;
-}
-
-function Close()
-{
- //Terminate document
- if($this->state==3)
- return;
- if($this->page==0)
- $this->AddPage();
- //Page footer
- $this->InFooter=true;
- $this->Footer();
- $this->InFooter=false;
- //Close page
- $this->_endpage();
- //Close document
- $this->_enddoc();
-}
-
-function AddPage($orientation='', $format='')
-{
- //Start a new page
- if($this->state==0)
- $this->Open();
- $family=$this->FontFamily;
- $style=$this->FontStyle.($this->underline ? 'U' : '');
- $size=$this->FontSizePt;
- $lw=$this->LineWidth;
- $dc=$this->DrawColor;
- $fc=$this->FillColor;
- $tc=$this->TextColor;
- $cf=$this->ColorFlag;
- if($this->page>0)
- {
- //Page footer
- $this->InFooter=true;
- $this->Footer();
- $this->InFooter=false;
- //Close page
- $this->_endpage();
- }
- //Start new page
- $this->_beginpage($orientation,$format);
- //Set line cap style to square
- $this->_out('2 J');
- //Set line width
- $this->LineWidth=$lw;
- $this->_out(sprintf('%.2F w',$lw*$this->k));
- //Set font
- if($family)
- $this->SetFont($family,$style,$size);
- //Set colors
- $this->DrawColor=$dc;
- if($dc!='0 G')
- $this->_out($dc);
- $this->FillColor=$fc;
- if($fc!='0 g')
- $this->_out($fc);
- $this->TextColor=$tc;
- $this->ColorFlag=$cf;
- //Page header
- $this->InHeader=true;
- $this->Header();
- $this->InHeader=false;
- //Restore line width
- if($this->LineWidth!=$lw)
- {
- $this->LineWidth=$lw;
- $this->_out(sprintf('%.2F w',$lw*$this->k));
- }
- //Restore font
- if($family)
- $this->SetFont($family,$style,$size);
- //Restore colors
- if($this->DrawColor!=$dc)
- {
- $this->DrawColor=$dc;
- $this->_out($dc);
- }
- if($this->FillColor!=$fc)
- {
- $this->FillColor=$fc;
- $this->_out($fc);
- }
- $this->TextColor=$tc;
- $this->ColorFlag=$cf;
-}
-
-function Header()
-{
- //To be implemented in your own inherited class
-}
-
-function Footer()
-{
- //To be implemented in your own inherited class
-}
-
-function PageNo()
-{
- //Get current page number
- return $this->page;
-}
-
-function SetDrawColor($r, $g=null, $b=null)
-{
- //Set color for all stroking operations
- if(($r==0 && $g==0 && $b==0) || $g===null)
- $this->DrawColor=sprintf('%.3F G',$r/255);
- else
- $this->DrawColor=sprintf('%.3F %.3F %.3F RG',$r/255,$g/255,$b/255);
- if($this->page>0)
- $this->_out($this->DrawColor);
-}
-
-function SetFillColor($r, $g=null, $b=null)
-{
- //Set color for all filling operations
- if(($r==0 && $g==0 && $b==0) || $g===null)
- $this->FillColor=sprintf('%.3F g',$r/255);
- else
- $this->FillColor=sprintf('%.3F %.3F %.3F rg',$r/255,$g/255,$b/255);
- $this->ColorFlag=($this->FillColor!=$this->TextColor);
- if($this->page>0)
- $this->_out($this->FillColor);
-}
-
-function SetTextColor($r, $g=null, $b=null)
-{
- //Set color for text
- if(($r==0 && $g==0 && $b==0) || $g===null)
- $this->TextColor=sprintf('%.3F g',$r/255);
- else
- $this->TextColor=sprintf('%.3F %.3F %.3F rg',$r/255,$g/255,$b/255);
- $this->ColorFlag=($this->FillColor!=$this->TextColor);
-}
-
-function GetStringWidth($s)
-{
- //Get width of a string in the current font
- $s=(string)$s;
- $cw=&$this->CurrentFont['cw'];
- $w=0;
- $l=strlen($s);
- for($i=0;$i<$l;$i++)
- $w+=$cw[$s[$i]];
- return $w*$this->FontSize/1000;
-}
-
-function SetLineWidth($width)
-{
- //Set line width
- $this->LineWidth=$width;
- if($this->page>0)
- $this->_out(sprintf('%.2F w',$width*$this->k));
-}
-
-function Line($x1, $y1, $x2, $y2)
-{
- //Draw a line
- $this->_out(sprintf('%.2F %.2F m %.2F %.2F l S',$x1*$this->k,($this->h-$y1)*$this->k,$x2*$this->k,($this->h-$y2)*$this->k));
-}
-
-function Rect($x, $y, $w, $h, $style='')
-{
- //Draw a rectangle
- if($style=='F')
- $op='f';
- elseif($style=='FD' || $style=='DF')
- $op='B';
- else
- $op='S';
- $this->_out(sprintf('%.2F %.2F %.2F %.2F re %s',$x*$this->k,($this->h-$y)*$this->k,$w*$this->k,-$h*$this->k,$op));
-}
-
-function AddFont($family, $style='', $file='')
-{
- //Add a TrueType or Type1 font
- $family=strtolower($family);
- if($file=='')
- $file=str_replace(' ','',$family).strtolower($style).'.php';
- if($family=='arial')
- $family='helvetica';
- $style=strtoupper($style);
- if($style=='IB')
- $style='BI';
- $fontkey=$family.$style;
- if(isset($this->fonts[$fontkey]))
- return;
- include($this->_getfontpath().$file);
- if(!isset($name))
- $this->Error('Could not include font definition file');
- $i=count($this->fonts)+1;
- $this->fonts[$fontkey]=array('i'=>$i, 'type'=>$type, 'name'=>$name, 'desc'=>$desc, 'up'=>$up, 'ut'=>$ut, 'cw'=>$cw, 'enc'=>$enc, 'file'=>$file);
- if($diff)
- {
- //Search existing encodings
- $d=0;
- $nb=count($this->diffs);
- for($i=1;$i<=$nb;$i++)
- {
- if($this->diffs[$i]==$diff)
- {
- $d=$i;
- break;
- }
- }
- if($d==0)
- {
- $d=$nb+1;
- $this->diffs[$d]=$diff;
- }
- $this->fonts[$fontkey]['diff']=$d;
- }
- if($file)
- {
- if($type=='TrueType')
- $this->FontFiles[$file]=array('length1'=>$originalsize);
- else
- $this->FontFiles[$file]=array('length1'=>$size1, 'length2'=>$size2);
- }
-}
-
-function SetFont($family, $style='', $size=0)
-{
- //Select a font; size given in points
- global $fpdf_charwidths;
-
- $family=strtolower($family);
- if($family=='')
- $family=$this->FontFamily;
- if($family=='arial')
- $family='helvetica';
- elseif($family=='symbol' || $family=='zapfdingbats')
- $style='';
- $style=strtoupper($style);
- if(strpos($style,'U')!==false)
- {
- $this->underline=true;
- $style=str_replace('U','',$style);
- }
- else
- $this->underline=false;
- if($style=='IB')
- $style='BI';
- if($size==0)
- $size=$this->FontSizePt;
- //Test if font is already selected
- if($this->FontFamily==$family && $this->FontStyle==$style && $this->FontSizePt==$size)
- return;
- //Test if used for the first time
- $fontkey=$family.$style;
- if(!isset($this->fonts[$fontkey]))
- {
- //Check if one of the standard fonts
- if(isset($this->CoreFonts[$fontkey]))
- {
- if(!isset($fpdf_charwidths[$fontkey]))
- {
- //Load metric file
- $file=$family;
- if($family=='times' || $family=='helvetica')
- $file.=strtolower($style);
- include($this->_getfontpath().$file.'.php');
- if(!isset($fpdf_charwidths[$fontkey]))
- $this->Error('Could not include font metric file');
- }
- $i=count($this->fonts)+1;
- $name=$this->CoreFonts[$fontkey];
- $cw=$fpdf_charwidths[$fontkey];
- $this->fonts[$fontkey]=array('i'=>$i, 'type'=>'core', 'name'=>$name, 'up'=>-100, 'ut'=>50, 'cw'=>$cw);
- }
- else
- $this->Error('Undefined font: '.$family.' '.$style);
- }
- //Select it
- $this->FontFamily=$family;
- $this->FontStyle=$style;
- $this->FontSizePt=$size;
- $this->FontSize=$size/$this->k;
- $this->CurrentFont=&$this->fonts[$fontkey];
- if($this->page>0)
- $this->_out(sprintf('BT /F%d %.2F Tf ET',$this->CurrentFont['i'],$this->FontSizePt));
-}
-
-function SetFontSize($size)
-{
- //Set font size in points
- if($this->FontSizePt==$size)
- return;
- $this->FontSizePt=$size;
- $this->FontSize=$size/$this->k;
- if($this->page>0)
- $this->_out(sprintf('BT /F%d %.2F Tf ET',$this->CurrentFont['i'],$this->FontSizePt));
-}
-
-function AddLink()
-{
- //Create a new internal link
- $n=count($this->links)+1;
- $this->links[$n]=array(0, 0);
- return $n;
-}
-
-function SetLink($link, $y=0, $page=-1)
-{
- //Set destination of internal link
- if($y==-1)
- $y=$this->y;
- if($page==-1)
- $page=$this->page;
- $this->links[$link]=array($page, $y);
-}
-
-function Link($x, $y, $w, $h, $link)
-{
- //Put a link on the page
- $this->PageLinks[$this->page][]=array($x*$this->k, $this->hPt-$y*$this->k, $w*$this->k, $h*$this->k, $link);
-}
-
-function Text($x, $y, $txt)
-{
- //Output a string
- $s=sprintf('BT %.2F %.2F Td (%s) Tj ET',$x*$this->k,($this->h-$y)*$this->k,$this->_escape($txt));
- if ($txt!='')
- {
- if($this->underline) $s.=' '.$this->_dounderline($x,$y,$txt);
- }
- if($this->ColorFlag)
- $s='q '.$this->TextColor.' '.$s.' Q';
- $this->_out($s);
-}
-
-function AcceptPageBreak()
-{
- //Accept automatic page break or not
- return $this->AutoPageBreak;
-}
-
-function Cell($w, $h=0, $txt='', $border=0, $ln=0, $align='', $fill=false, $link='')
-{
- //Output a cell
- $k=$this->k;
- if($this->y+$h>$this->PageBreakTrigger && !$this->InHeader && !$this->InFooter && $this->AcceptPageBreak())
- {
- //Automatic page break
- $x=$this->x;
- $ws=$this->ws;
- if($ws>0)
- {
- $this->ws=0;
- $this->_out('0 Tw');
- }
- $this->AddPage($this->CurOrientation,$this->CurPageFormat);
- $this->x=$x;
- if($ws>0)
- {
- $this->ws=$ws;
- $this->_out(sprintf('%.3F Tw',$ws*$k));
- }
- }
- if($w==0)
- $w=$this->w-$this->rMargin-$this->x;
- $s='';
- if($fill || $border==1)
- {
- if($fill)
- $op=($border==1) ? 'B' : 'f';
- else
- $op='S';
- $s=sprintf('%.2F %.2F %.2F %.2F re %s ',$this->x*$k,($this->h-$this->y)*$k,$w*$k,-$h*$k,$op);
- }
- if(is_string($border))
- {
- $x=$this->x;
- $y=$this->y;
- if(strpos($border,'L')!==false)
- $s.=sprintf('%.2F %.2F m %.2F %.2F l S ',$x*$k,($this->h-$y)*$k,$x*$k,($this->h-($y+$h))*$k);
- if(strpos($border,'T')!==false)
- $s.=sprintf('%.2F %.2F m %.2F %.2F l S ',$x*$k,($this->h-$y)*$k,($x+$w)*$k,($this->h-$y)*$k);
- if(strpos($border,'R')!==false)
- $s.=sprintf('%.2F %.2F m %.2F %.2F l S ',($x+$w)*$k,($this->h-$y)*$k,($x+$w)*$k,($this->h-($y+$h))*$k);
- if(strpos($border,'B')!==false)
- $s.=sprintf('%.2F %.2F m %.2F %.2F l S ',$x*$k,($this->h-($y+$h))*$k,($x+$w)*$k,($this->h-($y+$h))*$k);
- }
- if($txt!=='')
- {
- if($align=='R')
- $dx=$w-$this->cMargin-$this->GetStringWidth($txt);
- elseif($align=='C')
- $dx=($w-$this->GetStringWidth($txt))/2;
- else
- $dx=$this->cMargin;
- if($this->ColorFlag)
- $s.='q '.$this->TextColor.' ';
- $txt2=str_replace(')','\\)',str_replace('(','\\(',str_replace('\\','\\\\',$txt)));
- $s.=sprintf('BT %.2F %.2F Td (%s) Tj ET',($this->x+$dx)*$k,($this->h-($this->y+.5*$h+.3*$this->FontSize))*$k,$txt2);
- if($this->underline)
- $s.=' '.$this->_dounderline($this->x+$dx,$this->y+.5*$h+.3*$this->FontSize,$txt);
- if($this->ColorFlag)
- $s.=' Q';
- if($link)
- $this->Link($this->x+$dx,$this->y+.5*$h-.5*$this->FontSize,$this->GetStringWidth($txt),$this->FontSize,$link);
- }
- if($s)
- $this->_out($s);
- $this->lasth=$h;
- if($ln>0)
- {
- //Go to next line
- $this->y+=$h;
- if($ln==1)
- $this->x=$this->lMargin;
- }
- else
- $this->x+=$w;
-}
-
-function MultiCell($w, $h, $txt, $border=0, $align='J', $fill=false)
-{
- //Output text with automatic or explicit line breaks
- $cw=&$this->CurrentFont['cw'];
- if($w==0)
- $w=$this->w-$this->rMargin-$this->x;
- $wmax=($w-2*$this->cMargin)*1000/$this->FontSize;
- $s=str_replace("\r",'',$txt);
- $nb=strlen($s);
- if($nb>0 && $s[$nb-1]=="\n")
- $nb--;
- $b=0;
- if($border)
- {
- if($border==1)
- {
- $border='LTRB';
- $b='LRT';
- $b2='LR';
- }
- else
- {
- $b2='';
- if(strpos($border,'L')!==false)
- $b2.='L';
- if(strpos($border,'R')!==false)
- $b2.='R';
- $b=(strpos($border,'T')!==false) ? $b2.'T' : $b2;
- }
- }
- $sep=-1;
- $i=0;
- $j=0;
- $l=0;
- $ns=0;
- $nl=1;
- while($i<$nb)
- {
- //Get next character
- $c=$s[$i];
- if($c=="\n")
- {
- //Explicit line break
- if($this->ws>0)
- {
- $this->ws=0;
- $this->_out('0 Tw');
- }
- $this->Cell($w,$h,substr($s,$j,$i-$j),$b,2,$align,$fill);
- $i++;
- $sep=-1;
- $j=$i;
- $l=0;
- $ns=0;
- $nl++;
- if($border && $nl==2)
- $b=$b2;
- continue;
- }
- if($c==' ')
- {
- $sep=$i;
- $ls=$l;
- $ns++;
- }
- $l+=$cw[$c];
- if($l>$wmax)
- {
- //Automatic line break
- if($sep==-1)
- {
- if($i==$j)
- $i++;
- if($this->ws>0)
- {
- $this->ws=0;
- $this->_out('0 Tw');
- }
- $this->Cell($w,$h,substr($s,$j,$i-$j),$b,2,$align,$fill);
- }
- else
- {
- if($align=='J')
- {
- $this->ws=($ns>1) ? ($wmax-$ls)/1000*$this->FontSize/($ns-1) : 0;
- $this->_out(sprintf('%.3F Tw',$this->ws*$this->k));
- }
- $this->Cell($w,$h,substr($s,$j,$sep-$j),$b,2,$align,$fill);
- $i=$sep+1;
- }
- $sep=-1;
- $j=$i;
- $l=0;
- $ns=0;
- $nl++;
- if($border && $nl==2)
- $b=$b2;
- }
- else
- $i++;
- }
- //Last chunk
- if($this->ws>0)
- {
- $this->ws=0;
- $this->_out('0 Tw');
- }
- if($border && strpos($border,'B')!==false)
- $b.='B';
- $this->Cell($w,$h,substr($s,$j,$i-$j),$b,2,$align,$fill);
- $this->x=$this->lMargin;
-}
-
-function Write($h, $txt, $link='')
-{
- //Output text in flowing mode
- $cw=&$this->CurrentFont['cw'];
- $w=$this->w-$this->rMargin-$this->x;
- $wmax=($w-2*$this->cMargin)*1000/$this->FontSize;
- $s=str_replace("\r",'',$txt);
- $nb=strlen($s);
- $sep=-1;
- $i=0;
- $j=0;
- $l=0;
- $nl=1;
- while($i<$nb)
- {
- //Get next character
- $c=$s[$i];
- if($c=="\n")
- {
- //Explicit line break
- $this->Cell($w,$h,substr($s,$j,$i-$j),0,2,'',0,$link);
- $i++;
- $sep=-1;
- $j=$i;
- $l=0;
- if($nl==1)
- {
- $this->x=$this->lMargin;
- $w=$this->w-$this->rMargin-$this->x;
- $wmax=($w-2*$this->cMargin)*1000/$this->FontSize;
- }
- $nl++;
- continue;
- }
- if($c==' ')
- $sep=$i;
- $l+=$cw[$c];
- if($l>$wmax)
- {
- //Automatic line break
- if($sep==-1)
- {
- if($this->x>$this->lMargin)
- {
- //Move to next line
- $this->x=$this->lMargin;
- $this->y+=$h;
- $w=$this->w-$this->rMargin-$this->x;
- $wmax=($w-2*$this->cMargin)*1000/$this->FontSize;
- $i++;
- $nl++;
- continue;
- }
- if($i==$j)
- $i++;
- $this->Cell($w,$h,substr($s,$j,$i-$j),0,2,'',0,$link);
- }
- else
- {
- $this->Cell($w,$h,substr($s,$j,$sep-$j),0,2,'',0,$link);
- $i=$sep+1;
- }
- $sep=-1;
- $j=$i;
- $l=0;
- if($nl==1)
- {
- $this->x=$this->lMargin;
- $w=$this->w-$this->rMargin-$this->x;
- $wmax=($w-2*$this->cMargin)*1000/$this->FontSize;
- }
- $nl++;
- }
- else
- $i++;
- }
- //Last chunk
- if($i!=$j)
- $this->Cell($l/1000*$this->FontSize,$h,substr($s,$j),0,0,'',0,$link);
-}
-
-function Ln($h=null)
-{
- //Line feed; default value is last cell height
- $this->x=$this->lMargin;
- if($h===null)
- $this->y+=$this->lasth;
- else
- $this->y+=$h;
-}
-
-function Image($file, $x=null, $y=null, $w=0, $h=0, $type='', $link='')
-{
- //Put an image on the page
- if(!isset($this->images[$file]))
- {
- //First use of this image, get info
- if($type=='')
- {
- $pos=strrpos($file,'.');
- if(!$pos)
- $this->Error('Image file has no extension and no type was specified: '.$file);
- $type=substr($file,$pos+1);
- }
- $type=strtolower($type);
- if($type=='jpeg')
- $type='jpg';
- $mtd='_parse'.$type;
- if(!method_exists($this,$mtd))
- $this->Error('Unsupported image type: '.$type);
- $info=$this->$mtd($file);
- $info['i']=count($this->images)+1;
- $this->images[$file]=$info;
- }
- else
- $info=$this->images[$file];
- //Automatic width and height calculation if needed
- if($w==0 && $h==0)
- {
- //Put image at 72 dpi
- $w=$info['w']/$this->k;
- $h=$info['h']/$this->k;
- }
- elseif($w==0)
- $w=$h*$info['w']/$info['h'];
- elseif($h==0)
- $h=$w*$info['h']/$info['w'];
- //Flowing mode
- if($y===null)
- {
- if($this->y+$h>$this->PageBreakTrigger && !$this->InHeader && !$this->InFooter && $this->AcceptPageBreak())
- {
- //Automatic page break
- $x2=$this->x;
- $this->AddPage($this->CurOrientation,$this->CurPageFormat);
- $this->x=$x2;
- }
- $y=$this->y;
- $this->y+=$h;
- }
- if($x===null)
- $x=$this->x;
- $this->_out(sprintf('q %.2F 0 0 %.2F %.2F %.2F cm /I%d Do Q',$w*$this->k,$h*$this->k,$x*$this->k,($this->h-($y+$h))*$this->k,$info['i']));
- if($link)
- $this->Link($x,$y,$w,$h,$link);
-}
-
-function GetX()
-{
- //Get x position
- return $this->x;
-}
-
-function SetX($x)
-{
- //Set x position
- if($x>=0)
- $this->x=$x;
- else
- $this->x=$this->w+$x;
-}
-
-function GetY()
-{
- //Get y position
- return $this->y;
-}
-
-function SetY($y)
-{
- //Set y position and reset x
- $this->x=$this->lMargin;
- if($y>=0)
- $this->y=$y;
- else
- $this->y=$this->h+$y;
-}
-
-function SetXY($x, $y)
-{
- //Set x and y positions
- $this->SetY($y);
- $this->SetX($x);
-}
-
-function Output($name='', $dest='')
-{
- //Output PDF to some destination
- if($this->state<3)
- $this->Close();
- $dest=strtoupper($dest);
- if($dest=='')
- {
- if($name=='')
- {
- $name='doc.pdf';
- $dest='I';
- }
- else
- $dest='F';
- }
- switch($dest)
- {
- case 'I':
- //Send to standard output
- if(ob_get_length())
- $this->Error('Some data has already been output, can\'t send PDF file');
- if(php_sapi_name()!='cli')
- {
- //We send to a browser
- header('Content-Type: application/pdf');
- if(headers_sent())
- $this->Error('Some data has already been output, can\'t send PDF file');
- header('Content-Length: '.strlen($this->buffer));
- header('Content-Disposition: inline; filename="'.$name.'"');
- header('Cache-Control: private, max-age=0, must-revalidate');
- header('Pragma: public');
- ini_set('zlib.output_compression','0');
- }
- echo $this->buffer;
- break;
- case 'D':
- //Download file
- if(ob_get_length())
- $this->Error('Some data has already been output, can\'t send PDF file');
- header('Content-Type: application/x-download');
- if(headers_sent())
- $this->Error('Some data has already been output, can\'t send PDF file');
- header('Content-Length: '.strlen($this->buffer));
- header('Content-Disposition: attachment; filename="'.$name.'"');
- header('Cache-Control: private, max-age=0, must-revalidate');
- header('Pragma: public');
- ini_set('zlib.output_compression','0');
- echo $this->buffer;
- break;
- case 'F':
- //Save to local file
- $f=fopen($name,'wb');
- if(!$f)
- $this->Error('Unable to create output file: '.$name);
- fwrite($f,$this->buffer,strlen($this->buffer));
- fclose($f);
- break;
- case 'S':
- //Return as a string
- return $this->buffer;
- default:
- $this->Error('Incorrect output destination: '.$dest);
- }
- return '';
-}
-
-/*******************************************************************************
-* *
-* Protected methods *
-* *
-*******************************************************************************/
-function _dochecks()
-{
- //Check availability of %F
- if(sprintf('%.1F',1.0)!='1.0')
- $this->Error('This version of PHP is not supported');
- //Check mbstring overloading
- if(ini_get('mbstring.func_overload') & 2)
- $this->Error('mbstring overloading must be disabled');
- //Disable runtime magic quotes
- if(get_magic_quotes_runtime())
- @set_magic_quotes_runtime(0);
-}
-
-function _getpageformat($format)
-{
- $format=strtolower($format);
- if(!isset($this->PageFormats[$format]))
- $this->Error('Unknown page format: '.$format);
- $a=$this->PageFormats[$format];
- return array($a[0]/$this->k, $a[1]/$this->k);
-}
-
-function _getfontpath()
-{
- if(!defined('FPDF_FONTPATH') && is_dir(dirname(__FILE__).'/font'))
- define('FPDF_FONTPATH',dirname(__FILE__).'/font/');
- return defined('FPDF_FONTPATH') ? FPDF_FONTPATH : '';
-}
-
-function _beginpage($orientation, $format)
-{
- $this->page++;
- $this->pages[$this->page]='';
- $this->state=2;
- $this->x=$this->lMargin;
- $this->y=$this->tMargin;
- $this->FontFamily='';
- //Check page size
- if($orientation=='')
- $orientation=$this->DefOrientation;
- else
- $orientation=strtoupper($orientation[0]);
- if($format=='')
- $format=$this->DefPageFormat;
- else
- {
- if(is_string($format))
- $format=$this->_getpageformat($format);
- }
- if($orientation!=$this->CurOrientation || $format[0]!=$this->CurPageFormat[0] || $format[1]!=$this->CurPageFormat[1])
- {
- //New size
- if($orientation=='P')
- {
- $this->w=$format[0];
- $this->h=$format[1];
- }
- else
- {
- $this->w=$format[1];
- $this->h=$format[0];
- }
- $this->wPt=$this->w*$this->k;
- $this->hPt=$this->h*$this->k;
- $this->PageBreakTrigger=$this->h-$this->bMargin;
- $this->CurOrientation=$orientation;
- $this->CurPageFormat=$format;
- }
- if($orientation!=$this->DefOrientation || $format[0]!=$this->DefPageFormat[0] || $format[1]!=$this->DefPageFormat[1])
- $this->PageSizes[$this->page]=array($this->wPt, $this->hPt);
-}
-
-function _endpage()
-{
- $this->state=1;
-}
-
-function _escape($s)
-{
- //Escape special characters in strings
- $s=str_replace('\\','\\\\',$s);
- $s=str_replace('(','\\(',$s);
- $s=str_replace(')','\\)',$s);
- $s=str_replace("\r",'\\r',$s);
- return $s;
-}
-
-function _textstring($s)
-{
- //Format a text string
- return '('.$this->_escape($s).')';
-}
-
-function _UTF8toUTF16($s)
-{
- //Convert UTF-8 to UTF-16BE with BOM
- $res="\xFE\xFF";
- $nb=strlen($s);
- $i=0;
- while($i<$nb)
- {
- $c1=ord($s[$i++]);
- if($c1>=224)
- {
- //3-byte character
- $c2=ord($s[$i++]);
- $c3=ord($s[$i++]);
- $res.=chr((($c1 & 0x0F)<<4) + (($c2 & 0x3C)>>2));
- $res.=chr((($c2 & 0x03)<<6) + ($c3 & 0x3F));
- }
- elseif($c1>=192)
- {
- //2-byte character
- $c2=ord($s[$i++]);
- $res.=chr(($c1 & 0x1C)>>2);
- $res.=chr((($c1 & 0x03)<<6) + ($c2 & 0x3F));
- }
- else
- {
- //Single-byte character
- $res.="\0".chr($c1);
- }
- }
- return $res;
-}
-
-function _dounderline($x, $y, $txt)
-{
- //Underline text
- $up=$this->CurrentFont['up'];
- $ut=$this->CurrentFont['ut'];
- $w=$this->GetStringWidth($txt)+$this->ws*substr_count($txt,' ');
- return sprintf('%.2F %.2F %.2F %.2F re f',$x*$this->k,($this->h-($y-$up/1000*$this->FontSize))*$this->k,$w*$this->k,-$ut/1000*$this->FontSizePt);
-}
-
-function _parsejpg($file)
-{
- //Extract info from a JPEG file
- $a=GetImageSize($file);
- if(!$a)
- $this->Error('Missing or incorrect image file: '.$file);
- if($a[2]!=2)
- $this->Error('Not a JPEG file: '.$file);
- if(!isset($a['channels']) || $a['channels']==3)
- $colspace='DeviceRGB';
- elseif($a['channels']==4)
- $colspace='DeviceCMYK';
- else
- $colspace='DeviceGray';
- $bpc=isset($a['bits']) ? $a['bits'] : 8;
- //Read whole file
- $f=fopen($file,'rb');
- $data='';
- while(!feof($f))
- $data.=fread($f,8192);
- fclose($f);
- return array('w'=>$a[0], 'h'=>$a[1], 'cs'=>$colspace, 'bpc'=>$bpc, 'f'=>'DCTDecode', 'data'=>$data);
-}
-
-function _parsepng($file)
-{
- //Extract info from a PNG file
- $f=fopen($file,'rb');
- if(!$f)
- $this->Error('Can\'t open image file: '.$file);
- //Check signature
- if($this->_readstream($f,8)!=chr(137).'PNG'.chr(13).chr(10).chr(26).chr(10))
- $this->Error('Not a PNG file: '.$file);
- //Read header chunk
- $this->_readstream($f,4);
- if($this->_readstream($f,4)!='IHDR')
- $this->Error('Incorrect PNG file: '.$file);
- $w=$this->_readint($f);
- $h=$this->_readint($f);
- $bpc=ord($this->_readstream($f,1));
- if($bpc>8)
- $this->Error('16-bit depth not supported: '.$file);
- $ct=ord($this->_readstream($f,1));
- if($ct==0)
- $colspace='DeviceGray';
- elseif($ct==2)
- $colspace='DeviceRGB';
- elseif($ct==3)
- $colspace='Indexed';
- else
- $this->Error('Alpha channel not supported: '.$file);
- if(ord($this->_readstream($f,1))!=0)
- $this->Error('Unknown compression method: '.$file);
- if(ord($this->_readstream($f,1))!=0)
- $this->Error('Unknown filter method: '.$file);
- if(ord($this->_readstream($f,1))!=0)
- $this->Error('Interlacing not supported: '.$file);
- $this->_readstream($f,4);
- $parms='/DecodeParms <>';
- //Scan chunks looking for palette, transparency and image data
- $pal='';
- $trns='';
- $data='';
- do
- {
- $n=$this->_readint($f);
- $type=$this->_readstream($f,4);
- if($type=='PLTE')
- {
- //Read palette
- $pal=$this->_readstream($f,$n);
- $this->_readstream($f,4);
- }
- elseif($type=='tRNS')
- {
- //Read transparency info
- $t=$this->_readstream($f,$n);
- if($ct==0)
- $trns=array(ord(substr($t,1,1)));
- elseif($ct==2)
- $trns=array(ord(substr($t,1,1)), ord(substr($t,3,1)), ord(substr($t,5,1)));
- else
- {
- $pos=strpos($t,chr(0));
- if($pos!==false)
- $trns=array($pos);
- }
- $this->_readstream($f,4);
- }
- elseif($type=='IDAT')
- {
- //Read image data block
- $data.=$this->_readstream($f,$n);
- $this->_readstream($f,4);
- }
- elseif($type=='IEND')
- break;
- else
- $this->_readstream($f,$n+4);
- }
- while($n);
- if($colspace=='Indexed' && empty($pal))
- $this->Error('Missing palette in '.$file);
- fclose($f);
- return array('w'=>$w, 'h'=>$h, 'cs'=>$colspace, 'bpc'=>$bpc, 'f'=>'FlateDecode', 'parms'=>$parms, 'pal'=>$pal, 'trns'=>$trns, 'data'=>$data);
-}
-
-function _readstream($f, $n)
-{
- //Read n bytes from stream
- $res='';
- while($n>0 && !feof($f))
- {
- $s=fread($f,$n);
- if($s===false)
- $this->Error('Error while reading stream');
- $n-=strlen($s);
- $res.=$s;
- }
- if($n>0)
- $this->Error('Unexpected end of stream');
- return $res;
-}
-
-function _readint($f)
-{
- //Read a 4-byte integer from stream
- $a=unpack('Ni',$this->_readstream($f,4));
- return $a['i'];
-}
-
-function _parsegif($file)
-{
- //Extract info from a GIF file (via PNG conversion)
- if(!function_exists('imagepng'))
- $this->Error('GD extension is required for GIF support');
- if(!function_exists('imagecreatefromgif'))
- $this->Error('GD has no GIF read support');
- $im=imagecreatefromgif($file);
- if(!$im)
- $this->Error('Missing or incorrect image file: '.$file);
- imageinterlace($im,0);
- $tmp=tempnam('.','gif');
- if(!$tmp)
- $this->Error('Unable to create a temporary file');
- if(!imagepng($im,$tmp))
- $this->Error('Error while saving to temporary file');
- imagedestroy($im);
- $info=$this->_parsepng($tmp);
- unlink($tmp);
- return $info;
-}
-
-function _newobj()
-{
- //Begin a new object
- $this->n++;
- $this->offsets[$this->n]=strlen($this->buffer);
- $this->_out($this->n.' 0 obj');
-}
-
-function _putstream($s)
-{
- $this->_out('stream');
- $this->_out($s);
- $this->_out('endstream');
-}
-
-function _out($s)
-{
- //Add a line to the document
- if($this->state==2)
- $this->pages[$this->page].=$s."\n";
- else
- $this->buffer.=$s."\n";
-}
-
-function _putpages()
-{
- $nb=$this->page;
- if(!empty($this->AliasNbPages))
- {
- //Replace number of pages
- for($n=1;$n<=$nb;$n++)
- $this->pages[$n]=str_replace($this->AliasNbPages,$nb,$this->pages[$n]);
- }
- if($this->DefOrientation=='P')
- {
- $wPt=$this->DefPageFormat[0]*$this->k;
- $hPt=$this->DefPageFormat[1]*$this->k;
- }
- else
- {
- $wPt=$this->DefPageFormat[1]*$this->k;
- $hPt=$this->DefPageFormat[0]*$this->k;
- }
- $filter=($this->compress) ? '/Filter /FlateDecode ' : '';
- for($n=1;$n<=$nb;$n++)
- {
- //Page
- $this->_newobj();
- $this->_out('<_out('/Parent 1 0 R');
- if(isset($this->PageSizes[$n]))
- $this->_out(sprintf('/MediaBox [0 0 %.2F %.2F]',$this->PageSizes[$n][0],$this->PageSizes[$n][1]));
- $this->_out('/Resources 2 0 R');
- if(isset($this->PageLinks[$n]))
- {
- //Links
- $annots='/Annots [';
- foreach($this->PageLinks[$n] as $pl)
- {
- $rect=sprintf('%.2F %.2F %.2F %.2F',$pl[0],$pl[1],$pl[0]+$pl[2],$pl[1]-$pl[3]);
- $annots.='<_textstring($pl[4]).'>>>>';
- else
- {
- $l=$this->links[$pl[4]];
- $h=isset($this->PageSizes[$l[0]]) ? $this->PageSizes[$l[0]][1] : $hPt;
- $annots.=sprintf('/Dest [%d 0 R /XYZ 0 %.2F null]>>',1+2*$l[0],$h-$l[1]*$this->k);
- }
- }
- $this->_out($annots.']');
- }
- $this->_out('/Contents '.($this->n+1).' 0 R>>');
- $this->_out('endobj');
- //Page content
- $p=($this->compress) ? gzcompress($this->pages[$n]) : $this->pages[$n];
- $this->_newobj();
- $this->_out('<<'.$filter.'/Length '.strlen($p).'>>');
- $this->_putstream($p);
- $this->_out('endobj');
- }
- //Pages root
- $this->offsets[1]=strlen($this->buffer);
- $this->_out('1 0 obj');
- $this->_out('<_out($kids.']');
- $this->_out('/Count '.$nb);
- $this->_out(sprintf('/MediaBox [0 0 %.2F %.2F]',$wPt,$hPt));
- $this->_out('>>');
- $this->_out('endobj');
-}
-
-function _putfonts()
-{
- $nf=$this->n;
- foreach($this->diffs as $diff)
- {
- //Encodings
- $this->_newobj();
- $this->_out('<>');
- $this->_out('endobj');
- }
- foreach($this->FontFiles as $file=>$info)
- {
- //Font file embedding
- $this->_newobj();
- $this->FontFiles[$file]['n']=$this->n;
- $font='';
- $f=fopen($this->_getfontpath().$file,'rb',1);
- if(!$f)
- $this->Error('Font file not found');
- while(!feof($f))
- $font.=fread($f,8192);
- fclose($f);
- $compressed=(substr($file,-2)=='.z');
- if(!$compressed && isset($info['length2']))
- {
- $header=(ord($font[0])==128);
- if($header)
- {
- //Strip first binary header
- $font=substr($font,6);
- }
- if($header && ord($font[$info['length1']])==128)
- {
- //Strip second binary header
- $font=substr($font,0,$info['length1']).substr($font,$info['length1']+6);
- }
- }
- $this->_out('<_out('/Filter /FlateDecode');
- $this->_out('/Length1 '.$info['length1']);
- if(isset($info['length2']))
- $this->_out('/Length2 '.$info['length2'].' /Length3 0');
- $this->_out('>>');
- $this->_putstream($font);
- $this->_out('endobj');
- }
- foreach($this->fonts as $k=>$font)
- {
- //Font objects
- $this->fonts[$k]['n']=$this->n+1;
- $type=$font['type'];
- $name=$font['name'];
- if($type=='core')
- {
- //Standard font
- $this->_newobj();
- $this->_out('<_out('/BaseFont /'.$name);
- $this->_out('/Subtype /Type1');
- if($name!='Symbol' && $name!='ZapfDingbats')
- $this->_out('/Encoding /WinAnsiEncoding');
- $this->_out('>>');
- $this->_out('endobj');
- }
- elseif($type=='Type1' || $type=='TrueType')
- {
- //Additional Type1 or TrueType font
- $this->_newobj();
- $this->_out('<_out('/BaseFont /'.$name);
- $this->_out('/Subtype /'.$type);
- $this->_out('/FirstChar 32 /LastChar 255');
- $this->_out('/Widths '.($this->n+1).' 0 R');
- $this->_out('/FontDescriptor '.($this->n+2).' 0 R');
- if($font['enc'])
- {
- if(isset($font['diff']))
- $this->_out('/Encoding '.($nf+$font['diff']).' 0 R');
- else
- $this->_out('/Encoding /WinAnsiEncoding');
- }
- $this->_out('>>');
- $this->_out('endobj');
- //Widths
- $this->_newobj();
- $cw=&$font['cw'];
- $s='[';
- for($i=32;$i<=255;$i++)
- $s.=$cw[chr($i)].' ';
- $this->_out($s.']');
- $this->_out('endobj');
- //Descriptor
- $this->_newobj();
- $s='<$v)
- $s.=' /'.$k.' '.$v;
- $file=$font['file'];
- if($file)
- $s.=' /FontFile'.($type=='Type1' ? '' : '2').' '.$this->FontFiles[$file]['n'].' 0 R';
- $this->_out($s.'>>');
- $this->_out('endobj');
- }
- else
- {
- //Allow for additional types
- $mtd='_put'.strtolower($type);
- if(!method_exists($this,$mtd))
- $this->Error('Unsupported font type: '.$type);
- $this->$mtd($font);
- }
- }
-}
-
-function _putimages()
-{
- $filter=($this->compress) ? '/Filter /FlateDecode ' : '';
- reset($this->images);
- while(list($file,$info)=each($this->images))
- {
- $this->_newobj();
- $this->images[$file]['n']=$this->n;
- $this->_out('<_out('/Subtype /Image');
- $this->_out('/Width '.$info['w']);
- $this->_out('/Height '.$info['h']);
- if($info['cs']=='Indexed')
- $this->_out('/ColorSpace [/Indexed /DeviceRGB '.(strlen($info['pal'])/3-1).' '.($this->n+1).' 0 R]');
- else
- {
- $this->_out('/ColorSpace /'.$info['cs']);
- if($info['cs']=='DeviceCMYK')
- $this->_out('/Decode [1 0 1 0 1 0 1 0]');
- }
- $this->_out('/BitsPerComponent '.$info['bpc']);
- if(isset($info['f']))
- $this->_out('/Filter /'.$info['f']);
- if(isset($info['parms']))
- $this->_out($info['parms']);
- if(isset($info['trns']) && is_array($info['trns']))
- {
- $trns='';
- for($i=0;$i_out('/Mask ['.$trns.']');
- }
- $this->_out('/Length '.strlen($info['data']).'>>');
- $this->_putstream($info['data']);
- unset($this->images[$file]['data']);
- $this->_out('endobj');
- //Palette
- if($info['cs']=='Indexed')
- {
- $this->_newobj();
- $pal=($this->compress) ? gzcompress($info['pal']) : $info['pal'];
- $this->_out('<<'.$filter.'/Length '.strlen($pal).'>>');
- $this->_putstream($pal);
- $this->_out('endobj');
- }
- }
-}
-
-function _putxobjectdict()
-{
- foreach($this->images as $image)
- $this->_out('/I'.$image['i'].' '.$image['n'].' 0 R');
-}
-
-function _putresourcedict()
-{
- $this->_out('/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]');
- $this->_out('/Font <<');
- foreach($this->fonts as $font)
- $this->_out('/F'.$font['i'].' '.$font['n'].' 0 R');
- $this->_out('>>');
- $this->_out('/XObject <<');
- $this->_putxobjectdict();
- $this->_out('>>');
-}
-
-function _putresources()
-{
- $this->_putfonts();
- $this->_putimages();
- //Resource dictionary
- $this->offsets[2]=strlen($this->buffer);
- $this->_out('2 0 obj');
- $this->_out('<<');
- $this->_putresourcedict();
- $this->_out('>>');
- $this->_out('endobj');
-}
-
-function _putinfo()
-{
- $this->_out('/Producer '.$this->_textstring('FPDF '.FPDF_VERSION));
- if(!empty($this->title))
- $this->_out('/Title '.$this->_textstring($this->title));
- if(!empty($this->subject))
- $this->_out('/Subject '.$this->_textstring($this->subject));
- if(!empty($this->author))
- $this->_out('/Author '.$this->_textstring($this->author));
- if(!empty($this->keywords))
- $this->_out('/Keywords '.$this->_textstring($this->keywords));
- if(!empty($this->creator))
- $this->_out('/Creator '.$this->_textstring($this->creator));
- $this->_out('/CreationDate '.$this->_textstring('D:'.@date('YmdHis')));
-}
-
-function _putcatalog()
-{
- $this->_out('/Type /Catalog');
- $this->_out('/Pages 1 0 R');
- if($this->ZoomMode=='fullpage')
- $this->_out('/OpenAction [3 0 R /Fit]');
- elseif($this->ZoomMode=='fullwidth')
- $this->_out('/OpenAction [3 0 R /FitH null]');
- elseif($this->ZoomMode=='real')
- $this->_out('/OpenAction [3 0 R /XYZ null null 1]');
- elseif(!is_string($this->ZoomMode))
- $this->_out('/OpenAction [3 0 R /XYZ null null '.($this->ZoomMode/100).']');
- if($this->LayoutMode=='single')
- $this->_out('/PageLayout /SinglePage');
- elseif($this->LayoutMode=='continuous')
- $this->_out('/PageLayout /OneColumn');
- elseif($this->LayoutMode=='two')
- $this->_out('/PageLayout /TwoColumnLeft');
-}
-
-function _putheader()
-{
- $this->_out('%PDF-'.$this->PDFVersion);
-}
-
-function _puttrailer()
-{
- $this->_out('/Size '.($this->n+1));
- $this->_out('/Root '.$this->n.' 0 R');
- $this->_out('/Info '.($this->n-1).' 0 R');
-}
-
-function _enddoc()
-{
- $this->_putheader();
- $this->_putpages();
- $this->_putresources();
- //Info
- $this->_newobj();
- $this->_out('<<');
- $this->_putinfo();
- $this->_out('>>');
- $this->_out('endobj');
- //Catalog
- $this->_newobj();
- $this->_out('<<');
- $this->_putcatalog();
- $this->_out('>>');
- $this->_out('endobj');
- //Cross-ref
- $o=strlen($this->buffer);
- $this->_out('xref');
- $this->_out('0 '.($this->n+1));
- $this->_out('0000000000 65535 f ');
- for($i=1;$i<=$this->n;$i++)
- $this->_out(sprintf('%010d 00000 n ',$this->offsets[$i]));
- //Trailer
- $this->_out('trailer');
- $this->_out('<<');
- $this->_puttrailer();
- $this->_out('>>');
- $this->_out('startxref');
- $this->_out($o);
- $this->_out('%%EOF');
- $this->state=3;
-}
-//End of class
-}
-
-//Handle special IE contype request
-if(isset($_SERVER['HTTP_USER_AGENT']) && $_SERVER['HTTP_USER_AGENT']=='contype')
-{
- header('Content-Type: application/pdf');
- exit;
-}
-
-?>
+_dochecks();
+ //Initialization of properties
+ $this->page=0;
+ $this->n=2;
+ $this->buffer='';
+ $this->pages=array();
+ $this->PageSizes=array();
+ $this->state=0;
+ $this->fonts=array();
+ $this->FontFiles=array();
+ $this->diffs=array();
+ $this->images=array();
+ $this->links=array();
+ $this->InHeader=false;
+ $this->InFooter=false;
+ $this->lasth=0;
+ $this->FontFamily='';
+ $this->FontStyle='';
+ $this->FontSizePt=12;
+ $this->underline=false;
+ $this->DrawColor='0 G';
+ $this->FillColor='0 g';
+ $this->TextColor='0 g';
+ $this->ColorFlag=false;
+ $this->ws=0;
+ //Standard fonts
+ $this->CoreFonts=array('courier'=>'Courier', 'courierB'=>'Courier-Bold', 'courierI'=>'Courier-Oblique', 'courierBI'=>'Courier-BoldOblique',
+ 'helvetica'=>'Helvetica', 'helveticaB'=>'Helvetica-Bold', 'helveticaI'=>'Helvetica-Oblique', 'helveticaBI'=>'Helvetica-BoldOblique',
+ 'times'=>'Times-Roman', 'timesB'=>'Times-Bold', 'timesI'=>'Times-Italic', 'timesBI'=>'Times-BoldItalic',
+ 'symbol'=>'Symbol', 'zapfdingbats'=>'ZapfDingbats');
+ //Scale factor
+ if($unit=='pt')
+ $this->k=1;
+ elseif($unit=='mm')
+ $this->k=72/25.4;
+ elseif($unit=='cm')
+ $this->k=72/2.54;
+ elseif($unit=='in')
+ $this->k=72;
+ else
+ $this->Error('Incorrect unit: '.$unit);
+ //Page format
+ $this->PageFormats=array('a3'=>array(841.89,1190.55), 'a4'=>array(595.28,841.89), 'a5'=>array(420.94,595.28),
+ 'letter'=>array(612,792), 'legal'=>array(612,1008));
+ if(is_string($format))
+ $format=$this->_getpageformat($format);
+ $this->DefPageFormat=$format;
+ $this->CurPageFormat=$format;
+ //Page orientation
+ $orientation=strtolower($orientation);
+ if($orientation=='p' || $orientation=='portrait')
+ {
+ $this->DefOrientation='P';
+ $this->w=$this->DefPageFormat[0];
+ $this->h=$this->DefPageFormat[1];
+ }
+ elseif($orientation=='l' || $orientation=='landscape')
+ {
+ $this->DefOrientation='L';
+ $this->w=$this->DefPageFormat[1];
+ $this->h=$this->DefPageFormat[0];
+ }
+ else
+ $this->Error('Incorrect orientation: '.$orientation);
+ $this->CurOrientation=$this->DefOrientation;
+ $this->wPt=$this->w*$this->k;
+ $this->hPt=$this->h*$this->k;
+ //Page margins (1 cm)
+ $margin=28.35/$this->k;
+ $this->SetMargins($margin,$margin);
+ //Interior cell margin (1 mm)
+ $this->cMargin=$margin/10;
+ //Line width (0.2 mm)
+ $this->LineWidth=.567/$this->k;
+ //Automatic page break
+ $this->SetAutoPageBreak(true,2*$margin);
+ //Full width display mode
+ $this->SetDisplayMode('fullwidth');
+ //Enable compression
+ $this->SetCompression(true);
+ //Set default PDF version number
+ $this->PDFVersion='1.3';
+}
+
+function SetMargins($left, $top, $right=null)
+{
+ //Set left, top and right margins
+ $this->lMargin=$left;
+ $this->tMargin=$top;
+ if($right===null)
+ $right=$left;
+ $this->rMargin=$right;
+}
+
+function SetLeftMargin($margin)
+{
+ //Set left margin
+ $this->lMargin=$margin;
+ if($this->page>0 && $this->x<$margin)
+ $this->x=$margin;
+}
+
+function SetTopMargin($margin)
+{
+ //Set top margin
+ $this->tMargin=$margin;
+}
+
+function SetRightMargin($margin)
+{
+ //Set right margin
+ $this->rMargin=$margin;
+}
+
+function SetAutoPageBreak($auto, $margin=0)
+{
+ //Set auto page break mode and triggering margin
+ $this->AutoPageBreak=$auto;
+ $this->bMargin=$margin;
+ $this->PageBreakTrigger=$this->h-$margin;
+}
+
+function SetDisplayMode($zoom, $layout='continuous')
+{
+ //Set display mode in viewer
+ if($zoom=='fullpage' || $zoom=='fullwidth' || $zoom=='real' || $zoom=='default' || !is_string($zoom))
+ $this->ZoomMode=$zoom;
+ else
+ $this->Error('Incorrect zoom display mode: '.$zoom);
+ if($layout=='single' || $layout=='continuous' || $layout=='two' || $layout=='default')
+ $this->LayoutMode=$layout;
+ else
+ $this->Error('Incorrect layout display mode: '.$layout);
+}
+
+function SetCompression($compress)
+{
+ //Set page compression
+ if(function_exists('gzcompress'))
+ $this->compress=$compress;
+ else
+ $this->compress=false;
+}
+
+function SetTitle($title, $isUTF8=false)
+{
+ //Title of document
+ if($isUTF8)
+ $title=$this->_UTF8toUTF16($title);
+ $this->title=$title;
+}
+
+function SetSubject($subject, $isUTF8=false)
+{
+ //Subject of document
+ if($isUTF8)
+ $subject=$this->_UTF8toUTF16($subject);
+ $this->subject=$subject;
+}
+
+function SetAuthor($author, $isUTF8=false)
+{
+ //Author of document
+ if($isUTF8)
+ $author=$this->_UTF8toUTF16($author);
+ $this->author=$author;
+}
+
+function SetKeywords($keywords, $isUTF8=false)
+{
+ //Keywords of document
+ if($isUTF8)
+ $keywords=$this->_UTF8toUTF16($keywords);
+ $this->keywords=$keywords;
+}
+
+function SetCreator($creator, $isUTF8=false)
+{
+ //Creator of document
+ if($isUTF8)
+ $creator=$this->_UTF8toUTF16($creator);
+ $this->creator=$creator;
+}
+
+function AliasNbPages($alias='{nb}')
+{
+ //Define an alias for total number of pages
+ $this->AliasNbPages=$alias;
+}
+
+function Error($msg)
+{
+ //Fatal error
+ die('FPDF error: '.$msg);
+}
+
+function Open()
+{
+ //Begin document
+ $this->state=1;
+}
+
+function Close()
+{
+ //Terminate document
+ if($this->state==3)
+ return;
+ if($this->page==0)
+ $this->AddPage();
+ //Page footer
+ $this->InFooter=true;
+ $this->Footer();
+ $this->InFooter=false;
+ //Close page
+ $this->_endpage();
+ //Close document
+ $this->_enddoc();
+}
+
+function AddPage($orientation='', $format='')
+{
+ //Start a new page
+ if($this->state==0)
+ $this->Open();
+ $family=$this->FontFamily;
+ $style=$this->FontStyle.($this->underline ? 'U' : '');
+ $size=$this->FontSizePt;
+ $lw=$this->LineWidth;
+ $dc=$this->DrawColor;
+ $fc=$this->FillColor;
+ $tc=$this->TextColor;
+ $cf=$this->ColorFlag;
+ if($this->page>0)
+ {
+ //Page footer
+ $this->InFooter=true;
+ $this->Footer();
+ $this->InFooter=false;
+ //Close page
+ $this->_endpage();
+ }
+ //Start new page
+ $this->_beginpage($orientation,$format);
+ //Set line cap style to square
+ $this->_out('2 J');
+ //Set line width
+ $this->LineWidth=$lw;
+ $this->_out(sprintf('%.2F w',$lw*$this->k));
+ //Set font
+ if($family)
+ $this->SetFont($family,$style,$size);
+ //Set colors
+ $this->DrawColor=$dc;
+ if($dc!='0 G')
+ $this->_out($dc);
+ $this->FillColor=$fc;
+ if($fc!='0 g')
+ $this->_out($fc);
+ $this->TextColor=$tc;
+ $this->ColorFlag=$cf;
+ //Page header
+ $this->InHeader=true;
+ $this->Header();
+ $this->InHeader=false;
+ //Restore line width
+ if($this->LineWidth!=$lw)
+ {
+ $this->LineWidth=$lw;
+ $this->_out(sprintf('%.2F w',$lw*$this->k));
+ }
+ //Restore font
+ if($family)
+ $this->SetFont($family,$style,$size);
+ //Restore colors
+ if($this->DrawColor!=$dc)
+ {
+ $this->DrawColor=$dc;
+ $this->_out($dc);
+ }
+ if($this->FillColor!=$fc)
+ {
+ $this->FillColor=$fc;
+ $this->_out($fc);
+ }
+ $this->TextColor=$tc;
+ $this->ColorFlag=$cf;
+}
+
+function Header()
+{
+ //To be implemented in your own inherited class
+}
+
+function Footer()
+{
+ //To be implemented in your own inherited class
+}
+
+function PageNo()
+{
+ //Get current page number
+ return $this->page;
+}
+
+function SetDrawColor($r, $g=null, $b=null)
+{
+ //Set color for all stroking operations
+ if(($r==0 && $g==0 && $b==0) || $g===null)
+ $this->DrawColor=sprintf('%.3F G',$r/255);
+ else
+ $this->DrawColor=sprintf('%.3F %.3F %.3F RG',$r/255,$g/255,$b/255);
+ if($this->page>0)
+ $this->_out($this->DrawColor);
+}
+
+function SetFillColor($r, $g=null, $b=null)
+{
+ //Set color for all filling operations
+ if(($r==0 && $g==0 && $b==0) || $g===null)
+ $this->FillColor=sprintf('%.3F g',$r/255);
+ else
+ $this->FillColor=sprintf('%.3F %.3F %.3F rg',$r/255,$g/255,$b/255);
+ $this->ColorFlag=($this->FillColor!=$this->TextColor);
+ if($this->page>0)
+ $this->_out($this->FillColor);
+}
+
+function SetTextColor($r, $g=null, $b=null)
+{
+ //Set color for text
+ if(($r==0 && $g==0 && $b==0) || $g===null)
+ $this->TextColor=sprintf('%.3F g',$r/255);
+ else
+ $this->TextColor=sprintf('%.3F %.3F %.3F rg',$r/255,$g/255,$b/255);
+ $this->ColorFlag=($this->FillColor!=$this->TextColor);
+}
+
+function GetStringWidth($s)
+{
+ //Get width of a string in the current font
+ $s=(string)$s;
+ $cw=&$this->CurrentFont['cw'];
+ $w=0;
+ $l=strlen($s);
+ for($i=0;$i<$l;$i++)
+ $w+=$cw[$s[$i]];
+ return $w*$this->FontSize/1000;
+}
+
+function SetLineWidth($width)
+{
+ //Set line width
+ $this->LineWidth=$width;
+ if($this->page>0)
+ $this->_out(sprintf('%.2F w',$width*$this->k));
+}
+
+function Line($x1, $y1, $x2, $y2)
+{
+ //Draw a line
+ $this->_out(sprintf('%.2F %.2F m %.2F %.2F l S',$x1*$this->k,($this->h-$y1)*$this->k,$x2*$this->k,($this->h-$y2)*$this->k));
+}
+
+function Rect($x, $y, $w, $h, $style='')
+{
+ //Draw a rectangle
+ if($style=='F')
+ $op='f';
+ elseif($style=='FD' || $style=='DF')
+ $op='B';
+ else
+ $op='S';
+ $this->_out(sprintf('%.2F %.2F %.2F %.2F re %s',$x*$this->k,($this->h-$y)*$this->k,$w*$this->k,-$h*$this->k,$op));
+}
+
+function AddFont($family, $style='', $file='')
+{
+ //Add a TrueType or Type1 font
+ $family=strtolower($family);
+ if($file=='')
+ $file=str_replace(' ','',$family).strtolower($style).'.php';
+ if($family=='arial')
+ $family='helvetica';
+ $style=strtoupper($style);
+ if($style=='IB')
+ $style='BI';
+ $fontkey=$family.$style;
+ if(isset($this->fonts[$fontkey]))
+ return;
+ include($this->_getfontpath().$file);
+ if(!isset($name))
+ $this->Error('Could not include font definition file');
+ $i=count($this->fonts)+1;
+ $this->fonts[$fontkey]=array('i'=>$i, 'type'=>$type, 'name'=>$name, 'desc'=>$desc, 'up'=>$up, 'ut'=>$ut, 'cw'=>$cw, 'enc'=>$enc, 'file'=>$file);
+ if($diff)
+ {
+ //Search existing encodings
+ $d=0;
+ $nb=count($this->diffs);
+ for($i=1;$i<=$nb;$i++)
+ {
+ if($this->diffs[$i]==$diff)
+ {
+ $d=$i;
+ break;
+ }
+ }
+ if($d==0)
+ {
+ $d=$nb+1;
+ $this->diffs[$d]=$diff;
+ }
+ $this->fonts[$fontkey]['diff']=$d;
+ }
+ if($file)
+ {
+ if($type=='TrueType')
+ $this->FontFiles[$file]=array('length1'=>$originalsize);
+ else
+ $this->FontFiles[$file]=array('length1'=>$size1, 'length2'=>$size2);
+ }
+}
+
+function SetFont($family, $style='', $size=0)
+{
+ //Select a font; size given in points
+ global $fpdf_charwidths;
+
+ $family=strtolower($family);
+ if($family=='')
+ $family=$this->FontFamily;
+ if($family=='arial')
+ $family='helvetica';
+ elseif($family=='symbol' || $family=='zapfdingbats')
+ $style='';
+ $style=strtoupper($style);
+ if(strpos($style,'U')!==false)
+ {
+ $this->underline=true;
+ $style=str_replace('U','',$style);
+ }
+ else
+ $this->underline=false;
+ if($style=='IB')
+ $style='BI';
+ if($size==0)
+ $size=$this->FontSizePt;
+ //Test if font is already selected
+ if($this->FontFamily==$family && $this->FontStyle==$style && $this->FontSizePt==$size)
+ return;
+ //Test if used for the first time
+ $fontkey=$family.$style;
+ if(!isset($this->fonts[$fontkey]))
+ {
+ //Check if one of the standard fonts
+ if(isset($this->CoreFonts[$fontkey]))
+ {
+ if(!isset($fpdf_charwidths[$fontkey]))
+ {
+ //Load metric file
+ $file=$family;
+ if($family=='times' || $family=='helvetica')
+ $file.=strtolower($style);
+ include($this->_getfontpath().$file.'.php');
+ if(!isset($fpdf_charwidths[$fontkey]))
+ $this->Error('Could not include font metric file');
+ }
+ $i=count($this->fonts)+1;
+ $name=$this->CoreFonts[$fontkey];
+ $cw=$fpdf_charwidths[$fontkey];
+ $this->fonts[$fontkey]=array('i'=>$i, 'type'=>'core', 'name'=>$name, 'up'=>-100, 'ut'=>50, 'cw'=>$cw);
+ }
+ else
+ $this->Error('Undefined font: '.$family.' '.$style);
+ }
+ //Select it
+ $this->FontFamily=$family;
+ $this->FontStyle=$style;
+ $this->FontSizePt=$size;
+ $this->FontSize=$size/$this->k;
+ $this->CurrentFont=&$this->fonts[$fontkey];
+ if($this->page>0)
+ $this->_out(sprintf('BT /F%d %.2F Tf ET',$this->CurrentFont['i'],$this->FontSizePt));
+}
+
+function SetFontSize($size)
+{
+ //Set font size in points
+ if($this->FontSizePt==$size)
+ return;
+ $this->FontSizePt=$size;
+ $this->FontSize=$size/$this->k;
+ if($this->page>0)
+ $this->_out(sprintf('BT /F%d %.2F Tf ET',$this->CurrentFont['i'],$this->FontSizePt));
+}
+
+function AddLink()
+{
+ //Create a new internal link
+ $n=count($this->links)+1;
+ $this->links[$n]=array(0, 0);
+ return $n;
+}
+
+function SetLink($link, $y=0, $page=-1)
+{
+ //Set destination of internal link
+ if($y==-1)
+ $y=$this->y;
+ if($page==-1)
+ $page=$this->page;
+ $this->links[$link]=array($page, $y);
+}
+
+function Link($x, $y, $w, $h, $link)
+{
+ //Put a link on the page
+ $this->PageLinks[$this->page][]=array($x*$this->k, $this->hPt-$y*$this->k, $w*$this->k, $h*$this->k, $link);
+}
+
+function Text($x, $y, $txt)
+{
+ //Output a string
+ $s=sprintf('BT %.2F %.2F Td (%s) Tj ET',$x*$this->k,($this->h-$y)*$this->k,$this->_escape($txt));
+ if ($txt!='')
+ {
+ if($this->underline) $s.=' '.$this->_dounderline($x,$y,$txt);
+ }
+ if($this->ColorFlag)
+ $s='q '.$this->TextColor.' '.$s.' Q';
+ $this->_out($s);
+}
+
+function AcceptPageBreak()
+{
+ //Accept automatic page break or not
+ return $this->AutoPageBreak;
+}
+
+function Cell($w, $h=0, $txt='', $border=0, $ln=0, $align='', $fill=false, $link='')
+{
+ //Output a cell
+ $k=$this->k;
+ if($this->y+$h>$this->PageBreakTrigger && !$this->InHeader && !$this->InFooter && $this->AcceptPageBreak())
+ {
+ //Automatic page break
+ $x=$this->x;
+ $ws=$this->ws;
+ if($ws>0)
+ {
+ $this->ws=0;
+ $this->_out('0 Tw');
+ }
+ $this->AddPage($this->CurOrientation,$this->CurPageFormat);
+ $this->x=$x;
+ if($ws>0)
+ {
+ $this->ws=$ws;
+ $this->_out(sprintf('%.3F Tw',$ws*$k));
+ }
+ }
+ if($w==0)
+ $w=$this->w-$this->rMargin-$this->x;
+ $s='';
+ if($fill || $border==1)
+ {
+ if($fill)
+ $op=($border==1) ? 'B' : 'f';
+ else
+ $op='S';
+ $s=sprintf('%.2F %.2F %.2F %.2F re %s ',$this->x*$k,($this->h-$this->y)*$k,$w*$k,-$h*$k,$op);
+ }
+ if(is_string($border))
+ {
+ $x=$this->x;
+ $y=$this->y;
+ if(strpos($border,'L')!==false)
+ $s.=sprintf('%.2F %.2F m %.2F %.2F l S ',$x*$k,($this->h-$y)*$k,$x*$k,($this->h-($y+$h))*$k);
+ if(strpos($border,'T')!==false)
+ $s.=sprintf('%.2F %.2F m %.2F %.2F l S ',$x*$k,($this->h-$y)*$k,($x+$w)*$k,($this->h-$y)*$k);
+ if(strpos($border,'R')!==false)
+ $s.=sprintf('%.2F %.2F m %.2F %.2F l S ',($x+$w)*$k,($this->h-$y)*$k,($x+$w)*$k,($this->h-($y+$h))*$k);
+ if(strpos($border,'B')!==false)
+ $s.=sprintf('%.2F %.2F m %.2F %.2F l S ',$x*$k,($this->h-($y+$h))*$k,($x+$w)*$k,($this->h-($y+$h))*$k);
+ }
+ if($txt!=='')
+ {
+ if($align=='R')
+ $dx=$w-$this->cMargin-$this->GetStringWidth($txt);
+ elseif($align=='C')
+ $dx=($w-$this->GetStringWidth($txt))/2;
+ else
+ $dx=$this->cMargin;
+ if($this->ColorFlag)
+ $s.='q '.$this->TextColor.' ';
+ $txt2=str_replace(')','\\)',str_replace('(','\\(',str_replace('\\','\\\\',$txt)));
+ $s.=sprintf('BT %.2F %.2F Td (%s) Tj ET',($this->x+$dx)*$k,($this->h-($this->y+.5*$h+.3*$this->FontSize))*$k,$txt2);
+ if($this->underline)
+ $s.=' '.$this->_dounderline($this->x+$dx,$this->y+.5*$h+.3*$this->FontSize,$txt);
+ if($this->ColorFlag)
+ $s.=' Q';
+ if($link)
+ $this->Link($this->x+$dx,$this->y+.5*$h-.5*$this->FontSize,$this->GetStringWidth($txt),$this->FontSize,$link);
+ }
+ if($s)
+ $this->_out($s);
+ $this->lasth=$h;
+ if($ln>0)
+ {
+ //Go to next line
+ $this->y+=$h;
+ if($ln==1)
+ $this->x=$this->lMargin;
+ }
+ else
+ $this->x+=$w;
+}
+
+function MultiCell($w, $h, $txt, $border=0, $align='J', $fill=false)
+{
+ //Output text with automatic or explicit line breaks
+ $cw=&$this->CurrentFont['cw'];
+ if($w==0)
+ $w=$this->w-$this->rMargin-$this->x;
+ $wmax=($w-2*$this->cMargin)*1000/$this->FontSize;
+ $s=str_replace("\r",'',$txt);
+ $nb=strlen($s);
+ if($nb>0 && $s[$nb-1]=="\n")
+ $nb--;
+ $b=0;
+ if($border)
+ {
+ if($border==1)
+ {
+ $border='LTRB';
+ $b='LRT';
+ $b2='LR';
+ }
+ else
+ {
+ $b2='';
+ if(strpos($border,'L')!==false)
+ $b2.='L';
+ if(strpos($border,'R')!==false)
+ $b2.='R';
+ $b=(strpos($border,'T')!==false) ? $b2.'T' : $b2;
+ }
+ }
+ $sep=-1;
+ $i=0;
+ $j=0;
+ $l=0;
+ $ns=0;
+ $nl=1;
+ while($i<$nb)
+ {
+ //Get next character
+ $c=$s[$i];
+ if($c=="\n")
+ {
+ //Explicit line break
+ if($this->ws>0)
+ {
+ $this->ws=0;
+ $this->_out('0 Tw');
+ }
+ $this->Cell($w,$h,substr($s,$j,$i-$j),$b,2,$align,$fill);
+ $i++;
+ $sep=-1;
+ $j=$i;
+ $l=0;
+ $ns=0;
+ $nl++;
+ if($border && $nl==2)
+ $b=$b2;
+ continue;
+ }
+ if($c==' ')
+ {
+ $sep=$i;
+ $ls=$l;
+ $ns++;
+ }
+ $l+=$cw[$c];
+ if($l>$wmax)
+ {
+ //Automatic line break
+ if($sep==-1)
+ {
+ if($i==$j)
+ $i++;
+ if($this->ws>0)
+ {
+ $this->ws=0;
+ $this->_out('0 Tw');
+ }
+ $this->Cell($w,$h,substr($s,$j,$i-$j),$b,2,$align,$fill);
+ }
+ else
+ {
+ if($align=='J')
+ {
+ $this->ws=($ns>1) ? ($wmax-$ls)/1000*$this->FontSize/($ns-1) : 0;
+ $this->_out(sprintf('%.3F Tw',$this->ws*$this->k));
+ }
+ $this->Cell($w,$h,substr($s,$j,$sep-$j),$b,2,$align,$fill);
+ $i=$sep+1;
+ }
+ $sep=-1;
+ $j=$i;
+ $l=0;
+ $ns=0;
+ $nl++;
+ if($border && $nl==2)
+ $b=$b2;
+ }
+ else
+ $i++;
+ }
+ //Last chunk
+ if($this->ws>0)
+ {
+ $this->ws=0;
+ $this->_out('0 Tw');
+ }
+ if($border && strpos($border,'B')!==false)
+ $b.='B';
+ $this->Cell($w,$h,substr($s,$j,$i-$j),$b,2,$align,$fill);
+ $this->x=$this->lMargin;
+}
+
+function Write($h, $txt, $link='')
+{
+ //Output text in flowing mode
+ $cw=&$this->CurrentFont['cw'];
+ $w=$this->w-$this->rMargin-$this->x;
+ $wmax=($w-2*$this->cMargin)*1000/$this->FontSize;
+ $s=str_replace("\r",'',$txt);
+ $nb=strlen($s);
+ $sep=-1;
+ $i=0;
+ $j=0;
+ $l=0;
+ $nl=1;
+ while($i<$nb)
+ {
+ //Get next character
+ $c=$s[$i];
+ if($c=="\n")
+ {
+ //Explicit line break
+ $this->Cell($w,$h,substr($s,$j,$i-$j),0,2,'',0,$link);
+ $i++;
+ $sep=-1;
+ $j=$i;
+ $l=0;
+ if($nl==1)
+ {
+ $this->x=$this->lMargin;
+ $w=$this->w-$this->rMargin-$this->x;
+ $wmax=($w-2*$this->cMargin)*1000/$this->FontSize;
+ }
+ $nl++;
+ continue;
+ }
+ if($c==' ')
+ $sep=$i;
+ $l+=$cw[$c];
+ if($l>$wmax)
+ {
+ //Automatic line break
+ if($sep==-1)
+ {
+ if($this->x>$this->lMargin)
+ {
+ //Move to next line
+ $this->x=$this->lMargin;
+ $this->y+=$h;
+ $w=$this->w-$this->rMargin-$this->x;
+ $wmax=($w-2*$this->cMargin)*1000/$this->FontSize;
+ $i++;
+ $nl++;
+ continue;
+ }
+ if($i==$j)
+ $i++;
+ $this->Cell($w,$h,substr($s,$j,$i-$j),0,2,'',0,$link);
+ }
+ else
+ {
+ $this->Cell($w,$h,substr($s,$j,$sep-$j),0,2,'',0,$link);
+ $i=$sep+1;
+ }
+ $sep=-1;
+ $j=$i;
+ $l=0;
+ if($nl==1)
+ {
+ $this->x=$this->lMargin;
+ $w=$this->w-$this->rMargin-$this->x;
+ $wmax=($w-2*$this->cMargin)*1000/$this->FontSize;
+ }
+ $nl++;
+ }
+ else
+ $i++;
+ }
+ //Last chunk
+ if($i!=$j)
+ $this->Cell($l/1000*$this->FontSize,$h,substr($s,$j),0,0,'',0,$link);
+}
+
+function Ln($h=null)
+{
+ //Line feed; default value is last cell height
+ $this->x=$this->lMargin;
+ if($h===null)
+ $this->y+=$this->lasth;
+ else
+ $this->y+=$h;
+}
+/*
+ * en commentaire car erreur PHP :
+ * Strict Standards: Declaration of FPDF_Alpha::Image() should be compatible with that of FPDF::Image()
+ */
+/*
+function Image($file, $x=null, $y=null, $w=0, $h=0, $type='', $link='')
+{
+ //Put an image on the page
+ if(!isset($this->images[$file]))
+ {
+ //First use of this image, get info
+ if($type=='')
+ {
+ $pos=strrpos($file,'.');
+ if(!$pos)
+ $this->Error('Image file has no extension and no type was specified: '.$file);
+ $type=substr($file,$pos+1);
+ }
+ $type=strtolower($type);
+ if($type=='jpeg')
+ $type='jpg';
+ $mtd='_parse'.$type;
+ if(!method_exists($this,$mtd))
+ $this->Error('Unsupported image type: '.$type);
+ $info=$this->$mtd($file);
+ $info['i']=count($this->images)+1;
+ $this->images[$file]=$info;
+ }
+ else
+ $info=$this->images[$file];
+ //Automatic width and height calculation if needed
+ if($w==0 && $h==0)
+ {
+ //Put image at 72 dpi
+ $w=$info['w']/$this->k;
+ $h=$info['h']/$this->k;
+ }
+ elseif($w==0)
+ $w=$h*$info['w']/$info['h'];
+ elseif($h==0)
+ $h=$w*$info['h']/$info['w'];
+ //Flowing mode
+ if($y===null)
+ {
+ if($this->y+$h>$this->PageBreakTrigger && !$this->InHeader && !$this->InFooter && $this->AcceptPageBreak())
+ {
+ //Automatic page break
+ $x2=$this->x;
+ $this->AddPage($this->CurOrientation,$this->CurPageFormat);
+ $this->x=$x2;
+ }
+ $y=$this->y;
+ $this->y+=$h;
+ }
+ if($x===null)
+ $x=$this->x;
+ $this->_out(sprintf('q %.2F 0 0 %.2F %.2F %.2F cm /I%d Do Q',$w*$this->k,$h*$this->k,$x*$this->k,($this->h-($y+$h))*$this->k,$info['i']));
+ if($link)
+ $this->Link($x,$y,$w,$h,$link);
+}
+*/
+function GetX()
+{
+ //Get x position
+ return $this->x;
+}
+
+function SetX($x)
+{
+ //Set x position
+ if($x>=0)
+ $this->x=$x;
+ else
+ $this->x=$this->w+$x;
+}
+
+function GetY()
+{
+ //Get y position
+ return $this->y;
+}
+
+function SetY($y)
+{
+ //Set y position and reset x
+ $this->x=$this->lMargin;
+ if($y>=0)
+ $this->y=$y;
+ else
+ $this->y=$this->h+$y;
+}
+
+function SetXY($x, $y)
+{
+ //Set x and y positions
+ $this->SetY($y);
+ $this->SetX($x);
+}
+
+function Output($name='', $dest='')
+{
+ //Output PDF to some destination
+ if($this->state<3)
+ $this->Close();
+ $dest=strtoupper($dest);
+ if($dest=='')
+ {
+ if($name=='')
+ {
+ $name='doc.pdf';
+ $dest='I';
+ }
+ else
+ $dest='F';
+ }
+ switch($dest)
+ {
+ case 'I':
+ //Send to standard output
+ if(ob_get_length())
+ $this->Error('Some data has already been output, can\'t send PDF file');
+ if(php_sapi_name()!='cli')
+ {
+ //We send to a browser
+ header('Content-Type: application/pdf');
+ if(headers_sent())
+ $this->Error('Some data has already been output, can\'t send PDF file');
+ header('Content-Length: '.strlen($this->buffer));
+ header('Content-Disposition: inline; filename="'.$name.'"');
+ header('Cache-Control: private, max-age=0, must-revalidate');
+ header('Pragma: public');
+ ini_set('zlib.output_compression','0');
+ }
+ echo $this->buffer;
+ break;
+ case 'D':
+ //Download file
+ if(ob_get_length())
+ $this->Error('Some data has already been output, can\'t send PDF file');
+ header('Content-Type: application/x-download');
+ if(headers_sent())
+ $this->Error('Some data has already been output, can\'t send PDF file');
+ header('Content-Length: '.strlen($this->buffer));
+ header('Content-Disposition: attachment; filename="'.$name.'"');
+ header('Cache-Control: private, max-age=0, must-revalidate');
+ header('Pragma: public');
+ ini_set('zlib.output_compression','0');
+ echo $this->buffer;
+ break;
+ case 'F':
+ //Save to local file
+ $f=fopen($name,'wb');
+ if(!$f)
+ $this->Error('Unable to create output file: '.$name);
+ fwrite($f,$this->buffer,strlen($this->buffer));
+ fclose($f);
+ break;
+ case 'S':
+ //Return as a string
+ return $this->buffer;
+ default:
+ $this->Error('Incorrect output destination: '.$dest);
+ }
+ return '';
+}
+
+/*******************************************************************************
+* *
+* Protected methods *
+* *
+*******************************************************************************/
+function _dochecks()
+{
+ //Check availability of %F
+ if(sprintf('%.1F',1.0)!='1.0')
+ $this->Error('This version of PHP is not supported');
+ //Check mbstring overloading
+ if(ini_get('mbstring.func_overload') & 2)
+ $this->Error('mbstring overloading must be disabled');
+ //Disable runtime magic quotes
+ if(get_magic_quotes_runtime())
+ @set_magic_quotes_runtime(0);
+}
+
+function _getpageformat($format)
+{
+ $format=strtolower($format);
+ if(!isset($this->PageFormats[$format]))
+ $this->Error('Unknown page format: '.$format);
+ $a=$this->PageFormats[$format];
+ return array($a[0]/$this->k, $a[1]/$this->k);
+}
+
+function _getfontpath()
+{
+ if(!defined('FPDF_FONTPATH') && is_dir(dirname(__FILE__).'/font'))
+ define('FPDF_FONTPATH',dirname(__FILE__).'/font/');
+ return defined('FPDF_FONTPATH') ? FPDF_FONTPATH : '';
+}
+
+function _beginpage($orientation, $format)
+{
+ $this->page++;
+ $this->pages[$this->page]='';
+ $this->state=2;
+ $this->x=$this->lMargin;
+ $this->y=$this->tMargin;
+ $this->FontFamily='';
+ //Check page size
+ if($orientation=='')
+ $orientation=$this->DefOrientation;
+ else
+ $orientation=strtoupper($orientation[0]);
+ if($format=='')
+ $format=$this->DefPageFormat;
+ else
+ {
+ if(is_string($format))
+ $format=$this->_getpageformat($format);
+ }
+ if($orientation!=$this->CurOrientation || $format[0]!=$this->CurPageFormat[0] || $format[1]!=$this->CurPageFormat[1])
+ {
+ //New size
+ if($orientation=='P')
+ {
+ $this->w=$format[0];
+ $this->h=$format[1];
+ }
+ else
+ {
+ $this->w=$format[1];
+ $this->h=$format[0];
+ }
+ $this->wPt=$this->w*$this->k;
+ $this->hPt=$this->h*$this->k;
+ $this->PageBreakTrigger=$this->h-$this->bMargin;
+ $this->CurOrientation=$orientation;
+ $this->CurPageFormat=$format;
+ }
+ if($orientation!=$this->DefOrientation || $format[0]!=$this->DefPageFormat[0] || $format[1]!=$this->DefPageFormat[1])
+ $this->PageSizes[$this->page]=array($this->wPt, $this->hPt);
+}
+
+function _endpage()
+{
+ $this->state=1;
+}
+
+function _escape($s)
+{
+ //Escape special characters in strings
+ $s=str_replace('\\','\\\\',$s);
+ $s=str_replace('(','\\(',$s);
+ $s=str_replace(')','\\)',$s);
+ $s=str_replace("\r",'\\r',$s);
+ return $s;
+}
+
+function _textstring($s)
+{
+ //Format a text string
+ return '('.$this->_escape($s).')';
+}
+
+function _UTF8toUTF16($s)
+{
+ //Convert UTF-8 to UTF-16BE with BOM
+ $res="\xFE\xFF";
+ $nb=strlen($s);
+ $i=0;
+ while($i<$nb)
+ {
+ $c1=ord($s[$i++]);
+ if($c1>=224)
+ {
+ //3-byte character
+ $c2=ord($s[$i++]);
+ $c3=ord($s[$i++]);
+ $res.=chr((($c1 & 0x0F)<<4) + (($c2 & 0x3C)>>2));
+ $res.=chr((($c2 & 0x03)<<6) + ($c3 & 0x3F));
+ }
+ elseif($c1>=192)
+ {
+ //2-byte character
+ $c2=ord($s[$i++]);
+ $res.=chr(($c1 & 0x1C)>>2);
+ $res.=chr((($c1 & 0x03)<<6) + ($c2 & 0x3F));
+ }
+ else
+ {
+ //Single-byte character
+ $res.="\0".chr($c1);
+ }
+ }
+ return $res;
+}
+
+function _dounderline($x, $y, $txt)
+{
+ //Underline text
+ $up=$this->CurrentFont['up'];
+ $ut=$this->CurrentFont['ut'];
+ $w=$this->GetStringWidth($txt)+$this->ws*substr_count($txt,' ');
+ return sprintf('%.2F %.2F %.2F %.2F re f',$x*$this->k,($this->h-($y-$up/1000*$this->FontSize))*$this->k,$w*$this->k,-$ut/1000*$this->FontSizePt);
+}
+
+function _parsejpg($file)
+{
+ //Extract info from a JPEG file
+ $a=GetImageSize($file);
+ if(!$a)
+ $this->Error('Missing or incorrect image file: '.$file);
+ if($a[2]!=2)
+ $this->Error('Not a JPEG file: '.$file);
+ if(!isset($a['channels']) || $a['channels']==3)
+ $colspace='DeviceRGB';
+ elseif($a['channels']==4)
+ $colspace='DeviceCMYK';
+ else
+ $colspace='DeviceGray';
+ $bpc=isset($a['bits']) ? $a['bits'] : 8;
+ //Read whole file
+ $f=fopen($file,'rb');
+ $data='';
+ while(!feof($f))
+ $data.=fread($f,8192);
+ fclose($f);
+ return array('w'=>$a[0], 'h'=>$a[1], 'cs'=>$colspace, 'bpc'=>$bpc, 'f'=>'DCTDecode', 'data'=>$data);
+}
+
+function _parsepng($file)
+{
+ //Extract info from a PNG file
+ $f=fopen($file,'rb');
+ if(!$f)
+ $this->Error('Can\'t open image file: '.$file);
+ //Check signature
+ if($this->_readstream($f,8)!=chr(137).'PNG'.chr(13).chr(10).chr(26).chr(10))
+ $this->Error('Not a PNG file: '.$file);
+ //Read header chunk
+ $this->_readstream($f,4);
+ if($this->_readstream($f,4)!='IHDR')
+ $this->Error('Incorrect PNG file: '.$file);
+ $w=$this->_readint($f);
+ $h=$this->_readint($f);
+ $bpc=ord($this->_readstream($f,1));
+ if($bpc>8)
+ $this->Error('16-bit depth not supported: '.$file);
+ $ct=ord($this->_readstream($f,1));
+ if($ct==0)
+ $colspace='DeviceGray';
+ elseif($ct==2)
+ $colspace='DeviceRGB';
+ elseif($ct==3)
+ $colspace='Indexed';
+ else
+ $this->Error('Alpha channel not supported: '.$file);
+ if(ord($this->_readstream($f,1))!=0)
+ $this->Error('Unknown compression method: '.$file);
+ if(ord($this->_readstream($f,1))!=0)
+ $this->Error('Unknown filter method: '.$file);
+ if(ord($this->_readstream($f,1))!=0)
+ $this->Error('Interlacing not supported: '.$file);
+ $this->_readstream($f,4);
+ $parms='/DecodeParms <>';
+ //Scan chunks looking for palette, transparency and image data
+ $pal='';
+ $trns='';
+ $data='';
+ do
+ {
+ $n=$this->_readint($f);
+ $type=$this->_readstream($f,4);
+ if($type=='PLTE')
+ {
+ //Read palette
+ $pal=$this->_readstream($f,$n);
+ $this->_readstream($f,4);
+ }
+ elseif($type=='tRNS')
+ {
+ //Read transparency info
+ $t=$this->_readstream($f,$n);
+ if($ct==0)
+ $trns=array(ord(substr($t,1,1)));
+ elseif($ct==2)
+ $trns=array(ord(substr($t,1,1)), ord(substr($t,3,1)), ord(substr($t,5,1)));
+ else
+ {
+ $pos=strpos($t,chr(0));
+ if($pos!==false)
+ $trns=array($pos);
+ }
+ $this->_readstream($f,4);
+ }
+ elseif($type=='IDAT')
+ {
+ //Read image data block
+ $data.=$this->_readstream($f,$n);
+ $this->_readstream($f,4);
+ }
+ elseif($type=='IEND')
+ break;
+ else
+ $this->_readstream($f,$n+4);
+ }
+ while($n);
+ if($colspace=='Indexed' && empty($pal))
+ $this->Error('Missing palette in '.$file);
+ fclose($f);
+ return array('w'=>$w, 'h'=>$h, 'cs'=>$colspace, 'bpc'=>$bpc, 'f'=>'FlateDecode', 'parms'=>$parms, 'pal'=>$pal, 'trns'=>$trns, 'data'=>$data);
+}
+
+function _readstream($f, $n)
+{
+ //Read n bytes from stream
+ $res='';
+ while($n>0 && !feof($f))
+ {
+ $s=fread($f,$n);
+ if($s===false)
+ $this->Error('Error while reading stream');
+ $n-=strlen($s);
+ $res.=$s;
+ }
+ if($n>0)
+ $this->Error('Unexpected end of stream');
+ return $res;
+}
+
+function _readint($f)
+{
+ //Read a 4-byte integer from stream
+ $a=unpack('Ni',$this->_readstream($f,4));
+ return $a['i'];
+}
+
+function _parsegif($file)
+{
+ //Extract info from a GIF file (via PNG conversion)
+ if(!function_exists('imagepng'))
+ $this->Error('GD extension is required for GIF support');
+ if(!function_exists('imagecreatefromgif'))
+ $this->Error('GD has no GIF read support');
+ $im=imagecreatefromgif($file);
+ if(!$im)
+ $this->Error('Missing or incorrect image file: '.$file);
+ imageinterlace($im,0);
+ $tmp=tempnam('.','gif');
+ if(!$tmp)
+ $this->Error('Unable to create a temporary file');
+ if(!imagepng($im,$tmp))
+ $this->Error('Error while saving to temporary file');
+ imagedestroy($im);
+ $info=$this->_parsepng($tmp);
+ unlink($tmp);
+ return $info;
+}
+
+function _newobj()
+{
+ //Begin a new object
+ $this->n++;
+ $this->offsets[$this->n]=strlen($this->buffer);
+ $this->_out($this->n.' 0 obj');
+}
+
+function _putstream($s)
+{
+ $this->_out('stream');
+ $this->_out($s);
+ $this->_out('endstream');
+}
+
+function _out($s)
+{
+ //Add a line to the document
+ if($this->state==2)
+ $this->pages[$this->page].=$s."\n";
+ else
+ $this->buffer.=$s."\n";
+}
+
+function _putpages()
+{
+ $nb=$this->page;
+ if(!empty($this->AliasNbPages))
+ {
+ //Replace number of pages
+ for($n=1;$n<=$nb;$n++)
+ $this->pages[$n]=str_replace($this->AliasNbPages,$nb,$this->pages[$n]);
+ }
+ if($this->DefOrientation=='P')
+ {
+ $wPt=$this->DefPageFormat[0]*$this->k;
+ $hPt=$this->DefPageFormat[1]*$this->k;
+ }
+ else
+ {
+ $wPt=$this->DefPageFormat[1]*$this->k;
+ $hPt=$this->DefPageFormat[0]*$this->k;
+ }
+ $filter=($this->compress) ? '/Filter /FlateDecode ' : '';
+ for($n=1;$n<=$nb;$n++)
+ {
+ //Page
+ $this->_newobj();
+ $this->_out('<_out('/Parent 1 0 R');
+ if(isset($this->PageSizes[$n]))
+ $this->_out(sprintf('/MediaBox [0 0 %.2F %.2F]',$this->PageSizes[$n][0],$this->PageSizes[$n][1]));
+ $this->_out('/Resources 2 0 R');
+ if(isset($this->PageLinks[$n]))
+ {
+ //Links
+ $annots='/Annots [';
+ foreach($this->PageLinks[$n] as $pl)
+ {
+ $rect=sprintf('%.2F %.2F %.2F %.2F',$pl[0],$pl[1],$pl[0]+$pl[2],$pl[1]-$pl[3]);
+ $annots.='<_textstring($pl[4]).'>>>>';
+ else
+ {
+ $l=$this->links[$pl[4]];
+ $h=isset($this->PageSizes[$l[0]]) ? $this->PageSizes[$l[0]][1] : $hPt;
+ $annots.=sprintf('/Dest [%d 0 R /XYZ 0 %.2F null]>>',1+2*$l[0],$h-$l[1]*$this->k);
+ }
+ }
+ $this->_out($annots.']');
+ }
+ $this->_out('/Contents '.($this->n+1).' 0 R>>');
+ $this->_out('endobj');
+ //Page content
+ $p=($this->compress) ? gzcompress($this->pages[$n]) : $this->pages[$n];
+ $this->_newobj();
+ $this->_out('<<'.$filter.'/Length '.strlen($p).'>>');
+ $this->_putstream($p);
+ $this->_out('endobj');
+ }
+ //Pages root
+ $this->offsets[1]=strlen($this->buffer);
+ $this->_out('1 0 obj');
+ $this->_out('<_out($kids.']');
+ $this->_out('/Count '.$nb);
+ $this->_out(sprintf('/MediaBox [0 0 %.2F %.2F]',$wPt,$hPt));
+ $this->_out('>>');
+ $this->_out('endobj');
+}
+
+function _putfonts()
+{
+ $nf=$this->n;
+ foreach($this->diffs as $diff)
+ {
+ //Encodings
+ $this->_newobj();
+ $this->_out('<>');
+ $this->_out('endobj');
+ }
+ foreach($this->FontFiles as $file=>$info)
+ {
+ //Font file embedding
+ $this->_newobj();
+ $this->FontFiles[$file]['n']=$this->n;
+ $font='';
+ $f=fopen($this->_getfontpath().$file,'rb',1);
+ if(!$f)
+ $this->Error('Font file not found');
+ while(!feof($f))
+ $font.=fread($f,8192);
+ fclose($f);
+ $compressed=(substr($file,-2)=='.z');
+ if(!$compressed && isset($info['length2']))
+ {
+ $header=(ord($font[0])==128);
+ if($header)
+ {
+ //Strip first binary header
+ $font=substr($font,6);
+ }
+ if($header && ord($font[$info['length1']])==128)
+ {
+ //Strip second binary header
+ $font=substr($font,0,$info['length1']).substr($font,$info['length1']+6);
+ }
+ }
+ $this->_out('<_out('/Filter /FlateDecode');
+ $this->_out('/Length1 '.$info['length1']);
+ if(isset($info['length2']))
+ $this->_out('/Length2 '.$info['length2'].' /Length3 0');
+ $this->_out('>>');
+ $this->_putstream($font);
+ $this->_out('endobj');
+ }
+ foreach($this->fonts as $k=>$font)
+ {
+ //Font objects
+ $this->fonts[$k]['n']=$this->n+1;
+ $type=$font['type'];
+ $name=$font['name'];
+ if($type=='core')
+ {
+ //Standard font
+ $this->_newobj();
+ $this->_out('<_out('/BaseFont /'.$name);
+ $this->_out('/Subtype /Type1');
+ if($name!='Symbol' && $name!='ZapfDingbats')
+ $this->_out('/Encoding /WinAnsiEncoding');
+ $this->_out('>>');
+ $this->_out('endobj');
+ }
+ elseif($type=='Type1' || $type=='TrueType')
+ {
+ //Additional Type1 or TrueType font
+ $this->_newobj();
+ $this->_out('<_out('/BaseFont /'.$name);
+ $this->_out('/Subtype /'.$type);
+ $this->_out('/FirstChar 32 /LastChar 255');
+ $this->_out('/Widths '.($this->n+1).' 0 R');
+ $this->_out('/FontDescriptor '.($this->n+2).' 0 R');
+ if($font['enc'])
+ {
+ if(isset($font['diff']))
+ $this->_out('/Encoding '.($nf+$font['diff']).' 0 R');
+ else
+ $this->_out('/Encoding /WinAnsiEncoding');
+ }
+ $this->_out('>>');
+ $this->_out('endobj');
+ //Widths
+ $this->_newobj();
+ $cw=&$font['cw'];
+ $s='[';
+ for($i=32;$i<=255;$i++)
+ $s.=$cw[chr($i)].' ';
+ $this->_out($s.']');
+ $this->_out('endobj');
+ //Descriptor
+ $this->_newobj();
+ $s='<$v)
+ $s.=' /'.$k.' '.$v;
+ $file=$font['file'];
+ if($file)
+ $s.=' /FontFile'.($type=='Type1' ? '' : '2').' '.$this->FontFiles[$file]['n'].' 0 R';
+ $this->_out($s.'>>');
+ $this->_out('endobj');
+ }
+ else
+ {
+ //Allow for additional types
+ $mtd='_put'.strtolower($type);
+ if(!method_exists($this,$mtd))
+ $this->Error('Unsupported font type: '.$type);
+ $this->$mtd($font);
+ }
+ }
+}
+
+function _putimages()
+{
+ $filter=($this->compress) ? '/Filter /FlateDecode ' : '';
+ reset($this->images);
+ while(list($file,$info)=each($this->images))
+ {
+ $this->_newobj();
+ $this->images[$file]['n']=$this->n;
+ $this->_out('<_out('/Subtype /Image');
+ $this->_out('/Width '.$info['w']);
+ $this->_out('/Height '.$info['h']);
+ if($info['cs']=='Indexed')
+ $this->_out('/ColorSpace [/Indexed /DeviceRGB '.(strlen($info['pal'])/3-1).' '.($this->n+1).' 0 R]');
+ else
+ {
+ $this->_out('/ColorSpace /'.$info['cs']);
+ if($info['cs']=='DeviceCMYK')
+ $this->_out('/Decode [1 0 1 0 1 0 1 0]');
+ }
+ $this->_out('/BitsPerComponent '.$info['bpc']);
+ if(isset($info['f']))
+ $this->_out('/Filter /'.$info['f']);
+ if(isset($info['parms']))
+ $this->_out($info['parms']);
+ if(isset($info['trns']) && is_array($info['trns']))
+ {
+ $trns='';
+ for($i=0;$i_out('/Mask ['.$trns.']');
+ }
+ $this->_out('/Length '.strlen($info['data']).'>>');
+ $this->_putstream($info['data']);
+ unset($this->images[$file]['data']);
+ $this->_out('endobj');
+ //Palette
+ if($info['cs']=='Indexed')
+ {
+ $this->_newobj();
+ $pal=($this->compress) ? gzcompress($info['pal']) : $info['pal'];
+ $this->_out('<<'.$filter.'/Length '.strlen($pal).'>>');
+ $this->_putstream($pal);
+ $this->_out('endobj');
+ }
+ }
+}
+
+function _putxobjectdict()
+{
+ foreach($this->images as $image)
+ $this->_out('/I'.$image['i'].' '.$image['n'].' 0 R');
+}
+
+function _putresourcedict()
+{
+ $this->_out('/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]');
+ $this->_out('/Font <<');
+ foreach($this->fonts as $font)
+ $this->_out('/F'.$font['i'].' '.$font['n'].' 0 R');
+ $this->_out('>>');
+ $this->_out('/XObject <<');
+ $this->_putxobjectdict();
+ $this->_out('>>');
+}
+
+function _putresources()
+{
+ $this->_putfonts();
+ $this->_putimages();
+ //Resource dictionary
+ $this->offsets[2]=strlen($this->buffer);
+ $this->_out('2 0 obj');
+ $this->_out('<<');
+ $this->_putresourcedict();
+ $this->_out('>>');
+ $this->_out('endobj');
+}
+
+function _putinfo()
+{
+ $this->_out('/Producer '.$this->_textstring('FPDF '.FPDF_VERSION));
+ if(!empty($this->title))
+ $this->_out('/Title '.$this->_textstring($this->title));
+ if(!empty($this->subject))
+ $this->_out('/Subject '.$this->_textstring($this->subject));
+ if(!empty($this->author))
+ $this->_out('/Author '.$this->_textstring($this->author));
+ if(!empty($this->keywords))
+ $this->_out('/Keywords '.$this->_textstring($this->keywords));
+ if(!empty($this->creator))
+ $this->_out('/Creator '.$this->_textstring($this->creator));
+ $this->_out('/CreationDate '.$this->_textstring('D:'.@date('YmdHis')));
+}
+
+function _putcatalog()
+{
+ $this->_out('/Type /Catalog');
+ $this->_out('/Pages 1 0 R');
+ if($this->ZoomMode=='fullpage')
+ $this->_out('/OpenAction [3 0 R /Fit]');
+ elseif($this->ZoomMode=='fullwidth')
+ $this->_out('/OpenAction [3 0 R /FitH null]');
+ elseif($this->ZoomMode=='real')
+ $this->_out('/OpenAction [3 0 R /XYZ null null 1]');
+ elseif(!is_string($this->ZoomMode))
+ $this->_out('/OpenAction [3 0 R /XYZ null null '.($this->ZoomMode/100).']');
+ if($this->LayoutMode=='single')
+ $this->_out('/PageLayout /SinglePage');
+ elseif($this->LayoutMode=='continuous')
+ $this->_out('/PageLayout /OneColumn');
+ elseif($this->LayoutMode=='two')
+ $this->_out('/PageLayout /TwoColumnLeft');
+}
+
+function _putheader()
+{
+ $this->_out('%PDF-'.$this->PDFVersion);
+}
+
+function _puttrailer()
+{
+ $this->_out('/Size '.($this->n+1));
+ $this->_out('/Root '.$this->n.' 0 R');
+ $this->_out('/Info '.($this->n-1).' 0 R');
+}
+
+function _enddoc()
+{
+ $this->_putheader();
+ $this->_putpages();
+ $this->_putresources();
+ //Info
+ $this->_newobj();
+ $this->_out('<<');
+ $this->_putinfo();
+ $this->_out('>>');
+ $this->_out('endobj');
+ //Catalog
+ $this->_newobj();
+ $this->_out('<<');
+ $this->_putcatalog();
+ $this->_out('>>');
+ $this->_out('endobj');
+ //Cross-ref
+ $o=strlen($this->buffer);
+ $this->_out('xref');
+ $this->_out('0 '.($this->n+1));
+ $this->_out('0000000000 65535 f ');
+ for($i=1;$i<=$this->n;$i++)
+ $this->_out(sprintf('%010d 00000 n ',$this->offsets[$i]));
+ //Trailer
+ $this->_out('trailer');
+ $this->_out('<<');
+ $this->_puttrailer();
+ $this->_out('>>');
+ $this->_out('startxref');
+ $this->_out($o);
+ $this->_out('%%EOF');
+ $this->state=3;
+}
+//End of class
+}
+
+//Handle special IE contype request
+if(isset($_SERVER['HTTP_USER_AGENT']) && $_SERVER['HTTP_USER_AGENT']=='contype')
+{
+ header('Content-Type: application/pdf');
+ exit;
+}
diff --git a/main/inc/lib/html2pdf/_fpdf/license.txt b/main/inc/lib/html2pdf/_fpdf/license.txt
index 6107ee4777..fd811c6f56 100755
--- a/main/inc/lib/html2pdf/_fpdf/license.txt
+++ b/main/inc/lib/html2pdf/_fpdf/license.txt
@@ -1,6 +1,6 @@
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software to use, copy, modify, distribute, sublicense, and/or sell
-copies of the software, and to permit persons to whom the software is furnished
-to do so.
-
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software to use, copy, modify, distribute, sublicense, and/or sell
+copies of the software, and to permit persons to whom the software is furnished
+to do so.
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED.
\ No newline at end of file
diff --git a/main/inc/lib/html2pdf/_mypdf/00_fpdf_codebar.class.php b/main/inc/lib/html2pdf/_mypdf/00_fpdf_codebar.class.php
index 9fb8ff05cb..220f05b7ea 100755
--- a/main/inc/lib/html2pdf/_mypdf/00_fpdf_codebar.class.php
+++ b/main/inc/lib/html2pdf/_mypdf/00_fpdf_codebar.class.php
@@ -1,238 +1,237 @@
-FPDF($sens, $unit, $format);
- }
-
- function BARCODE_EAN13($x,$y,$barcode,$h=10,$w=.35)
- {
- return $this->Barcode($x,$y,$barcode,$h,$w,13);
- }
-
- function BARCODE_UPC_A($x,$y,$barcode,$h=10,$w=.35)
- {
- return $this->Barcode($x,$y,$barcode,$h,$w,12);
- }
-
- function GetCheckDigit($barcode)
- {
- //Compute the check digit
- $sum=0;
- for($i=1;$i<=11;$i+=2)
- $sum+=3*$barcode{$i};
- for($i=0;$i<=10;$i+=2)
- $sum+=$barcode{$i};
- $r=$sum%10;
- if($r>0)
- $r=10-$r;
- return $r;
- }
-
- function TestCheckDigit($barcode)
- {
- //Test validity of check digit
- $sum=0;
- for($i=1;$i<=11;$i+=2)
- $sum+=3*$barcode{$i};
- for($i=0;$i<=10;$i+=2)
- $sum+=$barcode{$i};
- return ($sum+$barcode{12})%10==0;
- }
-
- function Barcode($x,$y,$barcode,$h,$w,$len)
- {
- //Padding
- $barcode=str_pad($barcode,$len-1,'0',STR_PAD_LEFT);
- if($len==12)
- $barcode='0'.$barcode;
- //Add or control the check digit
- if(strlen($barcode)==12)
- $barcode.=$this->GetCheckDigit($barcode);
- elseif(!$this->TestCheckDigit($barcode))
- $this->Error('Incorrect check digit');
- //Convert digits to bars
- $codes=array(
- 'A'=>array(
- '0'=>'0001101','1'=>'0011001','2'=>'0010011','3'=>'0111101','4'=>'0100011',
- '5'=>'0110001','6'=>'0101111','7'=>'0111011','8'=>'0110111','9'=>'0001011'),
- 'B'=>array(
- '0'=>'0100111','1'=>'0110011','2'=>'0011011','3'=>'0100001','4'=>'0011101',
- '5'=>'0111001','6'=>'0000101','7'=>'0010001','8'=>'0001001','9'=>'0010111'),
- 'C'=>array(
- '0'=>'1110010','1'=>'1100110','2'=>'1101100','3'=>'1000010','4'=>'1011100',
- '5'=>'1001110','6'=>'1010000','7'=>'1000100','8'=>'1001000','9'=>'1110100')
- );
- $parities=array(
- '0'=>array('A','A','A','A','A','A'),
- '1'=>array('A','A','B','A','B','B'),
- '2'=>array('A','A','B','B','A','B'),
- '3'=>array('A','A','B','B','B','A'),
- '4'=>array('A','B','A','A','B','B'),
- '5'=>array('A','B','B','A','A','B'),
- '6'=>array('A','B','B','B','A','A'),
- '7'=>array('A','B','A','B','A','B'),
- '8'=>array('A','B','A','B','B','A'),
- '9'=>array('A','B','B','A','B','A')
- );
- $code='101';
- $p=$parities[$barcode{0}];
- for($i=1;$i<=6;$i++)
- $code.=$codes[$p[$i-1]][$barcode{$i}];
- $code.='01010';
- for($i=7;$i<=12;$i++)
- $code.=$codes['C'][$barcode{$i}];
- $code.='101';
- //Draw bars
- for($i=0;$iRect($x+$i*$w,$y,$w,$h,'F');
- }
-
- $code_w = strlen($code)*$w;
- $code_t = substr($barcode,-$len);
-
- $code_f = $code_w/strlen($code_t)*$this->k/0.60;
- $code_h = $h+$code_f/$this->k;
-
- //Print text uder barcode
- $this->SetFont('Arial','',$code_f);
- $this->Text($x,$y+$h+0.90*$code_f/$this->k,$code_t);
-
- return array($code_w, $code_h);
- }
-
- function BARCODE_CODE39($xpos, $ypos, $code,$height=10, $baseline=0.5 )
- {
-
- $wide = $baseline;
- $narrow = $baseline / 3 ;
- $gap = $narrow;
-
- $barChar['0'] = 'nnnwwnwnn';
- $barChar['1'] = 'wnnwnnnnw';
- $barChar['2'] = 'nnwwnnnnw';
- $barChar['3'] = 'wnwwnnnnn';
- $barChar['4'] = 'nnnwwnnnw';
- $barChar['5'] = 'wnnwwnnnn';
- $barChar['6'] = 'nnwwwnnnn';
- $barChar['7'] = 'nnnwnnwnw';
- $barChar['8'] = 'wnnwnnwnn';
- $barChar['9'] = 'nnwwnnwnn';
- $barChar['A'] = 'wnnnnwnnw';
- $barChar['B'] = 'nnwnnwnnw';
- $barChar['C'] = 'wnwnnwnnn';
- $barChar['D'] = 'nnnnwwnnw';
- $barChar['E'] = 'wnnnwwnnn';
- $barChar['F'] = 'nnwnwwnnn';
- $barChar['G'] = 'nnnnnwwnw';
- $barChar['H'] = 'wnnnnwwnn';
- $barChar['I'] = 'nnwnnwwnn';
- $barChar['J'] = 'nnnnwwwnn';
- $barChar['K'] = 'wnnnnnnww';
- $barChar['L'] = 'nnwnnnnww';
- $barChar['M'] = 'wnwnnnnwn';
- $barChar['N'] = 'nnnnwnnww';
- $barChar['O'] = 'wnnnwnnwn';
- $barChar['P'] = 'nnwnwnnwn';
- $barChar['Q'] = 'nnnnnnwww';
- $barChar['R'] = 'wnnnnnwwn';
- $barChar['S'] = 'nnwnnnwwn';
- $barChar['T'] = 'nnnnwnwwn';
- $barChar['U'] = 'wwnnnnnnw';
- $barChar['V'] = 'nwwnnnnnw';
- $barChar['W'] = 'wwwnnnnnn';
- $barChar['X'] = 'nwnnwnnnw';
- $barChar['Y'] = 'wwnnwnnnn';
- $barChar['Z'] = 'nwwnwnnnn';
- $barChar['-'] = 'nwnnnnwnw';
- $barChar['.'] = 'wwnnnnwnn';
- $barChar[' '] = 'nwwnnnwnn';
- $barChar['*'] = 'nwnnwnwnn';
- $barChar['$'] = 'nwnwnwnnn';
- $barChar['/'] = 'nwnwnnnwn';
- $barChar['+'] = 'nwnnnwnwn';
- $barChar['%'] = 'nnnwnwnwn';
-
- $xpos_dep = $xpos;
- $code = '*'.strtoupper($code).'*';
- for($i=0; $iError('Invalid character in barcode: '.$char);
- }
- $seq = $barChar[$char];
- for($bar=0; $bar<9; $bar++){
- if($seq{$bar} == 'n'){
- $lineWidth = $narrow;
- }else{
- $lineWidth = $wide;
- }
- if($bar % 2 == 0){
- $this->Rect($xpos, $ypos, $lineWidth, $height, 'F');
- }
- $xpos += $lineWidth;
- }
- $xpos += $gap;
- }
-
- $code_w = $xpos-$xpos_dep;
- $code_t = $code;
-
- $code_f = $code_w/strlen($code_t)*$this->k/0.60/3;
- $code_h = $height+$code_f/$this->k;
-
- //Print text uder barcode
- $this->SetFont('Arial','',$code_f);
- $this->Text($xpos_dep,$ypos+$height+0.90*$code_f/$this->k,$code_t);
-
- return array($code_w, $code_h);
- }
- }
-}
-?>
\ No newline at end of file
+FPDF($sens, $unit, $format);
+ }
+
+ function BARCODE_EAN13($x,$y,$barcode,$h=10,$w=.35)
+ {
+ return $this->Barcode($x,$y,$barcode,$h,$w,13);
+ }
+
+ function BARCODE_UPC_A($x,$y,$barcode,$h=10,$w=.35)
+ {
+ return $this->Barcode($x,$y,$barcode,$h,$w,12);
+ }
+
+ function GetCheckDigit($barcode)
+ {
+ //Compute the check digit
+ $sum=0;
+ for($i=1;$i<=11;$i+=2)
+ $sum+=3*$barcode{$i};
+ for($i=0;$i<=10;$i+=2)
+ $sum+=$barcode{$i};
+ $r=$sum%10;
+ if($r>0)
+ $r=10-$r;
+ return $r;
+ }
+
+ function TestCheckDigit($barcode)
+ {
+ //Test validity of check digit
+ $sum=0;
+ for($i=1;$i<=11;$i+=2)
+ $sum+=3*$barcode{$i};
+ for($i=0;$i<=10;$i+=2)
+ $sum+=$barcode{$i};
+ return ($sum+$barcode{12})%10==0;
+ }
+
+ function Barcode($x,$y,$barcode,$h,$w,$len)
+ {
+ //Padding
+ $barcode=str_pad($barcode,$len-1,'0',STR_PAD_LEFT);
+ if($len==12)
+ $barcode='0'.$barcode;
+ //Add or control the check digit
+ if(strlen($barcode)==12)
+ $barcode.=$this->GetCheckDigit($barcode);
+ elseif(!$this->TestCheckDigit($barcode))
+ $this->Error('Incorrect check digit');
+ //Convert digits to bars
+ $codes=array(
+ 'A'=>array(
+ '0'=>'0001101','1'=>'0011001','2'=>'0010011','3'=>'0111101','4'=>'0100011',
+ '5'=>'0110001','6'=>'0101111','7'=>'0111011','8'=>'0110111','9'=>'0001011'),
+ 'B'=>array(
+ '0'=>'0100111','1'=>'0110011','2'=>'0011011','3'=>'0100001','4'=>'0011101',
+ '5'=>'0111001','6'=>'0000101','7'=>'0010001','8'=>'0001001','9'=>'0010111'),
+ 'C'=>array(
+ '0'=>'1110010','1'=>'1100110','2'=>'1101100','3'=>'1000010','4'=>'1011100',
+ '5'=>'1001110','6'=>'1010000','7'=>'1000100','8'=>'1001000','9'=>'1110100')
+ );
+ $parities=array(
+ '0'=>array('A','A','A','A','A','A'),
+ '1'=>array('A','A','B','A','B','B'),
+ '2'=>array('A','A','B','B','A','B'),
+ '3'=>array('A','A','B','B','B','A'),
+ '4'=>array('A','B','A','A','B','B'),
+ '5'=>array('A','B','B','A','A','B'),
+ '6'=>array('A','B','B','B','A','A'),
+ '7'=>array('A','B','A','B','A','B'),
+ '8'=>array('A','B','A','B','B','A'),
+ '9'=>array('A','B','B','A','B','A')
+ );
+ $code='101';
+ $p=$parities[$barcode{0}];
+ for($i=1;$i<=6;$i++)
+ $code.=$codes[$p[$i-1]][$barcode{$i}];
+ $code.='01010';
+ for($i=7;$i<=12;$i++)
+ $code.=$codes['C'][$barcode{$i}];
+ $code.='101';
+ //Draw bars
+ for($i=0;$iRect($x+$i*$w,$y,$w,$h,'F');
+ }
+
+ $code_w = strlen($code)*$w;
+ $code_t = substr($barcode,-$len);
+
+ $code_f = $code_w/strlen($code_t)*$this->k/0.60;
+ $code_h = $h+$code_f/$this->k;
+
+ //Print text uder barcode
+ $this->SetFont('Arial','',$code_f);
+ $this->Text($x,$y+$h+0.90*$code_f/$this->k,$code_t);
+
+ return array($code_w, $code_h);
+ }
+
+ function BARCODE_CODE39($xpos, $ypos, $code,$height=10, $baseline=0.5 )
+ {
+
+ $wide = $baseline;
+ $narrow = $baseline / 3 ;
+ $gap = $narrow;
+
+ $barChar['0'] = 'nnnwwnwnn';
+ $barChar['1'] = 'wnnwnnnnw';
+ $barChar['2'] = 'nnwwnnnnw';
+ $barChar['3'] = 'wnwwnnnnn';
+ $barChar['4'] = 'nnnwwnnnw';
+ $barChar['5'] = 'wnnwwnnnn';
+ $barChar['6'] = 'nnwwwnnnn';
+ $barChar['7'] = 'nnnwnnwnw';
+ $barChar['8'] = 'wnnwnnwnn';
+ $barChar['9'] = 'nnwwnnwnn';
+ $barChar['A'] = 'wnnnnwnnw';
+ $barChar['B'] = 'nnwnnwnnw';
+ $barChar['C'] = 'wnwnnwnnn';
+ $barChar['D'] = 'nnnnwwnnw';
+ $barChar['E'] = 'wnnnwwnnn';
+ $barChar['F'] = 'nnwnwwnnn';
+ $barChar['G'] = 'nnnnnwwnw';
+ $barChar['H'] = 'wnnnnwwnn';
+ $barChar['I'] = 'nnwnnwwnn';
+ $barChar['J'] = 'nnnnwwwnn';
+ $barChar['K'] = 'wnnnnnnww';
+ $barChar['L'] = 'nnwnnnnww';
+ $barChar['M'] = 'wnwnnnnwn';
+ $barChar['N'] = 'nnnnwnnww';
+ $barChar['O'] = 'wnnnwnnwn';
+ $barChar['P'] = 'nnwnwnnwn';
+ $barChar['Q'] = 'nnnnnnwww';
+ $barChar['R'] = 'wnnnnnwwn';
+ $barChar['S'] = 'nnwnnnwwn';
+ $barChar['T'] = 'nnnnwnwwn';
+ $barChar['U'] = 'wwnnnnnnw';
+ $barChar['V'] = 'nwwnnnnnw';
+ $barChar['W'] = 'wwwnnnnnn';
+ $barChar['X'] = 'nwnnwnnnw';
+ $barChar['Y'] = 'wwnnwnnnn';
+ $barChar['Z'] = 'nwwnwnnnn';
+ $barChar['-'] = 'nwnnnnwnw';
+ $barChar['.'] = 'wwnnnnwnn';
+ $barChar[' '] = 'nwwnnnwnn';
+ $barChar['*'] = 'nwnnwnwnn';
+ $barChar['$'] = 'nwnwnwnnn';
+ $barChar['/'] = 'nwnwnnnwn';
+ $barChar['+'] = 'nwnnnwnwn';
+ $barChar['%'] = 'nnnwnwnwn';
+
+ $xpos_dep = $xpos;
+ $code = '*'.strtoupper($code).'*';
+ for($i=0; $iError('Invalid character in barcode: '.$char);
+ }
+ $seq = $barChar[$char];
+ for($bar=0; $bar<9; $bar++){
+ if($seq{$bar} == 'n'){
+ $lineWidth = $narrow;
+ }else{
+ $lineWidth = $wide;
+ }
+ if($bar % 2 == 0){
+ $this->Rect($xpos, $ypos, $lineWidth, $height, 'F');
+ }
+ $xpos += $lineWidth;
+ }
+ $xpos += $gap;
+ }
+
+ $code_w = $xpos-$xpos_dep;
+ $code_t = $code;
+
+ $code_f = $code_w/strlen($code_t)*$this->k/0.60/3;
+ $code_h = $height+$code_f/$this->k;
+
+ //Print text uder barcode
+ $this->SetFont('Arial','',$code_f);
+ $this->Text($xpos_dep,$ypos+$height+0.90*$code_f/$this->k,$code_t);
+
+ return array($code_w, $code_h);
+ }
+ }
+}
\ No newline at end of file
diff --git a/main/inc/lib/html2pdf/_mypdf/01_fpdf_bookmark.class.php b/main/inc/lib/html2pdf/_mypdf/01_fpdf_bookmark.class.php
index 80e70a3d63..89d65900ae 100755
--- a/main/inc/lib/html2pdf/_mypdf/01_fpdf_bookmark.class.php
+++ b/main/inc/lib/html2pdf/_mypdf/01_fpdf_bookmark.class.php
@@ -1,27 +1,27 @@
FPDF_Codebar($orientation,$unit,$format);
-
+
}
-
+
function Bookmark($txt, $level=0, $y=0)
{
if($y==-1) $y=$this->GetY();
$this->outlines[]=array('t'=>$txt, 'l'=>$level, 'y'=>($this->h-$y)*$this->k, 'p'=>$this->PageNo());
}
-
+
function _putbookmarks()
{
$nb=count($this->outlines);
@@ -67,7 +67,7 @@ require_once(dirname(__FILE__).'/00_fpdf_codebar.class.php');
}
else
$this->outlines[$i]['parent']=$nb;
-
+
if($o['l']<=$level and $i>0)
{
//Set prev and next pointers
@@ -78,7 +78,7 @@ require_once(dirname(__FILE__).'/00_fpdf_codebar.class.php');
$lru[$o['l']]=$i;
$level=$o['l'];
}
-
+
//Outline items
$n=$this->n+1;
foreach($this->outlines as $i=>$o)
@@ -98,7 +98,7 @@ require_once(dirname(__FILE__).'/00_fpdf_codebar.class.php');
$this->_out('/Count 0>>');
$this->_out('endobj');
}
-
+
//Outline root
$this->_newobj();
$this->OutlineRoot=$this->n;
@@ -106,13 +106,13 @@ require_once(dirname(__FILE__).'/00_fpdf_codebar.class.php');
$this->_out('/Last '.($n+$lru[0]).' 0 R>>');
$this->_out('endobj');
}
-
+
function _putresources()
{
parent::_putresources();
$this->_putbookmarks();
}
-
+
function _putcatalog()
{
parent::_putcatalog();
@@ -122,17 +122,17 @@ require_once(dirname(__FILE__).'/00_fpdf_codebar.class.php');
$this->_out('/PageMode /UseOutlines');
}
}
-
+
function CreateIndex(&$obj, $titre = 'Index', $size_title = 20, $size_bookmark = 15, $bookmark_title = true, $display_page = true)
{
if ($bookmark_title) $this->Bookmark($titre, 0, -1);
-
+
//Index title
$this->SetFontSize($size_title);
$this->Cell(0,5,$titre,0,1,'C');
$this->SetFontSize($size_bookmark);
$this->Ln(10);
-
+
$size=sizeof($this->outlines);
$PageCellSize=$this->GetStringWidth('p. '.$this->outlines[$size-1]['p'])+2;
for ($i=0;$i<$size;$i++)
@@ -142,11 +142,11 @@ require_once(dirname(__FILE__).'/00_fpdf_codebar.class.php');
$obj->setNewPage();
$this->SetFontSize($size_bookmark);
}
-
+
//Offset
$level=$this->outlines[$i]['l'];
if($level>0) $this->Cell($level*8);
-
+
//Caption
$str=$this->outlines[$i]['t'];
$strsize=$this->GetStringWidth($str);
@@ -159,7 +159,7 @@ require_once(dirname(__FILE__).'/00_fpdf_codebar.class.php');
if ($display_page)
{
$this->Cell($strsize+2,$this->FontSize+2,$str);
-
+
//Filling dots
$w=$this->w-$this->lMargin-$this->rMargin-$PageCellSize-($level*8)-($strsize+2);
$nb=$w/$this->GetStringWidth('.');
@@ -171,10 +171,9 @@ require_once(dirname(__FILE__).'/00_fpdf_codebar.class.php');
}
else
{
- $this->Cell($strsize+2,$this->FontSize+2,$str, 0, 1);
+ $this->Cell($strsize+2,$this->FontSize+2,$str, 0, 1);
}
}
}
}
}
-?>
\ No newline at end of file
diff --git a/main/inc/lib/html2pdf/_mypdf/02_fpdf_formulaire.class.php b/main/inc/lib/html2pdf/_mypdf/02_fpdf_formulaire.class.php
index 65a0b4a73a..d1b6e70d6f 100755
--- a/main/inc/lib/html2pdf/_mypdf/02_fpdf_formulaire.class.php
+++ b/main/inc/lib/html2pdf/_mypdf/02_fpdf_formulaire.class.php
@@ -1,9 +1,9 @@
*/
@@ -11,29 +11,29 @@
if (!defined('__CLASS_FPDF_FORMULAIRE__'))
{
define('__CLASS_FPDF_FORMULAIRE__', true);
-
+
require_once(dirname(__FILE__).'/01_fpdf_bookmark.class.php');
-
+
class FPDF_Formulaire extends FPDF_BookMark
{
var $javascript = ''; //javascript code
- var $n_js; //num�ro de l'objet javascript
- var $n_cata; //num�ro de l'objet catalogue
+ var $n_js; //numéro de l'objet javascript
+ var $n_cata; //numéro de l'objet catalogue
var $ur; //
-
+
function FPDF_Formulaire($orientation='P',$unit='mm',$format='A4')
{
$this->FPDF_BookMark($orientation,$unit,$format);
$this->PDFVersion='1.6';
-
+
$this->ur = false;
}
-
+
function _putuserrights()
{
if (!$this->ur) return;
$this->_out('/Perms<<');
-
+
$this->_out('/UR3<<');
$this->_out('/Reference[<<');
$this->_out('/Type /SigRef');
@@ -50,20 +50,20 @@ if (!defined('__CLASS_FPDF_FORMULAIRE__'))
$this->_out('>>');
$this->_out('>>');
}
-
+
function _putresources()
{
-
+
parent::_putresources();
$this->_putjavascript();
}
-
+
function _putcatalog()
{
$this->n_cata = $this->n;
-
+
parent::_putcatalog();
-
+
if (!empty($this->javascript)) $this->_out('/Names <n_js).' 0 R>>');
$this->_putuserrights();
}
@@ -71,12 +71,12 @@ if (!defined('__CLASS_FPDF_FORMULAIRE__'))
/*
* Create a javascript PDF string.
* @access protected
- * @author Johannes G�ntert, Nicola Asuni
+ * @author Johannes Güntert, Nicola Asuni
*/
function _putjavascript()
{
if (empty($this->javascript)) return;
-
+
// the following two lines are used to avoid form fields duplication after saving
if ($this->ur)
{
@@ -86,9 +86,9 @@ if (!defined('__CLASS_FPDF_FORMULAIRE__'))
else
{
$js1 = '';
- $js2 = '';
+ $js2 = '';
}
-
+
$this->_newobj();
$this->n_js = $this->n;
$this->_out('<<');
@@ -102,7 +102,7 @@ if (!defined('__CLASS_FPDF_FORMULAIRE__'))
$this->_out('>>');
$this->_out('endobj');
}
-
+
/*
* Convert color to javascript color.
* @param string $color color name or #RRGGBB
@@ -120,10 +120,10 @@ if (!defined('__CLASS_FPDF_FORMULAIRE__'))
{
$this->Error('Invalid color: '.$color);
}
-
+
return 'color.'.$color;
}
-
+
/*
* Adds a javascript form field.
* @param string $type field type
@@ -149,10 +149,10 @@ if (!defined('__CLASS_FPDF_FORMULAIRE__'))
$r = 0.1;
$this->Rect($x+$d*0.5+$r, $y-$d*0.5+$r, $w-$d-2*$r, $h-$d-2*$r, 'F');
}
-
- // javascript inclus
+
+ // javascript inclus
$this->ur = true;
-
+
// the followind avoid fields duplication after saving the document
$this->javascript .= "if(this.getField('pdfoldsaved') && this.getField('pdfoldsaved').value != 'saved') {";
$this->javascript .= sprintf("f".$name."=this.addField('%s','%s',%d,[%.2F,%.2F,%.2F,%.2F]);", $name, $type, $this->PageNo()-1, $x*$this->k, ($this->h-$y)*$this->k+1, ($x+$w)*$this->k, ($this->h-$y-$h)*$this->k+1)."\n";
@@ -165,23 +165,23 @@ if (!defined('__CLASS_FPDF_FORMULAIRE__'))
$val = '"'.$val.'"';
$this->javascript .= 'f'.$name.'.'.$key.'='.$val.";\n";
}
-
+
$this->javascript .= '}';
$this->javascript.= "\n".$js_after;
}
-
+
function IncludeJS($script)
{
$this->javascript .= $script;
}
-
+
function form_InputHidden($name, $value)
{
$prop = array('value' => $value);
$js_after = '';
$this->_addfield('checkbox', $name, 0, 0, 0.1, 0.1, $prop, $js_after);
}
-
+
function form_InputCheckBox($name, $x, $y, $w, $checked)
{
$prop = array();
@@ -189,20 +189,20 @@ if (!defined('__CLASS_FPDF_FORMULAIRE__'))
$js_after = '';
$this->_addfield('checkbox', $name, $x, $y, $w, $w, $prop, $js_after);
}
-
+
function form_InputRadio($name, $x, $y, $w)
{
$prop = array();
$js_after = '';
$this->_addfield('radiobutton', $name, $x, $y, $w, $w, $prop, $js_after);
}
-
+
function form_InputText($name, $x, $y, $w, $h, $prop)
{
$js_after = '';
$this->_addfield('text', $name, $x, $y, $w, $h, $prop, $js_after);
}
-
+
function form_InputButton($name, $x, $y, $w, $h, $caption, $action, $prop)
{
if (!isset($prop['borderStyle'])) $prop['borderStyle'] = 'beveled';
@@ -218,11 +218,10 @@ if (!defined('__CLASS_FPDF_FORMULAIRE__'))
function form_Select($name, $x, $y, $w, $h, $values, $multiligne, $prop)
{
- $type = ($multiligne ? 'listbox' : 'combobox');
+ $type = ($multiligne ? 'listbox' : 'combobox');
$s = ''; foreach ($values as $value) { $s .= ($s ? ',' : '')."'".addslashes($value)."'"; }
$js_after = 'f'.$name.'.setItems(['.$s."]);\n";
$this->_addfield($type, $name, $x, $y, $w, $h, $prop, $js_after);
}
}
}
-?>
\ No newline at end of file
diff --git a/main/inc/lib/html2pdf/_mypdf/03_fpdf_alpha.class.php b/main/inc/lib/html2pdf/_mypdf/03_fpdf_alpha.class.php
new file mode 100644
index 0000000000..6af47e891a
--- /dev/null
+++ b/main/inc/lib/html2pdf/_mypdf/03_fpdf_alpha.class.php
@@ -0,0 +1,326 @@
+FPDF_Formulaire($orientation,$unit,$format);
+ }
+
+ /* Public methods */
+ function Image($file,$x,$y,$w=0,$h=0,$type='',$link='', $isMask=false, $maskImg=0)
+ {
+ //Put an image on the page
+ if(!isset($this->images[$file]))
+ {
+ //First use of image, get info
+ if($type=='')
+ {
+ /* MODIFICATION HTML2PDF pour le support des images PHP */
+ $type = explode('?', $file);
+ $type = pathinfo($type[0]);
+ if (!isset($type['extension']) || !$type['extension'])
+ $this->Error('Image file has no extension and no type was specified: '.$file);
+
+ $type = $type['extension'];
+ /* FIN MODIFICATION */
+/*
+ $pos=strrpos($file,'.');
+ if(!$pos)
+ $this->Error('Image file has no extension and no type was specified: '.$file);
+ $type=substr($file,$pos+1);
+*/
+ }
+ $type=strtolower($type);
+
+ /* MODIFICATION HTML2PDF pour le support des images PHP et CGI*/
+ if ($type=='php' || $type=='cgi')
+ {
+ // identification des infos
+ $infos=@GetImageSize($file);
+ if (!$infos) $this->Error('Unsupported image : '.$file);
+
+ // identification du type
+ $type = explode('/', $infos['mime']);
+ if ($type[0]!='image') $this->Error('Unsupported image : '.$file);
+ $type = $type[1];
+ }
+ /* FIN MODIFICATION */
+
+// $mqr=get_magic_quotes_runtime();
+// set_magic_quotes_runtime(0);
+ if($type=='jpg' || $type=='jpeg')
+ $info=$this->_parsejpg($file);
+ elseif($type=='png')
+ {
+ $info=$this->_parsepng($file);
+ if ($info=='alpha')
+ return $this->ImagePngWithAlpha($file,$x,$y,$w,$h,$link);
+ }
+ else
+ {
+ //Allow for additional formats
+ $mtd='_parse'.$type;
+ if(!method_exists($this,$mtd))
+ $this->Error('Unsupported image type: '.$type);
+ $info=$this->$mtd($file);
+ }
+// set_magic_quotes_runtime($mqr);
+
+ if ($isMask)
+ {
+ $info['cs']="DeviceGray"; // try to force grayscale (instead of indexed)
+ }
+ $info['i']=count($this->images)+1;
+ if ($maskImg>0) $info['masked'] = $maskImg;###
+ $this->images[$file]=$info;
+ }
+ else
+ $info=$this->images[$file];
+
+ //Automatic width and height calculation if needed
+ if($w==0 && $h==0)
+ {
+ //Put image at 72 dpi
+ $w=$info['w']/$this->k;
+ $h=$info['h']/$this->k;
+ }
+ if($w==0)
+ $w=$h*$info['w']/$info['h'];
+ if($h==0)
+ $h=$w*$info['h']/$info['w'];
+
+ if ($isMask) // embed hidden, ouside the canvas
+ {
+ $x = ($this->CurOrientation=='P'?$this->CurPageFormat[0]*2:$this->CurPageFormat[1]*2) + 10;
+ }
+ else // modification by spipu :) pas besoin de tracer l'image si c'est pour faire un mask !!!!
+ {
+ $this->_out(sprintf('q %.2f 0 0 %.2f %.2f %.2f cm /I%d Do Q',$w*$this->k,$h*$this->k,$x*$this->k,($this->h-($y+$h))*$this->k,$info['i']));
+ if($link) $this->Link($x,$y,$w,$h,$link);
+ }
+
+ return $info['i'];
+ }
+
+ // needs GD 2.x extension
+ // pixel-wise operation, not very fast
+ function ImagePngWithAlpha($file,$x,$y,$w=0,$h=0,$link='')
+ {
+ $tmp_alpha = tempnam('.', 'mska');
+ $this->tmpFiles[] = $tmp_alpha;
+ $tmp_plain = tempnam('.', 'mskp');
+ $this->tmpFiles[] = $tmp_plain;
+
+ list($wpx, $hpx) = @getimagesize($file);
+ $img = imagecreatefrompng($file);
+ $alpha_img = imagecreate( $wpx, $hpx );
+
+ // generate gray scale pallete
+ for($c=0;$c<256;$c++) ImageColorAllocate($alpha_img, $c, $c, $c);
+
+ // extract alpha channel
+ $xpx=0;
+ while ($xpx<$wpx)
+ {
+ $ypx = 0;
+ while ($ypx<$hpx)
+ {
+ $color_index = imagecolorat($img, $xpx, $ypx);
+ $col = imagecolorsforindex($img, $color_index);
+ imagesetpixel($alpha_img, $xpx, $ypx, $this->_gamma( (127-$col['alpha'])*255/127) );
+ ++$ypx;
+ }
+ ++$xpx;
+ }
+
+ imagepng($alpha_img, $tmp_alpha);
+ imagedestroy($alpha_img);
+
+ // extract image without alpha channel
+ $plain_img = imagecreatetruecolor ( $wpx, $hpx );
+ imagecopy ($plain_img, $img, 0, 0, 0, 0, $wpx, $hpx );
+ imagepng($plain_img, $tmp_plain);
+ imagedestroy($plain_img);
+
+ //first embed mask image (w, h, x, will be ignored)
+ $maskImg = $this->Image($tmp_alpha, 0,0,0,0, 'PNG', '', true);
+
+ //embed image, masked with previously embedded mask
+ $this->Image($tmp_plain,$x,$y,$w,$h,'PNG',$link, false, $maskImg);
+ }
+
+ function Close()
+ {
+ parent::Close();
+ // clean up tmp files
+ foreach($this->tmpFiles as $tmp) @unlink($tmp);
+ }
+
+ /* Private methods */
+ function _putimages()
+ {
+ $filter=($this->compress) ? '/Filter /FlateDecode ' : '';
+ reset($this->images);
+ while(list($file,$info)=each($this->images))
+ {
+ $this->_newobj();
+ $this->images[$file]['n']=$this->n;
+ $this->_out('<_out('/Subtype /Image');
+ $this->_out('/Width '.$info['w']);
+ $this->_out('/Height '.$info['h']);
+
+ if (isset($info["masked"])) $this->_out('/SMask '.($this->n-1).' 0 R'); ###
+
+ if($info['cs']=='Indexed')
+ $this->_out('/ColorSpace [/Indexed /DeviceRGB '.(strlen($info['pal'])/3-1).' '.($this->n+1).' 0 R]');
+ else
+ {
+ $this->_out('/ColorSpace /'.$info['cs']);
+ if($info['cs']=='DeviceCMYK')
+ $this->_out('/Decode [1 0 1 0 1 0 1 0]');
+ }
+ $this->_out('/BitsPerComponent '.$info['bpc']);
+ if(isset($info['f']))
+ $this->_out('/Filter /'.$info['f']);
+ if(isset($info['parms']))
+ $this->_out($info['parms']);
+ if(isset($info['trns']) && is_array($info['trns']))
+ {
+ $trns='';
+ for($i=0;$i_out('/Mask ['.$trns.']');
+ }
+ $this->_out('/Length '.strlen($info['data']).'>>');
+ $this->_putstream($info['data']);
+ unset($this->images[$file]['data']);
+ $this->_out('endobj');
+ //Palette
+ if($info['cs']=='Indexed')
+ {
+ $this->_newobj();
+ $pal=($this->compress) ? gzcompress($info['pal']) : $info['pal'];
+ $this->_out('<<'.$filter.'/Length '.strlen($pal).'>>');
+ $this->_putstream($pal);
+ $this->_out('endobj');
+ }
+ }
+ }
+
+ // GD seems to use a different gamma, this method is used to correct it again
+ function _gamma($v)
+ {
+ return pow ($v/255, 2.2) * 255;
+ }
+
+ // this method overwriing the original version is only needed to make the Image method support PNGs with alpha channels.
+ // if you only use the ImagePngWithAlpha method for such PNGs, you can remove it from this script.
+ function _parsepng($file)
+ {
+ //Extract info from a PNG file
+ $f=fopen($file,'rb');
+ if(!$f)
+ $this->Error('Can\'t open image file: '.$file);
+ //Check signature
+ if(fread($f,8)!=chr(137).'PNG'.chr(13).chr(10).chr(26).chr(10))
+ $this->Error('Not a PNG file: '.$file);
+ //Read header chunk
+ fread($f,4);
+ if(fread($f,4)!='IHDR')
+ $this->Error('Incorrect PNG file: '.$file);
+ $w=$this->_readint($f);
+ $h=$this->_readint($f);
+ $bpc=ord(fread($f,1));
+ if($bpc>8)
+ $this->Error('16-bit depth not supported: '.$file);
+ $ct=ord(fread($f,1));
+ if($ct==0)
+ $colspace='DeviceGray';
+ elseif($ct==2)
+ $colspace='DeviceRGB';
+ elseif($ct==3)
+ $colspace='Indexed';
+ else
+ {
+ fclose($f); // the only changes are
+ return 'alpha'; // made in those 2 lines
+ }
+ if(ord(fread($f,1))!=0)
+ $this->Error('Unknown compression method: '.$file);
+ if(ord(fread($f,1))!=0)
+ $this->Error('Unknown filter method: '.$file);
+ if(ord(fread($f,1))!=0)
+ $this->Error('Interlacing not supported: '.$file);
+ fread($f,4);
+ $parms='/DecodeParms <>';
+ //Scan chunks looking for palette, transparency and image data
+ $pal='';
+ $trns='';
+ $data='';
+ do
+ {
+ $n=$this->_readint($f);
+ $type=fread($f,4);
+ if($type=='PLTE')
+ {
+ //Read palette
+ $pal=fread($f,$n);
+ fread($f,4);
+ }
+ elseif($type=='tRNS')
+ {
+ //Read transparency info
+ $t=fread($f,$n);
+ if($ct==0)
+ $trns=array(ord(substr($t,1,1)));
+ elseif($ct==2)
+ $trns=array(ord(substr($t,1,1)),ord(substr($t,3,1)),ord(substr($t,5,1)));
+ else
+ {
+ $pos=strpos($t,chr(0));
+ if($pos!==false)
+ $trns=array($pos);
+ }
+ fread($f,4);
+ }
+ elseif($type=='IDAT')
+ {
+ //Read image data block
+ $data.=fread($f,$n);
+ fread($f,4);
+ }
+ elseif($type=='IEND')
+ break;
+ else
+ fread($f,$n+4);
+ }
+ while($n);
+ if($colspace=='Indexed' && empty($pal))
+ $this->Error('Missing palette in '.$file);
+ fclose($f);
+ return array('w'=>$w,'h'=>$h,'cs'=>$colspace,'bpc'=>$bpc,'f'=>'FlateDecode','parms'=>$parms,'pal'=>$pal,'trns'=>$trns,'data'=>$data);
+ }
+
+ }
+}
diff --git a/main/inc/lib/html2pdf/_mypdf/99_fpdf_protection.class.php b/main/inc/lib/html2pdf/_mypdf/99_fpdf_protection.class.php
index 779cb99cf7..ab091efb54 100755
--- a/main/inc/lib/html2pdf/_mypdf/99_fpdf_protection.class.php
+++ b/main/inc/lib/html2pdf/_mypdf/99_fpdf_protection.class.php
@@ -1,229 +1,228 @@
-FPDF_Formulaire($orientation,$unit,$format);
-
- $this->encrypted=false;
- $this->last_rc4_key='';
- $this->padding="\x28\xBF\x4E\x5E\x4E\x75\x8A\x41\x64\x00\x4E\x56\xFF\xFA\x01\x08".
- "\x2E\x2E\x00\xB6\xD0\x68\x3E\x80\x2F\x0C\xA9\xFE\x64\x53\x69\x7A";
- }
-
- /**
- * Function to set permissions as well as user and owner passwords
- *
- * - permissions is an array with values taken from the following list:
- * copy, print, modify, annot-forms
- * If a value is present it means that the permission is granted
- * - If a user password is set, user will be prompted before document is opened
- * - If an owner password is set, document can be opened in privilege mode with no
- * restriction if that password is entered
- */
- function SetProtection($permissions=array(),$user_pass='',$owner_pass=null)
- {
- $options = array('print' => 4, 'modify' => 8, 'copy' => 16, 'annot-forms' => 32 );
- $protection = 192;
- foreach($permissions as $permission){
- if (!isset($options[$permission]))
- $this->Error('Incorrect permission: '.$permission);
- $protection += $options[$permission];
- }
- if ($owner_pass === null)
- $owner_pass = uniqid(rand());
- $this->encrypted = true;
- $this->_generateencryptionkey($user_pass, $owner_pass, $protection);
- }
-
-/****************************************************************************
-* *
-* Private methods *
-* *
-****************************************************************************/
-
- function _putstream($s)
- {
- if ($this->encrypted) {
- $s = $this->_RC4($this->_objectkey($this->n), $s);
- }
- parent::_putstream($s);
- }
-
- function _textstring($s)
- {
- if ($this->encrypted) {
- $s = $this->_RC4($this->_objectkey($this->n), $s);
- }
- return parent::_textstring($s);
- }
-
- /**
- * Compute key depending on object number where the encrypted data is stored
- */
- function _objectkey($n)
- {
- return substr($this->_md5_16($this->encryption_key.pack('VXxx',$n)),0,10);
- }
-
- function _putresources()
- {
- parent::_putresources();
- if ($this->encrypted) {
- $this->_newobj();
- $this->enc_obj_id = $this->n;
- $this->_out('<<');
- $this->_putencryption();
- $this->_out('>>');
- $this->_out('endobj');
- }
- }
-
- function _putencryption()
- {
- $this->_out('/Filter /Standard');
- $this->_out('/V 1');
- $this->_out('/R 2');
- $this->_out('/O ('.$this->_escape($this->Ovalue).')');
- $this->_out('/U ('.$this->_escape($this->Uvalue).')');
- $this->_out('/P '.$this->Pvalue);
- }
-
- function _puttrailer()
- {
- parent::_puttrailer();
- if ($this->encrypted) {
- $this->_out('/Encrypt '.$this->enc_obj_id.' 0 R');
- $this->_out('/ID [()()]');
- }
- }
-
- /**
- * RC4 is the standard encryption algorithm used in PDF format
- */
- function _RC4($key, $text)
- {
- if ($this->last_rc4_key != $key) {
- $k = str_repeat($key, 256/strlen($key)+1);
- $rc4 = range(0,255);
- $j = 0;
- for ($i=0; $i<256; $i++){
- $t = $rc4[$i];
- $j = ($j + $t + ord($k{$i})) % 256;
- $rc4[$i] = $rc4[$j];
- $rc4[$j] = $t;
- }
- $this->last_rc4_key = $key;
- $this->last_rc4_key_c = $rc4;
- } else {
- $rc4 = $this->last_rc4_key_c;
- }
-
- $len = strlen($text);
- $a = 0;
- $b = 0;
- $out = '';
- for ($i=0; $i<$len; $i++){
- $a = ($a+1)%256;
- $t= $rc4[$a];
- $b = ($b+$t)%256;
- $rc4[$a] = $rc4[$b];
- $rc4[$b] = $t;
- $k = $rc4[($rc4[$a]+$rc4[$b])%256];
- $out.=chr(ord($text{$i}) ^ $k);
- }
-
- return $out;
- }
-
- /**
- * Get MD5 as binary string
- */
- function _md5_16($string)
- {
- return pack('H*',md5($string));
- }
-
- /**
- * Compute O value
- */
- function _Ovalue($user_pass, $owner_pass)
- {
- $tmp = $this->_md5_16($owner_pass);
- $owner_RC4_key = substr($tmp,0,5);
- return $this->_RC4($owner_RC4_key, $user_pass);
- }
-
- /**
- * Compute U value
- */
- function _Uvalue()
- {
- return $this->_RC4($this->encryption_key, $this->padding);
- }
-
- /**
- * Compute encryption key
- */
- function _generateencryptionkey($user_pass, $owner_pass, $protection)
- {
- // Pad passwords
- $user_pass = substr($user_pass.$this->padding,0,32);
- $owner_pass = substr($owner_pass.$this->padding,0,32);
- // Compute O value
- $this->Ovalue = $this->_Ovalue($user_pass,$owner_pass);
- // Compute encyption key
- $tmp = $this->_md5_16($user_pass.$this->Ovalue.chr($protection)."\xFF\xFF\xFF");
- $this->encryption_key = substr($tmp,0,5);
- // Compute U value
- $this->Uvalue = $this->_Uvalue();
- // Compute P value
- $this->Pvalue = -(($protection^255)+1);
- }
- }
-}
-?>
\ No newline at end of file
+FPDF_Formulaire($orientation,$unit,$format);
+
+ $this->encrypted=false;
+ $this->last_rc4_key='';
+ $this->padding="\x28\xBF\x4E\x5E\x4E\x75\x8A\x41\x64\x00\x4E\x56\xFF\xFA\x01\x08".
+ "\x2E\x2E\x00\xB6\xD0\x68\x3E\x80\x2F\x0C\xA9\xFE\x64\x53\x69\x7A";
+ }
+
+ /**
+ * Function to set permissions as well as user and owner passwords
+ *
+ * - permissions is an array with values taken from the following list:
+ * copy, print, modify, annot-forms
+ * If a value is present it means that the permission is granted
+ * - If a user password is set, user will be prompted before document is opened
+ * - If an owner password is set, document can be opened in privilege mode with no
+ * restriction if that password is entered
+ */
+ function SetProtection($permissions=array(),$user_pass='',$owner_pass=null)
+ {
+ $options = array('print' => 4, 'modify' => 8, 'copy' => 16, 'annot-forms' => 32 );
+ $protection = 192;
+ foreach($permissions as $permission){
+ if (!isset($options[$permission]))
+ $this->Error('Incorrect permission: '.$permission);
+ $protection += $options[$permission];
+ }
+ if ($owner_pass === null)
+ $owner_pass = uniqid(rand());
+ $this->encrypted = true;
+ $this->_generateencryptionkey($user_pass, $owner_pass, $protection);
+ }
+
+/****************************************************************************
+* *
+* Private methods *
+* *
+****************************************************************************/
+
+ function _putstream($s)
+ {
+ if ($this->encrypted) {
+ $s = $this->_RC4($this->_objectkey($this->n), $s);
+ }
+ parent::_putstream($s);
+ }
+
+ function _textstring($s)
+ {
+ if ($this->encrypted) {
+ $s = $this->_RC4($this->_objectkey($this->n), $s);
+ }
+ return parent::_textstring($s);
+ }
+
+ /**
+ * Compute key depending on object number where the encrypted data is stored
+ */
+ function _objectkey($n)
+ {
+ return substr($this->_md5_16($this->encryption_key.pack('VXxx',$n)),0,10);
+ }
+
+ function _putresources()
+ {
+ parent::_putresources();
+ if ($this->encrypted) {
+ $this->_newobj();
+ $this->enc_obj_id = $this->n;
+ $this->_out('<<');
+ $this->_putencryption();
+ $this->_out('>>');
+ $this->_out('endobj');
+ }
+ }
+
+ function _putencryption()
+ {
+ $this->_out('/Filter /Standard');
+ $this->_out('/V 1');
+ $this->_out('/R 2');
+ $this->_out('/O ('.$this->_escape($this->Ovalue).')');
+ $this->_out('/U ('.$this->_escape($this->Uvalue).')');
+ $this->_out('/P '.$this->Pvalue);
+ }
+
+ function _puttrailer()
+ {
+ parent::_puttrailer();
+ if ($this->encrypted) {
+ $this->_out('/Encrypt '.$this->enc_obj_id.' 0 R');
+ $this->_out('/ID [()()]');
+ }
+ }
+
+ /**
+ * RC4 is the standard encryption algorithm used in PDF format
+ */
+ function _RC4($key, $text)
+ {
+ if ($this->last_rc4_key != $key) {
+ $k = str_repeat($key, 256/strlen($key)+1);
+ $rc4 = range(0,255);
+ $j = 0;
+ for ($i=0; $i<256; $i++){
+ $t = $rc4[$i];
+ $j = ($j + $t + ord($k{$i})) % 256;
+ $rc4[$i] = $rc4[$j];
+ $rc4[$j] = $t;
+ }
+ $this->last_rc4_key = $key;
+ $this->last_rc4_key_c = $rc4;
+ } else {
+ $rc4 = $this->last_rc4_key_c;
+ }
+
+ $len = strlen($text);
+ $a = 0;
+ $b = 0;
+ $out = '';
+ for ($i=0; $i<$len; $i++){
+ $a = ($a+1)%256;
+ $t= $rc4[$a];
+ $b = ($b+$t)%256;
+ $rc4[$a] = $rc4[$b];
+ $rc4[$b] = $t;
+ $k = $rc4[($rc4[$a]+$rc4[$b])%256];
+ $out.=chr(ord($text{$i}) ^ $k);
+ }
+
+ return $out;
+ }
+
+ /**
+ * Get MD5 as binary string
+ */
+ function _md5_16($string)
+ {
+ return pack('H*',md5($string));
+ }
+
+ /**
+ * Compute O value
+ */
+ function _Ovalue($user_pass, $owner_pass)
+ {
+ $tmp = $this->_md5_16($owner_pass);
+ $owner_RC4_key = substr($tmp,0,5);
+ return $this->_RC4($owner_RC4_key, $user_pass);
+ }
+
+ /**
+ * Compute U value
+ */
+ function _Uvalue()
+ {
+ return $this->_RC4($this->encryption_key, $this->padding);
+ }
+
+ /**
+ * Compute encryption key
+ */
+ function _generateencryptionkey($user_pass, $owner_pass, $protection)
+ {
+ // Pad passwords
+ $user_pass = substr($user_pass.$this->padding,0,32);
+ $owner_pass = substr($owner_pass.$this->padding,0,32);
+ // Compute O value
+ $this->Ovalue = $this->_Ovalue($user_pass,$owner_pass);
+ // Compute encyption key
+ $tmp = $this->_md5_16($user_pass.$this->Ovalue.chr($protection)."\xFF\xFF\xFF");
+ $this->encryption_key = substr($tmp,0,5);
+ // Compute U value
+ $this->Uvalue = $this->_Uvalue();
+ // Compute P value
+ $this->Pvalue = -(($protection^255)+1);
+ }
+ }
+}
diff --git a/main/inc/lib/html2pdf/_mypdf/mypdf.class.php b/main/inc/lib/html2pdf/_mypdf/mypdf.class.php
index d1b02f3d1b..bbd3a0893c 100755
--- a/main/inc/lib/html2pdf/_mypdf/mypdf.class.php
+++ b/main/inc/lib/html2pdf/_mypdf/mypdf.class.php
@@ -1,485 +1,502 @@
- PDF, utilise fpdf de Olivier PLATHEY
- * Distribu� sous la licence LGPL.
- *
- * @author Laurent MINGUET
- * @version 3.24 - 05/08/2009
- */
-
-if (!defined('__CLASS_MYPDF__'))
-{
- define('__CLASS_MYPDF__', true);
-
- require_once(dirname(__FILE__).'/99_fpdf_protection.class.php'); // classe fpdf_protection
-
- class MyPDF extends FPDF_Protection
- {
- var $footer_param = array();
-
- var $underline = false;
- var $overline = false;
- var $linethrough = false;
-
- function MyPDF($sens = 'P', $unit = 'mm', $format = 'A4')
- {
- $this->underline = false;
- $this->overline = false;
- $this->linethrough = false;
-
- $this->FPDF_Protection($sens, $unit, $format);
- $this->AliasNbPages();
- $this->SetMyFooter();
- }
-
- function SetMyFooter($page = null, $date = null, $heure = null, $form = null)
- {
- if ($page===null) $page = null;
- if ($date===null) $date = null;
- if ($heure===null) $heure = null;
- if ($form===null) $form = null;
-
- $this->footer_param = array('page' => $page, 'date' => $date, 'heure' => $heure, 'form' => $form);
- }
-
- function Footer()
- {
- $txt = '';
- if ($this->footer_param['form']) $txt = (@HTML2PDF::textGET('pdf05'));
- if ($this->footer_param['date'] && $this->footer_param['heure']) $txt.= ($txt ? ' - ' : '').(@HTML2PDF::textGET('pdf03'));
- if ($this->footer_param['date'] && !$this->footer_param['heure']) $txt.= ($txt ? ' - ' : '').(@HTML2PDF::textGET('pdf01'));
- if (!$this->footer_param['date'] && $this->footer_param['heure']) $txt.= ($txt ? ' - ' : '').(@HTML2PDF::textGET('pdf02'));
- if ($this->footer_param['page']) $txt.= ($txt ? ' - ' : '').(@HTML2PDF::textGET('pdf04'));
-
- $txt = str_replace('[[date_d]]', date('d'), $txt);
- $txt = str_replace('[[date_m]]', date('m'), $txt);
- $txt = str_replace('[[date_y]]', date('Y'), $txt);
- $txt = str_replace('[[date_h]]', date('H'), $txt);
- $txt = str_replace('[[date_i]]', date('i'), $txt);
- $txt = str_replace('[[date_s]]', date('s'), $txt);
- $txt = str_replace('[[current]]', $this->PageNo(), $txt);
- $txt = str_replace('[[nb]]', '{nb}', $txt);
-
- if (strlen($txt)>0)
- {
- $this->SetY(-11);
- $this->setOverline(false);
- $this->setLinethrough(false);
- $this->SetFont('Arial','I',8);
- $this->Cell(0, 10, $txt, 0, 0, 'R');
- }
- }
-
- // red�finition de la fonction Image de FPDF afin de rajouter la gestion des fichiers PHP
- function Image($file, $x=null, $y=null, $w=0, $h=0, $type='', $link='')
- {
- //Put an image on the page
- if(!isset($this->images[$file]))
- {
- //First use of this image, get info
- if($type=='')
- {
- /* MODIFICATION HTML2PDF pour le support des images PHP */
- $type = explode('?', $file);
- $type = pathinfo($type[0]);
- if (!isset($type['extension']) || !$type['extension'])
- $this->Error('Image file has no extension and no type was specified: '.$file);
-
- $type = $type['extension'];
- /* FIN MODIFICATION */
- }
-
- $type=strtolower($type);
-
- /* MODIFICATION HTML2PDF pour le support des images PHP */
- if ($type=='php')
- {
- // identification des infos
- $infos=@GetImageSize($file);
- if (!$infos) $this->Error('Unsupported image : '.$file);
-
- // identification du type
- $type = explode('/', $infos['mime']);
- if ($type[0]!='image') $this->Error('Unsupported image : '.$file);
- $type = $type[1];
- }
- /* FIN MODIFICATION */
-
- if($type=='jpeg')
- $type='jpg';
- $mtd='_parse'.$type;
- if(!method_exists($this,$mtd))
- $this->Error('Unsupported image type: '.$type);
- $info=$this->$mtd($file);
- $info['i']=count($this->images)+1;
- $this->images[$file]=$info;
- }
- else
- $info=$this->images[$file];
- //Automatic width and height calculation if needed
- if($w==0 && $h==0)
- {
- //Put image at 72 dpi
- $w=$info['w']/$this->k;
- $h=$info['h']/$this->k;
- }
- elseif($w==0)
- $w=$h*$info['w']/$info['h'];
- elseif($h==0)
- $h=$w*$info['h']/$info['w'];
- //Flowing mode
- if($y===null)
- {
- if($this->y+$h>$this->PageBreakTrigger && !$this->InHeader && !$this->InFooter && $this->AcceptPageBreak())
- {
- //Automatic page break
- $x2=$this->x;
- $this->AddPage($this->CurOrientation,$this->CurPageFormat);
- $this->x=$x2;
- }
- $y=$this->y;
- $this->y+=$h;
- }
- if($x===null)
- $x=$this->x;
-
- $this->_out(sprintf('q %.2F 0 0 %.2F %.2F %.2F cm /I%d Do Q',$w*$this->k,$h*$this->k,$x*$this->k,($this->h-($y+$h))*$this->k,$info['i']));
- if($link)
- $this->Link($x,$y,$w,$h,$link);
- }
-
- // Draw a polygon
- // Auteur : Andrew Meier
- // Licence : Freeware
- function Polygon($points, $style='D')
- {
- if($style=='F') $op='f';
- elseif($style=='FD' or $style=='DF') $op='b';
- else $op='s';
-
- $h = $this->h;
- $k = $this->k;
-
- $points_string = '';
- for($i=0; $i_out($points_string . $op);
- }
-
- function setOverline($value = true)
- {
- $this->overline = $value;
- }
-
- function setLinethrough($value = true)
- {
- $this->linethrough = $value;
- }
-
- // red�finition de la methode Text de FPDF afin de rajouter la gestion des overline et linethrough
- function Text($x, $y, $txt)
- {
- //Output a string
- $s=sprintf('BT %.2F %.2F Td (%s) Tj ET',$x*$this->k,($this->h-$y)*$this->k,$this->_escape($txt));
-
- /* MODIFICATION HTML2PDF pour le support de underline, overline, linethrough */
- if ($txt!='')
- {
- if($this->underline) $s.=' '.$this->_dounderline($x,$y,$txt);
- if($this->overline) $s.=' '.$this->_dooverline($x,$y,$txt);
- if($this->linethrough) $s.=' '.$this->_dolinethrough($x,$y,$txt);
- }
- /* FIN MODIFICATION */
-
- if($this->ColorFlag)
- $s='q '.$this->TextColor.' '.$s.' Q';
- $this->_out($s);
- }
-
- // red�finition de la methode Cell de FPDF afin de rajouter la gestion des overline et linethrough
- function Cell($w, $h=0, $txt='', $border=0, $ln=0, $align='', $fill=false, $link='')
- {
- //Output a cell
- $k=$this->k;
- if($this->y+$h>$this->PageBreakTrigger && !$this->InHeader && !$this->InFooter && $this->AcceptPageBreak())
- {
- //Automatic page break
- $x=$this->x;
- $ws=$this->ws;
- if($ws>0)
- {
- $this->ws=0;
- $this->_out('0 Tw');
- }
- $this->AddPage($this->CurOrientation,$this->CurPageFormat);
- $this->x=$x;
- if($ws>0)
- {
- $this->ws=$ws;
- $this->_out(sprintf('%.3F Tw',$ws*$k));
- }
- }
- if($w==0)
- $w=$this->w-$this->rMargin-$this->x;
- $s='';
- if($fill || $border==1)
- {
- if($fill)
- $op=($border==1) ? 'B' : 'f';
- else
- $op='S';
- $s=sprintf('%.2F %.2F %.2F %.2F re %s ',$this->x*$k,($this->h-$this->y)*$k,$w*$k,-$h*$k,$op);
- }
- if(is_string($border))
- {
- $x=$this->x;
- $y=$this->y;
- if(strpos($border,'L')!==false)
- $s.=sprintf('%.2F %.2F m %.2F %.2F l S ',$x*$k,($this->h-$y)*$k,$x*$k,($this->h-($y+$h))*$k);
- if(strpos($border,'T')!==false)
- $s.=sprintf('%.2F %.2F m %.2F %.2F l S ',$x*$k,($this->h-$y)*$k,($x+$w)*$k,($this->h-$y)*$k);
- if(strpos($border,'R')!==false)
- $s.=sprintf('%.2F %.2F m %.2F %.2F l S ',($x+$w)*$k,($this->h-$y)*$k,($x+$w)*$k,($this->h-($y+$h))*$k);
- if(strpos($border,'B')!==false)
- $s.=sprintf('%.2F %.2F m %.2F %.2F l S ',$x*$k,($this->h-($y+$h))*$k,($x+$w)*$k,($this->h-($y+$h))*$k);
- }
- if($txt!=='')
- {
- if($align=='R')
- $dx=$w-$this->cMargin-$this->GetStringWidth($txt);
- elseif($align=='C')
- $dx=($w-$this->GetStringWidth($txt))/2;
- else
- $dx=$this->cMargin;
- if($this->ColorFlag)
- $s.='q '.$this->TextColor.' ';
- $txt2=str_replace(')','\\)',str_replace('(','\\(',str_replace('\\','\\\\',$txt)));
- $s.=sprintf('BT %.2F %.2F Td (%s) Tj ET',($this->x+$dx)*$k,($this->h-($this->y+.5*$h+.3*$this->FontSize))*$k,$txt2);
-
- /* MODIFICATION HTML2PDF pour le support de underline, overline, linethrough */
- if($this->underline) $s.=' '.$this->_dounderline($this->x+$dx,$this->y+.5*$h+.3*$this->FontSize,$txt);
- if($this->overline) $s.=' '.$this->_dooverline($this->x+$dx,$this->y+.5*$h+.3*$this->FontSize,$txt);
- if($this->linethrough) $s.=' '.$this->_dolinethrough($this->x+$dx,$this->y+.5*$h+.3*$this->FontSize,$txt);
- /* FIN MODIFICATION */
-
- if($this->ColorFlag)
- $s.=' Q';
- if($link)
- $this->Link($this->x+$dx,$this->y+.5*$h-.5*$this->FontSize,$this->GetStringWidth($txt),$this->FontSize,$link);
- }
- if($s)
- $this->_out($s);
- $this->lasth=$h;
- if($ln>0)
- {
- //Go to next line
- $this->y+=$h;
- if($ln==1)
- $this->x=$this->lMargin;
- }
- else
- $this->x+=$w;
- }
-
- function _dounderline($x, $y, $txt)
- {
- //Underline text
- $up=$this->CurrentFont['up'];
- $ut=$this->CurrentFont['ut'];
-
- $p_x = $x*$this->k;
- $p_y = ($this->h-($y-$up/1000*$this->FontSize))*$this->k;
- $p_w = ($this->GetStringWidth($txt)+$this->ws*substr_count($txt,' '))*$this->k;
- $p_h = -$ut/1000*$this->FontSizePt;
-
- return sprintf('%.2F %.2F %.2F %.2F re f',$p_x,$p_y,$p_w,$p_h);
- }
-
- function _dooverline($x, $y, $txt)
- {
- //Overline text
- $up=$this->CurrentFont['up'];
- $ut=$this->CurrentFont['ut'];
-
- $p_x = $x*$this->k;
- $p_y = ($this->h-($y-(1000+1.5*$up)/1000*$this->FontSize))*$this->k;
- $p_w = ($this->GetStringWidth($txt)+$this->ws*substr_count($txt,' '))*$this->k;
- $p_h = -$ut/1000*$this->FontSizePt;
-
- return sprintf('%.2F %.2F %.2F %.2F re f',$p_x,$p_y,$p_w,$p_h);
- }
-
- function _dolinethrough($x, $y, $txt)
- {
- //Linethrough text
- $up=$this->CurrentFont['up'];
- $ut=$this->CurrentFont['ut'];
-
- $p_x = $x*$this->k;
- $p_y = ($this->h-($y-(1000+2.5*$up)/2000*$this->FontSize))*$this->k;
- $p_w = ($this->GetStringWidth($txt)+$this->ws*substr_count($txt,' '))*$this->k;
- $p_h = -$ut/1000*$this->FontSizePt;
-
- return sprintf('%.2F %.2F %.2F %.2F re f',$p_x,$p_y,$p_w,$p_h);
- }
-
- function clippingPathOpen($x = null, $y = null, $w = null, $h = null, $coin_TL=null, $coin_TR=null, $coin_BL=null, $coin_BR=null)
- {
- $path = '';
- if ($x!==null && $y!==null && $w!==null && $h!==null)
- {
- $x1 = $x*$this->k;
- $y1 = ($this->h-$y)*$this->k;
-
- $x2 = ($x+$w)*$this->k;
- $y2 = ($this->h-$y)*$this->k;
-
- $x3 = ($x+$w)*$this->k;
- $y3 = ($this->h-$y-$h)*$this->k;
-
- $x4 = $x*$this->k;
- $y4 = ($this->h-$y-$h)*$this->k;
-
- if ($coin_TL || $coin_TR || $coin_BL || $coin_BR)
- {
- if ($coin_TL) { $coin_TL[0] = $coin_TL[0]*$this->k; $coin_TL[1] =-$coin_TL[1]*$this->k; }
- if ($coin_TR) { $coin_TR[0] = $coin_TR[0]*$this->k; $coin_TR[1] =-$coin_TR[1]*$this->k; }
- if ($coin_BL) { $coin_BL[0] = $coin_BL[0]*$this->k; $coin_BL[1] =-$coin_BL[1]*$this->k; }
- if ($coin_BR) { $coin_BR[0] = $coin_BR[0]*$this->k; $coin_BR[1] =-$coin_BR[1]*$this->k; }
-
- $MyArc = 4/3 * (sqrt(2) - 1);
-
- if ($coin_TL)
- $path.= sprintf('%.2F %.2F m ', $x1+$coin_TL[0], $y1);
- else
- $path.= sprintf('%.2F %.2F m ', $x1, $y1);
-
- if ($coin_TR)
- {
- $xt1 = ($x2-$coin_TR[0])+$coin_TR[0]*$MyArc;
- $yt1 = ($y2+$coin_TR[1])-$coin_TR[1];
- $xt2 = ($x2-$coin_TR[0])+$coin_TR[0];
- $yt2 = ($y2+$coin_TR[1])-$coin_TR[1]*$MyArc;
-
- $path.= sprintf('%.2F %.2F l ', $x2-$coin_TR[0], $y2);
- $path.= sprintf('%.2F %.2F %.2F %.2F %.2F %.2F c ', $xt1, $yt1, $xt2, $yt2, $x2, $y2+$coin_TR[1]);
- }
- else
- $path.= sprintf('%.2F %.2F l ', $x2, $y2);
-
- if ($coin_BR)
- {
- $xt1 = ($x3-$coin_BR[0])+$coin_BR[0];
- $yt1 = ($y3-$coin_BR[1])+$coin_BR[1]*$MyArc;
- $xt2 = ($x3-$coin_BR[0])+$coin_BR[0]*$MyArc;
- $yt2 = ($y3-$coin_BR[1])+$coin_BR[1];
-
- $path.= sprintf('%.2F %.2F l ', $x3, $y3-$coin_BR[1]);
- $path.= sprintf('%.2F %.2F %.2F %.2F %.2F %.2F c ', $xt1, $yt1, $xt2, $yt2, $x3-$coin_BR[0], $y3);
- }
- else
- $path.= sprintf('%.2F %.2F l ', $x3, $y3);
-
- if ($coin_BL)
- {
- $xt1 = ($x4+$coin_BL[0])-$coin_BL[0]*$MyArc;
- $yt1 = ($y4-$coin_BL[1])+$coin_BL[1];
- $xt2 = ($x4+$coin_BL[0])-$coin_BL[0];
- $yt2 = ($y4-$coin_BL[1])+$coin_BL[1]*$MyArc;
-
- $path.= sprintf('%.2F %.2F l ', $x4+$coin_BL[0], $y4);
- $path.= sprintf('%.2F %.2F %.2F %.2F %.2F %.2F c ', $xt1, $yt1, $xt2, $yt2, $x4, $y4-$coin_BL[1]);
- }
- else
- $path.= sprintf('%.2F %.2F l ', $x4, $y4);
-
- if ($coin_TL)
- {
- $xt1 = ($x1+$coin_TL[0])-$coin_TL[0];
- $yt1 = ($y1+$coin_TL[1])-$coin_TL[1]*$MyArc;
- $xt2 = ($x1+$coin_TL[0])-$coin_TL[0]*$MyArc;
- $yt2 = ($y1+$coin_TL[1])-$coin_TL[1];
-
- $path.= sprintf('%.2F %.2F l ', $x1, $y1+$coin_TL[1]);
- $path.= sprintf('%.2F %.2F %.2F %.2F %.2F %.2F c ', $xt1, $yt1, $xt2, $yt2, $x1+$coin_TL[0], $y1);
- }
- }
- else
- {
- $path.= sprintf('%.2F %.2F m ', $x1, $y1);
- $path.= sprintf('%.2F %.2F l ', $x2, $y2);
- $path.= sprintf('%.2F %.2F l ', $x3, $y3);
- $path.= sprintf('%.2F %.2F l ', $x4, $y4);
- }
-
- $path.= ' h W n';
- }
- $this->_out('q '.$path.' ');
- }
-
- function clippingPathClose()
- {
- $this->_out(' Q');
- }
-
- function drawCourbe($ext1_x, $ext1_y, $ext2_x, $ext2_y, $int1_x, $int1_y, $int2_x, $int2_y, $cen_x, $cen_y)
- {
- $MyArc = 4/3 * (sqrt(2) - 1);
-
- $ext1_x = $ext1_x*$this->k; $ext1_y = ($this->h-$ext1_y)*$this->k;
- $ext2_x = $ext2_x*$this->k; $ext2_y = ($this->h-$ext2_y)*$this->k;
- $int1_x = $int1_x*$this->k; $int1_y = ($this->h-$int1_y)*$this->k;
- $int2_x = $int2_x*$this->k; $int2_y = ($this->h-$int2_y)*$this->k;
- $cen_x = $cen_x*$this->k; $cen_y = ($this->h-$cen_y) *$this->k;
-
- $path = '';
-
- if ($ext1_x-$cen_x!=0)
- {
- $xt1 = $cen_x+($ext1_x-$cen_x);
- $yt1 = $cen_y+($ext2_y-$cen_y)*$MyArc;
- $xt2 = $cen_x+($ext1_x-$cen_x)*$MyArc;
- $yt2 = $cen_y+($ext2_y-$cen_y);
- }
- else
- {
- $xt1 = $cen_x+($ext2_x-$cen_x)*$MyArc;
- $yt1 = $cen_y+($ext1_y-$cen_y);
- $xt2 = $cen_x+($ext2_x-$cen_x);
- $yt2 = $cen_y+($ext1_y-$cen_y)*$MyArc;
-
- }
-
- $path.= sprintf('%.2F %.2F m ', $ext1_x, $ext1_y);
- $path.= sprintf('%.2F %.2F %.2F %.2F %.2F %.2F c ', $xt1, $yt1, $xt2, $yt2, $ext2_x, $ext2_y);
-
- if ($int1_x-$cen_x!=0)
- {
- $xt1 = $cen_x+($int1_x-$cen_x)*$MyArc;
- $yt1 = $cen_y+($int2_y-$cen_y);
- $xt2 = $cen_x+($int1_x-$cen_x);
- $yt2 = $cen_y+($int2_y-$cen_y)*$MyArc;
- }
- else
- {
- $xt1 = $cen_x+($int2_x-$cen_x);
- $yt1 = $cen_y+($int1_y-$cen_y)*$MyArc;
- $xt2 = $cen_x+($int2_x-$cen_x)*$MyArc;
- $yt2 = $cen_y+($int1_y-$cen_y);
-
- }
-
- $path.= sprintf('%.2F %.2F l ', $int2_x, $int2_y);
- $path.= sprintf('%.2F %.2F %.2F %.2F %.2F %.2F c ', $xt1, $yt1, $xt2, $yt2, $int1_x, $int1_y);
-
- $this->_out($path . 'f');
- }
- }
-}
-?>
\ No newline at end of file
+ PDF, utilise fpdf de Olivier PLATHEY
+ * Distribué sous la licence LGPL.
+ *
+ * @author Laurent MINGUET
+ * @version 3.26 - 16/11/2009
+ */
+
+if (!defined('__CLASS_MYPDF__'))
+{
+ define('__CLASS_MYPDF__', true);
+
+ require_once(dirname(__FILE__).'/99_fpdf_protection.class.php'); // classe fpdf_protection
+
+ class MyPDF extends FPDF_Protection
+ {
+ var $footer_param = array();
+
+ var $underline = false;
+ var $overline = false;
+ var $linethrough = false;
+
+ function MyPDF($sens = 'P', $unit = 'mm', $format = 'A4')
+ {
+ $this->underline = false;
+ $this->overline = false;
+ $this->linethrough = false;
+
+ $this->FPDF_Protection($sens, $unit, $format);
+ $this->AliasNbPages();
+ $this->SetMyFooter();
+ }
+
+ function SetMyFooter($page = null, $date = null, $heure = null, $form = null)
+ {
+ if ($page===null) $page = null;
+ if ($date===null) $date = null;
+ if ($heure===null) $heure = null;
+ if ($form===null) $form = null;
+
+ $this->footer_param = array('page' => $page, 'date' => $date, 'heure' => $heure, 'form' => $form);
+ }
+
+ function Footer()
+ {
+ $txt = '';
+ if ($this->footer_param['form']) $txt = (@HTML2PDF::textGET('pdf05'));
+ if ($this->footer_param['date'] && $this->footer_param['heure']) $txt.= ($txt ? ' - ' : '').(@HTML2PDF::textGET('pdf03'));
+ if ($this->footer_param['date'] && !$this->footer_param['heure']) $txt.= ($txt ? ' - ' : '').(@HTML2PDF::textGET('pdf01'));
+ if (!$this->footer_param['date'] && $this->footer_param['heure']) $txt.= ($txt ? ' - ' : '').(@HTML2PDF::textGET('pdf02'));
+ if ($this->footer_param['page']) $txt.= ($txt ? ' - ' : '').(@HTML2PDF::textGET('pdf04'));
+
+ $txt = str_replace('[[date_d]]', date('d'), $txt);
+ $txt = str_replace('[[date_m]]', date('m'), $txt);
+ $txt = str_replace('[[date_y]]', date('Y'), $txt);
+ $txt = str_replace('[[date_h]]', date('H'), $txt);
+ $txt = str_replace('[[date_i]]', date('i'), $txt);
+ $txt = str_replace('[[date_s]]', date('s'), $txt);
+ $txt = str_replace('[[current]]', $this->PageNo(), $txt);
+ $txt = str_replace('[[nb]]', '{nb}', $txt);
+
+ if (strlen($txt)>0)
+ {
+ $this->SetY(-11);
+ $this->setOverline(false);
+ $this->setLinethrough(false);
+ $this->SetFont('Arial','I',8);
+ $this->Cell(0, 10, $txt, 0, 0, 'R');
+ }
+ }
+
+ // Draw a polygon
+ // Auteur : Andrew Meier
+ // Licence : Freeware
+ function Polygon($points, $style='D')
+ {
+ if($style=='F') $op='f';
+ elseif($style=='FD' or $style=='DF') $op='b';
+ else $op='s';
+
+ $h = $this->h;
+ $k = $this->k;
+
+ $points_string = '';
+ for($i=0; $i_out($points_string . $op);
+ }
+
+ function setOverline($value = true)
+ {
+ $this->overline = $value;
+ }
+
+ function setLinethrough($value = true)
+ {
+ $this->linethrough = $value;
+ }
+
+ // redéfinition de la methode Text de FPDF afin de rajouter la gestion des overline et linethrough
+ function Text($x, $y, $txt)
+ {
+ //Output a string
+ $s=sprintf('BT %.2F %.2F Td (%s) Tj ET',$x*$this->k,($this->h-$y)*$this->k,$this->_escape($txt));
+
+ /* MODIFICATION HTML2PDF pour le support de underline, overline, linethrough */
+ if ($txt!='')
+ {
+ if($this->underline) $s.=' '.$this->_dounderline($x,$y,$txt);
+ if($this->overline) $s.=' '.$this->_dooverline($x,$y,$txt);
+ if($this->linethrough) $s.=' '.$this->_dolinethrough($x,$y,$txt);
+ }
+ /* FIN MODIFICATION */
+
+ if($this->ColorFlag)
+ $s='q '.$this->TextColor.' '.$s.' Q';
+ $this->_out($s);
+ }
+
+ // redéfinition de la methode Cell de FPDF afin de rajouter la gestion des overline et linethrough
+ function Cell($w, $h=0, $txt='', $border=0, $ln=0, $align='', $fill=false, $link='')
+ {
+ //Output a cell
+ $k=$this->k;
+ if($this->y+$h>$this->PageBreakTrigger && !$this->InHeader && !$this->InFooter && $this->AcceptPageBreak())
+ {
+ //Automatic page break
+ $x=$this->x;
+ $ws=$this->ws;
+ if($ws>0)
+ {
+ $this->ws=0;
+ $this->_out('0 Tw');
+ }
+ $this->AddPage($this->CurOrientation,$this->CurPageFormat);
+ $this->x=$x;
+ if($ws>0)
+ {
+ $this->ws=$ws;
+ $this->_out(sprintf('%.3F Tw',$ws*$k));
+ }
+ }
+ if($w==0)
+ $w=$this->w-$this->rMargin-$this->x;
+ $s='';
+ if($fill || $border==1)
+ {
+ if($fill)
+ $op=($border==1) ? 'B' : 'f';
+ else
+ $op='S';
+ $s=sprintf('%.2F %.2F %.2F %.2F re %s ',$this->x*$k,($this->h-$this->y)*$k,$w*$k,-$h*$k,$op);
+ }
+ if(is_string($border))
+ {
+ $x=$this->x;
+ $y=$this->y;
+ if(strpos($border,'L')!==false)
+ $s.=sprintf('%.2F %.2F m %.2F %.2F l S ',$x*$k,($this->h-$y)*$k,$x*$k,($this->h-($y+$h))*$k);
+ if(strpos($border,'T')!==false)
+ $s.=sprintf('%.2F %.2F m %.2F %.2F l S ',$x*$k,($this->h-$y)*$k,($x+$w)*$k,($this->h-$y)*$k);
+ if(strpos($border,'R')!==false)
+ $s.=sprintf('%.2F %.2F m %.2F %.2F l S ',($x+$w)*$k,($this->h-$y)*$k,($x+$w)*$k,($this->h-($y+$h))*$k);
+ if(strpos($border,'B')!==false)
+ $s.=sprintf('%.2F %.2F m %.2F %.2F l S ',$x*$k,($this->h-($y+$h))*$k,($x+$w)*$k,($this->h-($y+$h))*$k);
+ }
+ if($txt!=='')
+ {
+ if($align=='R')
+ $dx=$w-$this->cMargin-$this->GetStringWidth($txt);
+ elseif($align=='C')
+ $dx=($w-$this->GetStringWidth($txt))/2;
+ else
+ $dx=$this->cMargin;
+ if($this->ColorFlag)
+ $s.='q '.$this->TextColor.' ';
+ $txt2=str_replace(')','\\)',str_replace('(','\\(',str_replace('\\','\\\\',$txt)));
+ $s.=sprintf('BT %.2F %.2F Td (%s) Tj ET',($this->x+$dx)*$k,($this->h-($this->y+.5*$h+.3*$this->FontSize))*$k,$txt2);
+
+ /* MODIFICATION HTML2PDF pour le support de underline, overline, linethrough */
+ if($this->underline) $s.=' '.$this->_dounderline($this->x+$dx,$this->y+.5*$h+.3*$this->FontSize,$txt);
+ if($this->overline) $s.=' '.$this->_dooverline($this->x+$dx,$this->y+.5*$h+.3*$this->FontSize,$txt);
+ if($this->linethrough) $s.=' '.$this->_dolinethrough($this->x+$dx,$this->y+.5*$h+.3*$this->FontSize,$txt);
+ /* FIN MODIFICATION */
+
+ if($this->ColorFlag)
+ $s.=' Q';
+ if($link)
+ $this->Link($this->x+$dx,$this->y+.5*$h-.5*$this->FontSize,$this->GetStringWidth($txt),$this->FontSize,$link);
+ }
+ if($s)
+ $this->_out($s);
+ $this->lasth=$h;
+ if($ln>0)
+ {
+ //Go to next line
+ $this->y+=$h;
+ if($ln==1)
+ $this->x=$this->lMargin;
+ }
+ else
+ $this->x+=$w;
+ }
+
+ function _dounderline($x, $y, $txt)
+ {
+ //Underline text
+ $up=$this->CurrentFont['up'];
+ $ut=$this->CurrentFont['ut'];
+
+ $p_x = $x*$this->k;
+ $p_y = ($this->h-($y-$up/1000*$this->FontSize))*$this->k;
+ $p_w = ($this->GetStringWidth($txt)+$this->ws*substr_count($txt,' '))*$this->k;
+ $p_h = -$ut/1000*$this->FontSizePt;
+
+ return sprintf('%.2F %.2F %.2F %.2F re f',$p_x,$p_y,$p_w,$p_h);
+ }
+
+ function _dooverline($x, $y, $txt)
+ {
+ //Overline text
+ $up=$this->CurrentFont['up'];
+ $ut=$this->CurrentFont['ut'];
+
+ $p_x = $x*$this->k;
+ $p_y = ($this->h-($y-(1000+1.5*$up)/1000*$this->FontSize))*$this->k;
+ $p_w = ($this->GetStringWidth($txt)+$this->ws*substr_count($txt,' '))*$this->k;
+ $p_h = -$ut/1000*$this->FontSizePt;
+
+ return sprintf('%.2F %.2F %.2F %.2F re f',$p_x,$p_y,$p_w,$p_h);
+ }
+
+ function _dolinethrough($x, $y, $txt)
+ {
+ //Linethrough text
+ $up=$this->CurrentFont['up'];
+ $ut=$this->CurrentFont['ut'];
+
+ $p_x = $x*$this->k;
+ $p_y = ($this->h-($y-(1000+2.5*$up)/2000*$this->FontSize))*$this->k;
+ $p_w = ($this->GetStringWidth($txt)+$this->ws*substr_count($txt,' '))*$this->k;
+ $p_h = -$ut/1000*$this->FontSizePt;
+
+ return sprintf('%.2F %.2F %.2F %.2F re f',$p_x,$p_y,$p_w,$p_h);
+ }
+
+ function clippingPathOpen($x = null, $y = null, $w = null, $h = null, $coin_TL=null, $coin_TR=null, $coin_BL=null, $coin_BR=null)
+ {
+ $path = '';
+ if ($x!==null && $y!==null && $w!==null && $h!==null)
+ {
+ $x1 = $x*$this->k;
+ $y1 = ($this->h-$y)*$this->k;
+
+ $x2 = ($x+$w)*$this->k;
+ $y2 = ($this->h-$y)*$this->k;
+
+ $x3 = ($x+$w)*$this->k;
+ $y3 = ($this->h-$y-$h)*$this->k;
+
+ $x4 = $x*$this->k;
+ $y4 = ($this->h-$y-$h)*$this->k;
+
+ if ($coin_TL || $coin_TR || $coin_BL || $coin_BR)
+ {
+ if ($coin_TL) { $coin_TL[0] = $coin_TL[0]*$this->k; $coin_TL[1] =-$coin_TL[1]*$this->k; }
+ if ($coin_TR) { $coin_TR[0] = $coin_TR[0]*$this->k; $coin_TR[1] =-$coin_TR[1]*$this->k; }
+ if ($coin_BL) { $coin_BL[0] = $coin_BL[0]*$this->k; $coin_BL[1] =-$coin_BL[1]*$this->k; }
+ if ($coin_BR) { $coin_BR[0] = $coin_BR[0]*$this->k; $coin_BR[1] =-$coin_BR[1]*$this->k; }
+
+ $MyArc = 4/3 * (sqrt(2) - 1);
+
+ if ($coin_TL)
+ $path.= sprintf('%.2F %.2F m ', $x1+$coin_TL[0], $y1);
+ else
+ $path.= sprintf('%.2F %.2F m ', $x1, $y1);
+
+ if ($coin_TR)
+ {
+ $xt1 = ($x2-$coin_TR[0])+$coin_TR[0]*$MyArc;
+ $yt1 = ($y2+$coin_TR[1])-$coin_TR[1];
+ $xt2 = ($x2-$coin_TR[0])+$coin_TR[0];
+ $yt2 = ($y2+$coin_TR[1])-$coin_TR[1]*$MyArc;
+
+ $path.= sprintf('%.2F %.2F l ', $x2-$coin_TR[0], $y2);
+ $path.= sprintf('%.2F %.2F %.2F %.2F %.2F %.2F c ', $xt1, $yt1, $xt2, $yt2, $x2, $y2+$coin_TR[1]);
+ }
+ else
+ $path.= sprintf('%.2F %.2F l ', $x2, $y2);
+
+ if ($coin_BR)
+ {
+ $xt1 = ($x3-$coin_BR[0])+$coin_BR[0];
+ $yt1 = ($y3-$coin_BR[1])+$coin_BR[1]*$MyArc;
+ $xt2 = ($x3-$coin_BR[0])+$coin_BR[0]*$MyArc;
+ $yt2 = ($y3-$coin_BR[1])+$coin_BR[1];
+
+ $path.= sprintf('%.2F %.2F l ', $x3, $y3-$coin_BR[1]);
+ $path.= sprintf('%.2F %.2F %.2F %.2F %.2F %.2F c ', $xt1, $yt1, $xt2, $yt2, $x3-$coin_BR[0], $y3);
+ }
+ else
+ $path.= sprintf('%.2F %.2F l ', $x3, $y3);
+
+ if ($coin_BL)
+ {
+ $xt1 = ($x4+$coin_BL[0])-$coin_BL[0]*$MyArc;
+ $yt1 = ($y4-$coin_BL[1])+$coin_BL[1];
+ $xt2 = ($x4+$coin_BL[0])-$coin_BL[0];
+ $yt2 = ($y4-$coin_BL[1])+$coin_BL[1]*$MyArc;
+
+ $path.= sprintf('%.2F %.2F l ', $x4+$coin_BL[0], $y4);
+ $path.= sprintf('%.2F %.2F %.2F %.2F %.2F %.2F c ', $xt1, $yt1, $xt2, $yt2, $x4, $y4-$coin_BL[1]);
+ }
+ else
+ $path.= sprintf('%.2F %.2F l ', $x4, $y4);
+
+ if ($coin_TL)
+ {
+ $xt1 = ($x1+$coin_TL[0])-$coin_TL[0];
+ $yt1 = ($y1+$coin_TL[1])-$coin_TL[1]*$MyArc;
+ $xt2 = ($x1+$coin_TL[0])-$coin_TL[0]*$MyArc;
+ $yt2 = ($y1+$coin_TL[1])-$coin_TL[1];
+
+ $path.= sprintf('%.2F %.2F l ', $x1, $y1+$coin_TL[1]);
+ $path.= sprintf('%.2F %.2F %.2F %.2F %.2F %.2F c ', $xt1, $yt1, $xt2, $yt2, $x1+$coin_TL[0], $y1);
+ }
+ }
+ else
+ {
+ $path.= sprintf('%.2F %.2F m ', $x1, $y1);
+ $path.= sprintf('%.2F %.2F l ', $x2, $y2);
+ $path.= sprintf('%.2F %.2F l ', $x3, $y3);
+ $path.= sprintf('%.2F %.2F l ', $x4, $y4);
+ }
+
+ $path.= ' h W n';
+ }
+ $this->_out('q '.$path.' ');
+ }
+
+ function clippingPathClose()
+ {
+ $this->_out(' Q');
+ }
+
+ function drawCourbe($ext1_x, $ext1_y, $ext2_x, $ext2_y, $int1_x, $int1_y, $int2_x, $int2_y, $cen_x, $cen_y)
+ {
+ $MyArc = 4/3 * (sqrt(2) - 1);
+
+ $ext1_x = $ext1_x*$this->k; $ext1_y = ($this->h-$ext1_y)*$this->k;
+ $ext2_x = $ext2_x*$this->k; $ext2_y = ($this->h-$ext2_y)*$this->k;
+ $int1_x = $int1_x*$this->k; $int1_y = ($this->h-$int1_y)*$this->k;
+ $int2_x = $int2_x*$this->k; $int2_y = ($this->h-$int2_y)*$this->k;
+ $cen_x = $cen_x*$this->k; $cen_y = ($this->h-$cen_y) *$this->k;
+
+ $path = '';
+
+ if ($ext1_x-$cen_x!=0)
+ {
+ $xt1 = $cen_x+($ext1_x-$cen_x);
+ $yt1 = $cen_y+($ext2_y-$cen_y)*$MyArc;
+ $xt2 = $cen_x+($ext1_x-$cen_x)*$MyArc;
+ $yt2 = $cen_y+($ext2_y-$cen_y);
+ }
+ else
+ {
+ $xt1 = $cen_x+($ext2_x-$cen_x)*$MyArc;
+ $yt1 = $cen_y+($ext1_y-$cen_y);
+ $xt2 = $cen_x+($ext2_x-$cen_x);
+ $yt2 = $cen_y+($ext1_y-$cen_y)*$MyArc;
+
+ }
+
+ $path.= sprintf('%.2F %.2F m ', $ext1_x, $ext1_y);
+ $path.= sprintf('%.2F %.2F %.2F %.2F %.2F %.2F c ', $xt1, $yt1, $xt2, $yt2, $ext2_x, $ext2_y);
+
+ if ($int1_x-$cen_x!=0)
+ {
+ $xt1 = $cen_x+($int1_x-$cen_x)*$MyArc;
+ $yt1 = $cen_y+($int2_y-$cen_y);
+ $xt2 = $cen_x+($int1_x-$cen_x);
+ $yt2 = $cen_y+($int2_y-$cen_y)*$MyArc;
+ }
+ else
+ {
+ $xt1 = $cen_x+($int2_x-$cen_x);
+ $yt1 = $cen_y+($int1_y-$cen_y)*$MyArc;
+ $xt2 = $cen_x+($int2_x-$cen_x)*$MyArc;
+ $yt2 = $cen_y+($int1_y-$cen_y);
+
+ }
+
+ $path.= sprintf('%.2F %.2F l ', $int2_x, $int2_y);
+ $path.= sprintf('%.2F %.2F %.2F %.2F %.2F %.2F c ', $xt1, $yt1, $xt2, $yt2, $int1_x, $int1_y);
+
+ $this->_out($path . 'f');
+ }
+
+ function startTransform()
+ {
+ $this->_out('q');
+ }
+
+ function stopTransform()
+ {
+ $this->_out('Q');
+ }
+
+ function setTranslate($t_x, $t_y)
+ {
+ // matrice de transformation
+ $tm[0]=1;
+ $tm[1]=0;
+ $tm[2]=0;
+ $tm[3]=1;
+ $tm[4]=$t_x*$this->k;
+ $tm[5]=-$t_y*$this->k;
+
+ $this->_out(sprintf('%.3F %.3F %.3F %.3F %.3F %.3F cm', $tm[0],$tm[1],$tm[2],$tm[3],$tm[4],$tm[5]));
+ }
+
+
+ function setRotation($angle, $x='', $y='')
+ {
+ if($x === '') $x=$this->x;
+ if($y === '') $y=$this->y;
+
+ $y=($this->h-$y)*$this->k;
+ $x*=$this->k;
+
+ // matrice de transformation
+ $tm[0]=cos(deg2rad($angle));
+ $tm[1]=sin(deg2rad($angle));
+ $tm[2]=-$tm[1];
+ $tm[3]=$tm[0];
+ $tm[4]=$x+$tm[1]*$y-$tm[0]*$x;
+ $tm[5]=$y-$tm[0]*$y-$tm[1]*$x;
+
+ $this->_out(sprintf('%.3F %.3F %.3F %.3F %.3F %.3F cm', $tm[0],$tm[1],$tm[2],$tm[3],$tm[4],$tm[5]));
+ }
+
+ function setMyDrawColor($c)
+ {
+ $c = $this->setMyColor($c, true);
+ if (!$c) return false;
+
+ $this->DrawColor=$c;
+ if($this->page>0) $this->_out($this->DrawColor);
+ }
+
+ function setMyFillColor($c)
+ {
+ $c = $this->setMyColor($c);
+ if (!$c) return false;
+
+ $this->FillColor=$c;
+ $this->ColorFlag=($this->FillColor!=$this->TextColor);
+ if($this->page>0) $this->_out($this->FillColor);
+ }
+
+ function setMyTextColor($c)
+ {
+ $c = $this->setMyColor($c);
+ if (!$c) return false;
+
+ $this->TextColor=$c;
+ $this->ColorFlag=($this->FillColor!=$this->TextColor);
+ }
+
+ function setMyColor($c, $mode = false)
+ {
+ if (!is_array($c)) return sprintf('%.3F ',$c).($mode ? 'G' : 'g');
+ elseif (count($c)==3) return sprintf('%.3F %.3F %.3F ',$c[0],$c[1],$c[2]).($mode ? 'RG' : 'rg');
+ elseif (count($c)==4) return sprintf('%.3F %.3F %.3F %.3F ',$c[0],$c[1],$c[2],$c[3]).($mode ? 'K' : 'k');
+ return null;
+ }
+
+ function SetX($x)
+ {
+ $this->x=$x;
+ }
+
+ function SetY($y)
+ {
+ $this->x=$this->lMargin;
+ $this->y=$y;
+ }
+
+ function SetXY($x, $y)
+ {
+ $this->x=$x;
+ $this->y=$y;
+ }
+ }
+}
diff --git a/main/inc/lib/html2pdf/html2pdf.class.php b/main/inc/lib/html2pdf/html2pdf.class.php
index 75ec856e9e..d415531977 100755
--- a/main/inc/lib/html2pdf/html2pdf.class.php
+++ b/main/inc/lib/html2pdf/html2pdf.class.php
@@ -1,60 +1,33 @@
PDF, utilise fpdf de Olivier PLATHEY
- * Distribu� sous la licence LGPL.
+ *
+ * Convertisseur HTML => PDF, utilise fpdf de Olivier PLATHEY
+ * Distribué sous la licence LGPL.
*
* @author Laurent MINGUET
- * @version 3.24 - 05/08/2009
+ * @version 3.26 - 16/11/2009
*/
+
/**
-* Author: Juan Carlos Ra�a.
+* Author: Juan Carlos Raña Trabado
* forced to read first because another similar library (but different version) can be found elsewhere in the system
*/
$configurationPearPath = $configuration['root_sys'].'/main/inc/lib/html2pdf';
ini_set('include_path', $configurationPearPath);
+
if (!defined('__CLASS_HTML2PDF__'))
{
- define('__CLASS_HTML2PDF__', '3.24');
-
- // vous pouvez utiliser cette fonction de debug comme suit
- // pour voir le temps et la m�moire utilis�s (sous linux) pour la conversion :
- // echo HTML2PDFgetTimerDebug();
- // $html2pdf->WriteHTML($content);
- // echo HTML2PDFgetTimerDebug();
- function HTML2PDFgetTimerDebug($debug=false)
- {
- global $TIMER_ACTION_LAST;
- list($usec, $sec) = explode(" ", microtime());
- $time = (float)$sec + (float)$usec;
- $mem = HTML2PDFgetMem();
-
- if (!$TIMER_ACTION_LAST)
- {
- if ($debug) $ret = null;
- else $ret = 'Debug : init'." \n";
- }
- else
- {
- $aff_time = $time-$TIMER_ACTION_LAST[0];
- $aff_mem = $mem;
- if ($debug) $ret = array($aff_time, $aff_mem);
- else $ret = 'Timer : '.number_format($aff_time, 3, '.', '').'s - Memory used '.$aff_mem.' Ko'." \n";
- }
- $TIMER_ACTION_LAST = array($time, $mem);
- return $ret;
- }
- function HTML2PDFgetMem() { return function_exists('memory_get_usage') ? floor(memory_get_usage()/1024) : 0; }
+ define('__CLASS_HTML2PDF__', '3.26');
- require_once(dirname(__FILE__).'/_mypdf/mypdf.class.php'); // classe mypdf d�riv� de fpdf de Olivier PLATHEY
+ require_once(dirname(__FILE__).'/_mypdf/mypdf.class.php'); // classe mypdf dérivé de fpdf de Olivier PLATHEY
require_once(dirname(__FILE__).'/parsingHTML.class.php'); // classe de parsing HTML
require_once(dirname(__FILE__).'/styleHTML.class.php'); // classe de gestion des styles
- global $HTML2PDF_TABLEAU; $HTML2PDF_TABLEAU = array(); // tableau global necessaire � la gestion des tables imbriqu�es
+ global $HTML2PDF_TABLEAU; $HTML2PDF_TABLEAU = array(); // tableau global necessaire à la gestion des tables imbriquées
class HTML2PDF
{
@@ -63,49 +36,61 @@ if (!defined('__CLASS_HTML2PDF__'))
var $format = 'A4'; // format de la page : A4, A3, ...
var $background = array(); // informations sur le background
var $testTDin1page = true; // activer le test de TD ne devant pas depasser une page
-
+ var $testIsImage = true; // test si les images existes ou non
+
var $style = null; // objet de style
var $parsing = null; // objet de parsing
var $parse_pos = 0; // position du parsing
var $temp_pos = 0; // position temporaire pour multi tableau
-
+ var $page = 0; // numero de la page courante
+
var $sub_html = null; // sous html
var $sub_part = false; // indicateur de sous html
var $isSubPart = false; // indique que le convertisseur courant est un sous html
-
+
var $pdf = null; // objet PDF
var $maxX = 0; // zone maxi X
var $maxY = 0; // zone maxi Y
var $FirstPage = true; // premier page
-
+
var $defaultLeft = 0; // marges par default de la page
var $defaultTop = 0;
var $defaultRight = 0;
var $defaultBottom = 0;
-
- var $margeLeft = 0; //marges r�elles de la page
+
+ var $margeLeft = 0; //marges réelles de la page
var $margeTop = 0;
var $margeRight = 0;
var $margeBottom = 0;
var $marges = array();
var $Maxs = array();
-
- var $maxH = 0; // plus grande hauteur dans la ligne, pour saut de ligne � corriger
- var $inLink = ''; // indique si on est � l'interieur d'un lien
- var $lstAncre = array(); // liste des ancres d�tect�es ou cr��es
+
+ var $maxH = 0; // plus grande hauteur dans la ligne, pour saut de ligne à corriger
+ var $inLink = ''; // indique si on est à l'interieur d'un lien
+ var $lstAncre = array(); // liste des ancres détectées ou créées
var $subHEADER = array(); // tableau des sous commandes pour faire l'HEADER
var $subFOOTER = array(); // tableau des sous commandes pour faire le FOOTER
- var $subSTATES = array(); // tableau de sauvegarde de certains param�tres
+ var $subSTATES = array(); // tableau de sauvegarde de certains paramètres
var $defLIST = array(); // tableau de sauvegarde de l'etat des UL et OL
-
+
var $lstChamps = array(); // liste des champs
var $lstSelect = array(); // options du select en cours
var $previousCall = null; // dernier appel
+ var $pageMarges = array(); // marges spécifiques dues aux floats
var $isInTfoot = false; // indique si on est dans un tfoot
- var $pageMarges = array(); // marges sp�cifiques dues aux floats
+ var $isInOverflow = false; // indique si on est dans une div overflow
var $isAfterFloat = false; // indique si on est apres un float
var $forOneLine = false; // indique si on est dans un sous HTML ne servant qu'a calculer la taille de la prochaine ligne
+ var $encoding = 'ISO-8859-15'; // encodage utilisé pour les entites html
+
+ var $DEBUG_actif = false; // indique si on est en mode debug
+ var $DEBUG_ok_usage = false; // indique l'existance de la fonction memory_get_usage
+ var $DEBUG_ok_peak = false; // indique l'existance de la fonction memory_get_peak_usage
+ var $DEBUG_level = 0; // niveau du debug
+ var $DEBUG_start_time = 0; //
+ var $DEBUG_last_time = 0; //
+ var $defaultFont = null; // fonte par défaut si la fonte demandée n'existe pas
/**
* Constructeur
@@ -114,35 +99,41 @@ if (!defined('__CLASS_HTML2PDF__'))
* @param string format A4, A5, ...
* @param string langue : fr, en, it...
* @param array marges par defaut, dans l'ordre (left, top, right, bottom)
- * @param boolean forcer la cr�ation de la premiere page, ne pas utiliser, c'est utilis� en interne pour la gestion des tableaux
+ * @param boolean forcer la création de la premiere page, ne pas utiliser, c'est utilisé en interne pour la gestion des tableaux
* @return null
*/
function HTML2PDF($sens = 'P', $format = 'A4', $langue='fr', $marges = array(5, 5, 5, 8), $force_page = false)
{
- // sauvegarde des param�tres
+ // sauvegarde des paramètres
+ $this->page = 0;
$this->sens = $sens;
$this->format = $format;
$this->FirstPage = true;
$this->langue = strtolower($langue);
- $this->setTestTdInOnePage(true);
-
+
// chargement du fichier de langue
$this->textLOAD($this->langue);
-
- // cr�ation de l' objet PDF
+
+ // création de l' objet PDF
$this->pdf = new MyPDF($sens, 'mm', $format);
// initialisation des styles
$this->style = new styleHTML($this->pdf);
$this->style->FontSet();
$this->defLIST = array();
-
+
+ // initialisations diverses
+ $this->setTestTdInOnePage(true);
+ $this->setTestIsImage(true);
+ $this->setDefaultFont(null);
+
// initialisation du parsing
$this->parsing = new parsingHTML();
- $this->sub_html = null;
+ $this->sub_html = null;
$this->sub_part = false;
-
+
// initialisation des marges
+ if (!is_array($marges)) $marges = array($marges, $marges, $marges, $marges);
$this->setDefaultMargins($marges[0], $marges[1], $marges[2], $marges[3]);
$this->setMargins();
$this->marges = array();
@@ -150,10 +141,79 @@ if (!defined('__CLASS_HTML2PDF__'))
// initialisation des champs de formulaire
$this->lstChamps = array();
- // premier page forc�e
- if ($force_page) $this->setNewPage($this->sens);
+ // premier page forcée
+ if ($force_page) $this->setNewPage($this->format, $this->sens);
}
-
+
+ /**
+ * activer le debug mode
+ *
+ * @return null
+ */
+ function setModeDebug()
+ {
+ list($usec, $sec) = explode(' ', microtime());
+
+ $this->DEBUG_actif = true;
+ $this->DEBUG_ok_usage = function_exists('memory_get_usage');
+ $this->DEBUG_ok_peak = function_exists('memory_get_peak_usage');
+ $this->DEBUG_start_time = (float)$sec + (float)$usec;
+ $this->DEBUG_last_time = (float)$sec + (float)$usec;
+
+ $this->DEBUG_stepline('step', 'time', 'delta', 'memory', 'peak');
+ $this->DEBUG_add('Init debug');
+ }
+
+ /**
+ * rajouter une ligne de debug
+ *
+ * @param string nom de l'etape
+ * @param boolean true=monter d'un niveau, false=descendre d'un niveau, null : ne rien faire
+ * @return null
+ */
+ function DEBUG_add($nom, $level=null)
+ {
+ list($usec, $sec) = explode(' ', microtime());
+ if ($level===true) $this->DEBUG_level++;
+
+ $nom = str_repeat(' ',$this->DEBUG_level). $nom.($level===true ? ' Begin' : ($level===false ? ' End' : ''));
+ $time = (float)$sec + (float)$usec;
+ $usage = ($this->DEBUG_ok_usage ? memory_get_usage() : 0);
+ $peak = ($this->DEBUG_ok_peak ? memory_get_peak_usage() : 0);
+
+ $this->DEBUG_stepline(
+ $nom,
+ number_format(($time - $this->DEBUG_start_time)*1000, 1, '.', ' ').' ms',
+ number_format(($time - $this->DEBUG_last_time)*1000, 1, '.', ' ').' ms',
+ number_format($usage/1024, 1, '.', ' ').' Ko',
+ number_format($peak/1024, 1, '.', ' ').' Ko');
+
+ $this->DEBUG_last_time = $time;
+ if ($level===false) $this->DEBUG_level--;
+ return true;
+ }
+
+ /**
+ * affiche une ligne de debug
+ *
+ * @param string nom de l'etape
+ * @param string valeur 1
+ * @param string valeur 2
+ * @param string valeur 3
+ * @param string valeur 4
+ * @return null
+ */
+ function DEBUG_stepline($nom, $val1, $val2, $val3, $val4)
+ {
+ $txt = str_pad($nom, 30, ' ', STR_PAD_RIGHT).
+ str_pad($val1, 12, ' ', STR_PAD_LEFT).
+ str_pad($val2, 12, ' ', STR_PAD_LEFT).
+ str_pad($val3, 15, ' ', STR_PAD_LEFT).
+ str_pad($val4, 15, ' ', STR_PAD_LEFT);
+
+ echo '
'.$txt.'
';
+ }
+
/**
* activer ou desactiver le test de TD ne devant pas depasser une page
*
@@ -163,14 +223,52 @@ if (!defined('__CLASS_HTML2PDF__'))
function setTestTdInOnePage($mode = true)
{
$old = $this->testTDin1page;
-
$this->testTDin1page = $mode ? true : false;
-
return $old;
}
-
+
+ /**
+ * renseigner l'encoding à utiliser
+ *
+ * @param string nouvel encoding
+ * @return string ancien encoding
+ */
+ function setEncoding($encoding = 'ISO-8859-15')
+ {
+ $old = $this->encoding;
+ $this->encoding = $encoding;
+ return $old;
+ }
+
+ /**
+ * activer ou desactiver le test sur la présence des images
+ *
+ * @param boolean nouvel etat
+ * @return boolean ancien etat
+ */
+ function setTestIsImage($mode = true)
+ {
+ $old = $this->testIsImage;
+ $this->testIsImage = $mode ? true : false;
+ return $old;
+ }
+
+ /**
+ * définit la fonte par défaut si aucun fonte n'est spécifiée, ou si la fonte demandée n'existe pas
+ *
+ * @param string nom de la fonte par defaut. si null : Arial pour fonte non spécifiée, et erreur pour fonte non existante
+ * @return string nom de l'ancienne fonte par defaut
+ */
+ function setDefaultFont($default = null)
+ {
+ $old = $this->defaultFont;
+ $this->defaultFont = $default;
+ $this->style->setDefaultFont($default);
+ return $old;
+ }
+
/**
- * d�finir les marges par d�fault
+ * définir les marges par défault
*
* @param int en mm, marge left
* @param int en mm, marge top
@@ -182,7 +280,7 @@ if (!defined('__CLASS_HTML2PDF__'))
{
if ($right===null) $right = $left;
if ($bottom===null) $bottom = 8;
-
+
$this->defaultLeft = $this->style->ConvertToMM($left.'mm');
$this->defaultTop = $this->style->ConvertToMM($top.'mm');
$this->defaultRight = $this->style->ConvertToMM($right.'mm');
@@ -190,7 +288,7 @@ if (!defined('__CLASS_HTML2PDF__'))
}
/**
- * d�finir les marges r�elles, fonctions de la balise page
+ * définir les marges réelles, fonctions de la balise page
*
* @return null
*/
@@ -200,12 +298,12 @@ if (!defined('__CLASS_HTML2PDF__'))
$this->margeRight = $this->defaultRight + (isset($this->background['right']) ? $this->background['right'] : 0);
$this->margeTop = $this->defaultTop + (isset($this->background['top']) ? $this->background['top'] : 0);
$this->margeBottom = $this->defaultBottom + (isset($this->background['bottom']) ? $this->background['bottom'] : 0);
-
+
$this->pdf->SetMargins($this->margeLeft, $this->margeTop, $this->margeRight);
$this->pdf->cMargin = 0;
$this->pdf->SetAutoPageBreak(false, $this->margeBottom);
}
-
+
/**
* recuperer les positions x minimales et maximales en fonction d'une hauteur
*
@@ -216,13 +314,13 @@ if (!defined('__CLASS_HTML2PDF__'))
{
$y = floor($y*100);
$x = array($this->pdf->lMargin, $this->pdf->w-$this->pdf->rMargin);
-
+
foreach($this->pageMarges as $m_y => $m_x)
if ($m_y<=$y) $x = $m_x;
-
+
return $x;
}
-
+
/**
* ajouter une marge suite a un float
*
@@ -237,30 +335,30 @@ if (!defined('__CLASS_HTML2PDF__'))
{
$old1 = $this->getMargins($y1);
$old2 = $this->getMargins($y2);
- if ($float=='left') $old1[0] = $x2;
+ if ($float=='left') $old1[0] = $x2;
if ($float=='right') $old1[1] = $x1;
-
+
$y1 = floor($y1*100);
$y2 = floor($y2*100);
foreach($this->pageMarges as $m_y => $m_x)
{
- if ($m_y<$y1) continue;
- if ($m_y>$y2) break;
- if ($float=='left' && $this->pageMarges[$m_y][0]<$x2) unset($this->pageMarges[$m_y]);
+ if ($m_y<$y1) continue;
+ if ($m_y>$y2) break;
+ if ($float=='left' && $this->pageMarges[$m_y][0]<$x2) unset($this->pageMarges[$m_y]);
if ($float=='right' && $this->pageMarges[$m_y][1]>$x1) unset($this->pageMarges[$m_y]);
}
$this->pageMarges[$y1] = $old1;
$this->pageMarges[$y2] = $old2;
-
+
ksort($this->pageMarges);
-
+
$this->isAfterFloat = true;
}
-
+
/**
- * d�finir des nouvelles marges et sauvegarder les anciennes
+ * définir des nouvelles marges et sauvegarder les anciennes
*
* @param float marge left
* @param float marge top
@@ -275,9 +373,9 @@ if (!defined('__CLASS_HTML2PDF__'))
$this->pageMarges = array();
$this->pageMarges[floor($mt*100)] = array($ml, $this->pdf->w-$mr);
}
-
+
/**
- * r�cuperer les derni�res marches sauv�es
+ * récuperer les dernières marches sauvées
*
* @return null
*/
@@ -298,11 +396,11 @@ if (!defined('__CLASS_HTML2PDF__'))
$mr = $this->margeRight;
$mP = array($mt => array($ml, $this->pdf->w-$mr));
}
-
+
$this->pdf->SetMargins($ml, $mt, $mr);
$this->pageMarges = $mP;
}
-
+
/**
* permet d'ajouter une fonte.
*
@@ -315,9 +413,9 @@ if (!defined('__CLASS_HTML2PDF__'))
{
$this->pdf->AddFont($family, $style, $file);
}
-
+
/**
- * sauvegarder l'�tat actuelle des maximums
+ * sauvegarder l'état actuelle des maximums
*
* @return null
*/
@@ -325,9 +423,9 @@ if (!defined('__CLASS_HTML2PDF__'))
{
$this->Maxs[] = array($this->maxX, $this->maxY, $this->maxH);
}
-
+
/**
- * charger le dernier �tat sauv� des maximums
+ * charger le dernier état sauvé des maximums
*
* @return null
*/
@@ -348,7 +446,7 @@ if (!defined('__CLASS_HTML2PDF__'))
$this->maxH = 0;
}
}
-
+
/**
* afficher l'header contenu dans page_header
*
@@ -360,11 +458,11 @@ if (!defined('__CLASS_HTML2PDF__'))
$OLD_parse_pos = $this->parse_pos;
$OLD_parse_code = $this->parsing->code;
-
+
$this->parse_pos = 0;
$this->parsing->code = $this->subHEADER;
$this->MakeHTMLcode();
-
+
$this->parse_pos = $OLD_parse_pos;
$this->parsing->code = $OLD_parse_code;
}
@@ -380,112 +478,111 @@ if (!defined('__CLASS_HTML2PDF__'))
$OLD_parse_pos = $this->parse_pos;
$OLD_parse_code = $this->parsing->code;
-
+
$this->parse_pos = 0;
$this->parsing->code = $this->subFOOTER;
$this->MakeHTMLcode();
-
+
$this->parse_pos = $OLD_parse_pos;
$this->parsing->code = $OLD_parse_code;
}
-
+
/**
- * saut de ligne avec une hauteur sp�cifique
+ * saut de ligne avec une hauteur spécifique
*
* @param float hauteur de la ligne
- * @param integer position reelle courante si saut de ligne pendant l'ecriture d'un texte
+ * @param integer position reelle courante si saut de ligne pendant l'ecriture d'un texte
* @return null
*/
function setNewLine($h, $curr = null)
{
$this->pdf->Ln($h);
-
+
$this->setNewPositionForNewLine($curr);
}
-
+
/**
- * cr�ation d'une nouvelle page avec une orientation particuliere
+ * création d'une nouvelle page avec le format et l'orientation spécifies
*
+ * @param mixed format de la page : A5, A4, array(width, height)
* @param string sens P=portrait ou L=landscape
- * @param array tableau des propri�t�s du fond de la page
- * @param integer position reelle courante si saut de ligne pendant l'ecriture d'un texte
+ * @param array tableau des propriétés du fond de la page
+ * @param integer position reelle courante si saut de ligne pendant l'ecriture d'un texte
* @return null
*/
- function setNewPage($orientation = '', $background = null, $curr = null)
+ function setNewPage($format = null, $orientation = '', $background = null, $curr = null)
{
-/*
- if (!$this->FirstPage)
- {
- $info = debug_backtrace(); foreach($info as $k => $v) { unset($info[$k]['object']); unset($info[$k]['type']); unset($info[$k]['args']);}
- echo '
'.print_r($info, true).'
';
- }
-*/
$this->FirstPage = false;
+ $this->format = $format ? $format : $this->format;
$this->sens = $orientation ? $orientation : $this->sens;
$this->background = $background!==null ? $background : $this->background;
- $this->maxY = 0;
+ $this->maxY = 0;
$this->maxX = 0;
-
+ $this->maxH = 0;
+
$this->pdf->lMargin = $this->defaultLeft;
$this->pdf->rMargin = $this->defaultRight;
$this->pdf->tMargin = $this->defaultTop;
- $this->pdf->AddPage($this->sens);
-
+ $this->pdf->AddPage($this->sens, $this->format);
+ $this->page++;
+
if (!$this->sub_part && !$this->isSubPart)
{
if (is_array($this->background))
{
if (isset($this->background['color']) && $this->background['color'])
{
- $this->pdf->SetFillColor($this->background['color'][0], $this->background['color'][1], $this->background['color'][2]);
+ $this->pdf->setMyFillColor($this->background['color']);
$this->pdf->Rect(0, 0, $this->pdf->w, $this->pdf->h, 'F');
}
if (isset($this->background['img']) && $this->background['img'])
$this->pdf->Image($this->background['img'], $this->background['posX'], $this->background['posY'], $this->background['width']);
- }
-
+ }
+
$this->SetPageHeader();
$this->SetPageFooter();
}
-
+
$this->SetMargins();
$this->pdf->y = $this->margeTop;
-
+
$this->setNewPositionForNewLine($curr);
+ $this->maxH = 0;
}
-
+
/**
* calcul de la position de debut de la prochaine ligne en fonction de l'alignement voulu
*
- * @param integer position reelle courante si saut de ligne pendant l'ecriture d'un texte
+ * @param integer position reelle courante si saut de ligne pendant l'ecriture d'un texte
* @return null
*/
function setNewPositionForNewLine($curr = null)
{
list($lx, $rx) = $this->getMargins($this->pdf->y);
$this->pdf->x=$lx;
-
+
if (
- $this->style->value['text-align']!='right' &&
- $this->style->value['text-align']!='center'
+ $this->style->value['text-align']!='right' &&
+ $this->style->value['text-align']!='center' &&
+ $this->style->value['text-align']!='justify'
)
return null;
$sub = null;
$this->CreateSubHTML($sub);
- $sub->saveMargin(0, 0, $sub->pdf->w-$rx+$lx);
+ $sub->saveMargin(0, 0, $sub->pdf->w-$rx+$lx);
$sub->forOneLine = true;
$sub->parse_pos = $this->parse_pos;
$sub->parsing->code = $this->parsing->code;
-
+
if ($curr!==null && $sub->parsing->code[$this->parse_pos]['name']=='write')
$sub->parsing->code[$this->parse_pos]['param']['txt'] = substr($sub->parsing->code[$this->parse_pos]['param']['txt'], $curr);
else
$sub->parse_pos++;
-
- // pour chaque element identifi� par le parsing
+
+ // pour chaque element identifié par le parsing
for($sub->parse_pos; $sub->parse_posparsing->code); $sub->parse_pos++)
{
$todo = $sub->parsing->code[$sub->parse_pos];
@@ -494,62 +591,71 @@ if (!defined('__CLASS_HTML2PDF__'))
$w = $sub->maxX;
- unset($sub);
+ $this->DestroySubHTML($sub);
if ($this->style->value['text-align']=='center')
$this->pdf->x+= ($rx-$this->pdf->x-$w)*0.5-0.01;
- else
+ elseif ($this->style->value['text-align']=='right')
$this->pdf->x = $rx-$w-0.01;
+ else
+ $this->pdf->x = $lx;
}
-
- /**
- * r�cup�ration du PDF
- *
- * @param string nom du fichier PDF
- * @param boolean destination
- * @return string contenu �ventuel du pdf
+
+ /**
+ * récupération du PDF
+ *
+ * @param string nom du fichier PDF
+ * @param boolean destination
+ * @return string contenu éventuel du pdf
+ *
*
- *
- * Destination o� envoyer le document. Le param�tre peut prendre les valeurs suivantes :
- * true : equivalent � I
- * false : equivalent � S
- * I : envoyer en inline au navigateur. Le plug-in est utilis� s'il est install�. Le nom indiqu� dans name est utilis� lorsque l'on s�lectionne "Enregistrer sous" sur le lien g�n�rant le PDF.
- * D : envoyer au navigateur en for�ant le t�l�chargement, avec le nom indiqu� dans name.
- * F : sauver dans un fichier local, avec le nom indiqu� dans name (peut inclure un r�pertoire).
- * S : renvoyer le document sous forme de cha�ne. name est ignor�.
+ * Destination où envoyer le document. Le paramètre peut prendre les valeurs suivantes :
+ * true : equivalent à I
+ * false : equivalent à S
+ * I : envoyer en inline au navigateur. Le plug-in est utilisé s'il est installé. Le nom indiqué dans name est utilisé lorsque l'on sélectionne "Enregistrer sous" sur le lien générant le PDF.
+ * D : envoyer au navigateur en forçant le téléchargement, avec le nom indiqué dans name.
+ * F : sauver dans un fichier local, avec le nom indiqué dans name (peut inclure un répertoire).
+ * S : renvoyer le document sous forme de chaîne. name est ignoré.
*/
function Output($name = '', $dest = false)
{
+ if ($this->DEBUG_actif)
+ {
+ $this->DEBUG_add('Before output');
+ $this->pdf->Close();
+ exit;
+ }
+
// nettoyage
global $HTML2PDF_TABLEAU; $HTML2PDF_TABLEAU = array();
- // interpretation des param�tres
+ // interpretation des paramètres
if ($dest===false) $dest = 'I';
if ($dest===true) $dest = 'S';
if ($dest==='') $dest = 'I';
if ($name=='') $name='document.pdf';
-
+
// verification de la destination
$dest = strtoupper($dest);
if (!in_array($dest, array('I', 'D', 'F', 'S'))) $dest = 'I';
-
+
// verification du nom
if (strtolower(substr($name, -4))!='.pdf')
{
echo 'ERROR : The output document name "'.$name.'" is not a PDF name';
exit;
}
-
+
return $this->pdf->Output($name, $dest);
}
-
+
/**
- * cr�ation d'un sous HTML2PDF pour la gestion des tableaux imbriqu�s
+ * création d'un sous HTML2PDF pour la gestion des tableaux imbriqués
*
- * @param HTML2PDF futur sous HTML2PDF pass� en r�f�rence pour cr�ation
+ * @param HTML2PDF futur sous HTML2PDF passé en référence pour création
* @param integer marge eventuelle de l'objet si simulation d'un TD
* @return null
- */
+ */
function CreateSubHTML(&$sub_html, $cellmargin=0)
{
// initialisation du sous objet
@@ -561,8 +667,10 @@ if (!defined('__CLASS_HTML2PDF__'))
true
);
$sub_html->isSubPart = true;
+ $sub_html->setEncoding($this->encoding);
$sub_html->setTestTdInOnePage($this->testTDin1page);
-
+ $sub_html->setTestIsImage($this->testIsImage);
+ $sub_html->setDefaultFont($this->defaultFont);
$sub_html->style->css = $this->style->css;
$sub_html->style->css_keys = $this->style->css_keys;
$sub_html->style->table = $this->style->table;
@@ -570,7 +678,7 @@ if (!defined('__CLASS_HTML2PDF__'))
$sub_html->style->value['text-align'] = 'left';
$sub_html->defLIST = $this->defLIST;
$sub_html->style->onlyLeft = true;
-
+
// initialisation de la largeur
if ($this->style->value['width'])
{
@@ -581,7 +689,7 @@ if (!defined('__CLASS_HTML2PDF__'))
}
else
$marge = $this->margeLeft+$this->margeRight;
-
+
$sub_html->saveMargin(0, 0, $marge);
// initialisation des fontes
@@ -590,30 +698,30 @@ if (!defined('__CLASS_HTML2PDF__'))
$sub_html->pdf->diffs = &$this->pdf->diffs;
// initialisation des positions et autre
+ $sub_html->page = $this->page;
$sub_html->maxX = 0;
$sub_html->maxY = 0;
$sub_html->maxH = 0;
- $sub_html->pdf->setX(0);
- $sub_html->pdf->setY(0);
+ $sub_html->pdf->setXY(0, 0);
$sub_html->style->FontSet();
}
-
+
/**
- * destruction d'un sous HTML2PDF pour la gestion des tableaux imbriqu�s
+ * destruction d'un sous HTML2PDF pour la gestion des tableaux imbriqués
*
* @return null
- */
- function DestroySubHTML()
+ */
+ function DestroySubHTML(&$sub_html)
{
-
- unset($this->sub_html);
- $this->sub_html = null;
+ $sub_html->pdf->Close();
+ unset($sub_html);
+ $sub_html = null;
}
-
+
/**
* Convertir un nombre arabe en nombre romain
*
- * @param integer nombre � convertir
+ * @param integer nombre à convertir
* @return string nombre converti
*/
function listeArab2Rom($nb_ar)
@@ -658,7 +766,7 @@ if (!defined('__CLASS_HTML2PDF__'))
}
return $nb_ro;
}
-
+
/**
* Ajouter un LI au niveau actuel
*
@@ -675,7 +783,7 @@ if (!defined('__CLASS_HTML2PDF__'))
/**
* Recuperer le LI du niveau actuel
*
- * @return string chaine � afficher
+ * @return string chaine à afficher
*/
function listeGetLi()
{
@@ -683,32 +791,32 @@ if (!defined('__CLASS_HTML2PDF__'))
$st = $this->defLIST[count($this->defLIST)-1]['style'];
$nb = $this->defLIST[count($this->defLIST)-1]['nb'];
$up = (substr($st, 0, 6)=='upper-');
-
+
if ($im) return array(false, false, $im);
-
+
switch($st)
{
case 'none':
return array('arial', true, ' ');
-
+
case 'upper-alpha':
case 'lower-alpha':
$str = '';
while($nb>26)
{
- $str = chr(96+$nb%26).$str;
- $nb = floor($nb/26);
+ $str = chr(96+$nb%26).$str;
+ $nb = floor($nb/26);
}
- $str = chr(96+$nb).$str;
-
+ $str = chr(96+$nb).$str;
+
return array('arial', false, ($up ? strtoupper($str) : $str).'.');
case 'upper-roman':
case 'lower-roman':
$str = $this->listeArab2Rom($nb);
-
+
return array('arial', false, ($up ? strtoupper($str) : $str).'.');
-
+
case 'decimal':
return array('arial', false, $nb.'.');
@@ -723,7 +831,7 @@ if (!defined('__CLASS_HTML2PDF__'))
return array('zapfdingbats', true, chr(108));
}
}
-
+
/**
* Ajouter un niveau de liste
*
@@ -742,10 +850,10 @@ if (!defined('__CLASS_HTML2PDF__'))
}
else
$img = null;
-
+
if (!in_array($type, array('ul', 'ol'))) $type = 'ul';
if (!in_array($style, array('lower-alpha', 'upper-alpha', 'upper-roman', 'lower-roman', 'decimal', 'square', 'circle', 'disc', 'none'))) $style = '';
-
+
if (!$style)
{
if ($type=='ul') $style = 'disc';
@@ -753,7 +861,7 @@ if (!defined('__CLASS_HTML2PDF__'))
}
$this->defLIST[count($this->defLIST)] = array('style' => $style, 'nb' => 0, 'img' => $img);
}
-
+
/**
* Supprimer un niveau de liste
*
@@ -767,18 +875,22 @@ if (!defined('__CLASS_HTML2PDF__'))
$this->defLIST = array_values($this->defLIST);
}
}
-
+
/**
* traitement d'un code HTML
*
- * @param string code HTML � convertir
+ * @param string code HTML à convertir
* @param boolean afficher en pdf (false) ou en html (true)
* @return null
- */
+ */
function WriteHTML($html, $vue = false)
{
+ // si c'est une vrai page HTML, une conversion s'impose
+ if (preg_match('/getHtmlFromPage($html);
+
$html = str_replace('[[page_nb]]', '{nb}', $html);
-
+
$html = str_replace('[[date_y]]', date('Y'), $html);
$html = str_replace('[[date_m]]', date('m'), $html);
$html = str_replace('[[date_d]]', date('d'), $html);
@@ -786,9 +898,9 @@ if (!defined('__CLASS_HTML2PDF__'))
$html = str_replace('[[date_h]]', date('H'), $html);
$html = str_replace('[[date_i]]', date('i'), $html);
$html = str_replace('[[date_s]]', date('s'), $html);
-
- // si on veut voir le r�sultat en HTML => on appelle la fonction
- if ($vue) $this->vueHTML($html);
+
+ // si on veut voir le résultat en HTML => on appelle la fonction
+ if ($vue) $this->vueHTML($html);
// sinon, traitement pour conversion en PDF :
// parsing
@@ -798,25 +910,50 @@ if (!defined('__CLASS_HTML2PDF__'))
$this->parsing->parse();
$this->MakeHTMLcode();
}
-
+
+ function getHtmlFromPage($html)
+ {
+ $html = str_replace('';
+
+ // extraction des balises link
+ preg_match_all('/]*)>/isU', $html, $match);
+ foreach($match[0] as $src)
+ $content = $src.''.$content;
+
+ // extraction des balises style
+ preg_match_all('/