From 100fb961484c3d5f96ed47e11b6dd8c93b744911 Mon Sep 17 00:00:00 2001
From: Llewellyn van der Merwe
Fusce et felis vitae diam lobortis sollicitudin. Aenean tincidunt accumsan nisi, id vehicula quam laoreet elementum. Phasellus egestas interdum erat, et viverra ipsum ultricies ac. Praesent sagittis augue at augue volutpat eleifend. Cras nec orci neque. Mauris bibendum posuere blandit. Donec feugiat mollis dui sit amet pellentesque. Sed a enim justo. Donec tincidunt, nisl eget elementum aliquam, odio ipsum ultrices quam, eu porttitor ligula urna at lorem. Donec varius, eros et convallis laoreet, ligula tellus consequat felis, ut ornare metus tellus sodales velit. Duis sed diam ante. Ut rutrum malesuada massa, vitae consectetur ipsum rhoncus sed. Suspendisse potenti. Pellentesque a congue massa.
+ +Integer non sem eget neque mattis accumsan. Maecenas eu nisl mauris, sit amet interdum ipsum. In pharetra erat vel lectus venenatis elementum. Nulla non elit ligula, sit amet mollis urna. Morbi ut gravida est. Mauris tincidunt sem et turpis molestie malesuada. Curabitur vel nulla risus, sed mollis erat. Suspendisse vehicula accumsan purus nec varius. Donec fermentum lorem id felis sodales dictum. Quisque et dolor ipsum. Nam luctus consectetur dui vitae fermentum. Curabitur sodales consequat augue, id ultricies augue tempor ac. Aliquam ac magna id ipsum vehicula bibendum. Sed elementum congue tristique. Phasellus vel lorem eu lectus porta sodales. Etiam neque tortor, sagittis id pharetra quis, laoreet vel arcu.
+ +Cras quam mi, ornare laoreet laoreet vel, vehicula at lacus. Maecenas a lacus accumsan augue convallis sagittis sed quis odio. Morbi sit amet turpis diam, dictum convallis urna. Cras eget interdum augue. Cras eu nisi sit amet dolor faucibus porttitor. Suspendisse potenti. Nunc vitae dolor risus, at cursus libero. Suspendisse bibendum tellus non nibh hendrerit tristique. Mauris eget orci elit. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam porta libero non ante laoreet semper. Proin volutpat sodales mi, ac fermentum erat sagittis in. Vivamus at viverra felis. Ut pretium facilisis ante et pharetra.
+ +Nulla facilisi. Cras varius quam eget libero aliquam vitae tincidunt leo rutrum. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Pellentesque a nisl massa, quis pretium urna. Proin vel porttitor tortor. Cras rhoncus congue velit in bibendum. Donec pharetra semper augue id lacinia. Quisque magna quam, hendrerit eu aliquam et, pellentesque ut tellus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Maecenas nulla quam, rutrum eu feugiat at, elementum eu libero. Maecenas ullamcorper leo et turpis rutrum ac laoreet eros faucibus. Phasellus condimentum lorem quis neque imperdiet quis molestie enim iaculis. Phasellus risus est, vestibulum ut convallis ultrices, dignissim nec erat. Etiam congue lobortis laoreet. Nulla ut neque sed velit dapibus semper. Quisque nec dolor id nibh eleifend iaculis. Vivamus vitae fermentum odio. Etiam malesuada quam in nulla aliquam sed convallis dui feugiat.
+ +Lorem ipsum dolor sit amet, consectetur adipiscing elit. In sed imperdiet lectus. Phasellus quis velit velit, non condimentum quam. Sed neque urna, ultrices ac volutpat vel, laoreet vitae augue. Sed vel velit erat. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Cras eget velit nulla, eu sagittis elit. Nunc ac arcu est, in lobortis tellus. Praesent condimentum rhoncus sodales. In hac habitasse platea dictumst. Proin porta eros pharetra enim tincidunt dignissim nec vel dolor. Cras sapien elit, ornare ac dignissim eu, ultricies ac eros. Maecenas augue magna, ultrices a congue in, mollis eu nulla. Nunc venenatis massa at est eleifend faucibus. Vivamus sed risus lectus, nec interdum nunc.
+ + + +Fusce et felis vitae diam lobortis sollicitudin. Aenean tincidunt accumsan nisi, id vehicula quam laoreet elementum. Phasellus egestas interdum erat, et viverra ipsum ultricies ac. Praesent sagittis augue at augue volutpat eleifend. Cras nec orci neque. Mauris bibendum posuere blandit. Donec feugiat mollis dui sit amet pellentesque. Sed a enim justo. Donec tincidunt, nisl eget elementum aliquam, odio ipsum ultrices quam, eu porttitor ligula urna at lorem. Donec varius, eros et convallis laoreet, ligula tellus consequat felis, ut ornare metus tellus sodales velit. Duis sed diam ante. Ut rutrum malesuada massa, vitae consectetur ipsum rhoncus sed. Suspendisse potenti. Pellentesque a congue massa.
+ +Integer non sem eget neque mattis accumsan. Maecenas eu nisl mauris, sit amet interdum ipsum. In pharetra erat vel lectus venenatis elementum. Nulla non elit ligula, sit amet mollis urna. Morbi ut gravida est. Mauris tincidunt sem et turpis molestie malesuada. Curabitur vel nulla risus, sed mollis erat. Suspendisse vehicula accumsan purus nec varius. Donec fermentum lorem id felis sodales dictum. Quisque et dolor ipsum. Nam luctus consectetur dui vitae fermentum. Curabitur sodales consequat augue, id ultricies augue tempor ac. Aliquam ac magna id ipsum vehicula bibendum. Sed elementum congue tristique. Phasellus vel lorem eu lectus porta sodales. Etiam neque tortor, sagittis id pharetra quis, laoreet vel arcu.
+ +Cras quam mi, ornare laoreet laoreet vel, vehicula at lacus. Maecenas a lacus accumsan augue convallis sagittis sed quis odio. Morbi sit amet turpis diam, dictum convallis urna. Cras eget interdum augue. Cras eu nisi sit amet dolor faucibus porttitor. Suspendisse potenti. Nunc vitae dolor risus, at cursus libero. Suspendisse bibendum tellus non nibh hendrerit tristique. Mauris eget orci elit. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam porta libero non ante laoreet semper. Proin volutpat sodales mi, ac fermentum erat sagittis in. Vivamus at viverra felis. Ut pretium facilisis ante et pharetra.
+ +Nulla facilisi. Cras varius quam eget libero aliquam vitae tincidunt leo rutrum. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Pellentesque a nisl massa, quis pretium urna. Proin vel porttitor tortor. Cras rhoncus congue velit in bibendum. Donec pharetra semper augue id lacinia. Quisque magna quam, hendrerit eu aliquam et, pellentesque ut tellus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Maecenas nulla quam, rutrum eu feugiat at, elementum eu libero. Maecenas ullamcorper leo et turpis rutrum ac laoreet eros faucibus. Phasellus condimentum lorem quis neque imperdiet quis molestie enim iaculis. Phasellus risus est, vestibulum ut convallis ultrices, dignissim nec erat. Etiam congue lobortis laoreet. Nulla ut neque sed velit dapibus semper. Quisque nec dolor id nibh eleifend iaculis. Vivamus vitae fermentum odio. Etiam malesuada quam in nulla aliquam sed convallis dui feugiat.
diff --git a/examples/data/table_data_demo.txt b/examples/data/table_data_demo.txt new file mode 100644 index 0000000..5a48a42 --- /dev/null +++ b/examples/data/table_data_demo.txt @@ -0,0 +1,15 @@ +Austria;Vienna;83859;8075 +Belgium;Brussels;30518;10192 +Denmark;Copenhagen;43094;5295 +Finland;Helsinki;304529;5147 +France;Paris;543965;58728 +Germany;Berlin;357022;82057 +Greece;Athens;131625;10511 +Ireland;Dublin;70723;3694 +Italy;Roma;301316;57563 +Luxembourg;Luxembourg;2586;424 +Netherlands;Amsterdam;41526;15654 +Portugal;Lisbon;91906;9957 +Spain;Madrid;504790;39348 +Sweden;Stockholm;410934;8839 +United Kingdom;London;243820;58862 diff --git a/examples/data/utf8test.txt b/examples/data/utf8test.txt new file mode 100644 index 0000000..291d4e7 --- /dev/null +++ b/examples/data/utf8test.txt @@ -0,0 +1,128 @@ +Sentences that contain all letters commonly used in a language +-------------------------------------------------------------- + +This file is UTF-8 encoded. + +Czech (cz) +--------- + + Příšerně žluťoučký kůň úpěl ďábelské ódy. + Hleď, toť přízračný kůň v mátožné póze šíleně úpí. + Zvlášť zákeřný učeň s ďolíčky běží podél zóny úlů. + Loď čeří kýlem tůň obzvlášť v Grónské úžině. + Ó, náhlý déšť již zvířil prach a čilá laň teď běží s houfcem gazel k úkrytům. + +Danish (da) +--------- + + Quizdeltagerne spiste jordbær med fløde, mens cirkusklovnen + Wolther spillede på xylofon. + (= Quiz contestants were eating strawbery with cream while Wolther + the circus clown played on xylophone.) + +German (de) +----------- + + Falsches Üben von Xylophonmusik quält jeden größeren Zwerg + (= Wrongful practicing of xylophone music tortures every larger dwarf) + + Zwölf Boxkämpfer jagten Eva quer über den Sylter Deich + (= Twelve boxing fighters hunted Eva across the dike of Sylt) + + Heizölrückstoßabdämpfung + (= fuel oil recoil absorber) + (jqvwxy missing, but all non-ASCII letters in one word) + +English (en) +------------ + + The quick brown fox jumps over the lazy dog + +Spanish (es) +------------ + + El pingüino Wenceslao hizo kilómetros bajo exhaustiva lluvia y + frío, añoraba a su querido cachorro. + (Contains every letter and every accent, but not every combination + of vowel + acute.) + +French (fr) +----------- + + Portez ce vieux whisky au juge blond qui fume sur son île intérieure, à + côté de l'alcôve ovoïde, où les bûches se consument dans l'âtre, ce + qui lui permet de penser à la cænogenèse de l'être dont il est question + dans la cause ambiguë entendue à Moÿ, dans un capharnaüm qui, + pense-t-il, diminue çà et là la qualité de son œuvre. + + l'île exiguë + Où l'obèse jury mûr + Fête l'haï volapük, + Âne ex aéquo au whist, + Ôtez ce vœu déçu. + + Le cœur déçu mais l'âme plutôt naïve, Louÿs rêva de crapaüter en + canoë au delà des îles, près du mälström où brûlent les novæ. + +Irish Gaelic (ga) +----------------- + + D'fhuascail Íosa, Úrmhac na hÓighe Beannaithe, pór Éava agus Ádhaimh + +Hungarian (hu) +-------------- + + Árvíztűrő tükörfúrógép + (= flood-proof mirror-drilling machine, only all non-ASCII letters) + +Icelandic (is) +-------------- + + Kæmi ný öxi hér ykist þjófum nú bæði víl og ádrepa + + Sævör grét áðan því úlpan var ónýt + (some ASCII letters missing) + +Greek (el) +------------- + + Γαζέες καὶ μυρτιὲς δὲν θὰ βρῶ πιὰ στὸ χρυσαφὶ ξέφωτο + (= No more shall I see acacias or myrtles in the golden clearing) + + Ξεσκεπάζω τὴν ψυχοφθόρα βδελυγμία + (= I uncover the soul-destroying abhorrence) + +Hebrew (iw) +----------- + + ? דג סקרן שט בים מאוכזב ולפתע מצא לו חברה איך הקליטה + +Polish (pl) +----------- + + Pchnąć w tę łódź jeża lub osiem skrzyń fig + (= To push a hedgehog or eight bins of figs in this boat) + + Zażółć gęślą jaźń + +Russian (ru) +------------ + + В чащах юга жил бы цитрус? Да, но фальшивый экземпляр! + (= Would a citrus live in the bushes of south? Yes, but only a fake one!) + +Thai (th) +--------- + + [--------------------------|------------------------] + ๏ เป็นมนุษย์สุดประเสริฐเลิศคุณค่า กว่าบรรดาฝูงสัตว์เดรัจฉาน + จงฝ่าฟันพัฒนาวิชาการ อย่าล้างผลาญฤๅเข่นฆ่าบีฑาใคร + ไม่ถือโทษโกรธแช่งซัดฮึดฮัดด่า หัดอภัยเหมือนกีฬาอัชฌาสัย + ปฏิบัติประพฤติกฎกำหนดใจ พูดจาให้จ๊ะๆ จ๋าๆ น่าฟังเอย ฯ + + [The copyright for the Thai example is owned by The Computer + Association of Thailand under the Royal Patronage of His Majesty the + King.] + +Please let me know if you find others! Special thanks to the people +from all over the world who contributed these sentences. diff --git a/examples/example_001.php b/examples/example_001.php new file mode 100755 index 0000000..055c66a --- /dev/null +++ b/examples/example_001.php @@ -0,0 +1,106 @@ +SetCreator(PDF_CREATOR); +$pdf->SetAuthor('Nicola Asuni'); +$pdf->SetTitle('TCPDF Example 001'); +$pdf->SetSubject('TCPDF Tutorial'); +$pdf->SetKeywords('TCPDF, PDF, example, test, guide'); + +// set default header data +$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 001', PDF_HEADER_STRING, array(0,64,255), array(0,64,128)); +$pdf->setFooterData(array(0,64,0), array(0,64,128)); + +// set header and footer fonts +$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); +$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA)); + +// set default monospaced font +$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); + +// set margins +$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT); +$pdf->SetHeaderMargin(PDF_MARGIN_HEADER); +$pdf->SetFooterMargin(PDF_MARGIN_FOOTER); + +// set auto page breaks +$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); + +// set image scale factor +$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); + +// set some language-dependent strings (optional) +if (@file_exists(dirname(__FILE__).'/lang/eng.php')) { + require_once(dirname(__FILE__).'/lang/eng.php'); + $pdf->setLanguageArray($l); +} + +// --------------------------------------------------------- + +// set default font subsetting mode +$pdf->setFontSubsetting(true); + +// Set font +// dejavusans is a UTF-8 Unicode font, if you only need to +// print standard ASCII chars, you can use core fonts like +// helvetica or times to reduce file size. +$pdf->SetFont('dejavusans', '', 14, '', true); + +// Add a page +// This method has several options, check the source code documentation for more information. +$pdf->AddPage(); + +// set text shadow effect +$pdf->setTextShadow(array('enabled'=>true, 'depth_w'=>0.2, 'depth_h'=>0.2, 'color'=>array(196,196,196), 'opacity'=>1, 'blend_mode'=>'Normal')); + +// Set some content to print +$html = <<This text is printed using the writeHTMLCell() method but you can also use: Multicell(), writeHTML(), Write(), Cell() and Text().
+Please check the source code documentation and other examples for further information.
+TO IMPROVE AND EXPAND TCPDF I NEED YOUR SUPPORT, PLEASE MAKE A DONATION!
+EOD; + +// Print text using writeHTMLCell() +$pdf->writeHTMLCell(0, 0, '', '', $html, 0, 1, 0, true, '', true); + +// --------------------------------------------------------- + +// Close and output PDF document +// This method has several options, check the source code documentation for more information. +$pdf->Output('example_001.pdf', 'I'); + +//============================================================+ +// END OF FILE +//============================================================+ diff --git a/examples/example_002.php b/examples/example_002.php new file mode 100755 index 0000000..020dd29 --- /dev/null +++ b/examples/example_002.php @@ -0,0 +1,87 @@ +SetCreator(PDF_CREATOR); +$pdf->SetAuthor('Nicola Asuni'); +$pdf->SetTitle('TCPDF Example 002'); +$pdf->SetSubject('TCPDF Tutorial'); +$pdf->SetKeywords('TCPDF, PDF, example, test, guide'); + +// remove default header/footer +$pdf->setPrintHeader(false); +$pdf->setPrintFooter(false); + +// set default monospaced font +$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); + +// set margins +$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT); + +// set auto page breaks +$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); + +// set image scale factor +$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); + +// set some language-dependent strings (optional) +if (@file_exists(dirname(__FILE__).'/lang/eng.php')) { + require_once(dirname(__FILE__).'/lang/eng.php'); + $pdf->setLanguageArray($l); +} + +// --------------------------------------------------------- + +// set font +$pdf->SetFont('times', 'BI', 20); + +// add a page +$pdf->AddPage(); + +// set some text to print +$txt = <<This is just an example of html code to demonstrate some supported CSS inline styles. +bold text +line-trough +underline and line-trough +color +background color +bold +xx-small +x-small +small +medium +large +x-large +xx-large +
'; + +$pdf->writeHTML($html, true, false, true, false, ''); + +// reset pointer to the last page +$pdf->lastPage(); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +// Print a table + +// add a page +$pdf->AddPage(); + +// create some HTML content +$subtable = 'a | b |
c | d |
# | +RIGHT align | +LEFT align | +4A | +
---|---|---|---|
1 | +A1 example link column span. One two tree four five six seven eight nine ten. line after br small text normal subscript normal superscript normal bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla
|
+ 4B | +|
'.$subtable.' | +A2 € € € & è è A2 € € € & è è |
+ Red Yellow BG | +4C | +
1A | +2AA 2AB 2AC |
+ 4D | +|
1B | +4E | +||
1C | +2C | +3C | +4F | +
+int main() { + printf("HelloWorld"); + return 0; +} ++Monospace font, normal font, monospace font, normal font. +
0;pEen)|Xy$x#_&x?TEjBC@n`k
z5`VcU{bNMo-SMQ8?K?+wt|J7?n2T;KT)W*ay&0E}xV2#ieqxxl*eMdx{frY|k=Ps`
z=JvTD_*fx%2l-sA?sEjvCN=l=3FgvTs{@mJIwelN1V2)<4ZpJ6Hwxy7m-UYjx6SX(
z&oA9`rC*`1`U|@$g& You can set a full page background. Example of paragraph with class selector. Lorem ipsum dolor sit amet, consectetur adipiscing elit. In sed imperdiet lectus. Phasellus quis velit velit, non condimentum quam. Sed neque urna, ultrices ac volutpat vel, laoreet vitae augue. Sed vel velit erat. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Cras eget velit nulla, eu sagittis elit. Nunc ac arcu est, in lobortis tellus. Praesent condimentum rhoncus sodales. In hac habitasse platea dictumst. Proin porta eros pharetra enim tincidunt dignissim nec vel dolor. Cras sapien elit, ornare ac dignissim eu, ultricies ac eros. Maecenas augue magna, ultrices a congue in, mollis eu nulla. Nunc venenatis massa at est eleifend faucibus. Vivamus sed risus lectus, nec interdum nunc. Example of paragraph with ID selector. Fusce et felis vitae diam lobortis sollicitudin. Aenean tincidunt accumsan nisi, id vehicula quam laoreet elementum. Phasellus egestas interdum erat, et viverra ipsum ultricies ac. Praesent sagittis augue at augue volutpat eleifend. Cras nec orci neque. Mauris bibendum posuere blandit. Donec feugiat mollis dui sit amet pellentesque. Sed a enim justo. Donec tincidunt, nisl eget elementum aliquam, odio ipsum ultrices quam, eu porttitor ligula urna at lorem. Donec varius, eros et convallis laoreet, ligula tellus consequat felis, ut ornare metus tellus sodales velit. Duis sed diam ante. Ut rutrum malesuada massa, vitae consectetur ipsum rhoncus sed. Suspendisse potenti. Pellentesque a congue massa. TEST PAGE REGIONS: A no-write region is a portion of the page with a rectangular or trapezium shape that will not be covered when writing text or html code. A region is always aligned on the left or right side of the page ad is defined using a vertical segment. You can set multiple regions for the same page. You can combine several adjacent regions to approximate curved shapes. Lorem ipsum dolor sit amet, consectetur adipiscing elit. In sed imperdiet lectus. Phasellus quis velit velit, non condimentum quam. Sed neque urna, ultrices ac volutpat vel, laoreet vitae augue. Sed vel velit erat. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Cras eget velit nulla, eu sagittis elit. Nunc ac arcu est, in lobortis tellus. Praesent condimentum rhoncus sodales. In hac habitasse platea dictumst. Proin porta eros pharetra enim tincidunt dignissim nec vel dolor. Cras sapien elit, ornare ac dignissim eu, ultricies ac eros. Maecenas augue magna, ultrices a congue in, mollis eu nulla. Nunc venenatis massa at est eleifend faucibus. Vivamus sed risus lectus, nec interdum nunc.
+Fusce et felis vitae diam lobortis sollicitudin. Aenean tincidunt accumsan nisi, id vehicula quam laoreet elementum. Phasellus egestas interdum erat, et viverra ipsum ultricies ac. Praesent sagittis augue at augue volutpat eleifend. Cras nec orci neque. Mauris bibendum posuere blandit. Donec feugiat mollis dui sit amet pellentesque. Sed a enim justo. Donec tincidunt, nisl eget elementum aliquam, odio ipsum ultrices quam, eu porttitor ligula urna at lorem. Donec varius, eros et convallis laoreet, ligula tellus consequat felis, ut ornare metus tellus sodales velit. Duis sed diam ante. Ut rutrum malesuada massa, vitae consectetur ipsum rhoncus sed. Suspendisse potenti. Pellentesque a congue massa.
+Integer non sem eget neque mattis accumsan. Maecenas eu nisl mauris, sit amet interdum ipsum. In pharetra erat vel lectus venenatis elementum. Nulla non elit ligula, sit amet mollis urna. Morbi ut gravida est. Mauris tincidunt sem et turpis molestie malesuada. Curabitur vel nulla risus, sed mollis erat. Suspendisse vehicula accumsan purus nec varius. Donec fermentum lorem id felis sodales dictum. Quisque et dolor ipsum. Nam luctus consectetur dui vitae fermentum. Curabitur sodales consequat augue, id ultricies augue tempor ac. Aliquam ac magna id ipsum vehicula bibendum. Sed elementum congue tristique. Phasellus vel lorem eu lectus porta sodales. Etiam neque tortor, sagittis id pharetra quis, laoreet vel arcu.
+Cras quam mi, ornare laoreet laoreet vel, vehicula at lacus. Maecenas a lacus accumsan augue convallis sagittis sed quis odio. Morbi sit amet turpis diam, dictum convallis urna. Cras eget interdum augue. Cras eu nisi sit amet dolor faucibus porttitor. Suspendisse potenti. Nunc vitae dolor risus, at cursus libero. Suspendisse bibendum tellus non nibh hendrerit tristique. Mauris eget orci elit. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam porta libero non ante laoreet semper. Proin volutpat sodales mi, ac fermentum erat sagittis in. Vivamus at viverra felis. Ut pretium facilisis ante et pharetra.
+Nulla facilisi. Cras varius quam eget libero aliquam vitae tincidunt leo rutrum. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Pellentesque a nisl massa, quis pretium urna. Proin vel porttitor tortor. Cras rhoncus congue velit in bibendum. Donec pharetra semper augue id lacinia. Quisque magna quam, hendrerit eu aliquam et, pellentesque ut tellus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Maecenas nulla quam, rutrum eu feugiat at, elementum eu libero. Maecenas ullamcorper leo et turpis rutrum ac laoreet eros faucibus. Phasellus condimentum lorem quis neque imperdiet quis molestie enim iaculis. Phasellus risus est, vestibulum ut convallis ultrices, dignissim nec erat. Etiam congue lobortis laoreet. Nulla ut neque sed velit dapibus semper. Quisque nec dolor id nibh eleifend iaculis. Vivamus vitae fermentum odio. Etiam malesuada quam in nulla aliquam sed convallis dui feugiat. Please check the source code documentation and other examples for further information (http://www.tcpdf.org). TO IMPROVE AND EXPAND TCPDF I NEED YOUR SUPPORT, PLEASE MAKE A DONATION! UcNa?jwfqC#C~gRmIao^O@|>eR8X}(Q#S-dARZr`ai@Iy)gxufW`uz~
z{hyZG1$1XiEw4k?8qs=H76Ax6)I6cG{o+NffKd6{e?L5F7am<1a4J3hA7~2|baQfX
z(RO^+undF4;|zgDa{{qsJ3t-re~P|=^pouiEN;v0SlAy1i=tX06pbbxd^9F1jSr!3
zacua>eY%1J62fQF^7adQEZsWaeEToxfxff3o!4QNE{=+MGyBr?H^0N4*zAXwwpHJ9
zPe%`9RY0t@IWHRN{O_0IzrST=6l(ePQC|io*OB!`;AwXO9xemn_UK9yv;2X@?b-$!
zi(I9*ANvqwD$N59{&hXUr#vNu-rbjz;t~>6`11m~{?F`kASb>9b8~?#JkLD}@k;|I
zW|J-3|KxuM<01rDH0_!NY06A^oVH`}oTrjO4U$fH&CwmwNWWE22cV3_+GsF9r*Y>c
zuGI9H;DzJr?cF8)fm2(Rw*Pq!lWRc+Qs5~mZLl=6R!!r((8YfjRjLpFj03%_-TuCu
z?5ArIiChsJ>oa%gVFKVfTYa*g`*8T@>}c74Zw>jyDbVkBvCYr=8xJ_~R|Fz!+(4Q~
zMw+nB_s=;&I6f8_8+0_*dEYzeR~x?bcl8ewg9u9clW6=-#bP;l*2ghX6n#m#*ncs$
zM1Ox6{iRBOZ)KeiCp6VRdX}UMObgu<9C9qkb6mYTqkkC0f|Ea7I+Dh|*51n;5N2jJ
zl5Nu&4`^U&J^ee0g=Vy2l|rJUgPX|uZEbs5=T@6jtNyJ!fCEI`{&}&7YpMPA;NfnN
z>;i#yOzc-*nY?bOGGxVP#w#ASYyAXESX|h?k0mt5T&x^oL4f`#f{^^j4uV;@xcSmD
zQhs>#vZf6W>-6_?je?D$a%g8MAVllgyr6}=M>GLVLe6urmxS1M)~%Ps)lJsYQtfPK
z{Ln63e%d`+SVubsfQ-|c%>cU`n4!Ntpo}Hj1%gn~Lc7eisB9*fG!HY3PmC9W0^l2o
zE-!YTt_vE|*{kd+{kS}OCnF`8BZ>$3ol53IR~6G?@aO8P^WijNX)5^aaQv|h=}Ypm
z*;L6Wlh;dLH<8OeN9j(hO{d3b$)(kF0kqR=a)>Z0Q-81CHaJsGm>06cX5c09koFMh
zRPk5_z0n2R{FUgY_x@Yx>sGI?6s>M++)HgP=x=C=g^Cr @Mw^TyJ%-jJ=A^9wJI
zac{p7Twvcl%MOlwDvqG7utB!a*!^~l=H @H+@#!B=J+I
سلام بالاخره مشکل PDF فارسی به طور کامل حل شد. اینم یک نمونش.
مشکل حرف \"ژ\" در بعضی کلمات مانند کلمه ویژه نیز بر طرف شد.
نگارش حروف لام و الف پشت سر هم نیز تصحیح شد.
با تشکر از "Asuni Nicola" و محمد علی گل کار برای پشتیبانی زبان فارسی.';
+$pdf->WriteHTML($htmlpersian, true, 0, true, 0);
+
+// set LTR direction for english translation
+$pdf->setRTL(false);
+
+$pdf->SetFontSize(10);
+
+// print newline
+$pdf->Ln();
+
+// Persian and English content
+$htmlpersiantranslation = 'Hi, At last Problem of Persian PDF Solved completely. This is a example for it.
Problem of "jeh" letter in some word like "ویژه" (=special) fix too.
The joining of laa and alf letter fix now.
Special thanks to "Nicola Asuni" and "Mohamad Ali Golkar" for Persian support.';
+$pdf->WriteHTML($htmlpersiantranslation, true, 0, true, 0);
+
+// Restore RTL direction
+$pdf->setRTL(true);
+
+// set font
+$pdf->SetFont('aefurat', '', 18);
+
+// print newline
+$pdf->Ln();
+
+// Arabic and English content
+$pdf->Cell(0, 12, 'بِسْمِ اللهِ الرَّحْمنِ الرَّحِيمِ',0,1,'C');
+$htmlcontent = 'تمَّ بِحمد الله حلّ مشكلة الكتابة باللغة العربية في ملفات الـPDF مع دعم الكتابة من اليمين إلى اليسار والحركَات .
تم الحل بواسطة صالح المطرفي و Asuni Nicola . ';
+$pdf->WriteHTML($htmlcontent, true, 0, true, 0);
+
+// set LTR direction for english translation
+$pdf->setRTL(false);
+
+// print newline
+$pdf->Ln();
+
+$pdf->SetFont('aealarabiya', '', 18);
+
+// Arabic and English content
+$htmlcontent2 = 'This is Arabic "العربية" Example With TCPDF.';
+$pdf->WriteHTML($htmlcontent2, true, 0, true, 0);
+
+// ---------------------------------------------------------
+
+//Close and output PDF document
+$pdf->Output('example_018.pdf', 'I');
+
+//============================================================+
+// END OF FILE
+//============================================================+
diff --git a/examples/example_019.php b/examples/example_019.php
new file mode 100755
index 0000000..a1d5f08
--- /dev/null
+++ b/examples/example_019.php
@@ -0,0 +1,98 @@
+SetDocInfoUnicode(true);
+
+// set document information
+$pdf->SetCreator(PDF_CREATOR);
+$pdf->SetAuthor('Nicola Asuni [€]');
+$pdf->SetTitle('TCPDF Example 019');
+$pdf->SetSubject('TCPDF Tutorial');
+$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
+
+// set default header data
+$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 019', PDF_HEADER_STRING);
+
+// set header and footer fonts
+$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
+$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
+
+// set default monospaced font
+$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
+
+// set margins
+$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
+$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
+$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
+
+// set auto page breaks
+$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
+
+// set image scale factor
+$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
+
+// set some language dependent data:
+$lg = Array();
+$lg['a_meta_charset'] = 'ISO-8859-1';
+$lg['a_meta_dir'] = 'ltr';
+$lg['a_meta_language'] = 'en';
+$lg['w_page'] = 'page';
+
+// set some language-dependent strings (optional)
+$pdf->setLanguageArray($lg);
+
+// ---------------------------------------------------------
+
+// set font
+$pdf->SetFont('helvetica', '', 12);
+
+// add a page
+$pdf->AddPage();
+
+// set color for background
+$pdf->SetFillColor(200, 255, 200);
+
+$txt = 'An alternative configuration file is used on this example.
+Check the definition of the K_TCPDF_EXTERNAL_CONFIG constant on the source code.';
+
+// print some text
+$pdf->MultiCell(0, 0, $txt."\n", 1, 'J', 1, 1, '', '', true, 0, false, true, 0);
+
+// ---------------------------------------------------------
+
+//Close and output PDF document
+$pdf->Output('example_019.pdf', 'I');
+
+//============================================================+
+// END OF FILE
+//============================================================+
diff --git a/examples/example_020.php b/examples/example_020.php
new file mode 100755
index 0000000..6204f74
--- /dev/null
+++ b/examples/example_020.php
@@ -0,0 +1,146 @@
+getPage();
+ $y_start = $this->GetY();
+
+ // write the left cell
+ $this->MultiCell(40, 0, $left, 1, 'R', 1, 2, '', '', true, 0);
+
+ $page_end_1 = $this->getPage();
+ $y_end_1 = $this->GetY();
+
+ $this->setPage($page_start);
+
+ // write the right cell
+ $this->MultiCell(0, 0, $right, 1, 'J', 0, 1, $this->GetX() ,$y_start, true, 0);
+
+ $page_end_2 = $this->getPage();
+ $y_end_2 = $this->GetY();
+
+ // set the new row position by case
+ if (max($page_end_1,$page_end_2) == $page_start) {
+ $ynew = max($y_end_1, $y_end_2);
+ } elseif ($page_end_1 == $page_end_2) {
+ $ynew = max($y_end_1, $y_end_2);
+ } elseif ($page_end_1 > $page_end_2) {
+ $ynew = $y_end_1;
+ } else {
+ $ynew = $y_end_2;
+ }
+
+ $this->setPage(max($page_end_1,$page_end_2));
+ $this->SetXY($this->GetX(),$ynew);
+ }
+
+}
+
+// create new PDF document
+$pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
+
+// set document information
+$pdf->SetCreator(PDF_CREATOR);
+$pdf->SetAuthor('Nicola Asuni');
+$pdf->SetTitle('TCPDF Example 020');
+$pdf->SetSubject('TCPDF Tutorial');
+$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
+
+// set default header data
+$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 020', PDF_HEADER_STRING);
+
+// set header and footer fonts
+$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
+$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
+
+// set default monospaced font
+$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
+
+// set margins
+$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
+$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
+$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
+
+// set auto page breaks
+$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
+
+// set image scale factor
+$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
+
+// set some language-dependent strings (optional)
+if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
+ require_once(dirname(__FILE__).'/lang/eng.php');
+ $pdf->setLanguageArray($l);
+}
+
+// ---------------------------------------------------------
+
+// set font
+$pdf->SetFont('helvetica', '', 20);
+// add a page
+$pdf->AddPage();
+
+$pdf->Write(0, 'Example of text layout using Multicell()', '', 0, 'L', true, 0, false, false, 0);
+
+$pdf->Ln(5);
+
+$pdf->SetFont('times', '', 9);
+
+//$pdf->SetCellPadding(0);
+//$pdf->SetLineWidth(2);
+
+// set color for background
+$pdf->SetFillColor(255, 255, 200);
+
+$text = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. In sed imperdiet lectus. Phasellus quis velit velit, non condimentum quam. Sed neque urna, ultrices ac volutpat vel, laoreet vitae augue. Sed vel velit erat. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Cras eget velit nulla, eu sagittis elit. Nunc ac arcu est, in lobortis tellus. Praesent condimentum rhoncus sodales. In hac habitasse platea dictumst. Proin porta eros pharetra enim tincidunt dignissim nec vel dolor. Cras sapien elit, ornare ac dignissim eu, ultricies ac eros. Maecenas augue magna, ultrices a congue in, mollis eu nulla. Nunc venenatis massa at est eleifend faucibus. Vivamus sed risus lectus, nec interdum nunc.
+
+Fusce et felis vitae diam lobortis sollicitudin. Aenean tincidunt accumsan nisi, id vehicula quam laoreet elementum. Phasellus egestas interdum erat, et viverra ipsum ultricies ac. Praesent sagittis augue at augue volutpat eleifend. Cras nec orci neque. Mauris bibendum posuere blandit. Donec feugiat mollis dui sit amet pellentesque. Sed a enim justo. Donec tincidunt, nisl eget elementum aliquam, odio ipsum ultrices quam, eu porttitor ligula urna at lorem. Donec varius, eros et convallis laoreet, ligula tellus consequat felis, ut ornare metus tellus sodales velit. Duis sed diam ante. Ut rutrum malesuada massa, vitae consectetur ipsum rhoncus sed. Suspendisse potenti. Pellentesque a congue massa.';
+
+// print some rows just as example
+for ($i = 0; $i < 10; ++$i) {
+ $pdf->MultiRow('Row '.($i+1), $text."\n");
+}
+
+// reset pointer to the last page
+$pdf->lastPage();
+
+// ---------------------------------------------------------
+
+//Close and output PDF document
+$pdf->Output('example_020.pdf', 'I');
+
+//============================================================+
+// END OF FILE
+//============================================================+
diff --git a/examples/example_021.php b/examples/example_021.php
new file mode 100755
index 0000000..65e39fb
--- /dev/null
+++ b/examples/example_021.php
@@ -0,0 +1,91 @@
+SetCreator(PDF_CREATOR);
+$pdf->SetAuthor('Nicola Asuni');
+$pdf->SetTitle('TCPDF Example 021');
+$pdf->SetSubject('TCPDF Tutorial');
+$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
+
+// set default header data
+$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 021', PDF_HEADER_STRING);
+
+// set header and footer fonts
+$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
+$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
+
+// set default monospaced font
+$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
+
+// set margins
+$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
+$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
+$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
+
+// set auto page breaks
+$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
+
+// set image scale factor
+$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
+
+// set some language-dependent strings (optional)
+if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
+ require_once(dirname(__FILE__).'/lang/eng.php');
+ $pdf->setLanguageArray($l);
+}
+
+// ---------------------------------------------------------
+
+// set font
+$pdf->SetFont('helvetica', '', 9);
+
+// add a page
+$pdf->AddPage();
+
+// create some HTML content
+$html = 'Example of HTML text flow
Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?
A + B = C -> C - B = A -> C - A = B -> A + B = C -> C - B = A -> C - A = B -> A + B = C -> C - B = A -> C - A = B -> A + B = C -> C - B = A -> C - A = B -> A + B = C -> C - B = A -> C - A = B -> A + B = C -> C - B = A -> C - A = B -> A + B = C -> C - B = A -> C - A = B -> A + B = C -> C - B = A -> C - A = B
BoldItalicUnderlined BoldItalicUnderlined BoldItalicUnderlined BoldItalicUnderlined BoldItalicUnderlined BoldItalicUnderlined BoldItalicUnderlined BoldItalicUnderlined BoldItalicUnderlined BoldItalicUnderlined BoldItalicUnderlined BoldItalicUnderlined BoldItalicUnderlined BoldItalicUnderlined BoldItalicUnderlined';
+
+// output the HTML content
+$pdf->writeHTML($html, true, 0, true, 0);
+
+// reset pointer to the last page
+$pdf->lastPage();
+
+// ---------------------------------------------------------
+
+//Close and output PDF document
+$pdf->Output('example_021.pdf', 'I');
+
+//============================================================+
+// END OF FILE
+//============================================================+
diff --git a/examples/example_022.php b/examples/example_022.php
new file mode 100755
index 0000000..ca35d68
--- /dev/null
+++ b/examples/example_022.php
@@ -0,0 +1,146 @@
+SetCreator(PDF_CREATOR);
+$pdf->SetAuthor('Nicola Asuni');
+$pdf->SetTitle('TCPDF Example 022');
+$pdf->SetSubject('TCPDF Tutorial');
+$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
+
+// set default header data
+$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 022', PDF_HEADER_STRING);
+
+// set header and footer fonts
+$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
+$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
+
+// set default monospaced font
+$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
+
+// set margins
+$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
+$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
+$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
+
+// set auto page breaks
+$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
+
+// set image scale factor
+$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
+
+// set some language-dependent strings (optional)
+if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
+ require_once(dirname(__FILE__).'/lang/eng.php');
+ $pdf->setLanguageArray($l);
+}
+
+// ---------------------------------------------------------
+
+// check also the following methods:
+// SetDrawColorArray()
+// SetFillColorArray()
+// SetTextColorArray()
+
+// set font
+$pdf->SetFont('helvetica', 'B', 18);
+
+// add a page
+$pdf->AddPage();
+
+$pdf->Write(0, 'Example of CMYK, RGB and Grayscale colours', '', 0, 'L', true, 0, false, false, 0);
+
+// define style for border
+$border_style = array('all' => array('width' => 2, 'cap' => 'square', 'join' => 'miter', 'dash' => 0, 'phase' => 0));
+
+// --- CMYK ------------------------------------------------
+
+$pdf->SetDrawColor(50, 0, 0, 0);
+$pdf->SetFillColor(100, 0, 0, 0);
+$pdf->SetTextColor(100, 0, 0, 0);
+$pdf->Rect(30, 60, 30, 30, 'DF', $border_style);
+$pdf->Text(30, 92, 'Cyan');
+
+$pdf->SetDrawColor(0, 50, 0, 0);
+$pdf->SetFillColor(0, 100, 0, 0);
+$pdf->SetTextColor(0, 100, 0, 0);
+$pdf->Rect(70, 60, 30, 30, 'DF', $border_style);
+$pdf->Text(70, 92, 'Magenta');
+
+$pdf->SetDrawColor(0, 0, 50, 0);
+$pdf->SetFillColor(0, 0, 100, 0);
+$pdf->SetTextColor(0, 0, 100, 0);
+$pdf->Rect(110, 60, 30, 30, 'DF', $border_style);
+$pdf->Text(110, 92, 'Yellow');
+
+$pdf->SetDrawColor(0, 0, 0, 50);
+$pdf->SetFillColor(0, 0, 0, 100);
+$pdf->SetTextColor(0, 0, 0, 100);
+$pdf->Rect(150, 60, 30, 30, 'DF', $border_style);
+$pdf->Text(150, 92, 'Black');
+
+// --- RGB -------------------------------------------------
+
+$pdf->SetDrawColor(255, 127, 127);
+$pdf->SetFillColor(255, 0, 0);
+$pdf->SetTextColor(255, 0, 0);
+$pdf->Rect(30, 110, 30, 30, 'DF', $border_style);
+$pdf->Text(30, 142, 'Red');
+
+$pdf->SetDrawColor(127, 255, 127);
+$pdf->SetFillColor(0, 255, 0);
+$pdf->SetTextColor(0, 255, 0);
+$pdf->Rect(70, 110, 30, 30, 'DF', $border_style);
+$pdf->Text(70, 142, 'Green');
+
+$pdf->SetDrawColor(127, 127, 255);
+$pdf->SetFillColor(0, 0, 255);
+$pdf->SetTextColor(0, 0, 255);
+$pdf->Rect(110, 110, 30, 30, 'DF', $border_style);
+$pdf->Text(110, 142, 'Blue');
+
+// --- GRAY ------------------------------------------------
+
+$pdf->SetDrawColor(191);
+$pdf->SetFillColor(127);
+$pdf->SetTextColor(127);
+$pdf->Rect(30, 160, 30, 30, 'DF', $border_style);
+$pdf->Text(30, 192, 'Gray');
+
+// ---------------------------------------------------------
+
+//Close and output PDF document
+$pdf->Output('example_022.pdf', 'I');
+
+//============================================================+
+// END OF FILE
+//============================================================+
diff --git a/examples/example_023.php b/examples/example_023.php
new file mode 100755
index 0000000..dbb8b98
--- /dev/null
+++ b/examples/example_023.php
@@ -0,0 +1,113 @@
+SetCreator(PDF_CREATOR);
+$pdf->SetAuthor('Nicola Asuni');
+$pdf->SetTitle('TCPDF Example 023');
+$pdf->SetSubject('TCPDF Tutorial');
+$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
+
+// set default header data
+$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 023', PDF_HEADER_STRING);
+
+// set header and footer fonts
+$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
+$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
+
+// set default monospaced font
+$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
+
+// set margins
+$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
+$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
+$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
+
+// set auto page breaks
+$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
+
+// set image scale factor
+$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
+
+// set some language-dependent strings (optional)
+if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
+ require_once(dirname(__FILE__).'/lang/eng.php');
+ $pdf->setLanguageArray($l);
+}
+
+// ---------------------------------------------------------
+
+// set font
+$pdf->SetFont('times', 'BI', 14);
+
+// Start First Page Group
+$pdf->startPageGroup();
+
+// add a page
+$pdf->AddPage();
+
+// set some text to print
+$txt = <<
';
+$html .= 'HTML Stroke text
';
+$html .= 'HTML Fill, then stroke text
';
+$html .= 'HTML Neither fill nor stroke text (invisible)
';
+
+// output the HTML content
+$pdf->writeHTML($html, true, 0, true, 0);
+
+// ---------------------------------------------------------
+
+//Close and output PDF document
+$pdf->Output('example_026.pdf', 'I');
+
+//============================================================+
+// END OF FILE
+//============================================================+
diff --git a/examples/example_027.php b/examples/example_027.php
new file mode 100755
index 0000000..a237074
--- /dev/null
+++ b/examples/example_027.php
@@ -0,0 +1,418 @@
+SetCreator(PDF_CREATOR);
+$pdf->SetAuthor('Nicola Asuni');
+$pdf->SetTitle('TCPDF Example 027');
+$pdf->SetSubject('TCPDF Tutorial');
+$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
+
+// set default header data
+$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 027', PDF_HEADER_STRING);
+
+// set header and footer fonts
+$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
+$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
+
+// set default monospaced font
+$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
+
+// set margins
+$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
+$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
+$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
+
+// set auto page breaks
+$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
+
+// set image scale factor
+$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
+
+// set some language-dependent strings (optional)
+if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
+ require_once(dirname(__FILE__).'/lang/eng.php');
+ $pdf->setLanguageArray($l);
+}
+
+// ---------------------------------------------------------
+
+// set a barcode on the page footer
+$pdf->setBarcode(date('Y-m-d H:i:s'));
+
+// set font
+$pdf->SetFont('helvetica', '', 11);
+
+// add a page
+$pdf->AddPage();
+
+// print a message
+$txt = "You can also export 1D barcodes in other formats (PNG, SVG, HTML). Check the examples inside the barcodes directory.\n";
+$pdf->MultiCell(70, 50, $txt, 0, 'J', false, 1, 125, 30, true, 0, false, true, 0, 'T', false);
+$pdf->SetY(30);
+
+// -----------------------------------------------------------------------------
+
+$pdf->SetFont('helvetica', '', 10);
+
+// define barcode style
+$style = array(
+ 'position' => '',
+ 'align' => 'C',
+ 'stretch' => false,
+ 'fitwidth' => true,
+ 'cellfitalign' => '',
+ 'border' => true,
+ 'hpadding' => 'auto',
+ 'vpadding' => 'auto',
+ 'fgcolor' => array(0,0,0),
+ 'bgcolor' => false, //array(255,255,255),
+ 'text' => true,
+ 'font' => 'helvetica',
+ 'fontsize' => 8,
+ 'stretchtext' => 4
+);
+
+// PRINT VARIOUS 1D BARCODES
+
+// CODE 39 - ANSI MH10.8M-1983 - USD-3 - 3 of 9.
+$pdf->Cell(0, 0, 'CODE 39 - ANSI MH10.8M-1983 - USD-3 - 3 of 9', 0, 1);
+$pdf->write1DBarcode('CODE 39', 'C39', '', '', '', 18, 0.4, $style, 'N');
+
+$pdf->Ln();
+
+// CODE 39 + CHECKSUM
+$pdf->Cell(0, 0, 'CODE 39 + CHECKSUM', 0, 1);
+$pdf->write1DBarcode('CODE 39 +', 'C39+', '', '', '', 18, 0.4, $style, 'N');
+
+$pdf->Ln();
+
+// CODE 39 EXTENDED
+$pdf->Cell(0, 0, 'CODE 39 EXTENDED', 0, 1);
+$pdf->write1DBarcode('CODE 39 E', 'C39E', '', '', '', 18, 0.4, $style, 'N');
+
+$pdf->Ln();
+
+// CODE 39 EXTENDED + CHECKSUM
+$pdf->Cell(0, 0, 'CODE 39 EXTENDED + CHECKSUM', 0, 1);
+$pdf->write1DBarcode('CODE 39 E+', 'C39E+', '', '', '', 18, 0.4, $style, 'N');
+
+$pdf->Ln();
+
+// CODE 93 - USS-93
+$pdf->Cell(0, 0, 'CODE 93 - USS-93', 0, 1);
+$pdf->write1DBarcode('TEST93', 'C93', '', '', '', 18, 0.4, $style, 'N');
+
+$pdf->Ln();
+
+// Standard 2 of 5
+$pdf->Cell(0, 0, 'Standard 2 of 5', 0, 1);
+$pdf->write1DBarcode('1234567', 'S25', '', '', '', 18, 0.4, $style, 'N');
+
+$pdf->Ln();
+
+// Standard 2 of 5 + CHECKSUM
+$pdf->Cell(0, 0, 'Standard 2 of 5 + CHECKSUM', 0, 1);
+$pdf->write1DBarcode('1234567', 'S25+', '', '', '', 18, 0.4, $style, 'N');
+
+$pdf->Ln();
+
+// Interleaved 2 of 5
+$pdf->Cell(0, 0, 'Interleaved 2 of 5', 0, 1);
+$pdf->write1DBarcode('1234567', 'I25', '', '', '', 18, 0.4, $style, 'N');
+
+$pdf->Ln();
+
+// Interleaved 2 of 5 + CHECKSUM
+$pdf->Cell(0, 0, 'Interleaved 2 of 5 + CHECKSUM', 0, 1);
+$pdf->write1DBarcode('1234567', 'I25+', '', '', '', 18, 0.4, $style, 'N');
+
+
+// add a page ----------
+$pdf->AddPage();
+
+// CODE 128 AUTO
+$pdf->Cell(0, 0, 'CODE 128 AUTO', 0, 1);
+$pdf->write1DBarcode('CODE 128 AUTO', 'C128', '', '', '', 18, 0.4, $style, 'N');
+
+$pdf->Ln();
+
+// CODE 128 A
+$pdf->Cell(0, 0, 'CODE 128 A', 0, 1);
+$pdf->write1DBarcode('CODE 128 A', 'C128A', '', '', '', 18, 0.4, $style, 'N');
+
+$pdf->Ln();
+
+// CODE 128 B
+$pdf->Cell(0, 0, 'CODE 128 B', 0, 1);
+$pdf->write1DBarcode('CODE 128 B', 'C128B', '', '', '', 18, 0.4, $style, 'N');
+
+$pdf->Ln();
+
+// CODE 128 C
+$pdf->Cell(0, 0, 'CODE 128 C', 0, 1);
+$pdf->write1DBarcode('0123456789', 'C128C', '', '', '', 18, 0.4, $style, 'N');
+
+$pdf->Ln();
+
+// EAN 8
+$pdf->Cell(0, 0, 'EAN 8', 0, 1);
+$pdf->write1DBarcode('1234567', 'EAN8', '', '', '', 18, 0.4, $style, 'N');
+
+$pdf->Ln();
+
+// EAN 13
+$pdf->Cell(0, 0, 'EAN 13', 0, 1);
+$pdf->write1DBarcode('1234567890128', 'EAN13', '', '', '', 18, 0.4, $style, 'N');
+
+$pdf->Ln();
+
+// UPC-A
+$pdf->Cell(0, 0, 'UPC-A', 0, 1);
+$pdf->write1DBarcode('12345678901', 'UPCA', '', '', '', 18, 0.4, $style, 'N');
+
+$pdf->Ln();
+
+// UPC-E
+$pdf->Cell(0, 0, 'UPC-E', 0, 1);
+$pdf->write1DBarcode('04210000526', 'UPCE', '', '', '', 18, 0.4, $style, 'N');
+
+// add a page ----------
+$pdf->AddPage();
+
+// 5-Digits UPC-Based Extension
+$pdf->Cell(0, 0, '5-Digits UPC-Based Extension', 0, 1);
+$pdf->write1DBarcode('51234', 'EAN5', '', '', '', 18, 0.4, $style, 'N');
+
+$pdf->Ln();
+
+// 2-Digits UPC-Based Extension
+$pdf->Cell(0, 0, '2-Digits UPC-Based Extension', 0, 1);
+$pdf->write1DBarcode('34', 'EAN2', '', '', '', 18, 0.4, $style, 'N');
+
+$pdf->Ln();
+
+// MSI
+$pdf->Cell(0, 0, 'MSI', 0, 1);
+$pdf->write1DBarcode('80523', 'MSI', '', '', '', 18, 0.4, $style, 'N');
+
+$pdf->Ln();
+
+// MSI + CHECKSUM (module 11)
+$pdf->Cell(0, 0, 'MSI + CHECKSUM (module 11)', 0, 1);
+$pdf->write1DBarcode('80523', 'MSI+', '', '', '', 18, 0.4, $style, 'N');
+
+$pdf->Ln();
+
+// CODABAR
+$pdf->Cell(0, 0, 'CODABAR', 0, 1);
+$pdf->write1DBarcode('123456789', 'CODABAR', '', '', '', 18, 0.4, $style, 'N');
+
+$pdf->Ln();
+
+// CODE 11
+$pdf->Cell(0, 0, 'CODE 11', 0, 1);
+$pdf->write1DBarcode('123-456-789', 'CODE11', '', '', '', 18, 0.4, $style, 'N');
+
+$pdf->Ln();
+
+// PHARMACODE
+$pdf->Cell(0, 0, 'PHARMACODE', 0, 1);
+$pdf->write1DBarcode('789', 'PHARMA', '', '', '', 18, 0.4, $style, 'N');
+
+$pdf->Ln();
+
+// PHARMACODE TWO-TRACKS
+$pdf->Cell(0, 0, 'PHARMACODE TWO-TRACKS', 0, 1);
+$pdf->write1DBarcode('105', 'PHARMA2T', '', '', '', 18, 2, $style, 'N');
+
+// add a page ----------
+$pdf->AddPage();
+
+// IMB - Intelligent Mail Barcode - Onecode - USPS-B-3200
+$pdf->Cell(0, 0, 'IMB - Intelligent Mail Barcode - Onecode - USPS-B-3200', 0, 1);
+$pdf->write1DBarcode('01234567094987654321-01234567891', 'IMB', '', '', '', 15, 0.6, $style, 'N');
+
+$pdf->Ln();
+
+// POSTNET
+$pdf->Cell(0, 0, 'POSTNET', 0, 1);
+$pdf->write1DBarcode('98000', 'POSTNET', '', '', '', 15, 0.6, $style, 'N');
+
+$pdf->Ln();
+
+// PLANET
+$pdf->Cell(0, 0, 'PLANET', 0, 1);
+$pdf->write1DBarcode('98000', 'PLANET', '', '', '', 15, 0.6, $style, 'N');
+
+$pdf->Ln();
+
+// RMS4CC (Royal Mail 4-state Customer Code) - CBC (Customer Bar Code)
+$pdf->Cell(0, 0, 'RMS4CC (Royal Mail 4-state Customer Code) - CBC (Customer Bar Code)', 0, 1);
+$pdf->write1DBarcode('SN34RD1A', 'RMS4CC', '', '', '', 15, 0.6, $style, 'N');
+
+$pdf->Ln();
+
+// KIX (Klant index - Customer index)
+$pdf->Cell(0, 0, 'KIX (Klant index - Customer index)', 0, 1);
+$pdf->write1DBarcode('SN34RDX1A', 'KIX', '', '', '', 15, 0.6, $style, 'N');
+
+// - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+// TEST BARCODE ALIGNMENTS
+
+// add a page
+$pdf->AddPage();
+
+// set a background color
+$style['bgcolor'] = array(255,255,240);
+$style['fgcolor'] = array(127,0,0);
+
+// Left position
+$style['position'] = 'L';
+$pdf->write1DBarcode('LEFT', 'C128A', '', '', '', 15, 0.4, $style, 'N');
+
+$pdf->Ln(2);
+
+// Center position
+$style['position'] = 'C';
+$pdf->write1DBarcode('CENTER', 'C128A', '', '', '', 15, 0.4, $style, 'N');
+
+$pdf->Ln(2);
+
+// Right position
+$style['position'] = 'R';
+$pdf->write1DBarcode('RIGHT', 'C128A', '', '', '', 15, 0.4, $style, 'N');
+
+$pdf->Ln(2);
+// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
+
+$style['fgcolor'] = array(0,127,0);
+$style['position'] = '';
+$style['stretch'] = false; // disable stretch
+$style['fitwidth'] = false; // disable fitwidth
+
+// Left alignment
+$style['align'] = 'L';
+$pdf->write1DBarcode('LEFT', 'C128A', '', '', '', 15, 0.4, $style, 'N');
+
+$pdf->Ln(2);
+
+// Center alignment
+$style['align'] = 'C';
+$pdf->write1DBarcode('CENTER', 'C128A', '', '', '', 15, 0.4, $style, 'N');
+
+$pdf->Ln(2);
+
+// Right alignment
+$style['align'] = 'R';
+$pdf->write1DBarcode('RIGHT', 'C128A', '', '', '', 15, 0.4, $style, 'N');
+
+$pdf->Ln(2);
+// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
+
+$style['fgcolor'] = array(0,64,127);
+$style['position'] = '';
+$style['stretch'] = false; // disable stretch
+$style['fitwidth'] = true; // disable fitwidth
+
+// Left alignment
+$style['cellfitalign'] = 'L';
+$pdf->write1DBarcode('LEFT', 'C128A', 105, '', 90, 15, 0.4, $style, 'N');
+
+$pdf->Ln(2);
+
+// Center alignment
+$style['cellfitalign'] = 'C';
+$pdf->write1DBarcode('CENTER', 'C128A', 105, '', 90, 15, 0.4, $style, 'N');
+
+$pdf->Ln(2);
+
+// Right alignment
+$style['cellfitalign'] = 'R';
+$pdf->write1DBarcode('RIGHT', 'C128A', 105, '', 90, 15, 0.4, $style, 'N');
+
+$pdf->Ln(2);
+// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
+
+$style['fgcolor'] = array(127,0,127);
+
+// Left alignment
+$style['position'] = 'L';
+$pdf->write1DBarcode('LEFT', 'C128A', '', '', '', 15, 0.4, $style, 'N');
+
+$pdf->Ln(2);
+
+// Center alignment
+$style['position'] = 'C';
+$pdf->write1DBarcode('CENTER', 'C128A', '', '', '', 15, 0.4, $style, 'N');
+
+$pdf->Ln(2);
+
+// Right alignment
+$style['position'] = 'R';
+$pdf->write1DBarcode('RIGHT', 'C128A', '', '', '', 15, 0.4, $style, 'N');
+
+// - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+// TEST BARCODE STYLE
+
+// define barcode style
+$style = array(
+ 'position' => '',
+ 'align' => '',
+ 'stretch' => true,
+ 'fitwidth' => false,
+ 'cellfitalign' => '',
+ 'border' => true,
+ 'hpadding' => 'auto',
+ 'vpadding' => 'auto',
+ 'fgcolor' => array(0,0,128),
+ 'bgcolor' => array(255,255,128),
+ 'text' => true,
+ 'label' => 'CUSTOM LABEL',
+ 'font' => 'helvetica',
+ 'fontsize' => 8,
+ 'stretchtext' => 4
+);
+
+// CODE 39 EXTENDED + CHECKSUM
+$pdf->Cell(0, 0, 'CODE 39 EXTENDED + CHECKSUM', 0, 1);
+$pdf->SetLineStyle(array('width' => 1, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(255, 0, 0)));
+$pdf->write1DBarcode('CODE 39 E+', 'C39E+', '', '', 120, 25, 0.4, $style, 'N');
+
+// ---------------------------------------------------------
+
+//Close and output PDF document
+$pdf->Output('example_027.pdf', 'I');
+
+//============================================================+
+// END OF FILE
+//============================================================+
diff --git a/examples/example_028.php b/examples/example_028.php
new file mode 100755
index 0000000..f250ac5
--- /dev/null
+++ b/examples/example_028.php
@@ -0,0 +1,138 @@
+SetCreator(PDF_CREATOR);
+$pdf->SetAuthor('Nicola Asuni');
+$pdf->SetTitle('TCPDF Example 028');
+$pdf->SetSubject('TCPDF Tutorial');
+$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
+
+// remove default header/footer
+$pdf->setPrintHeader(false);
+$pdf->setPrintFooter(false);
+
+// set default monospaced font
+$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
+
+// set margins
+$pdf->SetMargins(10, PDF_MARGIN_TOP, 10);
+
+// set auto page breaks
+$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
+
+// set image scale factor
+$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
+
+// set some language-dependent strings (optional)
+if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
+ require_once(dirname(__FILE__).'/lang/eng.php');
+ $pdf->setLanguageArray($l);
+}
+
+// ---------------------------------------------------------
+
+$pdf->SetDisplayMode('fullpage', 'SinglePage', 'UseNone');
+
+// set font
+$pdf->SetFont('times', 'B', 20);
+
+$pdf->AddPage('P', 'A4');
+$pdf->Cell(0, 0, 'A4 PORTRAIT', 1, 1, 'C');
+
+$pdf->AddPage('L', 'A4');
+$pdf->Cell(0, 0, 'A4 LANDSCAPE', 1, 1, 'C');
+
+$pdf->AddPage('P', 'A5');
+$pdf->Cell(0, 0, 'A5 PORTRAIT', 1, 1, 'C');
+
+$pdf->AddPage('L', 'A5');
+$pdf->Cell(0, 0, 'A5 LANDSCAPE', 1, 1, 'C');
+
+$pdf->AddPage('P', 'A6');
+$pdf->Cell(0, 0, 'A6 PORTRAIT', 1, 1, 'C');
+
+$pdf->AddPage('L', 'A6');
+$pdf->Cell(0, 0, 'A6 LANDSCAPE', 1, 1, 'C');
+
+$pdf->AddPage('P', 'A7');
+$pdf->Cell(0, 0, 'A7 PORTRAIT', 1, 1, 'C');
+
+$pdf->AddPage('L', 'A7');
+$pdf->Cell(0, 0, 'A7 LANDSCAPE', 1, 1, 'C');
+
+
+// --- test backward editing ---
+
+
+$pdf->setPage(1, true);
+$pdf->SetY(50);
+$pdf->Cell(0, 0, 'A4 test', 1, 1, 'C');
+
+$pdf->setPage(2, true);
+$pdf->SetY(50);
+$pdf->Cell(0, 0, 'A4 test', 1, 1, 'C');
+
+$pdf->setPage(3, true);
+$pdf->SetY(50);
+$pdf->Cell(0, 0, 'A5 test', 1, 1, 'C');
+
+$pdf->setPage(4, true);
+$pdf->SetY(50);
+$pdf->Cell(0, 0, 'A5 test', 1, 1, 'C');
+
+$pdf->setPage(5, true);
+$pdf->SetY(50);
+$pdf->Cell(0, 0, 'A6 test', 1, 1, 'C');
+
+$pdf->setPage(6, true);
+$pdf->SetY(50);
+$pdf->Cell(0, 0, 'A6 test', 1, 1, 'C');
+
+$pdf->setPage(7, true);
+$pdf->SetY(40);
+$pdf->Cell(0, 0, 'A7 test', 1, 1, 'C');
+
+$pdf->setPage(8, true);
+$pdf->SetY(40);
+$pdf->Cell(0, 0, 'A7 test', 1, 1, 'C');
+
+$pdf->lastPage();
+
+// ---------------------------------------------------------
+
+//Close and output PDF document
+$pdf->Output('example_028.pdf', 'I');
+
+//============================================================+
+// END OF FILE
+//============================================================+
diff --git a/examples/example_029.php b/examples/example_029.php
new file mode 100755
index 0000000..33be97e
--- /dev/null
+++ b/examples/example_029.php
@@ -0,0 +1,124 @@
+SetCreator(PDF_CREATOR);
+$pdf->SetAuthor('Nicola Asuni');
+$pdf->SetTitle('TCPDF Example 029');
+$pdf->SetSubject('TCPDF Tutorial');
+$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
+
+// set default header data
+$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 029', PDF_HEADER_STRING);
+
+// set header and footer fonts
+$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
+$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
+
+// set default monospaced font
+$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
+
+// set margins
+$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
+$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
+$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
+
+// set auto page breaks
+$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
+
+// set image scale factor
+$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
+
+// set some language-dependent strings (optional)
+if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
+ require_once(dirname(__FILE__).'/lang/eng.php');
+ $pdf->setLanguageArray($l);
+}
+
+// ---------------------------------------------------------
+
+// set array for viewer preferences
+$preferences = array(
+ 'HideToolbar' => true,
+ 'HideMenubar' => true,
+ 'HideWindowUI' => true,
+ 'FitWindow' => true,
+ 'CenterWindow' => true,
+ 'DisplayDocTitle' => true,
+ 'NonFullScreenPageMode' => 'UseNone', // UseNone, UseOutlines, UseThumbs, UseOC
+ 'ViewArea' => 'CropBox', // CropBox, BleedBox, TrimBox, ArtBox
+ 'ViewClip' => 'CropBox', // CropBox, BleedBox, TrimBox, ArtBox
+ 'PrintArea' => 'CropBox', // CropBox, BleedBox, TrimBox, ArtBox
+ 'PrintClip' => 'CropBox', // CropBox, BleedBox, TrimBox, ArtBox
+ 'PrintScaling' => 'AppDefault', // None, AppDefault
+ 'Duplex' => 'DuplexFlipLongEdge', // Simplex, DuplexFlipShortEdge, DuplexFlipLongEdge
+ 'PickTrayByPDFSize' => true,
+ 'PrintPageRange' => array(1,1,2,3),
+ 'NumCopies' => 2
+);
+
+// Check the example n. 60 for advanced page settings
+
+// set pdf viewer preferences
+$pdf->setViewerPreferences($preferences);
+
+// set font
+$pdf->SetFont('times', '', 14);
+
+// add a page
+$pdf->AddPage();
+
+// print a line
+$pdf->Cell(0, 12, 'DISPLAY PREFERENCES - PAGE 1', 1, 1, 'C');
+
+$pdf->Ln(5);
+
+$pdf->Write(0, 'You can use the setViewerPreferences() method to change viewer preferences.', '', 0, 'L', true, 0, false, false, 0);
+
+// add a page
+$pdf->AddPage();
+// print a line
+$pdf->Cell(0, 12, 'DISPLAY PREFERENCES - PAGE 2', 0, 0, 'C');
+
+// add a page
+$pdf->AddPage();
+// print a line
+$pdf->Cell(0, 12, 'DISPLAY PREFERENCES - PAGE 3', 0, 0, 'C');
+
+// ---------------------------------------------------------
+
+//Close and output PDF document
+$pdf->Output('example_029.pdf', 'D');
+
+//============================================================+
+// END OF FILE
+//============================================================+
diff --git a/examples/example_030.php b/examples/example_030.php
new file mode 100755
index 0000000..ed4e799
--- /dev/null
+++ b/examples/example_030.php
@@ -0,0 +1,188 @@
+SetCreator(PDF_CREATOR);
+$pdf->SetAuthor('Nicola Asuni');
+$pdf->SetTitle('TCPDF Example 030');
+$pdf->SetSubject('TCPDF Tutorial');
+$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
+
+// set default header data
+$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 030', PDF_HEADER_STRING);
+
+// set header and footer fonts
+$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
+$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
+
+// set default monospaced font
+$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
+
+// set margins
+$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
+$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
+$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
+
+// set auto page breaks
+$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
+
+// set image scale factor
+$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
+
+// set some language-dependent strings (optional)
+if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
+ require_once(dirname(__FILE__).'/lang/eng.php');
+ $pdf->setLanguageArray($l);
+}
+
+// ---------------------------------------------------------
+
+// set font
+$pdf->SetFont('helvetica', 'B', 20);
+
+// --- first page ------------------------------------------
+
+// add a page
+$pdf->AddPage();
+
+$pdf->Cell(0, 0, 'TCPDF Gradients', 0, 1, 'C', 0, '', 0, false, 'T', 'M');
+
+// set colors for gradients (r,g,b) or (grey 0-255)
+$red = array(255, 0, 0);
+$blue = array(0, 0, 200);
+$yellow = array(255, 255, 0);
+$green = array(0, 255, 0);
+$white = array(255);
+$black = array(0);
+
+// set the coordinates x1,y1,x2,y2 of the gradient (see linear_gradient_coords.jpg)
+$coords = array(0, 0, 1, 0);
+
+// paint a linear gradient
+$pdf->LinearGradient(20, 45, 80, 80, $red, $blue, $coords);
+
+// write label
+$pdf->Text(20, 130, 'LinearGradient()');
+
+// set the coordinates fx,fy,cx,cy,r of the gradient (see radial_gradient_coords.jpg)
+$coords = array(0.5, 0.5, 1, 1, 1.2);
+
+// paint a radial gradient
+$pdf->RadialGradient(110, 45, 80, 80, $white, $black, $coords);
+
+// write label
+$pdf->Text(110, 130, 'RadialGradient()');
+
+// paint a coons patch mesh with default coordinates
+$pdf->CoonsPatchMesh(20, 155, 80, 80, $yellow, $blue, $green, $red);
+
+// write label
+$pdf->Text(20, 240, 'CoonsPatchMesh()');
+
+// set the coordinates for the cubic Bézier points x1,y1 ... x12, y12 of the patch (see coons_patch_mesh_coords.jpg)
+$coords = array(
+ 0.00,0.00, 0.33,0.20, //lower left
+ 0.67,0.00, 1.00,0.00, 0.80,0.33, //lower right
+ 0.80,0.67, 1.00,1.00, 0.67,0.80, //upper right
+ 0.33,1.00, 0.00,1.00, 0.20,0.67, //upper left
+ 0.00,0.33); //lower left
+$coords_min = 0; //minimum value of the coordinates
+$coords_max = 1; //maximum value of the coordinates
+
+// paint a coons patch gradient with the above coordinates
+$pdf->CoonsPatchMesh(110, 155, 80, 80, $yellow, $blue, $green, $red, $coords, $coords_min, $coords_max);
+
+// write label
+$pdf->Text(110, 240, 'CoonsPatchMesh()');
+
+// --- second page -----------------------------------------
+$pdf->AddPage();
+
+// first patch: f = 0
+$patch_array[0]['f'] = 0;
+$patch_array[0]['points'] = array(
+ 0.00,0.00, 0.33,0.00,
+ 0.67,0.00, 1.00,0.00, 1.00,0.33,
+ 0.8,0.67, 1.00,1.00, 0.67,0.8,
+ 0.33,1.80, 0.00,1.00, 0.00,0.67,
+ 0.00,0.33);
+$patch_array[0]['colors'][0] = array('r' => 255, 'g' => 255, 'b' => 0);
+$patch_array[0]['colors'][1] = array('r' => 0, 'g' => 0, 'b' => 255);
+$patch_array[0]['colors'][2] = array('r' => 0, 'g' => 255,'b' => 0);
+$patch_array[0]['colors'][3] = array('r' => 255, 'g' => 0,'b' => 0);
+
+// second patch - above the other: f = 2
+$patch_array[1]['f'] = 2;
+$patch_array[1]['points'] = array(
+ 0.00,1.33,
+ 0.00,1.67, 0.00,2.00, 0.33,2.00,
+ 0.67,2.00, 1.00,2.00, 1.00,1.67,
+ 1.5,1.33);
+$patch_array[1]['colors'][0]=array('r' => 0, 'g' => 0, 'b' => 0);
+$patch_array[1]['colors'][1]=array('r' => 255, 'g' => 0, 'b' => 255);
+
+// third patch - right of the above: f = 3
+$patch_array[2]['f'] = 3;
+$patch_array[2]['points'] = array(
+ 1.33,0.80,
+ 1.67,1.50, 2.00,1.00, 2.00,1.33,
+ 2.00,1.67, 2.00,2.00, 1.67,2.00,
+ 1.33,2.00);
+$patch_array[2]['colors'][0] = array('r' => 0, 'g' => 255, 'b' => 255);
+$patch_array[2]['colors'][1] = array('r' => 0, 'g' => 0, 'b' => 0);
+
+// fourth patch - below the above, which means left(?) of the above: f = 1
+$patch_array[3]['f'] = 1;
+$patch_array[3]['points'] = array(
+ 2.00,0.67,
+ 2.00,0.33, 2.00,0.00, 1.67,0.00,
+ 1.33,0.00, 1.00,0.00, 1.00,0.33,
+ 0.8,0.67);
+$patch_array[3]['colors'][0] = array('r' => 0, 'g' => 0, 'b' => 0);
+$patch_array[3]['colors'][1] = array('r' => 0, 'g' => 0, 'b' => 255);
+
+$coords_min = 0;
+$coords_max = 2;
+
+$pdf->CoonsPatchMesh(10, 45, 190, 200, '', '', '', '', $patch_array, $coords_min, $coords_max);
+
+// write label
+$pdf->Text(10, 250, 'CoonsPatchMesh()');
+
+// ---------------------------------------------------------
+
+//Close and output PDF document
+$pdf->Output('example_030.pdf', 'D');
+
+//============================================================+
+// END OF FILE
+//============================================================+
diff --git a/examples/example_031.php b/examples/example_031.php
new file mode 100755
index 0000000..160d162
--- /dev/null
+++ b/examples/example_031.php
@@ -0,0 +1,103 @@
+SetCreator(PDF_CREATOR);
+$pdf->SetAuthor('Nicola Asuni');
+$pdf->SetTitle('TCPDF Example 031');
+$pdf->SetSubject('TCPDF Tutorial');
+$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
+
+// set default header data
+$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 031', PDF_HEADER_STRING);
+
+// set header and footer fonts
+$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
+$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
+
+// set default monospaced font
+$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
+
+// set margins
+$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
+$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
+$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
+
+// set auto page breaks
+$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
+
+// set image scale factor
+$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
+
+// set some language-dependent strings (optional)
+if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
+ require_once(dirname(__FILE__).'/lang/eng.php');
+ $pdf->setLanguageArray($l);
+}
+
+// ---------------------------------------------------------
+
+// set font
+$pdf->SetFont('helvetica', 'B', 20);
+
+// add a page
+$pdf->AddPage();
+
+$pdf->Write(0, 'Example of PieSector() method.');
+
+$xc = 105;
+$yc = 100;
+$r = 50;
+
+$pdf->SetFillColor(0, 0, 255);
+$pdf->PieSector($xc, $yc, $r, 20, 120, 'FD', false, 0, 2);
+
+$pdf->SetFillColor(0, 255, 0);
+$pdf->PieSector($xc, $yc, $r, 120, 250, 'FD', false, 0, 2);
+
+$pdf->SetFillColor(255, 0, 0);
+$pdf->PieSector($xc, $yc, $r, 250, 20, 'FD', false, 0, 2);
+
+// write labels
+$pdf->SetTextColor(255,255,255);
+$pdf->Text(105, 65, 'BLUE');
+$pdf->Text(60, 95, 'GREEN');
+$pdf->Text(120, 115, 'RED');
+
+// ---------------------------------------------------------
+
+//Close and output PDF document
+$pdf->Output('example_031.pdf', 'I');
+
+//============================================================+
+// END OF FILE
+//============================================================+
diff --git a/examples/example_032.php b/examples/example_032.php
new file mode 100755
index 0000000..b38f5ae
--- /dev/null
+++ b/examples/example_032.php
@@ -0,0 +1,91 @@
+SetCreator(PDF_CREATOR);
+$pdf->SetAuthor('Nicola Asuni');
+$pdf->SetTitle('TCPDF Example 032');
+$pdf->SetSubject('TCPDF Tutorial');
+$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
+
+// set default header data
+$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 032', PDF_HEADER_STRING);
+
+// set header and footer fonts
+$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
+$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
+
+// set default monospaced font
+$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
+
+// set margins
+$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
+$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
+$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
+
+// set auto page breaks
+$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
+
+// set image scale factor
+$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
+
+// set some language-dependent strings (optional)
+if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
+ require_once(dirname(__FILE__).'/lang/eng.php');
+ $pdf->setLanguageArray($l);
+}
+
+// ---------------------------------------------------------
+
+// set font
+$pdf->SetFont('helvetica', '', 12);
+
+$pdf->AddPage();
+
+$html = <<Example of Spot Colors
Spot colors are single ink colors, rather than colors produced by four (CMYK), six (CMYKOG) or more inks in the printing process (process colors). They can be obtained by special vendors, but often the printers have found their own way of mixing inks to match defined colors.
As long as no open standard for spot colours exists, TCPDF users will have to buy a colour book by one of the colour manufacturers and insert the values and names of spot colours directly into the $spotcolor array in include/tcpdf_colors.php file, or define them using the AddSpotColor() method.
Common industry standard spot colors are:
ANPA-COLOR, DIC, FOCOLTONE, GCMI, HKS, PANTONE, TOYO, TRUMATCH.';
+
+// Print text using writeHTMLCell()
+$pdf->writeHTMLCell(0, 0, '', '', $html, 0, 1, 0, true, 'J', true);
+
+
+$pdf->SetFont('helvetica', '', 10);
+
+// Define some new spot colors
+// $c, $m, $y and $k (2nd, 3rd, 4th and 5th parameter) are the CMYK color components.
+// AddSpotColor($name, $c, $m, $y, $k)
+
+$pdf->AddSpotColor('My TCPDF Dark Green', 100, 50, 80, 45);
+$pdf->AddSpotColor('My TCPDF Light Yellow', 0, 0, 55, 0);
+$pdf->AddSpotColor('My TCPDF Black', 0, 0, 0, 100);
+$pdf->AddSpotColor('My TCPDF Red', 30, 100, 90, 10);
+$pdf->AddSpotColor('My TCPDF Green', 100, 30, 100, 0);
+$pdf->AddSpotColor('My TCPDF Blue', 100, 60, 10, 5);
+$pdf->AddSpotColor('My TCPDF Yellow', 0, 20, 100, 0);
+
+// Select the spot color
+// $tint (the second parameter) is the intensity of the color (0-100).
+// SetTextSpotColor($name, $tint=100)
+// SetDrawSpotColor($name, $tint=100)
+// SetFillSpotColor($name, $tint=100)
+
+$pdf->SetTextSpotColor('My TCPDF Black', 100);
+$pdf->SetDrawSpotColor('My TCPDF Black', 100);
+
+$starty = 100;
+
+// print some spot colors
+
+$pdf->SetFillSpotColor('My TCPDF Dark Green', 100);
+$pdf->Rect(30, $starty, 40, 20, 'DF');
+$pdf->Text(73, $starty + 8, 'My TCPDF Dark Green');
+
+$starty += 24;
+$pdf->SetFillSpotColor('My TCPDF Light Yellow', 100);
+$pdf->Rect(30, $starty, 40, 20, 'DF');
+$pdf->Text(73, $starty + 8, 'My TCPDF Light Yellow');
+
+
+// --- default values defined on spotcolors.php ---
+
+$starty += 24;
+$pdf->SetFillSpotColor('My TCPDF Red', 100);
+$pdf->Rect(30, $starty, 40, 20, 'DF');
+$pdf->Text(73, $starty + 8, 'My TCPDF Red');
+
+$starty += 24;
+$pdf->SetFillSpotColor('My TCPDF Green', 100);
+$pdf->Rect(30, $starty, 40, 20, 'DF');
+$pdf->Text(73, $starty + 8, 'My TCPDF Green');
+
+$starty += 24;
+$pdf->SetFillSpotColor('My TCPDF Blue', 100);
+$pdf->Rect(30, $starty, 40, 20, 'DF');
+$pdf->Text(73, $starty + 8, 'My TCPDF Blue');
+
+$starty += 24;
+$pdf->SetFillSpotColor('My TCPDF Yellow', 100);
+$pdf->Rect(30, $starty, 40, 20, 'DF');
+$pdf->Text(73, $starty + 8, 'My TCPDF Yellow');
+
+// ---------------------------------------------------------
+
+//Close and output PDF document
+$pdf->Output('example_037.pdf', 'I');
+
+//============================================================+
+// END OF FILE
+//============================================================+
diff --git a/examples/example_038.php b/examples/example_038.php
new file mode 100755
index 0000000..a1e57e2
--- /dev/null
+++ b/examples/example_038.php
@@ -0,0 +1,92 @@
+SetCreator(PDF_CREATOR);
+$pdf->SetAuthor('Nicola Asuni');
+$pdf->SetTitle('TCPDF Example 038');
+$pdf->SetSubject('TCPDF Tutorial');
+$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
+
+// set default header data
+$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 038', PDF_HEADER_STRING);
+
+// set header and footer fonts
+$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
+$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
+
+// set default monospaced font
+$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
+
+// set margins
+$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
+$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
+$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
+
+// set auto page breaks
+$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
+
+// set image scale factor
+$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
+
+// set some language-dependent strings (optional)
+if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
+ require_once(dirname(__FILE__).'/lang/eng.php');
+ $pdf->setLanguageArray($l);
+}
+
+// ---------------------------------------------------------
+
+// set font
+$pdf->SetFont('helvetica', '', 20);
+
+// add a page
+$pdf->AddPage();
+
+$txt = 'Example of CID-0 CJK unembedded font.
+To display extended text you must have CJK fonts installed for your PDF reader:';
+$pdf->Write(0, $txt, '', 0, 'L', true, 0, false, false, 0);
+
+// set font
+$pdf->SetFont('cid0jp', '', 40);
+
+$txt = 'こんにちは世界';
+$pdf->Write(0, $txt, '', 0, 'L', true, 0, false, false, 0);
+
+// ---------------------------------------------------------
+
+//Close and output PDF document
+$pdf->Output('example_038.pdf', 'I');
+
+//============================================================+
+// END OF FILE
+//============================================================+
diff --git a/examples/example_039.php b/examples/example_039.php
new file mode 100755
index 0000000..4a8775c
--- /dev/null
+++ b/examples/example_039.php
@@ -0,0 +1,104 @@
+SetCreator(PDF_CREATOR);
+$pdf->SetAuthor('Nicola Asuni');
+$pdf->SetTitle('TCPDF Example 039');
+$pdf->SetSubject('TCPDF Tutorial');
+$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
+
+// set default header data
+$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 039', PDF_HEADER_STRING);
+
+// set header and footer fonts
+$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
+$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
+
+// set default monospaced font
+$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
+
+// set margins
+$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
+$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
+$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
+
+// set auto page breaks
+$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
+
+// set image scale factor
+$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
+
+// set some language-dependent strings (optional)
+if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
+ require_once(dirname(__FILE__).'/lang/eng.php');
+ $pdf->setLanguageArray($l);
+}
+
+// ---------------------------------------------------------
+
+// add a page
+$pdf->AddPage();
+
+// set font
+$pdf->SetFont('helvetica', 'B', 20);
+
+$pdf->Write(0, 'Example of HTML Justification', '', 0, 'L', true, 0, false, false, 0);
+
+// create some HTML content
+$html = 'a abc abcdefghijkl (abcdef) abcdefg abcdefghi a ((abc)) abcd abcdef abcdefg abcdefghi a abc abcd abcdef abcdefg abcdefghi a abc abcd abcdef abcdefg abcdefghi a abc abcd abcdef abcdefg abcdefghi a abc \(abcd\) abcdef abcdefg abcdefghi a abc \\\(abcd\\\) abcdef abcdefg abcdefghi a abc abcd abcdef abcdefg abcdefghi a abc abcd abcdef abcdefg abcdefghi a abc abcd abcdef abcdefg abcdefghi a abc abcd abcdef abcdefg start a abc before yellow color after a abc abcd abcdef abcdefg abcdefghi a abc abcd end abcdefg abcdefghi a abc abcd abcdef abcdefg abcdefghi a abc abcd abcdef abcdefg abcdefghi a abc abcd abcdef abcdefg abcdefghi a abc abcd abcdef abcdefg abcdefghi a abc abcd abcdef abcdefg abcdefghi a abc abcd abcdef abcdefg abcdefghi a abc abcd abcdef abcdefg abcdefghi
abcd abcdef abcdefg abcdefghi
abcd abcde abcdef';
+
+// set core font
+$pdf->SetFont('helvetica', '', 10);
+
+// output the HTML content
+$pdf->writeHTML($html, true, 0, true, true);
+
+$pdf->Ln();
+
+// set UTF-8 Unicode font
+$pdf->SetFont('dejavusans', '', 10);
+
+// output the HTML content
+$pdf->writeHTML($html, true, 0, true, true);
+
+// reset pointer to the last page
+$pdf->lastPage();
+
+// ---------------------------------------------------------
+
+//Close and output PDF document
+$pdf->Output('example_039.pdf', 'I');
+
+//============================================================+
+// END OF FILE
+//============================================================+
diff --git a/examples/example_040.php b/examples/example_040.php
new file mode 100755
index 0000000..c1d9091
--- /dev/null
+++ b/examples/example_040.php
@@ -0,0 +1,116 @@
+SetCreator(PDF_CREATOR);
+$pdf->SetAuthor('Nicola Asuni');
+$pdf->SetTitle('TCPDF Example 040');
+$pdf->SetSubject('TCPDF Tutorial');
+$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
+
+// set default header data
+$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 040', PDF_HEADER_STRING);
+
+// set header and footer fonts
+$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
+$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
+
+// set default monospaced font
+$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
+
+// set margins
+$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
+$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
+$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
+
+// set auto page breaks
+$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
+
+// set image scale factor
+$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
+
+// set some language-dependent strings (optional)
+if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
+ require_once(dirname(__FILE__).'/lang/eng.php');
+ $pdf->setLanguageArray($l);
+}
+
+// ---------------------------------------------------------
+
+// set display mode
+$pdf->SetDisplayMode($zoom='fullpage', $layout='TwoColumnRight', $mode='UseNone');
+
+// set pdf viewer preferences
+$pdf->setViewerPreferences(array('Duplex' => 'DuplexFlipLongEdge'));
+
+// set booklet mode
+$pdf->SetBooklet(true, 10, 30);
+
+// set core font
+$pdf->SetFont('helvetica', '', 18);
+
+// add a page (left page)
+$pdf->AddPage();
+
+$pdf->Write(0, 'Example of booklet mode', '', 0, 'L', true, 0, false, false, 0);
+
+// print a line using Cell()
+$pdf->Cell(0, 0, 'PAGE 1', 1, 1, 'C');
+
+
+// add a page (right page)
+$pdf->AddPage();
+
+// print a line using Cell()
+$pdf->Cell(0, 0, 'PAGE 2', 1, 1, 'C');
+
+
+// add a page (left page)
+$pdf->AddPage();
+
+// print a line using Cell()
+$pdf->Cell(0, 0, 'PAGE 3', 1, 1, 'C');
+
+// add a page (right page)
+$pdf->AddPage();
+
+// print a line using Cell()
+$pdf->Cell(0, 0, 'PAGE 4', 1, 1, 'C');
+
+// ---------------------------------------------------------
+
+//Close and output PDF document
+$pdf->Output('example_040.pdf', 'I');
+
+//============================================================+
+// END OF FILE
+//============================================================+
diff --git a/examples/example_041.php b/examples/example_041.php
new file mode 100755
index 0000000..973bdf9
--- /dev/null
+++ b/examples/example_041.php
@@ -0,0 +1,90 @@
+SetCreator(PDF_CREATOR);
+$pdf->SetAuthor('Nicola Asuni');
+$pdf->SetTitle('TCPDF Example 041');
+$pdf->SetSubject('TCPDF Tutorial');
+$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
+
+// set default header data
+$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 041', PDF_HEADER_STRING);
+
+// set header and footer fonts
+$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
+$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
+
+// set default monospaced font
+$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
+
+// set margins
+$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
+$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
+$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
+
+// set auto page breaks
+$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
+
+// set image scale factor
+$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
+
+// set some language-dependent strings (optional)
+if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
+ require_once(dirname(__FILE__).'/lang/eng.php');
+ $pdf->setLanguageArray($l);
+}
+
+// ---------------------------------------------------------
+
+// set font
+$pdf->SetFont('times', '', 16);
+
+// add a page
+$pdf->AddPage();
+
+
+$txt = 'Example of File Attachment.
+Double click on the icon to open the attached file.';
+$pdf->Write(0, $txt, '', 0, 'L', true, 0, false, false, 0);
+
+// attach an external file
+$pdf->Annotation(85, 27, 5, 5, 'text file', array('Subtype'=>'FileAttachment', 'Name' => 'PushPin', 'FS' => 'data/utf8test.txt'));
+
+// ---------------------------------------------------------
+
+//Close and output PDF document
+$pdf->Output('example_041.pdf', 'D');
+
+//============================================================+
+// END OF FILE
+//============================================================+
diff --git a/examples/example_042.php b/examples/example_042.php
new file mode 100755
index 0000000..14c9fd0
--- /dev/null
+++ b/examples/example_042.php
@@ -0,0 +1,102 @@
+SetCreator(PDF_CREATOR);
+$pdf->SetAuthor('Nicola Asuni');
+$pdf->SetTitle('TCPDF Example 042');
+$pdf->SetSubject('TCPDF Tutorial');
+$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
+
+// set default header data
+$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 042', PDF_HEADER_STRING);
+
+// set header and footer fonts
+$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
+$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
+
+// set default monospaced font
+$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
+
+// set margins
+$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
+$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
+$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
+
+// set auto page breaks
+$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
+
+// set image scale factor
+$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
+
+// set some language-dependent strings (optional)
+if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
+ require_once(dirname(__FILE__).'/lang/eng.php');
+ $pdf->setLanguageArray($l);
+}
+
+// ---------------------------------------------------------
+
+// set JPEG quality
+//$pdf->setJPEGQuality(75);
+
+$pdf->SetFont('helvetica', '', 18);
+
+// add a page
+$pdf->AddPage();
+
+// create background text
+$background_text = str_repeat('TCPDF test PNG Alpha Channel ', 50);
+$pdf->MultiCell(0, 5, $background_text, 0, 'J', 0, 2, '', '', true, 0, false);
+
+// --- Method (A) ------------------------------------------
+// the Image() method recognizes the alpha channel embedded on the image:
+
+$pdf->Image('images/image_with_alpha.png', 50, 50, 100, '', '', 'http://www.tcpdf.org', '', false, 300);
+
+// --- Method (B) ------------------------------------------
+// provide image + separate 8-bit mask
+
+// first embed mask image (w, h, x and y will be ignored, the image will be scaled to the target image's size)
+$mask = $pdf->Image('images/alpha.png', 50, 140, 100, '', '', '', '', false, 300, '', true);
+
+// embed image, masked with previously embedded mask
+$pdf->Image('images/img.png', 50, 140, 100, '', '', 'http://www.tcpdf.org', '', false, 300, '', false, $mask);
+
+// ---------------------------------------------------------
+
+//Close and output PDF document
+$pdf->Output('example_042.pdf', 'I');
+
+//============================================================+
+// END OF FILE
+//============================================================+
diff --git a/examples/example_043.php b/examples/example_043.php
new file mode 100755
index 0000000..116827e
--- /dev/null
+++ b/examples/example_043.php
@@ -0,0 +1,85 @@
+SetCreator(PDF_CREATOR);
+$pdf->SetAuthor('Nicola Asuni');
+$pdf->SetTitle('TCPDF Example 043');
+$pdf->SetSubject('TCPDF Tutorial');
+$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
+
+// set default header data
+$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 043', PDF_HEADER_STRING);
+
+// set header and footer fonts
+$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
+$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
+
+// set default monospaced font
+$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
+
+// set margins
+$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
+$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
+$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
+
+// set auto page breaks
+$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
+
+// set image scale factor
+$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
+
+// set some language-dependent strings (optional)
+if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
+ require_once(dirname(__FILE__).'/lang/eng.php');
+ $pdf->setLanguageArray($l);
+}
+
+// ---------------------------------------------------------
+
+// set font
+$pdf->SetFont('helvetica', '', 16);
+
+// add a page
+$pdf->AddPage();
+
+// Multicell test
+$pdf->MultiCell(0, 0, 'DISK CACHING TEST: check the parameters of the class constructor.', 1, 'L', 0, 0, '', '', true);
+
+// ---------------------------------------------------------
+
+//Close and output PDF document
+$pdf->Output('example_043.pdf', 'I');
+
+//============================================================+
+// END OF FILE
+//============================================================+
diff --git a/examples/example_044.php b/examples/example_044.php
new file mode 100755
index 0000000..949270c
--- /dev/null
+++ b/examples/example_044.php
@@ -0,0 +1,128 @@
+SetCreator(PDF_CREATOR);
+$pdf->SetAuthor('Nicola Asuni');
+$pdf->SetTitle('TCPDF Example 044');
+$pdf->SetSubject('TCPDF Tutorial');
+$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
+
+// set default header data
+$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 044', PDF_HEADER_STRING);
+
+// set header and footer fonts
+$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
+$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
+
+// set default monospaced font
+$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
+
+// set margins
+$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
+$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
+$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
+
+// set auto page breaks
+$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
+
+// set image scale factor
+$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
+
+// set some language-dependent strings (optional)
+if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
+ require_once(dirname(__FILE__).'/lang/eng.php');
+ $pdf->setLanguageArray($l);
+}
+
+// ---------------------------------------------------------
+
+// set font
+$pdf->SetFont('helvetica', 'B', 40);
+
+// print a line using Cell()
+$pdf->AddPage();
+$pdf->Cell(0, 10, 'PAGE: A', 0, 1, 'L');
+
+// add some vertical space
+$pdf->Ln(10);
+
+// print some text
+$pdf->SetFont('times', 'I', 16);
+$txt = 'TCPDF allows you to Copy, Move and Delete pages.';
+$pdf->Write(0, $txt, '', 0, 'L', true, 0, false, false, 0);
+
+$pdf->SetFont('helvetica', 'B', 40);
+
+$pdf->AddPage();
+$pdf->Cell(0, 10, 'PAGE: B', 0, 1, 'L');
+
+$pdf->AddPage();
+$pdf->Cell(0, 10, 'PAGE: D', 0, 1, 'L');
+
+$pdf->AddPage();
+$pdf->Cell(0, 10, 'PAGE: E', 0, 1, 'L');
+
+$pdf->AddPage();
+$pdf->Cell(0, 10, 'PAGE: E-2', 0, 1, 'L');
+
+$pdf->AddPage();
+$pdf->Cell(0, 10, 'PAGE: F', 0, 1, 'L');
+
+$pdf->AddPage();
+$pdf->Cell(0, 10, 'PAGE: C', 0, 1, 'L');
+
+$pdf->AddPage();
+$pdf->Cell(0, 10, 'PAGE: G', 0, 1, 'L');
+
+// Move page 7 to page 3
+$pdf->movePage(7, 3);
+
+// Delete page 6
+$pdf->deletePage(6);
+
+$pdf->AddPage();
+$pdf->Cell(0, 10, 'PAGE: H', 0, 1, 'L');
+
+// copy the second page
+$pdf->copyPage(2);
+
+// NOTE: to insert a page to a previous position, you can add a new page to the end of document and then move it using movePage().
+
+// ---------------------------------------------------------
+
+//Close and output PDF document
+$pdf->Output('example_044.pdf', 'I');
+
+//============================================================+
+// END OF FILE
+//============================================================+
diff --git a/examples/example_045.php b/examples/example_045.php
new file mode 100755
index 0000000..0f49abc
--- /dev/null
+++ b/examples/example_045.php
@@ -0,0 +1,140 @@
+SetCreator(PDF_CREATOR);
+$pdf->SetAuthor('Nicola Asuni');
+$pdf->SetTitle('TCPDF Example 045');
+$pdf->SetSubject('TCPDF Tutorial');
+$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
+
+// set default header data
+$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 045', PDF_HEADER_STRING);
+
+// set header and footer fonts
+$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
+$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
+
+// set default monospaced font
+$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
+
+// set margins
+$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
+$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
+$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
+
+// set auto page breaks
+$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
+
+// set image scale factor
+$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
+
+// set some language-dependent strings (optional)
+if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
+ require_once(dirname(__FILE__).'/lang/eng.php');
+ $pdf->setLanguageArray($l);
+}
+
+// ---------------------------------------------------------
+
+// set font
+$pdf->SetFont('times', 'B', 20);
+
+// add a page
+$pdf->AddPage();
+
+// set a bookmark for the current position
+$pdf->Bookmark('Chapter 1', 0, 0, '', 'B', array(0,64,128));
+
+// print a line using Cell()
+$pdf->Cell(0, 10, 'Chapter 1', 0, 1, 'L');
+
+// Create a fixed link to the first page using the * character
+$index_link = $pdf->AddLink();
+$pdf->SetLink($index_link, 0, '*1');
+$pdf->Cell(0, 10, 'Link to INDEX', 0, 1, 'R', false, $index_link);
+
+$pdf->AddPage();
+$pdf->Bookmark('Paragraph 1.1', 1, 0, '', '', array(128,0,0));
+$pdf->Cell(0, 10, 'Paragraph 1.1', 0, 1, 'L');
+
+$pdf->AddPage();
+$pdf->Bookmark('Paragraph 1.2', 1, 0, '', '', array(128,0,0));
+$pdf->Cell(0, 10, 'Paragraph 1.2', 0, 1, 'L');
+
+$pdf->AddPage();
+$pdf->Bookmark('Sub-Paragraph 1.2.1', 2, 0, '', 'I', array(0,128,0));
+$pdf->Cell(0, 10, 'Sub-Paragraph 1.2.1', 0, 1, 'L');
+
+$pdf->AddPage();
+$pdf->Bookmark('Paragraph 1.3', 1, 0, '', '', array(128,0,0));
+$pdf->Cell(0, 10, 'Paragraph 1.3', 0, 1, 'L');
+
+// fixed link to the first page using the * character
+$html = 'link to INDEX (page 1)';
+$pdf->writeHTML($html, true, false, true, false, '');
+
+
+// add some pages and bookmarks
+for ($i = 2; $i < 12; $i++) {
+ $pdf->AddPage();
+ $pdf->Bookmark('Chapter '.$i, 0, 0, '', 'B', array(0,64,128));
+ $pdf->Cell(0, 10, 'Chapter '.$i, 0, 1, 'L');
+}
+
+// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
+
+// add a new page for TOC
+$pdf->addTOCPage();
+
+// write the TOC title
+$pdf->SetFont('times', 'B', 16);
+$pdf->MultiCell(0, 0, 'Table Of Content', 0, 'C', 0, 1, '', '', true, 0);
+$pdf->Ln();
+
+$pdf->SetFont('dejavusans', '', 12);
+
+// add a simple Table Of Content at first page
+// (check the example n. 59 for the HTML version)
+$pdf->addTOC(1, 'courier', '.', 'INDEX', 'B', array(128,0,0));
+
+// end of TOC page
+$pdf->endTOCPage();
+
+// ---------------------------------------------------------
+
+//Close and output PDF document
+$pdf->Output('example_045.pdf', 'I');
+
+//============================================================+
+// END OF FILE
+//============================================================+
diff --git a/examples/example_046.php b/examples/example_046.php
new file mode 100755
index 0000000..70d11d3
--- /dev/null
+++ b/examples/example_046.php
@@ -0,0 +1,123 @@
+SetCreator(PDF_CREATOR);
+$pdf->SetAuthor('Nicola Asuni');
+$pdf->SetTitle('TCPDF Example 046');
+$pdf->SetSubject('TCPDF Tutorial');
+$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
+
+// set default header data
+$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 046', PDF_HEADER_STRING);
+
+// set header and footer fonts
+$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
+$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
+
+// set default monospaced font
+$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
+
+// set margins
+$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
+$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
+$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
+
+// set auto page breaks
+$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
+
+// set image scale factor
+$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
+
+// set some language-dependent strings (optional)
+if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
+ require_once(dirname(__FILE__).'/lang/eng.php');
+ $pdf->setLanguageArray($l);
+}
+
+// ---------------------------------------------------------
+
+// set font
+$pdf->SetFont('helvetica', 'B', 20);
+
+// add a page
+$pdf->AddPage();
+
+$pdf->Write(0, 'Example of Text Hyphenation', '', 0, 'L', true, 0, false, false, 0);
+
+$pdf->Ln(10);
+
+/*
+Unicode Data for SHY:
+ Name : SOFT HYPHEN, commonly abbreviated as SHY
+ HTML Entity (decimal):
+ HTML Entity (hex):
+ HTML Entity (named):
+ How to type in Microsoft Windows: [Alt +00AD] or [Alt 0173]
+ UTF-8 (hex): 0xC2 0xAD (c2ad)
+*/
+
+/*
+// You can automatically add SOFT HYPHENS to your text using
+// the hyphenateText() method, but this requires either an
+// hyphenation pattern array of a hyphenation pattern TEX file.
+// You can download hyphenation TEX patterns from:
+// http://www.ctan.org/tex-archive/language/hyph-utf8/tex/generic/hyph-utf8/patterns/
+
+// EXAMPLE:
+
+$html = 'On the other hand, we denounce with righteous indignation and dislike men who are so beguiled and demoralized by the charms of pleasure of the moment, so blinded by desire, that they cannot foresee the pain and trouble that are bound to ensue; and equal blame belongs to those who fail in their duty through weakness of will, which is the same as saying through shrinking from toil and pain. These cases are perfectly simple and easy to distinguish. In a free hour, when our power of choice is untrammelled and when nothing prevents our being able to do what we like best, every pleasure is to be welcomed and every pain avoided. But in certain circumstances and owing to the claims of duty or the obligations of business it will frequently occur that pleasures have to be repudiated and annoyances accepted. The wise man therefore always holds in these matters to this principle of selection: he rejects pleasures to secure other greater pleasures, or else he endures pains to avoid worse pains.';
+
+$hyphen_patterns = $pdf->getHyphenPatternsFromTEX('hyphens/hyph-en-gb.tex');
+
+$html = $pdf->hyphenateText($html, $hyphen_patterns, array(), 1, 2, 1, 8);
+*/
+
+
+// HTML text with soft hyphens ()
+$html = 'On the other hand, we denounce with righteous indignation and dislike men who are so beguiled and demoralized by the charms of pleasure of the moment, so blinded by desire, that they cannot foresee the pain and trouble that are bound to ensue; and equal blame belongs to those who fail in their duty through weakness of will, which is the same as saying through shrinking from toil and pain. These cases are perfectly simple and easy to distinguish. In a free hour, when our power of choice is untrammelled and when nothing prevents our being able to do what we like best, every pleasure is to be welcomed and every pain avoided. But in certain circumstances and owing to the claims of duty or the obligations of business it will frequently occur that pleasures have to be repudiated and annoyances accepted. The wise man therefore always holds in these matters to this principle of selection: he rejects pleasures to secure other greater pleasures, or else he endures pains to avoid worse pains.';
+
+$pdf->SetFont('times', '', 10);
+$pdf->SetDrawColor(255,0,0);
+$pdf->SetTextColor(0,63,127);
+
+// print a cell
+$pdf->writeHTMLCell(50, 0, '', '', $html, 1, 1, 0, true, 'J');
+
+// ---------------------------------------------------------
+
+//Close and output PDF document
+$pdf->Output('example_046.pdf', 'I');
+
+//============================================================+
+// END OF FILE
+//============================================================+
diff --git a/examples/example_047.php b/examples/example_047.php
new file mode 100755
index 0000000..a26ae5d
--- /dev/null
+++ b/examples/example_047.php
@@ -0,0 +1,117 @@
+SetCreator(PDF_CREATOR);
+$pdf->SetAuthor('Nicola Asuni');
+$pdf->SetTitle('TCPDF Example 047');
+$pdf->SetSubject('TCPDF Tutorial');
+$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
+
+// set default header data
+$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 047', PDF_HEADER_STRING);
+
+// set header and footer fonts
+$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
+$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
+
+// set default monospaced font
+$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
+
+// set margins
+$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
+$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
+$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
+
+// set auto page breaks
+$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
+
+// set image scale factor
+$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
+
+// set some language-dependent strings (optional)
+if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
+ require_once(dirname(__FILE__).'/lang/eng.php');
+ $pdf->setLanguageArray($l);
+}
+
+// ---------------------------------------------------------
+
+// set font
+$pdf->SetFont('helvetica', '', 16);
+
+// add a page
+$pdf->AddPage();
+
+$txt = 'Example of Transactions.
+TCPDF allows you to undo some operations using the Transactions.
+Check the source code for further information.';
+$pdf->Write(0, $txt, '', 0, 'L', true, 0, false, false, 0);
+
+$pdf->Ln(5);
+
+$pdf->SetFont('times', '', 12);
+
+// start transaction
+$pdf->startTransaction();
+
+$pdf->Write(0, "LINE 1\n");
+$pdf->Write(0, "LINE 2\n");
+
+// restarts transaction
+$pdf->startTransaction();
+
+$pdf->Write(0, "LINE 3\n");
+$pdf->Write(0, "LINE 4\n");
+
+// rolls back to the last (re)start
+$pdf = $pdf->rollbackTransaction();
+
+$pdf->Write(0, "LINE 5\n");
+$pdf->Write(0, "LINE 6\n");
+
+// start transaction
+$pdf->startTransaction();
+
+$pdf->Write(0, "LINE 7\n");
+
+// commit transaction (actually just frees memory)
+$pdf->commitTransaction();
+
+// ---------------------------------------------------------
+
+//Close and output PDF document
+$pdf->Output('example_047.pdf', 'I');
+
+//============================================================+
+// END OF FILE
+//============================================================+
diff --git a/examples/example_048.php b/examples/example_048.php
new file mode 100755
index 0000000..ca88a14
--- /dev/null
+++ b/examples/example_048.php
@@ -0,0 +1,313 @@
+SetCreator(PDF_CREATOR);
+$pdf->SetAuthor('Nicola Asuni');
+$pdf->SetTitle('TCPDF Example 048');
+$pdf->SetSubject('TCPDF Tutorial');
+$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
+
+// set default header data
+$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 048', PDF_HEADER_STRING);
+
+// set header and footer fonts
+$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
+$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
+
+// set default monospaced font
+$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
+
+// set margins
+$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
+$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
+$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
+
+// set auto page breaks
+$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
+
+// set image scale factor
+$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
+
+// set some language-dependent strings (optional)
+if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
+ require_once(dirname(__FILE__).'/lang/eng.php');
+ $pdf->setLanguageArray($l);
+}
+
+// ---------------------------------------------------------
+
+// set font
+$pdf->SetFont('helvetica', 'B', 20);
+
+// add a page
+$pdf->AddPage();
+
+$pdf->Write(0, 'Example of HTML tables', '', 0, 'L', true, 0, false, false, 0);
+
+$pdf->SetFont('helvetica', '', 8);
+
+// -----------------------------------------------------------------------------
+
+$tbl = <<
+
+ COL 1 - ROW 1
+
COLSPAN 3COL 2 - ROW 1
+ COL 3 - ROW 1
+
+
+ COL 2 - ROW 2 - COLSPAN 2
+
text line
text line
text line
text lineCOL 3 - ROW 2
+
+
+
+
+EOD;
+
+$pdf->writeHTML($tbl, true, false, false, false, '');
+
+// -----------------------------------------------------------------------------
+
+$tbl = <<COL 3 - ROW 3
+
+
+ COL 1 - ROW 1
+
COLSPAN 3
text line
text line
text line
text line
text line
text lineCOL 2 - ROW 1
+ COL 3 - ROW 1
+
+
+ COL 2 - ROW 2 - COLSPAN 2
+
text line
text line
text line
text lineCOL 3 - ROW 2
+
+
+
+
+EOD;
+
+$pdf->writeHTML($tbl, true, false, false, false, '');
+
+// -----------------------------------------------------------------------------
+
+$tbl = <<COL 3 - ROW 3
+
+
+ COL 1 - ROW 1
+
COLSPAN 3
text line
text line
text line
text line
text line
text lineCOL 2 - ROW 1
+ COL 3 - ROW 1
+
+
+ COL 2 - ROW 2 - COLSPAN 2
+
text line
text line
text line
text lineCOL 3 - ROW 2
+
text line
text line
+
+
+
+EOD;
+
+$pdf->writeHTML($tbl, true, false, false, false, '');
+
+// -----------------------------------------------------------------------------
+
+$tbl = <<COL 3 - ROW 3
+
+
+Left column
+Heading Column Span 5
+Heading Column Span 9
+
+
+Rowspan 2
+
This is some text that fills the table cell.span 2
+span 2
+2 rows
+Colspan 8
+
+
+
+EOD;
+
+$pdf->writeHTML($tbl, true, false, false, false, '');
+
+// -----------------------------------------------------------------------------
+
+// Table with rowspans and THEAD
+$tbl = <<1a
+2a
+1b
+2b
+1
+2
+3
+4
+5
+6
+7
+8
+
+
+ A
+ XXXX
+ XXXX
+ XXXX
+ XXXX
+ XXXX
+
+
+
+ B
+ XXXX
+ XXXX
+ XXXX
+ XXXX
+ XXXX
+
+
+ 1.
+ XXXX
+
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXXXXXX
+
XXXXXXXX
+
XXXXXXXX
+ XXXX
+
XXXX
+
+ 2.
+ XXXX
+
XXXXXXXX
+
XXXXXXXX
+
XXXXXXXX
+
XXXX
+
+ XXXX
+
XXXX
XXXX
XXXXXXXX
+
XXXXXXXX
+
XXXX
+
+ RRRRRR
+
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXXXXXX
+
XXXXXXXX
+
XXXX
+
+ 3.
+ XXXX1
+
XXXXXXXX
+
XXXXXXXX
+
XXXX
+
+
+EOD;
+
+$pdf->writeHTML($tbl, true, false, false, false, '');
+
+$pdf->writeHTML($tbl, true, false, false, false, '');
+
+// -----------------------------------------------------------------------------
+
+// NON-BREAKING TABLE (nobr="true")
+
+$tbl = <<4.
+ XXXX
+
XXXXXXXX
+
XXXXXXXX
+
XXXXXXXX
+
XXXX
+
+ NON-BREAKING TABLE
+
+
+ 1-1
+ 1-2
+ 1-3
+
+
+ 2-1
+ 3-2
+ 3-3
+
+
+
+EOD;
+
+$pdf->writeHTML($tbl, true, false, false, false, '');
+
+// -----------------------------------------------------------------------------
+
+// NON-BREAKING ROWS (nobr="true")
+
+$tbl = <<3-1
+ 3-2
+ 3-3
+
+
+ NON-BREAKING ROWS
+
+
+ ROW 1
+
COLUMN 1ROW 1
+
COLUMN 2ROW 1
+
COLUMN 3
+
+ ROW 2
+
COLUMN 1ROW 2
+
COLUMN 2ROW 2
+
COLUMN 3
+
+
+EOD;
+
+$pdf->writeHTML($tbl, true, false, false, false, '');
+
+// -----------------------------------------------------------------------------
+
+//Close and output PDF document
+$pdf->Output('example_048.pdf', 'I');
+
+//============================================================+
+// END OF FILE
+//============================================================+
diff --git a/examples/example_049.php b/examples/example_049.php
new file mode 100755
index 0000000..7a764fb
--- /dev/null
+++ b/examples/example_049.php
@@ -0,0 +1,126 @@
+SetCreator(PDF_CREATOR);
+$pdf->SetAuthor('Nicola Asuni');
+$pdf->SetTitle('TCPDF Example 049');
+$pdf->SetSubject('TCPDF Tutorial');
+$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
+
+// set default header data
+$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 049', PDF_HEADER_STRING);
+
+// set header and footer fonts
+$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
+$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
+
+// set default monospaced font
+$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
+
+// set margins
+$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
+$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
+$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
+
+// set auto page breaks
+$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
+
+// set image scale factor
+$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
+
+// set some language-dependent strings (optional)
+if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
+ require_once(dirname(__FILE__).'/lang/eng.php');
+ $pdf->setLanguageArray($l);
+}
+
+// ---------------------------------------------------------
+
+// set font
+$pdf->SetFont('helvetica', '', 10);
+
+// add a page
+$pdf->AddPage();
+
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+
+IMPORTANT:
+If you are printing user-generated content, tcpdf tag can be unsafe.
+You can disable this tag by setting to false the K_TCPDF_CALLS_IN_HTML
+constant on TCPDF configuration file.
+
+For security reasons, the parameters for the 'params' attribute of TCPDF
+tag must be prepared as an array and encoded with the
+serializeTCPDFtagParameters() method (see the example below).
+
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+
+$html = 'ROW 3
+
COLUMN 1ROW 3
+
COLUMN 2ROW 3
+
COLUMN 3Test TCPDF Methods in HTML
+IMPORTANT:
+If you are using user-generated content, the tcpdf tag can be unsafe.
+You can disable this tag by setting to false the K_TCPDF_CALLS_IN_HTML constant on TCPDF configuration file.
+write1DBarcode method in HTML
';
+
+$params = $pdf->serializeTCPDFtagParameters(array('CODE 39', 'C39', '', '', 80, 30, 0.4, array('position'=>'S', 'border'=>true, 'padding'=>4, 'fgcolor'=>array(0,0,0), 'bgcolor'=>array(255,255,255), 'text'=>true, 'font'=>'helvetica', 'fontsize'=>8, 'stretchtext'=>4), 'N'));
+$html .= 'Graphic Functions
';
+
+$params = $pdf->serializeTCPDFtagParameters(array(0));
+$html .= '
To validate this signature you have to load the tcpdf.fdf on the Arobat Reader to add the certificate to List of Trusted Identities.
For more information check the source code of this example and the source code documentation for the setSignature() method.
www.tcpdf.org';
+$pdf->writeHTML($text, true, 0, true, 0);
+
+// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+// *** set signature appearance ***
+
+// create content for signature (image and/or text)
+$pdf->Image('images/tcpdf_signature.png', 180, 60, 15, 15, 'PNG');
+
+// define active area for signature appearance
+$pdf->setSignatureAppearance(180, 60, 15, 15);
+
+// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+// *** set an empty signature appearance ***
+$pdf->addEmptySignatureAppearance(180, 80, 15, 15);
+
+// ---------------------------------------------------------
+
+//Close and output PDF document
+$pdf->Output('example_052.pdf', 'D');
+
+//============================================================+
+// END OF FILE
+//============================================================+
diff --git a/examples/example_053.php b/examples/example_053.php
new file mode 100755
index 0000000..8c784d5
--- /dev/null
+++ b/examples/example_053.php
@@ -0,0 +1,108 @@
+SetCreator(PDF_CREATOR);
+$pdf->SetAuthor('Nicola Asuni');
+$pdf->SetTitle('TCPDF Example 053');
+$pdf->SetSubject('TCPDF Tutorial');
+$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
+
+// set default header data
+$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 053', PDF_HEADER_STRING);
+
+// set header and footer fonts
+$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
+$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
+
+// set default monospaced font
+$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
+
+// set margins
+$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
+$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
+$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
+
+// set auto page breaks
+$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
+
+// set image scale factor
+$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
+
+// set some language-dependent strings (optional)
+if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
+ require_once(dirname(__FILE__).'/lang/eng.php');
+ $pdf->setLanguageArray($l);
+}
+
+// ---------------------------------------------------------
+
+// set font
+$pdf->SetFont('times', '', 14);
+
+// add a page
+$pdf->AddPage();
+
+// print a some of text
+$text = 'This is an example of JavaScript usage on PDF documents.
For more information check the source code of this example, the source code documentation for the IncludeJS() method and the JavaScript for Acrobat API Reference guide.
www.tcpdf.org';
+$pdf->writeHTML($text, true, 0, true, 0);
+
+// write some JavaScript code
+$js = <<
';
+$bookmark_templates[1] = '#TOC_DESCRIPTION# #TOC_PAGE_NUMBER#
';
+$bookmark_templates[2] = ' #TOC_DESCRIPTION# #TOC_PAGE_NUMBER#
';
+// add other bookmark level templates here ...
+
+// add table of content at page 1
+// (check the example n. 45 for a text-only TOC
+$pdf->addHTMLTOC(1, 'INDEX', $bookmark_templates, true, 'B', array(128,0,0));
+
+// end of TOC page
+$pdf->endTOCPage();
+
+// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
+
+// ---------------------------------------------------------
+
+//Close and output PDF document
+$pdf->Output('example_059.pdf', 'D');
+
+//============================================================+
+// END OF FILE
+//============================================================+
diff --git a/examples/example_060.php b/examples/example_060.php
new file mode 100755
index 0000000..03bad28
--- /dev/null
+++ b/examples/example_060.php
@@ -0,0 +1,108 @@
+SetCreator(PDF_CREATOR);
+$pdf->SetAuthor('Nicola Asuni');
+$pdf->SetTitle('TCPDF Example 060');
+$pdf->SetSubject('TCPDF Tutorial');
+$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
+
+// set default header data
+$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 060', PDF_HEADER_STRING);
+
+// set header and footer fonts
+$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
+$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
+
+// set default monospaced font
+$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
+
+// set margins
+$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
+$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
+$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
+
+// set auto page breaks
+$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
+
+// set image scale factor
+$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
+
+// set some language-dependent strings (optional)
+if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
+ require_once(dirname(__FILE__).'/lang/eng.php');
+ $pdf->setLanguageArray($l);
+}
+
+// set font
+$pdf->SetFont('helvetica', '', 20);
+
+// ---------------------------------------------------------
+
+// set page format (read source code documentation for further information)
+$page_format = array(
+ 'MediaBox' => array ('llx' => 0, 'lly' => 0, 'urx' => 210, 'ury' => 297),
+ 'CropBox' => array ('llx' => 0, 'lly' => 0, 'urx' => 210, 'ury' => 297),
+ 'BleedBox' => array ('llx' => 5, 'lly' => 5, 'urx' => 205, 'ury' => 292),
+ 'TrimBox' => array ('llx' => 10, 'lly' => 10, 'urx' => 200, 'ury' => 287),
+ 'ArtBox' => array ('llx' => 15, 'lly' => 15, 'urx' => 195, 'ury' => 282),
+ 'Dur' => 3,
+ 'trans' => array(
+ 'D' => 1.5,
+ 'S' => 'Split',
+ 'Dm' => 'V',
+ 'M' => 'O'
+ ),
+ 'Rotate' => 90,
+ 'PZ' => 1,
+);
+
+// Check the example n. 29 for viewer preferences
+
+// add first page ---
+$pdf->AddPage('P', $page_format, false, false);
+$pdf->Cell(0, 12, 'First Page', 1, 1, 'C');
+
+// add second page ---
+$page_format['Rotate'] = 270;
+$pdf->AddPage('P', $page_format, false, false);
+$pdf->Cell(0, 12, 'Second Page', 1, 1, 'C');
+
+// ---------------------------------------------------------
+
+//Close and output PDF document
+$pdf->Output('example_060.pdf', 'I');
+
+//============================================================+
+// END OF FILE
+//============================================================+
diff --git a/examples/example_061.php b/examples/example_061.php
new file mode 100755
index 0000000..13e18c2
--- /dev/null
+++ b/examples/example_061.php
@@ -0,0 +1,264 @@
+SetCreator(PDF_CREATOR);
+$pdf->SetAuthor('Nicola Asuni');
+$pdf->SetTitle('TCPDF Example 061');
+$pdf->SetSubject('TCPDF Tutorial');
+$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
+
+// set default header data
+$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 061', PDF_HEADER_STRING);
+
+// set header and footer fonts
+$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
+$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
+
+// set default monospaced font
+$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
+
+// set margins
+$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
+$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
+$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
+
+// set auto page breaks
+$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
+
+// set image scale factor
+$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
+
+// set some language-dependent strings (optional)
+if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
+ require_once(dirname(__FILE__).'/lang/eng.php');
+ $pdf->setLanguageArray($l);
+}
+
+// ---------------------------------------------------------
+
+// set font
+$pdf->SetFont('helvetica', '', 10);
+
+// add a page
+$pdf->AddPage();
+
+/* NOTE:
+ * *********************************************************
+ * You can load external XHTML using :
+ *
+ * $html = file_get_contents('/path/to/your/file.html');
+ *
+ * External CSS files will be automatically loaded.
+ * Sometimes you need to fix the path of the external CSS.
+ * *********************************************************
+ */
+
+// define some HTML content with style
+$html = << #TOC_DESCRIPTION# #TOC_PAGE_NUMBER# Example of XHTML + CSS
+
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
+
text-transform LOWERCASE Lorem ipsum dolor sit amet, consectetur adipiscing elit.
+
text-transform uppercase Lorem ipsum dolor sit amet, consectetur adipiscing elit.
+
text-transform cAPITALIZE Lorem ipsum dolor sit amet, consectetur adipiscing elit.
+
+
+
+
+EOF;
+
+// output the HTML content
+$pdf->writeHTML($html, true, false, true, false, '');
+
+// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+// add a page
+$pdf->AddPage();
+
+$html = '
+
+
+ No.
+ XXXX
+ XXXX
+ XXXX
+ XXXX
+ XXXX
+
+
+ 1.
+ XXXX
+
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXXXXXX
+
XXXXXXXX
+
XXXXXXXX
+ XXXX
+
XXXX
+
+ 2.
+ XXXX
+
XXXXXXXX
+
XXXXXXXX
+
XXXXXXXX
+
XXXX
+
+ XXXX
+
XXXX
XXXX
XXXXXXXX
+
XXXXXXXX
+
XXXX
+
+ XXXX
+
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXXXXXX
+
XXXXXXXX
+
XXXX
+
+ 3.
+ XXXX
+
XXXXXXXX
+
XXXXXXXX
+
XXXX
+
+4.
+ XXXX
+
XXXXXXXX
+
XXXXXXXX
+
XXXXXXXX
+
XXXXHTML TIPS & TRICKS
+
+REMOVE CELL PADDING
+$pdf->SetCellPadding(0);
+This is used to remove any additional vertical space inside a single cell of text.
+
+REMOVE TAG TOP AND BOTTOM MARGINS
+$tagvs = array(\'p\' => array(0 => array(\'h\' => 0, \'n\' => 0), 1 => array(\'h\' => 0, \'n\' => 0)));
+$pdf->setHtmlVSpace($tagvs);
+Since the CSS margin command is not yet implemented on TCPDF, you need to set the spacing of block tags using the following method.
+
+SET LINE HEIGHT
+$pdf->setCellHeightRatio(1.25);
+You can use the following method to fine tune the line height (the number is a percentage relative to font height).
+
+CHANGE THE PIXEL CONVERSION RATIO
+$pdf->setImageScale(0.47);
+This is used to adjust the conversion ratio between pixels and document units. Increase the value to get smaller objects.
+Since you are using pixel unit, this method is important to set theright zoom factor.
+Suppose that you want to print a web page larger 1024 pixels to fill all the available page width.
+An A4 page is larger 210mm equivalent to 8.268 inches, if you subtract 13mm (0.512") of margins for each side, the remaining space is 184mm (7.244 inches).
+The default resolution for a PDF document is 300 DPI (dots per inch), so you have 7.244 * 300 = 2173.2 dots (this is the maximum number of points you can print at 300 DPI for the given width).
+The conversion ratio is approximatively 1024 / 2173.2 = 0.47 px/dots
+If the web page is larger 1280 pixels, on the same A4 page the conversion ratio to use is 1280 / 2173.2 = 0.59 pixels/dots';
+
+// output the HTML content
+$pdf->writeHTML($html, true, false, true, false, '');
+
+// reset pointer to the last page
+$pdf->lastPage();
+
+// ---------------------------------------------------------
+
+//Close and output PDF document
+$pdf->Output('example_061.pdf', 'I');
+
+//============================================================+
+// END OF FILE
+//============================================================+
diff --git a/examples/example_062.php b/examples/example_062.php
new file mode 100755
index 0000000..45fc25d
--- /dev/null
+++ b/examples/example_062.php
@@ -0,0 +1,140 @@
+SetCreator(PDF_CREATOR);
+$pdf->SetAuthor('Nicola Asuni');
+$pdf->SetTitle('TCPDF Example 062');
+$pdf->SetSubject('TCPDF Tutorial');
+$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
+
+// set default header data
+$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 062', PDF_HEADER_STRING);
+
+// set header and footer fonts
+$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
+$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
+
+// set default monospaced font
+$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
+
+// set margins
+$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
+$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
+$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
+
+// set auto page breaks
+$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
+
+// set image scale factor
+$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
+
+// set some language-dependent strings (optional)
+if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
+ require_once(dirname(__FILE__).'/lang/eng.php');
+ $pdf->setLanguageArray($l);
+}
+
+// ---------------------------------------------------------
+
+// set font
+$pdf->SetFont('helvetica', 'B', 20);
+
+// add a page
+$pdf->AddPage();
+
+$pdf->Write(0, 'XObject Templates', '', 0, 'C', 1, 0, false, false, 0);
+
+/*
+ * An XObject Template is a PDF block that is a self-contained
+ * description of any sequence of graphics objects (including path
+ * objects, text objects, and sampled images).
+ * An XObject Template may be painted multiple times, either on
+ * several pages or at several locations on the same page and produces
+ * the same results each time, subject only to the graphics state at
+ * the time it is invoked.
+ */
+
+
+// start a new XObject Template and set transparency group option
+$template_id = $pdf->startTemplate(60, 60, true);
+
+// create Template content
+// ...................................................................
+//Start Graphic Transformation
+$pdf->StartTransform();
+
+// set clipping mask
+$pdf->StarPolygon(30, 30, 29, 10, 3, 0, 1, 'CNZ');
+
+// draw jpeg image to be clipped
+$pdf->Image('images/image_demo.jpg', 0, 0, 60, 60, '', '', '', true, 72, '', false, false, 0, false, false, false);
+
+//Stop Graphic Transformation
+$pdf->StopTransform();
+
+$pdf->SetXY(0, 0);
+
+$pdf->SetFont('times', '', 40);
+
+$pdf->SetTextColor(255, 0, 0);
+
+// print a text
+$pdf->Cell(60, 60, 'Template', 0, 0, 'C', false, '', 0, false, 'T', 'M');
+// ...................................................................
+
+// end the current Template
+$pdf->endTemplate();
+
+
+// print the selected Template various times using various transparencies
+
+$pdf->SetAlpha(0.4);
+$pdf->printTemplate($template_id, 15, 50, 20, 20, '', '', false);
+
+$pdf->SetAlpha(0.6);
+$pdf->printTemplate($template_id, 27, 62, 40, 40, '', '', false);
+
+$pdf->SetAlpha(0.8);
+$pdf->printTemplate($template_id, 55, 85, 60, 60, '', '', false);
+
+$pdf->SetAlpha(1);
+$pdf->printTemplate($template_id, 95, 125, 80, 80, '', '', false);
+
+// ---------------------------------------------------------
+
+//Close and output PDF document
+$pdf->Output('example_062.pdf', 'I');
+
+//============================================================+
+// END OF FILE
+//============================================================+
diff --git a/examples/example_063.php b/examples/example_063.php
new file mode 100755
index 0000000..de13515
--- /dev/null
+++ b/examples/example_063.php
@@ -0,0 +1,131 @@
+SetCreator(PDF_CREATOR);
+$pdf->SetAuthor('Nicola Asuni');
+$pdf->SetTitle('TCPDF Example 063');
+$pdf->SetSubject('TCPDF Tutorial');
+$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
+
+// set default header data
+$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 063', PDF_HEADER_STRING);
+
+// set header and footer fonts
+$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
+$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
+
+// set default monospaced font
+$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
+
+// set margins
+$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
+$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
+$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
+
+// set auto page breaks
+$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
+
+// set image scale factor
+$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
+
+// set some language-dependent strings (optional)
+if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
+ require_once(dirname(__FILE__).'/lang/eng.php');
+ $pdf->setLanguageArray($l);
+}
+
+// ---------------------------------------------------------
+
+// set font
+$pdf->SetFont('helvetica', 'B', 16);
+
+// add a page
+$pdf->AddPage();
+
+$pdf->Write(0, 'Example of Text Stretching and Spacing (tracking)', '', 0, 'L', true, 0, false, false, 0);
+$pdf->Ln(5);
+
+// create several cells to display all cases of stretching and spacing combinations.
+
+$fonts = array('times', 'dejavuserif');
+$alignments = array('L' => 'LEFT', 'C' => 'CENTER', 'R' => 'RIGHT', 'J' => 'JUSTIFY');
+
+
+// Test all cases using direct stretching/spacing methods
+foreach ($fonts as $fkey => $font) {
+ $pdf->SetFont($font, '', 14);
+ foreach ($alignments as $align_mode => $align_name) {
+ for ($stretching = 90; $stretching <= 110; $stretching += 10) {
+ for ($spacing = -0.254; $spacing <= 0.254; $spacing += 0.254) {
+ $pdf->setFontStretching($stretching);
+ $pdf->setFontSpacing($spacing);
+ $txt = $align_name.' | Stretching = '.$stretching.'% | Spacing = '.sprintf('%+.3F', $spacing).'mm';
+ $pdf->Cell(0, 0, $txt, 1, 1, $align_mode);
+ }
+ }
+ }
+ $pdf->AddPage();
+}
+
+
+// Test all cases using CSS stretching/spacing properties
+foreach ($fonts as $fkey => $font) {
+ $pdf->SetFont($font, '', 11);
+ foreach ($alignments as $align_mode => $align_name) {
+ for ($stretching = 90; $stretching <= 110; $stretching += 10) {
+ for ($spacing = -0.254; $spacing <= 0.254; $spacing += 0.254) {
+ $html = ''.$align_name.' | Stretching = '.$stretching.'% | Spacing = '.sprintf('%+.3F', $spacing).'mm
Lorem ipsum dolor sit amet, consectetur adipiscing elit. In sed imperdiet lectus. Phasellus quis velit velit, non condimentum quam. Sed neque urna, ultrices ac volutpat vel, laoreet vitae augue. Sed vel velit erat. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.';
+ $pdf->writeHTMLCell(0, 0, '', '', $html, 1, 1, false, true, $align_mode, false);
+ }
+ }
+ if (!(($fkey == 1) AND ($align_mode == 'J'))) {
+ $pdf->AddPage();
+ }
+ }
+}
+
+
+// reset font stretching
+$pdf->setFontStretching(100);
+
+// reset font spacing
+$pdf->setFontSpacing(0);
+
+// ---------------------------------------------------------
+
+//Close and output PDF document
+$pdf->Output('example_063.pdf', 'I');
+
+//============================================================+
+// END OF FILE
+//============================================================+
diff --git a/examples/example_064.php b/examples/example_064.php
new file mode 100755
index 0000000..39da071
--- /dev/null
+++ b/examples/example_064.php
@@ -0,0 +1,176 @@
+SetCreator(PDF_CREATOR);
+$pdf->SetAuthor('Nicola Asuni');
+$pdf->SetTitle('TCPDF Example 064');
+$pdf->SetSubject('TCPDF Tutorial');
+$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
+
+// set default header data
+$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 064', PDF_HEADER_STRING);
+
+// set header and footer fonts
+$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
+$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
+
+// set default monospaced font
+$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
+
+// set margins
+$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
+$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
+$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
+
+// set auto page breaks
+$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
+
+// set image scale factor
+$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
+
+// set some language-dependent strings (optional)
+if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
+ require_once(dirname(__FILE__).'/lang/eng.php');
+ $pdf->setLanguageArray($l);
+}
+
+// ---------------------------------------------------------
+
+// set font
+$pdf->SetFont('helvetica', '', 8);
+
+
+// define some html content for testing
+$txt = '9i<6@8uMKZh2cKxFD(kZI>g2{uS;v
!N-7WdBj58MOe&F$w(Z*ZA^;QlL_miEbR!64z5mM*RCnv
z1jK|{3{ELCG
71Ui-hNh`>ISD}U
zdat2_864E;exsZ_sH*!(*@%g_gM%5f`H9f1t!ZhjKY^Q0%jlLrHdnEeg2PqR++9?A
zlancD`PEYIYXy3sw--!0>q%LNnT+|jX04wJMRZ5=tAJ;>YA1BdA9E{>@sw_+O+^On
zRc>8R=GG9w@Mo8Tsk79qr{%L`To;0}*Cs}%p-7LnTHbP5s
52LKBcH`JJghOzM^W
zBnVQ@sINK9qqw}_+x(6MJwA!8T~jJp#!-Uozs}6jIeeJZ_qw_cuPWN@R#3n^dCbh%
zaRYL4&%ehle!uRFml0Rkf^ms;Yu40BRS-u&l*p$pAG77O#^hh^UkZO&yKzWpPs6=M
z%$!CkWUoRD=7Fm3