update html2pdf library to ver 3.26

skala
Juan Carlos Raña 16 years ago
parent f967554dc8
commit 93e96b5ee5
  1. 14
      main/inc/lib/html2pdf/_fpdf/font/courier.php
  2. 30
      main/inc/lib/html2pdf/_fpdf/font/helvetica.php
  3. 30
      main/inc/lib/html2pdf/_fpdf/font/helveticab.php
  4. 30
      main/inc/lib/html2pdf/_fpdf/font/helveticabi.php
  5. 30
      main/inc/lib/html2pdf/_fpdf/font/helveticai.php
  6. 838
      main/inc/lib/html2pdf/_fpdf/font/makefont/makefont.php
  7. 30
      main/inc/lib/html2pdf/_fpdf/font/symbol.php
  8. 30
      main/inc/lib/html2pdf/_fpdf/font/times.php
  9. 30
      main/inc/lib/html2pdf/_fpdf/font/timesb.php
  10. 30
      main/inc/lib/html2pdf/_fpdf/font/timesbi.php
  11. 30
      main/inc/lib/html2pdf/_fpdf/font/timesi.php
  12. 30
      main/inc/lib/html2pdf/_fpdf/font/zapfdingbats.php
  13. 3470
      main/inc/lib/html2pdf/_fpdf/fpdf.php
  14. 10
      main/inc/lib/html2pdf/_fpdf/license.txt
  15. 475
      main/inc/lib/html2pdf/_mypdf/00_fpdf_codebar.class.php
  16. 51
      main/inc/lib/html2pdf/_mypdf/01_fpdf_bookmark.class.php
  17. 69
      main/inc/lib/html2pdf/_mypdf/02_fpdf_formulaire.class.php
  18. 326
      main/inc/lib/html2pdf/_mypdf/03_fpdf_alpha.class.php
  19. 457
      main/inc/lib/html2pdf/_mypdf/99_fpdf_protection.class.php
  20. 987
      main/inc/lib/html2pdf/_mypdf/mypdf.class.php
  21. 3003
      main/inc/lib/html2pdf/html2pdf.class.php
  22. 38
      main/inc/lib/html2pdf/langues/ca.txt
  23. 19
      main/inc/lib/html2pdf/langues/da.txt
  24. 38
      main/inc/lib/html2pdf/langues/de.txt
  25. 38
      main/inc/lib/html2pdf/langues/en.txt
  26. 38
      main/inc/lib/html2pdf/langues/es.txt
  27. 38
      main/inc/lib/html2pdf/langues/fr.txt
  28. 38
      main/inc/lib/html2pdf/langues/it.txt
  29. 38
      main/inc/lib/html2pdf/langues/nl.txt
  30. 38
      main/inc/lib/html2pdf/langues/pt.txt
  31. 38
      main/inc/lib/html2pdf/langues/tr.txt
  32. 861
      main/inc/lib/html2pdf/parsingHTML.class.php
  33. 47
      main/inc/lib/html2pdf/qrcode/qrcode.class.php
  34. 2992
      main/inc/lib/html2pdf/styleHTML.class.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'];
?>

@ -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);
?>

@ -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);
?>

@ -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);
?>

@ -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);
?>

@ -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>';
}
?>

@ -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);
?>

@ -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);
?>

@ -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);
?>

@ -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);
?>

@ -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);
?>

@ -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);
?>

File diff suppressed because it is too large Load Diff

@ -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.

@ -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);
}
}
}

@ -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);
}
}
}
}
}
?>

@ -1,9 +1,9 @@
<?php
/**
* Logiciel : HTML2PDF - classe FPDF_Formulaire
*
* permet la gestion de champs de formulaire dans un PDF
* Inspir<EFBFBD> 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<EFBFBD>ro de l'objet javascript
var $n_cata; //num<EFBFBD>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<EFBFBD>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);
}
}
}
?>

@ -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);
}
}
}

@ -1,229 +1,228 @@
<?php
/*************************************************************************
* http://www.fpdf.org/fr/script/script37.php
*
* @author Klemen Vodopivec
*
* Ce script permet de prot<EFBFBD>ger le PDF, c'est-<EFBFBD>-dire emp<EFBFBD>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<EFBFBD>faut (seule la lecture est autoris<EFBFBD>e).
* user_pass : mot de passe utilisateur. Vide par d<EFBFBD>faut.
* owner_pass : mot de passe propri<EFBFBD>taire. Par d<EFBFBD>faut, une valeur al<EFBFBD>atoire est choisie.
*
* Le tableau des permissions est compos<EFBFBD> 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<EFBFBD>dant la version compl<EFBFBD>te d'Acrobat.
*
* Si vous ne sp<EFBFBD>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<EFBFBD>taire, s'il est diff<EFBFBD>rent de celui utilisateur,
* permet d'obtenir l'acc<EFBFBD>s complet.
*
* Note : prot<EFBFBD>ger un document n<EFBFBD>cessite de le crypter, ce qui augmente le temps de traitement de mani<EFBFBD>re importante.
* Cela peut dans certains cas entra<EFBFBD>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);
}
}
}

@ -1,485 +1,502 @@
<?php
/**
* Logiciel : HTML2PDF - classe MyPDF
*
* Convertisseur HTML => PDF, utilise fpdf de Olivier PLATHEY
* Distribu<EFBFBD> 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<EFBFBD>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<EFBFBD>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<EFBFBD>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 Load Diff

@ -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<EFBFBD>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<EFBFBD>s, si creeu nous m<EFBFBD>todes, envieu-ho a webmaster@spipu.net per tal d'afegir-los a les seg<EFBFBD>ents versions d'HTML2PDF, i que tothom en pugui gaudir.
err02 Frase de 1000 l<EFBFBD>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<EFBFBD>lid, una etiqueta t<EFBFBD> un tancament de m<EFBFBD>s : <b>&lt;[[OTHER]]&gt;</b>
err04 Codi HTML no v<EFBFBD>lid, les etiquetes no estan tancades en l'ordre correcte.<br>Estat : <pre>[[OTHER]]</pre>
err05 Codi HTML no v<EFBFBD>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<EFBFBD>gina
txt01 ERROR n<EFBFBD>
txt02 Fitxer :
txt03 L<EFBFBD>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<EFBFBD>gina [[current]]/[[nb]]
pdf05 Els formularis requereixen l'<EFBFBD>s de l'Adobe Reader 9
vue01 ENCABEZAR
vue02 PEU DE P<EFBFBD>GINA
vue03 P<EFBFBD>GINA
vue04 Visualitzaci<EFBFBD>
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ó

@ -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

@ -1,19 +1,19 @@
err01 Das Tag <b>&lt;[[OTHER]]&gt;</b> existiert noch nicht.<br><br>Wenn Sie es hinzuf<EFBFBD>gen m<EFBFBD>chten, sollen Sie die Methoden<b>o_[[OTHER]]</b> (zu <EFBFBD>ffnen) und <b>c_[[OTHER]]</b> (zu schlie<EFBFBD>en) nach dem Modell den existierenden Tags.<br><br>Wenn Sie diese Methoden au<EFBFBD>erdem aufbauen, bitte teilen Sie sie duch eine E-Mail an meine Adresse : webmaster@spipu.net, so da<EFBFBD> sie k<EFBFBD>nftig in die n<EFBFBD>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<EFBFBD>nge des Texts :</b> [[OTHER_2]]<br>
err03 Falsches HTML Code, <EFBFBD>berz<EFBFBD>hliges geschlo<EFBFBD>ene Tag : <b>&lt;[[OTHER]]&gt;</b>
err04 Falsches HTML Code, die Tags sind nicht in richtiger Ordnung geschlo<EFBFBD>en.<br>Status : <pre>[[OTHER]]</pre>
err05 Falsches HTML Code, alle Tags sollen geschlo<EFBFBD>en sein.<br>Status : <pre>[[OTHER]]</pre>
err06 Ladung des Bilds unm<EFBFBD>glich <b>[[OTHER]]</b>
err07 Er Inhalt eines TD-Tag passt nicht nur auf einer Seite
txt01 Fehler n<EFBFBD>
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<EFBFBD>tigen Sie den Adobe Reader 9
vue01 Seite-Header
vue02 Fu<EFBFBD>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

@ -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<EFBFBD>
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

@ -1,19 +1,19 @@
err01 La etiqueta <b>&lt;[[OTHER]]&gt;</b> todav<EFBFBD>a no existe.<br><br>Si quiere a<EFBFBD>adirla, debe crear los m<EFBFBD>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<EFBFBD>todos, env<EFBFBD>elos a webmaster@spipu.net para a<EFBFBD>adirlos a las siguientes versiones de HTML2PDF, y que todo el mundo se pueda beneficiar.
err02 Frase de 1000 l<EFBFBD>neas => demasiado larga<br><b>Frase :</b> [[OTHER_0]]<br><b>Tama<EFBFBD>o casilla :</b> [[OTHER_1]]<br><b>Tama<EFBFBD>o texto :</b> [[OTHER_2]]<br>
err03 C<EFBFBD>digo HTML no v<EFBFBD>lido, una etiqueta tiene un cierre de m<EFBFBD>s : <b>&lt;[[OTHER]]&gt;</b>
err04 C<EFBFBD>digo HTML no v<EFBFBD>lido, las etiquetas no estan cerradas en el orden correcto.<br>Estado : <pre>[[OTHER]]</pre>
err05 C<EFBFBD>digo HTML no v<EFBFBD>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<EFBFBD>gina
txt01 ERROR n<EFBFBD>
txt02 Fichero :
txt03 L<EFBFBD>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<EFBFBD>gina [[current]]/[[nb]]
pdf05 Los formularios requieren el uso de Adobe Reader 9
vue01 ENCABEZADO
vue02 PIE DE P<EFBFBD>GINA
vue03 P<EFBFBD>GINA
vue04 Visualizaci<EFBFBD>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

@ -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<EFBFBD>er les m<EFBFBD>thodes <b>o_[[OTHER]]</b> (pour l'ouverture) et <b>c_[[OTHER]]</b> (pour la fermeture) en suivant le mod<EFBFBD>le des balises existantes.<br><br>De plus, si vous cr<EFBFBD>ez ces m<EFBFBD>thodes, n'h<EFBFBD>sitez pas <EFBFBD> en faire profiter tout le monde en m'<EFBFBD>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<EFBFBD>e en trop : <b>&lt;[[OTHER]]&gt;</b>
err04 Code HTML non valide, les balises ne sont pas ferm<EFBFBD>es dans le bon ordre.<br>Etat : <pre>[[OTHER]]</pre>
err05 Code HTML non valide, toutes les balises doivent <EFBFBD>tre ferm<EFBFBD>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<EFBFBD>
txt02 Fichier :
txt03 Ligne :
pdf01 Document g<EFBFBD>n<EFBFBD>r<EFBFBD> le [[date_d]]/[[date_m]]/[[date_y]]
pdf02 Document g<EFBFBD>n<EFBFBD>r<EFBFBD> <EFBFBD> [[date_h]]:[[date_i]]
pdf03 Document g<EFBFBD>n<EFBFBD>r<EFBFBD> le [[date_d]]/[[date_m]]/[[date_y]] <EFBFBD> [[date_h]]:[[date_i]]
pdf04 Page [[current]]/[[nb]]
pdf05 Les formulaires n<EFBFBD>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

@ -1,19 +1,19 @@
err01 Il tag <b>&lt;[[OTHER]]&gt;</b> non esiste ancora.<br><br>Se si desidera aggiungere, <EFBFBD> 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 <EFBFBD> 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<EFBFBD>
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

@ -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

@ -1,19 +1,19 @@
err01 A tag <b>&lt;[[OTHER]]&gt;</b> ainda n<EFBFBD>o existe.<br><br>Se voc<EFBFBD> quer inser<EFBFBD>-la, deve criar os m<EFBFBD>todos <b>o_[[OTHER]]</b> (para abr<EFBFBD>-la) e <b>c_[[OTHER]]</b> (para fech<EFBFBD>-la) seguindo o modelo das tags existentes.<br><br>Se voc<EFBFBD> criar novos m<EFBFBD>todos, os envie para webmaster@spipu.net para que as pr<EFBFBD>ximas vers<EFBFBD>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<EFBFBD>digo HTML n<EFBFBD>o v<EFBFBD>lido, uma tag est<EFBFBD> com fechamento sobrando : <b>&lt;[[OTHER]]&gt;</b>
err04 C<EFBFBD>digo HTML n<EFBFBD>o v<EFBFBD>lido, as tags n<EFBFBD>o est<EFBFBD>o fechadas na ordem correta.<br>Estado : <pre>[[OTHER]]</pre>
err05 C<EFBFBD>digo HTML n<EFBFBD>o v<EFBFBD>lido, todas as tags devem ser fechadas.<br>Estado : <pre>[[OTHER]]</pre>
err06 Imposs<EFBFBD>vel carregar imagem <b>[[OTHER]]</b>
err07 O conte<EFBFBD>do de uma tag TD n<EFBFBD>o se encaixa em apenas uma p<EFBFBD>gina
txt01 ERRO n<EFBFBD>
txt02 Arquivo :
txt03 Linha :
pdf01 Documento generado em [[date_d]]/[[date_m]]/[[date_y]]
pdf02 Documento generado <EFBFBD>s [[date_h]]:[[date_i]]
pdf03 Documento generado em [[date_d]]/[[date_m]]/[[date_y]] <EFBFBD>s [[date_h]]:[[date_i]]
pdf04 P<EFBFBD>gina [[current]]/[[nb]]
pdf05 Os formul<EFBFBD>rios exigem a utiliza<EFBFBD><EFBFBD>o do Adobe Reader 9
vue01 CABE<EFBFBD>ALHO
vue02 RODAP<EFBFBD>
vue03 P<EFBFBD>GINA
vue04 Visualiza<EFBFBD><EFBFBD>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

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

@ -1,421 +1,440 @@
<?php
/**
* Logiciel : HTML2PDF - classe ParsingHTML
*
* Convertisseur HTML => PDF, utilise fpdf de Olivier PLATHEY
* Distribu<EFBFBD> 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 <EFBFBD> parser
var $code = array(); // code HTML pars<EFBFBD>
var $num = 0; // num<EFBFBD>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<EFBFBD>finir le code HTML <EFBFBD> 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<EFBFBD>cup<EFBFBD>rer le code <EFBFBD> parser
$content = $this->html;
// chercher les balises HTML du code
$tmp = array();
$this->searchCode($content, $tmp);
// identifier les balises une <EFBFBD> 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<EFBFBD>e, il faut nettoyer le d<EFBFBD>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<EFBFBD>cifique le pr<EFBFBD>c<EFBFBD>de => on nettoye les espaces du d<EFBFBD>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<EFBFBD>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<EFBFBD>e
$this->code = $todos;
}
/**
* parser le code HTML
*
* @param string contenu <EFBFBD> parser.
* @param &array tableau de retour des donn<EFBFBD>es
* @return null
*/
function searchCode($content, &$tmp)
{
// s<EFBFBD>parer les balises du texte
$tmp = array();
$reg = '/(<[^>]+>)|([^<]+)+/isU';
// pour chaque <EFBFBD>l<EFBFBD>ment trouv<EFBFBD> :
$str = '';
$offset = 0;
while(preg_match($reg, $content, $parse, PREG_OFFSET_CAPTURE, $offset))
{
// si une balise a <EFBFBD>t<EFBFBD> d<EFBFBD>tect<EFBFBD>e
if ($parse[1][0])
{
// sauvegarde du texte pr<EFBFBD>c<EFBFBD>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 <EFBFBD> la fin de celui qui est d<EFBFBD>j<EFBFBD> d<EFBFBD>tect<EFBFBD>
$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<EFBFBD>sent <EFBFBD> la fin, on l'enregistre
if ($str!='') $tmp[] = array('txt',$str);
unset($str);
}
/**
* analyse une balise HTML
*
* @param string code HTML <EFBFBD> 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<EFBFBD>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<EFBFBD>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<EFBFBD>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<EFBFBD>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<EFBFBD> en style de chaque param<EFBFBD>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<EFBFBD>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<EFBFBD>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<EFBFBD> se trouve l'<EFBFBD>l<EFBFBD>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<EFBFBD>e
return array('name' => $name, 'close' => $close ? 1 : 0, 'param' => $param);
}
// r<EFBFBD>cup<EFBFBD>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<EFBFBD>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 <EFBFBD> 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 <EFBFBD> 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);
}
}
}

@ -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; }
}
}

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save