]> git.mjollnir.org Git - moodle.git/commitdiff
Fix for Bug #5467. Converted newlines to unix format. Removed extra lines at
authorvyshane <vyshane>
Tue, 16 May 2006 06:45:14 +0000 (06:45 +0000)
committervyshane <vyshane>
Tue, 16 May 2006 06:45:14 +0000 (06:45 +0000)
the end of php scripts. Converted tabs to spaces in php scripts.

12 files changed:
lib/fpdf/font/courier.php
lib/fpdf/font/helvetica.php
lib/fpdf/font/helveticab.php
lib/fpdf/font/helveticabi.php
lib/fpdf/font/makefont/makefont.php
lib/fpdf/font/symbol.php
lib/fpdf/font/times.php
lib/fpdf/font/timesb.php
lib/fpdf/font/timesbi.php
lib/fpdf/font/timesi.php
lib/fpdf/font/zapfdingbats.php
lib/fpdf/fpdf.php

index 913f9a4533e0047f42e8ac037991b3d44c8cc939..afe7de31d5f6f259d65203374ad95d2f022d41a7 100755 (executable)
@@ -1,7 +1,7 @@
-<?php\r
-for($i=0;$i<=255;$i++)\r
-       $fpdf_charwidths['courier'][chr($i)]=600;\r
-$fpdf_charwidths['courierB']=$fpdf_charwidths['courier'];\r
-$fpdf_charwidths['courierI']=$fpdf_charwidths['courier'];\r
-$fpdf_charwidths['courierBI']=$fpdf_charwidths['courier'];\r
-?>\r
+<?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'];
+?>
\ No newline at end of file
index ca94cdf21ab299eff088953feb86104aeaa91bae..7021af7f4833db3194d211833ec4c4ac9b738ddb 100755 (executable)
@@ -1,15 +1,15 @@
-<?php\r
-$fpdf_charwidths['helvetica']=array(\r
-       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,\r
-       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,\r
-       ','=>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,\r
-       '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,\r
-       '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,\r
-       '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,\r
-       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,\r
-       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,\r
-       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,\r
-       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,\r
-       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,\r
-       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);\r
-?>\r
+<?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);
+?>
\ No newline at end of file
index 276cfa8cb8c14554fd5d9179a38f137dc06a174c..f8b439e5b11fb532f1ae6901f73ed91a2d87d8ea 100755 (executable)
@@ -1,15 +1,15 @@
-<?php\r
-$fpdf_charwidths['helveticaB']=array(\r
-       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,\r
-       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,\r
-       ','=>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,\r
-       '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,\r
-       '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,\r
-       '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,\r
-       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,\r
-       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,\r
-       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,\r
-       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,\r
-       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,\r
-       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);\r
-?>\r
+<?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);
+?>
\ No newline at end of file
index 8d2177432542b3908e37b90a768e7b4905c175db..3888a573ca136c59fecb1116e2a2a6b9749e8a98 100755 (executable)
@@ -1,15 +1,15 @@
-<?php\r
-$fpdf_charwidths['helveticaBI']=array(\r
-       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,\r
-       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,\r
-       ','=>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,\r
-       '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,\r
-       '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,\r
-       '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,\r
-       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,\r
-       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,\r
-       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,\r
-       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,\r
-       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,\r
-       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);\r
-?>\r
+<?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);
+?>
\ No newline at end of file
index 178e9e2395acc23d413e6e399555701fcd8cc334..17348ab4ae7d6f6ef07b1009ef243ca48f190e14 100755 (executable)
-<?php\r
-/*******************************************************************************\r
-* Utility to generate font definition files                                    *\r
-* Version: 1.13                                                                *\r
-* Date:    2004-12-31                                                          *\r
-*******************************************************************************/\r
-\r
-function ReadMap($enc)\r
-{\r
-       //Read a map file\r
-       $file=dirname(__FILE__).'/'.strtolower($enc).'.map';\r
-       $a=file($file);\r
-       if(empty($a))\r
-               die('<B>Error:</B> encoding not found: '.$enc);\r
-       $cc2gn=array();\r
-       foreach($a as $l)\r
-       {\r
-               if($l{0}=='!')\r
-               {\r
-                       $e=preg_split('/[ \\t]+/',rtrim($l));\r
-                       $cc=hexdec(substr($e[0],1));\r
-                       $gn=$e[2];\r
-                       $cc2gn[$cc]=$gn;\r
-               }\r
-       }\r
-       for($i=0;$i<=255;$i++)\r
-       {\r
-               if(!isset($cc2gn[$i]))\r
-                       $cc2gn[$i]='.notdef';\r
-       }\r
-       return $cc2gn;\r
-}\r
-\r
-function ReadAFM($file,&$map)\r
-{\r
-       //Read a font metric file\r
-       $a=file($file);\r
-       if(empty($a))\r
-               die('File not found');\r
-       $widths=array();\r
-       $fm=array();\r
-       $fix=array('Edot'=>'Edotaccent','edot'=>'edotaccent','Idot'=>'Idotaccent','Zdot'=>'Zdotaccent','zdot'=>'zdotaccent',\r
-               'Odblacute'=>'Ohungarumlaut','odblacute'=>'ohungarumlaut','Udblacute'=>'Uhungarumlaut','udblacute'=>'uhungarumlaut',\r
-               'Gcedilla'=>'Gcommaaccent','gcedilla'=>'gcommaaccent','Kcedilla'=>'Kcommaaccent','kcedilla'=>'kcommaaccent',\r
-               'Lcedilla'=>'Lcommaaccent','lcedilla'=>'lcommaaccent','Ncedilla'=>'Ncommaaccent','ncedilla'=>'ncommaaccent',\r
-               'Rcedilla'=>'Rcommaaccent','rcedilla'=>'rcommaaccent','Scedilla'=>'Scommaaccent','scedilla'=>'scommaaccent',\r
-               'Tcedilla'=>'Tcommaaccent','tcedilla'=>'tcommaaccent','Dslash'=>'Dcroat','dslash'=>'dcroat','Dmacron'=>'Dcroat','dmacron'=>'dcroat',\r
-               'combininggraveaccent'=>'gravecomb','combininghookabove'=>'hookabovecomb','combiningtildeaccent'=>'tildecomb',\r
-               'combiningacuteaccent'=>'acutecomb','combiningdotbelow'=>'dotbelowcomb','dongsign'=>'dong');\r
-       foreach($a as $l)\r
-       {\r
-               $e=explode(' ',rtrim($l));\r
-               if(count($e)<2)\r
-                       continue;\r
-               $code=$e[0];\r
-               $param=$e[1];\r
-               if($code=='C')\r
-               {\r
-                       //Character metrics\r
-                       $cc=(int)$e[1];\r
-                       $w=$e[4];\r
-                       $gn=$e[7];\r
-                       if(substr($gn,-4)=='20AC')\r
-                               $gn='Euro';\r
-                       if(isset($fix[$gn]))\r
-                       {\r
-                               //Fix incorrect glyph name\r
-                               foreach($map as $c=>$n)\r
-                               {\r
-                                       if($n==$fix[$gn])\r
-                                               $map[$c]=$gn;\r
-                               }\r
-                       }\r
-                       if(empty($map))\r
-                       {\r
-                               //Symbolic font: use built-in encoding\r
-                               $widths[$cc]=$w;\r
-                       }\r
-                       else\r
-                       {\r
-                               $widths[$gn]=$w;\r
-                               if($gn=='X')\r
-                                       $fm['CapXHeight']=$e[13];\r
-                       }\r
-                       if($gn=='.notdef')\r
-                               $fm['MissingWidth']=$w;\r
-               }\r
-               elseif($code=='FontName')\r
-                       $fm['FontName']=$param;\r
-               elseif($code=='Weight')\r
-                       $fm['Weight']=$param;\r
-               elseif($code=='ItalicAngle')\r
-                       $fm['ItalicAngle']=(double)$param;\r
-               elseif($code=='Ascender')\r
-                       $fm['Ascender']=(int)$param;\r
-               elseif($code=='Descender')\r
-                       $fm['Descender']=(int)$param;\r
-               elseif($code=='UnderlineThickness')\r
-                       $fm['UnderlineThickness']=(int)$param;\r
-               elseif($code=='UnderlinePosition')\r
-                       $fm['UnderlinePosition']=(int)$param;\r
-               elseif($code=='IsFixedPitch')\r
-                       $fm['IsFixedPitch']=($param=='true');\r
-               elseif($code=='FontBBox')\r
-                       $fm['FontBBox']=array($e[1],$e[2],$e[3],$e[4]);\r
-               elseif($code=='CapHeight')\r
-                       $fm['CapHeight']=(int)$param;\r
-               elseif($code=='StdVW')\r
-                       $fm['StdVW']=(int)$param;\r
-       }\r
-       if(!isset($fm['FontName']))\r
-               die('FontName not found');\r
-       if(!empty($map))\r
-       {\r
-               if(!isset($widths['.notdef']))\r
-                       $widths['.notdef']=600;\r
-               if(!isset($widths['Delta']) and isset($widths['increment']))\r
-                       $widths['Delta']=$widths['increment'];\r
-               //Order widths according to map\r
-               for($i=0;$i<=255;$i++)\r
-               {\r
-                       if(!isset($widths[$map[$i]]))\r
-                       {\r
-                               echo '<B>Warning:</B> character '.$map[$i].' is missing<BR>';\r
-                               $widths[$i]=$widths['.notdef'];\r
-                       }\r
-                       else\r
-                               $widths[$i]=$widths[$map[$i]];\r
-               }\r
-       }\r
-       $fm['Widths']=$widths;\r
-       return $fm;\r
-}\r
-\r
-function MakeFontDescriptor($fm,$symbolic)\r
-{\r
-       //Ascent\r
-       $asc=(isset($fm['Ascender']) ? $fm['Ascender'] : 1000);\r
-       $fd="array('Ascent'=>".$asc;\r
-       //Descent\r
-       $desc=(isset($fm['Descender']) ? $fm['Descender'] : -200);\r
-       $fd.=",'Descent'=>".$desc;\r
-       //CapHeight\r
-       if(isset($fm['CapHeight']))\r
-               $ch=$fm['CapHeight'];\r
-       elseif(isset($fm['CapXHeight']))\r
-               $ch=$fm['CapXHeight'];\r
-       else\r
-               $ch=$asc;\r
-       $fd.=",'CapHeight'=>".$ch;\r
-       //Flags\r
-       $flags=0;\r
-       if(isset($fm['IsFixedPitch']) and $fm['IsFixedPitch'])\r
-               $flags+=1<<0;\r
-       if($symbolic)\r
-               $flags+=1<<2;\r
-       if(!$symbolic)\r
-               $flags+=1<<5;\r
-       if(isset($fm['ItalicAngle']) and $fm['ItalicAngle']!=0)\r
-               $flags+=1<<6;\r
-       $fd.=",'Flags'=>".$flags;\r
-       //FontBBox\r
-       if(isset($fm['FontBBox']))\r
-               $fbb=$fm['FontBBox'];\r
-       else\r
-               $fbb=array(0,$des-100,1000,$asc+100);\r
-       $fd.=",'FontBBox'=>'[".$fbb[0].' '.$fbb[1].' '.$fbb[2].' '.$fbb[3]."]'";\r
-       //ItalicAngle\r
-       $ia=(isset($fm['ItalicAngle']) ? $fm['ItalicAngle'] : 0);\r
-       $fd.=",'ItalicAngle'=>".$ia;\r
-       //StemV\r
-       if(isset($fm['StdVW']))\r
-               $stemv=$fm['StdVW'];\r
-       elseif(isset($fm['Weight']) and eregi('(bold|black)',$fm['Weight']))\r
-               $stemv=120;\r
-       else\r
-               $stemv=70;\r
-       $fd.=",'StemV'=>".$stemv;\r
-       //MissingWidth\r
-       if(isset($fm['MissingWidth']))\r
-               $fd.=",'MissingWidth'=>".$fm['MissingWidth'];\r
-       $fd.=')';\r
-       return $fd;\r
-}\r
-\r
-function MakeWidthArray($fm)\r
-{\r
-       //Make character width array\r
-       $s="array(\n\t";\r
-       $cw=$fm['Widths'];\r
-       for($i=0;$i<=255;$i++)\r
-       {\r
-               if(chr($i)=="'")\r
-                       $s.="'\\''";\r
-               elseif(chr($i)=="\\")\r
-                       $s.="'\\\\'";\r
-               elseif($i>=32 and $i<=126)\r
-                       $s.="'".chr($i)."'";\r
-               else\r
-                       $s.="chr($i)";\r
-               $s.='=>'.$fm['Widths'][$i];\r
-               if($i<255)\r
-                       $s.=',';\r
-               if(($i+1)%22==0)\r
-                       $s.="\n\t";\r
-       }\r
-       $s.=')';\r
-       return $s;\r
-}\r
-\r
-function MakeFontEncoding($map)\r
-{\r
-       //Build differences from reference encoding\r
-       $ref=ReadMap('cp1252');\r
-       $s='';\r
-       $last=0;\r
-       for($i=32;$i<=255;$i++)\r
-       {\r
-               if($map[$i]!=$ref[$i])\r
-               {\r
-                       if($i!=$last+1)\r
-                               $s.=$i.' ';\r
-                       $last=$i;\r
-                       $s.='/'.$map[$i].' ';\r
-               }\r
-       }\r
-       return rtrim($s);\r
-}\r
-\r
-function SaveToFile($file,$s,$mode='t')\r
-{\r
-       $f=fopen($file,'w'.$mode);\r
-       if(!$f)\r
-               die('Can\'t write to file '.$file);\r
-       fwrite($f,$s,strlen($s));\r
-       fclose($f);\r
-}\r
-\r
-function ReadShort($f)\r
-{\r
-       $a=unpack('n1n',fread($f,2));\r
-       return $a['n'];\r
-}\r
-\r
-function ReadLong($f)\r
-{\r
-       $a=unpack('N1N',fread($f,4));\r
-       return $a['N'];\r
-}\r
-\r
-function CheckTTF($file)\r
-{\r
-       //Check if font license allows embedding\r
-       $f=fopen($file,'rb');\r
-       if(!$f)\r
-               die('<B>Error:</B> Can\'t open '.$file);\r
-       //Extract number of tables\r
-       fseek($f,4,SEEK_CUR);\r
-       $nb=ReadShort($f);\r
-       fseek($f,6,SEEK_CUR);\r
-       //Seek OS/2 table\r
-       $found=false;\r
-       for($i=0;$i<$nb;$i++)\r
-       {\r
-               if(fread($f,4)=='OS/2')\r
-               {\r
-                       $found=true;\r
-                       break;\r
-               }\r
-               fseek($f,12,SEEK_CUR);\r
-       }\r
-       if(!$found)\r
-       {\r
-               fclose($f);\r
-               return;\r
-       }\r
-       fseek($f,4,SEEK_CUR);\r
-       $offset=ReadLong($f);\r
-       fseek($f,$offset,SEEK_SET);\r
-       //Extract fsType flags\r
-       fseek($f,8,SEEK_CUR);\r
-       $fsType=ReadShort($f);\r
-       $rl=($fsType & 0x02)!=0;\r
-       $pp=($fsType & 0x04)!=0;\r
-       $e=($fsType & 0x08)!=0;\r
-       fclose($f);\r
-       if($rl and !$pp and !$e)\r
-               echo '<B>Warning:</B> font license does not allow embedding';\r
-}\r
-\r
-/*******************************************************************************\r
-* $fontfile : chemin du fichier TTF (ou chaîne vide si pas d'incorporation)    *\r
-* $afmfile :  chemin du fichier AFM                                            *\r
-* $enc :      encodage (ou chaîne vide si la police est symbolique)            *\r
-* $patch :    patch optionnel pour l'encodage                                  *\r
-* $type :     type de la police si $fontfile est vide                          *\r
-*******************************************************************************/\r
-function MakeFont($fontfile,$afmfile,$enc='cp1252',$patch=array(),$type='TrueType')\r
-{\r
-       //Generate a font definition file\r
-       set_magic_quotes_runtime(0);\r
-       ini_set('auto_detect_line_endings','1');\r
-       if($enc)\r
-       {\r
-               $map=ReadMap($enc);\r
-               foreach($patch as $cc=>$gn)\r
-                       $map[$cc]=$gn;\r
-       }\r
-       else\r
-               $map=array();\r
-       if(!file_exists($afmfile))\r
-               die('<B>Error:</B> AFM file not found: '.$afmfile);\r
-       $fm=ReadAFM($afmfile,$map);\r
-       if($enc)\r
-               $diff=MakeFontEncoding($map);\r
-       else\r
-               $diff='';\r
-       $fd=MakeFontDescriptor($fm,empty($map));\r
-       //Find font type\r
-       if($fontfile)\r
-       {\r
-               $ext=strtolower(substr($fontfile,-3));\r
-               if($ext=='ttf')\r
-                       $type='TrueType';\r
-               elseif($ext=='pfb')\r
-                       $type='Type1';\r
-               else\r
-                       die('<B>Error:</B> unrecognized font file extension: '.$ext);\r
-       }\r
-       else\r
-       {\r
-               if($type!='TrueType' and $type!='Type1')\r
-                       die('<B>Error:</B> incorrect font type: '.$type);\r
-       }\r
-       //Start generation\r
-       $s='<?php'."\n";\r
-       $s.='$type=\''.$type."';\n";\r
-       $s.='$name=\''.$fm['FontName']."';\n";\r
-       $s.='$desc='.$fd.";\n";\r
-       if(!isset($fm['UnderlinePosition']))\r
-               $fm['UnderlinePosition']=-100;\r
-       if(!isset($fm['UnderlineThickness']))\r
-               $fm['UnderlineThickness']=50;\r
-       $s.='$up='.$fm['UnderlinePosition'].";\n";\r
-       $s.='$ut='.$fm['UnderlineThickness'].";\n";\r
-       $w=MakeWidthArray($fm);\r
-       $s.='$cw='.$w.";\n";\r
-       $s.='$enc=\''.$enc."';\n";\r
-       $s.='$diff=\''.$diff."';\n";\r
-       $basename=substr(basename($afmfile),0,-4);\r
-       if($fontfile)\r
-       {\r
-               //Embedded font\r
-               if(!file_exists($fontfile))\r
-                       die('<B>Error:</B> font file not found: '.$fontfile);\r
-               if($type=='TrueType')\r
-                       CheckTTF($fontfile);\r
-               $f=fopen($fontfile,'rb');\r
-               if(!$f)\r
-                       die('<B>Error:</B> Can\'t open '.$fontfile);\r
-               $file=fread($f,filesize($fontfile));\r
-               fclose($f);\r
-               if($type=='Type1')\r
-               {\r
-                       //Find first two sections and discard third one\r
-                       $header=(ord($file{0})==128);\r
-                       if($header)\r
-                       {\r
-                               //Strip first binary header\r
-                               $file=substr($file,6);\r
-                       }\r
-                       $pos=strpos($file,'eexec');\r
-                       if(!$pos)\r
-                               die('<B>Error:</B> font file does not seem to be valid Type1');\r
-                       $size1=$pos+6;\r
-                       if($header and ord($file{$size1})==128)\r
-                       {\r
-                               //Strip second binary header\r
-                               $file=substr($file,0,$size1).substr($file,$size1+6);\r
-                       }\r
-                       $pos=strpos($file,'00000000');\r
-                       if(!$pos)\r
-                               die('<B>Error:</B> font file does not seem to be valid Type1');\r
-                       $size2=$pos-$size1;\r
-                       $file=substr($file,0,$size1+$size2);\r
-               }\r
-               if(function_exists('gzcompress'))\r
-               {\r
-                       $cmp=$basename.'.z';\r
-                       SaveToFile($cmp,gzcompress($file),'b');\r
-                       $s.='$file=\''.$cmp."';\n";\r
-                       echo 'Font file compressed ('.$cmp.')<BR>';\r
-               }\r
-               else\r
-               {\r
-                       $s.='$file=\''.basename($fontfile)."';\n";\r
-                       echo '<B>Notice:</B> font file could not be compressed (zlib extension not available)<BR>';\r
-               }\r
-               if($type=='Type1')\r
-               {\r
-                       $s.='$size1='.$size1.";\n";\r
-                       $s.='$size2='.$size2.";\n";\r
-               }\r
-               else\r
-                       $s.='$originalsize='.filesize($fontfile).";\n";\r
-       }\r
-       else\r
-       {\r
-               //Not embedded font\r
-               $s.='$file='."'';\n";\r
-       }\r
-       $s.="?>\n";\r
-       SaveToFile($basename.'.php',$s);\r
-       echo 'Font definition file generated ('.$basename.'.php'.')<BR>';\r
-}\r
-?>\r
+<?php
+/*******************************************************************************
+* Utility to generate font definition files                                    *
+* Version: 1.13                                                                *
+* Date:    2004-12-31                                                          *
+*******************************************************************************/
+
+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']) and 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']) and $fm['IsFixedPitch'])
+        $flags+=1<<0;
+    if($symbolic)
+        $flags+=1<<2;
+    if(!$symbolic)
+        $flags+=1<<5;
+    if(isset($fm['ItalicAngle']) and $fm['ItalicAngle']!=0)
+        $flags+=1<<6;
+    $fd.=",'Flags'=>".$flags;
+    //FontBBox
+    if(isset($fm['FontBBox']))
+        $fbb=$fm['FontBBox'];
+    else
+        $fbb=array(0,$des-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']) and eregi('(bold|black)',$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 and $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='t')
+{
+    $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 and !$pp and !$e)
+        echo '<B>Warning:</B> font license does not allow embedding';
+}
+
+/*******************************************************************************
+* $fontfile : chemin du fichier TTF (ou chaîne vide si pas d'incorporation)    *
+* $afmfile :  chemin du fichier AFM                                            *
+* $enc :      encodage (ou chaîne vide si la police est symbolique)            *
+* $patch :    patch optionnel pour l'encodage                                  *
+* $type :     type de la police si $fontfile est vide                          *
+*******************************************************************************/
+function MakeFont($fontfile,$afmfile,$enc='cp1252',$patch=array(),$type='TrueType')
+{
+    //Generate a font definition file
+    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' and $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 and 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);
+    echo 'Font definition file generated ('.$basename.'.php'.')<BR>';
+}
+?>
\ No newline at end of file
index 43b50e4511f32eb8b3e5b2a5796cd5212f7e6c79..faecffc03fa90cf2fcd0ca4b8d3fcd9bcdc3ecb4 100755 (executable)
@@ -1,15 +1,15 @@
-<?php\r
-$fpdf_charwidths['symbol']=array(\r
-       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,\r
-       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,\r
-       ','=>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,\r
-       '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,\r
-       '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,\r
-       '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,\r
-       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,\r
-       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,\r
-       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,\r
-       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,\r
-       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,\r
-       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);\r
-?>\r
+<?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);
+?>
\ No newline at end of file
index 837c706e08d966b1109bc6a7709bd4364a96b037..7ce0348d5bc479404a0614c04926ed266e9c8093 100755 (executable)
@@ -1,15 +1,15 @@
-<?php\r
-$fpdf_charwidths['times']=array(\r
-       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,\r
-       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,\r
-       ','=>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,\r
-       '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,\r
-       '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,\r
-       '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,\r
-       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,\r
-       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,\r
-       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,\r
-       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,\r
-       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,\r
-       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);\r
-?>\r
+<?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);
+?>
\ No newline at end of file
index 09cff86ac4a8c4ac25ce3bf8eadfb65f0ba39d78..9efa19f8edf8e130329555ccac7958625fb86bf8 100755 (executable)
@@ -1,15 +1,15 @@
-<?php\r
-$fpdf_charwidths['timesB']=array(\r
-       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,\r
-       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,\r
-       ','=>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,\r
-       '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,\r
-       '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,\r
-       '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,\r
-       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,\r
-       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,\r
-       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,\r
-       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,\r
-       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,\r
-       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);\r
-?>\r
+<?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);
+?>
\ No newline at end of file
index b4e38d763b5b780228ae0141b66fe58b88a9ac47..6e3fecfc19b3654fc5eda82dc93e1df8c6d250f2 100755 (executable)
@@ -1,15 +1,15 @@
-<?php\r
-$fpdf_charwidths['timesBI']=array(\r
-       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,\r
-       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,\r
-       ','=>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,\r
-       '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,\r
-       '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,\r
-       '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,\r
-       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,\r
-       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,\r
-       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,\r
-       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,\r
-       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,\r
-       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);\r
-?>\r
+<?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);
+?>
\ No newline at end of file
index 0ba2b7773d84511a1e5d4b3b82d6d697e43d9a7c..861810bc83f59513ece7fe6f9a5aa66489f42ad0 100755 (executable)
@@ -1,15 +1,15 @@
-<?php\r
-$fpdf_charwidths['timesI']=array(\r
-       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,\r
-       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,\r
-       ','=>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,\r
-       '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,\r
-       '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,\r
-       '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,\r
-       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,\r
-       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,\r
-       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,\r
-       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,\r
-       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,\r
-       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);\r
-?>\r
+<?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);
+?>
\ No newline at end of file
index 1f926a8c3f01ac8ad19d61e7e84cfceb5d4db727..a91f05e9b4749355c44a88d97c4ffa5b0442f3e1 100755 (executable)
@@ -1,15 +1,15 @@
-<?php\r
-$fpdf_charwidths['zapfdingbats']=array(\r
-       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,\r
-       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,\r
-       ','=>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,\r
-       '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,\r
-       '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,\r
-       '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,\r
-       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,\r
-       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,\r
-       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,\r
-       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,\r
-       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,\r
-       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);\r
-?>\r
+<?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);
+?>
\ No newline at end of file
index f0a3e45efa6eb6899246d1f969b3dd7e8d0f7991..222dc2094dea3649d370dfef34a2d23df226edb8 100755 (executable)
-<?php\r
-/*******************************************************************************\r
-* Software: FPDF                                                               *\r
-* Version:  1.53                                                               *\r
-* Date:     2004-12-31                                                         *\r
-* Author:   Olivier PLATHEY                                                    *\r
-* License:  Freeware                                                           *\r
-*                                                                              *\r
-* You may use, modify and redistribute this software as you wish.              *\r
-*******************************************************************************/\r
-\r
-if(!class_exists('FPDF'))\r
-{\r
-define('FPDF_VERSION','1.53');\r
-\r
-class FPDF\r
-{\r
-//Private properties\r
-var $page;               //current page number\r
-var $n;                  //current object number\r
-var $offsets;            //array of object offsets\r
-var $buffer;             //buffer holding in-memory PDF\r
-var $pages;              //array containing pages\r
-var $state;              //current document state\r
-var $compress;           //compression flag\r
-var $DefOrientation;     //default orientation\r
-var $CurOrientation;     //current orientation\r
-var $OrientationChanges; //array indicating orientation changes\r
-var $k;                  //scale factor (number of points in user unit)\r
-var $fwPt,$fhPt;         //dimensions of page format in points\r
-var $fw,$fh;             //dimensions of page format in user unit\r
-var $wPt,$hPt;           //current dimensions of page in points\r
-var $w,$h;               //current dimensions of page in user unit\r
-var $lMargin;            //left margin\r
-var $tMargin;            //top margin\r
-var $rMargin;            //right margin\r
-var $bMargin;            //page break margin\r
-var $cMargin;            //cell margin\r
-var $x,$y;               //current position in user unit for cell positioning\r
-var $lasth;              //height of last cell printed\r
-var $LineWidth;          //line width in user unit\r
-var $CoreFonts;          //array of standard font names\r
-var $fonts;              //array of used fonts\r
-var $FontFiles;          //array of font files\r
-var $diffs;              //array of encoding differences\r
-var $images;             //array of used images\r
-var $PageLinks;          //array of links in pages\r
-var $links;              //array of internal links\r
-var $FontFamily;         //current font family\r
-var $FontStyle;          //current font style\r
-var $underline;          //underlining flag\r
-var $CurrentFont;        //current font info\r
-var $FontSizePt;         //current font size in points\r
-var $FontSize;           //current font size in user unit\r
-var $DrawColor;          //commands for drawing color\r
-var $FillColor;          //commands for filling color\r
-var $TextColor;          //commands for text color\r
-var $ColorFlag;          //indicates whether fill and text colors are different\r
-var $ws;                 //word spacing\r
-var $AutoPageBreak;      //automatic page breaking\r
-var $PageBreakTrigger;   //threshold used to trigger page breaks\r
-var $InFooter;           //flag set when processing footer\r
-var $ZoomMode;           //zoom display mode\r
-var $LayoutMode;         //layout display mode\r
-var $title;              //title\r
-var $subject;            //subject\r
-var $author;             //author\r
-var $keywords;           //keywords\r
-var $creator;            //creator\r
-var $AliasNbPages;       //alias for total number of pages\r
-var $PDFVersion;         //PDF version number\r
-\r
-/*******************************************************************************\r
-*                                                                              *\r
-*                               Public methods                                 *\r
-*                                                                              *\r
-*******************************************************************************/\r
-function FPDF($orientation='P',$unit='mm',$format='A4')\r
-{\r
-       //Some checks\r
-       $this->_dochecks();\r
-       //Initialization of properties\r
-       $this->page=0;\r
-       $this->n=2;\r
-       $this->buffer='';\r
-       $this->pages=array();\r
-       $this->OrientationChanges=array();\r
-       $this->state=0;\r
-       $this->fonts=array();\r
-       $this->FontFiles=array();\r
-       $this->diffs=array();\r
-       $this->images=array();\r
-       $this->links=array();\r
-       $this->InFooter=false;\r
-       $this->lasth=0;\r
-       $this->FontFamily='';\r
-       $this->FontStyle='';\r
-       $this->FontSizePt=12;\r
-       $this->underline=false;\r
-       $this->DrawColor='0 G';\r
-       $this->FillColor='0 g';\r
-       $this->TextColor='0 g';\r
-       $this->ColorFlag=false;\r
-       $this->ws=0;\r
-       //Standard fonts\r
-       $this->CoreFonts=array('courier'=>'Courier','courierB'=>'Courier-Bold','courierI'=>'Courier-Oblique','courierBI'=>'Courier-BoldOblique',\r
-               'helvetica'=>'Helvetica','helveticaB'=>'Helvetica-Bold','helveticaI'=>'Helvetica-Oblique','helveticaBI'=>'Helvetica-BoldOblique',\r
-               'times'=>'Times-Roman','timesB'=>'Times-Bold','timesI'=>'Times-Italic','timesBI'=>'Times-BoldItalic',\r
-               'symbol'=>'Symbol','zapfdingbats'=>'ZapfDingbats');\r
-       //Scale factor\r
-       if($unit=='pt')\r
-               $this->k=1;\r
-       elseif($unit=='mm')\r
-               $this->k=72/25.4;\r
-       elseif($unit=='cm')\r
-               $this->k=72/2.54;\r
-       elseif($unit=='in')\r
-               $this->k=72;\r
-       else\r
-               $this->Error('Incorrect unit: '.$unit);\r
-       //Page format\r
-       if(is_string($format))\r
-       {\r
-               $format=strtolower($format);\r
-               if($format=='a3')\r
-                       $format=array(841.89,1190.55);\r
-               elseif($format=='a4')\r
-                       $format=array(595.28,841.89);\r
-               elseif($format=='a5')\r
-                       $format=array(420.94,595.28);\r
-               elseif($format=='letter')\r
-                       $format=array(612,792);\r
-               elseif($format=='legal')\r
-                       $format=array(612,1008);\r
-               else\r
-                       $this->Error('Unknown page format: '.$format);\r
-               $this->fwPt=$format[0];\r
-               $this->fhPt=$format[1];\r
-       }\r
-       else\r
-       {\r
-               $this->fwPt=$format[0]*$this->k;\r
-               $this->fhPt=$format[1]*$this->k;\r
-       }\r
-       $this->fw=$this->fwPt/$this->k;\r
-       $this->fh=$this->fhPt/$this->k;\r
-       //Page orientation\r
-       $orientation=strtolower($orientation);\r
-       if($orientation=='p' || $orientation=='portrait')\r
-       {\r
-               $this->DefOrientation='P';\r
-               $this->wPt=$this->fwPt;\r
-               $this->hPt=$this->fhPt;\r
-       }\r
-       elseif($orientation=='l' || $orientation=='landscape')\r
-       {\r
-               $this->DefOrientation='L';\r
-               $this->wPt=$this->fhPt;\r
-               $this->hPt=$this->fwPt;\r
-       }\r
-       else\r
-               $this->Error('Incorrect orientation: '.$orientation);\r
-       $this->CurOrientation=$this->DefOrientation;\r
-       $this->w=$this->wPt/$this->k;\r
-       $this->h=$this->hPt/$this->k;\r
-       //Page margins (1 cm)\r
-       $margin=28.35/$this->k;\r
-       $this->SetMargins($margin,$margin);\r
-       //Interior cell margin (1 mm)\r
-       $this->cMargin=$margin/10;\r
-       //Line width (0.2 mm)\r
-       $this->LineWidth=.567/$this->k;\r
-       //Automatic page break\r
-       $this->SetAutoPageBreak(true,2*$margin);\r
-       //Full width display mode\r
-       $this->SetDisplayMode('fullwidth');\r
-       //Enable compression\r
-       $this->SetCompression(true);\r
-       //Set default PDF version number\r
-       $this->PDFVersion='1.3';\r
-}\r
-\r
-function SetMargins($left,$top,$right=-1)\r
-{\r
-       //Set left, top and right margins\r
-       $this->lMargin=$left;\r
-       $this->tMargin=$top;\r
-       if($right==-1)\r
-               $right=$left;\r
-       $this->rMargin=$right;\r
-}\r
-\r
-function SetLeftMargin($margin)\r
-{\r
-       //Set left margin\r
-       $this->lMargin=$margin;\r
-       if($this->page>0 && $this->x<$margin)\r
-               $this->x=$margin;\r
-}\r
-\r
-function SetTopMargin($margin)\r
-{\r
-       //Set top margin\r
-       $this->tMargin=$margin;\r
-}\r
-\r
-function SetRightMargin($margin)\r
-{\r
-       //Set right margin\r
-       $this->rMargin=$margin;\r
-}\r
-\r
-function SetAutoPageBreak($auto,$margin=0)\r
-{\r
-       //Set auto page break mode and triggering margin\r
-       $this->AutoPageBreak=$auto;\r
-       $this->bMargin=$margin;\r
-       $this->PageBreakTrigger=$this->h-$margin;\r
-}\r
-\r
-function SetDisplayMode($zoom,$layout='continuous')\r
-{\r
-       //Set display mode in viewer\r
-       if($zoom=='fullpage' || $zoom=='fullwidth' || $zoom=='real' || $zoom=='default' || !is_string($zoom))\r
-               $this->ZoomMode=$zoom;\r
-       else\r
-               $this->Error('Incorrect zoom display mode: '.$zoom);\r
-       if($layout=='single' || $layout=='continuous' || $layout=='two' || $layout=='default')\r
-               $this->LayoutMode=$layout;\r
-       else\r
-               $this->Error('Incorrect layout display mode: '.$layout);\r
-}\r
-\r
-function SetCompression($compress)\r
-{\r
-       //Set page compression\r
-       if(function_exists('gzcompress'))\r
-               $this->compress=$compress;\r
-       else\r
-               $this->compress=false;\r
-}\r
-\r
-function SetTitle($title)\r
-{\r
-       //Title of document\r
-       $this->title=$title;\r
-}\r
-\r
-function SetSubject($subject)\r
-{\r
-       //Subject of document\r
-       $this->subject=$subject;\r
-}\r
-\r
-function SetAuthor($author)\r
-{\r
-       //Author of document\r
-       $this->author=$author;\r
-}\r
-\r
-function SetKeywords($keywords)\r
-{\r
-       //Keywords of document\r
-       $this->keywords=$keywords;\r
-}\r
-\r
-function SetCreator($creator)\r
-{\r
-       //Creator of document\r
-       $this->creator=$creator;\r
-}\r
-\r
-function AliasNbPages($alias='{nb}')\r
-{\r
-       //Define an alias for total number of pages\r
-       $this->AliasNbPages=$alias;\r
-}\r
-\r
-function Error($msg)\r
-{\r
-       //Fatal error\r
-       die('<B>FPDF error: </B>'.$msg);\r
-}\r
-\r
-function Open()\r
-{\r
-       //Begin document\r
-       $this->state=1;\r
-}\r
-\r
-function Close()\r
-{\r
-       //Terminate document\r
-       if($this->state==3)\r
-               return;\r
-       if($this->page==0)\r
-               $this->AddPage();\r
-       //Page footer\r
-       $this->InFooter=true;\r
-       $this->Footer();\r
-       $this->InFooter=false;\r
-       //Close page\r
-       $this->_endpage();\r
-       //Close document\r
-       $this->_enddoc();\r
-}\r
-\r
-function AddPage($orientation='')\r
-{\r
-       //Start a new page\r
-       if($this->state==0)\r
-               $this->Open();\r
-       $family=$this->FontFamily;\r
-       $style=$this->FontStyle.($this->underline ? 'U' : '');\r
-       $size=$this->FontSizePt;\r
-       $lw=$this->LineWidth;\r
-       $dc=$this->DrawColor;\r
-       $fc=$this->FillColor;\r
-       $tc=$this->TextColor;\r
-       $cf=$this->ColorFlag;\r
-       if($this->page>0)\r
-       {\r
-               //Page footer\r
-               $this->InFooter=true;\r
-               $this->Footer();\r
-               $this->InFooter=false;\r
-               //Close page\r
-               $this->_endpage();\r
-       }\r
-       //Start new page\r
-       $this->_beginpage($orientation);\r
-       //Set line cap style to square\r
-       $this->_out('2 J');\r
-       //Set line width\r
-       $this->LineWidth=$lw;\r
-       $this->_out(sprintf('%.2f w',$lw*$this->k));\r
-       //Set font\r
-       if($family)\r
-               $this->SetFont($family,$style,$size);\r
-       //Set colors\r
-       $this->DrawColor=$dc;\r
-       if($dc!='0 G')\r
-               $this->_out($dc);\r
-       $this->FillColor=$fc;\r
-       if($fc!='0 g')\r
-               $this->_out($fc);\r
-       $this->TextColor=$tc;\r
-       $this->ColorFlag=$cf;\r
-       //Page header\r
-       $this->Header();\r
-       //Restore line width\r
-       if($this->LineWidth!=$lw)\r
-       {\r
-               $this->LineWidth=$lw;\r
-               $this->_out(sprintf('%.2f w',$lw*$this->k));\r
-       }\r
-       //Restore font\r
-       if($family)\r
-               $this->SetFont($family,$style,$size);\r
-       //Restore colors\r
-       if($this->DrawColor!=$dc)\r
-       {\r
-               $this->DrawColor=$dc;\r
-               $this->_out($dc);\r
-       }\r
-       if($this->FillColor!=$fc)\r
-       {\r
-               $this->FillColor=$fc;\r
-               $this->_out($fc);\r
-       }\r
-       $this->TextColor=$tc;\r
-       $this->ColorFlag=$cf;\r
-}\r
-\r
-function Header()\r
-{\r
-       //To be implemented in your own inherited class\r
-}\r
-\r
-function Footer()\r
-{\r
-       //To be implemented in your own inherited class\r
-}\r
-\r
-function PageNo()\r
-{\r
-       //Get current page number\r
-       return $this->page;\r
-}\r
-\r
-function SetDrawColor($r,$g=-1,$b=-1)\r
-{\r
-       //Set color for all stroking operations\r
-       if(($r==0 && $g==0 && $b==0) || $g==-1)\r
-               $this->DrawColor=sprintf('%.3f G',$r/255);\r
-       else\r
-               $this->DrawColor=sprintf('%.3f %.3f %.3f RG',$r/255,$g/255,$b/255);\r
-       if($this->page>0)\r
-               $this->_out($this->DrawColor);\r
-}\r
-\r
-function SetFillColor($r,$g=-1,$b=-1)\r
-{\r
-       //Set color for all filling operations\r
-       if(($r==0 && $g==0 && $b==0) || $g==-1)\r
-               $this->FillColor=sprintf('%.3f g',$r/255);\r
-       else\r
-               $this->FillColor=sprintf('%.3f %.3f %.3f rg',$r/255,$g/255,$b/255);\r
-       $this->ColorFlag=($this->FillColor!=$this->TextColor);\r
-       if($this->page>0)\r
-               $this->_out($this->FillColor);\r
-}\r
-\r
-function SetTextColor($r,$g=-1,$b=-1)\r
-{\r
-       //Set color for text\r
-       if(($r==0 && $g==0 && $b==0) || $g==-1)\r
-               $this->TextColor=sprintf('%.3f g',$r/255);\r
-       else\r
-               $this->TextColor=sprintf('%.3f %.3f %.3f rg',$r/255,$g/255,$b/255);\r
-       $this->ColorFlag=($this->FillColor!=$this->TextColor);\r
-}\r
-\r
-function GetStringWidth($s)\r
-{\r
-       //Get width of a string in the current font\r
-       $s=(string)$s;\r
-       $cw=&$this->CurrentFont['cw'];\r
-       $w=0;\r
-       $l=strlen($s);\r
-       for($i=0;$i<$l;$i++)\r
-               $w+=$cw[$s{$i}];\r
-       return $w*$this->FontSize/1000;\r
-}\r
-\r
-function SetLineWidth($width)\r
-{\r
-       //Set line width\r
-       $this->LineWidth=$width;\r
-       if($this->page>0)\r
-               $this->_out(sprintf('%.2f w',$width*$this->k));\r
-}\r
-\r
-function Line($x1,$y1,$x2,$y2)\r
-{\r
-       //Draw a line\r
-       $this->_out(sprintf('%.2f %.2f m %.2f %.2f l S',$x1*$this->k,($this->h-$y1)*$this->k,$x2*$this->k,($this->h-$y2)*$this->k));\r
-}\r
-\r
-function Rect($x,$y,$w,$h,$style='')\r
-{\r
-       //Draw a rectangle\r
-       if($style=='F')\r
-               $op='f';\r
-       elseif($style=='FD' || $style=='DF')\r
-               $op='B';\r
-       else\r
-               $op='S';\r
-       $this->_out(sprintf('%.2f %.2f %.2f %.2f re %s',$x*$this->k,($this->h-$y)*$this->k,$w*$this->k,-$h*$this->k,$op));\r
-}\r
-\r
-function AddFont($family,$style='',$file='')\r
-{\r
-       //Add a TrueType or Type1 font\r
-       $family=strtolower($family);\r
-       if($file=='')\r
-               $file=str_replace(' ','',$family).strtolower($style).'.php';\r
-       if($family=='arial')\r
-               $family='helvetica';\r
-       $style=strtoupper($style);\r
-       if($style=='IB')\r
-               $style='BI';\r
-       $fontkey=$family.$style;\r
-       if(isset($this->fonts[$fontkey]))\r
-               $this->Error('Font already added: '.$family.' '.$style);\r
-       include($this->_getfontpath().$file);\r
-       if(!isset($name))\r
-               $this->Error('Could not include font definition file');\r
-       $i=count($this->fonts)+1;\r
-       $this->fonts[$fontkey]=array('i'=>$i,'type'=>$type,'name'=>$name,'desc'=>$desc,'up'=>$up,'ut'=>$ut,'cw'=>$cw,'enc'=>$enc,'file'=>$file);\r
-       if($diff)\r
-       {\r
-               //Search existing encodings\r
-               $d=0;\r
-               $nb=count($this->diffs);\r
-               for($i=1;$i<=$nb;$i++)\r
-               {\r
-                       if($this->diffs[$i]==$diff)\r
-                       {\r
-                               $d=$i;\r
-                               break;\r
-                       }\r
-               }\r
-               if($d==0)\r
-               {\r
-                       $d=$nb+1;\r
-                       $this->diffs[$d]=$diff;\r
-               }\r
-               $this->fonts[$fontkey]['diff']=$d;\r
-       }\r
-       if($file)\r
-       {\r
-               if($type=='TrueType')\r
-                       $this->FontFiles[$file]=array('length1'=>$originalsize);\r
-               else\r
-                       $this->FontFiles[$file]=array('length1'=>$size1,'length2'=>$size2);\r
-       }\r
-}\r
-\r
-function SetFont($family,$style='',$size=0)\r
-{\r
-       //Select a font; size given in points\r
-       global $fpdf_charwidths;\r
-\r
-       $family=strtolower($family);\r
-       if($family=='')\r
-               $family=$this->FontFamily;\r
-       if($family=='arial')\r
-               $family='helvetica';\r
-       elseif($family=='symbol' || $family=='zapfdingbats')\r
-               $style='';\r
-       $style=strtoupper($style);\r
-       if(strpos($style,'U')!==false)\r
-       {\r
-               $this->underline=true;\r
-               $style=str_replace('U','',$style);\r
-       }\r
-       else\r
-               $this->underline=false;\r
-       if($style=='IB')\r
-               $style='BI';\r
-       if($size==0)\r
-               $size=$this->FontSizePt;\r
-       //Test if font is already selected\r
-       if($this->FontFamily==$family && $this->FontStyle==$style && $this->FontSizePt==$size)\r
-               return;\r
-       //Test if used for the first time\r
-       $fontkey=$family.$style;\r
-       if(!isset($this->fonts[$fontkey]))\r
-       {\r
-               //Check if one of the standard fonts\r
-               if(isset($this->CoreFonts[$fontkey]))\r
-               {\r
-                       if(!isset($fpdf_charwidths[$fontkey]))\r
-                       {\r
-                               //Load metric file\r
-                               $file=$family;\r
-                               if($family=='times' || $family=='helvetica')\r
-                                       $file.=strtolower($style);\r
-                               include($this->_getfontpath().$file.'.php');\r
-                               if(!isset($fpdf_charwidths[$fontkey]))\r
-                                       $this->Error('Could not include font metric file');\r
-                       }\r
-                       $i=count($this->fonts)+1;\r
-                       $this->fonts[$fontkey]=array('i'=>$i,'type'=>'core','name'=>$this->CoreFonts[$fontkey],'up'=>-100,'ut'=>50,'cw'=>$fpdf_charwidths[$fontkey]);\r
-               }\r
-               else\r
-                       $this->Error('Undefined font: '.$family.' '.$style);\r
-       }\r
-       //Select it\r
-       $this->FontFamily=$family;\r
-       $this->FontStyle=$style;\r
-       $this->FontSizePt=$size;\r
-       $this->FontSize=$size/$this->k;\r
-       $this->CurrentFont=&$this->fonts[$fontkey];\r
-       if($this->page>0)\r
-               $this->_out(sprintf('BT /F%d %.2f Tf ET',$this->CurrentFont['i'],$this->FontSizePt));\r
-}\r
-\r
-function SetFontSize($size)\r
-{\r
-       //Set font size in points\r
-       if($this->FontSizePt==$size)\r
-               return;\r
-       $this->FontSizePt=$size;\r
-       $this->FontSize=$size/$this->k;\r
-       if($this->page>0)\r
-               $this->_out(sprintf('BT /F%d %.2f Tf ET',$this->CurrentFont['i'],$this->FontSizePt));\r
-}\r
-\r
-function AddLink()\r
-{\r
-       //Create a new internal link\r
-       $n=count($this->links)+1;\r
-       $this->links[$n]=array(0,0);\r
-       return $n;\r
-}\r
-\r
-function SetLink($link,$y=0,$page=-1)\r
-{\r
-       //Set destination of internal link\r
-       if($y==-1)\r
-               $y=$this->y;\r
-       if($page==-1)\r
-               $page=$this->page;\r
-       $this->links[$link]=array($page,$y);\r
-}\r
-\r
-function Link($x,$y,$w,$h,$link)\r
-{\r
-       //Put a link on the page\r
-       $this->PageLinks[$this->page][]=array($x*$this->k,$this->hPt-$y*$this->k,$w*$this->k,$h*$this->k,$link);\r
-}\r
-\r
-function Text($x,$y,$txt)\r
-{\r
-       //Output a string\r
-       $s=sprintf('BT %.2f %.2f Td (%s) Tj ET',$x*$this->k,($this->h-$y)*$this->k,$this->_escape($txt));\r
-       if($this->underline && $txt!='')\r
-               $s.=' '.$this->_dounderline($x,$y,$txt);\r
-       if($this->ColorFlag)\r
-               $s='q '.$this->TextColor.' '.$s.' Q';\r
-       $this->_out($s);\r
-}\r
-\r
-function AcceptPageBreak()\r
-{\r
-       //Accept automatic page break or not\r
-       return $this->AutoPageBreak;\r
-}\r
-\r
-function Cell($w,$h=0,$txt='',$border=0,$ln=0,$align='',$fill=0,$link='')\r
-{\r
-       //Output a cell\r
-       $k=$this->k;\r
-       if($this->y+$h>$this->PageBreakTrigger && !$this->InFooter && $this->AcceptPageBreak())\r
-       {\r
-               //Automatic page break\r
-               $x=$this->x;\r
-               $ws=$this->ws;\r
-               if($ws>0)\r
-               {\r
-                       $this->ws=0;\r
-                       $this->_out('0 Tw');\r
-               }\r
-               $this->AddPage($this->CurOrientation);\r
-               $this->x=$x;\r
-               if($ws>0)\r
-               {\r
-                       $this->ws=$ws;\r
-                       $this->_out(sprintf('%.3f Tw',$ws*$k));\r
-               }\r
-       }\r
-       if($w==0)\r
-               $w=$this->w-$this->rMargin-$this->x;\r
-       $s='';\r
-       if($fill==1 || $border==1)\r
-       {\r
-               if($fill==1)\r
-                       $op=($border==1) ? 'B' : 'f';\r
-               else\r
-                       $op='S';\r
-               $s=sprintf('%.2f %.2f %.2f %.2f re %s ',$this->x*$k,($this->h-$this->y)*$k,$w*$k,-$h*$k,$op);\r
-       }\r
-       if(is_string($border))\r
-       {\r
-               $x=$this->x;\r
-               $y=$this->y;\r
-               if(strpos($border,'L')!==false)\r
-                       $s.=sprintf('%.2f %.2f m %.2f %.2f l S ',$x*$k,($this->h-$y)*$k,$x*$k,($this->h-($y+$h))*$k);\r
-               if(strpos($border,'T')!==false)\r
-                       $s.=sprintf('%.2f %.2f m %.2f %.2f l S ',$x*$k,($this->h-$y)*$k,($x+$w)*$k,($this->h-$y)*$k);\r
-               if(strpos($border,'R')!==false)\r
-                       $s.=sprintf('%.2f %.2f m %.2f %.2f l S ',($x+$w)*$k,($this->h-$y)*$k,($x+$w)*$k,($this->h-($y+$h))*$k);\r
-               if(strpos($border,'B')!==false)\r
-                       $s.=sprintf('%.2f %.2f m %.2f %.2f l S ',$x*$k,($this->h-($y+$h))*$k,($x+$w)*$k,($this->h-($y+$h))*$k);\r
-       }\r
-       if($txt!=='')\r
-       {\r
-               if($align=='R')\r
-                       $dx=$w-$this->cMargin-$this->GetStringWidth($txt);\r
-               elseif($align=='C')\r
-                       $dx=($w-$this->GetStringWidth($txt))/2;\r
-               else\r
-                       $dx=$this->cMargin;\r
-               if($this->ColorFlag)\r
-                       $s.='q '.$this->TextColor.' ';\r
-               $txt2=str_replace(')','\\)',str_replace('(','\\(',str_replace('\\','\\\\',$txt)));\r
-               $s.=sprintf('BT %.2f %.2f Td (%s) Tj ET',($this->x+$dx)*$k,($this->h-($this->y+.5*$h+.3*$this->FontSize))*$k,$txt2);\r
-               if($this->underline)\r
-                       $s.=' '.$this->_dounderline($this->x+$dx,$this->y+.5*$h+.3*$this->FontSize,$txt);\r
-               if($this->ColorFlag)\r
-                       $s.=' Q';\r
-               if($link)\r
-                       $this->Link($this->x+$dx,$this->y+.5*$h-.5*$this->FontSize,$this->GetStringWidth($txt),$this->FontSize,$link);\r
-       }\r
-       if($s)\r
-               $this->_out($s);\r
-       $this->lasth=$h;\r
-       if($ln>0)\r
-       {\r
-               //Go to next line\r
-               $this->y+=$h;\r
-               if($ln==1)\r
-                       $this->x=$this->lMargin;\r
-       }\r
-       else\r
-               $this->x+=$w;\r
-}\r
-\r
-function MultiCell($w,$h,$txt,$border=0,$align='J',$fill=0)\r
-{\r
-       //Output text with automatic or explicit line breaks\r
-       $cw=&$this->CurrentFont['cw'];\r
-       if($w==0)\r
-               $w=$this->w-$this->rMargin-$this->x;\r
-       $wmax=($w-2*$this->cMargin)*1000/$this->FontSize;\r
-       $s=str_replace("\r",'',$txt);\r
-       $nb=strlen($s);\r
-       if($nb>0 && $s[$nb-1]=="\n")\r
-               $nb--;\r
-       $b=0;\r
-       if($border)\r
-       {\r
-               if($border==1)\r
-               {\r
-                       $border='LTRB';\r
-                       $b='LRT';\r
-                       $b2='LR';\r
-               }\r
-               else\r
-               {\r
-                       $b2='';\r
-                       if(strpos($border,'L')!==false)\r
-                               $b2.='L';\r
-                       if(strpos($border,'R')!==false)\r
-                               $b2.='R';\r
-                       $b=(strpos($border,'T')!==false) ? $b2.'T' : $b2;\r
-               }\r
-       }\r
-       $sep=-1;\r
-       $i=0;\r
-       $j=0;\r
-       $l=0;\r
-       $ns=0;\r
-       $nl=1;\r
-       while($i<$nb)\r
-       {\r
-               //Get next character\r
-               $c=$s{$i};\r
-               if($c=="\n")\r
-               {\r
-                       //Explicit line break\r
-                       if($this->ws>0)\r
-                       {\r
-                               $this->ws=0;\r
-                               $this->_out('0 Tw');\r
-                       }\r
-                       $this->Cell($w,$h,substr($s,$j,$i-$j),$b,2,$align,$fill);\r
-                       $i++;\r
-                       $sep=-1;\r
-                       $j=$i;\r
-                       $l=0;\r
-                       $ns=0;\r
-                       $nl++;\r
-                       if($border && $nl==2)\r
-                               $b=$b2;\r
-                       continue;\r
-               }\r
-               if($c==' ')\r
-               {\r
-                       $sep=$i;\r
-                       $ls=$l;\r
-                       $ns++;\r
-               }\r
-               $l+=$cw[$c];\r
-               if($l>$wmax)\r
-               {\r
-                       //Automatic line break\r
-                       if($sep==-1)\r
-                       {\r
-                               if($i==$j)\r
-                                       $i++;\r
-                               if($this->ws>0)\r
-                               {\r
-                                       $this->ws=0;\r
-                                       $this->_out('0 Tw');\r
-                               }\r
-                               $this->Cell($w,$h,substr($s,$j,$i-$j),$b,2,$align,$fill);\r
-                       }\r
-                       else\r
-                       {\r
-                               if($align=='J')\r
-                               {\r
-                                       $this->ws=($ns>1) ? ($wmax-$ls)/1000*$this->FontSize/($ns-1) : 0;\r
-                                       $this->_out(sprintf('%.3f Tw',$this->ws*$this->k));\r
-                               }\r
-                               $this->Cell($w,$h,substr($s,$j,$sep-$j),$b,2,$align,$fill);\r
-                               $i=$sep+1;\r
-                       }\r
-                       $sep=-1;\r
-                       $j=$i;\r
-                       $l=0;\r
-                       $ns=0;\r
-                       $nl++;\r
-                       if($border && $nl==2)\r
-                               $b=$b2;\r
-               }\r
-               else\r
-                       $i++;\r
-       }\r
-       //Last chunk\r
-       if($this->ws>0)\r
-       {\r
-               $this->ws=0;\r
-               $this->_out('0 Tw');\r
-       }\r
-       if($border && strpos($border,'B')!==false)\r
-               $b.='B';\r
-       $this->Cell($w,$h,substr($s,$j,$i-$j),$b,2,$align,$fill);\r
-       $this->x=$this->lMargin;\r
-}\r
-\r
-function Write($h,$txt,$link='')\r
-{\r
-       //Output text in flowing mode\r
-       $cw=&$this->CurrentFont['cw'];\r
-       $w=$this->w-$this->rMargin-$this->x;\r
-       $wmax=($w-2*$this->cMargin)*1000/$this->FontSize;\r
-       $s=str_replace("\r",'',$txt);\r
-       $nb=strlen($s);\r
-       $sep=-1;\r
-       $i=0;\r
-       $j=0;\r
-       $l=0;\r
-       $nl=1;\r
-       while($i<$nb)\r
-       {\r
-               //Get next character\r
-               $c=$s{$i};\r
-               if($c=="\n")\r
-               {\r
-                       //Explicit line break\r
-                       $this->Cell($w,$h,substr($s,$j,$i-$j),0,2,'',0,$link);\r
-                       $i++;\r
-                       $sep=-1;\r
-                       $j=$i;\r
-                       $l=0;\r
-                       if($nl==1)\r
-                       {\r
-                               $this->x=$this->lMargin;\r
-                               $w=$this->w-$this->rMargin-$this->x;\r
-                               $wmax=($w-2*$this->cMargin)*1000/$this->FontSize;\r
-                       }\r
-                       $nl++;\r
-                       continue;\r
-               }\r
-               if($c==' ')\r
-                       $sep=$i;\r
-               $l+=$cw[$c];\r
-               if($l>$wmax)\r
-               {\r
-                       //Automatic line break\r
-                       if($sep==-1)\r
-                       {\r
-                               if($this->x>$this->lMargin)\r
-                               {\r
-                                       //Move to next line\r
-                                       $this->x=$this->lMargin;\r
-                                       $this->y+=$h;\r
-                                       $w=$this->w-$this->rMargin-$this->x;\r
-                                       $wmax=($w-2*$this->cMargin)*1000/$this->FontSize;\r
-                                       $i++;\r
-                                       $nl++;\r
-                                       continue;\r
-                               }\r
-                               if($i==$j)\r
-                                       $i++;\r
-                               $this->Cell($w,$h,substr($s,$j,$i-$j),0,2,'',0,$link);\r
-                       }\r
-                       else\r
-                       {\r
-                               $this->Cell($w,$h,substr($s,$j,$sep-$j),0,2,'',0,$link);\r
-                               $i=$sep+1;\r
-                       }\r
-                       $sep=-1;\r
-                       $j=$i;\r
-                       $l=0;\r
-                       if($nl==1)\r
-                       {\r
-                               $this->x=$this->lMargin;\r
-                               $w=$this->w-$this->rMargin-$this->x;\r
-                               $wmax=($w-2*$this->cMargin)*1000/$this->FontSize;\r
-                       }\r
-                       $nl++;\r
-               }\r
-               else\r
-                       $i++;\r
-       }\r
-       //Last chunk\r
-       if($i!=$j)\r
-               $this->Cell($l/1000*$this->FontSize,$h,substr($s,$j),0,0,'',0,$link);\r
-}\r
-\r
-function Image($file,$x,$y,$w=0,$h=0,$type='',$link='')\r
-{\r
-       //Put an image on the page\r
-       if(!isset($this->images[$file]))\r
-       {\r
-               //First use of image, get info\r
-               if($type=='')\r
-               {\r
-                       $pos=strrpos($file,'.');\r
-                       if(!$pos)\r
-                               $this->Error('Image file has no extension and no type was specified: '.$file);\r
-                       $type=substr($file,$pos+1);\r
-               }\r
-               $type=strtolower($type);\r
-               $mqr=get_magic_quotes_runtime();\r
-               set_magic_quotes_runtime(0);\r
-               if($type=='jpg' || $type=='jpeg')\r
-                       $info=$this->_parsejpg($file);\r
-               elseif($type=='png')\r
-                       $info=$this->_parsepng($file);\r
-               else\r
-               {\r
-                       //Allow for additional formats\r
-                       $mtd='_parse'.$type;\r
-                       if(!method_exists($this,$mtd))\r
-                               $this->Error('Unsupported image type: '.$type);\r
-                       $info=$this->$mtd($file);\r
-               }\r
-               set_magic_quotes_runtime($mqr);\r
-               $info['i']=count($this->images)+1;\r
-               $this->images[$file]=$info;\r
-       }\r
-       else\r
-               $info=$this->images[$file];\r
-       //Automatic width and height calculation if needed\r
-       if($w==0 && $h==0)\r
-       {\r
-               //Put image at 72 dpi\r
-               $w=$info['w']/$this->k;\r
-               $h=$info['h']/$this->k;\r
-       }\r
-       if($w==0)\r
-               $w=$h*$info['w']/$info['h'];\r
-       if($h==0)\r
-               $h=$w*$info['h']/$info['w'];\r
-       $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']));\r
-       if($link)\r
-               $this->Link($x,$y,$w,$h,$link);\r
-}\r
-\r
-function Ln($h='')\r
-{\r
-       //Line feed; default value is last cell height\r
-       $this->x=$this->lMargin;\r
-       if(is_string($h))\r
-               $this->y+=$this->lasth;\r
-       else\r
-               $this->y+=$h;\r
-}\r
-\r
-function GetX()\r
-{\r
-       //Get x position\r
-       return $this->x;\r
-}\r
-\r
-function SetX($x)\r
-{\r
-       //Set x position\r
-       if($x>=0)\r
-               $this->x=$x;\r
-       else\r
-               $this->x=$this->w+$x;\r
-}\r
-\r
-function GetY()\r
-{\r
-       //Get y position\r
-       return $this->y;\r
-}\r
-\r
-function SetY($y)\r
-{\r
-       //Set y position and reset x\r
-       $this->x=$this->lMargin;\r
-       if($y>=0)\r
-               $this->y=$y;\r
-       else\r
-               $this->y=$this->h+$y;\r
-}\r
-\r
-function SetXY($x,$y)\r
-{\r
-       //Set x and y positions\r
-       $this->SetY($y);\r
-       $this->SetX($x);\r
-}\r
-\r
-function Output($name='',$dest='')\r
-{\r
-       //Output PDF to some destination\r
-       //Finish document if necessary\r
-       if($this->state<3)\r
-               $this->Close();\r
-       //Normalize parameters\r
-       if(is_bool($dest))\r
-               $dest=$dest ? 'D' : 'F';\r
-       $dest=strtoupper($dest);\r
-       if($dest=='')\r
-       {\r
-               if($name=='')\r
-               {\r
-                       $name='doc.pdf';\r
-                       $dest='I';\r
-               }\r
-               else\r
-                       $dest='F';\r
-       }\r
-       switch($dest)\r
-       {\r
-               case 'I':\r
-                       //Send to standard output\r
-                       if(ob_get_contents())\r
-                               $this->Error('Some data has already been output, can\'t send PDF file');\r
-                       if(php_sapi_name()!='cli')\r
-                       {\r
-                               //We send to a browser\r
-                               header('Content-Type: application/pdf');\r
-                               if(headers_sent())\r
-                                       $this->Error('Some data has already been output to browser, can\'t send PDF file');\r
-                               header('Content-Length: '.strlen($this->buffer));\r
-                               header('Content-disposition: inline; filename="'.$name.'"');\r
-                       }\r
-                       echo $this->buffer;\r
-                       break;\r
-               case 'D':\r
-                       //Download file\r
-                       if(ob_get_contents())\r
-                               $this->Error('Some data has already been output, can\'t send PDF file');\r
-                       if(isset($_SERVER['HTTP_USER_AGENT']) && strpos($_SERVER['HTTP_USER_AGENT'],'MSIE'))\r
-                               header('Content-Type: application/force-download');\r
-                       else\r
-                               header('Content-Type: application/octet-stream');\r
-                       if(headers_sent())\r
-                               $this->Error('Some data has already been output to browser, can\'t send PDF file');\r
-                       header('Content-Length: '.strlen($this->buffer));\r
-                       header('Content-disposition: attachment; filename="'.$name.'"');\r
-                       echo $this->buffer;\r
-                       break;\r
-               case 'F':\r
-                       //Save to local file\r
-                       $f=fopen($name,'wb');\r
-                       if(!$f)\r
-                               $this->Error('Unable to create output file: '.$name);\r
-                       fwrite($f,$this->buffer,strlen($this->buffer));\r
-                       fclose($f);\r
-                       break;\r
-               case 'S':\r
-                       //Return as a string\r
-                       return $this->buffer;\r
-               default:\r
-                       $this->Error('Incorrect output destination: '.$dest);\r
-       }\r
-       return '';\r
-}\r
-\r
-/*******************************************************************************\r
-*                                                                              *\r
-*                              Protected methods                               *\r
-*                                                                              *\r
-*******************************************************************************/\r
-function _dochecks()\r
-{\r
-       //Check for locale-related bug\r
-       if(1.1==1)\r
-               $this->Error('Don\'t alter the locale before including class file');\r
-       //Check for decimal separator\r
-       if(sprintf('%.1f',1.0)!='1.0')\r
-               setlocale(LC_NUMERIC,'C');\r
-}\r
-\r
-function _getfontpath()\r
-{\r
-       if(!defined('FPDF_FONTPATH') && is_dir(dirname(__FILE__).'/font'))\r
-               define('FPDF_FONTPATH',dirname(__FILE__).'/font/');\r
-       return defined('FPDF_FONTPATH') ? FPDF_FONTPATH : '';\r
-}\r
-\r
-function _putpages()\r
-{\r
-       $nb=$this->page;\r
-       if(!empty($this->AliasNbPages))\r
-       {\r
-               //Replace number of pages\r
-               for($n=1;$n<=$nb;$n++)\r
-                       $this->pages[$n]=str_replace($this->AliasNbPages,$nb,$this->pages[$n]);\r
-       }\r
-       if($this->DefOrientation=='P')\r
-       {\r
-               $wPt=$this->fwPt;\r
-               $hPt=$this->fhPt;\r
-       }\r
-       else\r
-       {\r
-               $wPt=$this->fhPt;\r
-               $hPt=$this->fwPt;\r
-       }\r
-       $filter=($this->compress) ? '/Filter /FlateDecode ' : '';\r
-       for($n=1;$n<=$nb;$n++)\r
-       {\r
-               //Page\r
-               $this->_newobj();\r
-               $this->_out('<</Type /Page');\r
-               $this->_out('/Parent 1 0 R');\r
-               if(isset($this->OrientationChanges[$n]))\r
-                       $this->_out(sprintf('/MediaBox [0 0 %.2f %.2f]',$hPt,$wPt));\r
-               $this->_out('/Resources 2 0 R');\r
-               if(isset($this->PageLinks[$n]))\r
-               {\r
-                       //Links\r
-                       $annots='/Annots [';\r
-                       foreach($this->PageLinks[$n] as $pl)\r
-                       {\r
-                               $rect=sprintf('%.2f %.2f %.2f %.2f',$pl[0],$pl[1],$pl[0]+$pl[2],$pl[1]-$pl[3]);\r
-                               $annots.='<</Type /Annot /Subtype /Link /Rect ['.$rect.'] /Border [0 0 0] ';\r
-                               if(is_string($pl[4]))\r
-                                       $annots.='/A <</S /URI /URI '.$this->_textstring($pl[4]).'>>>>';\r
-                               else\r
-                               {\r
-                                       $l=$this->links[$pl[4]];\r
-                                       $h=isset($this->OrientationChanges[$l[0]]) ? $wPt : $hPt;\r
-                                       $annots.=sprintf('/Dest [%d 0 R /XYZ 0 %.2f null]>>',1+2*$l[0],$h-$l[1]*$this->k);\r
-                               }\r
-                       }\r
-                       $this->_out($annots.']');\r
-               }\r
-               $this->_out('/Contents '.($this->n+1).' 0 R>>');\r
-               $this->_out('endobj');\r
-               //Page content\r
-               $p=($this->compress) ? gzcompress($this->pages[$n]) : $this->pages[$n];\r
-               $this->_newobj();\r
-               $this->_out('<<'.$filter.'/Length '.strlen($p).'>>');\r
-               $this->_putstream($p);\r
-               $this->_out('endobj');\r
-       }\r
-       //Pages root\r
-       $this->offsets[1]=strlen($this->buffer);\r
-       $this->_out('1 0 obj');\r
-       $this->_out('<</Type /Pages');\r
-       $kids='/Kids [';\r
-       for($i=0;$i<$nb;$i++)\r
-               $kids.=(3+2*$i).' 0 R ';\r
-       $this->_out($kids.']');\r
-       $this->_out('/Count '.$nb);\r
-       $this->_out(sprintf('/MediaBox [0 0 %.2f %.2f]',$wPt,$hPt));\r
-       $this->_out('>>');\r
-       $this->_out('endobj');\r
-}\r
-\r
-function _putfonts()\r
-{\r
-       $nf=$this->n;\r
-       foreach($this->diffs as $diff)\r
-       {\r
-               //Encodings\r
-               $this->_newobj();\r
-               $this->_out('<</Type /Encoding /BaseEncoding /WinAnsiEncoding /Differences ['.$diff.']>>');\r
-               $this->_out('endobj');\r
-       }\r
-       $mqr=get_magic_quotes_runtime();\r
-       set_magic_quotes_runtime(0);\r
-       foreach($this->FontFiles as $file=>$info)\r
-       {\r
-               //Font file embedding\r
-               $this->_newobj();\r
-               $this->FontFiles[$file]['n']=$this->n;\r
-               $font='';\r
-               $f=fopen($this->_getfontpath().$file,'rb',1);\r
-               if(!$f)\r
-                       $this->Error('Font file not found');\r
-               while(!feof($f))\r
-                       $font.=fread($f,8192);\r
-               fclose($f);\r
-               $compressed=(substr($file,-2)=='.z');\r
-               if(!$compressed && isset($info['length2']))\r
-               {\r
-                       $header=(ord($font{0})==128);\r
-                       if($header)\r
-                       {\r
-                               //Strip first binary header\r
-                               $font=substr($font,6);\r
-                       }\r
-                       if($header && ord($font{$info['length1']})==128)\r
-                       {\r
-                               //Strip second binary header\r
-                               $font=substr($font,0,$info['length1']).substr($font,$info['length1']+6);\r
-                       }\r
-               }\r
-               $this->_out('<</Length '.strlen($font));\r
-               if($compressed)\r
-                       $this->_out('/Filter /FlateDecode');\r
-               $this->_out('/Length1 '.$info['length1']);\r
-               if(isset($info['length2']))\r
-                       $this->_out('/Length2 '.$info['length2'].' /Length3 0');\r
-               $this->_out('>>');\r
-               $this->_putstream($font);\r
-               $this->_out('endobj');\r
-       }\r
-       set_magic_quotes_runtime($mqr);\r
-       foreach($this->fonts as $k=>$font)\r
-       {\r
-               //Font objects\r
-               $this->fonts[$k]['n']=$this->n+1;\r
-               $type=$font['type'];\r
-               $name=$font['name'];\r
-               if($type=='core')\r
-               {\r
-                       //Standard font\r
-                       $this->_newobj();\r
-                       $this->_out('<</Type /Font');\r
-                       $this->_out('/BaseFont /'.$name);\r
-                       $this->_out('/Subtype /Type1');\r
-                       if($name!='Symbol' && $name!='ZapfDingbats')\r
-                               $this->_out('/Encoding /WinAnsiEncoding');\r
-                       $this->_out('>>');\r
-                       $this->_out('endobj');\r
-               }\r
-               elseif($type=='Type1' || $type=='TrueType')\r
-               {\r
-                       //Additional Type1 or TrueType font\r
-                       $this->_newobj();\r
-                       $this->_out('<</Type /Font');\r
-                       $this->_out('/BaseFont /'.$name);\r
-                       $this->_out('/Subtype /'.$type);\r
-                       $this->_out('/FirstChar 32 /LastChar 255');\r
-                       $this->_out('/Widths '.($this->n+1).' 0 R');\r
-                       $this->_out('/FontDescriptor '.($this->n+2).' 0 R');\r
-                       if($font['enc'])\r
-                       {\r
-                               if(isset($font['diff']))\r
-                                       $this->_out('/Encoding '.($nf+$font['diff']).' 0 R');\r
-                               else\r
-                                       $this->_out('/Encoding /WinAnsiEncoding');\r
-                       }\r
-                       $this->_out('>>');\r
-                       $this->_out('endobj');\r
-                       //Widths\r
-                       $this->_newobj();\r
-                       $cw=&$font['cw'];\r
-                       $s='[';\r
-                       for($i=32;$i<=255;$i++)\r
-                               $s.=$cw[chr($i)].' ';\r
-                       $this->_out($s.']');\r
-                       $this->_out('endobj');\r
-                       //Descriptor\r
-                       $this->_newobj();\r
-                       $s='<</Type /FontDescriptor /FontName /'.$name;\r
-                       foreach($font['desc'] as $k=>$v)\r
-                               $s.=' /'.$k.' '.$v;\r
-                       $file=$font['file'];\r
-                       if($file)\r
-                               $s.=' /FontFile'.($type=='Type1' ? '' : '2').' '.$this->FontFiles[$file]['n'].' 0 R';\r
-                       $this->_out($s.'>>');\r
-                       $this->_out('endobj');\r
-               }\r
-               else\r
-               {\r
-                       //Allow for additional types\r
-                       $mtd='_put'.strtolower($type);\r
-                       if(!method_exists($this,$mtd))\r
-                               $this->Error('Unsupported font type: '.$type);\r
-                       $this->$mtd($font);\r
-               }\r
-       }\r
-}\r
-\r
-function _putimages()\r
-{\r
-       $filter=($this->compress) ? '/Filter /FlateDecode ' : '';\r
-       reset($this->images);\r
-       while(list($file,$info)=each($this->images))\r
-       {\r
-               $this->_newobj();\r
-               $this->images[$file]['n']=$this->n;\r
-               $this->_out('<</Type /XObject');\r
-               $this->_out('/Subtype /Image');\r
-               $this->_out('/Width '.$info['w']);\r
-               $this->_out('/Height '.$info['h']);\r
-               if($info['cs']=='Indexed')\r
-                       $this->_out('/ColorSpace [/Indexed /DeviceRGB '.(strlen($info['pal'])/3-1).' '.($this->n+1).' 0 R]');\r
-               else\r
-               {\r
-                       $this->_out('/ColorSpace /'.$info['cs']);\r
-                       if($info['cs']=='DeviceCMYK')\r
-                               $this->_out('/Decode [1 0 1 0 1 0 1 0]');\r
-               }\r
-               $this->_out('/BitsPerComponent '.$info['bpc']);\r
-               if(isset($info['f']))\r
-                       $this->_out('/Filter /'.$info['f']);\r
-               if(isset($info['parms']))\r
-                       $this->_out($info['parms']);\r
-               if(isset($info['trns']) && is_array($info['trns']))\r
-               {\r
-                       $trns='';\r
-                       for($i=0;$i<count($info['trns']);$i++)\r
-                               $trns.=$info['trns'][$i].' '.$info['trns'][$i].' ';\r
-                       $this->_out('/Mask ['.$trns.']');\r
-               }\r
-               $this->_out('/Length '.strlen($info['data']).'>>');\r
-               $this->_putstream($info['data']);\r
-               unset($this->images[$file]['data']);\r
-               $this->_out('endobj');\r
-               //Palette\r
-               if($info['cs']=='Indexed')\r
-               {\r
-                       $this->_newobj();\r
-                       $pal=($this->compress) ? gzcompress($info['pal']) : $info['pal'];\r
-                       $this->_out('<<'.$filter.'/Length '.strlen($pal).'>>');\r
-                       $this->_putstream($pal);\r
-                       $this->_out('endobj');\r
-               }\r
-       }\r
-}\r
-\r
-function _putxobjectdict()\r
-{\r
-       foreach($this->images as $image)\r
-               $this->_out('/I'.$image['i'].' '.$image['n'].' 0 R');\r
-}\r
-\r
-function _putresourcedict()\r
-{\r
-       $this->_out('/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]');\r
-       $this->_out('/Font <<');\r
-       foreach($this->fonts as $font)\r
-               $this->_out('/F'.$font['i'].' '.$font['n'].' 0 R');\r
-       $this->_out('>>');\r
-       $this->_out('/XObject <<');\r
-       $this->_putxobjectdict();\r
-       $this->_out('>>');\r
-}\r
-\r
-function _putresources()\r
-{\r
-       $this->_putfonts();\r
-       $this->_putimages();\r
-       //Resource dictionary\r
-       $this->offsets[2]=strlen($this->buffer);\r
-       $this->_out('2 0 obj');\r
-       $this->_out('<<');\r
-       $this->_putresourcedict();\r
-       $this->_out('>>');\r
-       $this->_out('endobj');\r
-}\r
-\r
-function _putinfo()\r
-{\r
-       $this->_out('/Producer '.$this->_textstring('FPDF '.FPDF_VERSION));\r
-       if(!empty($this->title))\r
-               $this->_out('/Title '.$this->_textstring($this->title));\r
-       if(!empty($this->subject))\r
-               $this->_out('/Subject '.$this->_textstring($this->subject));\r
-       if(!empty($this->author))\r
-               $this->_out('/Author '.$this->_textstring($this->author));\r
-       if(!empty($this->keywords))\r
-               $this->_out('/Keywords '.$this->_textstring($this->keywords));\r
-       if(!empty($this->creator))\r
-               $this->_out('/Creator '.$this->_textstring($this->creator));\r
-       $this->_out('/CreationDate '.$this->_textstring('D:'.date('YmdHis')));\r
-}\r
-\r
-function _putcatalog()\r
-{\r
-       $this->_out('/Type /Catalog');\r
-       $this->_out('/Pages 1 0 R');\r
-       if($this->ZoomMode=='fullpage')\r
-               $this->_out('/OpenAction [3 0 R /Fit]');\r
-       elseif($this->ZoomMode=='fullwidth')\r
-               $this->_out('/OpenAction [3 0 R /FitH null]');\r
-       elseif($this->ZoomMode=='real')\r
-               $this->_out('/OpenAction [3 0 R /XYZ null null 1]');\r
-       elseif(!is_string($this->ZoomMode))\r
-               $this->_out('/OpenAction [3 0 R /XYZ null null '.($this->ZoomMode/100).']');\r
-       if($this->LayoutMode=='single')\r
-               $this->_out('/PageLayout /SinglePage');\r
-       elseif($this->LayoutMode=='continuous')\r
-               $this->_out('/PageLayout /OneColumn');\r
-       elseif($this->LayoutMode=='two')\r
-               $this->_out('/PageLayout /TwoColumnLeft');\r
-}\r
-\r
-function _putheader()\r
-{\r
-       $this->_out('%PDF-'.$this->PDFVersion);\r
-}\r
-\r
-function _puttrailer()\r
-{\r
-       $this->_out('/Size '.($this->n+1));\r
-       $this->_out('/Root '.$this->n.' 0 R');\r
-       $this->_out('/Info '.($this->n-1).' 0 R');\r
-}\r
-\r
-function _enddoc()\r
-{\r
-       $this->_putheader();\r
-       $this->_putpages();\r
-       $this->_putresources();\r
-       //Info\r
-       $this->_newobj();\r
-       $this->_out('<<');\r
-       $this->_putinfo();\r
-       $this->_out('>>');\r
-       $this->_out('endobj');\r
-       //Catalog\r
-       $this->_newobj();\r
-       $this->_out('<<');\r
-       $this->_putcatalog();\r
-       $this->_out('>>');\r
-       $this->_out('endobj');\r
-       //Cross-ref\r
-       $o=strlen($this->buffer);\r
-       $this->_out('xref');\r
-       $this->_out('0 '.($this->n+1));\r
-       $this->_out('0000000000 65535 f ');\r
-       for($i=1;$i<=$this->n;$i++)\r
-               $this->_out(sprintf('%010d 00000 n ',$this->offsets[$i]));\r
-       //Trailer\r
-       $this->_out('trailer');\r
-       $this->_out('<<');\r
-       $this->_puttrailer();\r
-       $this->_out('>>');\r
-       $this->_out('startxref');\r
-       $this->_out($o);\r
-       $this->_out('%%EOF');\r
-       $this->state=3;\r
-}\r
-\r
-function _beginpage($orientation)\r
-{\r
-       $this->page++;\r
-       $this->pages[$this->page]='';\r
-       $this->state=2;\r
-       $this->x=$this->lMargin;\r
-       $this->y=$this->tMargin;\r
-       $this->FontFamily='';\r
-       //Page orientation\r
-       if(!$orientation)\r
-               $orientation=$this->DefOrientation;\r
-       else\r
-       {\r
-               $orientation=strtoupper($orientation{0});\r
-               if($orientation!=$this->DefOrientation)\r
-                       $this->OrientationChanges[$this->page]=true;\r
-       }\r
-       if($orientation!=$this->CurOrientation)\r
-       {\r
-               //Change orientation\r
-               if($orientation=='P')\r
-               {\r
-                       $this->wPt=$this->fwPt;\r
-                       $this->hPt=$this->fhPt;\r
-                       $this->w=$this->fw;\r
-                       $this->h=$this->fh;\r
-               }\r
-               else\r
-               {\r
-                       $this->wPt=$this->fhPt;\r
-                       $this->hPt=$this->fwPt;\r
-                       $this->w=$this->fh;\r
-                       $this->h=$this->fw;\r
-               }\r
-               $this->PageBreakTrigger=$this->h-$this->bMargin;\r
-               $this->CurOrientation=$orientation;\r
-       }\r
-}\r
-\r
-function _endpage()\r
-{\r
-       //End of page contents\r
-       $this->state=1;\r
-}\r
-\r
-function _newobj()\r
-{\r
-       //Begin a new object\r
-       $this->n++;\r
-       $this->offsets[$this->n]=strlen($this->buffer);\r
-       $this->_out($this->n.' 0 obj');\r
-}\r
-\r
-function _dounderline($x,$y,$txt)\r
-{\r
-       //Underline text\r
-       $up=$this->CurrentFont['up'];\r
-       $ut=$this->CurrentFont['ut'];\r
-       $w=$this->GetStringWidth($txt)+$this->ws*substr_count($txt,' ');\r
-       return sprintf('%.2f %.2f %.2f %.2f re f',$x*$this->k,($this->h-($y-$up/1000*$this->FontSize))*$this->k,$w*$this->k,-$ut/1000*$this->FontSizePt);\r
-}\r
-\r
-function _parsejpg($file)\r
-{\r
-       //Extract info from a JPEG file\r
-       $a=GetImageSize($file);\r
-       if(!$a)\r
-               $this->Error('Missing or incorrect image file: '.$file);\r
-       if($a[2]!=2)\r
-               $this->Error('Not a JPEG file: '.$file);\r
-       if(!isset($a['channels']) || $a['channels']==3)\r
-               $colspace='DeviceRGB';\r
-       elseif($a['channels']==4)\r
-               $colspace='DeviceCMYK';\r
-       else\r
-               $colspace='DeviceGray';\r
-       $bpc=isset($a['bits']) ? $a['bits'] : 8;\r
-       //Read whole file\r
-       $f=fopen($file,'rb');\r
-       $data='';\r
-       while(!feof($f))\r
-               $data.=fread($f,4096);\r
-       fclose($f);\r
-       return array('w'=>$a[0],'h'=>$a[1],'cs'=>$colspace,'bpc'=>$bpc,'f'=>'DCTDecode','data'=>$data);\r
-}\r
-\r
-function _parsepng($file)\r
-{\r
-       //Extract info from a PNG file\r
-       $f=fopen($file,'rb');\r
-       if(!$f)\r
-               $this->Error('Can\'t open image file: '.$file);\r
-       //Check signature\r
-       if(fread($f,8)!=chr(137).'PNG'.chr(13).chr(10).chr(26).chr(10))\r
-               $this->Error('Not a PNG file: '.$file);\r
-       //Read header chunk\r
-       fread($f,4);\r
-       if(fread($f,4)!='IHDR')\r
-               $this->Error('Incorrect PNG file: '.$file);\r
-       $w=$this->_freadint($f);\r
-       $h=$this->_freadint($f);\r
-       $bpc=ord(fread($f,1));\r
-       if($bpc>8)\r
-               $this->Error('16-bit depth not supported: '.$file);\r
-       $ct=ord(fread($f,1));\r
-       if($ct==0)\r
-               $colspace='DeviceGray';\r
-       elseif($ct==2)\r
-               $colspace='DeviceRGB';\r
-       elseif($ct==3)\r
-               $colspace='Indexed';\r
-       else\r
-               $this->Error('Alpha channel not supported: '.$file);\r
-       if(ord(fread($f,1))!=0)\r
-               $this->Error('Unknown compression method: '.$file);\r
-       if(ord(fread($f,1))!=0)\r
-               $this->Error('Unknown filter method: '.$file);\r
-       if(ord(fread($f,1))!=0)\r
-               $this->Error('Interlacing not supported: '.$file);\r
-       fread($f,4);\r
-       $parms='/DecodeParms <</Predictor 15 /Colors '.($ct==2 ? 3 : 1).' /BitsPerComponent '.$bpc.' /Columns '.$w.'>>';\r
-       //Scan chunks looking for palette, transparency and image data\r
-       $pal='';\r
-       $trns='';\r
-       $data='';\r
-       do\r
-       {\r
-               $n=$this->_freadint($f);\r
-               $type=fread($f,4);\r
-               if($type=='PLTE')\r
-               {\r
-                       //Read palette\r
-                       $pal=fread($f,$n);\r
-                       fread($f,4);\r
-               }\r
-               elseif($type=='tRNS')\r
-               {\r
-                       //Read transparency info\r
-                       $t=fread($f,$n);\r
-                       if($ct==0)\r
-                               $trns=array(ord(substr($t,1,1)));\r
-                       elseif($ct==2)\r
-                               $trns=array(ord(substr($t,1,1)),ord(substr($t,3,1)),ord(substr($t,5,1)));\r
-                       else\r
-                       {\r
-                               $pos=strpos($t,chr(0));\r
-                               if($pos!==false)\r
-                                       $trns=array($pos);\r
-                       }\r
-                       fread($f,4);\r
-               }\r
-               elseif($type=='IDAT')\r
-               {\r
-                       //Read image data block\r
-                       $data.=fread($f,$n);\r
-                       fread($f,4);\r
-               }\r
-               elseif($type=='IEND')\r
-                       break;\r
-               else\r
-                       fread($f,$n+4);\r
-       }\r
-       while($n);\r
-       if($colspace=='Indexed' && empty($pal))\r
-               $this->Error('Missing palette in '.$file);\r
-       fclose($f);\r
-       return array('w'=>$w,'h'=>$h,'cs'=>$colspace,'bpc'=>$bpc,'f'=>'FlateDecode','parms'=>$parms,'pal'=>$pal,'trns'=>$trns,'data'=>$data);\r
-}\r
-\r
-function _freadint($f)\r
-{\r
-       //Read a 4-byte integer from file\r
-       $a=unpack('Ni',fread($f,4));\r
-       return $a['i'];\r
-}\r
-\r
-function _textstring($s)\r
-{\r
-       //Format a text string\r
-       return '('.$this->_escape($s).')';\r
-}\r
-\r
-function _escape($s)\r
-{\r
-       //Add \ before \, ( and )\r
-       return str_replace(')','\\)',str_replace('(','\\(',str_replace('\\','\\\\',$s)));\r
-}\r
-\r
-function _putstream($s)\r
-{\r
-       $this->_out('stream');\r
-       $this->_out($s);\r
-       $this->_out('endstream');\r
-}\r
-\r
-function _out($s)\r
-{\r
-       //Add a line to the document\r
-       if($this->state==2)\r
-               $this->pages[$this->page].=$s."\n";\r
-       else\r
-               $this->buffer.=$s."\n";\r
-}\r
-//End of class\r
-}\r
-\r
-//Handle special IE contype request\r
-if(isset($_SERVER['HTTP_USER_AGENT']) && $_SERVER['HTTP_USER_AGENT']=='contype')\r
-{\r
-       header('Content-Type: application/pdf');\r
-       exit;\r
-}\r
-\r
-}\r
-?>\r
+<?php
+/*******************************************************************************
+* Software: FPDF                                                               *
+* Version:  1.53                                                               *
+* Date:     2004-12-31                                                         *
+* Author:   Olivier PLATHEY                                                    *
+* License:  Freeware                                                           *
+*                                                                              *
+* You may use, modify and redistribute this software as you wish.              *
+*******************************************************************************/
+
+if(!class_exists('FPDF'))
+{
+define('FPDF_VERSION','1.53');
+
+class FPDF
+{
+//Private properties
+var $page;               //current page number
+var $n;                  //current object number
+var $offsets;            //array of object offsets
+var $buffer;             //buffer holding in-memory PDF
+var $pages;              //array containing pages
+var $state;              //current document state
+var $compress;           //compression flag
+var $DefOrientation;     //default orientation
+var $CurOrientation;     //current orientation
+var $OrientationChanges; //array indicating orientation changes
+var $k;                  //scale factor (number of points in user unit)
+var $fwPt,$fhPt;         //dimensions of page format in points
+var $fw,$fh;             //dimensions of page format in user unit
+var $wPt,$hPt;           //current dimensions of page in points
+var $w,$h;               //current dimensions of page in user unit
+var $lMargin;            //left margin
+var $tMargin;            //top margin
+var $rMargin;            //right margin
+var $bMargin;            //page break margin
+var $cMargin;            //cell margin
+var $x,$y;               //current position in user unit for cell positioning
+var $lasth;              //height of last cell printed
+var $LineWidth;          //line width in user unit
+var $CoreFonts;          //array of standard font names
+var $fonts;              //array of used fonts
+var $FontFiles;          //array of font files
+var $diffs;              //array of encoding differences
+var $images;             //array of used images
+var $PageLinks;          //array of links in pages
+var $links;              //array of internal links
+var $FontFamily;         //current font family
+var $FontStyle;          //current font style
+var $underline;          //underlining flag
+var $CurrentFont;        //current font info
+var $FontSizePt;         //current font size in points
+var $FontSize;           //current font size in user unit
+var $DrawColor;          //commands for drawing color
+var $FillColor;          //commands for filling color
+var $TextColor;          //commands for text color
+var $ColorFlag;          //indicates whether fill and text colors are different
+var $ws;                 //word spacing
+var $AutoPageBreak;      //automatic page breaking
+var $PageBreakTrigger;   //threshold used to trigger page breaks
+var $InFooter;           //flag set when processing footer
+var $ZoomMode;           //zoom display mode
+var $LayoutMode;         //layout display mode
+var $title;              //title
+var $subject;            //subject
+var $author;             //author
+var $keywords;           //keywords
+var $creator;            //creator
+var $AliasNbPages;       //alias for total number of pages
+var $PDFVersion;         //PDF version number
+
+/*******************************************************************************
+*                                                                              *
+*                               Public methods                                 *
+*                                                                              *
+*******************************************************************************/
+function FPDF($orientation='P',$unit='mm',$format='A4')
+{
+    //Some checks
+    $this->_dochecks();
+    //Initialization of properties
+    $this->page=0;
+    $this->n=2;
+    $this->buffer='';
+    $this->pages=array();
+    $this->OrientationChanges=array();
+    $this->state=0;
+    $this->fonts=array();
+    $this->FontFiles=array();
+    $this->diffs=array();
+    $this->images=array();
+    $this->links=array();
+    $this->InFooter=false;
+    $this->lasth=0;
+    $this->FontFamily='';
+    $this->FontStyle='';
+    $this->FontSizePt=12;
+    $this->underline=false;
+    $this->DrawColor='0 G';
+    $this->FillColor='0 g';
+    $this->TextColor='0 g';
+    $this->ColorFlag=false;
+    $this->ws=0;
+    //Standard fonts
+    $this->CoreFonts=array('courier'=>'Courier','courierB'=>'Courier-Bold','courierI'=>'Courier-Oblique','courierBI'=>'Courier-BoldOblique',
+        'helvetica'=>'Helvetica','helveticaB'=>'Helvetica-Bold','helveticaI'=>'Helvetica-Oblique','helveticaBI'=>'Helvetica-BoldOblique',
+        'times'=>'Times-Roman','timesB'=>'Times-Bold','timesI'=>'Times-Italic','timesBI'=>'Times-BoldItalic',
+        'symbol'=>'Symbol','zapfdingbats'=>'ZapfDingbats');
+    //Scale factor
+    if($unit=='pt')
+        $this->k=1;
+    elseif($unit=='mm')
+        $this->k=72/25.4;
+    elseif($unit=='cm')
+        $this->k=72/2.54;
+    elseif($unit=='in')
+        $this->k=72;
+    else
+        $this->Error('Incorrect unit: '.$unit);
+    //Page format
+    if(is_string($format))
+    {
+        $format=strtolower($format);
+        if($format=='a3')
+            $format=array(841.89,1190.55);
+        elseif($format=='a4')
+            $format=array(595.28,841.89);
+        elseif($format=='a5')
+            $format=array(420.94,595.28);
+        elseif($format=='letter')
+            $format=array(612,792);
+        elseif($format=='legal')
+            $format=array(612,1008);
+        else
+            $this->Error('Unknown page format: '.$format);
+        $this->fwPt=$format[0];
+        $this->fhPt=$format[1];
+    }
+    else
+    {
+        $this->fwPt=$format[0]*$this->k;
+        $this->fhPt=$format[1]*$this->k;
+    }
+    $this->fw=$this->fwPt/$this->k;
+    $this->fh=$this->fhPt/$this->k;
+    //Page orientation
+    $orientation=strtolower($orientation);
+    if($orientation=='p' || $orientation=='portrait')
+    {
+        $this->DefOrientation='P';
+        $this->wPt=$this->fwPt;
+        $this->hPt=$this->fhPt;
+    }
+    elseif($orientation=='l' || $orientation=='landscape')
+    {
+        $this->DefOrientation='L';
+        $this->wPt=$this->fhPt;
+        $this->hPt=$this->fwPt;
+    }
+    else
+        $this->Error('Incorrect orientation: '.$orientation);
+    $this->CurOrientation=$this->DefOrientation;
+    $this->w=$this->wPt/$this->k;
+    $this->h=$this->hPt/$this->k;
+    //Page margins (1 cm)
+    $margin=28.35/$this->k;
+    $this->SetMargins($margin,$margin);
+    //Interior cell margin (1 mm)
+    $this->cMargin=$margin/10;
+    //Line width (0.2 mm)
+    $this->LineWidth=.567/$this->k;
+    //Automatic page break
+    $this->SetAutoPageBreak(true,2*$margin);
+    //Full width display mode
+    $this->SetDisplayMode('fullwidth');
+    //Enable compression
+    $this->SetCompression(true);
+    //Set default PDF version number
+    $this->PDFVersion='1.3';
+}
+
+function SetMargins($left,$top,$right=-1)
+{
+    //Set left, top and right margins
+    $this->lMargin=$left;
+    $this->tMargin=$top;
+    if($right==-1)
+        $right=$left;
+    $this->rMargin=$right;
+}
+
+function SetLeftMargin($margin)
+{
+    //Set left margin
+    $this->lMargin=$margin;
+    if($this->page>0 && $this->x<$margin)
+        $this->x=$margin;
+}
+
+function SetTopMargin($margin)
+{
+    //Set top margin
+    $this->tMargin=$margin;
+}
+
+function SetRightMargin($margin)
+{
+    //Set right margin
+    $this->rMargin=$margin;
+}
+
+function SetAutoPageBreak($auto,$margin=0)
+{
+    //Set auto page break mode and triggering margin
+    $this->AutoPageBreak=$auto;
+    $this->bMargin=$margin;
+    $this->PageBreakTrigger=$this->h-$margin;
+}
+
+function SetDisplayMode($zoom,$layout='continuous')
+{
+    //Set display mode in viewer
+    if($zoom=='fullpage' || $zoom=='fullwidth' || $zoom=='real' || $zoom=='default' || !is_string($zoom))
+        $this->ZoomMode=$zoom;
+    else
+        $this->Error('Incorrect zoom display mode: '.$zoom);
+    if($layout=='single' || $layout=='continuous' || $layout=='two' || $layout=='default')
+        $this->LayoutMode=$layout;
+    else
+        $this->Error('Incorrect layout display mode: '.$layout);
+}
+
+function SetCompression($compress)
+{
+    //Set page compression
+    if(function_exists('gzcompress'))
+        $this->compress=$compress;
+    else
+        $this->compress=false;
+}
+
+function SetTitle($title)
+{
+    //Title of document
+    $this->title=$title;
+}
+
+function SetSubject($subject)
+{
+    //Subject of document
+    $this->subject=$subject;
+}
+
+function SetAuthor($author)
+{
+    //Author of document
+    $this->author=$author;
+}
+
+function SetKeywords($keywords)
+{
+    //Keywords of document
+    $this->keywords=$keywords;
+}
+
+function SetCreator($creator)
+{
+    //Creator of document
+    $this->creator=$creator;
+}
+
+function AliasNbPages($alias='{nb}')
+{
+    //Define an alias for total number of pages
+    $this->AliasNbPages=$alias;
+}
+
+function Error($msg)
+{
+    //Fatal error
+    die('<B>FPDF error: </B>'.$msg);
+}
+
+function Open()
+{
+    //Begin document
+    $this->state=1;
+}
+
+function Close()
+{
+    //Terminate document
+    if($this->state==3)
+        return;
+    if($this->page==0)
+        $this->AddPage();
+    //Page footer
+    $this->InFooter=true;
+    $this->Footer();
+    $this->InFooter=false;
+    //Close page
+    $this->_endpage();
+    //Close document
+    $this->_enddoc();
+}
+
+function AddPage($orientation='')
+{
+    //Start a new page
+    if($this->state==0)
+        $this->Open();
+    $family=$this->FontFamily;
+    $style=$this->FontStyle.($this->underline ? 'U' : '');
+    $size=$this->FontSizePt;
+    $lw=$this->LineWidth;
+    $dc=$this->DrawColor;
+    $fc=$this->FillColor;
+    $tc=$this->TextColor;
+    $cf=$this->ColorFlag;
+    if($this->page>0)
+    {
+        //Page footer
+        $this->InFooter=true;
+        $this->Footer();
+        $this->InFooter=false;
+        //Close page
+        $this->_endpage();
+    }
+    //Start new page
+    $this->_beginpage($orientation);
+    //Set line cap style to square
+    $this->_out('2 J');
+    //Set line width
+    $this->LineWidth=$lw;
+    $this->_out(sprintf('%.2f w',$lw*$this->k));
+    //Set font
+    if($family)
+        $this->SetFont($family,$style,$size);
+    //Set colors
+    $this->DrawColor=$dc;
+    if($dc!='0 G')
+        $this->_out($dc);
+    $this->FillColor=$fc;
+    if($fc!='0 g')
+        $this->_out($fc);
+    $this->TextColor=$tc;
+    $this->ColorFlag=$cf;
+    //Page header
+    $this->Header();
+    //Restore line width
+    if($this->LineWidth!=$lw)
+    {
+        $this->LineWidth=$lw;
+        $this->_out(sprintf('%.2f w',$lw*$this->k));
+    }
+    //Restore font
+    if($family)
+        $this->SetFont($family,$style,$size);
+    //Restore colors
+    if($this->DrawColor!=$dc)
+    {
+        $this->DrawColor=$dc;
+        $this->_out($dc);
+    }
+    if($this->FillColor!=$fc)
+    {
+        $this->FillColor=$fc;
+        $this->_out($fc);
+    }
+    $this->TextColor=$tc;
+    $this->ColorFlag=$cf;
+}
+
+function Header()
+{
+    //To be implemented in your own inherited class
+}
+
+function Footer()
+{
+    //To be implemented in your own inherited class
+}
+
+function PageNo()
+{
+    //Get current page number
+    return $this->page;
+}
+
+function SetDrawColor($r,$g=-1,$b=-1)
+{
+    //Set color for all stroking operations
+    if(($r==0 && $g==0 && $b==0) || $g==-1)
+        $this->DrawColor=sprintf('%.3f G',$r/255);
+    else
+        $this->DrawColor=sprintf('%.3f %.3f %.3f RG',$r/255,$g/255,$b/255);
+    if($this->page>0)
+        $this->_out($this->DrawColor);
+}
+
+function SetFillColor($r,$g=-1,$b=-1)
+{
+    //Set color for all filling operations
+    if(($r==0 && $g==0 && $b==0) || $g==-1)
+        $this->FillColor=sprintf('%.3f g',$r/255);
+    else
+        $this->FillColor=sprintf('%.3f %.3f %.3f rg',$r/255,$g/255,$b/255);
+    $this->ColorFlag=($this->FillColor!=$this->TextColor);
+    if($this->page>0)
+        $this->_out($this->FillColor);
+}
+
+function SetTextColor($r,$g=-1,$b=-1)
+{
+    //Set color for text
+    if(($r==0 && $g==0 && $b==0) || $g==-1)
+        $this->TextColor=sprintf('%.3f g',$r/255);
+    else
+        $this->TextColor=sprintf('%.3f %.3f %.3f rg',$r/255,$g/255,$b/255);
+    $this->ColorFlag=($this->FillColor!=$this->TextColor);
+}
+
+function GetStringWidth($s)
+{
+    //Get width of a string in the current font
+    $s=(string)$s;
+    $cw=&$this->CurrentFont['cw'];
+    $w=0;
+    $l=strlen($s);
+    for($i=0;$i<$l;$i++)
+        $w+=$cw[$s{$i}];
+    return $w*$this->FontSize/1000;
+}
+
+function SetLineWidth($width)
+{
+    //Set line width
+    $this->LineWidth=$width;
+    if($this->page>0)
+        $this->_out(sprintf('%.2f w',$width*$this->k));
+}
+
+function Line($x1,$y1,$x2,$y2)
+{
+    //Draw a line
+    $this->_out(sprintf('%.2f %.2f m %.2f %.2f l S',$x1*$this->k,($this->h-$y1)*$this->k,$x2*$this->k,($this->h-$y2)*$this->k));
+}
+
+function Rect($x,$y,$w,$h,$style='')
+{
+    //Draw a rectangle
+    if($style=='F')
+        $op='f';
+    elseif($style=='FD' || $style=='DF')
+        $op='B';
+    else
+        $op='S';
+    $this->_out(sprintf('%.2f %.2f %.2f %.2f re %s',$x*$this->k,($this->h-$y)*$this->k,$w*$this->k,-$h*$this->k,$op));
+}
+
+function AddFont($family,$style='',$file='')
+{
+    //Add a TrueType or Type1 font
+    $family=strtolower($family);
+    if($file=='')
+        $file=str_replace(' ','',$family).strtolower($style).'.php';
+    if($family=='arial')
+        $family='helvetica';
+    $style=strtoupper($style);
+    if($style=='IB')
+        $style='BI';
+    $fontkey=$family.$style;
+    if(isset($this->fonts[$fontkey]))
+        $this->Error('Font already added: '.$family.' '.$style);
+    include($this->_getfontpath().$file);
+    if(!isset($name))
+        $this->Error('Could not include font definition file');
+    $i=count($this->fonts)+1;
+    $this->fonts[$fontkey]=array('i'=>$i,'type'=>$type,'name'=>$name,'desc'=>$desc,'up'=>$up,'ut'=>$ut,'cw'=>$cw,'enc'=>$enc,'file'=>$file);
+    if($diff)
+    {
+        //Search existing encodings
+        $d=0;
+        $nb=count($this->diffs);
+        for($i=1;$i<=$nb;$i++)
+        {
+            if($this->diffs[$i]==$diff)
+            {
+                $d=$i;
+                break;
+            }
+        }
+        if($d==0)
+        {
+            $d=$nb+1;
+            $this->diffs[$d]=$diff;
+        }
+        $this->fonts[$fontkey]['diff']=$d;
+    }
+    if($file)
+    {
+        if($type=='TrueType')
+            $this->FontFiles[$file]=array('length1'=>$originalsize);
+        else
+            $this->FontFiles[$file]=array('length1'=>$size1,'length2'=>$size2);
+    }
+}
+
+function SetFont($family,$style='',$size=0)
+{
+    //Select a font; size given in points
+    global $fpdf_charwidths;
+
+    $family=strtolower($family);
+    if($family=='')
+        $family=$this->FontFamily;
+    if($family=='arial')
+        $family='helvetica';
+    elseif($family=='symbol' || $family=='zapfdingbats')
+        $style='';
+    $style=strtoupper($style);
+    if(strpos($style,'U')!==false)
+    {
+        $this->underline=true;
+        $style=str_replace('U','',$style);
+    }
+    else
+        $this->underline=false;
+    if($style=='IB')
+        $style='BI';
+    if($size==0)
+        $size=$this->FontSizePt;
+    //Test if font is already selected
+    if($this->FontFamily==$family && $this->FontStyle==$style && $this->FontSizePt==$size)
+        return;
+    //Test if used for the first time
+    $fontkey=$family.$style;
+    if(!isset($this->fonts[$fontkey]))
+    {
+        //Check if one of the standard fonts
+        if(isset($this->CoreFonts[$fontkey]))
+        {
+            if(!isset($fpdf_charwidths[$fontkey]))
+            {
+                //Load metric file
+                $file=$family;
+                if($family=='times' || $family=='helvetica')
+                    $file.=strtolower($style);
+                include($this->_getfontpath().$file.'.php');
+                if(!isset($fpdf_charwidths[$fontkey]))
+                    $this->Error('Could not include font metric file');
+            }
+            $i=count($this->fonts)+1;
+            $this->fonts[$fontkey]=array('i'=>$i,'type'=>'core','name'=>$this->CoreFonts[$fontkey],'up'=>-100,'ut'=>50,'cw'=>$fpdf_charwidths[$fontkey]);
+        }
+        else
+            $this->Error('Undefined font: '.$family.' '.$style);
+    }
+    //Select it
+    $this->FontFamily=$family;
+    $this->FontStyle=$style;
+    $this->FontSizePt=$size;
+    $this->FontSize=$size/$this->k;
+    $this->CurrentFont=&$this->fonts[$fontkey];
+    if($this->page>0)
+        $this->_out(sprintf('BT /F%d %.2f Tf ET',$this->CurrentFont['i'],$this->FontSizePt));
+}
+
+function SetFontSize($size)
+{
+    //Set font size in points
+    if($this->FontSizePt==$size)
+        return;
+    $this->FontSizePt=$size;
+    $this->FontSize=$size/$this->k;
+    if($this->page>0)
+        $this->_out(sprintf('BT /F%d %.2f Tf ET',$this->CurrentFont['i'],$this->FontSizePt));
+}
+
+function AddLink()
+{
+    //Create a new internal link
+    $n=count($this->links)+1;
+    $this->links[$n]=array(0,0);
+    return $n;
+}
+
+function SetLink($link,$y=0,$page=-1)
+{
+    //Set destination of internal link
+    if($y==-1)
+        $y=$this->y;
+    if($page==-1)
+        $page=$this->page;
+    $this->links[$link]=array($page,$y);
+}
+
+function Link($x,$y,$w,$h,$link)
+{
+    //Put a link on the page
+    $this->PageLinks[$this->page][]=array($x*$this->k,$this->hPt-$y*$this->k,$w*$this->k,$h*$this->k,$link);
+}
+
+function Text($x,$y,$txt)
+{
+    //Output a string
+    $s=sprintf('BT %.2f %.2f Td (%s) Tj ET',$x*$this->k,($this->h-$y)*$this->k,$this->_escape($txt));
+    if($this->underline && $txt!='')
+        $s.=' '.$this->_dounderline($x,$y,$txt);
+    if($this->ColorFlag)
+        $s='q '.$this->TextColor.' '.$s.' Q';
+    $this->_out($s);
+}
+
+function AcceptPageBreak()
+{
+    //Accept automatic page break or not
+    return $this->AutoPageBreak;
+}
+
+function Cell($w,$h=0,$txt='',$border=0,$ln=0,$align='',$fill=0,$link='')
+{
+    //Output a cell
+    $k=$this->k;
+    if($this->y+$h>$this->PageBreakTrigger && !$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->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==1 || $border==1)
+    {
+        if($fill==1)
+            $op=($border==1) ? 'B' : 'f';
+        else
+            $op='S';
+        $s=sprintf('%.2f %.2f %.2f %.2f re %s ',$this->x*$k,($this->h-$this->y)*$k,$w*$k,-$h*$k,$op);
+    }
+    if(is_string($border))
+    {
+        $x=$this->x;
+        $y=$this->y;
+        if(strpos($border,'L')!==false)
+            $s.=sprintf('%.2f %.2f m %.2f %.2f l S ',$x*$k,($this->h-$y)*$k,$x*$k,($this->h-($y+$h))*$k);
+        if(strpos($border,'T')!==false)
+            $s.=sprintf('%.2f %.2f m %.2f %.2f l S ',$x*$k,($this->h-$y)*$k,($x+$w)*$k,($this->h-$y)*$k);
+        if(strpos($border,'R')!==false)
+            $s.=sprintf('%.2f %.2f m %.2f %.2f l S ',($x+$w)*$k,($this->h-$y)*$k,($x+$w)*$k,($this->h-($y+$h))*$k);
+        if(strpos($border,'B')!==false)
+            $s.=sprintf('%.2f %.2f m %.2f %.2f l S ',$x*$k,($this->h-($y+$h))*$k,($x+$w)*$k,($this->h-($y+$h))*$k);
+    }
+    if($txt!=='')
+    {
+        if($align=='R')
+            $dx=$w-$this->cMargin-$this->GetStringWidth($txt);
+        elseif($align=='C')
+            $dx=($w-$this->GetStringWidth($txt))/2;
+        else
+            $dx=$this->cMargin;
+        if($this->ColorFlag)
+            $s.='q '.$this->TextColor.' ';
+        $txt2=str_replace(')','\\)',str_replace('(','\\(',str_replace('\\','\\\\',$txt)));
+        $s.=sprintf('BT %.2f %.2f Td (%s) Tj ET',($this->x+$dx)*$k,($this->h-($this->y+.5*$h+.3*$this->FontSize))*$k,$txt2);
+        if($this->underline)
+            $s.=' '.$this->_dounderline($this->x+$dx,$this->y+.5*$h+.3*$this->FontSize,$txt);
+        if($this->ColorFlag)
+            $s.=' Q';
+        if($link)
+            $this->Link($this->x+$dx,$this->y+.5*$h-.5*$this->FontSize,$this->GetStringWidth($txt),$this->FontSize,$link);
+    }
+    if($s)
+        $this->_out($s);
+    $this->lasth=$h;
+    if($ln>0)
+    {
+        //Go to next line
+        $this->y+=$h;
+        if($ln==1)
+            $this->x=$this->lMargin;
+    }
+    else
+        $this->x+=$w;
+}
+
+function MultiCell($w,$h,$txt,$border=0,$align='J',$fill=0)
+{
+    //Output text with automatic or explicit line breaks
+    $cw=&$this->CurrentFont['cw'];
+    if($w==0)
+        $w=$this->w-$this->rMargin-$this->x;
+    $wmax=($w-2*$this->cMargin)*1000/$this->FontSize;
+    $s=str_replace("\r",'',$txt);
+    $nb=strlen($s);
+    if($nb>0 && $s[$nb-1]=="\n")
+        $nb--;
+    $b=0;
+    if($border)
+    {
+        if($border==1)
+        {
+            $border='LTRB';
+            $b='LRT';
+            $b2='LR';
+        }
+        else
+        {
+            $b2='';
+            if(strpos($border,'L')!==false)
+                $b2.='L';
+            if(strpos($border,'R')!==false)
+                $b2.='R';
+            $b=(strpos($border,'T')!==false) ? $b2.'T' : $b2;
+        }
+    }
+    $sep=-1;
+    $i=0;
+    $j=0;
+    $l=0;
+    $ns=0;
+    $nl=1;
+    while($i<$nb)
+    {
+        //Get next character
+        $c=$s{$i};
+        if($c=="\n")
+        {
+            //Explicit line break
+            if($this->ws>0)
+            {
+                $this->ws=0;
+                $this->_out('0 Tw');
+            }
+            $this->Cell($w,$h,substr($s,$j,$i-$j),$b,2,$align,$fill);
+            $i++;
+            $sep=-1;
+            $j=$i;
+            $l=0;
+            $ns=0;
+            $nl++;
+            if($border && $nl==2)
+                $b=$b2;
+            continue;
+        }
+        if($c==' ')
+        {
+            $sep=$i;
+            $ls=$l;
+            $ns++;
+        }
+        $l+=$cw[$c];
+        if($l>$wmax)
+        {
+            //Automatic line break
+            if($sep==-1)
+            {
+                if($i==$j)
+                    $i++;
+                if($this->ws>0)
+                {
+                    $this->ws=0;
+                    $this->_out('0 Tw');
+                }
+                $this->Cell($w,$h,substr($s,$j,$i-$j),$b,2,$align,$fill);
+            }
+            else
+            {
+                if($align=='J')
+                {
+                    $this->ws=($ns>1) ? ($wmax-$ls)/1000*$this->FontSize/($ns-1) : 0;
+                    $this->_out(sprintf('%.3f Tw',$this->ws*$this->k));
+                }
+                $this->Cell($w,$h,substr($s,$j,$sep-$j),$b,2,$align,$fill);
+                $i=$sep+1;
+            }
+            $sep=-1;
+            $j=$i;
+            $l=0;
+            $ns=0;
+            $nl++;
+            if($border && $nl==2)
+                $b=$b2;
+        }
+        else
+            $i++;
+    }
+    //Last chunk
+    if($this->ws>0)
+    {
+        $this->ws=0;
+        $this->_out('0 Tw');
+    }
+    if($border && strpos($border,'B')!==false)
+        $b.='B';
+    $this->Cell($w,$h,substr($s,$j,$i-$j),$b,2,$align,$fill);
+    $this->x=$this->lMargin;
+}
+
+function Write($h,$txt,$link='')
+{
+    //Output text in flowing mode
+    $cw=&$this->CurrentFont['cw'];
+    $w=$this->w-$this->rMargin-$this->x;
+    $wmax=($w-2*$this->cMargin)*1000/$this->FontSize;
+    $s=str_replace("\r",'',$txt);
+    $nb=strlen($s);
+    $sep=-1;
+    $i=0;
+    $j=0;
+    $l=0;
+    $nl=1;
+    while($i<$nb)
+    {
+        //Get next character
+        $c=$s{$i};
+        if($c=="\n")
+        {
+            //Explicit line break
+            $this->Cell($w,$h,substr($s,$j,$i-$j),0,2,'',0,$link);
+            $i++;
+            $sep=-1;
+            $j=$i;
+            $l=0;
+            if($nl==1)
+            {
+                $this->x=$this->lMargin;
+                $w=$this->w-$this->rMargin-$this->x;
+                $wmax=($w-2*$this->cMargin)*1000/$this->FontSize;
+            }
+            $nl++;
+            continue;
+        }
+        if($c==' ')
+            $sep=$i;
+        $l+=$cw[$c];
+        if($l>$wmax)
+        {
+            //Automatic line break
+            if($sep==-1)
+            {
+                if($this->x>$this->lMargin)
+                {
+                    //Move to next line
+                    $this->x=$this->lMargin;
+                    $this->y+=$h;
+                    $w=$this->w-$this->rMargin-$this->x;
+                    $wmax=($w-2*$this->cMargin)*1000/$this->FontSize;
+                    $i++;
+                    $nl++;
+                    continue;
+                }
+                if($i==$j)
+                    $i++;
+                $this->Cell($w,$h,substr($s,$j,$i-$j),0,2,'',0,$link);
+            }
+            else
+            {
+                $this->Cell($w,$h,substr($s,$j,$sep-$j),0,2,'',0,$link);
+                $i=$sep+1;
+            }
+            $sep=-1;
+            $j=$i;
+            $l=0;
+            if($nl==1)
+            {
+                $this->x=$this->lMargin;
+                $w=$this->w-$this->rMargin-$this->x;
+                $wmax=($w-2*$this->cMargin)*1000/$this->FontSize;
+            }
+            $nl++;
+        }
+        else
+            $i++;
+    }
+    //Last chunk
+    if($i!=$j)
+        $this->Cell($l/1000*$this->FontSize,$h,substr($s,$j),0,0,'',0,$link);
+}
+
+function Image($file,$x,$y,$w=0,$h=0,$type='',$link='')
+{
+    //Put an image on the page
+    if(!isset($this->images[$file]))
+    {
+        //First use of image, get info
+        if($type=='')
+        {
+            $pos=strrpos($file,'.');
+            if(!$pos)
+                $this->Error('Image file has no extension and no type was specified: '.$file);
+            $type=substr($file,$pos+1);
+        }
+        $type=strtolower($type);
+        $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);
+        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);
+        $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;
+    }
+    if($w==0)
+        $w=$h*$info['w']/$info['h'];
+    if($h==0)
+        $h=$w*$info['h']/$info['w'];
+    $this->_out(sprintf('q %.2f 0 0 %.2f %.2f %.2f cm /I%d Do Q',$w*$this->k,$h*$this->k,$x*$this->k,($this->h-($y+$h))*$this->k,$info['i']));
+    if($link)
+        $this->Link($x,$y,$w,$h,$link);
+}
+
+function Ln($h='')
+{
+    //Line feed; default value is last cell height
+    $this->x=$this->lMargin;
+    if(is_string($h))
+        $this->y+=$this->lasth;
+    else
+        $this->y+=$h;
+}
+
+function GetX()
+{
+    //Get x position
+    return $this->x;
+}
+
+function SetX($x)
+{
+    //Set x position
+    if($x>=0)
+        $this->x=$x;
+    else
+        $this->x=$this->w+$x;
+}
+
+function GetY()
+{
+    //Get y position
+    return $this->y;
+}
+
+function SetY($y)
+{
+    //Set y position and reset x
+    $this->x=$this->lMargin;
+    if($y>=0)
+        $this->y=$y;
+    else
+        $this->y=$this->h+$y;
+}
+
+function SetXY($x,$y)
+{
+    //Set x and y positions
+    $this->SetY($y);
+    $this->SetX($x);
+}
+
+function Output($name='',$dest='')
+{
+    //Output PDF to some destination
+    //Finish document if necessary
+    if($this->state<3)
+        $this->Close();
+    //Normalize parameters
+    if(is_bool($dest))
+        $dest=$dest ? 'D' : 'F';
+    $dest=strtoupper($dest);
+    if($dest=='')
+    {
+        if($name=='')
+        {
+            $name='doc.pdf';
+            $dest='I';
+        }
+        else
+            $dest='F';
+    }
+    switch($dest)
+    {
+        case 'I':
+            //Send to standard output
+            if(ob_get_contents())
+                $this->Error('Some data has already been output, can\'t send PDF file');
+            if(php_sapi_name()!='cli')
+            {
+                //We send to a browser
+                header('Content-Type: application/pdf');
+                if(headers_sent())
+                    $this->Error('Some data has already been output to browser, can\'t send PDF file');
+                header('Content-Length: '.strlen($this->buffer));
+                header('Content-disposition: inline; filename="'.$name.'"');
+            }
+            echo $this->buffer;
+            break;
+        case 'D':
+            //Download file
+            if(ob_get_contents())
+                $this->Error('Some data has already been output, can\'t send PDF file');
+            if(isset($_SERVER['HTTP_USER_AGENT']) && strpos($_SERVER['HTTP_USER_AGENT'],'MSIE'))
+                header('Content-Type: application/force-download');
+            else
+                header('Content-Type: application/octet-stream');
+            if(headers_sent())
+                $this->Error('Some data has already been output to browser, can\'t send PDF file');
+            header('Content-Length: '.strlen($this->buffer));
+            header('Content-disposition: attachment; filename="'.$name.'"');
+            echo $this->buffer;
+            break;
+        case 'F':
+            //Save to local file
+            $f=fopen($name,'wb');
+            if(!$f)
+                $this->Error('Unable to create output file: '.$name);
+            fwrite($f,$this->buffer,strlen($this->buffer));
+            fclose($f);
+            break;
+        case 'S':
+            //Return as a string
+            return $this->buffer;
+        default:
+            $this->Error('Incorrect output destination: '.$dest);
+    }
+    return '';
+}
+
+/*******************************************************************************
+*                                                                              *
+*                              Protected methods                               *
+*                                                                              *
+*******************************************************************************/
+function _dochecks()
+{
+    //Check for locale-related bug
+    if(1.1==1)
+        $this->Error('Don\'t alter the locale before including class file');
+    //Check for decimal separator
+    if(sprintf('%.1f',1.0)!='1.0')
+        setlocale(LC_NUMERIC,'C');
+}
+
+function _getfontpath()
+{
+    if(!defined('FPDF_FONTPATH') && is_dir(dirname(__FILE__).'/font'))
+        define('FPDF_FONTPATH',dirname(__FILE__).'/font/');
+    return defined('FPDF_FONTPATH') ? FPDF_FONTPATH : '';
+}
+
+function _putpages()
+{
+    $nb=$this->page;
+    if(!empty($this->AliasNbPages))
+    {
+        //Replace number of pages
+        for($n=1;$n<=$nb;$n++)
+            $this->pages[$n]=str_replace($this->AliasNbPages,$nb,$this->pages[$n]);
+    }
+    if($this->DefOrientation=='P')
+    {
+        $wPt=$this->fwPt;
+        $hPt=$this->fhPt;
+    }
+    else
+    {
+        $wPt=$this->fhPt;
+        $hPt=$this->fwPt;
+    }
+    $filter=($this->compress) ? '/Filter /FlateDecode ' : '';
+    for($n=1;$n<=$nb;$n++)
+    {
+        //Page
+        $this->_newobj();
+        $this->_out('<</Type /Page');
+        $this->_out('/Parent 1 0 R');
+        if(isset($this->OrientationChanges[$n]))
+            $this->_out(sprintf('/MediaBox [0 0 %.2f %.2f]',$hPt,$wPt));
+        $this->_out('/Resources 2 0 R');
+        if(isset($this->PageLinks[$n]))
+        {
+            //Links
+            $annots='/Annots [';
+            foreach($this->PageLinks[$n] as $pl)
+            {
+                $rect=sprintf('%.2f %.2f %.2f %.2f',$pl[0],$pl[1],$pl[0]+$pl[2],$pl[1]-$pl[3]);
+                $annots.='<</Type /Annot /Subtype /Link /Rect ['.$rect.'] /Border [0 0 0] ';
+                if(is_string($pl[4]))
+                    $annots.='/A <</S /URI /URI '.$this->_textstring($pl[4]).'>>>>';
+                else
+                {
+                    $l=$this->links[$pl[4]];
+                    $h=isset($this->OrientationChanges[$l[0]]) ? $wPt : $hPt;
+                    $annots.=sprintf('/Dest [%d 0 R /XYZ 0 %.2f null]>>',1+2*$l[0],$h-$l[1]*$this->k);
+                }
+            }
+            $this->_out($annots.']');
+        }
+        $this->_out('/Contents '.($this->n+1).' 0 R>>');
+        $this->_out('endobj');
+        //Page content
+        $p=($this->compress) ? gzcompress($this->pages[$n]) : $this->pages[$n];
+        $this->_newobj();
+        $this->_out('<<'.$filter.'/Length '.strlen($p).'>>');
+        $this->_putstream($p);
+        $this->_out('endobj');
+    }
+    //Pages root
+    $this->offsets[1]=strlen($this->buffer);
+    $this->_out('1 0 obj');
+    $this->_out('<</Type /Pages');
+    $kids='/Kids [';
+    for($i=0;$i<$nb;$i++)
+        $kids.=(3+2*$i).' 0 R ';
+    $this->_out($kids.']');
+    $this->_out('/Count '.$nb);
+    $this->_out(sprintf('/MediaBox [0 0 %.2f %.2f]',$wPt,$hPt));
+    $this->_out('>>');
+    $this->_out('endobj');
+}
+
+function _putfonts()
+{
+    $nf=$this->n;
+    foreach($this->diffs as $diff)
+    {
+        //Encodings
+        $this->_newobj();
+        $this->_out('<</Type /Encoding /BaseEncoding /WinAnsiEncoding /Differences ['.$diff.']>>');
+        $this->_out('endobj');
+    }
+    $mqr=get_magic_quotes_runtime();
+    set_magic_quotes_runtime(0);
+    foreach($this->FontFiles as $file=>$info)
+    {
+        //Font file embedding
+        $this->_newobj();
+        $this->FontFiles[$file]['n']=$this->n;
+        $font='';
+        $f=fopen($this->_getfontpath().$file,'rb',1);
+        if(!$f)
+            $this->Error('Font file not found');
+        while(!feof($f))
+            $font.=fread($f,8192);
+        fclose($f);
+        $compressed=(substr($file,-2)=='.z');
+        if(!$compressed && isset($info['length2']))
+        {
+            $header=(ord($font{0})==128);
+            if($header)
+            {
+                //Strip first binary header
+                $font=substr($font,6);
+            }
+            if($header && ord($font{$info['length1']})==128)
+            {
+                //Strip second binary header
+                $font=substr($font,0,$info['length1']).substr($font,$info['length1']+6);
+            }
+        }
+        $this->_out('<</Length '.strlen($font));
+        if($compressed)
+            $this->_out('/Filter /FlateDecode');
+        $this->_out('/Length1 '.$info['length1']);
+        if(isset($info['length2']))
+            $this->_out('/Length2 '.$info['length2'].' /Length3 0');
+        $this->_out('>>');
+        $this->_putstream($font);
+        $this->_out('endobj');
+    }
+    set_magic_quotes_runtime($mqr);
+    foreach($this->fonts as $k=>$font)
+    {
+        //Font objects
+        $this->fonts[$k]['n']=$this->n+1;
+        $type=$font['type'];
+        $name=$font['name'];
+        if($type=='core')
+        {
+            //Standard font
+            $this->_newobj();
+            $this->_out('<</Type /Font');
+            $this->_out('/BaseFont /'.$name);
+            $this->_out('/Subtype /Type1');
+            if($name!='Symbol' && $name!='ZapfDingbats')
+                $this->_out('/Encoding /WinAnsiEncoding');
+            $this->_out('>>');
+            $this->_out('endobj');
+        }
+        elseif($type=='Type1' || $type=='TrueType')
+        {
+            //Additional Type1 or TrueType font
+            $this->_newobj();
+            $this->_out('<</Type /Font');
+            $this->_out('/BaseFont /'.$name);
+            $this->_out('/Subtype /'.$type);
+            $this->_out('/FirstChar 32 /LastChar 255');
+            $this->_out('/Widths '.($this->n+1).' 0 R');
+            $this->_out('/FontDescriptor '.($this->n+2).' 0 R');
+            if($font['enc'])
+            {
+                if(isset($font['diff']))
+                    $this->_out('/Encoding '.($nf+$font['diff']).' 0 R');
+                else
+                    $this->_out('/Encoding /WinAnsiEncoding');
+            }
+            $this->_out('>>');
+            $this->_out('endobj');
+            //Widths
+            $this->_newobj();
+            $cw=&$font['cw'];
+            $s='[';
+            for($i=32;$i<=255;$i++)
+                $s.=$cw[chr($i)].' ';
+            $this->_out($s.']');
+            $this->_out('endobj');
+            //Descriptor
+            $this->_newobj();
+            $s='<</Type /FontDescriptor /FontName /'.$name;
+            foreach($font['desc'] as $k=>$v)
+                $s.=' /'.$k.' '.$v;
+            $file=$font['file'];
+            if($file)
+                $s.=' /FontFile'.($type=='Type1' ? '' : '2').' '.$this->FontFiles[$file]['n'].' 0 R';
+            $this->_out($s.'>>');
+            $this->_out('endobj');
+        }
+        else
+        {
+            //Allow for additional types
+            $mtd='_put'.strtolower($type);
+            if(!method_exists($this,$mtd))
+                $this->Error('Unsupported font type: '.$type);
+            $this->$mtd($font);
+        }
+    }
+}
+
+function _putimages()
+{
+    $filter=($this->compress) ? '/Filter /FlateDecode ' : '';
+    reset($this->images);
+    while(list($file,$info)=each($this->images))
+    {
+        $this->_newobj();
+        $this->images[$file]['n']=$this->n;
+        $this->_out('<</Type /XObject');
+        $this->_out('/Subtype /Image');
+        $this->_out('/Width '.$info['w']);
+        $this->_out('/Height '.$info['h']);
+        if($info['cs']=='Indexed')
+            $this->_out('/ColorSpace [/Indexed /DeviceRGB '.(strlen($info['pal'])/3-1).' '.($this->n+1).' 0 R]');
+        else
+        {
+            $this->_out('/ColorSpace /'.$info['cs']);
+            if($info['cs']=='DeviceCMYK')
+                $this->_out('/Decode [1 0 1 0 1 0 1 0]');
+        }
+        $this->_out('/BitsPerComponent '.$info['bpc']);
+        if(isset($info['f']))
+            $this->_out('/Filter /'.$info['f']);
+        if(isset($info['parms']))
+            $this->_out($info['parms']);
+        if(isset($info['trns']) && is_array($info['trns']))
+        {
+            $trns='';
+            for($i=0;$i<count($info['trns']);$i++)
+                $trns.=$info['trns'][$i].' '.$info['trns'][$i].' ';
+            $this->_out('/Mask ['.$trns.']');
+        }
+        $this->_out('/Length '.strlen($info['data']).'>>');
+        $this->_putstream($info['data']);
+        unset($this->images[$file]['data']);
+        $this->_out('endobj');
+        //Palette
+        if($info['cs']=='Indexed')
+        {
+            $this->_newobj();
+            $pal=($this->compress) ? gzcompress($info['pal']) : $info['pal'];
+            $this->_out('<<'.$filter.'/Length '.strlen($pal).'>>');
+            $this->_putstream($pal);
+            $this->_out('endobj');
+        }
+    }
+}
+
+function _putxobjectdict()
+{
+    foreach($this->images as $image)
+        $this->_out('/I'.$image['i'].' '.$image['n'].' 0 R');
+}
+
+function _putresourcedict()
+{
+    $this->_out('/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]');
+    $this->_out('/Font <<');
+    foreach($this->fonts as $font)
+        $this->_out('/F'.$font['i'].' '.$font['n'].' 0 R');
+    $this->_out('>>');
+    $this->_out('/XObject <<');
+    $this->_putxobjectdict();
+    $this->_out('>>');
+}
+
+function _putresources()
+{
+    $this->_putfonts();
+    $this->_putimages();
+    //Resource dictionary
+    $this->offsets[2]=strlen($this->buffer);
+    $this->_out('2 0 obj');
+    $this->_out('<<');
+    $this->_putresourcedict();
+    $this->_out('>>');
+    $this->_out('endobj');
+}
+
+function _putinfo()
+{
+    $this->_out('/Producer '.$this->_textstring('FPDF '.FPDF_VERSION));
+    if(!empty($this->title))
+        $this->_out('/Title '.$this->_textstring($this->title));
+    if(!empty($this->subject))
+        $this->_out('/Subject '.$this->_textstring($this->subject));
+    if(!empty($this->author))
+        $this->_out('/Author '.$this->_textstring($this->author));
+    if(!empty($this->keywords))
+        $this->_out('/Keywords '.$this->_textstring($this->keywords));
+    if(!empty($this->creator))
+        $this->_out('/Creator '.$this->_textstring($this->creator));
+    $this->_out('/CreationDate '.$this->_textstring('D:'.date('YmdHis')));
+}
+
+function _putcatalog()
+{
+    $this->_out('/Type /Catalog');
+    $this->_out('/Pages 1 0 R');
+    if($this->ZoomMode=='fullpage')
+        $this->_out('/OpenAction [3 0 R /Fit]');
+    elseif($this->ZoomMode=='fullwidth')
+        $this->_out('/OpenAction [3 0 R /FitH null]');
+    elseif($this->ZoomMode=='real')
+        $this->_out('/OpenAction [3 0 R /XYZ null null 1]');
+    elseif(!is_string($this->ZoomMode))
+        $this->_out('/OpenAction [3 0 R /XYZ null null '.($this->ZoomMode/100).']');
+    if($this->LayoutMode=='single')
+        $this->_out('/PageLayout /SinglePage');
+    elseif($this->LayoutMode=='continuous')
+        $this->_out('/PageLayout /OneColumn');
+    elseif($this->LayoutMode=='two')
+        $this->_out('/PageLayout /TwoColumnLeft');
+}
+
+function _putheader()
+{
+    $this->_out('%PDF-'.$this->PDFVersion);
+}
+
+function _puttrailer()
+{
+    $this->_out('/Size '.($this->n+1));
+    $this->_out('/Root '.$this->n.' 0 R');
+    $this->_out('/Info '.($this->n-1).' 0 R');
+}
+
+function _enddoc()
+{
+    $this->_putheader();
+    $this->_putpages();
+    $this->_putresources();
+    //Info
+    $this->_newobj();
+    $this->_out('<<');
+    $this->_putinfo();
+    $this->_out('>>');
+    $this->_out('endobj');
+    //Catalog
+    $this->_newobj();
+    $this->_out('<<');
+    $this->_putcatalog();
+    $this->_out('>>');
+    $this->_out('endobj');
+    //Cross-ref
+    $o=strlen($this->buffer);
+    $this->_out('xref');
+    $this->_out('0 '.($this->n+1));
+    $this->_out('0000000000 65535 f ');
+    for($i=1;$i<=$this->n;$i++)
+        $this->_out(sprintf('%010d 00000 n ',$this->offsets[$i]));
+    //Trailer
+    $this->_out('trailer');
+    $this->_out('<<');
+    $this->_puttrailer();
+    $this->_out('>>');
+    $this->_out('startxref');
+    $this->_out($o);
+    $this->_out('%%EOF');
+    $this->state=3;
+}
+
+function _beginpage($orientation)
+{
+    $this->page++;
+    $this->pages[$this->page]='';
+    $this->state=2;
+    $this->x=$this->lMargin;
+    $this->y=$this->tMargin;
+    $this->FontFamily='';
+    //Page orientation
+    if(!$orientation)
+        $orientation=$this->DefOrientation;
+    else
+    {
+        $orientation=strtoupper($orientation{0});
+        if($orientation!=$this->DefOrientation)
+            $this->OrientationChanges[$this->page]=true;
+    }
+    if($orientation!=$this->CurOrientation)
+    {
+        //Change orientation
+        if($orientation=='P')
+        {
+            $this->wPt=$this->fwPt;
+            $this->hPt=$this->fhPt;
+            $this->w=$this->fw;
+            $this->h=$this->fh;
+        }
+        else
+        {
+            $this->wPt=$this->fhPt;
+            $this->hPt=$this->fwPt;
+            $this->w=$this->fh;
+            $this->h=$this->fw;
+        }
+        $this->PageBreakTrigger=$this->h-$this->bMargin;
+        $this->CurOrientation=$orientation;
+    }
+}
+
+function _endpage()
+{
+    //End of page contents
+    $this->state=1;
+}
+
+function _newobj()
+{
+    //Begin a new object
+    $this->n++;
+    $this->offsets[$this->n]=strlen($this->buffer);
+    $this->_out($this->n.' 0 obj');
+}
+
+function _dounderline($x,$y,$txt)
+{
+    //Underline text
+    $up=$this->CurrentFont['up'];
+    $ut=$this->CurrentFont['ut'];
+    $w=$this->GetStringWidth($txt)+$this->ws*substr_count($txt,' ');
+    return sprintf('%.2f %.2f %.2f %.2f re f',$x*$this->k,($this->h-($y-$up/1000*$this->FontSize))*$this->k,$w*$this->k,-$ut/1000*$this->FontSizePt);
+}
+
+function _parsejpg($file)
+{
+    //Extract info from a JPEG file
+    $a=GetImageSize($file);
+    if(!$a)
+        $this->Error('Missing or incorrect image file: '.$file);
+    if($a[2]!=2)
+        $this->Error('Not a JPEG file: '.$file);
+    if(!isset($a['channels']) || $a['channels']==3)
+        $colspace='DeviceRGB';
+    elseif($a['channels']==4)
+        $colspace='DeviceCMYK';
+    else
+        $colspace='DeviceGray';
+    $bpc=isset($a['bits']) ? $a['bits'] : 8;
+    //Read whole file
+    $f=fopen($file,'rb');
+    $data='';
+    while(!feof($f))
+        $data.=fread($f,4096);
+    fclose($f);
+    return array('w'=>$a[0],'h'=>$a[1],'cs'=>$colspace,'bpc'=>$bpc,'f'=>'DCTDecode','data'=>$data);
+}
+
+function _parsepng($file)
+{
+    //Extract info from a PNG file
+    $f=fopen($file,'rb');
+    if(!$f)
+        $this->Error('Can\'t open image file: '.$file);
+    //Check signature
+    if(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->_freadint($f);
+    $h=$this->_freadint($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
+        $this->Error('Alpha channel not supported: '.$file);
+    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->_freadint($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);
+}
+
+function _freadint($f)
+{
+    //Read a 4-byte integer from file
+    $a=unpack('Ni',fread($f,4));
+    return $a['i'];
+}
+
+function _textstring($s)
+{
+    //Format a text string
+    return '('.$this->_escape($s).')';
+}
+
+function _escape($s)
+{
+    //Add \ before \, ( and )
+    return str_replace(')','\\)',str_replace('(','\\(',str_replace('\\','\\\\',$s)));
+}
+
+function _putstream($s)
+{
+    $this->_out('stream');
+    $this->_out($s);
+    $this->_out('endstream');
+}
+
+function _out($s)
+{
+    //Add a line to the document
+    if($this->state==2)
+        $this->pages[$this->page].=$s."\n";
+    else
+        $this->buffer.=$s."\n";
+}
+//End of class
+}
+
+//Handle special IE contype request
+if(isset($_SERVER['HTTP_USER_AGENT']) && $_SERVER['HTTP_USER_AGENT']=='contype')
+{
+    header('Content-Type: application/pdf');
+    exit;
+}
+
+}
+?>
\ No newline at end of file