Juan Carlos Raña 15 years ago
parent
commit
2e1f58e67c
100 changed files with 6760 additions and 5954 deletions
  1. 1 1
      main/admin/legal_add.php
  2. 1 1
      main/admin/settings.php
  3. 13 1
      main/document/document.inc.php
  4. 9 9
      main/document/document.php
  5. 1 1
      main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/inc/class.upload.php
  6. BIN
      main/inc/lib/fckeditor/editor/plugins/asciimath/asciimath.gif
  7. 14 14
      main/inc/lib/fckeditor/editor/plugins/asciimath/lang/es.js
  8. 41 7
      main/inc/lib/fckeditor/myconfig.php
  9. 46 0
      main/inc/lib/fckeditor/toolbars/default/terms_and_conditions.php
  10. 6 10
      main/inc/lib/fckeditor/toolbars/extended/admin_templates.php
  11. 9 9
      main/inc/lib/fckeditor/toolbars/extended/agenda.php
  12. 9 9
      main/inc/lib/fckeditor/toolbars/extended/agenda_student.php
  13. 9 9
      main/inc/lib/fckeditor/toolbars/extended/announcements.php
  14. 10 9
      main/inc/lib/fckeditor/toolbars/extended/announcements_student.php
  15. 10 12
      main/inc/lib/fckeditor/toolbars/extended/assessments_introduction.php
  16. 7 10
      main/inc/lib/fckeditor/toolbars/extended/documents.php
  17. 8 9
      main/inc/lib/fckeditor/toolbars/extended/documents_student.php
  18. 9 7
      main/inc/lib/fckeditor/toolbars/extended/faq.php
  19. 9 12
      main/inc/lib/fckeditor/toolbars/extended/forum.php
  20. 10 11
      main/inc/lib/fckeditor/toolbars/extended/forum_student.php
  21. 7 8
      main/inc/lib/fckeditor/toolbars/extended/global_agenda.php
  22. 9 12
      main/inc/lib/fckeditor/toolbars/extended/glossary.php
  23. 7 10
      main/inc/lib/fckeditor/toolbars/extended/introduction.php
  24. 1 5
      main/inc/lib/fckeditor/toolbars/extended/learning_path_author.php
  25. 6 11
      main/inc/lib/fckeditor/toolbars/extended/learning_path_documents.php
  26. 8 10
      main/inc/lib/fckeditor/toolbars/extended/messages.php
  27. 9 12
      main/inc/lib/fckeditor/toolbars/extended/notebook.php
  28. 10 11
      main/inc/lib/fckeditor/toolbars/extended/notebook_student.php
  29. 7 10
      main/inc/lib/fckeditor/toolbars/extended/portal_home_page.php
  30. 9 12
      main/inc/lib/fckeditor/toolbars/extended/portal_news.php
  31. 8 6
      main/inc/lib/fckeditor/toolbars/extended/profile.php
  32. 7 8
      main/inc/lib/fckeditor/toolbars/extended/project.php
  33. 6 8
      main/inc/lib/fckeditor/toolbars/extended/project_comment.php
  34. 6 8
      main/inc/lib/fckeditor/toolbars/extended/project_comment_student.php
  35. 7 8
      main/inc/lib/fckeditor/toolbars/extended/project_student.php
  36. 6 7
      main/inc/lib/fckeditor/toolbars/extended/survey.php
  37. 41 0
      main/inc/lib/fckeditor/toolbars/extended/terms_and_conditions.php
  38. 1 5
      main/inc/lib/fckeditor/toolbars/extended/test_answer_feedback.php
  39. 9 12
      main/inc/lib/fckeditor/toolbars/extended/test_description.php
  40. 1 5
      main/inc/lib/fckeditor/toolbars/extended/test_free_answer.php
  41. 1 4
      main/inc/lib/fckeditor/toolbars/extended/test_proposed_answer.php
  42. 9 12
      main/inc/lib/fckeditor/toolbars/extended/test_question_description.php
  43. 7 10
      main/inc/lib/fckeditor/toolbars/extended/training_description.php
  44. 6 10
      main/inc/lib/fckeditor/toolbars/extended/wiki.php
  45. 7 10
      main/inc/lib/fckeditor/toolbars/extended/wiki_student.php
  46. 4 4
      main/inc/lib/fileUpload.lib.php
  47. 7 7
      main/inc/lib/html2pdf/_fpdf/font/courier.php
  48. 15 15
      main/inc/lib/html2pdf/_fpdf/font/helvetica.php
  49. 15 15
      main/inc/lib/html2pdf/_fpdf/font/helveticab.php
  50. 15 15
      main/inc/lib/html2pdf/_fpdf/font/helveticabi.php
  51. 15 15
      main/inc/lib/html2pdf/_fpdf/font/helveticai.php
  52. 419 419
      main/inc/lib/html2pdf/_fpdf/font/makefont/makefont.php
  53. 15 15
      main/inc/lib/html2pdf/_fpdf/font/symbol.php
  54. 15 15
      main/inc/lib/html2pdf/_fpdf/font/times.php
  55. 15 15
      main/inc/lib/html2pdf/_fpdf/font/timesb.php
  56. 15 15
      main/inc/lib/html2pdf/_fpdf/font/timesbi.php
  57. 15 15
      main/inc/lib/html2pdf/_fpdf/font/timesi.php
  58. 15 15
      main/inc/lib/html2pdf/_fpdf/font/zapfdingbats.php
  59. 1736 1734
      main/inc/lib/html2pdf/_fpdf/fpdf.php
  60. 5 5
      main/inc/lib/html2pdf/_fpdf/license.txt
  61. 237 238
      main/inc/lib/html2pdf/_mypdf/00_fpdf_codebar.class.php
  62. 25 26
      main/inc/lib/html2pdf/_mypdf/01_fpdf_bookmark.class.php
  63. 34 35
      main/inc/lib/html2pdf/_mypdf/02_fpdf_formulaire.class.php
  64. 326 0
      main/inc/lib/html2pdf/_mypdf/03_fpdf_alpha.class.php
  65. 228 229
      main/inc/lib/html2pdf/_mypdf/99_fpdf_protection.class.php
  66. 502 485
      main/inc/lib/html2pdf/_mypdf/mypdf.class.php
  67. 334 197
      main/inc/lib/html2pdf/html2pdf.class.php
  68. 19 19
      main/inc/lib/html2pdf/langues/ca.txt
  69. 19 0
      main/inc/lib/html2pdf/langues/da.txt
  70. 19 19
      main/inc/lib/html2pdf/langues/de.txt
  71. 19 19
      main/inc/lib/html2pdf/langues/en.txt
  72. 19 19
      main/inc/lib/html2pdf/langues/es.txt
  73. 19 19
      main/inc/lib/html2pdf/langues/fr.txt
  74. 19 19
      main/inc/lib/html2pdf/langues/it.txt
  75. 19 19
      main/inc/lib/html2pdf/langues/nl.txt
  76. 19 19
      main/inc/lib/html2pdf/langues/pt.txt
  77. 19 19
      main/inc/lib/html2pdf/langues/tr.txt
  78. 440 421
      main/inc/lib/html2pdf/parsingHTML.class.php
  79. 47 0
      main/inc/lib/html2pdf/qrcode/qrcode.class.php
  80. 1536 1456
      main/inc/lib/html2pdf/styleHTML.class.php
  81. 20 9
      main/inc/lib/mimetex/README
  82. BIN
      main/inc/lib/mimetex/mimetex.cgi
  83. BIN
      main/inc/lib/mimetex/mimetex.exe
  84. 28 11
      main/install/dokeos_main.sql
  85. 5 0
      main/lang/asturian/admin.inc.php
  86. 1 0
      main/lang/asturian/course_home.inc.php
  87. 2 0
      main/lang/asturian/slideshow.inc.php
  88. 2 0
      main/lang/asturian/userInfo.inc.php
  89. 15 0
      main/lang/english/admin.inc.php
  90. 2 1
      main/lang/greek/accessibility.inc.php
  91. 4 0
      main/lang/italian/admin.inc.php
  92. 1 0
      main/lang/italian/course_home.inc.php
  93. 2 0
      main/lang/italian/slideshow.inc.php
  94. 2 0
      main/lang/italian/userInfo.inc.php
  95. 19 0
      main/lang/portuguese/admin.inc.php
  96. 1 0
      main/lang/portuguese/course_home.inc.php
  97. 2 0
      main/lang/portuguese/slideshow.inc.php
  98. 2 0
      main/lang/portuguese/userInfo.inc.php
  99. 14 0
      main/lang/spanish/admin.inc.php
  100. 1 1
      main/lang/spanish/trad4all.inc.php

+ 1 - 1
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');

+ 1 - 1
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')";

+ 13 - 1
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)?'':'<a href="'.$forcedownload_link.'" style="float:right"'.$prevent_multiple_click.'>'.Display::return_icon($forcedownload_icon, get_lang('Download'),array('height'=>'16', 'width' => '16')).'</a>';
+		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)?'':'<a href="'.$forcedownload_link.'" style="float:right"'.$prevent_multiple_click.'>'.Display::return_icon($forcedownload_icon, get_lang('Download'),array('height'=>'16', 'width' => '16')).'</a>';
+			}
+		}
+		else
+		{
+			$force_download_html = ($size==0)?'':'<a href="'.$forcedownload_link.'" style="float:right"'.$prevent_multiple_click.'>'.Display::return_icon($forcedownload_icon, get_lang('Download'),array('height'=>'16', 'width' => '16')).'</a>';
+		}
+		
 		return '<a href="'.$url.'" title="'.$tooltip_title_alt.'" target="'.$target.'"'.$visibility_class.' style="float:left">'.$title.'</a>'.$force_download_html;
 	}
 	else

+ 9 - 9
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())){ ?>
 	<!-- download zipped folder -->
 			<a href="<?php echo api_get_self(); ?>?<?php echo api_get_cidreq();?>&action=downloadfolder"><img src="../img/zip_save.gif" border="0" title="<?php echo get_lang("Save"); ?> (ZIP)" alt="" /></a>
 			<a href="<?php echo api_get_self(); ?>?<?php echo api_get_cidreq();?>&action=downloadfolder"><?php echo get_lang("Save"); ?> (ZIP)</a>&nbsp;
@@ -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 "<a href=\"slideshow.php?".api_get_cidreq()."&curdirpath=".$curdirpathurl."\"><img src=\"../img/images_gallery.gif\" border=\"0\" title=\"".get_lang('ViewSlideshow')."\"/>&nbsp;". get_lang('ViewSlideshow') . "</a>";

+ 1 - 1
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;
 

BIN
main/inc/lib/fckeditor/editor/plugins/asciimath/asciimath.gif


+ 14 - 14
main/inc/lib/fckeditor/editor/plugins/asciimath/lang/es.js

@@ -6,17 +6,17 @@
  * Author:
  */
 
-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' ;

+ 41 - 7
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.

+ 46 - 0
main/inc/lib/fckeditor/toolbars/default/terms_and_conditions.php

@@ -0,0 +1,46 @@
+<?php
+// Dokeos - elearning and course management software
+// See license terms in dokeos/documentation/license.txt
+
+// Training tools
+// Survey
+
+// 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('Style','FontFormat','FontName','FontSize'),
+	array('Bold','Italic','Underline'),
+	array('JustifyLeft','JustifyCenter','JustifyRight')
+);
+
+// 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
+//$config['ToolbarCanCollapse'] = true;
+
+// Sets how the editor's toolbar should start - expanded or collapsed.
+// Possible values: true , false
+//$config['ToolbarStartExpanded'] = true;
+
+//This option sets the location of the toolbar.
+// Possible values: 'In' , 'None' , 'Out:[TargetId]' , 'Out:[TargetWindow]([TargetId])'
+//$config['ToolbarLocation'] = 'In';
+
+// 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.
+// Possible values: true , false
+//$config['BlockCopyPaste'] = false;
+
+// Here new width and height of the editor may be set.
+// Possible values, examples: 300 , '250' , '100%' , ...
+//$config['Width'] = '100%';
+//$config['Height'] = '120';
+?>

+ 6 - 10
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')
 );
 

+ 9 - 9
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.

+ 9 - 9
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.

+ 9 - 9
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.

+ 10 - 9
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.

+ 10 - 12
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.

+ 7 - 10
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.

+ 8 - 9
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.

+ 9 - 7
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

+ 9 - 12
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.

+ 10 - 11
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.

+ 7 - 8
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.

+ 9 - 12
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.

+ 7 - 10
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.

+ 1 - 5
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.

+ 6 - 11
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.

+ 8 - 10
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.

+ 9 - 12
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.

+ 10 - 11
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.

+ 7 - 10
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')
 );
 

+ 9 - 12
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.

+ 8 - 6
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.

+ 7 - 8
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.

+ 6 - 8
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.

+ 6 - 8
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.

+ 7 - 8
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.

+ 6 - 7
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.

+ 41 - 0
main/inc/lib/fckeditor/toolbars/extended/terms_and_conditions.php

@@ -0,0 +1,41 @@
+<?php
+// Dokeos - elearning and course management software
+// See license terms in dokeos/documentation/license.txt
+
+// Training tools
+// Survey
+
+// 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('Style','FontFormat','FontName','FontSize'),
+	array('Bold','Italic','Underline'),
+	array('JustifyLeft','JustifyCenter','JustifyRight')
+);
+
+// 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('Style','FontFormat','FontName','FontSize'),
+	array('Bold','Italic','Underline'),
+	array('JustifyLeft','JustifyCenter','JustifyRight')
+);
+// Sets how the editor's toolbar should start - expanded or collapsed.
+// Possible values: true , false
+//$config['ToolbarStartExpanded'] = true;
+
+//This option sets the location of the toolbar.
+// Possible values: 'In' , 'None' , 'Out:[TargetId]' , 'Out:[TargetWindow]([TargetId])'
+//$config['ToolbarLocation'] = 'In';
+
+// 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.
+// Possible values: true , false
+//$config['BlockCopyPaste'] = false;
+
+// Here new width and height of the editor may be set.
+// Possible values, examples: 300 , '250' , '100%' , ...
+//$config['Width'] = '100%';
+//$config['Height'] = '120';
+?>

+ 1 - 5
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.

+ 9 - 12
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.

+ 1 - 5
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.

+ 1 - 4
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.

+ 9 - 12
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.

+ 7 - 10
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.

+ 6 - 10
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')
 );
 

+ 7 - 10
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.

+ 4 - 4
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))

+ 7 - 7
main/inc/lib/html2pdf/_fpdf/font/courier.php

@@ -1,7 +1,7 @@
-<?php
-for($i=0;$i<=255;$i++)
-	$fpdf_charwidths['courier'][chr($i)]=600;
-$fpdf_charwidths['courierB']=$fpdf_charwidths['courier'];
-$fpdf_charwidths['courierI']=$fpdf_charwidths['courier'];
-$fpdf_charwidths['courierBI']=$fpdf_charwidths['courier'];
-?>
+<?php
+for($i=0;$i<=255;$i++)
+	$fpdf_charwidths['courier'][chr($i)]=600;
+$fpdf_charwidths['courierB']=$fpdf_charwidths['courier'];
+$fpdf_charwidths['courierI']=$fpdf_charwidths['courier'];
+$fpdf_charwidths['courierBI']=$fpdf_charwidths['courier'];
+?>

+ 15 - 15
main/inc/lib/html2pdf/_fpdf/font/helvetica.php

@@ -1,15 +1,15 @@
-<?php
-$fpdf_charwidths['helvetica']=array(
-	chr(0)=>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);
-?>
+<?php
+$fpdf_charwidths['helvetica']=array(
+	chr(0)=>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);
+?>

+ 15 - 15
main/inc/lib/html2pdf/_fpdf/font/helveticab.php

@@ -1,15 +1,15 @@
-<?php
-$fpdf_charwidths['helveticaB']=array(
-	chr(0)=>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);
-?>
+<?php
+$fpdf_charwidths['helveticaB']=array(
+	chr(0)=>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);
+?>

+ 15 - 15
main/inc/lib/html2pdf/_fpdf/font/helveticabi.php

@@ -1,15 +1,15 @@
-<?php
-$fpdf_charwidths['helveticaBI']=array(
-	chr(0)=>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);
-?>
+<?php
+$fpdf_charwidths['helveticaBI']=array(
+	chr(0)=>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);
+?>

+ 15 - 15
main/inc/lib/html2pdf/_fpdf/font/helveticai.php

@@ -1,15 +1,15 @@
-<?php
-$fpdf_charwidths['helveticaI']=array(
-	chr(0)=>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);
-?>
+<?php
+$fpdf_charwidths['helveticaI']=array(
+	chr(0)=>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);
+?>

+ 419 - 419
main/inc/lib/html2pdf/_fpdf/font/makefont/makefont.php

@@ -1,419 +1,419 @@
-<?php
-/*******************************************************************************
-* Utility to generate font definition files
-*
-* Version:	1.14
-* Date:		2008-08-03
-* Author:	Olivier PLATHEY
-*******************************************************************************/
-
-function ReadMap($enc)
-{
-	//Read a map file
-	$file=dirname(__FILE__).'/'.strtolower($enc).'.map';
-	$a=file($file);
-	if(empty($a))
-		die('<b>Error:</b> 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 '<b>Warning:</b> character '.$map[$i].' is missing<br>';
-				$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('<b>Error:</b> 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 '<b>Warning:</b> 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('<b>Error:</b> 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('<b>Error:</b> unrecognized font file extension: '.$ext);
-	}
-	else
-	{
-		if($type!='TrueType' && $type!='Type1')
-			die('<b>Error:</b> incorrect font type: '.$type);
-	}
-	//Start generation
-	$s='<?php'."\n";
-	$s.='$type=\''.$type."';\n";
-	$s.='$name=\''.$fm['FontName']."';\n";
-	$s.='$desc='.$fd.";\n";
-	if(!isset($fm['UnderlinePosition']))
-		$fm['UnderlinePosition']=-100;
-	if(!isset($fm['UnderlineThickness']))
-		$fm['UnderlineThickness']=50;
-	$s.='$up='.$fm['UnderlinePosition'].";\n";
-	$s.='$ut='.$fm['UnderlineThickness'].";\n";
-	$w=MakeWidthArray($fm);
-	$s.='$cw='.$w.";\n";
-	$s.='$enc=\''.$enc."';\n";
-	$s.='$diff=\''.$diff."';\n";
-	$basename=substr(basename($afmfile),0,-4);
-	if($fontfile)
-	{
-		//Embedded font
-		if(!file_exists($fontfile))
-			die('<b>Error:</b> font file not found: '.$fontfile);
-		if($type=='TrueType')
-			CheckTTF($fontfile);
-		$f=fopen($fontfile,'rb');
-		if(!$f)
-			die('<b>Error:</b> 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('<b>Error:</b> 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('<b>Error:</b> 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.')<br>';
-		}
-		else
-		{
-			$s.='$file=\''.basename($fontfile)."';\n";
-			echo '<b>Notice:</b> font file could not be compressed (zlib extension not available)<br>';
-		}
-		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'.')<br>';
-}
-?>
+<?php
+/*******************************************************************************
+* Utility to generate font definition files
+*
+* Version:	1.14
+* Date:		2008-08-03
+* Author:	Olivier PLATHEY
+*******************************************************************************/
+
+function ReadMap($enc)
+{
+	//Read a map file
+	$file=dirname(__FILE__).'/'.strtolower($enc).'.map';
+	$a=file($file);
+	if(empty($a))
+		die('<b>Error:</b> 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 '<b>Warning:</b> character '.$map[$i].' is missing<br>';
+				$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('<b>Error:</b> 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 '<b>Warning:</b> 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('<b>Error:</b> 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('<b>Error:</b> unrecognized font file extension: '.$ext);
+	}
+	else
+	{
+		if($type!='TrueType' && $type!='Type1')
+			die('<b>Error:</b> incorrect font type: '.$type);
+	}
+	//Start generation
+	$s='<?php'."\n";
+	$s.='$type=\''.$type."';\n";
+	$s.='$name=\''.$fm['FontName']."';\n";
+	$s.='$desc='.$fd.";\n";
+	if(!isset($fm['UnderlinePosition']))
+		$fm['UnderlinePosition']=-100;
+	if(!isset($fm['UnderlineThickness']))
+		$fm['UnderlineThickness']=50;
+	$s.='$up='.$fm['UnderlinePosition'].";\n";
+	$s.='$ut='.$fm['UnderlineThickness'].";\n";
+	$w=MakeWidthArray($fm);
+	$s.='$cw='.$w.";\n";
+	$s.='$enc=\''.$enc."';\n";
+	$s.='$diff=\''.$diff."';\n";
+	$basename=substr(basename($afmfile),0,-4);
+	if($fontfile)
+	{
+		//Embedded font
+		if(!file_exists($fontfile))
+			die('<b>Error:</b> font file not found: '.$fontfile);
+		if($type=='TrueType')
+			CheckTTF($fontfile);
+		$f=fopen($fontfile,'rb');
+		if(!$f)
+			die('<b>Error:</b> 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('<b>Error:</b> 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('<b>Error:</b> 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.')<br>';
+		}
+		else
+		{
+			$s.='$file=\''.basename($fontfile)."';\n";
+			echo '<b>Notice:</b> font file could not be compressed (zlib extension not available)<br>';
+		}
+		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'.')<br>';
+}
+?>

+ 15 - 15
main/inc/lib/html2pdf/_fpdf/font/symbol.php

@@ -1,15 +1,15 @@
-<?php
-$fpdf_charwidths['symbol']=array(
-	chr(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);
-?>
+<?php
+$fpdf_charwidths['symbol']=array(
+	chr(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);
+?>

+ 15 - 15
main/inc/lib/html2pdf/_fpdf/font/times.php

@@ -1,15 +1,15 @@
-<?php
-$fpdf_charwidths['times']=array(
-	chr(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,'"'=>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);
-?>
+<?php
+$fpdf_charwidths['times']=array(
+	chr(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,'"'=>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);
+?>

+ 15 - 15
main/inc/lib/html2pdf/_fpdf/font/timesb.php

@@ -1,15 +1,15 @@
-<?php
-$fpdf_charwidths['timesB']=array(
-	chr(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,'"'=>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);
-?>
+<?php
+$fpdf_charwidths['timesB']=array(
+	chr(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,'"'=>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);
+?>

+ 15 - 15
main/inc/lib/html2pdf/_fpdf/font/timesbi.php

@@ -1,15 +1,15 @@
-<?php
-$fpdf_charwidths['timesBI']=array(
-	chr(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,'!'=>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);
-?>
+<?php
+$fpdf_charwidths['timesBI']=array(
+	chr(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,'!'=>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);
+?>

+ 15 - 15
main/inc/lib/html2pdf/_fpdf/font/timesi.php

@@ -1,15 +1,15 @@
-<?php
-$fpdf_charwidths['timesI']=array(
-	chr(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,'"'=>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);
-?>
+<?php
+$fpdf_charwidths['timesI']=array(
+	chr(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,'"'=>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);
+?>

+ 15 - 15
main/inc/lib/html2pdf/_fpdf/font/zapfdingbats.php

@@ -1,15 +1,15 @@
-<?php
-$fpdf_charwidths['zapfdingbats']=array(
-	chr(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);
-?>
+<?php
+$fpdf_charwidths['zapfdingbats']=array(
+	chr(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);
+?>

+ 1736 - 1734
main/inc/lib/html2pdf/_fpdf/fpdf.php

@@ -1,1734 +1,1736 @@
-<?php
-/*******************************************************************************
-* FPDF                                                                         *
-*                                                                              *
-* Version: 1.6                                                                 *
-* Date:    2008-08-03                                                          *
-* Author:  Olivier PLATHEY                                                     *
-*******************************************************************************/
-
-define('FPDF_VERSION','1.6');
-
-class FPDF
-{
-var $page;               //current page number
-var $n;                  //current object number
-var $offsets;            //array of object offsets
-var $buffer;             //buffer holding in-memory PDF
-var $pages;              //array containing pages
-var $state;              //current document state
-var $compress;           //compression flag
-var $k;                  //scale factor (number of points in user unit)
-var $DefOrientation;     //default orientation
-var $CurOrientation;     //current orientation
-var $PageFormats;        //available page formats
-var $DefPageFormat;      //default page format
-var $CurPageFormat;      //current page format
-var $PageSizes;          //array storing non-default page sizes
-var $wPt,$hPt;           //dimensions of current page in points
-var $w,$h;               //dimensions of current page in user unit
-var $lMargin;            //left margin
-var $tMargin;            //top margin
-var $rMargin;            //right margin
-var $bMargin;            //page break margin
-var $cMargin;            //cell margin
-var $x,$y;               //current position in user unit
-var $lasth;              //height of last printed cell
-var $LineWidth;          //line width in user unit
-var $CoreFonts;          //array of standard font names
-var $fonts;              //array of used fonts
-var $FontFiles;          //array of font files
-var $diffs;              //array of encoding differences
-var $FontFamily;         //current font family
-var $FontStyle;          //current font style
-var $underline;          //underlining flag
-var $CurrentFont;        //current font info
-var $FontSizePt;         //current font size in points
-var $FontSize;           //current font size in user unit
-var $DrawColor;          //commands for drawing color
-var $FillColor;          //commands for filling color
-var $TextColor;          //commands for text color
-var $ColorFlag;          //indicates whether fill and text colors are different
-var $ws;                 //word spacing
-var $images;             //array of used images
-var $PageLinks;          //array of links in pages
-var $links;              //array of internal links
-var $AutoPageBreak;      //automatic page breaking
-var $PageBreakTrigger;   //threshold used to trigger page breaks
-var $InHeader;           //flag set when processing header
-var $InFooter;           //flag set when processing footer
-var $ZoomMode;           //zoom display mode
-var $LayoutMode;         //layout display mode
-var $title;              //title
-var $subject;            //subject
-var $author;             //author
-var $keywords;           //keywords
-var $creator;            //creator
-var $AliasNbPages;       //alias for total number of pages
-var $PDFVersion;         //PDF version number
-
-/*******************************************************************************
-*                                                                              *
-*                               Public methods                                 *
-*                                                                              *
-*******************************************************************************/
-function FPDF($orientation='P', $unit='mm', $format='A4')
-{
-	//Some checks
-	$this->_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('<b>FPDF error:</b> '.$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 <</Predictor 15 /Colors '.($ct==2 ? 3 : 1).' /BitsPerComponent '.$bpc.' /Columns '.$w.'>>';
-	//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('<</Type /Page');
-		$this->_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.='<</Type /Annot /Subtype /Link /Rect ['.$rect.'] /Border [0 0 0] ';
-				if(is_string($pl[4]))
-					$annots.='/A <</S /URI /URI '.$this->_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('<</Type /Pages');
-	$kids='/Kids [';
-	for($i=0;$i<$nb;$i++)
-		$kids.=(3+2*$i).' 0 R ';
-	$this->_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('<</Type /Encoding /BaseEncoding /WinAnsiEncoding /Differences ['.$diff.']>>');
-		$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('<</Length '.strlen($font));
-		if($compressed)
-			$this->_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('<</Type /Font');
-			$this->_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('<</Type /Font');
-			$this->_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='<</Type /FontDescriptor /FontName /'.$name;
-			foreach($font['desc'] as $k=>$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('<</Type /XObject');
-		$this->_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<count($info['trns']);$i++)
-				$trns.=$info['trns'][$i].' '.$info['trns'][$i].' ';
-			$this->_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;
-}
-
-?>
+<?php
+/*******************************************************************************
+* FPDF                                                                         *
+*                                                                              *
+* Version: 1.6                                                                 *
+* Date:    2008-08-03                                                          *
+* Author:  Olivier PLATHEY                                                     *
+*******************************************************************************/
+
+define('FPDF_VERSION','1.6');
+
+class FPDF
+{
+var $page;               //current page number
+var $n;                  //current object number
+var $offsets;            //array of object offsets
+var $buffer;             //buffer holding in-memory PDF
+var $pages;              //array containing pages
+var $state;              //current document state
+var $compress;           //compression flag
+var $k;                  //scale factor (number of points in user unit)
+var $DefOrientation;     //default orientation
+var $CurOrientation;     //current orientation
+var $PageFormats;        //available page formats
+var $DefPageFormat;      //default page format
+var $CurPageFormat;      //current page format
+var $PageSizes;          //array storing non-default page sizes
+var $wPt,$hPt;           //dimensions of current page in points
+var $w,$h;               //dimensions of current page in user unit
+var $lMargin;            //left margin
+var $tMargin;            //top margin
+var $rMargin;            //right margin
+var $bMargin;            //page break margin
+var $cMargin;            //cell margin
+var $x,$y;               //current position in user unit
+var $lasth;              //height of last printed cell
+var $LineWidth;          //line width in user unit
+var $CoreFonts;          //array of standard font names
+var $fonts;              //array of used fonts
+var $FontFiles;          //array of font files
+var $diffs;              //array of encoding differences
+var $FontFamily;         //current font family
+var $FontStyle;          //current font style
+var $underline;          //underlining flag
+var $CurrentFont;        //current font info
+var $FontSizePt;         //current font size in points
+var $FontSize;           //current font size in user unit
+var $DrawColor;          //commands for drawing color
+var $FillColor;          //commands for filling color
+var $TextColor;          //commands for text color
+var $ColorFlag;          //indicates whether fill and text colors are different
+var $ws;                 //word spacing
+var $images;             //array of used images
+var $PageLinks;          //array of links in pages
+var $links;              //array of internal links
+var $AutoPageBreak;      //automatic page breaking
+var $PageBreakTrigger;   //threshold used to trigger page breaks
+var $InHeader;           //flag set when processing header
+var $InFooter;           //flag set when processing footer
+var $ZoomMode;           //zoom display mode
+var $LayoutMode;         //layout display mode
+var $title;              //title
+var $subject;            //subject
+var $author;             //author
+var $keywords;           //keywords
+var $creator;            //creator
+var $AliasNbPages;       //alias for total number of pages
+var $PDFVersion;         //PDF version number
+
+/*******************************************************************************
+*                                                                              *
+*                               Public methods                                 *
+*                                                                              *
+*******************************************************************************/
+function FPDF($orientation='P', $unit='mm', $format='A4')
+{
+	//Some checks
+	$this->_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('<b>FPDF error:</b> '.$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 <</Predictor 15 /Colors '.($ct==2 ? 3 : 1).' /BitsPerComponent '.$bpc.' /Columns '.$w.'>>';
+	//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('<</Type /Page');
+		$this->_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.='<</Type /Annot /Subtype /Link /Rect ['.$rect.'] /Border [0 0 0] ';
+				if(is_string($pl[4]))
+					$annots.='/A <</S /URI /URI '.$this->_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('<</Type /Pages');
+	$kids='/Kids [';
+	for($i=0;$i<$nb;$i++)
+		$kids.=(3+2*$i).' 0 R ';
+	$this->_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('<</Type /Encoding /BaseEncoding /WinAnsiEncoding /Differences ['.$diff.']>>');
+		$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('<</Length '.strlen($font));
+		if($compressed)
+			$this->_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('<</Type /Font');
+			$this->_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('<</Type /Font');
+			$this->_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='<</Type /FontDescriptor /FontName /'.$name;
+			foreach($font['desc'] as $k=>$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('<</Type /XObject');
+		$this->_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<count($info['trns']);$i++)
+				$trns.=$info['trns'][$i].' '.$info['trns'][$i].' ';
+			$this->_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;
+}

+ 5 - 5
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.

+ 237 - 238
main/inc/lib/html2pdf/_mypdf/00_fpdf_codebar.class.php

@@ -1,238 +1,237 @@
-<?php
-/*************************************************************************
- * http://www.fpdf.org/en/script/script5.php
- *
- * @author		Olivier
- *
- * This script implements EAN13 and UPC-A barcodes (the second being a particular case of the first one). Bars are drawn directly in the PDF (no image is generated).
- * EAN13(float x, float y, string barcode [, float h [, float w]])
- * x: abscissa of barcode.
- * y: ordinate of barcode.
- * barcode: value of barcode.
- * h: height of barcode. Default value: 16.
- * w: width of a bar. Default value: 0.35.
- *
- * UPC_A(float x, float y, string barcode [, float h [, float w]])
- *
- * Same parameters.
- *
- * An EAN13 barcode is made up of 13 digits, UPC-A of 12 (leading zeroes are added if necessary). The last digit is a check digit; if it's not supplied, it will be automatically computed.
- ************************************************************************/
-
-/*************************************************************************
- * http://www.fpdf.org/en/script/script46.php
- *
- * @author		The-eh
- *
- * This script implements Code 39 barcodes. A Code 39 barcode can encode a string with the following characters: digits (0 to 9), uppercase letters (A to Z) and 8 additional characters (- . space $ / + % *).
- * Code39(float xpos, float ypos, string code [, float baseline [, float height]])
- * xpos: abscissa of barcode
- * ypos: ordinate of barcode
- * code: value of barcode
- * height: bar height
- * baseline: corresponds to the width of a wide bar
- ************************************************************************/
-
-
-if (!defined('__CLASS_FPDF_CODEBAR__'))
-{
-	define('__CLASS_FPDF_CODEBAR__', true);
-
-	require_once(dirname(__FILE__).'/../_fpdf/fpdf.php');
-
-	class FPDF_Codebar extends FPDF
-	{
-		var $footer_param = array();
-
-		function FPDF_Codebar($sens = 'P', $unit = 'mm', $format = 'A4')
-		{
-			$this->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;$i<strlen($code);$i++)
-			{
-				if($code{$i}=='1')
-					$this->Rect($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; $i<strlen($code); $i++){
-				$char = $code{$i};
-				if(!isset($barChar[$char])){
-					$this->Error('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);
-		}
-	}
-}
-?>
+<?php
+/*************************************************************************
+ * http://www.fpdf.org/en/script/script5.php
+ * 
+ * @author		Olivier
+ * 
+ * This script implements EAN13 and UPC-A barcodes (the second being a particular case of the first one). Bars are drawn directly in the PDF (no image is generated).
+ * EAN13(float x, float y, string barcode [, float h [, float w]])
+ * x: abscissa of barcode.
+ * y: ordinate of barcode.
+ * barcode: value of barcode.
+ * h: height of barcode. Default value: 16.
+ * w: width of a bar. Default value: 0.35.
+ * 
+ * UPC_A(float x, float y, string barcode [, float h [, float w]])
+ * 
+ * Same parameters.
+ * 
+ * An EAN13 barcode is made up of 13 digits, UPC-A of 12 (leading zeroes are added if necessary). The last digit is a check digit; if it's not supplied, it will be automatically computed. 
+ ************************************************************************/
+ 
+/*************************************************************************
+ * http://www.fpdf.org/en/script/script46.php
+ * 
+ * @author		The-eh
+ *
+ * This script implements Code 39 barcodes. A Code 39 barcode can encode a string with the following characters: digits (0 to 9), uppercase letters (A to Z) and 8 additional characters (- . space $ / + % *).
+ * Code39(float xpos, float ypos, string code [, float baseline [, float height]])
+ * xpos: abscissa of barcode
+ * ypos: ordinate of barcode
+ * code: value of barcode
+ * height: bar height
+ * baseline: corresponds to the width of a wide bar
+ ************************************************************************/
+
+
+if (!defined('__CLASS_FPDF_CODEBAR__'))
+{
+	define('__CLASS_FPDF_CODEBAR__', true);
+	
+	require_once(dirname(__FILE__).'/../_fpdf/fpdf.php');
+
+	class FPDF_Codebar extends FPDF
+	{
+		var $footer_param = array();
+		
+		function FPDF_Codebar($sens = 'P', $unit = 'mm', $format = 'A4')
+		{
+			$this->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;$i<strlen($code);$i++)
+			{
+				if($code{$i}=='1')
+					$this->Rect($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; $i<strlen($code); $i++){
+				$char = $code{$i};
+				if(!isset($barChar[$char])){
+					$this->Error('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);
+		}
+	}
+}

+ 25 - 26
main/inc/lib/html2pdf/_mypdf/01_fpdf_bookmark.class.php

@@ -1,27 +1,27 @@
 <?php
 /*************************************************************************
  * http://www.fpdf.org/en/script/script1.php
- *
+ * 
  * @author		Olivier
- *
+ * 
  * This extension adds bookmark support. The method to add a bookmark is:
- *
+ * 
  * function Bookmark(string txt [, int level [, float y]])
- *
+ * 
  * txt: the bookmark title.
  * level: the bookmark level (0 is top level, 1 is just below, and so on).
  * y: the y position of the bookmark destination in the current page. -1 means the current position. Default value: 0.
- *
+ * 
  * The title must be encoded in ISO Latin-1.
  ************************************************************************/
 /*************************************************************************
  * http://www.fpdf.org/en/script/script13.php
- *
+ * 
  * @author		Min's
- *
- * This class prints an index from the created bookmarks.
+ * 
+ * This class prints an index from the created bookmarks. 
  ************************************************************************/
-
+ 
 if (!defined('__CLASS_FPDF_BOOKMARK__'))
 {
 	define('__CLASS_FPDF_BOOKMARK__', true);
@@ -32,19 +32,19 @@ require_once(dirname(__FILE__).'/00_fpdf_codebar.class.php');
 	{
 		var $outlines=array();
 		var $OutlineRoot;
-
+		
 		function FPDF_BookMark($orientation='P',$unit='mm',$format='A4')
 		{
 			$this->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);					
 				}
 			}
 		}
 	}
 }
-?>

+ 34 - 35
main/inc/lib/html2pdf/_mypdf/02_fpdf_formulaire.class.php

@@ -1,9 +1,9 @@
 <?php
 /**
  * Logiciel : HTML2PDF - classe FPDF_Formulaire
- *
- * permet la gestion de champs de formulaire dans un PDF
- * Inspir� des sources de http://fpdf.org/fr/script/script36.php et http://fpdf.org/fr/script/script40.php
+ * 
+ * permet la gestion de champs de formulaire dans un PDF 
+ * Inspiré des sources de http://fpdf.org/fr/script/script36.php et http://fpdf.org/fr/script/script40.php
  *
  * @author		Laurent MINGUET <webmaster@spipu.net>
  */
@@ -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 <</JavaScript '.($this->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);
 		}
 	}
 }
-?>

+ 326 - 0
main/inc/lib/html2pdf/_mypdf/03_fpdf_alpha.class.php

@@ -0,0 +1,326 @@
+<?php
+/*************************************************************************
+ * http://staff.dasdeck.de/valentin/fpdf/fpdf_alpha/
+ * 
+ * @author		Valentin Schmidt
+ * 
+ * This script allows to use images (PNGs or JPGs) with alpha-channels.
+ * The alpha-channel can be either supplied as separate 8-bit PNG ("mask"),
+ * or, for PNGs, also an internal alpha-channel can be used.
+ * For the latter, the GD 2.x extension is required.
+ ************************************************************************/
+
+
+if (!defined('__CLASS_FPDF_ALPHA__'))
+{
+	define('__CLASS_FPDF_ALPHA__', true);
+	
+	require_once(dirname(__FILE__).'/02_fpdf_formulaire.class.php');
+	
+	class FPDF_Alpha extends FPDF_Formulaire
+	{
+		var $tmpFiles = array(); 
+		
+		function FPDF_Alpha($orientation='P',$unit='mm',$format='A4')
+		{
+			$this->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('<</Type /XObject');
+				$this->_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<count($info['trns']);$i++)
+					$trns.=$info['trns'][$i].' '.$info['trns'][$i].' ';
+					$this->_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 <</Predictor 15 /Colors '.($ct==2 ? 3 : 1).' /BitsPerComponent '.$bpc.' /Columns '.$w.'>>';
+			//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);
+		} 
+		
+	}
+}

+ 228 - 229
main/inc/lib/html2pdf/_mypdf/99_fpdf_protection.class.php

@@ -1,229 +1,228 @@
-<?php
-/*************************************************************************
- * http://www.fpdf.org/fr/script/script37.php
- *
- * @author		Klemen Vodopivec
- *
- * Ce script permet de prot�ger le PDF, c'est-�-dire emp�cher l'utilisateur de copier son contenu, de l'imprimer ou de le modifier.
- *
- * SetProtection([array permissions [, string user_pass [, string owner_pass]]])
- *
- * permissions : l'ensemble des permissions. Vide par d�faut (seule la lecture est autoris�e).
- * user_pass : mot de passe utilisateur. Vide par d�faut.
- * owner_pass : mot de passe propri�taire. Par d�faut, une valeur al�atoire est choisie.
- *
- * Le tableau des permissions est compos� de valeurs prises parmi les suivantes :
- *		* copy : copie du texte et des images dans le presse-papier
- *		* print : impression du document
- *		* modify : modification (autre ques les annotations et les formulaires)
- *		* annot-forms : ajout d'annotations ou de formulaires
- *
- * Remarque : la protection contre la modification concerne les personnes poss�dant la version compl�te d'Acrobat.
- *
- * Si vous ne sp�cifiez pas de mot de passe, le document s'ouvrira normalement. Si vous indiquez un mot de passe utilisateur,
- * le lecteur de PDF le demandera avant d'afficher le document. Le mot de passe propri�taire, s'il est diff�rent de celui utilisateur,
- * permet d'obtenir l'acc�s complet.
- *
- * Note : prot�ger un document n�cessite de le crypter, ce qui augmente le temps de traitement de mani�re importante.
- * Cela peut dans certains cas entra�ner un time-out au niveau de PHP, en particulier si le document contient des
- * images ou des polices.
- ************************************************************************/
-
-if (!defined('__CLASS_FPDF_PROTECTION__'))
-{
-	define('__CLASS_FPDF_PROTECTION__', true);
-
-	require_once(dirname(__FILE__).'/02_fpdf_formulaire.class.php');
-
-	class FPDF_Protection extends FPDF_Formulaire
-	{
-		var $encrypted;			//whether document is protected
-		var $Uvalue;			//U entry in pdf document
-		var $Ovalue;			//O entry in pdf document
-		var $Pvalue;			//P entry in pdf document
-		var $enc_obj_id;		//encryption object id
-		var $last_rc4_key;		//last RC4 key encrypted (cached for optimisation)
-		var $last_rc4_key_c;	//last RC4 computed key
-
-		function FPDF_Protection($orientation='P',$unit='mm',$format='A4')
-		{
-			$this->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);
-		}
-	}
-}
-?>
+<?php
+/*************************************************************************
+ * http://www.fpdf.org/fr/script/script37.php
+ * 
+ * @author		Klemen Vodopivec
+ * 
+ * Ce script permet de protéger le PDF, c'est-à-dire empêcher l'utilisateur de copier son contenu, de l'imprimer ou de le modifier.
+ * 
+ * SetProtection([array permissions [, string user_pass [, string owner_pass]]])
+ * 
+ * permissions : l'ensemble des permissions. Vide par défaut (seule la lecture est autorisée).
+ * user_pass : mot de passe utilisateur. Vide par défaut.
+ * owner_pass : mot de passe propriétaire. Par défaut, une valeur aléatoire est choisie.
+ * 
+ * Le tableau des permissions est composé de valeurs prises parmi les suivantes :
+ *		* copy : copie du texte et des images dans le presse-papier
+ *		* print : impression du document
+ *		* modify : modification (autre ques les annotations et les formulaires)
+ *		* annot-forms : ajout d'annotations ou de formulaires 
+ * 
+ * Remarque : la protection contre la modification concerne les personnes possédant la version complète d'Acrobat.
+ * 
+ * Si vous ne spécifiez pas de mot de passe, le document s'ouvrira normalement. Si vous indiquez un mot de passe utilisateur,
+ * le lecteur de PDF le demandera avant d'afficher le document. Le mot de passe propriétaire, s'il est différent de celui utilisateur,
+ * permet d'obtenir l'accès complet.
+ * 
+ * Note : protéger un document nécessite de le crypter, ce qui augmente le temps de traitement de manière importante.
+ * Cela peut dans certains cas entraîner un time-out au niveau de PHP, en particulier si le document contient des
+ * images ou des polices.
+ ************************************************************************/
+
+if (!defined('__CLASS_FPDF_PROTECTION__'))
+{
+	define('__CLASS_FPDF_PROTECTION__', true);
+	
+	require_once(dirname(__FILE__).'/03_fpdf_alpha.class.php');
+	
+	class FPDF_Protection extends FPDF_Alpha
+	{
+		var $encrypted;			//whether document is protected
+		var $Uvalue;			//U entry in pdf document
+		var $Ovalue;			//O entry in pdf document
+		var $Pvalue;			//P entry in pdf document
+		var $enc_obj_id;		//encryption object id
+		var $last_rc4_key;		//last RC4 key encrypted (cached for optimisation)
+		var $last_rc4_key_c;	//last RC4 computed key
+	
+		function FPDF_Protection($orientation='P',$unit='mm',$format='A4')
+		{
+			$this->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);
+		}
+	}
+}

+ 502 - 485
main/inc/lib/html2pdf/_mypdf/mypdf.class.php

@@ -1,485 +1,502 @@
-<?php
-/**
- * Logiciel : HTML2PDF - classe MyPDF
- *
- * Convertisseur HTML => PDF, utilise fpdf de Olivier PLATHEY
- * Distribu� sous la licence LGPL.
- *
- * @author		Laurent MINGUET <webmaster@spipu.net>
- * @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<count($points); $i+=2)
-			{
-				$points_string .= sprintf('%.2F %.2F', $points[$i]*$k, ($h-$points[$i+1])*$k);
-				if($i==0)	$points_string .= ' m ';
-				else		$points_string .= ' l ';
-			}
-			$this->_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');
-		}
-	}
-}
-?>
+<?php
+/**
+ * Logiciel : HTML2PDF - classe MyPDF
+ * 
+ * Convertisseur HTML => PDF, utilise fpdf de Olivier PLATHEY 
+ * Distribué sous la licence LGPL. 
+ *
+ * @author		Laurent MINGUET <webmaster@spipu.net>
+ * @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<count($points); $i+=2)
+			{
+				$points_string .= sprintf('%.2F %.2F', $points[$i]*$k, ($h-$points[$i+1])*$k);
+				if($i==0)	$points_string .= ' m ';
+				else		$points_string .= ' l ';
+			}
+			$this->_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;
+		}
+	}
+}

File diff suppressed because it is too large
+ 334 - 197
main/inc/lib/html2pdf/html2pdf.class.php


+ 19 - 19
main/inc/lib/html2pdf/langues/ca.txt

@@ -1,19 +1,19 @@
-err01	L'etiqueta <b>&lt;[[OTHER]]&gt;</b> encara no existeix.<br><br>Si voleu afegir-la, heu de crear els m�todes <b>o_[[OTHER]]</b> (per l'obertura) i <b>c_[[OTHER]]</b> (pel tancament) seguint el model de les etiquetes existents.<br><br>A m�s, si creeu nous m�todes, envieu-ho a webmaster@spipu.net per tal d'afegir-los a les seg�ents versions d'HTML2PDF, i que tothom en pugui gaudir.
-err02	Frase de 1000 l�nies => massa llarga<br><b>Frase :</b> [[OTHER_0]]<br><b>Mida casella :</b> [[OTHER_1]]<br><b>Mida text :</b> [[OTHER_2]]<br>
-err03	Codi HTML no v�lid, una etiqueta t� un tancament de m�s : <b>&lt;[[OTHER]]&gt;</b>
-err04	Codi HTML no v�lid, les etiquetes no estan tancades en l'ordre correcte.<br>Estat : <pre>[[OTHER]]</pre>
-err05	Codi HTML no v�lid, totes les etiquetes han de tenir el seu tancament.<br>Estat : <pre>[[OTHER]]</pre>
-err06	Impossible carregar la imatge <b>[[OTHER]]</b>
-err07	El contenido de una etiqueta TD no encaja en una sola p�gina
-txt01	ERROR n�
-txt02	Fitxer :
-txt03	L�nia :
-pdf01	Document generat el [[date_d]]/[[date_m]]/[[date_y]]
-pdf02	Document generat a les [[date_h]]:[[date_i]]
-pdf03	Document generat el [[date_d]]/[[date_m]]/[[date_y]] a les [[date_h]]:[[date_i]]
-pdf04	P�gina [[current]]/[[nb]]
-pdf05	Els formularis requereixen l'�s de l'Adobe Reader 9
-vue01	ENCABEZAR
-vue02	PEU DE P�GINA
-vue03	P�GINA
-vue04	Visualitzaci�
+err01	L'etiqueta <b>&lt;[[OTHER]]&gt;</b> encara no existeix.<br><br>Si voleu afegir-la, heu de crear els mètodes <b>o_[[OTHER]]</b> (per l'obertura) i <b>c_[[OTHER]]</b> (pel tancament) seguint el model de les etiquetes existents.<br><br>A més, si creeu nous mètodes, envieu-ho a webmaster@spipu.net per tal d'afegir-los a les següents versions d'HTML2PDF, i que tothom en pugui gaudir.
+err02	Frase de 1000 línies => massa llarga<br><b>Frase :</b> [[OTHER_0]]<br><b>Mida casella :</b> [[OTHER_1]]<br><b>Mida text :</b> [[OTHER_2]]<br>
+err03	Codi HTML no vàlid, una etiqueta té un tancament de més : <b>&lt;[[OTHER]]&gt;</b>
+err04	Codi HTML no vàlid, les etiquetes no estan tancades en l'ordre correcte.<br>Estat : <pre>[[OTHER]]</pre>
+err05	Codi HTML no vàlid, totes les etiquetes han de tenir el seu tancament.<br>Estat : <pre>[[OTHER]]</pre>
+err06	Impossible carregar la imatge <b>[[OTHER]]</b>
+err07	El contingut d'una etiqueta TD no quep en una sola pàgina
+txt01	ERROR n°
+txt02	Fitxer :
+txt03	Línia :
+pdf01	Document generat el [[date_d]]/[[date_m]]/[[date_y]]
+pdf02	Document generat a les [[date_h]]:[[date_i]]
+pdf03	Document generat el [[date_d]]/[[date_m]]/[[date_y]] a les [[date_h]]:[[date_i]]
+pdf04	Pàgina [[current]]/[[nb]]
+pdf05	Els formularis requereixen l'ús de l'Adobe Reader 9
+vue01	CAPÇALERA
+vue02	PEU DE PÀGINA
+vue03	PÀGINA
+vue04	Visualització

+ 19 - 0
main/inc/lib/html2pdf/langues/da.txt

@@ -0,0 +1,19 @@
+err01	Tag <b>&lt;[[OTHER]]&gt;</b> endnu ikke eksisterer.<br><br>Hvis du ønsker at tilføje det, skal du oprette de metoder <b>o_[[OTHER]]</b> (for åbning) og <b>c_[[OTHER]]</b> (for lukning) ved at følge den model af eksisterende tags.<br><br>Hvis du opretter disse metoder, så tøv ikke med at send mig en e-mail til webmaster@spipu.net til indsat dem i den næste version af HTML2PDF.
+err02	Sætning af 1000 lines => er for lang<br><b>sætning :</b> [[OTHER_0]]<br><b>Bredde boksen :</b> [[OTHER_1]]<br><b>Længde tekst :</b> [[OTHER_2]]<br>
+err03	HTML-kode er ugyldig, et tag er lukket for mange gange: <b>&lt;[[OTHER]]&gt;</b>
+err04	HTML-kode er ugyldig, tags er ikke afsluttet på en ordentlig måde.<br>Status : <pre>[[OTHER]]</pre>
+err05	HTML-kode er ugyldig, alle tags skal lukkes. <br>Status : <pre>[[OTHER]]</pre>
+err06	Umuligt at indlæse billedet <b>[[OTHER]]</b>
+err07	Indholdet af en TD tag ikke passer på én side
+txt01	FEJL n°
+txt02	File :
+txt03	Linje :
+pdf01	Siden oprettet d. [[date_y]]-[[date_m]]-[[date_d]]
+pdf02	Siden oprettet d. [[date_h]]:[[date_i]]
+pdf03	Siden oprettet d. [[date_y]]-[[date_m]]-[[date_d]] at [[date_h]]:[[date_i]]
+pdf04	Side [[current]]/[[nb]]
+pdf05	De formularer kræver brug af Adobe Reader 9
+vue01	HEADER
+vue02	FOOTER
+vue03	PAGE
+vue04	View

+ 19 - 19
main/inc/lib/html2pdf/langues/de.txt

@@ -1,19 +1,19 @@
-err01	Das Tag <b>&lt;[[OTHER]]&gt;</b> existiert noch nicht.<br><br>Wenn Sie es hinzuf�gen m�chten, sollen Sie die Methoden<b>o_[[OTHER]]</b> (zu �ffnen) und <b>c_[[OTHER]]</b> (zu schlie�en) nach dem Modell den existierenden Tags.<br><br>Wenn Sie diese Methoden au�erdem aufbauen, bitte teilen Sie sie duch eine E-Mail an meine Adresse : webmaster@spipu.net, so da� sie k�nftig in die n�chste Version von HTML2PDF erscheinen.
-err02	1000-Linien Satz => zu lang<br><b>Satz :</b> [[OTHER_0]]<br><b>Breite des Eingabefelds :</b> [[OTHER_1]]<br><b>L�nge des Texts :</b> [[OTHER_2]]<br>
-err03	Falsches HTML Code, �berz�hliges geschlo�ene Tag : <b>&lt;[[OTHER]]&gt;</b>
-err04	Falsches HTML Code, die Tags sind nicht in richtiger Ordnung geschlo�en.<br>Status : <pre>[[OTHER]]</pre>
-err05	Falsches HTML Code, alle Tags sollen geschlo�en sein.<br>Status : <pre>[[OTHER]]</pre>
-err06	Ladung des Bilds unm�glich <b>[[OTHER]]</b>
-err07	Er Inhalt eines TD-Tag passt nicht nur auf einer Seite
-txt01	Fehler n�
-txt02	Datei :
-txt03	Linie :
-pdf01	Datei aufgebaut am [[date_d]]/[[date_m]]/[[date_y]]
-pdf02	Datei aufgebaut um [[date_h]]:[[date_m]]
-pdf03	Datei aufgebaut am [[date_d]]/[[date_m]]/[[date_y]] um [[date_h]]:[[date_i]]
-pdf04	Seite [[current]]/[[nb]]
-pdf05	Die Formulare ben�tigen Sie den Adobe Reader 9
-vue01	Seite-Header
-vue02	Fu�zeile
-vue03	Seite
-vue04	Visualisierung
+err01	Das Tag <b>&lt;[[OTHER]]&gt;</b> existiert noch nicht.<br><br>Wenn Sie es hinzufügen möchten, sollen Sie die Methoden<b>o_[[OTHER]]</b> (zu öffnen) und <b>c_[[OTHER]]</b> (zu schließen) nach dem Modell den existierenden Tags.<br><br>Wenn Sie diese Methoden außerdem aufbauen, bitte teilen Sie sie duch eine E-Mail an meine Adresse : webmaster@spipu.net, so daß sie künftig in die nächste Version von HTML2PDF erscheinen.
+err02	1000-Linien Satz => zu lang<br><b>Satz :</b> [[OTHER_0]]<br><b>Breite des Eingabefelds :</b> [[OTHER_1]]<br><b>Länge des Texts :</b> [[OTHER_2]]<br>
+err03	Falsches HTML Code, überzähliges geschloßene Tag : <b>&lt;[[OTHER]]&gt;</b>
+err04	Falsches HTML Code, die Tags sind nicht in richtiger Ordnung geschloßen.<br>Status : <pre>[[OTHER]]</pre>
+err05	Falsches HTML Code, alle Tags sollen geschloßen sein.<br>Status : <pre>[[OTHER]]</pre>
+err06	Ladung des Bilds unmöglich <b>[[OTHER]]</b>
+err07	Er Inhalt eines TD-Tag passt nicht nur auf einer Seite
+txt01	Fehler n°
+txt02	Datei :
+txt03	Linie :
+pdf01	Datei aufgebaut am [[date_d]]/[[date_m]]/[[date_y]]
+pdf02	Datei aufgebaut um [[date_h]]:[[date_m]]
+pdf03	Datei aufgebaut am [[date_d]]/[[date_m]]/[[date_y]] um [[date_h]]:[[date_i]]
+pdf04	Seite [[current]]/[[nb]]
+pdf05	Die Formulare benötigen Sie den Adobe Reader 9
+vue01	Seite-Header
+vue02	Fußzeile
+vue03	Seite
+vue04	Visualisierung

+ 19 - 19
main/inc/lib/html2pdf/langues/en.txt

@@ -1,19 +1,19 @@
-err01	The tag <b>&lt;[[OTHER]]&gt;</b> does not yet exist.<br><br>If you want to add it, you must create the methods <b>o_[[OTHER]]</b> (for opening) and <b>c_[[OTHER]]</b> (for closure) by following the model of existing tags.<br><br>If you create these methods, do not hesitate to send me an email to webmaster@spipu.net to included them in the next version of HTML2PDF.
-err02	Sentence of 1000 lines => too long<br><b>Sentence :</b> [[OTHER_0]]<br><b>Width box :</b> [[OTHER_1]]<br><b>Length text :</b> [[OTHER_2]]<br>
-err03	HTML code invalid, a tag is closed too many times: <b>&lt;[[OTHER]]&gt;</b>
-err04	HTML code invalid, the tags are not closed in an orderly fashion.<br>Status : <pre>[[OTHER]]</pre>
-err05	HTML code invalid, all tags must be closed.<br>Status : <pre>[[OTHER]]</pre>
-err06	Impossible to load the image <b>[[OTHER]]</b>
-err07	The content of a TD tag does not fit on only one page
-txt01	ERROR n�
-txt02	File :
-txt03	Line :
-pdf01	Document generated on [[date_y]]-[[date_m]]-[[date_d]]
-pdf02	Document generated at [[date_h]]:[[date_i]]
-pdf03	Document generated on [[date_y]]-[[date_m]]-[[date_d]] at [[date_h]]:[[date_i]]
-pdf04	Page [[current]]/[[nb]]
-pdf05	The forms require the use of Adobe Reader 9
-vue01	HEADER
-vue02	FOOTER
-vue03	PAGE
-vue04	View
+err01	The tag <b>&lt;[[OTHER]]&gt;</b> does not yet exist.<br><br>If you want to add it, you must create the methods <b>o_[[OTHER]]</b> (for opening) and <b>c_[[OTHER]]</b> (for closure) by following the model of existing tags.<br><br>If you create these methods, do not hesitate to send me an email to webmaster@spipu.net to included them in the next version of HTML2PDF.
+err02	Sentence of 1000 lines => too long<br><b>Sentence :</b> [[OTHER_0]]<br><b>Width box :</b> [[OTHER_1]]<br><b>Length text :</b> [[OTHER_2]]<br>
+err03	HTML code invalid, a tag is closed too many times: <b>&lt;[[OTHER]]&gt;</b>
+err04	HTML code invalid, the tags are not closed in an orderly fashion.<br>Status : <pre>[[OTHER]]</pre>
+err05	HTML code invalid, all tags must be closed.<br>Status : <pre>[[OTHER]]</pre>
+err06	Impossible to load the image <b>[[OTHER]]</b>
+err07	The content of a TD tag does not fit on only one page
+txt01	ERROR n°
+txt02	File :
+txt03	Line :
+pdf01	Document generated on [[date_y]]-[[date_m]]-[[date_d]]
+pdf02	Document generated at [[date_h]]:[[date_i]]
+pdf03	Document generated on [[date_y]]-[[date_m]]-[[date_d]] at [[date_h]]:[[date_i]]
+pdf04	Page [[current]]/[[nb]]
+pdf05	The forms require the use of Adobe Reader 9
+vue01	HEADER
+vue02	FOOTER
+vue03	PAGE
+vue04	View

+ 19 - 19
main/inc/lib/html2pdf/langues/es.txt

@@ -1,19 +1,19 @@
-err01	La etiqueta <b>&lt;[[OTHER]]&gt;</b> todav�a no existe.<br><br>Si quiere a�adirla, debe crear los m�todos <b>o_[[OTHER]]</b> (para la apertura) y <b>c_[[OTHER]]</b> (para el cierre) siguiendo el modelo de las etiquetas existentes.<br><br>Si crea nuevos m�todos, env�elos a webmaster@spipu.net para a�adirlos a las siguientes versiones de HTML2PDF, y que todo el mundo se pueda beneficiar.
-err02	Frase de 1000 l�neas => demasiado larga<br><b>Frase :</b> [[OTHER_0]]<br><b>Tama�o casilla :</b> [[OTHER_1]]<br><b>Tama�o texto :</b> [[OTHER_2]]<br>
-err03	C�digo HTML no v�lido, una etiqueta tiene un cierre de m�s : <b>&lt;[[OTHER]]&gt;</b>
-err04	C�digo HTML no v�lido, las etiquetas no estan cerradas en el orden correcto.<br>Estado : <pre>[[OTHER]]</pre>
-err05	C�digo HTML no v�lido, todas las etiquetas deben tener su cierre.<br>Estado : <pre>[[OTHER]]</pre>
-err06	Imposible cargar la imagen <b>[[OTHER]]</b>
-err07	El contenido de una etiqueta TD no encaja en una sola p�gina
-txt01	ERROR n�
-txt02	Fichero :
-txt03	L�nea :
-pdf01	Documento generado el [[date_d]]/[[date_m]]/[[date_y]]
-pdf02	Documento generado a las [[date_h]]:[[date_i]]
-pdf03	Documento generado el [[date_d]]/[[date_m]]/[[date_y]] a las [[date_h]]:[[date_i]]
-pdf04	P�gina [[current]]/[[nb]]
-pdf05	Los formularios requieren el uso de Adobe Reader 9
-vue01	ENCABEZADO
-vue02	PIE DE P�GINA
-vue03	P�GINA
-vue04	Visualizaci�n
+err01	La etiqueta <b>&lt;[[OTHER]]&gt;</b> todavía no existe.<br><br>Si quiere añadirla, debe crear los métodos <b>o_[[OTHER]]</b> (para la apertura) y <b>c_[[OTHER]]</b> (para el cierre) siguiendo el modelo de las etiquetas existentes.<br><br>Si crea nuevos métodos, envíelos a webmaster@spipu.net para añadirlos a las siguientes versiones de HTML2PDF, y que todo el mundo se pueda beneficiar.
+err02	Frase de 1000 líneas => demasiado larga<br><b>Frase :</b> [[OTHER_0]]<br><b>Tamaño casilla :</b> [[OTHER_1]]<br><b>Tamaño texto :</b> [[OTHER_2]]<br>
+err03	Código HTML no válido, una etiqueta tiene un cierre de más : <b>&lt;[[OTHER]]&gt;</b>
+err04	Código HTML no válido, las etiquetas no estan cerradas en el orden correcto.<br>Estado : <pre>[[OTHER]]</pre>
+err05	Código HTML no válido, todas las etiquetas deben tener su cierre.<br>Estado : <pre>[[OTHER]]</pre>
+err06	Imposible cargar la imagen <b>[[OTHER]]</b>
+err07	El contenido de una etiqueta TD no encaja en una sola página
+txt01	ERROR n°
+txt02	Fichero :
+txt03	Línea :
+pdf01	Documento generado el [[date_d]]/[[date_m]]/[[date_y]]
+pdf02	Documento generado a las [[date_h]]:[[date_i]]
+pdf03	Documento generado el [[date_d]]/[[date_m]]/[[date_y]] a las [[date_h]]:[[date_i]]
+pdf04	Página [[current]]/[[nb]]
+pdf05	Los formularios requieren el uso de Adobe Reader 9
+vue01	ENCABEZADO
+vue02	PIE DE PÁGINA
+vue03	PÁGINA
+vue04	Visualización

+ 19 - 19
main/inc/lib/html2pdf/langues/fr.txt

@@ -1,19 +1,19 @@
-err01	La balise <b>&lt;[[OTHER]]&gt;</b> n'existe pas encore.<br><br>Si vous voulez la rajouter, vous devez cr�er les m�thodes <b>o_[[OTHER]]</b> (pour l'ouverture) et <b>c_[[OTHER]]</b> (pour la fermeture) en suivant le mod�le des balises existantes.<br><br>De plus, si vous cr�ez ces m�thodes, n'h�sitez pas � en faire profiter tout le monde en m'�crivant sur webmaster@spipu.net afin qu'elles se retrouvent dans la prochaine version d'HTML2PDF.
-err02	Phrase de 1000 lignes => trop long<br><b>Phrase :</b> [[OTHER_0]]<br><b>Largeur case :</b> [[OTHER_1]]<br><b>Longueur text :</b> [[OTHER_2]]<br>
-err03	Code HTML non valide, une balise est ferm�e en trop : <b>&lt;[[OTHER]]&gt;</b>
-err04	Code HTML non valide, les balises ne sont pas ferm�es dans le bon ordre.<br>Etat : <pre>[[OTHER]]</pre>
-err05	Code HTML non valide, toutes les balises doivent �tre ferm�es.<br>Etat : <pre>[[OTHER]]</pre>
-err06	Impossible de charger l'image <b>[[OTHER]]</b>
-err07	le contenu d'une balise TD ne rentre pas sur une seule page
-txt01	ERREUR n�
-txt02	Fichier :
-txt03	Ligne :
-pdf01	Document g�n�r� le [[date_d]]/[[date_m]]/[[date_y]]
-pdf02	Document g�n�r� � [[date_h]]:[[date_i]]
-pdf03	Document g�n�r� le [[date_d]]/[[date_m]]/[[date_y]] � [[date_h]]:[[date_i]]
-pdf04	Page [[current]]/[[nb]]
-pdf05	Les formulaires n�cessitent  l'utilisation de Adobe Reader 9
-vue01	HEADER
-vue02	FOOTER
-vue03	PAGE
-vue04	Restitution
+err01	La balise <b>&lt;[[OTHER]]&gt;</b> n'existe pas encore.<br><br>Si vous voulez la rajouter, vous devez créer les méthodes <b>o_[[OTHER]]</b> (pour l'ouverture) et <b>c_[[OTHER]]</b> (pour la fermeture) en suivant le modèle des balises existantes.<br><br>De plus, si vous créez ces méthodes, n'hésitez pas à en faire profiter tout le monde en m'écrivant sur webmaster@spipu.net afin qu'elles se retrouvent dans la prochaine version d'HTML2PDF.
+err02	Phrase de 1000 lignes => trop long<br><b>Phrase :</b> [[OTHER_0]]<br><b>Largeur case :</b> [[OTHER_1]]<br><b>Longueur text :</b> [[OTHER_2]]<br>
+err03	Code HTML non valide, une balise est fermée en trop : <b>&lt;[[OTHER]]&gt;</b>
+err04	Code HTML non valide, les balises ne sont pas fermées dans le bon ordre.<br>Etat : <pre>[[OTHER]]</pre>
+err05	Code HTML non valide, toutes les balises doivent être fermées.<br>Etat : <pre>[[OTHER]]</pre>
+err06	Impossible de charger l'image <b>[[OTHER]]</b>
+err07	le contenu d'une balise TD ne rentre pas sur une seule page
+txt01	ERREUR n°
+txt02	Fichier :
+txt03	Ligne :
+pdf01	Document généré le [[date_d]]/[[date_m]]/[[date_y]]
+pdf02	Document généré à [[date_h]]:[[date_i]]
+pdf03	Document généré le [[date_d]]/[[date_m]]/[[date_y]] à [[date_h]]:[[date_i]]
+pdf04	Page [[current]]/[[nb]]
+pdf05	Les formulaires nécessitent  l'utilisation de Adobe Reader 9
+vue01	HEADER
+vue02	FOOTER
+vue03	PAGE
+vue04	Restitution

+ 19 - 19
main/inc/lib/html2pdf/langues/it.txt

@@ -1,19 +1,19 @@
-err01	Il tag <b>&lt;[[OTHER]]&gt;</b> non esiste ancora.<br><br>Se si desidera aggiungere, � necessario creare metodi <b>o_[[OTHER]]</b> (di apertura) e <b>C_[[OTHER]]</b> (per la chiusura) secondo il modello esistente di tag.<br><br>Inoltre, se si creare questi metodi, non esitate a portare il mondo intero ha scritto su webmaster@spipu.net in modo che alla fine nella prossima versione di HTML2PDF.
-err02	Citazione di 1000 linee => troppo lungo<br><b>frase :</b> [[OTHER_0]]<br><b>casella Larghezza :</b> [[OTHER_1]]<br><b>Lunghezza testo :</b> [[OTHER_2]]<br>
-err03	HTML non valido, un tag � chiusa troppo <b>&lt;[[OTHER]]&gt;</ b>
-err04	HTML non validi, i tag non sono chiusi nel corretto ordine.<br>Stato :<pre>[[OTHER]]</pre>
-err05	HTML non valido, tutte le tag deve essere chiuso.<br>Stato :<pre>[[OTHER]]</pre>
-err06	Impossibile caricare l'immagine <b>[[OTHER]]</b>
-err07	il contenuto di un tag TD non rientra in una sola pagina
-txt01	ERRORE n�
-txt02	File :
-txt03	Linea :
-pdf01	Documento generato il [[date_d]]/[[date_m]]/[[date_y]]
-pdf02	Documento generato [[date_h]]:[[date_i]]
-pdf03	Documento generato il [[date_d]]/[[date_m]]/[[date_y]] nel [[date_h]]:[[date_i]]
-pdf04	Pagina [[current]]/[[nb]]
-pdf05	I moduli richiedono l'uso di Adobe Reader 9
-vue01	HEADER
-vue02	FOOTER
-vue03	PAGINA
-vue04	Visualization
+err01	Il tag <b>&lt;[[OTHER]]&gt;</b> non esiste ancora.<br><br>Se si desidera aggiungere, è necessario creare metodi <b>o_[[OTHER]]</b> (di apertura) e <b>C_[[OTHER]]</b> (per la chiusura) secondo il modello esistente di tag.<br><br>Inoltre, se si creare questi metodi, non esitate a portare il mondo intero ha scritto su webmaster@spipu.net in modo che alla fine nella prossima versione di HTML2PDF.
+err02	Citazione di 1000 linee => troppo lungo<br><b>frase :</b> [[OTHER_0]]<br><b>casella Larghezza :</b> [[OTHER_1]]<br><b>Lunghezza testo :</b> [[OTHER_2]]<br>
+err03	HTML non valido, un tag è chiusa troppo <b>&lt;[[OTHER]]&gt;</ b>
+err04	HTML non validi, i tag non sono chiusi nel corretto ordine.<br>Stato :<pre>[[OTHER]]</pre>
+err05	HTML non valido, tutte le tag deve essere chiuso.<br>Stato :<pre>[[OTHER]]</pre>
+err06	Impossibile caricare l'immagine <b>[[OTHER]]</b>
+err07	il contenuto di un tag TD non rientra in una sola pagina
+txt01	ERRORE n°
+txt02	File :
+txt03	Linea :
+pdf01	Documento generato il [[date_d]]/[[date_m]]/[[date_y]]
+pdf02	Documento generato [[date_h]]:[[date_i]]
+pdf03	Documento generato il [[date_d]]/[[date_m]]/[[date_y]] nel [[date_h]]:[[date_i]]
+pdf04	Pagina [[current]]/[[nb]]
+pdf05	I moduli richiedono l'uso di Adobe Reader 9
+vue01	HEADER
+vue02	FOOTER
+vue03	PAGINA
+vue04	Visualization

+ 19 - 19
main/inc/lib/html2pdf/langues/nl.txt

@@ -1,19 +1,19 @@
-err01	De tag <b>&lt;[[OTHER]]&gt;</b> bestaat nog niet.<br><br>Om deze toe te voegen, gebruik de methods <b>o_[[OTHER]]</b> (om te openen) en <b>c_[[OTHER]]</b> (om te sluiten) volgens het model van de bestaande tags.<br><br>Als u deze methods maakt, stuur deze dan a.u.b. via e-mail naar webmaster@spipu.net voor opname in de volgende versie van HTML2PDF.
-err02	Zin van 1000 regels => te lang<br><b>Zin :</b> [[OTHER_0]]<br><b>Kaderbreedte :</b> [[OTHER_1]]<br><b>Tekstlengte :</b> [[OTHER_2]]<br>
-err03	Ongeldige HTML code, overvloedig afgesloten tag : <b>&lt;[[OTHER]]&gt;</b>
-err04	Ongeldige HTML code, de tags zijn niet correct afgesloten.<br>Status : <pre>[[OTHER]]</pre>
-err05	Ongeldige HTML code, alle tags dienen te zijn gesloten.<br>Status : <pre>[[OTHER]]</pre>
-err06	Kan afbeelding niet laden: <b>[[OTHER]]</b>
-err07	De inhoud van de cel (<TD>) past niet op een pagina
-txt01	Fout nr
-txt02	Bestand :
-txt03	Regel :
-pdf01	Document gemaakt op [[date_d]]-[[date_m]]-[[date_y]]
-pdf02	Document gemaakt om [[date_h]]:[[date_i]]
-pdf03	Document gemaakt op [[date_d]]-[[date_m]]-[[date_y]] om [[date_h]]:[[date_i]]
-pdf04	Pagina [[current]] van [[nb]]
-pdf05	De formulieren vereisen het gebruik van Adobe Reader 9
-vue01	Paginakop
-vue02	Paginavoet
-vue03	Pagina
-vue04	Bekijken
+err01	De tag <b>&lt;[[OTHER]]&gt;</b> bestaat nog niet.<br><br>Om deze toe te voegen, gebruik de methods <b>o_[[OTHER]]</b> (om te openen) en <b>c_[[OTHER]]</b> (om te sluiten) volgens het model van de bestaande tags.<br><br>Als u deze methods maakt, stuur deze dan a.u.b. via e-mail naar webmaster@spipu.net voor opname in de volgende versie van HTML2PDF.
+err02	Zin van 1000 regels => te lang<br><b>Zin :</b> [[OTHER_0]]<br><b>Kaderbreedte :</b> [[OTHER_1]]<br><b>Tekstlengte :</b> [[OTHER_2]]<br>
+err03	Ongeldige HTML code, overvloedig afgesloten tag : <b>&lt;[[OTHER]]&gt;</b>
+err04	Ongeldige HTML code, de tags zijn niet correct afgesloten.<br>Status : <pre>[[OTHER]]</pre>
+err05	Ongeldige HTML code, alle tags dienen te zijn gesloten.<br>Status : <pre>[[OTHER]]</pre>
+err06	Kan afbeelding niet laden: <b>[[OTHER]]</b>
+err07	De inhoud van de cel (<TD>) past niet op een pagina
+txt01	Fout nr
+txt02	Bestand :
+txt03	Regel :
+pdf01	Document gemaakt op [[date_d]]-[[date_m]]-[[date_y]]
+pdf02	Document gemaakt om [[date_h]]:[[date_i]]
+pdf03	Document gemaakt op [[date_d]]-[[date_m]]-[[date_y]] om [[date_h]]:[[date_i]]
+pdf04	Pagina [[current]] van [[nb]]
+pdf05	De formulieren vereisen het gebruik van Adobe Reader 9
+vue01	Paginakop
+vue02	Paginavoet
+vue03	Pagina
+vue04	Bekijken

+ 19 - 19
main/inc/lib/html2pdf/langues/pt.txt

@@ -1,19 +1,19 @@
-err01	A tag <b>&lt;[[OTHER]]&gt;</b> ainda n�o existe.<br><br>Se voc� quer inser�-la, deve criar os m�todos <b>o_[[OTHER]]</b> (para abr�-la) e <b>c_[[OTHER]]</b> (para fech�-la) seguindo o modelo das tags existentes.<br><br>Se voc� criar novos m�todos, os envie para webmaster@spipu.net para que as pr�ximas vers�es de HTML2PDF, e o restante do mundo se beneficie com isso.
-err02	Frase de 1000 linhas => muito grande<br><b>Frase :</b> [[OTHER_0]]<br><b>Tamanho do quadro :</b> [[OTHER_1]]<br><b>Tamanho do texto :</b> [[OTHER_2]]<br>
-err03	C�digo HTML n�o v�lido, uma tag est� com fechamento sobrando : <b>&lt;[[OTHER]]&gt;</b>
-err04	C�digo HTML n�o v�lido, as tags n�o est�o fechadas na ordem correta.<br>Estado : <pre>[[OTHER]]</pre>
-err05	C�digo HTML n�o v�lido, todas as tags devem ser fechadas.<br>Estado : <pre>[[OTHER]]</pre>
-err06	Imposs�vel carregar imagem <b>[[OTHER]]</b>
-err07	O conte�do de uma tag TD n�o se encaixa em apenas uma p�gina
-txt01	ERRO n�
-txt02	Arquivo :
-txt03	Linha :
-pdf01	Documento generado em [[date_d]]/[[date_m]]/[[date_y]]
-pdf02	Documento generado �s [[date_h]]:[[date_i]]
-pdf03	Documento generado em [[date_d]]/[[date_m]]/[[date_y]] �s [[date_h]]:[[date_i]]
-pdf04	P�gina [[current]]/[[nb]]
-pdf05	Os formul�rios exigem a utiliza��o do Adobe Reader 9
-vue01	CABE�ALHO
-vue02	RODAP�
-vue03	P�GINA
-vue04	Visualiza��o
+err01	A tag <b>&lt;[[OTHER]]&gt;</b> ainda não existe.<br><br>Se você quer inserí-la, deve criar os métodos <b>o_[[OTHER]]</b> (para abrí-la) e <b>c_[[OTHER]]</b> (para fechá-la) seguindo o modelo das tags existentes.<br><br>Se você criar novos métodos, os envie para webmaster@spipu.net para que as próximas versões de HTML2PDF, e o restante do mundo se beneficie com isso.
+err02	Frase de 1000 linhas => muito grande<br><b>Frase :</b> [[OTHER_0]]<br><b>Tamanho do quadro :</b> [[OTHER_1]]<br><b>Tamanho do texto :</b> [[OTHER_2]]<br>
+err03	Código HTML não válido, uma tag está com fechamento sobrando : <b>&lt;[[OTHER]]&gt;</b>
+err04	Código HTML não válido, as tags não estão fechadas na ordem correta.<br>Estado : <pre>[[OTHER]]</pre>
+err05	Código HTML não válido, todas as tags devem ser fechadas.<br>Estado : <pre>[[OTHER]]</pre>
+err06	Impossível carregar imagem <b>[[OTHER]]</b>
+err07	O conteúdo de uma tag TD não se encaixa em apenas uma página
+txt01	ERRO n°
+txt02	Arquivo :
+txt03	Linha :
+pdf01	Documento generado em [[date_d]]/[[date_m]]/[[date_y]]
+pdf02	Documento generado às [[date_h]]:[[date_i]]
+pdf03	Documento generado em [[date_d]]/[[date_m]]/[[date_y]] às [[date_h]]:[[date_i]]
+pdf04	Página [[current]]/[[nb]]
+pdf05	Os formulários exigem a utilização do Adobe Reader 9
+vue01	CABEÇALHO
+vue02	RODAPÉ
+vue03	PÁGINA
+vue04	Visualização

+ 19 - 19
main/inc/lib/html2pdf/langues/tr.txt

@@ -1,19 +1,19 @@
-err01	<b>&lt;[[OTHER]]&gt;</b> etiketi bulunamad�.<br><br>Eklemek isterseniz, <b>o_[[OTHER]]</b> �eklinde a��p, <b>c_[[OTHER]]</b> �eklinde kapatabilirsiniz.<br><br> Bu �ekilde etiketler �retirseniz l�tfen daha sonraki HTML2PDF versiyonuna eklenmek �zere bana g�nderin. ( webmaster@spipu.net ).
-err02	��erik 1000 sat�rdan fazla ve gerekenden uzun <br><b>Konu :</b> [[OTHER_0]]<br><b>Geni�lik :</b> [[OTHER_1]]<br><b>Yaz� boyutu :</b> [[OTHER_2]]<br>
-err03	HTML kodu hatal�, etiket birden fazla defa kapat�lm��: <b>&lt;[[OTHER]]&gt;</b>
-err04	HTML kodu hatal�, etiketler gereken d�zen i�inde kapat�lmam��.<br>Durum : <pre>[[OTHER]]</pre>
-err05	HTML kodu hatal�, b�t�n etiketler kapat�lmal�.<br>Durum : <pre>[[OTHER]]</pre>
-err06	Resim dosyas� okunam�yor <b>[[OTHER]]</b>
-err07	TD i�eri�i bir sayfaya s��m�yor
-txt01	HATA n�
-txt02	Dosya :
-txt03	Sat�r :
-pdf01	Dok�man �retilme tarihi [[date_y]]-[[date_m]]-[[date_d]]
-pdf02	Dok�man �retilme tarihi [[date_h]]:[[date_i]]
-pdf03	Dok�man �retilme tarihi [[date_y]]-[[date_m]]-[[date_d]] saati [[date_h]]:[[date_i]]
-pdf04	Sayfa [[current]]/[[nb]]
-pdf05	Adobe Reader 9 gerektirir
-vue01	DOSYA �ST�
-vue02	DOSYA ALTI
-vue03	SAYFA
-vue04	G�r�n�
+err01	<b>&lt;[[OTHER]]&gt;</b> etiketi bulunamadı.<br><br>Eklemek isterseniz, <b>o_[[OTHER]]</b> şeklinde açıp, <b>c_[[OTHER]]</b> şeklinde kapatabilirsiniz.<br><br> Bu şekilde etiketler üretirseniz lütfen daha sonraki HTML2PDF versiyonuna eklenmek üzere bana gönderin. ( webmaster@spipu.net ).
+err02	İçerik 1000 satırdan fazla ve gerekenden uzun <br><b>Konu :</b> [[OTHER_0]]<br><b>Genişlik :</b> [[OTHER_1]]<br><b>Yazı boyutu :</b> [[OTHER_2]]<br>
+err03	HTML kodu hatalı, etiket birden fazla defa kapatılmış: <b>&lt;[[OTHER]]&gt;</b>
+err04	HTML kodu hatalı, etiketler gereken düzen içinde kapatılmamış.<br>Durum : <pre>[[OTHER]]</pre>
+err05	HTML kodu hatalı, bütün etiketler kapatılmalı.<br>Durum : <pre>[[OTHER]]</pre>
+err06	Resim dosyası okunamıyor <b>[[OTHER]]</b>
+err07	TD içeriği bir sayfaya sığmıyor
+txt01	HATA n°
+txt02	Dosya :
+txt03	Satır :
+pdf01	Doküman üretilme tarihi [[date_y]]-[[date_m]]-[[date_d]]
+pdf02	Doküman üretilme tarihi [[date_h]]:[[date_i]]
+pdf03	Doküman üretilme tarihi [[date_y]]-[[date_m]]-[[date_d]] saati [[date_h]]:[[date_i]]
+pdf04	Sayfa [[current]]/[[nb]]
+pdf05	Adobe Reader 9 gerektirir
+vue01	DOSYA ÜSTÜ
+vue02	DOSYA ALTI
+vue03	SAYFA
+vue04	Görünüm

+ 440 - 421
main/inc/lib/html2pdf/parsingHTML.class.php

@@ -1,421 +1,440 @@
-<?php
-/**
- * Logiciel : HTML2PDF - classe ParsingHTML
- *
- * Convertisseur HTML => PDF, utilise fpdf de Olivier PLATHEY
- * Distribu� sous la licence LGPL.
- *
- * @author		Laurent MINGUET <webmaster@spipu.net>
- * @version		3.24 - 05/08/2009
- */
-
-if (!defined('__CLASS_PARSINGHTML__'))
-{
-	define('__CLASS_PARSINGHTML__', true);
-
-	class parsingHTML
-	{
-		var $html	= '';			// code HTML � parser
-		var $code	= array();		// code HTML pars�
-		var $num	= 0;			// num�ro de table
-		var $level	= 0;			// niveaux de table
-
-		/**
-		 * Constructeur
-		 *
-		 * @return	null
-		 */
-		function parsingHTML()
-		{
-			$this->num		= 0;
-			$this->level	= array($this->num);
-			$this->html		= '';
-			$this->code		= array();
-		}
-
-		/**
-		 * D�finir le code HTML � parser
-		 *
-		 * @param	string code html
-		 * @return	null
-		 */
-		function setHTML($html)
-		{
-			$html = preg_replace('/<!--(.*)-->/isU', '', $html);
-			$this->html = $html;
-		}
-
-		/**
-		 * parser le code HTML
-		 *
-		 * @return	null
-		 */
-		function parse()
-		{
-			$parents = array();
-			// r�cup�rer le code � parser
-			$content = $this->html;
-
-			// chercher les balises HTML du code
-			$tmp = array();
-			$this->searchCode($content, $tmp);
-
-			// identifier les balises une � une
-			$pre_in = false;
-			$pre_br = array(
-						'name' => 'br',
-						'close' => false,
-						'param' => array(
-							'style' => array(),
-							'num'	=> 0
-						)
-					);
-
-			$todos = array();
-			foreach($tmp as $part)
-			{
-				// si c'est un texte
-				if ($part[0]=='txt')
-				{
-					// enregistrer l'action correspondante
-					if (!$pre_in)
-					{
-						if (trim($part[1])!=='')
-						{
-							// remplacer tous les espaces, tabulations, saufs de ligne multiples par de simples espaces
-							$part[1] = preg_replace('/([\s]+)/is', ' ', $part[1]);
-
-							$todos[] = array(
-											'name'	=> 'write',
-											'close'	=> false,
-											'param' => array('txt' => $part[1]),
-										);
-						}
-					}
-					else
-					{
-						$part[1] = str_replace("\r", '', $part[1]);
-						$part[1] = explode("\n", $part[1]);
-
-						foreach($part[1] as $k => $txt)
-						{
-							$txt = str_replace("\t", '        ', $txt);
-							$txt = str_replace(' ', '&nbsp;', $txt);
-							if ($k>0) $todos[] = $pre_br;
-
-								$todos[] = array(
-											'name'	=> 'write',
-											'close'	=> false,
-											'param' => array('txt' => $txt),
-										);
-						}
-					}
-				}
-				// sinon, analyser le code
-				else
-				{
-					$res = $this->analiseCode($part[1]);
-					if ($res)
-					{
-						if (!in_array($res['name'], array('br', 'hr', 'img', 'input', 'link', 'option')))
-						{
-							if ($res['close'])
-							{
-								if (count($parents)<1)
-									@HTML2PDF::makeError(3, __FILE__, __LINE__, $res['name']);
-								else if ($parents[count($parents)-1]!=$res['name'])
-									@HTML2PDF::makeError(4, __FILE__, __LINE__, $parents);
-								else
-									unset($parents[count($parents)-1]);
-							}
-							else
-							{
-								$parents[count($parents)] = $res['name'];
-							}
-						}
-						if ($res['name']=='pre' || $res['name']=='code')
-						{
-							$pre_in = !$res['close'];
-						}
-						$todos[] = $res;
-					}
-				}
-			}
-
-			// pour chaque action identifi�e, il faut nettoyer le d�but et la fin des textes
-			// en fonction des balises qui l'entourent.
-			$nb = count($todos);
-			for($k=0; $k<$nb; $k++)
-			{
-				//si c'est un texte
-				if ($todos[$k]['name']=='write')
-				{
-					// et qu'une balise sp�cifique le pr�c�de => on nettoye les espaces du d�but du texte
-					if ($k>0 && in_array($todos[$k-1]['name'], array('table', 'tr', 'td', 'th', 'br', 'div', 'hr', 'p', 'ul', 'ol', 'li')))
-						$todos[$k]['param']['txt'] = preg_replace('/^([\s]*)([^\s])/isU', '$2', 	$todos[$k]['param']['txt']);
-
-					// et qu'une balise sp�cifique le suit => on nettoye les espaces de la fin du texte
-					if ($k<count($todos)-1 && in_array($todos[$k+1]['name'], array('table', 'tr', 'td', 'th', 'br', 'div', 'hr', 'p', 'ol', 'ul', 'li')))
-						$todos[$k]['param']['txt'] = preg_replace('/([^\s])([\s]*)$/isU', '$1', 	$todos[$k]['param']['txt']);
-				}
-			}
-			if (count($parents)) @HTML2PDF::makeError(5, __FILE__, __LINE__, $parents);
-
-			// liste des actions sauv�e
-			$this->code = $todos;
-		}
-
-		/**
-		 * parser le code HTML
-		 *
-		 * @param	string	contenu � parser.
-		 * @param	&array	tableau de retour des donn�es
-		 * @return	null
-		 */
-		function searchCode($content, &$tmp)
-		{
-			// s�parer les balises du texte
-			$tmp = array();
-			$reg = '/(<[^>]+>)|([^<]+)+/isU';
-
-			// pour chaque �l�ment trouv� :
-			$str = '';
-			$offset = 0;
-			while(preg_match($reg, $content, $parse, PREG_OFFSET_CAPTURE, $offset))
-			{
-				// si une balise a �t� d�tect�e
-				if ($parse[1][0])
-				{
-					// sauvegarde du texte pr�c�dent si il existe
-					if ($str!=='')	$tmp[] = array('txt',$str);
-
-					// sauvegarde de la balise
-					$tmp[] = array('code',trim($parse[1][0]));
-
-					// initialisation du texte suivant
-					$str = '';
-				}
-				else
-				{
-					// ajout du texte � la fin de celui qui est d�j� d�tect�
-					$str.= $parse[2][0];
-				}
-				// Update offset to the end of the match
-				$offset = $parse[0][1] + strlen($parse[0][0]);
-				unset($parse);
-			}
-			// si un texte est pr�sent � la fin, on l'enregistre
-			if ($str!='') $tmp[] = array('txt',$str);
-			unset($str);
-		}
-
-		/**
-		 * analyse une balise HTML
-		 *
-		 * @param	string	code HTML � identifier
-		 * @return	array	action correspondante
-		 */
-		function analiseCode($code)
-		{
-			// nom de la balise et ouverture ou fermeture
-			$balise = '<([\/]{0,1})([_a-z0-9]+)([\/>\s]+)';
-			preg_match('/'.$balise.'/isU', $code, $match);
-			$close	= ($match[1]=='/' ? true : false);
-			$name	= strtolower($match[2]);
-
-			// param�tres obligatoires en fonction du nom de la balise
-			$param	= array();
-			$param['style'] = '';
-			if ($name=='img')	{ $param['alt'] = '';	$param['src'] = ''; }
-			if ($name=='a')		{ $param['href'] = '';	}
-
-			// lecture des param�tres du type nom=valeur
-			$prop = '([a-zA-Z0-9_]+)=([^"\'\s>]+)';
-			preg_match_all('/'.$prop.'/is', $code, $match);
-			for($k=0; $k<count($match[0]); $k++)
-				$param[trim(strtolower($match[1][$k]))] = trim($match[2][$k]);
-
-			// lecture des param�tres du type nom="valeur"
-			$prop = '([a-zA-Z0-9_]+)=["]([^"]*)["]';
-			preg_match_all('/'.$prop.'/is', $code, $match);
-			for($k=0; $k<count($match[0]); $k++)
-				$param[trim(strtolower($match[1][$k]))] = trim($match[2][$k]);
-
-			// lecture des param�tres du type nom='valeur'
-			$prop = "([a-zA-Z0-9_]+)=[']([^']*)[']";
-			preg_match_all('/'.$prop.'/is', $code, $match);
-			for($k=0; $k<count($match[0]); $k++)
-				$param[trim(strtolower($match[1][$k]))] = trim($match[2][$k]);
-
-			// mise en conformit� en style de chaque param�tre
-			$color	= "#000000";
-			$border	= null;
-			foreach($param as $key => $val)
-			{
-				$key = strtolower($key);
-				switch($key)
-				{
-					case 'width':
-						unset($param[$key]);
-						$param['style'] = 'width: '.$val.'px; '.$param['style'];
-						break;
-
-					case 'align':
-						if ($name!=='table')
-						{
-							unset($param[$key]);
-							$param['style'] = 'text-align: '.$val.'; '.$param['style'];
-						}
-						break;
-
-					case 'valign':
-						unset($param[$key]);
-						$param['style'] = 'vertical-align: '.$val.'; '.$param['style'];
-						break;
-
-					case 'height':
-						unset($param[$key]);
-						$param['style'] = 'height: '.$val.'px; '.$param['style'];
-						break;
-
-					case 'bgcolor':
-						unset($param[$key]);
-						$param['style'] = 'background: '.$val.'; '.$param['style'];
-						break;
-
-					case 'bordercolor':
-						unset($param[$key]);
-						$color = $val;
-						break;
-
-					case 'border':
-						unset($param[$key]);
-						if (preg_match('/^[0-9]$/isU', $val)) $val = $val.'px';
-						$border = $val;
-						break;
-
-					case 'cellpadding':
-					case 'cellspacing':
-						if (preg_match('/^([0-9]+)$/isU', $val)) $param[$key] = $val.'px';
-						break;
-
-					case 'colspan':
-					case 'rowspan':
-						$val = preg_replace('/[^0-9]/isU', '', $val);
-						if (!$val) $val = 1;
-						$param[$key] = $val;
-						break;
-				}
-			}
-			if ($border!==null)
-			{
-				if ($border)	$param['style'] = 'border: solid '.$border.' '.$color.'; '.$param['style'];
-				else			$param['style'] = 'border: none';
-			}
-
-			// lecture des styles - d�composition
-			$styles = explode(';', $param['style']);
-			$param['style'] = array();
-			foreach($styles as $style)
-			{
-				$tmp = explode(':', $style);
-				if (count($tmp)>1)
-				{
-					$cod = $tmp[0]; unset($tmp[0]); $tmp = implode(':', $tmp);
-					$param['style'][trim(strtolower($cod))] = preg_replace('/[\s]+/isU', ' ', trim($tmp));
-				}
-			}
-
-			// d�termination du niveau de table pour les ouverture, avec ajout d'un level
-			if (in_array($name, array('ul', 'ol', 'table')) && !$close)
-			{
-				$this->num++;
-				$this->level[count($this->level)] = $this->num;
-			}
-
-			// attribution du niveau de table o� se trouve l'�l�ment
-			if (!isset($param['num'])) $param['num'] = $this->level[count($this->level)-1];
-
-			// pour les fins de table : suppression d'un level
-			if (in_array($name, array('ul', 'ol', 'table')) && $close)
-			{
-				unset($this->level[count($this->level)-1]);
-			}
-
-			// retour de l'action identifi�e
-			return array('name' => $name, 'close' => $close ? 1 : 0, 'param' => $param);
-		}
-
-		// r�cup�rer un niveau complet d'HTML entre une ouverture de balise et la fermeture correspondante
-		function getLevel($k)
-		{
-			// si le code n'existe pas : fin
-			if (!isset($this->code[$k])) return '';
-
-			// quelle balise faudra-t-il d�tecter
-			$detect = $this->code[$k]['name'];
-
-			$level = 0;		// niveau de profondeur
-			$end = false;	// etat de fin de recherche
-			$code = '';		// code extrait
-
-			// tant que c'est pas fini, on boucle
-			while (!$end)
-			{
-				// action courante
-				$row = $this->code[$k];
-
-				// si write => on ajoute le texte
-				if ($row['name']=='write')
-				{
-					$code.= $row['param']['txt'];
-				}
-				// sinon, c'est une balise html
-				else
-				{
-					$not = false; // indicateur de non prise en compte de la balise courante
-
-					// si c'est la balise que l'on cherche
-					if ($row['name']==$detect)
-					{
-						if ($level==0) { $not = true; }					// si on est � la premiere balise : on l'ignore
-						$level+= ($row['close'] ? -1 : 1);				// modification du niveau en cours en fonction de l'ouvertre / fermeture
-						if ($level==0) { $not = true; $end = true; }	// si on est au niveau 0 : on a fini
-					}
-
-					// si on doit prendre en compte la balise courante
-					if (!$not)
-					{
-						// ecriture du code HTML de la balise
-						$code.= '<'.($row['close'] ? '/' : '').$row['name'];
-						foreach($row['param'] as $key => $val)
-						{
-							if ($key=='style')
-							{
-								$tmp = '';
-								if (isset($val['text-align'])) unset($val['text-align']);
-								foreach($val as $ks => $vs) $tmp.= $ks.':'.$vs.'; ';
-								if (trim($tmp)) $code.= ' '.$key.'="'.$tmp.'"';
-							}
-							else
-							{
-								$code.= ' '.$key.'="'.$val.'"';
-							}
-						}
-						$code.= '>';
-					}
-				}
-
-				// on continue tant qu'il y a du code � analyser...
-				if (isset($this->code[$k+1]))
-					$k++;
-				else
-					$end = true;
-			}
-
-			// retourne la position finale et le code HTML extrait
-			return array($k, $code);
-		}
-	}
-}
-?>
+<?php
+/**
+ * Logiciel : HTML2PDF - classe ParsingHTML
+ * 
+ * Convertisseur HTML => PDF, utilise fpdf de Olivier PLATHEY 
+ * Distribué sous la licence LGPL. 
+ *
+ * @author		Laurent MINGUET <webmaster@spipu.net>
+ * @version		3.26 - 16/11/2009
+ */
+ 
+if (!defined('__CLASS_PARSINGHTML__'))
+{
+	define('__CLASS_PARSINGHTML__', true);
+	
+	class parsingHTML
+	{
+		var $html	= '';			// code HTML à parser
+		var $code	= array();		// code HTML parsé
+		var $num	= 0;			// numéro de table
+		var $level	= 0;			// niveaux de table
+		
+		/**
+		 * Constructeur
+		 *
+		 * @return	null
+		 */
+		function parsingHTML()
+		{
+			$this->num		= 0;
+			$this->level	= array($this->num);
+			$this->html		= '';
+			$this->code		= array();	
+		}
+		
+		/**
+		 * Définir le code HTML à parser
+		 *
+		 * @param	string code html
+		 * @return	null
+		 */
+		function setHTML($html)
+		{
+			$html = preg_replace('/<!--(.*)-->/isU', '', $html);
+			$this->html = $html;	
+		}
+		
+		/**
+		 * parser le code HTML
+		 *
+		 * @return	null
+		 */
+		function parse()
+		{
+			$parents = array();
+
+			// chercher les balises HTML du code
+			$tmp = array();
+			$this->searchCode($tmp);
+			
+			// identifier les balises une à une
+			$pre_in = false;
+			$pre_br = array(
+						'name' => 'br',
+						'close' => false,
+						'param' => array(
+							'style' => array(),
+							'num'	=> 0
+						)
+					);
+
+			$balises_no_closed = array('br', 'hr', 'img', 'input', 'link', 'option', 'col');
+			$todos = array();
+			foreach($tmp as $part)
+			{
+				// si c'est un texte
+				if ($part[0]=='txt')
+				{
+					// enregistrer l'action correspondante
+					if (!$pre_in)
+					{
+//						if (trim($part[1])!=='')
+//						{
+							// remplacer tous les espaces, tabulations, saufs de ligne multiples par de simples espaces
+							$part[1] = preg_replace('/([\s]+)/is', ' ', $part[1]);
+					
+							$todos[] = array(
+											'name'	=> 'write',
+											'close'	=> false,
+											'param' => array('txt' => $part[1]),
+										);
+//						}
+					}
+					else
+					{
+						$part[1] = str_replace("\r", '', $part[1]);
+						$part[1] = explode("\n", $part[1]);
+						
+						foreach($part[1] as $k => $txt)
+						{
+							$txt = str_replace("\t", '        ', $txt);
+							$txt = str_replace(' ', '&nbsp;', $txt);
+							if ($k>0) $todos[] = $pre_br;
+
+								$todos[] = array(
+											'name'	=> 'write',
+											'close'	=> false,
+											'param' => array('txt' => $txt),
+										);
+						}
+					}
+				}
+				// sinon, analyser le code
+				else
+				{
+					$res = $this->analiseCode($part[1]);
+					if ($res)
+					{
+						$res['html_pos'] = $part[2];
+						if (!in_array($res['name'], $balises_no_closed))
+						{
+							if ($res['close'])
+							{
+								if (count($parents)<1)
+									@HTML2PDF::makeError(3, __FILE__, __LINE__, $res['name'], $this->getHtmlErrorCode($res['html_pos']));
+								else if ($parents[count($parents)-1]!=$res['name'])
+									@HTML2PDF::makeError(4, __FILE__, __LINE__, $parents, $this->getHtmlErrorCode($res['html_pos']));
+								else
+									unset($parents[count($parents)-1]);
+							}
+							else
+							{
+								if ($res['autoclose'])
+								{
+									$todos[] = $res;
+									$res['params'] = array();
+									$res['close'] = true;
+								}
+								else
+									$parents[count($parents)] = $res['name'];
+														
+							}
+							if (($res['name']=='pre' || $res['name']=='code') && !$res['autoclose'])
+									$pre_in = !$res['close'];
+						}
+						
+						$todos[] = $res;
+					}
+				}	
+			}
+
+			// pour chaque action identifiée, il faut nettoyer le début et la fin des textes
+			// en fonction des balises qui l'entourent.
+			$balises_clean = array('page', 'page_header', 'page_footer', 'form',
+									'table', 'thead', 'tfoot', 'tr', 'td', 'th', 'br',
+									'div', 'hr', 'p', 'ul', 'ol', 'li',
+									'h1', 'h2', 'h3', 'h4', 'h5', 'h6',
+									'bookmark');
+			$nb = count($todos);
+			for($k=0; $k<$nb; $k++)
+			{
+				//si c'est un texte
+				if ($todos[$k]['name']=='write')
+				{
+					// et qu'une balise spécifique le précède => on nettoye les espaces du début du texte
+					if ($k>0 && in_array($todos[$k-1]['name'], $balises_clean))
+						$todos[$k]['param']['txt'] = ltrim($todos[$k]['param']['txt']);
+
+					// et qu'une balise spécifique le suit => on nettoye les espaces de la fin du texte
+					if ($k<count($todos)-1 && in_array($todos[$k+1]['name'], $balises_clean))
+						$todos[$k]['param']['txt'] = rtrim($todos[$k]['param']['txt']);
+						
+					if (!strlen($todos[$k]['param']['txt']))
+						unset($todos[$k]);
+				}
+			}
+			if (count($parents)) @HTML2PDF::makeError(5, __FILE__, __LINE__, $parents);
+
+			// liste des actions sauvée
+			$this->code = array_values($todos);;
+		}
+		
+		/**
+		 * parser le code HTML
+		 *
+		 * @param	&array	tableau de retour des données
+		 * @return	null
+		 */
+		function searchCode(&$tmp)
+		{
+			// séparer les balises du texte
+			$tmp = array();
+			$reg = '/(<[^>]+>)|([^<]+)+/isU';
+
+			// pour chaque élément trouvé :
+			$str = '';
+			$offset = 0;
+			while(preg_match($reg, $this->html, $parse, PREG_OFFSET_CAPTURE, $offset))
+			{
+				// si une balise a été détectée
+				if ($parse[1][0])
+				{
+					// sauvegarde du texte précédent si il existe
+					if ($str!=='')	$tmp[] = array('txt',$str);
+		
+					// sauvegarde de la balise
+					$tmp[] = array('code',trim($parse[1][0]), $offset);
+					
+					// initialisation du texte suivant
+					$str = ''; 	
+				}
+				else
+				{
+					// ajout du texte à la fin de celui qui est déjà détecté
+					$str.= $parse[2][0];
+				}
+				// Update offset to the end of the match
+				$offset = $parse[0][1] + strlen($parse[0][0]);
+				unset($parse);
+			}
+			// si un texte est présent à la fin, on l'enregistre
+			if ($str!='') $tmp[] = array('txt',$str);
+			unset($str);
+		}
+		
+		/**
+		 * analyse une balise HTML
+		 *
+		 * @param	string	code HTML à identifier
+		 * @return	array	action correspondante
+		 */
+		function analiseCode($code)
+		{
+			// nom de la balise et ouverture ou fermeture
+			$balise = '<([\/]{0,1})([_a-z0-9]+)([\/>\s]+)';
+			preg_match('/'.$balise.'/isU', $code, $match);
+			$close	= ($match[1]=='/' ? true : false);
+			$autoclose = preg_match('/\/>$/isU', $code);
+			$name	= strtolower($match[2]);
+			
+			// paramètres obligatoires en fonction du nom de la balise
+			$param	= array();
+			$param['style'] = '';
+			if ($name=='img')	{ $param['alt'] = '';	$param['src'] = ''; }
+			if ($name=='a')		{ $param['href'] = '';	}
+			
+			// lecture des paramétres du type nom=valeur
+			$prop = '([a-zA-Z0-9_]+)=([^"\'\s>]+)';
+			preg_match_all('/'.$prop.'/is', $code, $match);
+			for($k=0; $k<count($match[0]); $k++)
+				$param[trim(strtolower($match[1][$k]))] = trim($match[2][$k]);
+
+			// lecture des paramétres du type nom="valeur"
+			$prop = '([a-zA-Z0-9_]+)=["]([^"]*)["]';
+			preg_match_all('/'.$prop.'/is', $code, $match);
+			for($k=0; $k<count($match[0]); $k++)
+				$param[trim(strtolower($match[1][$k]))] = trim($match[2][$k]);
+
+			// lecture des paramétres du type nom='valeur'
+			$prop = "([a-zA-Z0-9_]+)=[']([^']*)[']";
+			preg_match_all('/'.$prop.'/is', $code, $match);
+			for($k=0; $k<count($match[0]); $k++)
+				$param[trim(strtolower($match[1][$k]))] = trim($match[2][$k]);
+		
+			// mise en conformité en style de chaque paramètre
+			$color	= "#000000";
+			$border	= null;
+			foreach($param as $key => $val)
+			{
+				$key = strtolower($key);
+				switch($key)
+				{
+					case 'width':
+						unset($param[$key]);
+						$param['style'] = 'width: '.$val.'px; '.$param['style'];
+						break;	
+
+					case 'align':
+						if ($name!=='table')
+						{
+							unset($param[$key]);
+							$param['style'] = 'text-align: '.$val.'; '.$param['style'];
+						}
+						break;
+						
+					case 'valign':
+						unset($param[$key]);
+						$param['style'] = 'vertical-align: '.$val.'; '.$param['style'];
+						break;
+						
+					case 'height':
+						unset($param[$key]);
+						$param['style'] = 'height: '.$val.'px; '.$param['style'];	
+						break;	
+
+					case 'bgcolor':
+						unset($param[$key]);
+						$param['style'] = 'background: '.$val.'; '.$param['style'];					
+						break;	
+
+					case 'bordercolor':
+						unset($param[$key]);
+						$color = $val;
+						break;	
+
+					case 'border':
+						unset($param[$key]);
+						if (preg_match('/^[0-9]$/isU', $val)) $val = $val.'px';
+						$border = $val;
+						break;
+					
+					case 'cellpadding':
+					case 'cellspacing':
+						if (preg_match('/^([0-9]+)$/isU', $val)) $param[$key] = $val.'px';
+						break;
+						
+					case 'colspan':
+					case 'rowspan':
+						$val = preg_replace('/[^0-9]/isU', '', $val);
+						if (!$val) $val = 1;
+						$param[$key] = $val;
+						break;
+				}
+			}
+			if ($border!==null)
+			{
+				if ($border)	$param['style'] = 'border: solid '.$border.' '.$color.'; '.$param['style'];
+				else			$param['style'] = 'border: none'.$param['style']; 
+			}
+			
+			// lecture des styles - décomposition
+			$styles = explode(';', $param['style']);
+			$param['style'] = array();
+			foreach($styles as $style)
+			{
+				$tmp = explode(':', $style);
+				if (count($tmp)>1)
+				{
+					$cod = $tmp[0]; unset($tmp[0]); $tmp = implode(':', $tmp); 
+					$param['style'][trim(strtolower($cod))] = preg_replace('/[\s]+/isU', ' ', trim($tmp));
+				}
+			}
+			
+			// détermination du niveau de table pour les ouverture, avec ajout d'un level
+			if (in_array($name, array('ul', 'ol', 'table')) && !$close)
+			{
+				$this->num++;
+				$this->level[count($this->level)] = $this->num;
+			} 
+			
+			// attribution du niveau de table où se trouve l'élément
+			if (!isset($param['num'])) $param['num'] = $this->level[count($this->level)-1];
+
+			// pour les fins de table : suppression d'un level
+			if (in_array($name, array('ul', 'ol', 'table')) && $close)
+			{
+				unset($this->level[count($this->level)-1]);			
+			} 
+
+			// retour de l'action identifiée
+			return array('name' => $name, 'close' => $close ? 1 : 0, 'autoclose' => $autoclose, 'param' => $param);
+		}
+		
+		// récupérer un niveau complet d'HTML entre une ouverture de balise et la fermeture correspondante
+		function getLevel($k)
+		{
+			// si le code n'existe pas : fin
+			if (!isset($this->code[$k])) return '';
+			
+			// quelle balise faudra-t-il détecter
+			$detect = $this->code[$k]['name'];
+			
+			$level = 0;		// niveau de profondeur
+			$end = false;	// etat de fin de recherche
+			$code = '';		// code extrait
+			
+			// tant que c'est pas fini, on boucle
+			while (!$end)
+			{
+				// action courante
+				$row = $this->code[$k];
+				
+				// si write => on ajoute le texte
+				if ($row['name']=='write')
+				{
+					$code.= $row['param']['txt'];	
+				}
+				// sinon, c'est une balise html
+				else
+				{
+					$not = false; // indicateur de non prise en compte de la balise courante
+					
+					// si c'est la balise que l'on cherche
+					if ($row['name']==$detect)
+					{
+						if ($level==0) { $not = true; }					// si on est à la premiere balise : on l'ignore
+						$level+= ($row['close'] ? -1 : 1);				// modification du niveau en cours en fonction de l'ouvertre / fermeture
+						if ($level==0) { $not = true; $end = true; }	// si on est au niveau 0 : on a fini
+					}
+					
+					// si on doit prendre en compte la balise courante
+					if (!$not)
+					{
+						// ecriture du code HTML de la balise
+						$code.= '<'.($row['close'] ? '/' : '').$row['name'];
+						foreach($row['param'] as $key => $val)
+						{
+							if ($key=='style')
+							{
+								$tmp = '';
+								if (isset($val['text-align'])) unset($val['text-align']);
+								foreach($val as $ks => $vs) $tmp.= $ks.':'.$vs.'; ';
+								if (trim($tmp)) $code.= ' '.$key.'="'.$tmp.'"';
+							}
+							else
+							{
+								$code.= ' '.$key.'="'.$val.'"';
+							}	
+						}
+						$code.= '>';
+					}
+				}
+				
+				// on continue tant qu'il y a du code à analyser...
+				if (isset($this->code[$k+1]))
+					$k++;
+				else
+					$end = true;	
+			}
+			
+			// retourne la position finale et le code HTML extrait
+			return array($k, $code);
+		}
+		
+		function getHtmlErrorCode($pos)
+		{
+			return substr($this->html, $pos-30, 70);
+		}
+	}
+}

+ 47 - 0
main/inc/lib/html2pdf/qrcode/qrcode.class.php

@@ -0,0 +1,47 @@
+<?php
+/*
+ * ATTENTION : 
+ * Vous devez télécharger la librairie "QR-code generator >=0.97" (sous licence LGPL)
+ * a cette adresse : http://prgm.spipu.net/php_qrcode
+ * et mettre tout son contenu dans ce repertoire (qrcode)
+ * en remplacant également ce fichier (qrcode.class.php)
+ * 
+ * WARNING: 
+ * You have to download the librairy "QR-code generator >=0.97" (under LGPL licence)
+ * at this url : http://prgm.spipu.net/php_qrcode
+ * and to put all his content in this folder (qrcode)
+ * and to replace also this file (qrcode.class.php)
+ */
+
+if (!defined('__CLASS_QRCODE__'))
+{
+	define('__CLASS_QRCODE__', true);
+	
+	class QRcode
+	{
+		public function __construct($value, $level='L')
+		{
+			echo '
+<pre>
+	<b>ATTENTION :</b> 
+		Vous devez télécharger la librairie "QR-code generator >=0.97" (sous licence LGPL)
+ 		a cette adresse : <a href="http://prgm.spipu.net/php_qrcode" target="_blank">http://prgm.spipu.net/php_qrcode</a>
+ 		et mettre tout son contenu dans ce repertoire : '.dirname(__FILE__).'
+ 		en remplacant également ce fichier : '.basename(__FILE__).'
+ 		
+ 	<b>WARNING:</b> 
+ 		You have to download the librairy "QR-code generator >=0.97" (under LGPL licence)
+ 		at this url : <a href="http://prgm.spipu.net/php_qrcode" target="_blank">http://prgm.spipu.net/php_qrcode</a>
+ 		and to put all his contents in this folder '.dirname(__FILE__).'
+ 		and to replace also this file : '.basename(__FILE__).'
+ </pre>';
+			exit;
+		}
+
+		public function getQrSize() { return 0; }
+		public function disableBorder() { }
+		public function displayFPDF(&$fpdf, $x, $y, $s, $background=array(255,255,255), $color=array(0,0,0)) { return true; }
+		public function displayHTML() { return true; }
+		public function displayPNG($s=4, $background=array(255,255,255), $color=array(0,0,0), $filename = null, $quality = 0) { return true; }
+	}
+}

+ 1536 - 1456
main/inc/lib/html2pdf/styleHTML.class.php

@@ -1,1456 +1,1536 @@
-<?php
-/**
- * Logiciel : HTML2PDF - classe styleHTML
- *
- * Convertisseur HTML => PDF, utilise fpdf de Olivier PLATHEY
- * Distribuďż˝ sous la licence LGPL.
- *
- * @author		Laurent MINGUET <webmaster@spipu.net>
- * @version		3.24 - 05/08/2009
- */
-
-if (!defined('__CLASS_STYLEHTML__'))
-{
-	define('__CLASS_STYLEHTML__', true);
-
-	class styleHTML
-	{
-		var $css		= array();		// tableau des CSS
-		var $css_keys	= array();		// tableau des clefs CSS, pour l'ordre d'execution
-		var $value		= array();		// valeurs actuelles
-		var $table		= array();		// tableau d'empilement pour historisation des niveaux
-		var $pdf		= null;			// r�f�rence au PDF parent
-		var $htmlColor	= array();		// liste des couleurs HTML
-		var $onlyLeft	= false;		// indique si on est dans un sous HTML et qu'on bloque ďż˝ gauche
-
-		/**
-		 * Constructeur
-		 *
-		 * @param	&pdf		r�f�rence � l'objet HTML2PDF parent
-		 * @return	null
-		 */
-		function styleHTML(&$pdf)
-		{
-			$this->init();		// initialisation
-			$this->pdf = &$pdf;
-		}
-
- 		/**
-		 * Initialisation du style
-		 *
-		 * @return	null
-		 */
-		function init()
-		{
-			$color = array();
-			$color['AliceBlue']			= '#F0F8FF';
-			$color['AntiqueWhite']		= '#FAEBD7';
-			$color['Aqua']				= '#00FFFF';
-			$color['Aquamarine']		= '#7FFFD4';
-			$color['Azure']				= '#F0FFFF';
-			$color['Beige']				= '#F5F5DC';
-			$color['Bisque']			= '#FFE4C4';
-			$color['Black']				= '#000000';
-			$color['BlanchedAlmond']	= '#FFEBCD';
-			$color['Blue']				= '#0000FF';
-			$color['BlueViolet']		= '#8A2BE2';
-			$color['Brown']				= '#A52A2A';
-			$color['BurlyWood']			= '#DEB887';
-			$color['CadetBlue']			= '#5F9EA0';
-			$color['Chartreuse']		= '#7FFF00';
-			$color['Chocolate']			= '#D2691E';
-			$color['Coral']				= '#FF7F50';
-			$color['CornflowerBlue']	= '#6495ED';
-			$color['Cornsilk']			= '#FFF8DC';
-			$color['Crimson']			= '#DC143C';
-			$color['Cyan']				= '#00FFFF';
-			$color['DarkBlue']			= '#00008B';
-			$color['DarkCyan']			= '#008B8B';
-			$color['DarkGoldenRod']		= '#B8860B';
-			$color['DarkGray']			= '#A9A9A9';
-			$color['DarkGrey']			= '#A9A9A9';
-			$color['DarkGreen']			= '#006400';
-			$color['DarkKhaki']			= '#BDB76B';
-			$color['DarkMagenta']		= '#8B008B';
-			$color['DarkOliveGreen']	= '#556B2F';
-			$color['Darkorange']		= '#FF8C00';
-			$color['DarkOrchid']		= '#9932CC';
-			$color['DarkRed']			= '#8B0000';
-			$color['DarkSalmon']		= '#E9967A';
-			$color['DarkSeaGreen']		= '#8FBC8F';
-			$color['DarkSlateBlue']		= '#483D8B';
-			$color['DarkSlateGray']		= '#2F4F4F';
-			$color['DarkSlateGrey']		= '#2F4F4F';
-			$color['DarkTurquoise']		= '#00CED1';
-			$color['DarkViolet']		= '#9400D3';
-			$color['DeepPink']			= '#FF1493';
-			$color['DeepSkyBlue']		= '#00BFFF';
-			$color['DimGray']			= '#696969';
-			$color['DimGrey']			= '#696969';
-			$color['DodgerBlue']		= '#1E90FF';
-			$color['FireBrick']			= '#B22222';
-			$color['FloralWhite']		= '#FFFAF0';
-			$color['ForestGreen']		= '#228B22';
-			$color['Fuchsia']			= '#FF00FF';
-			$color['Gainsboro']			= '#DCDCDC';
-			$color['GhostWhite']		= '#F8F8FF';
-			$color['Gold']				= '#FFD700';
-			$color['GoldenRod']			= '#DAA520';
-			$color['Gray']				= '#808080';
-			$color['Grey']				= '#808080';
-			$color['Green']				= '#008000';
-			$color['GreenYellow']		= '#ADFF2F';
-			$color['HoneyDew']			= '#F0FFF0';
-			$color['HotPink']			= '#FF69B4';
-			$color['IndianRed']			= '#CD5C5C';
-			$color['Indigo']			= '#4B0082';
-			$color['Ivory']				= '#FFFFF0';
-			$color['Khaki']				= '#F0E68C';
-			$color['Lavender']			= '#E6E6FA';
-			$color['LavenderBlush']		= '#FFF0F5';
-			$color['LawnGreen']			= '#7CFC00';
-			$color['LemonChiffon']		= '#FFFACD';
-			$color['LightBlue']			= '#ADD8E6';
-			$color['LightCoral']		= '#F08080';
-			$color['LightCyan']			= '#E0FFFF';
-			$color['LightGoldenRodYellow']	= '#FAFAD2';
-			$color['LightGray']			= '#D3D3D3';
-			$color['LightGrey']			= '#D3D3D3';
-			$color['LightGreen']		= '#90EE90';
-			$color['LightPink']			= '#FFB6C1';
-			$color['LightSalmon']		= '#FFA07A';
-			$color['LightSeaGreen']		= '#20B2AA';
-			$color['LightSkyBlue']		= '#87CEFA';
-			$color['LightSlateGray']	= '#778899';
-			$color['LightSlateGrey']	= '#778899';
-			$color['LightSteelBlue']	= '#B0C4DE';
-			$color['LightYellow']		= '#FFFFE0';
-			$color['Lime']				= '#00FF00';
-			$color['LimeGreen']			= '#32CD32';
-			$color['Linen']				= '#FAF0E6';
-			$color['Magenta']			= '#FF00FF';
-			$color['Maroon']			= '#800000';
-			$color['MediumAquaMarine']	= '#66CDAA';
-			$color['MediumBlue']		= '#0000CD';
-			$color['MediumOrchid']		= '#BA55D3';
-			$color['MediumPurple']		= '#9370D8';
-			$color['MediumSeaGreen']	= '#3CB371';
-			$color['MediumSlateBlue']	= '#7B68EE';
-			$color['MediumSpringGreen']	= '#00FA9A';
-			$color['MediumTurquoise']	= '#48D1CC';
-			$color['MediumVioletRed']	= '#C71585';
-			$color['MidnightBlue']		= '#191970';
-			$color['MintCream']			= '#F5FFFA';
-			$color['MistyRose']			= '#FFE4E1';
-			$color['Moccasin']			= '#FFE4B5';
-			$color['NavajoWhite']		= '#FFDEAD';
-			$color['Navy']				= '#000080';
-			$color['OldLace']			= '#FDF5E6';
-			$color['Olive']				= '#808000';
-			$color['OliveDrab']			= '#6B8E23';
-			$color['Orange']			= '#FFA500';
-			$color['OrangeRed']			= '#FF4500';
-			$color['Orchid']			= '#DA70D6';
-			$color['PaleGoldenRod']		= '#EEE8AA';
-			$color['PaleGreen']			= '#98FB98';
-			$color['PaleTurquoise']		= '#AFEEEE';
-			$color['PaleVioletRed']		= '#D87093';
-			$color['PapayaWhip']		= '#FFEFD5';
-			$color['PeachPuff']			= '#FFDAB9';
-			$color['Peru']				= '#CD853F';
-			$color['Pink']				= '#FFC0CB';
-			$color['Plum']				= '#DDA0DD';
-			$color['PowderBlue']		= '#B0E0E6';
-			$color['Purple']			= '#800080';
-			$color['Red']				= '#FF0000';
-			$color['RosyBrown']			= '#BC8F8F';
-			$color['RoyalBlue']			= '#4169E1';
-			$color['SaddleBrown']		= '#8B4513';
-			$color['Salmon']			= '#FA8072';
-			$color['SandyBrown']		= '#F4A460';
-			$color['SeaGreen']			= '#2E8B57';
-			$color['SeaShell']			= '#FFF5EE';
-			$color['Sienna']			= '#A0522D';
-			$color['Silver']			= '#C0C0C0';
-			$color['SkyBlue']			= '#87CEEB';
-			$color['SlateBlue']			= '#6A5ACD';
-			$color['SlateGray']			= '#708090';
-			$color['SlateGrey']			= '#708090';
-			$color['Snow']				= '#FFFAFA';
-			$color['SpringGreen']		= '#00FF7F';
-			$color['SteelBlue']			= '#4682B4';
-			$color['Tan']				= '#D2B48C';
-			$color['Teal']				= '#008080';
-			$color['Thistle']			= '#D8BFD8';
-			$color['Tomato']			= '#FF6347';
-			$color['Turquoise']			= '#40E0D0';
-			$color['Violet']			= '#EE82EE';
-			$color['Wheat']				= '#F5DEB3';
-			$color['White']				= '#FFFFFF';
-			$color['WhiteSmoke']		= '#F5F5F5';
-			$color['Yellow']			= '#FFFF00';
-			$color['YellowGreen']		= '#9ACD32';
-
-			$this->htmlColor = array();
-			foreach($color as $key => $val) $this->htmlColor[strtolower($key)] = $val;
-			unset($color);
-
-			$this->table = array();
-
-			$this->value = array();
-			$this->initStyle();
-
-			// initialisation des styles sans h�ritages
-			$this->resetStyle();
-		}
-
-		function initStyle()
-		{
-	 		$this->value['id_balise']			= 'body';		// balise
-			$this->value['id_name']				= null;			// name
-			$this->value['id_id']				= null;			// id
-			$this->value['id_class']			= null;			// class
-			$this->value['id_lst']				= array('*');	// lst de dependance
-			$this->value['mini-size']			= 1.;			// rapport de taille	sp�cifique aux sup, sub
-			$this->value['mini-decal']			= 0;			// rapport de position	sp�cifique aux sup, sub
-			$this->value['font-family']			= 'Arial';
-			$this->value['font-bold']			= false;
-			$this->value['font-italic']			= false;
-			$this->value['font-underline']		= false;
-			$this->value['font-overline']		= false;
-			$this->value['font-linethrough']	= false;
-			$this->value['font-size']			= $this->ConvertToMM('10pt');
-			$this->value['text-indent']			= 0;
-			$this->value['text-align']			= 'left';
-			$this->value['vertical-align']		= 'middle';
-			$this->value['line-height']			= 'normal';
-
-			$this->value['position']			= null;
-			$this->value['x']					= null;
-			$this->value['y']					= null;
-			$this->value['width']				= 0;
-			$this->value['height']				= 0;
-			$this->value['top']					= null;
-			$this->value['right']				= null;
-			$this->value['bottom']				= null;
-			$this->value['left']				= null;
-			$this->value['float']				= null;
-			$this->value['display']				= null;
-
-			$this->value['color']				= array(0, 0, 0);
-			$this->value['background']			= array('color' => null, 'image' => null, 'position' => null, 'repeat' => null);
-			$this->value['border']				= array();
-			$this->value['padding']				= array();
-			$this->value['margin']				= array();
-			$this->value['margin-auto']			= false;
-
-			$this->value['list-style-type']		= '';
-			$this->value['list-style-image']	= '';
-
-			$this->value['xc']					= null;
-			$this->value['yc']					= null;
-		}
-
-		/**
-		 * Initialisation des styles sans h�ritages
-		 *
-		 * @param	string	balise HTML
-		 * @return	null
-		 */
-		function resetStyle($balise = '')
-		{
-			$collapse = isset($this->value['border']['collapse']) ? $this->value['border']['collapse'] : false;
-			if (!in_array($balise, array('tr', 'td', 'th'))) $collapse = false;
-
-			$this->value['position']			= null;
-			$this->value['x']					= null;
-			$this->value['y']					= null;
-			$this->value['width']				= 0;
-			$this->value['height']				= 0;
-			$this->value['top']					= null;
-			$this->value['right']				= null;
-			$this->value['bottom']				= null;
-			$this->value['left']				= null;
-			$this->value['float']				= null;
-			$this->value['display']				= null;
-			$this->value['background']			= array('color' => null, 'image' => null, 'position' => null, 'repeat' => null);
-			$this->value['border']	= array(
-										't' => $this->readBorder('none'),
-										'r' => $this->readBorder('none'),
-										'b' => $this->readBorder('none'),
-										'l' => $this->readBorder('none'),
-										'radius' => array(0, 0),
-										'collapse' => $collapse,
-									);
-
-			$this->value['margin']	= array(
-									't' => 0,
-									'r' => 0,
-									'b' => 0,
-									'l' => 0
-								);
-			$this->value['margin-auto'] = false;
-
-			if (in_array($balise, array('div')))
-				$this->value['vertical-align']	 = 'top';
-
-			if (in_array($balise, array('ul', 'li')))
-			{
-				$this->value['list-style-type']		= '';
-				$this->value['list-style-image']	= '';
-			}
-
-			if (!in_array($balise, array('tr', 'td')))
-			{
-				$this->value['padding']	= array(
-										't' => 0,
-										'r' => 0,
-										'b' => 0,
-										'l' => 0
-									);
-			}
-			else
-			{
-				$this->value['padding']	= array(
-										't' => $this->ConvertToMM('1px'),
-										'r' => $this->ConvertToMM('1px'),
-										'b' => $this->ConvertToMM('1px'),
-										'l' => $this->ConvertToMM('1px')
-									);
-			}
-
-			if ($balise=='hr')
-			{
-				$this->value['border']	= array(
-										't' => $this->readBorder('solid 1px #000000'),
-										'r' => $this->readBorder('solid 1px #000000'),
-										'b' => $this->readBorder('solid 1px #000000'),
-										'l' => $this->readBorder('solid 1px #000000'),
-										'radius' => array(0, 0),
-										'collapse' => false,
-									);
-				$this->ConvertBackground('#FFFFFF', $this->value['background']);
-			}
-
-			$this->value['xc']					= null;
-			$this->value['yc']					= null;
-		}
-
-		/**
-		 * Initialisation de la font PDF
-		 *
-		 * @return	null
-		 */
-		function FontSet()
-		{
-			$b = ($this->value['font-bold']			? 'B' : '');
-			$i = ($this->value['font-italic']		? 'I' : '');
-			$u = ($this->value['font-underline']	? 'U' : '');
-
-			// taille en mm, ďż˝ ramener en pt
-			$size = $this->value['font-size'];
-			$size = 72 * $size / 25.4;
-
-			$this->pdf->setOverline($this->value['font-overline']);
-			$this->pdf->setLinethrough($this->value['font-linethrough']);
-
-			// application de la fonte
-			$this->pdf->SetFont($this->value['font-family'], $b.$i.$u, $this->value['mini-size']*$size);
-			$this->pdf->SetTextColor($this->value['color'][0],$this->value['color'][1], $this->value['color'][2]);
-			if ($this->value['background']['color'])
-				$this->pdf->SetFillColor($this->value['background']['color'][0],$this->value['background']['color'][1], $this->value['background']['color'][2]);
-			else
-				$this->pdf->SetFillColor(255);
-		}
-
- 		/**
-		 * Monter d'un niveau dans l'historisation
-		 *
-		 * @return	null
-		 */
-		function save()
-		{
-			$this->table[count($this->table)] = $this->value;
-		}
-
- 		/**
-		 * Descendre d'un niveau dans l'historisation
-		 *
-		 * @return	null
-		 */
-		function load()
-		{
-			if (count($this->table))
-			{
-				$this->value = $this->table[count($this->table)-1];
-				unset($this->table[count($this->table)-1]);
-			}
-		}
-
-		function restorePosition(&$current_x, &$current_y)
-		{
-			if ($this->value['y']==$current_y) $current_y = $this->value['yc'];
-		}
-
-		function setPosition(&$current_x, &$current_y)
-		{
-			$this->value['xc'] = $current_x;
-			$this->value['yc'] = $current_y;
-
-			if ($this->value['position']=='relative' || $this->value['position']=='absolute')
-			{
-				if ($this->value['right']!==null)
-				{
-					$x = $this->getLastWidth(true) - $this->value['right'] - $this->value['width'];
-					if ($this->value['margin']['r']) $x-= $this->value['margin']['r'];
-				}
-				else
-				{
-					$x = $this->value['left'];
-					if ($this->value['margin']['l']) $x+= $this->value['margin']['l'];
-				}
-
-				if ($this->value['bottom']!==null)
-				{
-					$y = $this->getLastHeight(true) - $this->value['bottom'] - $this->value['height'];
-					if ($this->value['margin']['b']) $y-= $this->value['margin']['b'];
-				}
-				else
-				{
-					$y = $this->value['top'];
-					if ($this->value['margin']['t']) $y+= $this->value['margin']['t'];
-				}
-
-				if ($this->value['position']=='relative')
-				{
-					$this->value['x'] = $current_x + $x;
-					$this->value['y'] = $current_y + $y;
-				}
-				else
-				{
-					$this->value['x'] = $this->getLastAbsoluteX()+$x;
-					$this->value['y'] = $this->getLastAbsoluteY()+$y;
-				}
-			}
-			else
-			{
-				$this->value['x'] = $current_x;
-				$this->value['y'] = $current_y;
-				if ($this->value['margin']['l'])	$this->value['x']+= $this->value['margin']['l'];
-				if ($this->value['margin']['t'])	$this->value['y']+= $this->value['margin']['t'];
-			}
-
-			$current_x = $this->value['x'];
-			$current_y = $this->value['y'];
-		}
-
- 		/**
-		 * Analyse un tableau de style provenant du parseurHTML
-		 *
-		 * @param	string	nom de la balise
-		 * @param	array	tableau de style
-		 * @return	null
-		 */
-		function analyse($balise, &$param)
-		{
-			// preparation
-			$balise = strtolower($balise);
-			$id		= isset($param['id'])		? strtolower(trim($param['id']))	: null; if (!$id)	$id		= null;
-			$name	= isset($param['name'])		? strtolower(trim($param['name']))	: null; if (!$name)	$name	= null;
-
-			// lecture de la propriete classe
-			$class = array();
-			$tmp	= isset($param['class'])	? preg_replace('/[\s]+/', ' ', strtolower($param['class']))	: '';
-			$tmp = explode(' ', $tmp);
-			foreach($tmp as $k => $v)
-			{
-				$v = trim($v);
-				if ($v) $class[] = $v;
-			}
-
-			// identification de la balise et des styles direct qui pourraient lui �tre appliqu�s
-			$this->value['id_balise']	= $balise;
-			$this->value['id_name']		= $name;
-			$this->value['id_id']		= $id;
-			$this->value['id_class']	= $class;
-			$this->value['id_lst']		= array();
-			$this->value['id_lst'][] = '*';
-			$this->value['id_lst'][] = $balise;
-			if (count($class))
-			{
-				foreach($class as $v)
-				{
-					$this->value['id_lst'][] = '*.'.$v;
-					$this->value['id_lst'][] = '.'.$v;
-					$this->value['id_lst'][] = $balise.'.'.$v;
-				}
-			}
-			if ($id)
-			{
-				$this->value['id_lst'][] = '*#'.$id;
-				$this->value['id_lst'][] = '#'.$id;
-				$this->value['id_lst'][] = $id.'#'.$id;
-			}
-
-			// style CSS
-			$styles = $this->getFromCSS();
-
-			// on ajoute le style propre ďż˝ la balise
-			$styles = array_merge($styles, $param['style']);
-			if (isset($param['allwidth']) && !isset($styles['width'])) $styles['width'] = '100%';
-
-			// mise � zero des styles non h�rit�s
-			$this->resetStyle($balise);
-
-			// interpreration des nouvelles valeurs
-			$correct_width = false;
-			$no_width = true;
-
-			foreach($styles as $nom => $val)
-			{
-				switch($nom)
-				{
-					case 'font-family':
-						$val = explode(',', $val);
-						$val = trim($val[0]);
-
-						if ($val) $this->value['font-family'] = $val;
-						break;
-
-					case 'font-weight':
-						$this->value['font-bold'] = ($val=='bold');
-						break;
-
-					case 'font-style':
-						$this->value['font-italic'] = ($val=='italic');
-						break;
-
-					case 'text-decoration':
-						$val = explode(' ', $val);
-						$this->value['font-underline']		= (in_array('underline',	$val));
-						$this->value['font-overline']		= (in_array('overline',		$val));
-						$this->value['font-linethrough']	= (in_array('line-through',	$val));
-						break;
-
-					case 'text-indent':
-						$this->value['text-indent']			= $this->ConvertToMM($val);
-						break;
-
-					case 'font-size':
-						$val = $this->ConvertToMM($val, $this->value['font-size']);
-						if ($val) $this->value['font-size'] = $val;
-						break;
-
-					case 'color':
-						$res = null;
-						$this->value['color'] = $this->ConvertToRVB($val, $res);
-
-						if ($balise=='hr')
-						{
-							$this->value['border']['l']['color'] = $this->value['color'];
-							$this->value['border']['t']['color'] = $this->value['color'];
-							$this->value['border']['r']['color'] = $this->value['color'];
-							$this->value['border']['b']['color'] = $this->value['color'];
-						}
-						break;
-
-					case 'text-align':
-						$this->value['text-align'] = $val;
-						break;
-
-					case 'vertical-align':
-						$this->value['vertical-align'] = $val;
-						break;
-
-					case 'width':
-						$this->value['width'] = $this->ConvertToMM($val, $this->getLastWidth());
-						if ($this->value['width'] && substr($val, -1)=='%') $correct_width=true;
-						$no_width = false;
-						break;
-
-					case 'height':
-						$this->value['height'] = $this->ConvertToMM($val, $this->getLastHeight());
-						break;
-
-					case 'line-height':
-						if (preg_match('/^[0-9\.]+$/isU', $val)) $val = floor($val*100).'%';
-						$this->value['line-height'] = $val;
-						break;
-
-					case 'padding':
-						$val = explode(' ', $val);
-						foreach($val as $k => $v)
-						{
-							$v = trim($v);
-							if ($v!='') $val[$k] = $v;
-							else	unset($val[$k]);
-						}
-						$val = array_values($val);
-						if (count($val)!=4)
-						{
-							$val = $this->ConvertToMM($val[0], 0);
-							$this->value['padding']['t'] = $val;
-							$this->value['padding']['r'] = $val;
-							$this->value['padding']['b'] = $val;
-							$this->value['padding']['l'] = $val;
-						}
-						else
-						{
-							$this->value['padding']['t'] = $this->ConvertToMM($val[0], 0);
-							$this->value['padding']['r'] = $this->ConvertToMM($val[1], 0);
-							$this->value['padding']['b'] = $this->ConvertToMM($val[2], 0);
-							$this->value['padding']['l'] = $this->ConvertToMM($val[3], 0);
-						}
-						break;
-
-					case 'padding-top':
-						$this->value['padding']['t'] = $this->ConvertToMM($val, 0);
-						break;
-
-					case 'padding-right':
-						$this->value['padding']['r'] = $this->ConvertToMM($val, 0);
-						break;
-
-					case 'padding-bottom':
-						$this->value['padding']['b'] = $this->ConvertToMM($val, 0);
-						break;
-
-					case 'padding-left':
-						$this->value['padding']['l'] = $this->ConvertToMM($val, 0);
-						break;
-
-					case 'margin':
-						if ($val=='auto')
-						{
-							$this->value['margin-auto'] = true;
-							break;
-						}
-						$val = explode(' ', $val);
-						foreach($val as $k => $v)
-						{
-							$v = trim($v);
-							if ($v!='') $val[$k] = $v;
-							else	unset($val[$k]);
-						}
-						$val = array_values($val);
-						if (count($val)!=4)
-						{
-							$val = $this->ConvertToMM($val[0], 0);
-							$this->value['margin']['t'] = $val;
-							$this->value['margin']['r'] = $val;
-							$this->value['margin']['b'] = $val;
-							$this->value['margin']['l'] = $val;
-						}
-						else
-						{
-							$this->value['margin']['t'] = $this->ConvertToMM($val[0], 0);
-							$this->value['margin']['r'] = $this->ConvertToMM($val[1], 0);
-							$this->value['margin']['b'] = $this->ConvertToMM($val[2], 0);
-							$this->value['margin']['l'] = $this->ConvertToMM($val[3], 0);
-						}
-						break;
-
-					case 'margin-top':
-						$this->value['margin']['t'] = $this->ConvertToMM($val, 0);
-						break;
-
-					case 'margin-right':
-						$this->value['margin']['r'] = $this->ConvertToMM($val, 0);
-						break;
-
-					case 'margin-bottom':
-						$this->value['margin']['b'] = $this->ConvertToMM($val, 0);
-						break;
-
-					case 'margin-left':
-						$this->value['margin']['l'] = $this->ConvertToMM($val, 0);
-						break;
-
-					case 'border':
-						$val = $this->readBorder($val);
-						$this->value['border']['t'] = $val;
-						$this->value['border']['r'] = $val;
-						$this->value['border']['b'] = $val;
-						$this->value['border']['l'] = $val;
-						break;
-
-					case 'border-style':
-						$val = explode(' ', $val);
-						foreach($val as $val_k => $val_v)
-							if (!in_array($val_v, array('solid', 'dotted', 'dashed')))
-								$val[$val_k] = null;
-						$this->duplicateBorder($val);
-
-						if ($val[0]) $this->value['border']['t']['type'] = $val[0];
-						if ($val[1]) $this->value['border']['r']['type'] = $val[1];
-						if ($val[2]) $this->value['border']['b']['type'] = $val[2];
-						if ($val[3]) $this->value['border']['l']['type'] = $val[3];
-						break;
-
-					case 'border-top-style':
-						if (in_array($val, array('solid', 'dotted', 'dashed')))
-							$this->value['border']['t']['type'] = $val;
-						break;
-
-					case 'border-right-style':
-						if (in_array($val, array('solid', 'dotted', 'dashed')))
-							$this->value['border']['r']['type'] = $val;
-						break;
-
-					case 'border-bottom-style':
-						if (in_array($val, array('solid', 'dotted', 'dashed')))
-							$this->value['border']['b']['type'] = $val;
-						break;
-
-					case 'border-left-style':
-						if (in_array($val, array('solid', 'dotted', 'dashed')))
-							$this->value['border']['l']['type'] = $val;
-						break;
-
-					case 'border-color':
-						$res = false;
-						$val = preg_replace('/,[\s]+/', ',', $val);
-						$val = explode(' ', $val);
-
-						foreach($val as $val_k => $val_v)
-						{
-								$val[$val_k] = $this->ConvertToRVB($val_v, $res);
-								if (!$res) $val[$val_k] = null;
-						}
-						$this->duplicateBorder($val);
-
-						if (is_array($val[0])) $this->value['border']['t']['color'] = $val[0];
-						if (is_array($val[1])) $this->value['border']['r']['color'] = $val[1];
-						if (is_array($val[2])) $this->value['border']['b']['color'] = $val[2];
-						if (is_array($val[3])) $this->value['border']['l']['color'] = $val[3];
-
-						break;
-
-					case 'border-top-color':
-						$res = false;
-						$val = $this->ConvertToRVB($val, $res);
-						if ($res) $this->value['border']['t']['color'] = $val;
-						break;
-
-					case 'border-right-color':
-						$res = false;
-						$val = $this->ConvertToRVB($val, $res);
-						if ($res) $this->value['border']['r']['color'] = $val;
-						break;
-
-					case 'border-bottom-color':
-						$res = false;
-						$val = $this->ConvertToRVB($val, $res);
-						if ($res) $this->value['border']['b']['color'] = $val;
-						break;
-
-					case 'border-left-color':
-						$res = false;
-						$val = $this->ConvertToRVB($val, $res);
-						if ($res) $this->value['border']['l']['color'] = $val;
-						break;
-
-					case 'border-width':
-						$val = explode(' ', $val);
-						foreach($val as $val_k => $val_v)
-						{
-								$val[$val_k] = $this->ConvertToMM($val_v, 0);
-						}
-						$this->duplicateBorder($val);
-
-						if ($val[0]) $this->value['border']['t']['width'] = $val[0];
-						if ($val[1]) $this->value['border']['r']['width'] = $val[1];
-						if ($val[2]) $this->value['border']['b']['width'] = $val[2];
-						if ($val[3]) $this->value['border']['l']['width'] = $val[3];
-						break;
-
-					case 'border-top-width':
-						$val = $this->ConvertToMM($val, 0);;
-						if ($val) $this->value['border']['t']['width'] = $val;
-						break;
-
-					case 'border-right-width':
-						$val = $this->ConvertToMM($val, 0);;
-						if ($val) $this->value['border']['r']['width'] = $val;
-						break;
-
-					case 'border-bottom-width':
-						$val = $this->ConvertToMM($val, 0);;
-						if ($val) $this->value['border']['b']['width'] = $val;
-						break;
-
-					case 'border-left-width':
-						$val = $this->ConvertToMM($val, 0);;
-						if ($val) $this->value['border']['l']['width'] = $val;
-						break;
-
-					case 'border-collapse':
-						if ($balise=='table') $this->value['border']['collapse'] = ($val=='collapse');
-						break;
-
-					case 'border-radius':
-						// nettoyage des valeurs
-						$val = explode(' ', $val);
-						foreach($val as $k => $v)
-						{
-							$v = trim($v);
-							if ($v)
-							{
-								$v = $this->ConvertToMM($v, 0);
-								if ($v) $val[$k] = $v;
-								else	unset($val[$k]);
-							}
-							else	unset($val[$k]);
-						}
-						$val = array_values($val);
-
-						if (!isset($val[1]) && isset($val[0])) $val[1] = $val[0];
-						if (count($val)==2)
-							$this->value['border']['radius'] = array($val[0], $val[1]);
-
-						break;
-
-					case 'border-top':
-						$this->value['border']['t'] = $this->readBorder($val);
-						break;
-
-					case 'border-right':
-						$this->value['border']['r'] = $this->readBorder($val);
-						break;
-
-					case 'border-bottom':
-						$this->value['border']['b'] = $this->readBorder($val);
-						break;
-
-					case 'border-left':
-						$this->value['border']['l'] = $this->readBorder($val);
-						break;
-
-					case 'background-color':
-						$this->value['background']['color'] = $this->ConvertBackgroundColor($val);
-						break;
-
-					case 'background-image':
-						$this->value['background']['image'] = $this->ConvertBackgroundImage($val);
-						break;
-
-					case 'background-position':
-						$res = null;
-						$this->value['background']['position'] = $this->ConvertBackgroundPosition($val, $res);
-						break;
-
-					case 'background-repeat':
-						$this->value['background']['repeat'] = $this->ConvertBackgroundRepeat($val);
-						break;
-
-					case 'background':
-						$this->ConvertBackground($val, $this->value['background']);
-						break;
-
-					case 'position':
-						if ($val=='absolute')		$this->value['position'] = 'absolute';
-						else if ($val=='relative')	$this->value['position'] = 'relative';
-						else						$this->value['position'] = null;
-						break;
-
-					case 'float':
-						if ($val=='left')			$this->value['float'] = 'left';
-						else if ($val=='right')		$this->value['float'] = 'right';
-						else						$this->value['float'] = null;
-						break;
-
-					case 'display':
-						if ($val=='inline')			$this->value['display'] = 'inline';
-						else if ($val=='block')		$this->value['display'] = 'block';
-						else if ($val=='none')		$this->value['display'] = 'none';
-						else						$this->value['display'] = null;
-						break;
-
-					case 'top':
-					case 'bottom':
-					case 'left':
-					case 'right':
-						$this->value[$nom] = $val;
-						break;
-
-					case 'list-style':
-					case 'list-style-type':
-					case 'list-style-image':
-						if ($nom=='list-style') $nom = 'list-style-type';
-						$this->value[$nom] = $val;
-						break;
-
-					default:
-						break;
-				}
-			}
-
-			if ($this->onlyLeft) $this->value['text-align'] = 'left';
-
-			// correction de la largeur pour correspondre au mod�le de boite quick
-			if ($no_width && in_array($balise, array('div')) && $this->value['position']!='absolute')
-			{
-				$this->value['width'] = $this->getLastWidth();
-				$this->value['width']-= $this->value['margin']['l'] + $this->value['margin']['r'];
-			}
-			else
-			{
-				if ($correct_width)
-				{
-					if (!in_array($balise, array('table', 'div', 'hr')))
-					{
-						$this->value['width']-= $this->value['padding']['l'] + $this->value['padding']['r'];
-						$this->value['width']-= $this->value['border']['l']['width'] + $this->value['border']['r']['width'];
-					}
-					if (in_array($balise, array('th', 'td')))
-					{
-						$this->value['width']-= $this->ConvertToMM(isset($param['cellspacing']) ? $param['cellspacing'] : '2px');
-					}
-					if ($this->value['width']<0) $this->value['width']=0;
-				}
-				else
-				{
-					if ($this->value['width'])
-					{
-						if ($this->value['border']['l']['width'])	$this->value['width']	+= $this->value['border']['l']['width'];
-						if ($this->value['border']['r']['width'])	$this->value['width']	+= $this->value['border']['r']['width'];
-						if ($this->value['padding']['l'])			$this->value['width']	+= $this->value['padding']['l'];
-						if ($this->value['padding']['r'])			$this->value['width']	+= $this->value['padding']['r'];
-					}
-				}
-			}
-			if ($this->value['height'])
-			{
-				if ($this->value['border']['b']['width']) { $this->value['height']	+= $this->value['border']['b']['width']; }
-				if ($this->value['border']['t']['width']) { $this->value['height']	+= $this->value['border']['t']['width']; }
-				if ($this->value['padding']['b'])			$this->value['height']	+= $this->value['padding']['b'];
-				if ($this->value['padding']['t'])			$this->value['height']	+= $this->value['padding']['t'];
-			}
-
-			if ($this->value['top']!=null)		$this->value['top']		= $this->ConvertToMM($this->value['top'],		$this->getLastHeight(true));
-			if ($this->value['bottom']!=null)	$this->value['bottom']	= $this->ConvertToMM($this->value['bottom'],	$this->getLastHeight(true));
-			if ($this->value['left']!=null)		$this->value['left']	= $this->ConvertToMM($this->value['left'],		$this->getLastWidth(true));
-			if ($this->value['right']!=null)	$this->value['right']	= $this->ConvertToMM($this->value['right'],		$this->getLastWidth(true));
-
-			if ($this->value['top'] && $this->value['bottom'] && $this->value['height'])	$this->value['bottom']	= null;
-			if ($this->value['left'] && $this->value['right'] && $this->value['width'])		$this->value['right']	= null;
-		}
-
- 		/**
-		 * R�cup�ration de la hauteur de ligne courante
-		 *
-		 * @return	float	hauteur en mm
-		 */
-		function getLineHeight()
-		{
-			$val = $this->value['line-height'];
-			if ($val=='normal') $val = '108%';
-			return $this->ConvertToMM($val, $this->value['font-size']);
-		}
-
- 		/**
-		 * R�cup�ration de la largeur de l'objet parent
-		 *
-		 * @return	float	largeur
-		 */
-		function getLastWidth($mode = false)
-		{
-			for($k=count($this->table); $k>0; $k--)
-			{
-				if ($this->table[$k-1]['width'])
-				{
-					$w = $this->table[$k-1]['width'];
-					if ($mode)
-					{
-						$w+= $this->table[$k-1]['border']['l']['width'] + $this->table[$k-1]['padding']['l']+0.02;
-						$w+= $this->table[$k-1]['border']['r']['width'] + $this->table[$k-1]['padding']['r']+0.02;
-					}
-					return $w;
-				}
-			}
-			return $this->pdf->w - $this->pdf->lMargin - $this->pdf->rMargin;
-		}
-
- 		/**
-		 * R�cup�ration de la hauteur de l'objet parent
-		 *
-		 * @return	float	hauteur
-		 */
-		function getLastHeight($mode = false)
-		{
-			for($k=count($this->table); $k>0; $k--)
-			{
-				if ($this->table[$k-1]['height'])
-				{
-					$h = $this->table[$k-1]['height'];
-					if ($mode)
-					{
-						$h+= $this->table[$k-1]['border']['t']['width'] + $this->table[$k-1]['padding']['t']+0.02;
-						$h+= $this->table[$k-1]['border']['b']['width'] + $this->table[$k-1]['padding']['b']+0.02;
-					}
-					return $h;
-				}
-			}
-			return $this->pdf->h - $this->pdf->tMargin - $this->pdf->bMargin;
-		}
-
-		function getFloat()
-		{
-			if ($this->value['float']=='left')	return 'left';
-			if ($this->value['float']=='right')	return 'right';
-			return null;
-		}
-
-		function getLastAbsoluteX()
-		{
-			for($k=count($this->table); $k>0; $k--)
-			{
-				if ($this->table[$k-1]['x'] && $this->table[$k-1]['position']) return $this->table[$k-1]['x'];
-			}
-			return $this->pdf->lMargin;
-		}
-
-		function getLastAbsoluteY()
-		{
-			for($k=count($this->table); $k>0; $k--)
-			{
-				if ($this->table[$k-1]['y'] && $this->table[$k-1]['position']) return $this->table[$k-1]['y'];
-			}
-			return $this->pdf->tMargin;
-		}
-
-		/**
-		 * R�cup�ration des propri�t�s CSS de la balise en cours
-		 *
-		 * @return	array()		tableau des propri�t�s CSS
-		 */
-		function getFromCSS()
-		{
-			$styles	= array();	// style ďż˝ appliquer
-			$getit	= array();	// styles � r�cuperer
-
-			// identification des styles direct, et ceux des parents
-			$lst = array();
-			$lst[] = $this->value['id_lst'];
-			for($i=count($this->table)-1; $i>=0; $i--) $lst[] = $this->table[$i]['id_lst'];
-
-			// identification des styles � r�cuperer
-			foreach($this->css_keys as $key => $num)
-				if ($this->getReccursiveStyle($key, $lst))
-					$getit[$key] = $num;
-
-			// si des styles sont ďż˝ recuperer
-			if (count($getit))
-			{
-				// on les r�cup�re, mais dans l'odre de d�finition, afin de garder les priorit�s
-				asort($getit);
-				foreach($getit as $key => $val) $styles = array_merge($styles, $this->css[$key]);
-			}
-
-			return $styles;
-		}
-
-		/**
-		 * Identification des styles � r�cuperer, en fonction de la balise et de ses parents
-		 *
-		 * @param	string		clef CSS ďż˝ analyser
-		 * @param	array()		tableau des styles direct, et ceux des parents
-		 * @param	string		prochaine etape
-		 * @return	boolean		clef autoris�e ou non
-		 */
-		function getReccursiveStyle($key, $lst, $next = null)
-		{
-			// si propchaine etape, on construit les valeurs
-			if ($next!==null)
-			{
-				if ($next) $key = trim(substr($key, 0, -strlen($next))); // on el�ve cette etape
-				unset($lst[0]);
-				if (!count($lst)) return false; // pas d'etape possible
-				$lst = array_values($lst);
-			}
-
-			// pour chaque style direct possible de l'etape en cours
-			foreach($lst[0] as $nom)
-			{
-				if ($key==$nom) return true; // si la clef conrrespond => ok
-				if (substr($key, -strlen(' '.$nom))==' '.$nom && $this->getReccursiveStyle($key, $lst, $nom)) return true; // si la clef est la fin, on analyse ce qui pr�c�de
-			}
-
-			// si on est pas ďż˝ la premiere etape, on doit analyse toutes les sous etapes
-			if ($next!==null && $this->getReccursiveStyle($key, $lst, '')) return true;
-
-			// aucun style trouvďż˝
-			return false;
-		}
-
-		/**
-		 * Analyse d'une propri�t� Border
-		 *
-		 * @param	string		propri�t� border
-		 * @return	array()		propri�t� d�cod�e
-		 */
-		function readBorder($val)
-		{
-			$none = array('type' => 'none', 'width' => 0, 'color' => array(0, 0, 0));
-
-			// valeurs par d�fault
-			$type	= 'solid';
-			$width	= $this->ConvertToMM('1pt');
-			$color	= array(0, 0, 0);
-
-			// nettoyage des valeurs
-			$val = explode(' ', $val);
-			foreach($val as $k => $v)
-			{
-				$v = trim($v);
-				if ($v)	$val[$k] = $v;
-				else	unset($val[$k]);
-			}
-			$val = array_values($val);
-			// identification des valeurs
-			$res = null;
-			foreach($val as $key)
-			{
-				if ($key=='none' || $key=='hidden') return $none;
-
-				if ($this->ConvertToMM($key)!==null)							$width = $this->ConvertToMM($key);
-				else if (in_array($key, array('solid', 'dotted', 'dashed')))	$type = $key;
-				else
-				{
-					$tmp = $this->ConvertToRVB($key, $res);
-					if ($res) $color = $tmp;
-				}
-			}
-			if (!$width) return $none;
-			return array('type' => $type, 'width' => $width, 'color' => $color);
-		}
-
-		function duplicateBorder(&$val)
-		{
-			if (count($val)==1)
-			{
-				$val[1] = $val[0];
-				$val[2] = $val[0];
-				$val[3] = $val[0];
-			}
-			else if (count($val)==2)
-			{
-				$val[2] = $val[0];
-				$val[3] = $val[1];
-			}
-			else if (count($val)==3)
-			{
-				$val[3] = $val[1];
-			}
-		}
-
-		function ConvertBackground($stl, &$res)
-		{
-			// Image
-			$text = '/url\(([^)]*)\)/isU';
-			if (preg_match($text, $stl, $match))
-			{
-				$res['image'] = $this->ConvertBackgroundImage($match[0]);
-				$stl = preg_replace($text, '', $stl);
-				$stl = preg_replace('/[\s]+/', ' ', $stl);
-			}
-
-			// protection des espaces
-			$stl = preg_replace('/,[\s]+/', ',', $stl);
-			$lst = explode(' ', $stl);
-
-			$pos = '';
-			foreach($lst as $val)
-			{
-				$ok = false;
-				$color = $this->ConvertToRVB($val, $ok);
-
-				if ($ok)
-				{
-					$res['color'] = $color;
-				}
-				else if ($val=='transparent')
-				{
-					$res['color'] = null;
-				}
-				else
-				{
-					$repeat = $this->ConvertBackgroundRepeat($val);
-					if ($repeat)
-					{
-						$res['repeat'] = $repeat;
-					}
-					else
-					{
-						$pos.= ($pos ? ' ' : '').$val;
-					}
-				}
-			}
-			if ($pos)
-			{
-				$pos = $this->ConvertBackgroundPosition($pos, $ok);
-				if ($ok) $res['position'] = $pos;
-			}
-		}
-
-		function ConvertBackgroundColor($val)
-		{
-			$res = null;
-			if ($val=='transparent')	return null;
-			else						return $this->ConvertToRVB($val, $res);
-		}
-
-		function ConvertBackgroundImage($val)
-		{
-			if ($val=='none')
-				return null;
-			else if (preg_match('/^url\(([^)]*)\)$/isU', $val, $match))
-				return $match[1];
-			else
-				return null;
-		}
-
-		function ConvertBackgroundPosition($val, &$res)
-		{
-			$val = explode(' ', $val);
-			if (count($val)<2)
-			{
-				if (!$val[0]) return null;
-				$val[1] = 'center';
-			}
-			if (count($val)>2) return null;
-
-			$x = 0;
-			$y = 0;
-			$res = true;
-
-			if ($val[0]=='left')		$x = '0%';
-			else if ($val[0]=='center')	$x = '50%';
-			else if ($val[0]=='right')	$x = '100%';
-			else if ($val[0]=='top')	$y = '0%';
-			else if ($val[0]=='bottom')	$y = '100%';
-			else if (preg_match('/^[-]?[0-9\.]+%$/isU',	$val[0])) $x = $val[0];
-			else if ($this->ConvertToMM($val[0])) $x = $this->ConvertToMM($val[0]);
-			else $res = false;
-
-			if ($val[1]=='left')		$x = '0%';
-			else if ($val[1]=='right')	$x = '100%';
-			else if ($val[1]=='top')	$y = '0%';
-			else if ($val[1]=='center')	$y = '50%';
-			else if ($val[1]=='bottom')	$y = '100%';
-			else if (preg_match('/^[-]?[0-9\.]+%$/isU',	$val[1])) $y = $val[1];
-			else if ($this->ConvertToMM($val[1])) $y = $this->ConvertToMM($val[1]);
-			else $res = false;
-
-			$val[0] = $x;
-			$val[1] = $y;
-
-			return $val;
-		}
-
- 		function ConvertBackgroundRepeat($val)
-		{
-			switch($val)
-			{
-				case 'repeat':
-					return array(true, true);
-				case 'repeat-x':
-					return array(true, false);
-				case 'repeat-y':
-					return array(false, true);
-				case 'no-repeat':
-					return array(false, false);
-			}
-			return null;
-		}
- 		/**
-		 * Convertir une longueur en mm
-		 *
-		 * @param	string			longueur, avec unitďż˝, ďż˝ convertir
-		 * @param	float			longueur du parent
-		 * @return	float			longueur exprim�e en mm
-		 */
-		function ConvertToMM($val, $old=0.)
-		{
-			$val = trim($val);
-			if (preg_match('/^[0-9\.\-]+$/isU', $val))			$val.= 'px';
-			if (preg_match('/^[0-9\.\-]+px$/isU', $val))		$val = 25.4/96. * str_replace('px', '', $val);
-			else if (preg_match('/^[0-9\.\-]+pt$/isU', $val))	$val = 25.4/72. * str_replace('pt', '', $val);
-			else if (preg_match('/^[0-9\.\-]+in$/isU', $val))	$val = 25.4 * str_replace('in', '', $val);
-			else if (preg_match('/^[0-9\.\-]+mm$/isU', $val))	$val = 1.*str_replace('mm', '', $val);
-			else if (preg_match('/^[0-9\.\-]+%$/isU', $val))	$val = 1.*$old*str_replace('%', '', $val)/100.;
-			else												$val = null;
-
-			return $val;
-		}
-
- 		/**
-		 * D�composition d'un code couleur HTML
-		 *
-		 * @param	string			couleur au format CSS
-		 * @return	array(r, v, b)	couleur exprimďż˝ par ses comporantes R, V, B, de 0 ďż˝ 255.
-		 */
-		function ConvertToRVB($val, &$res)
-		{
-			$val = trim($val);
-			$res = true;
-
-			if (strtolower($val)=='transparent') return array(null, null, null);
-			if (isset($this->htmlColor[strtolower($val)])) $val = $this->htmlColor[strtolower($val)];
-
-			if (preg_match('/rgb\([\s]*([0-9%]+)[\s]*,[\s]*([0-9%]+)[\s]*,[\s]*([0-9%]+)[\s]*\)/isU', $val, $match))
-			{
-				$r =$match[1]; if (substr($r, -1)=='%') $r = floor(255*substr($r, 0, -1)/100);
-				$v =$match[2]; if (substr($v, -1)=='%') $v = floor(255*substr($v, 0, -1)/100);
-				$b =$match[3]; if (substr($b, -1)=='%') $b = floor(255*substr($b, 0, -1)/100);
-			}
-			else if (strlen($val)==7 && substr($val, 0, 1)=='#')
-			{
-				$r = hexdec(substr($val, 1, 2));
-				$v = hexdec(substr($val, 3, 2));
-				$b = hexdec(substr($val, 5, 2));
-			}
-			else if (strlen($val)==4 && substr($val, 0, 1)=='#')
-			{
-				$r = hexdec(substr($val, 1, 1).substr($val, 1, 1));
-				$v = hexdec(substr($val, 2, 1).substr($val, 2, 1));
-				$b = hexdec(substr($val, 3, 1).substr($val, 3, 1));
-			}
-			else
-			{
-				$r=0;
-				$v=0;
-				$b=0;
-				$res = false;
-			}
-			return array(floor($r), floor($v), floor($b));
-		}
-
-		/**
-		 * Analyser une feuille de style
-		 *
-		 * @param	string			code CSS
-		 * @return	null
-		 */
-		function analyseStyle(&$code)
-		{
-			// on remplace tous les espaces, tab, \r, \n, par des espaces uniques
-			$code = preg_replace('/[\s]+/', ' ', $code);
-
-			// on enl�ve les commentaires
-			$code = preg_replace('/\/\*.*?\*\//s', '', $code);
-
-			// on analyse chaque style
-			preg_match_all('/([^{}]+){([^}]*)}/isU', $code, $match);
-			for($k=0; $k<count($match[0]); $k++)
-			{
-				// noms
-				$noms	= strtolower(trim($match[1][$k]));
-
-				// style, s�par� par des; => on remplie le tableau correspondant
-				$styles	= trim($match[2][$k]);
-				$styles = explode(';', $styles);
-				$stl = array();
-				foreach($styles as $style)
-				{
-					$tmp = explode(':', $style);
-					if (count($tmp)>1)
-					{
-						$cod = $tmp[0]; unset($tmp[0]); $tmp = implode(':', $tmp);
-						$stl[trim(strtolower($cod))] = trim($tmp);
-					}
-				}
-
-				// d�composition des noms par les ,
-				$noms = explode(',', $noms);
-				foreach($noms as $nom)
-				{
-					$nom = trim($nom);
-					// Si il a une fonction sp�cifique, comme :hover => on zap
-					if (strpos($nom, ':')!==false) continue;
-					if (!isset($this->css[$nom]))
-						$this->css[$nom] = $stl;
-					else
-						$this->css[$nom] = array_merge($this->css[$nom], $stl);
-
-				}
-			}
-
-			$this->css_keys = array_flip(array_keys($this->css));
-		}
-
-		/**
-		 * Extraction des feuille de style du code HTML
-		 *
-		 * @param	string			code HTML
-		 * @return	null
-		 */
-		function readStyle(&$html)
-		{
-			$style = ' ';
-
-			// extraction des balises link, et suppression de celles-ci dans le code HTML
-			preg_match_all('/<link([^>]*)>/isU', $html, $match);
-			$html = preg_replace('/<link[^>]*>/isU',	'', $html);
-			$html = preg_replace('/<\/link[^>]*>/isU',	'', $html);
-
-			// analyse de chaque balise
-			foreach($match[1] as $code)
-			{
-				$tmp = array();
-				// lecture des param�tres du type nom=valeur
-				$prop = '([a-zA-Z0-9_]+)=([^"\'\s>]+)';
-				preg_match_all('/'.$prop.'/is', $code, $match);
-				for($k=0; $k<count($match[0]); $k++)
-					$tmp[trim(strtolower($match[1][$k]))] = trim($match[2][$k]);
-
-				// lecture des param�tres du type nom="valeur"
-				$prop = '([a-zA-Z0-9_]+)=["]([^"]*)["]';
-				preg_match_all('/'.$prop.'/is', $code, $match);
-				for($k=0; $k<count($match[0]); $k++)
-					$tmp[trim(strtolower($match[1][$k]))] = trim($match[2][$k]);
-
-				// lecture des param�tres du type nom='valeur'
-				$prop = "([a-zA-Z0-9_]+)=[']([^']*)[']";
-				preg_match_all('/'.$prop.'/is', $code, $match);
-				for($k=0; $k<count($match[0]); $k++)
-					$tmp[trim(strtolower($match[1][$k]))] = trim($match[2][$k]);
-
-				// si de type text/css => on garde
-				if (isset($tmp['type']) && strtolower($tmp['type'])=='text/css' && isset($tmp['href']))
-				{
-					$content = @file_get_contents($tmp['href']);
-					$url = $tmp['href'];
-					if (strpos($url, 'http://')!==false)
-					{
-						$url = str_replace('http://', '', $url);
-						$url = explode('/', $url);
-						$url_main = 'http://'.$url[0].'/';
-						$url_self = $url; unset($url_self[count($url_self)-1]); $url_self = 'http://'.implode('/', $url_self).'/';
-
-						$content = preg_replace('/url\(([^\\\\][^)]*)\)/isU', 'url('.$url_self.'$1)', $content);
-						$content = preg_replace('/url\((\\\\[^)]*)\)/isU', 'url('.$url_main.'$1)', $content);
-					}
-
-					$style.= $content."\n";
-				}
-			}
-
-
-			// extraction des balises style, et suppression de celles-ci dans le code HTML
-			preg_match_all('/<style[^>]*>(.*)<\/style[^>]*>/isU', $html, $match);
-			$html = preg_replace('/<style[^>]*>(.*)<\/style[^>]*>/isU', '', $html);
-
-			// analyse de chaque balise
-			foreach($match[1] as $code)
-			{
-				$code = str_replace('<!--', '', $code);
-				$code = str_replace('-->', '', $code);
-				$style.= $code."\n";
-			}
-
-			$this->analyseStyle($style);
-		}
-	}
-}
-?>
+<?php
+/**
+ * Logiciel : HTML2PDF - classe styleHTML
+ * 
+ * Convertisseur HTML => PDF, utilise fpdf de Olivier PLATHEY 
+ * Distribué sous la licence LGPL. 
+ *
+ * @author		Laurent MINGUET <webmaster@spipu.net>
+ * @version		3.26 - 16/11/2009
+ */
+ 
+if (!defined('__CLASS_STYLEHTML__'))
+{
+	define('__CLASS_STYLEHTML__', true);
+	
+	class styleHTML
+	{
+		var $css		= array();		// tableau des CSS
+		var $css_keys	= array();		// tableau des clefs CSS, pour l'ordre d'execution
+		var $value		= array();		// valeurs actuelles
+		var $table		= array();		// tableau d'empilement pour historisation des niveaux
+		var $pdf		= null;			// référence au PDF parent
+		var $htmlColor	= array();		// liste des couleurs HTML
+		var $onlyLeft	= false;		// indique si on est dans un sous HTML et qu'on bloque ŕ gauche
+		var $defaultFont = null;		// fonte par défaut si la fonte demandée n'existe pas
+		
+		/**
+		 * Constructeur
+		 *
+		 * @param	&pdf		référence ŕ l'objet HTML2PDF parent
+		 * @return	null
+		 */
+		function styleHTML(&$pdf)
+		{
+			$this->init();		// initialisation
+			$this->pdf = &$pdf;
+		}
+			
+		/**
+		* 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;
+			if ($default) $this->value['font-family'] = $default;
+			return $old;
+		}
+		
+ 		/**
+		 * Initialisation du style
+		 *
+		 * @return	null
+		 */
+		function init()
+		{
+			$color = array();
+			$color['AliceBlue']			= '#F0F8FF';
+			$color['AntiqueWhite']		= '#FAEBD7';
+			$color['Aqua']				= '#00FFFF';
+			$color['Aquamarine']		= '#7FFFD4';
+			$color['Azure']				= '#F0FFFF';
+			$color['Beige']				= '#F5F5DC';
+			$color['Bisque']			= '#FFE4C4';
+			$color['Black']				= '#000000';
+			$color['BlanchedAlmond']	= '#FFEBCD';
+			$color['Blue']				= '#0000FF';
+			$color['BlueViolet']		= '#8A2BE2';
+			$color['Brown']				= '#A52A2A';
+			$color['BurlyWood']			= '#DEB887';
+			$color['CadetBlue']			= '#5F9EA0';
+			$color['Chartreuse']		= '#7FFF00';
+			$color['Chocolate']			= '#D2691E';
+			$color['Coral']				= '#FF7F50';
+			$color['CornflowerBlue']	= '#6495ED';
+			$color['Cornsilk']			= '#FFF8DC';
+			$color['Crimson']			= '#DC143C';
+			$color['Cyan']				= '#00FFFF';
+			$color['DarkBlue']			= '#00008B';
+			$color['DarkCyan']			= '#008B8B';
+			$color['DarkGoldenRod']		= '#B8860B';
+			$color['DarkGray']			= '#A9A9A9';
+			$color['DarkGrey']			= '#A9A9A9';
+			$color['DarkGreen']			= '#006400';
+			$color['DarkKhaki']			= '#BDB76B';
+			$color['DarkMagenta']		= '#8B008B';
+			$color['DarkOliveGreen']	= '#556B2F';
+			$color['Darkorange']		= '#FF8C00';
+			$color['DarkOrchid']		= '#9932CC';
+			$color['DarkRed']			= '#8B0000';
+			$color['DarkSalmon']		= '#E9967A';
+			$color['DarkSeaGreen']		= '#8FBC8F';
+			$color['DarkSlateBlue']		= '#483D8B';
+			$color['DarkSlateGray']		= '#2F4F4F';
+			$color['DarkSlateGrey']		= '#2F4F4F';
+			$color['DarkTurquoise']		= '#00CED1';
+			$color['DarkViolet']		= '#9400D3';
+			$color['DeepPink']			= '#FF1493';
+			$color['DeepSkyBlue']		= '#00BFFF';
+			$color['DimGray']			= '#696969';
+			$color['DimGrey']			= '#696969';
+			$color['DodgerBlue']		= '#1E90FF';
+			$color['FireBrick']			= '#B22222';
+			$color['FloralWhite']		= '#FFFAF0';
+			$color['ForestGreen']		= '#228B22';
+			$color['Fuchsia']			= '#FF00FF';
+			$color['Gainsboro']			= '#DCDCDC';
+			$color['GhostWhite']		= '#F8F8FF';
+			$color['Gold']				= '#FFD700';
+			$color['GoldenRod']			= '#DAA520';
+			$color['Gray']				= '#808080';
+			$color['Grey']				= '#808080';
+			$color['Green']				= '#008000';
+			$color['GreenYellow']		= '#ADFF2F';
+			$color['HoneyDew']			= '#F0FFF0';
+			$color['HotPink']			= '#FF69B4';
+			$color['IndianRed']			= '#CD5C5C';
+			$color['Indigo']			= '#4B0082';
+			$color['Ivory']				= '#FFFFF0';
+			$color['Khaki']				= '#F0E68C';
+			$color['Lavender']			= '#E6E6FA';
+			$color['LavenderBlush']		= '#FFF0F5';
+			$color['LawnGreen']			= '#7CFC00';
+			$color['LemonChiffon']		= '#FFFACD';
+			$color['LightBlue']			= '#ADD8E6';
+			$color['LightCoral']		= '#F08080';
+			$color['LightCyan']			= '#E0FFFF';
+			$color['LightGoldenRodYellow']	= '#FAFAD2';
+			$color['LightGray']			= '#D3D3D3';
+			$color['LightGrey']			= '#D3D3D3';
+			$color['LightGreen']		= '#90EE90';
+			$color['LightPink']			= '#FFB6C1';
+			$color['LightSalmon']		= '#FFA07A';
+			$color['LightSeaGreen']		= '#20B2AA';
+			$color['LightSkyBlue']		= '#87CEFA';
+			$color['LightSlateGray']	= '#778899';
+			$color['LightSlateGrey']	= '#778899';
+			$color['LightSteelBlue']	= '#B0C4DE';
+			$color['LightYellow']		= '#FFFFE0';
+			$color['Lime']				= '#00FF00';
+			$color['LimeGreen']			= '#32CD32';
+			$color['Linen']				= '#FAF0E6';
+			$color['Magenta']			= '#FF00FF';
+			$color['Maroon']			= '#800000';
+			$color['MediumAquaMarine']	= '#66CDAA';
+			$color['MediumBlue']		= '#0000CD';
+			$color['MediumOrchid']		= '#BA55D3';
+			$color['MediumPurple']		= '#9370D8';
+			$color['MediumSeaGreen']	= '#3CB371';
+			$color['MediumSlateBlue']	= '#7B68EE';
+			$color['MediumSpringGreen']	= '#00FA9A';
+			$color['MediumTurquoise']	= '#48D1CC';
+			$color['MediumVioletRed']	= '#C71585';
+			$color['MidnightBlue']		= '#191970';
+			$color['MintCream']			= '#F5FFFA';
+			$color['MistyRose']			= '#FFE4E1';
+			$color['Moccasin']			= '#FFE4B5';
+			$color['NavajoWhite']		= '#FFDEAD';
+			$color['Navy']				= '#000080';
+			$color['OldLace']			= '#FDF5E6';
+			$color['Olive']				= '#808000';
+			$color['OliveDrab']			= '#6B8E23';
+			$color['Orange']			= '#FFA500';
+			$color['OrangeRed']			= '#FF4500';
+			$color['Orchid']			= '#DA70D6';
+			$color['PaleGoldenRod']		= '#EEE8AA';
+			$color['PaleGreen']			= '#98FB98';
+			$color['PaleTurquoise']		= '#AFEEEE';
+			$color['PaleVioletRed']		= '#D87093';
+			$color['PapayaWhip']		= '#FFEFD5';
+			$color['PeachPuff']			= '#FFDAB9';
+			$color['Peru']				= '#CD853F';
+			$color['Pink']				= '#FFC0CB';
+			$color['Plum']				= '#DDA0DD';
+			$color['PowderBlue']		= '#B0E0E6';
+			$color['Purple']			= '#800080';
+			$color['Red']				= '#FF0000';
+			$color['RosyBrown']			= '#BC8F8F';
+			$color['RoyalBlue']			= '#4169E1';
+			$color['SaddleBrown']		= '#8B4513';
+			$color['Salmon']			= '#FA8072';
+			$color['SandyBrown']		= '#F4A460';
+			$color['SeaGreen']			= '#2E8B57';
+			$color['SeaShell']			= '#FFF5EE';
+			$color['Sienna']			= '#A0522D';
+			$color['Silver']			= '#C0C0C0';
+			$color['SkyBlue']			= '#87CEEB';
+			$color['SlateBlue']			= '#6A5ACD';
+			$color['SlateGray']			= '#708090';
+			$color['SlateGrey']			= '#708090';
+			$color['Snow']				= '#FFFAFA';
+			$color['SpringGreen']		= '#00FF7F';
+			$color['SteelBlue']			= '#4682B4';
+			$color['Tan']				= '#D2B48C';
+			$color['Teal']				= '#008080';
+			$color['Thistle']			= '#D8BFD8';
+			$color['Tomato']			= '#FF6347';
+			$color['Turquoise']			= '#40E0D0';
+			$color['Violet']			= '#EE82EE';
+			$color['Wheat']				= '#F5DEB3';
+			$color['White']				= '#FFFFFF';
+			$color['WhiteSmoke']		= '#F5F5F5';
+			$color['Yellow']			= '#FFFF00';
+			$color['YellowGreen']		= '#9ACD32';
+			
+			$this->htmlColor = array();
+			foreach($color as $key => $val) $this->htmlColor[strtolower($key)] = $val;			
+			unset($color);
+			
+			$this->table = array();
+			
+			$this->value = array();
+			$this->initStyle();
+			
+			// initialisation des styles sans héritages
+			$this->resetStyle();
+		}
+		
+		function initStyle()
+		{
+	 		$this->value['id_balise']			= 'body';		// balise
+			$this->value['id_name']				= null;			// name
+			$this->value['id_id']				= null;			// id
+			$this->value['id_class']			= null;			// class
+			$this->value['id_lst']				= array('*');	// lst de dependance
+			$this->value['mini-size']			= 1.;			// rapport de taille	spécifique aux sup, sub
+			$this->value['mini-decal']			= 0;			// rapport de position	spécifique aux sup, sub
+			$this->value['font-family']			= 'Arial';
+			$this->value['font-bold']			= false;
+			$this->value['font-italic']			= false;
+			$this->value['font-underline']		= false;
+			$this->value['font-overline']		= false;
+			$this->value['font-linethrough']	= false;
+			$this->value['text-transform']		= 'none';
+			$this->value['font-size']			= $this->ConvertToMM('10pt');
+			$this->value['text-indent']			= 0;
+			$this->value['text-align']			= 'left';
+			$this->value['vertical-align']		= 'middle';
+			$this->value['line-height']			= 'normal';
+
+			$this->value['position']			= null;
+			$this->value['x']					= null;
+			$this->value['y']					= null;
+			$this->value['width']				= 0;
+			$this->value['height']				= 0;
+			$this->value['top']					= null;
+			$this->value['right']				= null;
+			$this->value['bottom']				= null;
+			$this->value['left']				= null;
+			$this->value['float']				= null;
+			$this->value['display']				= null;
+			$this->value['rotate']				= null;
+			$this->value['overflow']			= 'visible';
+			
+			$this->value['color']				= array(0, 0, 0);
+			$this->value['background']			= array('color' => null, 'image' => null, 'position' => null, 'repeat' => null);
+			$this->value['border']				= array();
+			$this->value['padding']				= array();
+			$this->value['margin']				= array();
+			$this->value['margin-auto']			= false;
+
+			$this->value['list-style-type']		= '';
+			$this->value['list-style-image']	= '';
+
+			$this->value['xc']					= null;
+			$this->value['yc']					= null;
+		}
+		
+		/**
+		 * Initialisation des styles sans héritages
+		 *
+		 * @param	string	balise HTML
+		 * @return	null
+		 */
+		function resetStyle($balise = '')
+		{
+			$collapse = isset($this->value['border']['collapse']) ? $this->value['border']['collapse'] : false;
+			if (!in_array($balise, array('tr', 'td', 'th'))) $collapse = false;
+			
+			$this->value['position']			= null;
+			$this->value['x']					= null;
+			$this->value['y']					= null;
+			$this->value['width']				= 0;
+			$this->value['height']				= 0;
+			$this->value['top']					= null;
+			$this->value['right']				= null;
+			$this->value['bottom']				= null;
+			$this->value['left']				= null;
+			$this->value['float']				= null;
+			$this->value['display']				= null;
+			$this->value['rotate']				= null;
+			$this->value['overflow']			= 'visible';
+			$this->value['background']			= array('color' => null, 'image' => null, 'position' => null, 'repeat' => null);
+			$this->value['border']	= array(
+										't' => $this->readBorder('none'),
+										'r' => $this->readBorder('none'),
+										'b' => $this->readBorder('none'),
+										'l' => $this->readBorder('none'),
+										'radius' => array(0, 0),
+										'collapse' => $collapse,
+									);
+
+			if (!in_array($balise, array('h1', 'h2', 'h3', 'h4', 'h5', 'h6')))
+			$this->value['margin']	= array(
+									't' => 0,
+									'r' => 0,
+									'b' => 0,
+									'l' => 0
+								);
+			$this->value['margin-auto'] = false;
+			
+			if (in_array($balise, array('div')))
+				$this->value['vertical-align']	 = 'top';
+
+			if (in_array($balise, array('ul', 'li')))
+			{
+				$this->value['list-style-type']		= '';
+				$this->value['list-style-image']	= '';
+			}
+
+			if (!in_array($balise, array('tr', 'td')))
+			{
+				$this->value['padding']	= array(
+										't' => 0,
+										'r' => 0,
+										'b' => 0,
+										'l' => 0
+									);
+			}
+			else
+			{
+				$this->value['padding']	= array(
+										't' => $this->ConvertToMM('1px'),
+										'r' => $this->ConvertToMM('1px'),
+										'b' => $this->ConvertToMM('1px'),
+										'l' => $this->ConvertToMM('1px')
+									);
+			}
+			
+			if ($balise=='hr')
+			{
+				$this->value['border']	= array(
+										't' => $this->readBorder('solid 1px #000000'),
+										'r' => $this->readBorder('solid 1px #000000'),
+										'b' => $this->readBorder('solid 1px #000000'),
+										'l' => $this->readBorder('solid 1px #000000'),
+										'radius' => array(0, 0),
+										'collapse' => false,
+									);
+				$this->ConvertBackground('#FFFFFF', $this->value['background']);
+			}
+
+			$this->value['xc']					= null;
+			$this->value['yc']					= null;
+		}
+		
+		/**
+		 * Initialisation de la font PDF
+		 *
+		 * @return	null
+		 */
+		function FontSet()
+		{
+			$family = strtolower($this->value['font-family']);
+			$b = ($this->value['font-bold']			? 'B' : '');
+			$i = ($this->value['font-italic']		? 'I' : '');
+			$u = ($this->value['font-underline']	? 'U' : '');
+
+			if ($this->defaultFont)
+			{
+				$style = $b.$i;
+				if($family=='arial')
+					$family='helvetica';
+				elseif($family=='symbol' || $family=='zapfdingbats')
+					$style='';
+					
+				$fontkey = $family.$style;
+				if (!isset($this->pdf->fonts[$fontkey]))
+					if (!isset($this->pdf->CoreFonts[$fontkey]))
+						$family = $this->defaultFont;
+			}
+					
+			// taille en mm, ŕ ramener en pt
+			$size = $this->value['font-size'];
+			$size = 72 * $size / 25.4;
+			
+			$this->pdf->setOverline($this->value['font-overline']);
+			$this->pdf->setLinethrough($this->value['font-linethrough']);
+			
+			// application de la fonte 
+			$this->pdf->SetFont($family, $b.$i.$u, $this->value['mini-size']*$size);
+			$this->pdf->setMyTextColor($this->value['color']);
+			if ($this->value['background']['color'])
+				$this->pdf->setMyFillColor($this->value['background']['color']);
+			else
+				$this->pdf->setMyFillColor(1.);				
+		}
+
+ 		/**
+		 * Monter d'un niveau dans l'historisation
+		 *
+		 * @return	null
+		 */		
+		function save()
+		{
+			$this->table[count($this->table)] = $this->value;
+		}
+		
+ 		/**
+		 * Descendre d'un niveau dans l'historisation
+		 *
+		 * @return	null
+		 */		
+		function load()
+		{
+			if (count($this->table))
+			{
+				$this->value = $this->table[count($this->table)-1];
+				unset($this->table[count($this->table)-1]);
+			}
+		}
+
+		function restorePosition(&$current_x, &$current_y)
+		{
+			if ($this->value['y']==$current_y) $current_y = $this->value['yc'];
+		}
+		
+		function setPosition(&$current_x, &$current_y)
+		{
+			$this->value['xc'] = $current_x;
+			$this->value['yc'] = $current_y;
+			
+			if ($this->value['position']=='relative' || $this->value['position']=='absolute')
+			{
+				if ($this->value['right']!==null)
+				{
+					$x = $this->getLastWidth(true) - $this->value['right'] - $this->value['width'];
+					if ($this->value['margin']['r']) $x-= $this->value['margin']['r'];
+				} 
+				else
+				{
+					$x = $this->value['left'];
+					if ($this->value['margin']['l']) $x+= $this->value['margin']['l'];
+				}
+				
+				if ($this->value['bottom']!==null)
+				{
+					$y = $this->getLastHeight(true) - $this->value['bottom'] - $this->value['height'];
+					if ($this->value['margin']['b']) $y-= $this->value['margin']['b'];
+				} 	
+				else
+				{
+					$y = $this->value['top'];
+					if ($this->value['margin']['t']) $y+= $this->value['margin']['t'];
+				}
+								
+				if ($this->value['position']=='relative')
+				{
+					$this->value['x'] = $current_x + $x;
+					$this->value['y'] = $current_y + $y;
+				}
+				else
+				{
+					$this->value['x'] = $this->getLastAbsoluteX()+$x;
+					$this->value['y'] = $this->getLastAbsoluteY()+$y;					
+				}
+			}
+			else
+			{
+				$this->value['x'] = $current_x;
+				$this->value['y'] = $current_y;	
+				if ($this->value['margin']['l'])	$this->value['x']+= $this->value['margin']['l'];
+				if ($this->value['margin']['t'])	$this->value['y']+= $this->value['margin']['t'];
+			}
+			
+			$current_x = $this->value['x'];
+			$current_y = $this->value['y'];
+		}
+
+ 		/**
+		 * Analyse un tableau de style provenant du parseurHTML
+		 *
+		 * @param	string	nom de la balise
+		 * @param	array	tableau de style
+		 * @return	null
+		 */			
+		function analyse($balise, &$param)
+		{
+			// preparation
+			$balise = strtolower($balise);
+			$id		= isset($param['id'])		? strtolower(trim($param['id']))	: null; if (!$id)	$id		= null;
+			$name	= isset($param['name'])		? strtolower(trim($param['name']))	: null; if (!$name)	$name	= null;
+
+			// lecture de la propriete classe
+			$class = array();
+			$tmp	= isset($param['class'])	? preg_replace('/[\s]+/', ' ', strtolower($param['class']))	: '';
+			$tmp = explode(' ', $tmp);
+			foreach($tmp as $k => $v)
+			{
+				$v = trim($v);
+				if ($v) $class[] = $v;
+			}
+
+			// identification de la balise et des styles direct qui pourraient lui ętre appliqués
+			$this->value['id_balise']	= $balise;
+			$this->value['id_name']		= $name;
+			$this->value['id_id']		= $id;
+			$this->value['id_class']	= $class;
+			$this->value['id_lst']		= array();
+			$this->value['id_lst'][] = '*';
+			$this->value['id_lst'][] = $balise;
+			if (count($class))
+			{
+				foreach($class as $v)
+				{ 
+					$this->value['id_lst'][] = '*.'.$v;
+					$this->value['id_lst'][] = '.'.$v;
+					$this->value['id_lst'][] = $balise.'.'.$v;
+				}
+			}
+			if ($id)
+			{
+				$this->value['id_lst'][] = '*#'.$id;
+				$this->value['id_lst'][] = '#'.$id;
+				$this->value['id_lst'][] = $balise.'#'.$id;
+			}
+			
+			// style CSS
+			$styles = $this->getFromCSS();
+
+			// on ajoute le style propre ŕ la balise
+			$styles = array_merge($styles, $param['style']);
+			if (isset($param['allwidth']) && !isset($styles['width'])) $styles['width'] = '100%';
+
+			// mise ŕ zero des styles non hérités
+			$this->resetStyle($balise);
+					
+			// interpreration des nouvelles valeurs
+			$correct_width = false;
+			$no_width = true;
+
+			foreach($styles as $nom => $val)
+			{
+				switch($nom)
+				{
+					case 'font-family':
+						$val = explode(',', $val);
+						$val = trim($val[0]);
+
+						if ($val) $this->value['font-family'] = $val;
+						break;
+						
+					case 'font-weight':
+						$this->value['font-bold'] = ($val=='bold');
+						break;
+					
+					case 'font-style':
+						$this->value['font-italic'] = ($val=='italic');
+						break;
+					
+					case 'text-decoration':
+						$val = explode(' ', $val);
+						$this->value['font-underline']		= (in_array('underline',	$val));
+						$this->value['font-overline']		= (in_array('overline',		$val));
+						$this->value['font-linethrough']	= (in_array('line-through',	$val));
+						break;
+					
+					case 'text-indent':
+						$this->value['text-indent']			= $this->ConvertToMM($val);
+						break;
+					
+					case 'text-transform':
+						if (!in_array($val, array('none', 'capitalize', 'uppercase', 'lowercase'))) $val = 'none';
+						$this->value['text-transform']		= $val;
+						break;
+						
+					case 'font-size':
+						$val = $this->ConvertToMM($val, $this->value['font-size']);
+						if ($val) $this->value['font-size'] = $val;
+						break;
+					
+					case 'color':
+						$res = null;
+						$this->value['color'] = $this->ConvertToColor($val, $res);
+						
+						if ($balise=='hr')
+						{
+							$this->value['border']['l']['color'] = $this->value['color'];
+							$this->value['border']['t']['color'] = $this->value['color'];
+							$this->value['border']['r']['color'] = $this->value['color'];
+							$this->value['border']['b']['color'] = $this->value['color'];
+						}
+						break;
+					
+					case 'text-align':
+						$this->value['text-align'] = $val;
+						break;
+						
+					case 'vertical-align':
+						$this->value['vertical-align'] = $val;
+						break;
+					
+					case 'width':
+						$this->value['width'] = $this->ConvertToMM($val, $this->getLastWidth());
+						if ($this->value['width'] && substr($val, -1)=='%') $correct_width=true;
+						$no_width = false;
+						break;
+					
+					case 'height':
+						$this->value['height'] = $this->ConvertToMM($val, $this->getLastHeight());
+						break;
+				
+					case 'line-height':
+						if (preg_match('/^[0-9\.]+$/isU', $val)) $val = floor($val*100).'%';
+						$this->value['line-height'] = $val;
+						break;
+						
+					case 'rotate':
+						if (!in_array($val, array(0, -90, 90, 180, 270, -180, -270))) $val = null;
+						if ($val<0) $val+= 360;
+						$this->value['rotate'] = $val;
+						break;
+						
+					case 'overflow':
+						if (!in_array($val, array('visible', 'hidden'))) $val = 'visible';
+						$this->value['overflow'] = $val;
+						break;
+						
+					case 'padding':
+						$val = explode(' ', $val);
+						foreach($val as $k => $v)
+						{
+							$v = trim($v);
+							if ($v!='') $val[$k] = $v;
+							else	unset($val[$k]);
+						}
+						$val = array_values($val);
+						if (count($val)!=4)
+						{
+							$val = $this->ConvertToMM($val[0], 0);
+							$this->value['padding']['t'] = $val;
+							$this->value['padding']['r'] = $val;
+							$this->value['padding']['b'] = $val;
+							$this->value['padding']['l'] = $val;
+						}
+						else
+						{
+							$this->value['padding']['t'] = $this->ConvertToMM($val[0], 0);
+							$this->value['padding']['r'] = $this->ConvertToMM($val[1], 0);
+							$this->value['padding']['b'] = $this->ConvertToMM($val[2], 0);
+							$this->value['padding']['l'] = $this->ConvertToMM($val[3], 0);							
+						}
+						break;
+						
+					case 'padding-top':
+						$this->value['padding']['t'] = $this->ConvertToMM($val, 0);
+						break;
+
+					case 'padding-right':
+						$this->value['padding']['r'] = $this->ConvertToMM($val, 0);
+						break;
+
+					case 'padding-bottom':
+						$this->value['padding']['b'] = $this->ConvertToMM($val, 0);
+						break;
+
+					case 'padding-left':
+						$this->value['padding']['l'] = $this->ConvertToMM($val, 0);
+						break;
+												
+					case 'margin':
+						if ($val=='auto')
+						{
+							$this->value['margin-auto'] = true;
+							break;	
+						}
+						$val = explode(' ', $val);
+						foreach($val as $k => $v)
+						{
+							$v = trim($v);
+							if ($v!='') $val[$k] = $v;
+							else	unset($val[$k]);
+						}
+						$val = array_values($val);
+						if (count($val)!=4)
+						{
+							$val = $this->ConvertToMM($val[0], 0);
+							$this->value['margin']['t'] = $val;
+							$this->value['margin']['r'] = $val;
+							$this->value['margin']['b'] = $val;
+							$this->value['margin']['l'] = $val;
+						}
+						else
+						{
+							$this->value['margin']['t'] = $this->ConvertToMM($val[0], 0);
+							$this->value['margin']['r'] = $this->ConvertToMM($val[1], 0);
+							$this->value['margin']['b'] = $this->ConvertToMM($val[2], 0);
+							$this->value['margin']['l'] = $this->ConvertToMM($val[3], 0);							
+						}
+						break;
+						
+					case 'margin-top':
+						$this->value['margin']['t'] = $this->ConvertToMM($val, 0);
+						break;
+
+					case 'margin-right':
+						$this->value['margin']['r'] = $this->ConvertToMM($val, 0);
+						break;
+
+					case 'margin-bottom':
+						$this->value['margin']['b'] = $this->ConvertToMM($val, 0);
+						break;
+
+					case 'margin-left':
+						$this->value['margin']['l'] = $this->ConvertToMM($val, 0);
+						break;
+	
+					case 'border':
+						$val = $this->readBorder($val);
+						$this->value['border']['t'] = $val;
+						$this->value['border']['r'] = $val;
+						$this->value['border']['b'] = $val;
+						$this->value['border']['l'] = $val;
+						break;
+						
+					case 'border-style':
+						$val = explode(' ', $val);
+						foreach($val as $val_k => $val_v)
+							if (!in_array($val_v, array('solid', 'dotted', 'dashed')))
+								$val[$val_k] = null; 
+						$this->duplicateBorder($val);
+						
+						if ($val[0]) $this->value['border']['t']['type'] = $val[0];
+						if ($val[1]) $this->value['border']['r']['type'] = $val[1];
+						if ($val[2]) $this->value['border']['b']['type'] = $val[2];
+						if ($val[3]) $this->value['border']['l']['type'] = $val[3];
+						break;
+
+					case 'border-top-style':
+						if (in_array($val, array('solid', 'dotted', 'dashed'))) 
+							$this->value['border']['t']['type'] = $val;
+						break;
+
+					case 'border-right-style':
+						if (in_array($val, array('solid', 'dotted', 'dashed'))) 
+							$this->value['border']['r']['type'] = $val;
+						break;
+
+					case 'border-bottom-style':
+						if (in_array($val, array('solid', 'dotted', 'dashed'))) 
+							$this->value['border']['b']['type'] = $val;
+						break;
+
+					case 'border-left-style':
+						if (in_array($val, array('solid', 'dotted', 'dashed'))) 
+							$this->value['border']['l']['type'] = $val;
+						break;
+
+					case 'border-color':
+						$res = false;
+						$val = preg_replace('/,[\s]+/', ',', $val); 
+						$val = explode(' ', $val);
+
+						foreach($val as $val_k => $val_v)
+						{
+								$val[$val_k] = $this->ConvertToColor($val_v, $res);
+								if (!$res) $val[$val_k] = null;
+						}
+						$this->duplicateBorder($val);
+
+						if (is_array($val[0])) $this->value['border']['t']['color'] = $val[0];
+						if (is_array($val[1])) $this->value['border']['r']['color'] = $val[1];
+						if (is_array($val[2])) $this->value['border']['b']['color'] = $val[2];
+						if (is_array($val[3])) $this->value['border']['l']['color'] = $val[3];
+						
+						break;
+
+					case 'border-top-color':
+						$res = false;
+						$val = $this->ConvertToColor($val, $res); 
+						if ($res) $this->value['border']['t']['color'] = $val;
+						break;
+
+					case 'border-right-color':
+						$res = false;
+						$val = $this->ConvertToColor($val, $res); 
+						if ($res) $this->value['border']['r']['color'] = $val;
+						break;
+
+					case 'border-bottom-color':
+						$res = false;
+						$val = $this->ConvertToColor($val, $res); 
+						if ($res) $this->value['border']['b']['color'] = $val;
+						break;
+
+					case 'border-left-color':
+						$res = false;
+						$val = $this->ConvertToColor($val, $res); 
+						if ($res) $this->value['border']['l']['color'] = $val;
+						break;
+						
+					case 'border-width':
+						$val = explode(' ', $val);
+						foreach($val as $val_k => $val_v)
+						{
+								$val[$val_k] = $this->ConvertToMM($val_v, 0);
+						}
+						$this->duplicateBorder($val);
+						
+						if ($val[0]) $this->value['border']['t']['width'] = $val[0];
+						if ($val[1]) $this->value['border']['r']['width'] = $val[1];
+						if ($val[2]) $this->value['border']['b']['width'] = $val[2];
+						if ($val[3]) $this->value['border']['l']['width'] = $val[3];
+						break;
+
+					case 'border-top-width':
+						$val = $this->ConvertToMM($val, 0);; 
+						if ($val) $this->value['border']['t']['width'] = $val;
+						break;
+
+					case 'border-right-width':
+						$val = $this->ConvertToMM($val, 0);; 
+						if ($val) $this->value['border']['r']['width'] = $val;
+						break;
+
+					case 'border-bottom-width':
+						$val = $this->ConvertToMM($val, 0);; 
+						if ($val) $this->value['border']['b']['width'] = $val;
+						break;
+
+					case 'border-left-width':
+						$val = $this->ConvertToMM($val, 0);; 
+						if ($val) $this->value['border']['l']['width'] = $val;
+						break;
+											
+					case 'border-collapse':
+						if ($balise=='table') $this->value['border']['collapse'] = ($val=='collapse');
+						break;
+						
+					case 'border-radius':
+						// nettoyage des valeurs
+						$val = explode(' ', $val);
+						foreach($val as $k => $v)
+						{
+							$v = trim($v);
+							if ($v)
+							{
+								$v = $this->ConvertToMM($v, 0);
+								if ($v) $val[$k] = $v;
+								else	unset($val[$k]);
+							}
+							else	unset($val[$k]);	
+						}
+						$val = array_values($val);
+						
+						if (!isset($val[1]) && isset($val[0])) $val[1] = $val[0];
+						if (count($val)==2)
+							$this->value['border']['radius'] = array($val[0], $val[1]);
+
+						break;
+						
+					case 'border-top':
+						$this->value['border']['t'] = $this->readBorder($val);
+						break;
+
+					case 'border-right':
+						$this->value['border']['r'] = $this->readBorder($val);
+						break;
+
+					case 'border-bottom':
+						$this->value['border']['b'] = $this->readBorder($val);
+						break;
+
+					case 'border-left':
+						$this->value['border']['l'] = $this->readBorder($val);
+						break;
+					
+					case 'background-color':
+						$this->value['background']['color'] = $this->ConvertBackgroundColor($val);
+						break;
+
+					case 'background-image':
+						$this->value['background']['image'] = $this->ConvertBackgroundImage($val);
+						break;
+
+					case 'background-position':
+						$res = null;
+						$this->value['background']['position'] = $this->ConvertBackgroundPosition($val, $res);
+						break;
+
+					case 'background-repeat':
+						$this->value['background']['repeat'] = $this->ConvertBackgroundRepeat($val);
+						break;
+
+					case 'background':
+						$this->ConvertBackground($val, $this->value['background']);
+						break;
+
+					case 'position':
+						if ($val=='absolute')		$this->value['position'] = 'absolute';
+						else if ($val=='relative')	$this->value['position'] = 'relative';
+						else						$this->value['position'] = null;
+						break;
+
+					case 'float':
+						if ($val=='left')			$this->value['float'] = 'left';
+						else if ($val=='right')		$this->value['float'] = 'right';
+						else						$this->value['float'] = null;
+						break;
+
+					case 'display':
+						if ($val=='inline')			$this->value['display'] = 'inline';
+						else if ($val=='block')		$this->value['display'] = 'block';
+						else if ($val=='none')		$this->value['display'] = 'none';
+						else						$this->value['display'] = null;
+						break;
+											
+					case 'top':
+					case 'bottom':
+					case 'left':
+					case 'right':
+						$this->value[$nom] = $val;
+						break;
+
+					case 'list-style':
+					case 'list-style-type':
+					case 'list-style-image':
+						if ($nom=='list-style') $nom = 'list-style-type';
+						$this->value[$nom] = $val;
+						break;
+				
+					default:
+						break;	
+				}				
+			}
+
+			if ($this->onlyLeft) $this->value['text-align'] = 'left';
+			
+			// correction de la largeur pour correspondre au modčle de boite quick
+			if ($no_width && in_array($balise, array('div')) && $this->value['position']!='absolute')
+			{
+				$this->value['width'] = $this->getLastWidth();
+				$this->value['width']-= $this->value['margin']['l'] + $this->value['margin']['r'];
+			}
+			else
+			{
+				if ($correct_width)
+				{
+					if (!in_array($balise, array('table', 'div', 'hr')))
+					{
+						$this->value['width']-= $this->value['padding']['l'] + $this->value['padding']['r'];
+						$this->value['width']-= $this->value['border']['l']['width'] + $this->value['border']['r']['width'];
+					}
+					if (in_array($balise, array('th', 'td')))
+					{
+						$this->value['width']-= $this->ConvertToMM(isset($param['cellspacing']) ? $param['cellspacing'] : '2px');
+					}
+					if ($this->value['width']<0) $this->value['width']=0;
+				}
+				else
+				{
+					if ($this->value['width'])
+					{
+						if ($this->value['border']['l']['width'])	$this->value['width']	+= $this->value['border']['l']['width'];
+						if ($this->value['border']['r']['width'])	$this->value['width']	+= $this->value['border']['r']['width'];			
+						if ($this->value['padding']['l'])			$this->value['width']	+= $this->value['padding']['l'];
+						if ($this->value['padding']['r'])			$this->value['width']	+= $this->value['padding']['r'];
+					}		
+				}
+			}
+			if ($this->value['height'])
+			{
+				if ($this->value['border']['b']['width']) { $this->value['height']	+= $this->value['border']['b']['width']; }
+				if ($this->value['border']['t']['width']) { $this->value['height']	+= $this->value['border']['t']['width']; }
+				if ($this->value['padding']['b'])			$this->value['height']	+= $this->value['padding']['b'];
+				if ($this->value['padding']['t'])			$this->value['height']	+= $this->value['padding']['t'];		
+			}			
+			
+			if ($this->value['top']!=null)		$this->value['top']		= $this->ConvertToMM($this->value['top'],		$this->getLastHeight(true));
+			if ($this->value['bottom']!=null)	$this->value['bottom']	= $this->ConvertToMM($this->value['bottom'],	$this->getLastHeight(true));
+			if ($this->value['left']!=null)		$this->value['left']	= $this->ConvertToMM($this->value['left'],		$this->getLastWidth(true));
+			if ($this->value['right']!=null)	$this->value['right']	= $this->ConvertToMM($this->value['right'],		$this->getLastWidth(true));
+			
+			if ($this->value['top'] && $this->value['bottom'] && $this->value['height'])	$this->value['bottom']	= null;
+			if ($this->value['left'] && $this->value['right'] && $this->value['width'])		$this->value['right']	= null;
+		}
+		
+ 		/**
+		 * Récupération de la hauteur de ligne courante
+		 *
+		 * @return	float	hauteur en mm
+		 */
+		function getLineHeight()
+		{
+			$val = $this->value['line-height'];
+			if ($val=='normal') $val = '108%';
+			return $this->ConvertToMM($val, $this->value['font-size']);
+		}
+		
+ 		/**
+		 * Récupération de la largeur de l'objet parent
+		 *
+		 * @return	float	largeur
+		 */
+		function getLastWidth($mode = false)
+		{
+			for($k=count($this->table); $k>0; $k--)
+			{
+				if ($this->table[$k-1]['width'])
+				{
+					$w = $this->table[$k-1]['width'];
+					if ($mode)
+					{
+						$w+= $this->table[$k-1]['border']['l']['width'] + $this->table[$k-1]['padding']['l']+0.02;
+						$w+= $this->table[$k-1]['border']['r']['width'] + $this->table[$k-1]['padding']['r']+0.02;
+					}
+					return $w;
+				}
+			}
+			return $this->pdf->w - $this->pdf->lMargin - $this->pdf->rMargin;
+		}
+
+ 		/**
+		 * Récupération de la hauteur de l'objet parent
+		 *
+		 * @return	float	hauteur
+		 */
+		function getLastHeight($mode = false)
+		{
+			for($k=count($this->table); $k>0; $k--)
+			{
+				if ($this->table[$k-1]['height'])
+				{
+					$h = $this->table[$k-1]['height'];
+					if ($mode)
+					{
+						$h+= $this->table[$k-1]['border']['t']['width'] + $this->table[$k-1]['padding']['t']+0.02;
+						$h+= $this->table[$k-1]['border']['b']['width'] + $this->table[$k-1]['padding']['b']+0.02;
+					}
+					return $h;
+				}
+			}
+			return $this->pdf->h - $this->pdf->tMargin - $this->pdf->bMargin;
+		}
+		
+		function getFloat()
+		{
+			if ($this->value['float']=='left')	return 'left';
+			if ($this->value['float']=='right')	return 'right';
+			return null;
+		}
+		
+		function getParentBalise()
+		{
+			$nb = count($this->table);
+			if ($nb>0)
+				return $this->table[$nb-1]['id_balise'];
+			return null;
+		}
+		
+		function getLastAbsoluteX()
+		{
+			for($k=count($this->table); $k>0; $k--)
+			{
+				if ($this->table[$k-1]['x'] && $this->table[$k-1]['position']) return $this->table[$k-1]['x'];
+			}
+			return $this->pdf->lMargin;
+		}
+		
+		function getLastAbsoluteY()
+		{
+			for($k=count($this->table); $k>0; $k--)
+			{
+				if ($this->table[$k-1]['y'] && $this->table[$k-1]['position']) return $this->table[$k-1]['y'];
+			}
+			return $this->pdf->tMargin;
+		}
+		
+		/**
+		 * Récupération des propriétés CSS de la balise en cours
+		 *
+		 * @return	array()		tableau des propriétés CSS
+		 */		
+		function getFromCSS()
+		{
+			$styles	= array();	// style ŕ appliquer
+			$getit	= array();	// styles ŕ récuperer
+
+			// identification des styles direct, et ceux des parents
+			$lst = array();
+			$lst[] = $this->value['id_lst'];
+			for($i=count($this->table)-1; $i>=0; $i--) $lst[] = $this->table[$i]['id_lst'];
+
+			// identification des styles ŕ récuperer
+			foreach($this->css_keys as $key => $num)
+				if ($this->getReccursiveStyle($key, $lst))
+					$getit[$key] = $num;
+
+			// si des styles sont ŕ recuperer
+			if (count($getit))
+			{
+				// on les récupčre, mais dans l'odre de définition, afin de garder les priorités
+				asort($getit);
+				foreach($getit as $key => $val) $styles = array_merge($styles, $this->css[$key]);				
+			}
+			
+			return $styles;	
+		}
+		
+		/**
+		 * Identification des styles ŕ récuperer, en fonction de la balise et de ses parents
+		 *
+		 * @param	string		clef CSS ŕ analyser
+		 * @param	array()		tableau des styles direct, et ceux des parents
+		 * @param	string		prochaine etape
+		 * @return	boolean		clef autorisée ou non
+		 */
+		function getReccursiveStyle($key, $lst, $next = null)
+		{
+			// si propchaine etape, on construit les valeurs
+			if ($next!==null)
+			{
+				if ($next) $key = trim(substr($key, 0, -strlen($next))); // on elčve cette etape
+				unset($lst[0]);
+				if (!count($lst)) return false; // pas d'etape possible
+				$lst = array_values($lst);
+			}
+			
+			// pour chaque style direct possible de l'etape en cours
+			foreach($lst[0] as $nom)
+			{
+				if ($key==$nom) return true; // si la clef conrrespond => ok
+				if (substr($key, -strlen(' '.$nom))==' '.$nom && $this->getReccursiveStyle($key, $lst, $nom)) return true; // si la clef est la fin, on analyse ce qui précčde
+			}
+
+			// si on est pas ŕ la premiere etape, on doit analyse toutes les sous etapes			
+			if ($next!==null && $this->getReccursiveStyle($key, $lst, '')) return true;
+		
+			// aucun style trouvé	
+			return false;	
+		}
+		
+		/**
+		 * Analyse d'une propriété Border
+		 *
+		 * @param	string		propriété border
+		 * @return	array()		propriété décodée
+		 */
+		function readBorder($val)
+		{
+			$none = array('type' => 'none', 'width' => 0, 'color' => array(0, 0, 0));
+
+			// valeurs par défault
+			$type	= 'solid';
+			$width	= $this->ConvertToMM('1pt');
+			$color	= array(0, 0, 0);
+
+			// nettoyage des valeurs
+			$val = explode(' ', $val);
+			foreach($val as $k => $v)
+			{
+				$v = trim($v);
+				if ($v)	$val[$k] = $v;
+				else	unset($val[$k]);	
+			}
+			$val = array_values($val);
+			// identification des valeurs
+			$res = null;
+			foreach($val as $key)
+			{
+				if ($key=='none' || $key=='hidden') return $none;
+				
+				if ($this->ConvertToMM($key)!==null)							$width = $this->ConvertToMM($key);	
+				else if (in_array($key, array('solid', 'dotted', 'dashed')))	$type = $key;	
+				else
+				{
+					$tmp = $this->ConvertToColor($key, $res);
+					if ($res) $color = $tmp;
+				}
+			}
+			if (!$width) return $none;
+			return array('type' => $type, 'width' => $width, 'color' => $color);
+		}
+		
+		function duplicateBorder(&$val)
+		{
+			if (count($val)==1)
+			{
+				$val[1] = $val[0];
+				$val[2] = $val[0];
+				$val[3] = $val[0];
+			}
+			else if (count($val)==2)
+			{
+				$val[2] = $val[0];
+				$val[3] = $val[1];
+			}
+			else if (count($val)==3)
+			{
+				$val[3] = $val[1];
+			}
+		}
+
+		function ConvertBackground($stl, &$res)
+		{
+			// Image
+			$text = '/url\(([^)]*)\)/isU';
+			if (preg_match($text, $stl, $match))
+			{
+				$res['image'] = $this->ConvertBackgroundImage($match[0]);				
+				$stl = preg_replace($text, '', $stl);
+				$stl = preg_replace('/[\s]+/', ' ', $stl);
+			}
+			
+			// protection des espaces 
+			$stl = preg_replace('/,[\s]+/', ',', $stl); 
+			$lst = explode(' ', $stl);
+			
+			$pos = '';
+			foreach($lst as $val)
+			{
+				$ok = false;
+				$color = $this->ConvertToColor($val, $ok);
+				
+				if ($ok)
+				{
+					$res['color'] = $color;
+				}
+				else if ($val=='transparent')
+				{
+					$res['color'] = null;
+				}
+				else
+				{
+					$repeat = $this->ConvertBackgroundRepeat($val);
+					if ($repeat)
+					{
+						$res['repeat'] = $repeat;
+					}
+					else
+					{
+						$pos.= ($pos ? ' ' : '').$val;
+					}
+				}
+			}
+			if ($pos)
+			{
+				$pos = $this->ConvertBackgroundPosition($pos, $ok);
+				if ($ok) $res['position'] = $pos;
+			}
+		}
+
+		function ConvertBackgroundColor($val)
+		{
+			$res = null;
+			if ($val=='transparent')	return null;
+			else						return $this->ConvertToColor($val, $res);
+		}
+
+		function ConvertBackgroundImage($val)
+		{
+			if ($val=='none')
+				return null;
+			else if (preg_match('/^url\(([^)]*)\)$/isU', $val, $match))
+				return $match[1];
+			else
+				return null;
+		}
+		
+		function ConvertBackgroundPosition($val, &$res)
+		{
+			$val = explode(' ', $val);
+			if (count($val)<2)
+			{
+				if (!$val[0]) return null;
+				$val[1] = 'center';
+			}
+			if (count($val)>2) return null;
+
+			$x = 0;
+			$y = 0;
+			$res = true;
+			
+			if ($val[0]=='left')		$x = '0%';
+			else if ($val[0]=='center')	$x = '50%';
+			else if ($val[0]=='right')	$x = '100%';
+			else if ($val[0]=='top')	$y = '0%';
+			else if ($val[0]=='bottom')	$y = '100%';
+			else if (preg_match('/^[-]?[0-9\.]+%$/isU',	$val[0])) $x = $val[0];
+			else if ($this->ConvertToMM($val[0])) $x = $this->ConvertToMM($val[0]);
+			else $res = false;
+			
+			if ($val[1]=='left')		$x = '0%';
+			else if ($val[1]=='right')	$x = '100%';
+			else if ($val[1]=='top')	$y = '0%';
+			else if ($val[1]=='center')	$y = '50%';
+			else if ($val[1]=='bottom')	$y = '100%';
+			else if (preg_match('/^[-]?[0-9\.]+%$/isU',	$val[1])) $y = $val[1];
+			else if ($this->ConvertToMM($val[1])) $y = $this->ConvertToMM($val[1]);
+			else $res = false;
+
+			$val[0] = $x;
+			$val[1] = $y;
+			
+			return $val;	
+		}
+		
+ 		function ConvertBackgroundRepeat($val)
+		{
+			switch($val)
+			{
+				case 'repeat':
+					return array(true, true);
+				case 'repeat-x':
+					return array(true, false);
+				case 'repeat-y':
+					return array(false, true);
+				case 'no-repeat':
+					return array(false, false);
+			}
+			return null;
+		}
+ 		/**
+		 * Convertir une longueur en mm
+		 *
+		 * @param	string			longueur, avec unité, ŕ convertir
+		 * @param	float			longueur du parent
+		 * @return	float			longueur exprimée en mm
+		 */	
+		function ConvertToMM($val, $old=0.)
+		{
+			$val = trim($val);
+			if (preg_match('/^[0-9\.\-]+$/isU', $val))			$val.= 'px';
+			if (preg_match('/^[0-9\.\-]+px$/isU', $val))		$val = 25.4/96. * str_replace('px', '', $val);
+			else if (preg_match('/^[0-9\.\-]+pt$/isU', $val))	$val = 25.4/72. * str_replace('pt', '', $val);
+			else if (preg_match('/^[0-9\.\-]+in$/isU', $val))	$val = 25.4 * str_replace('in', '', $val);
+			else if (preg_match('/^[0-9\.\-]+mm$/isU', $val))	$val = 1.*str_replace('mm', '', $val);
+			else if (preg_match('/^[0-9\.\-]+%$/isU', $val))	$val = 1.*$old*str_replace('%', '', $val)/100.;
+			else												$val = null;	
+
+			return $val;
+		}
+		
+ 		/**
+		 * Décomposition d'un code couleur HTML
+		 *
+		 * @param	string			couleur au format CSS
+		 * @return	array(r, v, b)	couleur exprimé par ses comporantes R, V, B, de 0 ŕ 255.
+		 */	
+		function ConvertToColor($val, &$res)
+		{
+			$val = trim($val);
+			$res = true;
+				
+			if (strtolower($val)=='transparent') return array(null, null, null);
+			if (isset($this->htmlColor[strtolower($val)])) $val = $this->htmlColor[strtolower($val)];
+			
+			if (preg_match('/^#[0-9A-Fa-f]{6}$/isU', $val))
+			{
+				$r = floatVal(hexdec(substr($val, 1, 2)))/255.;
+				$v = floatVal(hexdec(substr($val, 3, 2)))/255.;
+				$b = floatVal(hexdec(substr($val, 5, 2)))/255.;
+				$col = array($r, $v, $b);
+			}
+			elseif (preg_match('/^#[0-9A-F]{3}$/isU', $val))
+			{
+				$r = floatVal(hexdec(substr($val, 1, 1).substr($val, 1, 1)))/255.;
+				$v = floatVal(hexdec(substr($val, 2, 1).substr($val, 2, 1)))/255.;
+				$b = floatVal(hexdec(substr($val, 3, 1).substr($val, 3, 1)))/255.;
+				$col = array($r, $v, $b);
+			}
+			elseif (preg_match('/rgb\([\s]*([0-9%\.]+)[\s]*,[\s]*([0-9%\.]+)[\s]*,[\s]*([0-9%\.]+)[\s]*\)/isU', $val, $match))
+			{
+				$r = $this->ConvertSubColor($match[1]);
+				$v = $this->ConvertSubColor($match[2]);
+				$b = $this->ConvertSubColor($match[3]);
+				$col = array($r, $v, $b);
+			}
+			elseif (preg_match('/cmyk\([\s]*([0-9%\.]+)[\s]*,[\s]*([0-9%\.]+)[\s]*,[\s]*([0-9%\.]+)[\s]*,[\s]*([0-9%\.]+)[\s]*\)/isU', $val, $match))
+			{
+				$c = $this->ConvertSubColor($match[1]);
+				$m = $this->ConvertSubColor($match[2]);
+				$y = $this->ConvertSubColor($match[3]);
+				$k = $this->ConvertSubColor($match[4]);
+				$col = array($c, $m, $y, $k);
+			}
+			else
+			{
+				$col = array(0., 0., 0.);
+				$res = false;
+			}
+			
+			return $col;	
+		}
+		
+		function ConvertSubColor($c)
+		{
+			if (substr($c, -1)=='%') $c = floatVal(substr($c, 0, -1))/100.;
+			else
+			{
+				$c = floatVal($c);
+				if ($c>1) $c = $c/255.;
+			}
+			return $c;
+		}
+		
+		/**
+		 * Analyser une feuille de style
+		 *
+		 * @param	string			code CSS
+		 * @return	null
+		 */	
+		function analyseStyle(&$code)
+		{
+			// on remplace tous les espaces, tab, \r, \n, par des espaces uniques
+			$code = preg_replace('/[\s]+/', ' ', $code);
+
+			// on enlčve les commentaires
+			$code = preg_replace('/\/\*.*?\*\//s', '', $code);
+
+			// on analyse chaque style
+			preg_match_all('/([^{}]+){([^}]*)}/isU', $code, $match);
+			for($k=0; $k<count($match[0]); $k++)
+			{
+				// noms
+				$noms	= strtolower(trim($match[1][$k]));
+				
+				// style, séparé par des; => on remplie le tableau correspondant
+				$styles	= trim($match[2][$k]);
+				$styles = explode(';', $styles);
+				$stl = array();
+				foreach($styles as $style)
+				{
+					$tmp = explode(':', $style);
+					if (count($tmp)>1)
+					{
+						$cod = $tmp[0]; unset($tmp[0]); $tmp = implode(':', $tmp); 
+						$stl[trim(strtolower($cod))] = trim($tmp);
+					}
+				}
+				
+				// décomposition des noms par les ,
+				$noms = explode(',', $noms);
+				foreach($noms as $nom)
+				{
+					$nom = trim($nom);
+					// Si il a une fonction spécifique, comme :hover => on zap
+					if (strpos($nom, ':')!==false) continue;
+					if (!isset($this->css[$nom]))
+						$this->css[$nom] = $stl;
+					else
+						$this->css[$nom] = array_merge($this->css[$nom], $stl);
+					
+				}
+			}
+			
+			$this->css_keys = array_flip(array_keys($this->css));
+		}
+		
+		/**
+		 * Extraction des feuille de style du code HTML
+		 *
+		 * @param	string			code HTML
+		 * @return	null
+		 */	
+		function readStyle(&$html)
+		{
+			$style = ' ';
+
+			// extraction des balises link, et suppression de celles-ci dans le code HTML
+			preg_match_all('/<link([^>]*)>/isU', $html, $match);
+			$html = preg_replace('/<link[^>]*>/isU',	'', $html);			
+			$html = preg_replace('/<\/link[^>]*>/isU',	'', $html);
+			
+			// analyse de chaque balise
+			foreach($match[1] as $code)
+			{
+				$tmp = array();
+				// lecture des paramétres du type nom=valeur
+				$prop = '([a-zA-Z0-9_]+)=([^"\'\s>]+)';
+				preg_match_all('/'.$prop.'/is', $code, $match);
+				for($k=0; $k<count($match[0]); $k++)
+					$tmp[trim(strtolower($match[1][$k]))] = trim($match[2][$k]);
+	
+				// lecture des paramétres du type nom="valeur"
+				$prop = '([a-zA-Z0-9_]+)=["]([^"]*)["]';
+				preg_match_all('/'.$prop.'/is', $code, $match);
+				for($k=0; $k<count($match[0]); $k++)
+					$tmp[trim(strtolower($match[1][$k]))] = trim($match[2][$k]);
+	
+				// lecture des paramétres du type nom='valeur'
+				$prop = "([a-zA-Z0-9_]+)=[']([^']*)[']";
+				preg_match_all('/'.$prop.'/is', $code, $match);
+				for($k=0; $k<count($match[0]); $k++)
+					$tmp[trim(strtolower($match[1][$k]))] = trim($match[2][$k]);
+
+				// si de type text/css => on garde
+				if (isset($tmp['type']) && strtolower($tmp['type'])=='text/css' && isset($tmp['href']))
+				{
+					$content = @file_get_contents($tmp['href']);
+					$url = $tmp['href'];
+					if (strpos($url, 'http://')!==false)
+					{
+						$url = str_replace('http://', '', $url);
+						$url = explode('/', $url);
+						$url_main = 'http://'.$url[0].'/';
+						$url_self = $url; unset($url_self[count($url_self)-1]); $url_self = 'http://'.implode('/', $url_self).'/';
+
+						$content = preg_replace('/url\(([^\\\\][^)]*)\)/isU', 'url('.$url_self.'$1)', $content);
+						$content = preg_replace('/url\((\\\\[^)]*)\)/isU', 'url('.$url_main.'$1)', $content);
+					}
+
+					$style.= $content."\n";
+				}
+			}
+
+
+			// extraction des balises style, et suppression de celles-ci dans le code HTML
+			preg_match_all('/<style[^>]*>(.*)<\/style[^>]*>/isU', $html, $match);
+			$html = preg_replace('/<style[^>]*>(.*)<\/style[^>]*>/isU', '', $html);			
+
+			// analyse de chaque balise
+			foreach($match[1] as $code)
+			{
+				$code = str_replace('<!--', '', $code);
+				$code = str_replace('-->', '', $code);
+				$style.= $code."\n";
+			} 
+			
+			$this->analyseStyle($style);
+		}
+	}
+}

+ 20 - 9
main/inc/lib/mimetex/README

@@ -1,10 +1,11 @@
 
  --------------------------------------------------------------------------
- September 6, 2008                                             Version 1.70
+ March 24, 2009                                                Version 1.71
 
                   m i m e T e X   R e a d m e   F i l e
+    (including pre-compiled Linux binary mimetex.cgi -- see NOTE below)
 
- Copyright(c) 2002-2008, John Forkosh Associates, Inc. All rights reserved.
+ Copyright(c) 2002-2009, John Forkosh Associates, Inc. All rights reserved.
  --------------------------------------------------------------------------
 
                             by: John Forkosh
@@ -12,10 +13,20 @@
 
           This file is part of mimeTeX, which is free software.
           You may redistribute and/or modify it under the terms
-          of the GNU General Public License, version 3 or later,
+          of the GNU General Public License, version 2 or later,
           as published by the Free Software Foundation. See
                    http://www.gnu.org/licenses/gpl.html
 
+	  -------------------------------------------------------------
+          NOTE for Linux users...
+	  -------------------------------------------------------------
+          This zip file contains pre-compiled binary image mimetex.cgi,
+          compiled under Debian GNU/Linux running kernel 2.4.32, with gcc
+          3.3.5.  It also contains all mimetex source files. The compile
+          command was
+             gcc -static -DAA mimetex.c gifsave.c -lm -o mimetex.cgi
+	  -------------------------------------------------------------
+
           MimeTeX is discussed and illustrated online at
           its homepage
                     http://www.forkosh.com/mimetex.html
@@ -91,7 +102,7 @@ III.  COMPILATION AND INSTALLATION
   Your working directory should now contain
        mimetex.zip    your gnu zipped mimeTeX distribution containing...
        README         this file (see mimetex.html for demo/tutorial)
-       COPYING        GPL license, under which you may use mimeTeX
+       LICENSE        GPL license, under which you may use mimeTeX
        mimetex.c      mimeTeX source program and all required functions
        mimetex.h      header file for mimetex.c (and for gfuntype.c)
        gfuntype.c     parses output from  gftype -i  and writes bitmap data
@@ -176,11 +187,7 @@ III.  COMPILATION AND INSTALLATION
 
 IV.  REVISION HISTORY
 ------------------------------------------------------------------------
-  A more detailed account of mimeTeX's revision history
-  is maintained at  http://www.forkosh.com/mimetexchangelog.html
-  ---
-  09/06/08  J.Forkosh      version 1.70 released.
-  11/30/04  J.Forkosh      version 1.60 released
+  11/30/04  J.Forkosh      version 1.60 (beta) released
   10/02/04  J.Forkosh      version 1.50 released on CTAN with various new
                            features and fixes, and updated documentation.
   07/18/04  J.Forkosh      version 1.40 re-released on CTAN with minor
@@ -212,5 +219,9 @@ V.  CONCLUDING REMARKS
   I hope you find mimeTeX useful.  If so, a contribution to your
   country's TeX Users Group, or to the GNU project, is suggested,
   especially if you're a company that's currently profitable.
+  
+  If you also like mimeTeX's source, I'm an independent contractor
+  incorporated in the US as John Forkosh Associates, Inc.  A resume
+  is at www.forkosh.com or email john@forkosh.com
 ========================= END-OF-FILE README ===========================
 

BIN
main/inc/lib/mimetex/mimetex.cgi


BIN
main/inc/lib/mimetex/mimetex.exe


+ 28 - 11
main/install/dokeos_main.sql

@@ -219,9 +219,6 @@ CREATE TABLE course_field (
     PRIMARY KEY(id)
 );
 
-INSERT INTO course_field (field_type, field_variable, field_display_text, field_default_value, field_visible, field_changeable) values (10, 'special_course','SpecialCourse', 'Yes', 1 , 1);
-
-
 --
 -- Table structure for table course_field_values
 --
@@ -647,7 +644,7 @@ VALUES
 ('service_ppt2lp', 'ftp_password', 'textfield', NULL, NULL, 'FtpPassword', NULL, NULL, NULL, 0),
 ('service_ppt2lp', 'path_to_lzx', 'textfield', NULL, NULL, '', NULL, NULL, NULL, 0),
 ('service_ppt2lp', 'size', 'radio', NULL, '720x540', '', NULL, NULL, NULL, 0),
-('wcag_anysurfer_public_pages', NULL, 'radio','Platform','false','PublicPagesComplyToWAITitle','PublicPagesComplyToWAIComment', NULL, NULL, 0),
+('wcag_anysurfer_public_pages', NULL, 'radio','Editor','false','PublicPagesComplyToWAITitle','PublicPagesComplyToWAIComment', NULL, NULL, 0),
 ('stylesheets', NULL, 'textfield','stylesheets','dokeos_blue','',NULL, NULL, NULL, 1),
 ('upload_extensions_list_type', NULL, 'radio', 'Security', 'blacklist', 'UploadExtensionsListType', 'UploadExtensionsListTypeComment', NULL, NULL, 0),
 ('upload_extensions_blacklist', NULL, 'textfield', 'Security', '', 'UploadExtensionsBlacklist', 'UploadExtensionsBlacklistComment', NULL, NULL, 0),
@@ -669,7 +666,6 @@ VALUES
 ('show_tabs', 'platform_administration', 'checkbox', 'Platform', 'true', 'ShowTabsTitle','ShowTabsComment',NULL,'TabsPlatformAdministration', 1),
 ('show_tabs', 'my_agenda', 'checkbox', 'Platform', 'true', 'ShowTabsTitle','ShowTabsComment',NULL,'TabsMyAgenda', 1),
 ('show_tabs', 'my_profile', 'checkbox', 'Platform', 'true', 'ShowTabsTitle','ShowTabsComment',NULL,'TabsMyProfile', 1),
-('show_tabs', 'social', 'checkbox', 'Platform', 'true', 'ShowTabsTitle','ShowTabsComment',NULL,'TabsSocial', 0),
 ('default_forum_view', NULL, 'radio', 'Course', 'flat', 'DefaultForumViewTitle','DefaultForumViewComment',NULL,NULL, 0),
 ('platform_charset',NULL,'textfield','Platform','iso-8859-15','PlatformCharsetTitle','PlatformCharsetComment','platform',NULL, 0),
 ('noreply_email_address', '', 'textfield', 'Platform', '', 'NoReplyEmailAddress', 'NoReplyEmailAddressComment', NULL, NULL, 0),
@@ -720,7 +716,7 @@ VALUES
 ('course_create_active_tools','survey','checkbox','Tools','true','CourseCreateActiveToolsTitle','CourseCreateActiveToolsComment',NULL,'Survey', 0),
 ('course_create_active_tools','glossary','checkbox','Tools','true','CourseCreateActiveToolsTitle','CourseCreateActiveToolsComment',NULL,'Glossary', 0),
 ('course_create_active_tools','notebook','checkbox','Tools','true','CourseCreateActiveToolsTitle','CourseCreateActiveToolsComment',NULL,'Notebook', 0),
-('advanced_filemanager',NULL,'radio','Platform','false','AdvancedFileManagerTitle','AdvancedFileManagerComment',NULL,NULL, 0),
+('advanced_filemanager',NULL,'radio','Editor','false','AdvancedFileManagerTitle','AdvancedFileManagerComment',NULL,NULL, 0),
 ('allow_reservation', NULL, 'radio', 'Tools', 'false', 'AllowReservationTitle', 'AllowReservationComment', NULL, NULL, 0),
 ('profile','apikeys','checkbox','User','false','ProfileChangesTitle','ProfileChangesComment',NULL,'ApiKeys', 0),
 ('allow_message_tool', NULL, 'radio', 'Tools', 'false', 'AllowMessageToolTitle', 'AllowMessageToolComment', NULL, NULL,0),
@@ -739,7 +735,14 @@ VALUES
 ('show_glossary_in_extra_tools', NULL, 'radio', 'Course', 'false', 'ShowGlossaryInExtraToolsTitle', 'ShowGlossaryInExtraToolsComment', NULL, NULL,1),
 ('dokeos_database_version', NULL, 'textfield', NULL,'1.8.6.2.9070','DokeosDatabaseVersion','',NULL,NULL,0),
 ('send_email_to_admin_when_create_course',NULL,'radio','Platform','false','SendEmailToAdminTitle','SendEmailToAdminComment',NULL,NULL, 1),
-('go_to_course_after_login',NULL,'radio','Course','false','GoToCourseAfterLoginTitle','GoToCourseAfterLoginComment',NULL,NULL, 0);
+('go_to_course_after_login',NULL,'radio','Course','false','GoToCourseAfterLoginTitle','GoToCourseAfterLoginComment',NULL,NULL, 0),
+('math_mimetex',NULL,'radio','Editor','false','MathMimetexTitle','MathMimetexComment',NULL,NULL, 0),
+('math_asciimathML',NULL,'radio','Editor','false','MathASCIImathMLTitle','MathASCIImathMLComment',NULL,NULL, 0),
+('youtube_for_students',NULL,'radio','Editor','true','YoutubeForStudentsTitle','YoutubeForStudentsComment',NULL,NULL, 0),
+('block_copy_paste_for_students',NULL,'radio','Editor','false','BlockCopyPasteForStudentsTitle','BlockCopyPasteForStudentsComment',NULL,NULL, 0),
+('more_buttons_maximized_mode',NULL,'radio','Editor','false','MoreButtonsForMaximizedModeTitle','MoreButtonsForMaximizedModeComment',NULL,NULL, 0),
+('students_download_folders',NULL,'radio','Tools','true','AllowStudentsDownloadFoldersTitle','AllowStudentsDownloadFoldersComment',NULL,NULL, 0);
+
 UNLOCK TABLES;
 /*!40000 ALTER TABLE settings_current ENABLE KEYS */;
 
@@ -928,7 +931,19 @@ VALUES
 ('send_email_to_admin_when_create_course','true','Yes'),
 ('send_email_to_admin_when_create_course','false','No'),
 ('go_to_course_after_login','true','Yes'),
-('go_to_course_after_login','false','No');
+('go_to_course_after_login','false','No'),
+('math_mimetex','true','Yes'),
+('math_mimetex','false','No'),
+('math_asciimathML','true','Yes'),
+('math_asciimathML','false','No'),
+('youtube_for_students','true','Yes'),
+('youtube_for_students','false','No'),
+('block_copy_paste_for_students','true','Yes'),
+('block_copy_paste_for_students','false','No'),
+('more_buttons_maximized_mode','true','Yes'),
+('more_buttons_maximized_mode','false','No'),
+('students_download_folders','true','Yes'),
+('students_download_folders','false','No');
 
 UNLOCK TABLES;
 
@@ -2277,6 +2292,7 @@ CREATE TABLE session_category (
 -- Table structure for table user tag
 --
 
+
 CREATE TABLE tag (
 	id int NOT NULL auto_increment,
 	tag varchar(255) NOT NULL,
@@ -2336,8 +2352,9 @@ CREATE TABLE IF NOT EXISTS message_attachment (
   message_id int NOT NULL,
   filename varchar(255) NOT NULL,
   PRIMARY KEY  (id)
-);
+)
+
 
-INSERT INTO user_field (field_type, field_variable, field_display_text, field_visible, field_changeable) values (1, 'rssfeeds','RSS',0,0);
-INSERT INTO user_field (field_type, field_variable, field_display_text, field_visible, field_changeable) values (10,'tags','tags',0,0);
+INSERT INTO user_field (field_type, field_variable, field_display_text, field_visible, field_changeable) values (10, 'tags','tags',0,0);
+INSERT INTO user_field (field_type, field_variable, field_display_text, field_visible, field_changeable) values (9, 'rssfeeds','RSS',0,0);
 

+ 5 - 0
main/lang/asturian/admin.inc.php

@@ -979,6 +979,7 @@ $SoberBrown = "Marr
 $SteelGrey = "Gris aceru";
 $TastyOlive = "Sabor oliva";
 $AddNews  = "Criar anunciu";
+$ExportCourses = "Esportar cursos";
 $SearchDatabaseOpeningError = "Nun pudo abrise la base de datos del motor d\'indexáu, preba a amestar un recursu nuevu (exerciciu, enllaz, lleición, etc) el cual será indexáu al guetador";
 $SearchDatabaseVersionError = "La base de datos ta nun formatu nun sofitáu";
 $SearchDatabaseModifiedError = "La base de datos foi camudada";
@@ -1096,4 +1097,8 @@ $ShowGlossaryInExtraToolsComment = "Dende equ
 $FieldTypeTag = "Etiqueta d\'usuariu";
 $SendEmailToAdminTitle = "Avisu por corréu electrónicu, de la criación d\'un cursu nuevu";
 $SendEmailToAdminComment = "Unviar un corréu electrónicu al alministrador de la plataforma, cada vegada qu\'un mayestru crie un cursu nuevu";
+$UserTag = "Etiqueta d\'usuariu";
+$SelectSession = "Seleicionar sesión";
+$GroupPermissions = "Permisos del grupu";
+$SpecialCourse = "Cursu especial";
 ?>

+ 1 - 0
main/lang/asturian/course_home.inc.php

@@ -27,4 +27,5 @@ $IntroductionTextDeleted = "Testu d\'entamu esborr
 $SessionIdentifier = "Identificador de la sesión";
 $SessionName = "Nome de la sesión";
 $SessionCategory = "Categoría de la sesión";
+$SessionData = "Datos de la sesión";
 ?>

+ 2 - 0
main/lang/asturian/slideshow.inc.php

@@ -18,4 +18,6 @@ $lang_next_slide = "Diapositiva siguiente";
 $lang_image = "Imaxe";
 $lang_of = "de";
 $lang_view_slideshow = "Ver presentación";
+$FirstSlide = "Primer diapositiva";
+$LastSlide = "Cabera diapositiva";
 ?>

+ 2 - 0
main/lang/asturian/userInfo.inc.php

@@ -92,4 +92,6 @@ $SendInvitation = "Unviar invitaci
 $SocialInvitationToFriends = "Invitar a xunise a la mio rede de collacios";
 $MyCertificates = "Los mios certificaos";
 $ToChangeYourEmailMustTypeYourPassword = "Pa camudar el to corréu electrónicu tienes qu\'escribir la to contraseña";
+$Invitations = "Invitaciones";
+$MyGroups = "Los mios grupos";
 ?>

+ 15 - 0
main/lang/english/admin.inc.php

@@ -1103,4 +1103,19 @@ $GroupPermissions = "Group Permissions";
 $MessagesSent = "Messages sent";
 $MessagesReceived = "Messages received";
 $CountFriends = "Number of friends";
+
+$MathASCIImathMLTitle = "SCIImathML mathematical editor";
+$MathASCIImathMLComment = "Enable SCIImathML mathematical editor";
+$YoutubeForStudentsTitle = "Allow students to insert videos from YouTube";
+$YoutubeForStudentsComment = "Enable the possibility that students can insert Youtube videos";
+$BlockCopyPasteForStudentsTitle = "Block students copy and paste";
+$BlockCopyPasteForStudentsComment = "Block students the ability to copy and paste into the WYSIWYG editor";
+$MoreButtonsForMaximizedModeTitle = "Buttons bar extended";
+$MoreButtonsForMaximizedModeComment = "Enable button bars extended when the WYSIWYG editor is maximized";
+$Editor = "WYSIWYG Editor";
+$GoToCourseAfterLoginTitle = "Go directly to the course after login";
+$GoToCourseAfterLoginComment = "When a user is registered in one course, go directly to the course after login";
+$GroupList = "Group List";
+$AllowStudentsDownloadFoldersTitle = "Allow students to download directories";
+$AllowStudentsDownloadFoldersComment = "Allow to students pack and download a complete directory in the document tool";
 ?>

+ 2 - 1
main/lang/greek/accessibility.inc.php

@@ -2,12 +2,13 @@
 for more information: see languages.txt in the lang folder. 
 */
 $langClarContent = "Εδώ, καθηγητές και βοηθοί δημιουργούν και διαχειρίζονται τους δικτυακούς τόπους των μαθημάτων τους. Οι φοιτητές μπορούν να διαβάσουν τα έγγραφα,  τα προγράμματα, την ατζέντα, κλπ., να κάνουν ασκήσεις, να δημοσιεύσουν εργασίες, να συμμετάσχουν σε συζητήσεις, κ.α.</p> <p><b>Εγγραφή</b></p><p>Αν είστε φοιτητής, θα πρέπει να εγγραφείτε επιλέγοντας «Παρακολούθηση μαθημάτων», και μετά να επιλέξετε τα μαθήματα που επιθυμείτε να παρακολουθήσετε.</p><p>Αν είστε καθηγητής ή βοηθός, θα πρέπει και πάλι να εγγραφείτε, επιλέγοντας όμως «Δημιουργία μαθημάτων». Στη συνέχεια, θα συμπληρώσετε μια φόρμα με τα στοιχεία του μαθήματός σας: τίτλο και κωδικό μαθήματος και σχολή/τμήμα που ανήκει. Μόλις επικυρώσετε τα στοιχεία αυτά, θα μεταφερθείτε στη σελίδα που μόλις θα έχει δημιουργηθεί για το μάθημα, και θα μπορείτε να αλλάξετε τα περιεχόμενά και την οργάνωσή της ανάλογα με τις ανάγκες σας.</p><p>Αν η σελίδα αυτή δεν ανταποκρίνεται στις ανάγκες σας, παρακαλούμε ενημερώστε μας μέσω της λίστας «Να γίνουν», που εμφανίζεται στην αρχική σελίδα της τάξης ";
-$test = "test";
+$test = "&#964;&#949;&#963;&#964;";
 $WCAGImage = "&#917;&#953;&#954;&#972;&#957;&#945;";
 $WCAGLabel = "&#932;&#943;&#964;&#955;&#959;&#962; &#949;&#953;&#954;&#972;&#957;&#945;&#962;";
 $WCAGLink = "&#931;&#973;&#957;&#948;&#949;&#963;&#956;&#959;&#962;";
 $WCAGLinkLabel = "&#932;&#943;&#964;&#955;&#959;&#962; &#931;&#965;&#957;&#948;&#941;&#963;&#956;&#959;&#965;";
 $errorNoLabel = "&#922;&#945;&#957;&#941;&#957;&#945;&#962; &#964;&#943;&#964;&#955;&#959;&#962; &#947;&#953;&#945; &#945;&#965;&#964;&#942; &#964;&#951;&#957; &#949;&#953;&#954;&#972;&#957;&#945;.";
+$AllLanguages = "&#972;&#955;&#949;&#962; &#959;&#953; &#947;&#955;&#974;&#963;&#963;&#949;&#962;";
 $WCAGEditor = "WCAG Editor";
 $WCAGGoMenu = "&#924;&#949;&#957;&#959;&#973; &#956;&#949;&#964;&#940;&#946;&#945;&#963;&#951;&#962;";
 $WCAGGoContent = "&#928;&#949;&#961;&#953;&#949;&#967;&#972;&#956;&#949;&#957;&#959; &#956;&#949;&#964;&#940;&#946;&#945;&#963;&#951;&#962;";

+ 4 - 0
main/lang/italian/admin.inc.php

@@ -979,6 +979,7 @@ $SoberBrown = "Sober brown";
 $SteelGrey = "Steel grey";
 $TastyOlive = "Tasty olive";
 $AddNews  = "Aggiungi avvisi";
+$ExportCourses = "Esporta corsi";
 $SearchDatabaseOpeningError = "Non è possibile accedere al database di indicizzazione dei contenuti";
 $SearchDatabaseVersionError = "Il formato del database non è supportato";
 $SearchDatabaseModifiedError = "Database di indicizzazione modificato";
@@ -1097,4 +1098,7 @@ $FieldTypeTag = "Tag utente";
 $SendEmailToAdminTitle = "Avviso della creazione di un nuovo corso tramite e-mail";
 $SendEmailToAdminComment = "Ogni volta che un docente crea un nuovo corso, verrà inviata un\'e-mail all\'amministratore";
 $UserTag = "Etichetta utente";
+$SelectSession = "Seleziona la sessione";
+$GroupPermissions = "Permessi del gruppo";
+$SpecialCourse = "Corso speciale";
 ?>

+ 1 - 0
main/lang/italian/course_home.inc.php

@@ -27,4 +27,5 @@ $IntroductionTextDeleted = "Testo introduttivo eliminato";
 $SessionIdentifier = "Identificatore della sessione";
 $SessionName = "Nome della sessione";
 $SessionCategory = "Categoria della sessione";
+$SessionData = "Dati della sessione";
 ?>

+ 2 - 0
main/lang/italian/slideshow.inc.php

@@ -18,4 +18,6 @@ $lang_next_slide = "Prossima Diapositiva";
 $lang_image = "Immagine";
 $lang_of = "di";
 $lang_view_slideshow = "Mostra presentazione";
+$FirstSlide = "Prima diapositiva";
+$LastSlide = "Ultima diapositiva";
 ?>

+ 2 - 0
main/lang/italian/userInfo.inc.php

@@ -92,4 +92,6 @@ $SendInvitation = "Manda un invito";
 $SocialInvitationToFriends = "Invita ad unirsi al mio gruppo di amici";
 $MyCertificates = "Il mio certificato";
 $ToChangeYourEmailMustTypeYourPassword = "Per cambiare l\'indirizzo e-mail devi riscrivere la password";
+$Invitations = "Inviti";
+$MyGroups = "I miei gruppi";
 ?>

+ 19 - 0
main/lang/portuguese/admin.inc.php

@@ -979,6 +979,7 @@ $SoberBrown = "Sober brown";
 $SteelGrey = "Steel grey";
 $TastyOlive = "Tasty olive";
 $AddNews  = "Adicionar notícias/novidades";
+$ExportCourses = "Exportar cursos";
 $SearchDatabaseOpeningError = "Erro ao tentar abrir a base-de-dados";
 $SearchDatabaseVersionError = "A base-de-dados encontra-se num formato não suportado";
 $SearchDatabaseModifiedError = "A base-de-dados foi modificada";
@@ -1096,4 +1097,22 @@ $ShowGlossaryInExtraToolsComment = "Neste local pode configurar como adicionar o
 $FieldTypeTag = "Etiqueta/comando do utilizador";
 $SendEmailToAdminTitle = "E-mail de alerta, de criação de um novo curso";
 $SendEmailToAdminComment = "Enviar um e-mail para o administardor da plataforma, de cada vez que um instrutor registrar um novo curso";
+$UserTag = "Etiqueta/comando do utilizador";
+$SelectSession = "Seleccionar sessão";
+$GroupPermissions = "Permissões do Grupo";
+$SpecialCourse = "Curso especial";
+$MathMimetexTitle = "Editor matemático mimeTEX";
+$MathMimetexComment = "Activar editor matemático mimeTEX";
+$MathASCIImathMLTitle = "Editor matemático SCIImathML";
+$MathASCIImathMLComment = "Activar editor matemático SCIImathML";
+$YoutubeForStudentsTitle = "Permitir aos alunos inserir videos do YouTube";
+$YoutubeForStudentsComment = "Activar a possibilidade dos alunos poderem inserir videos do YouTube";
+$BlockCopyPasteForStudentsTitle = "Bloquear aos alunos a opção de copiar e colar ";
+$BlockCopyPasteForStudentsComment = "Bloquear aos alunos a opção de copiar e colar para dentro do editor WYSIWYG ";
+$MoreButtonsForMaximizedModeTitle = "Barra de botões extendida";
+$MoreButtonsForMaximizedModeComment = "Activar a barra de botões extendida quando o editor WYSIWYG se encontrar maximizado";
+$Editor = "Editor WYSIWYG";
+$GoToCourseAfterLoginTitle = "Ir directamente para o curso após efectuar o login/acesso";
+$GoToCourseAfterLoginComment = "Quando um utilizador se encontra registado num curso, ir directamente para o curso após o login/acesso";
+$GroupList = "Lista do Grupo";
 ?>

+ 1 - 0
main/lang/portuguese/course_home.inc.php

@@ -27,4 +27,5 @@ $IntroductionTextDeleted = "A introdu
 $SessionIdentifier = "Identificador da sessão";
 $SessionName = "Nome da sessão";
 $SessionCategory = "Categoria da sessão";
+$SessionData = "Dados da sessão";
 ?>

+ 2 - 0
main/lang/portuguese/slideshow.inc.php

@@ -18,4 +18,6 @@ $lang_next_slide = "Imagem seguinte";
 $lang_image = "Imagem";
 $lang_of = "de";
 $lang_view_slideshow = "Ver Apresentação de slides";
+$FirstSlide = "Primeiro slide/diapositivo";
+$LastSlide = "Último slide/diapositivo";
 ?>

+ 2 - 0
main/lang/portuguese/userInfo.inc.php

@@ -92,4 +92,6 @@ $SendInvitation = "Enviar convite";
 $SocialInvitationToFriends = "Convidar para fazer parte do meu grupo de amigos";
 $MyCertificates = "Meus certificados";
 $ToChangeYourEmailMustTypeYourPassword = "Para modificar o seu e-mail deverá introduzir a sua senha/password";
+$Invitations = "Convites";
+$MyGroups = "Meus grupos";
 ?>

+ 14 - 0
main/lang/spanish/admin.inc.php

@@ -1103,4 +1103,18 @@ $GroupPermissions = "Permisos del grupo";
 $MessagesSent = "Mensajes enviados";
 $MessagesReceived = "Mensajes recibidos";
 $CountFriends = "Número de amigos";
+$MathASCIImathMLTitle = "Editor matemático SCIImathML";
+$MathASCIImathMLComment = "Habilitar el editor matemático SCIImathML";
+$YoutubeForStudentsTitle = "Permitir a los estudiantes insertar videos de YouTube";
+$YoutubeForStudentsComment = "Habilitar la posibilidad de que los estudiantes puedan insertar videos de Youtube";
+$BlockCopyPasteForStudentsTitle = "Bloquear a los estudiantes copiar y pegar";
+$BlockCopyPasteForStudentsComment = "Bloquear a los estudiantes la posibilidad de copiar y pegar en el editor WYSIWYG";
+$MoreButtonsForMaximizedModeTitle = "Barras de botones extendidas";
+$MoreButtonsForMaximizedModeComment = "Habilitar las barras de botones extendidas cuando el editor WYSIWYG está maximizado";
+$Editor = "Editor WYSIWYG";
+$GoToCourseAfterLoginTitle = "Ir directamente al curso tras identificarse";
+$GoToCourseAfterLoginComment = "Cuando un usuario está inscrito sólamente en un curso, ir directamente al curso despúes de identificarse";
+$GroupList = "Lista de grupos";
+$AllowStudentsDownloadFoldersTitle = "Permitir a los estudiantes descargar directorios";
+$AllowStudentsDownloadFoldersComment = "Permitir a los estudiantes empaquetar y descargar un directorio completo en la herramienta documentos";
 ?>

+ 1 - 1
main/lang/spanish/trad4all.inc.php

@@ -291,7 +291,7 @@ $Documents = "Documentos";
 $DocumentAdded = "Documento añadido";
 $DocumentUpdated = "Documento actualizado";
 $DocumentInFolderUpdated = "Documento actualizado en la carpeta";
-$Course_description = "Descripción";
+$Course_description = "Descripción del curso";
 $Calendar_event = "Agenda";
 $Document = "Documentos";
 $Learnpath = "Lecciones";

Some files were not shown because too many files changed in this diff