From dda292d19c88e01ad01f6f7d33ed3c31d7f47247 Mon Sep 17 00:00:00 2001 From: nicolaasuni Date: Fri, 21 May 2010 18:47:01 +0200 Subject: [PATCH] 5.0.014 --- CHANGELOG.TXT | 6 + README.TXT | 4 +- cache/chapter_demo_1.txt | 29 +- cache/chapter_demo_2.txt | 44 +- doc/classtrees_com-tecnick-tcpdf.html | 2 +- doc/com-tecnick-tcpdf/QRcode.html | 2 +- doc/com-tecnick-tcpdf/TCPDF.html | 820 ++++++++++-------- doc/com-tecnick-tcpdf/TCPDF2DBarcode.html | 2 +- doc/com-tecnick-tcpdf/TCPDFBarcode.html | 2 +- doc/com-tecnick-tcpdf/_2dbarcodes.php.html | 2 +- doc/com-tecnick-tcpdf/_barcodes.php.html | 2 +- .../_config---tcpdf_config.php.html | 2 +- doc/com-tecnick-tcpdf/_htmlcolors.php.html | 2 +- doc/com-tecnick-tcpdf/_qrcode.php.html | 2 +- doc/com-tecnick-tcpdf/_tcpdf.php.html | 6 +- doc/com-tecnick-tcpdf/_unicode_data.php.html | 2 +- doc/elementindex.html | 10 +- doc/elementindex_com-tecnick-tcpdf.html | 10 +- doc/errors.html | 2 +- doc/index.html | 2 +- doc/li_com-tecnick-tcpdf.html | 2 +- examples/example_001.php | 44 +- examples/example_002.php | 27 +- examples/example_003.php | 41 +- examples/example_004.php | 27 +- examples/example_005.php | 50 +- examples/example_006.php | 147 +++- examples/example_007.php | 48 +- examples/example_008.php | 27 +- examples/example_009.php | 22 +- examples/example_010.php | 12 +- examples/example_011.php | 26 +- examples/example_012.php | 4 +- examples/example_013.php | 158 ++-- examples/example_014.php | 20 +- examples/example_015.php | 27 +- examples/example_016.php | 18 +- examples/example_017.php | 52 +- examples/example_018.php | 33 +- examples/example_019.php | 29 +- examples/example_020.php | 52 +- examples/example_021.php | 20 +- examples/example_022.php | 66 +- examples/example_023.php | 39 +- examples/example_024.php | 50 +- examples/example_025.php | 27 +- examples/example_026.php | 4 +- examples/example_027.php | 6 +- examples/example_028.php | 16 +- examples/example_029.php | 28 +- examples/example_030.php | 84 +- examples/example_031.php | 37 +- examples/example_032.php | 39 +- examples/example_033.php | 33 +- examples/example_034.php | 26 +- examples/example_035.php | 21 +- examples/example_036.php | 25 +- examples/example_037.php | 26 +- examples/example_038.php | 30 +- examples/example_039.php | 31 +- examples/example_040.php | 27 +- examples/example_041.php | 26 +- examples/example_042.php | 27 +- examples/example_043.php | 20 +- examples/example_044.php | 34 +- examples/example_045.php | 22 +- examples/example_046.php | 14 +- examples/example_047.php | 35 +- examples/example_048.php | 30 +- examples/example_049.php | 14 +- examples/example_050.php | 4 +- examples/example_051.php | 26 +- examples/example_052.php | 8 +- examples/example_053.php | 20 +- examples/example_054.php | 18 +- examples/example_055.php | 24 +- examples/example_056.php | 55 +- examples/example_057.php | 26 +- examples/example_058.php | 11 +- examples/example_059.php | 9 +- examples/example_060.php | 10 +- examples/index.php | 2 +- tcpdf.php | 235 +++-- 83 files changed, 1888 insertions(+), 1236 deletions(-) diff --git a/CHANGELOG.TXT b/CHANGELOG.TXT index 1340912..c27d3ed 100755 --- a/CHANGELOG.TXT +++ b/CHANGELOG.TXT @@ -1,3 +1,9 @@ +5.0.014 (2010-05-21) + - A problem on color and style of HTML links was fixed. + - A bug relative to gradients was fixed. + - The getStringHeight() method was added and getNumLines() method was improved. + - All examples were updated. + 5.0.013 (2010-05-19) - A bug related to page-breaks and table cells was fixed. diff --git a/README.TXT b/README.TXT index dbf88ab..53d6053 100755 --- a/README.TXT +++ b/README.TXT @@ -8,8 +8,8 @@ http://sourceforge.net/donate/index.php?group_id=128076 ------------------------------------------------------------ Name: TCPDF -Version: 5.0.013 -Release date: 2010-05-19 +Version: 5.0.014 +Release date: 2010-05-21 Author: Nicola Asuni Copyright (c) 2001-2010: diff --git a/cache/chapter_demo_1.txt b/cache/chapter_demo_1.txt index 422eb43..4025de9 100755 --- a/cache/chapter_demo_1.txt +++ b/cache/chapter_demo_1.txt @@ -1,10 +1,19 @@ -The year 1866 was marked by a bizarre development, an unexplained and downright inexplicable phenomenon that surely no one has forgotten. Without getting into those rumors that upset civilians in the seaports and deranged the public mind even far inland, it must be said that professional seamen were especially alarmed. Traders, shipowners, captains of vessels, skippers, and master mariners from Europe and America, naval officers from every country, and at their heels the various national governments on these two continents, were all extremely disturbed by the business. -In essence, over a period of time several ships had encountered "an enormous thing" at sea, a long spindle-shaped object, sometimes giving off a phosphorescent glow, infinitely bigger and faster than any whale. -The relevant data on this apparition, as recorded in various logbooks, agreed pretty closely as to the structure of the object or creature in question, its unprecedented speed of movement, its startling locomotive power, and the unique vitality with which it seemed to be gifted. If it was a cetacean, it exceeded in bulk any whale previously classified by science. No naturalist, neither Cuvier nor Lacépède, neither Professor Dumeril nor Professor de Quatrefages, would have accepted the existence of such a monster sight unseen -- specifically, unseen by their own scientific eyes. -Striking an average of observations taken at different times -- rejecting those timid estimates that gave the object a length of 200 feet, and ignoring those exaggerated views that saw it as a mile wide and three long--you could still assert that this phenomenal creature greatly exceeded the dimensions of anything then known to ichthyologists, if it existed at all. -Now then, it did exist, this was an undeniable fact; and since the human mind dotes on objects of wonder, you can understand the worldwide excitement caused by this unearthly apparition. As for relegating it to the realm of fiction, that charge had to be dropped. -In essence, on July 20, 1866, the steamer Governor Higginson, from the Calcutta & Burnach Steam Navigation Co., encountered this moving mass five miles off the eastern shores of Australia. Captain Baker at first thought he was in the presence of an unknown reef; he was even about to fix its exact position when two waterspouts shot out of this inexplicable object and sprang hissing into the air some 150 feet. So, unless this reef was subject to the intermittent eruptions of a geyser, the Governor Higginson had fair and honest dealings with some aquatic mammal, until then unknown, that could spurt from its blowholes waterspouts mixed with air and steam. -Similar events were likewise observed in Pacific seas, on July 23 of the same year, by the Christopher Columbus from the West India & Pacific Steam Navigation Co. Consequently, this extraordinary cetacean could transfer itself from one locality to another with startling swiftness, since within an interval of just three days, the Governor Higginson and the Christopher Columbus had observed it at two positions on the charts separated by a distance of more than 700 nautical leagues. -Fifteen days later and 2,000 leagues farther, the Helvetia from the Compagnie Nationale and the Shannon from the Royal Mail line, running on opposite tacks in that part of the Atlantic lying between the United States and Europe, respectively signaled each other that the monster had been sighted in latitude 42 degrees 15' north and longitude 60 degrees 35' west of the meridian of Greenwich. From their simultaneous observations, they were able to estimate the mammal's minimum length at more than 350 English feet; this was because both the Shannon and the Helvetia were of smaller dimensions, although each measured 100 meters stem to stern. Now then, the biggest whales, those rorqual whales that frequent the waterways of the Aleutian Islands, have never exceeded a length of 56 meters--if they reach even that. -One after another, reports arrived that would profoundly affect public opinion: new observations taken by the transatlantic liner Pereire, the Inman line's Etna running afoul of the monster, an official report drawn up by officers on the French frigate Normandy, dead-earnest reckonings obtained by the general staff of Commodore Fitz-James aboard the Lord Clyde. In lighthearted countries, people joked about this phenomenon, but such serious, practical countries as England, America, and Germany were deeply concerned. -In every big city the monster was the latest rage; they sang about it in the coffee houses, they ridiculed it in the newspapers, they dramatized it in the theaters. The tabloids found it a fine opportunity for hatching all sorts of hoaxes. In those newspapers short of copy, you saw the reappearance of every gigantic imaginary creature, from "Moby Dick," that dreadful white whale from the High Arctic regions, to the stupendous kraken whose tentacles could entwine a 500-ton craft and drag it into the ocean depths. They even reprinted reports from ancient times: the views of Aristotle and Pliny accepting the existence of such monsters, then the Norwegian stories of Bishop Pontoppidan, the narratives of Paul Egede, and finally the reports of Captain Harrington -- whose good faith is above suspicion--in which he claims he saw, while aboard the Castilian in 1857, one of those enormous serpents that, until then, had frequented only the seas of France's old extremist newspaper, The Constitutionalist. +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. + +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/cache/chapter_demo_2.txt b/cache/chapter_demo_2.txt index 6f7165c..cd7bfe6 100755 --- a/cache/chapter_demo_2.txt +++ b/cache/chapter_demo_2.txt @@ -1,23 +1,23 @@ -During the period in which these developments were occurring, I had returned from a scientific undertaking organized to explore the Nebraska badlands in the United States. In my capacity as Assistant Professor at the Paris Museum of Natural History, I had been attached to this expedition by the French government. After spending six months in Nebraska, I arrived in New York laden with valuable collections near the end of March. My departure for France was set for early May. In the meantime, then, I was busy classifying my mineralogical, botanical, and zoological treasures when that incident took place with the Scotia. -I was perfectly abreast of this question, which was the big news of the day, and how could I not have been? I had read and reread every American and European newspaper without being any farther along. This mystery puzzled me. Finding it impossible to form any views, I drifted from one extreme to the other. Something was out there, that much was certain, and any doubting Thomas was invited to place his finger on the Scotia's wound. -When I arrived in New York, the question was at the boiling point. The hypothesis of a drifting islet or an elusive reef, put forward by people not quite in their right minds, was completely eliminated. And indeed, unless this reef had an engine in its belly, how could it move about with such prodigious speed? -Also discredited was the idea of a floating hull or some other enormous wreckage, and again because of this speed of movement. -So only two possible solutions to the question were left, creating two very distinct groups of supporters: on one side, those favoring a monster of colossal strength; on the other, those favoring an "underwater boat" of tremendous motor power. -Now then, although the latter hypothesis was completely admissible, it couldn't stand up to inquiries conducted in both the New World and the Old. That a private individual had such a mechanism at his disposal was less than probable. Where and when had he built it, and how could he have built it in secret? -Only some government could own such an engine of destruction, and in these disaster-filled times, when men tax their ingenuity to build increasingly powerful aggressive weapons, it was possible that, unknown to the rest of the world, some nation could have been testing such a fearsome machine. The Chassepot rifle led to the torpedo, and the torpedo has led to this underwater battering ram, which in turn will lead to the world putting its foot down. At least I hope it will. -But this hypothesis of a war machine collapsed in the face of formal denials from the various governments. Since the public interest was at stake and transoceanic travel was suffering, the sincerity of these governments could not be doubted. Besides, how could the assembly of this underwater boat have escaped public notice? Keeping a secret under such circumstances would be difficult enough for an individual, and certainly impossible for a nation whose every move is under constant surveillance by rival powers. -So, after inquiries conducted in England, France, Russia, Prussia, Spain, Italy, America, and even Turkey, the hypothesis of an underwater Monitor was ultimately rejected. -After I arrived in New York, several people did me the honor of consulting me on the phenomenon in question. In France I had published a two-volume work, in quarto, entitled The Mysteries of the Great Ocean Depths. Well received in scholarly circles, this book had established me as a specialist in this pretty obscure field of natural history. My views were in demand. As long as I could deny the reality of the business, I confined myself to a flat "no comment." But soon, pinned to the wall, I had to explain myself straight out. And in this vein, "the honorable Pierre Aronnax, Professor at the Paris Museum," was summoned by The New York Herald to formulate his views no matter what. -I complied. Since I could no longer hold my tongue, I let it wag. I discussed the question in its every aspect, both political and scientific, and this is an excerpt from the well-padded article I published in the issue of April 30. +

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.

-"Therefore," I wrote, "after examining these different hypotheses one by one, we are forced, every other supposition having been refuted, to accept the existence of an extremely powerful marine animal. -"The deepest parts of the ocean are totally unknown to us. No soundings have been able to reach them. What goes on in those distant depths? What creatures inhabit, or could inhabit, those regions twelve or fifteen miles beneath the surface of the water? What is the constitution of these animals? It's almost beyond conjecture. -"However, the solution to this problem submitted to me can take the form of a choice between two alternatives. -"Either we know every variety of creature populating our planet, or we do not. -"If we do not know every one of them, if nature still keeps ichthyological secrets from us, nothing is more admissible than to accept the existence of fish or cetaceans of new species or even new genera, animals with a basically 'cast-iron' constitution that inhabit strata beyond the reach of our soundings, and which some development or other, an urge or a whim if you prefer, can bring to the upper level of the ocean for long intervals. -"If, on the other hand, we do know every living species, we must look for the animal in question among those marine creatures already cataloged, and in this event I would be inclined to accept the existence of a giant narwhale. -"The common narwhale, or sea unicorn, often reaches a length of sixty feet. Increase its dimensions fivefold or even tenfold, then give this cetacean a strength in proportion to its size while enlarging its offensive weapons, and you have the animal we're looking for. It would have the proportions determined by the officers of the Shannon, the instrument needed to perforate the Scotia, and the power to pierce a steamer's hull. -"In essence, the narwhale is armed with a sort of ivory sword, or lance, as certain naturalists have expressed it. It's a king-sized tooth as hard as steel. Some of these teeth have been found buried in the bodies of baleen whales, which the narwhale attacks with invariable success. Others have been wrenched, not without difficulty, from the undersides of vessels that narwhales have pierced clean through, as a gimlet pierces a wine barrel. The museum at the Faculty of Medicine in Paris owns one of these tusks with a length of 2.25 meters and a width at its base of forty-eight centimeters! -"All right then! Imagine this weapon to be ten times stronger and the animal ten times more powerful, launch it at a speed of twenty miles per hour, multiply its mass times its velocity, and you get just the collision we need to cause the specified catastrophe. -"So, until information becomes more abundant, I plump for a sea unicorn of colossal dimensions, no longer armed with a mere lance but with an actual spur, like ironclad frigates or those warships called 'rams,' whose mass and motor power it would possess simultaneously. -"This inexplicable phenomenon is thus explained away unless it's something else entirely, which, despite everything that has been sighted, studied, explored and experienced, is still possible!" + + +

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/doc/classtrees_com-tecnick-tcpdf.html b/doc/classtrees_com-tecnick-tcpdf.html index 1dfbef3..3d8c315 100644 --- a/doc/classtrees_com-tecnick-tcpdf.html +++ b/doc/classtrees_com-tecnick-tcpdf.html @@ -55,7 +55,7 @@

- Documentation generated on Wed, 19 May 2010 21:31:17 +0200 by phpDocumentor 1.4.3 + Documentation generated on Fri, 21 May 2010 18:46:51 +0200 by phpDocumentor 1.4.3
diff --git a/doc/com-tecnick-tcpdf/QRcode.html b/doc/com-tecnick-tcpdf/QRcode.html index 4f26ddd..195eaae 100644 --- a/doc/com-tecnick-tcpdf/QRcode.html +++ b/doc/com-tecnick-tcpdf/QRcode.html @@ -5548,7 +5548,7 @@ $frame)

- Documentation generated on Wed, 19 May 2010 21:31:18 +0200 by phpDocumentor 1.4.3 + Documentation generated on Fri, 21 May 2010 18:46:52 +0200 by phpDocumentor 1.4.3
diff --git a/doc/com-tecnick-tcpdf/TCPDF.html b/doc/com-tecnick-tcpdf/TCPDF.html index 7c1d79b..4ba12f6 100644 --- a/doc/com-tecnick-tcpdf/TCPDF.html +++ b/doc/com-tecnick-tcpdf/TCPDF.html @@ -80,7 +80,7 @@ Source Location: /tcpdf.php

Version:

@@ -424,6 +424,7 @@ Source Location: /tcpdf.php

  • getRTL
  • getScaleFactor
  • getSpaceString
  • +
  • getStringHeight
  • GetStringWidth
  • getSVGTransformMatrix
  • getTransformationMatrixProduct
  • @@ -713,7 +714,7 @@ This is a PHP class for generating PDF documents without requiring external exte author:  Nicola Asuni - info@tecnick.com - version:  5.0.013 + version:  5.0.014 link:  http://www.tcpdf.org @@ -6878,7 +6879,7 @@ $diskcache = false])
    -

    method AcceptPageBreak [line 4157]

    +

    method AcceptPageBreak [line 4173]

    @@ -6909,7 +6910,7 @@ $diskcache = false])
    -

    method addExtGState [line 12788]

    +

    method addExtGState [line 12895]

    @@ -6957,7 +6958,7 @@ $params)
    -

    method AddFont [line 3657]

    +

    method AddFont [line 3673]

    @@ -7014,7 +7015,7 @@ $fontfile = ''])
    -

    method addHtmlLink [line 8875]

    +

    method addHtmlLink [line 8982]

    @@ -7089,7 +7090,7 @@ $firstblock = false])
    -

    method addHTMLTOC [line 18398]

    +

    method addHTMLTOC [line 18493]

    @@ -7152,7 +7153,7 @@ $correct_align = true])
    -

    method addHTMLVertSpace [line 17150]

    +

    method addHTMLVertSpace [line 17245]

    @@ -7206,7 +7207,7 @@ $firstorlast = false])
    -

    method addJavascriptObject [line 11416]

    +

    method addJavascriptObject [line 11523]

    @@ -7257,7 +7258,7 @@ $onload = false])
    -

    method AddLink [line 3959]

    +

    method AddLink [line 3975]

    @@ -7288,7 +7289,7 @@ $onload = false])
    -

    method AddPage [line 2832]

    +

    method AddPage [line 2848]

    @@ -7348,7 +7349,7 @@ $tocpage = false])
    -

    method AddSpotColor [line 3276]

    +

    method AddSpotColor [line 3292]

    @@ -7414,7 +7415,7 @@ $k)
    -

    method addTOC [line 18248]

    +

    method addTOC [line 18343]

    @@ -7477,7 +7478,7 @@ $toc_name = 'TOC'])
    -

    method addTOCPage [line 2807]

    +

    method addTOCPage [line 2823]

    @@ -7531,7 +7532,7 @@ $keepmargins = false])
    -

    method AliasNbPages [line 12600]

    +

    method AliasNbPages [line 12707]

    @@ -7573,7 +7574,7 @@ $alias = '{nb}'])
    -

    method AliasNumPage [line 12627]

    +

    method AliasNumPage [line 12734]

    @@ -7615,7 +7616,7 @@ $alias = '{pnb}'])
    -

    method Annotation [line 4015]

    +

    method Annotation [line 4031]

    @@ -7690,7 +7691,7 @@ $spaces = 0])
    -

    method Arrow [line 10629]

    +

    method Arrow [line 10736]

    @@ -7768,7 +7769,7 @@ $arm_angle = 15])
    -

    method arrUTF8ToUTF16BE [line 8772]

    +

    method arrUTF8ToUTF16BE [line 8879]

    @@ -7843,7 +7844,7 @@ $setbom = true])
    -

    method Bookmark [line 11294]

    +

    method Bookmark [line 11401]

    @@ -7903,7 +7904,7 @@ $page = ''])
    -

    method Button [line 12303]

    +

    method Button [line 12410]

    @@ -7999,7 +8000,7 @@ $js = false])
    -

    method Cell [line 4241]

    +

    method Cell [line 4257]

    @@ -8107,7 +8108,7 @@ $valign = 'M'])
    -

    method CheckBox [line 12233]

    +

    method CheckBox [line 12340]

    @@ -8197,7 +8198,7 @@ $js = false])
    -

    method checkPageBreak [line 4184]

    +

    method checkPageBreak [line 4200]

    @@ -8251,7 +8252,7 @@ $addpage = true])
    -

    method Circle [line 10317]

    +

    method Circle [line 10424]

    @@ -8350,7 +8351,7 @@ $angend:)
    -

    method Clip [line 13249]

    +

    method Clip [line 13356]

    @@ -8441,7 +8442,7 @@ $h)
    -

    method closeHTMLTagHandler [line 16760]

    +

    method closeHTMLTagHandler [line 16855]

    @@ -8501,7 +8502,7 @@ $dom)
    -

    method colorRegistrationBar [line 12924]

    +

    method colorRegistrationBar [line 13031]

    @@ -8579,7 +8580,7 @@ $colors = 'A,R,G,B,C,M,Y,K'])
    -

    method ComboBox [line 12172]

    +

    method ComboBox [line 12279]

    @@ -8669,7 +8670,7 @@ $js = false])
    -

    method commitTransaction [line 18510]

    +

    method commitTransaction [line 18605]

    @@ -8697,7 +8698,7 @@ $js = false])
    -

    method convertHexStringToString [line 9487]

    +

    method convertHexStringToString [line 9594]

    @@ -8739,7 +8740,7 @@ $bs)
    -

    method convertHTMLColorToDec [line 8908]

    +

    method convertHTMLColorToDec [line 9015]

    @@ -8778,7 +8779,7 @@ $color = '#FFFFFF'])
    -

    method convertStringToHexString [line 9508]

    +

    method convertStringToHexString [line 9615]

    @@ -8823,7 +8824,7 @@ $s)
    -

    method convertSVGtMatrix [line 19445]

    +

    method convertSVGtMatrix [line 19540]

    @@ -8865,7 +8866,7 @@ $tm)
    -

    method CoonsPatchMesh [line 13164]

    +

    method CoonsPatchMesh [line 13271]

    @@ -8973,7 +8974,7 @@ $antialias = false])
    -

    method copyPage [line 18180]

    +

    method copyPage [line 18275]

    @@ -9015,7 +9016,7 @@ $page = 0])
    -

    method cropMark [line 13022]

    +

    method cropMark [line 13129]

    @@ -9087,7 +9088,7 @@ $color = array(0,0,0)])
    -

    method Curve [line 10122]

    +

    method Curve [line 10229]

    @@ -9189,7 +9190,7 @@ $fill_color = array()])
    -

    method deletePage [line 18043]

    +

    method deletePage [line 18138]

    @@ -9231,7 +9232,7 @@ $page)
    -

    method Ellipse [line 10186]

    +

    method Ellipse [line 10293]

    @@ -9351,7 +9352,7 @@ $afinish:)
    -

    method empty_string [line 18564]

    +

    method empty_string [line 18659]

    @@ -9393,7 +9394,7 @@ $str)
    -

    method endPage [line 2852]

    +

    method endPage [line 2868]

    @@ -9435,7 +9436,7 @@ $tocpage = false])
    -

    method endSVGElementHandler [line 20472]

    +

    method endSVGElementHandler [line 20567]

    @@ -9483,7 +9484,7 @@ $name)
    -

    method endTOCPage [line 2817]

    +

    method endTOCPage [line 2833]

    @@ -9553,7 +9554,7 @@ $msg)
    -

    method Footer [line 3099]

    +

    method Footer [line 3115]

    @@ -9578,7 +9579,7 @@ $msg)
    -

    method formatPageNumber [line 12704]

    +

    method formatPageNumber [line 12811]

    @@ -9617,7 +9618,7 @@ $num)
    -

    method formatTOCPageNumber [line 12716]

    +

    method formatTOCPageNumber [line 12823]

    @@ -9659,7 +9660,7 @@ $num)
    -

    method GetAbsX [line 6134]

    +

    method GetAbsX [line 6241]

    @@ -9690,7 +9691,7 @@ $num)
    -

    method getAliasNbPages [line 12612]

    +

    method getAliasNbPages [line 12719]

    @@ -9721,7 +9722,7 @@ $num)
    -

    method getAliasNumPage [line 12640]

    +

    method getAliasNumPage [line 12747]

    @@ -9752,7 +9753,7 @@ $num)
    -

    method getAnnotOptFromJSProp [line 11540]

    +

    method getAnnotOptFromJSProp [line 11647]

    @@ -9797,7 +9798,7 @@ $prop)
    -

    method GetArrStringWidth [line 3560]

    +

    method GetArrStringWidth [line 3576]

    @@ -9866,7 +9867,7 @@ $getarray = false])
    -

    method getBarcode [line 13899]

    +

    method getBarcode [line 14010]

    @@ -9894,7 +9895,7 @@ $getarray = false])
    -

    method getBorderMode [line 4881]

    +

    method getBorderMode [line 4897]

    @@ -9990,7 +9991,7 @@ $pagenum = ''])
    -

    method getBuffer [line 17729]

    +

    method getBuffer [line 17824]

    @@ -10021,7 +10022,7 @@ $pagenum = ''])
    -

    method getCellCode [line 4296]

    +

    method getCellCode [line 4312]

    @@ -10129,7 +10130,7 @@ $valign = 'M'])
    -

    method getCellHeightRatio [line 12884]

    +

    method getCellHeightRatio [line 12991]

    @@ -10157,7 +10158,7 @@ $valign = 'M'])
    -

    method GetCharWidth [line 3596]

    +

    method GetCharWidth [line 3612]

    @@ -10202,7 +10203,7 @@ $char)
    -

    method getEncPermissionsString [line 9525]

    +

    method getEncPermissionsString [line 9632]

    @@ -10244,7 +10245,7 @@ $protection)
    -

    method getFontAscent [line 3930]

    +

    method getFontAscent [line 3946]

    @@ -10298,7 +10299,7 @@ $size = 0])
    -

    method getFontBuffer [line 17889]

    +

    method getFontBuffer [line 17984]

    @@ -10340,7 +10341,7 @@ $font)
    -

    method getFontDescent [line 3909]

    +

    method getFontDescent [line 3925]

    @@ -10394,7 +10395,7 @@ $size = 0])
    -

    method getFontFamily [line 14383]

    +

    method getFontFamily [line 14494]

    @@ -10425,7 +10426,7 @@ $size = 0])
    -

    method getFontSize [line 14363]

    +

    method getFontSize [line 14474]

    @@ -10456,7 +10457,7 @@ $size = 0])
    -

    method getFontSizePt [line 14373]

    +

    method getFontSizePt [line 14484]

    @@ -10487,7 +10488,7 @@ $size = 0])
    -

    method getFontsList [line 3635]

    +

    method getFontsList [line 3651]

    @@ -10515,7 +10516,7 @@ $size = 0])
    -

    method getFontStyle [line 14393]

    +

    method getFontStyle [line 14504]

    @@ -10546,7 +10547,7 @@ $size = 0])
    -

    method getFooterFont [line 8833]

    +

    method getFooterFont [line 8940]

    @@ -10574,7 +10575,7 @@ $size = 0])
    -

    method getFooterMargin [line 3013]

    +

    method getFooterMargin [line 3029]

    @@ -10602,7 +10603,7 @@ $size = 0])
    -

    method getFormDefaultProp [line 11915]

    +

    method getFormDefaultProp [line 12022]

    @@ -10636,7 +10637,7 @@ $size = 0])
    -

    method getGDgamma [line 6074]

    +

    method getGDgamma [line 6181]

    @@ -10675,7 +10676,7 @@ $v)
    -

    method getGraphicVars [line 17581]

    +

    method getGraphicVars [line 17676]

    @@ -10706,7 +10707,7 @@ $v)
    -

    method getGroupPageNo [line 12653]

    +

    method getGroupPageNo [line 12760]

    @@ -10737,7 +10738,7 @@ $v)
    -

    method getGroupPageNoFormatted [line 12663]

    +

    method getGroupPageNoFormatted [line 12770]

    @@ -10768,7 +10769,7 @@ $v)
    -

    method getHeaderData [line 2968]

    +

    method getHeaderData [line 2984]

    @@ -10796,7 +10797,7 @@ $v)
    -

    method getHeaderFont [line 8813]

    +

    method getHeaderFont [line 8920]

    @@ -10824,7 +10825,7 @@ $v)
    -

    method getHeaderMargin [line 2993]

    +

    method getHeaderMargin [line 3009]

    @@ -10852,7 +10853,7 @@ $v)
    -

    method getHtmlDomArray [line 14429]

    +

    method getHtmlDomArray [line 14540]

    @@ -10891,7 +10892,7 @@ $html)
    -

    method getHTMLUnitToUnits [line 17296]

    +

    method getHTMLUnitToUnits [line 17391]

    @@ -10957,7 +10958,7 @@ $point)
    -

    method getHyphenPatternsFromTEX [line 18836]

    +

    method getHyphenPatternsFromTEX [line 18931]

    @@ -11002,7 +11003,7 @@ $file)
    -

    method getImageBuffer [line 17831]

    +

    method getImageBuffer [line 17926]

    @@ -11044,7 +11045,7 @@ $image)
    -

    method getImageFileType [line 5450]

    +

    method getImageFileType [line 5557]

    @@ -11092,7 +11093,7 @@ $iminfo = array()])
    -

    method getImageRBX [line 3039]

    +

    method getImageRBX [line 3055]

    @@ -11117,7 +11118,7 @@ $iminfo = array()])
    -

    method getImageRBY [line 3048]

    +

    method getImageRBY [line 3064]

    @@ -11207,7 +11208,7 @@ $iminfo = array()])
    -

    method GetLineWidth [line 9868]

    +

    method GetLineWidth [line 9975]

    @@ -11241,7 +11242,7 @@ $iminfo = array()])
    -

    method getMargins [line 14326]

    +

    method getMargins [line 14437]

    @@ -11272,7 +11273,7 @@ $iminfo = array()])
    -

    method GetNumChars [line 3623]

    +

    method GetNumChars [line 3639]

    @@ -11314,28 +11315,30 @@ $s)
    -

    method getNumLines [line 4969]

    +

    method getNumLines [line 4981]

    - int getNumLines( + float getNumLines( string $txt, [float -$w = 0]) +$w = 0], [boolean +$reseth = false], [boolean +$autopadding = true], [float +$cellMargin = ''], [float +$lineWidth = ''])

    - This method returns the estimated number of lines required to print the text (not the real number just a quick estimation).

    If you want o know the exact number of lines you have to use the following technique:

      // store current object
    -  $pdf->startTransaction();
    -  // get the number of lines for multicell
    -  $lines = $pdf->MultiCell($w, 0, $txt, 0, 'L', 0, 0, '', '', true, 0, false, true, 0);
    -  // restore previous object
    -  $pdf = $pdf->rollbackTransaction();




    + This method return the estimated number of lines for print a simple text string in Multicell() method.



    Tags:

    - + + + + @@ -11354,12 +11357,32 @@ $w = 0]) - + - + + + + + + + + + + + + + + + + + + + + +
    return:  Return the estimated number of lines.return:  Return the minimal height needed for multicell method for printing the $txt param.
    author:  Alexander Escalona Fernndez, Nicola Asuni
    since:  4.5.011
    string   $txt  text to printString for calculating his height
    float   $w  width of cell. If 0, they extend up to the right margin of the page.Width of cells. If 0, they extend up to the right margin of the page.
    boolean  $reseth  if true reset the last cell height (default false).
    boolean  $autopadding  if true, uses internal padding and automatically adjust it to account for line width (default true).
    float  $cellMargin  Internal cell margin, if empty or <= 0, extended up to current pdf cell margin (default '').
    float  $lineWidth  Line width, if empty or <= 0, extended up to current pdf line width (default '').

    @@ -11367,7 +11390,7 @@ $w = 0])

    -

    method getNumPages [line 2795]

    +

    method getNumPages [line 2811]

    @@ -11401,7 +11424,7 @@ $w = 0])
    -

    method getObjFilename [line 17661]

    +

    method getObjFilename [line 17756]

    @@ -11446,7 +11469,7 @@ $prefix)
    -

    method getOriginalMargins [line 14349]

    +

    method getOriginalMargins [line 14460]

    @@ -11477,7 +11500,7 @@ $prefix)
    -

    method getPage [line 2783]

    +

    method getPage [line 2799]

    @@ -11511,7 +11534,7 @@ $prefix)
    -

    method getPageBuffer [line 17772]

    +

    method getPageBuffer [line 17867]

    @@ -11598,7 +11621,7 @@ $pagenum = ''])
    -

    method getPageGroupAlias [line 12675]

    +

    method getPageGroupAlias [line 12782]

    @@ -11677,7 +11700,7 @@ $pagenum = ''])
    -

    method getPageNumGroupAlias [line 12690]

    +

    method getPageNumGroupAlias [line 12797]

    @@ -11798,7 +11821,7 @@ $pagenum = ''])
    -

    method getPathPaintOperator [line 18948]

    +

    method getPathPaintOperator [line 19043]

    @@ -11852,7 +11875,7 @@ $mode)
    -

    method getPDFData [line 8856]

    +

    method getPDFData [line 8963]

    @@ -11877,7 +11900,7 @@ $mode)
    -

    method getRemainingWidth [line 5351]

    +

    method getRemainingWidth [line 5458]

    @@ -11967,7 +11990,7 @@ $mode)
    -

    method getSpaceString [line 14972]

    +

    method getSpaceString [line 15092]

    @@ -11996,9 +12019,112 @@ $mode)
    [ Top ]
    +
    + +

    method getStringHeight [line 5080]

    +
    +
    +
    + float getStringHeight( +float +$w, string +$txt, [boolean +$reseth = false], [boolean +$autopadding = true], [float +$cellMargin = ''], [float +$lineWidth = '']) +
    +

    + + This method return the estimated needed height for print a simple text string in Multicell() method.

    Generally, if you want to know the exact height for a block of content you can use the following technique:

      // store current object
    +  $pdf->startTransaction();
    +  // store starting values
    +  $start_y = $pdf->GetY();
    +  $start_page = $pdf->getPage();
    +  // call your printing functions with your parameters
    +  // - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    +  $pdf->MultiCell($w=0, $h=0, $txt, $border=1, $align='L', $fill=0, $ln=1, $x='', $y='', $reseth=true, $stretch=0, $ishtml=false, $autopadding=true, $maxh=0);
    +  // - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    +  // get the new Y
    +  $end_y = $pdf->GetY();
    +  $end_page = $pdf->getPage();
    +  // calculate height
    +  $height = 0;
    +  if ($end_page == $start_page) {
    +  	$height = $end_y - $start_y;
    +  } else {
    +  	for ($page=$start_page; $page <= $end_page; ++$page) {
    +  		$this->setPage($page);
    +  		if ($page == $start_page) {
    +  			// first page
    +  			$height = $this->h - $start_y - $this->bMargin;
    +  		} elseif ($page == $end_page) {
    +  			// last page
    +  			$height = $end_y - $this->tMargin;
    +  		} else {
    +  			$height = $this->h - $this->tMargin - $this->bMargin;
    +  		}
    +  	}
    +  }
    +  // restore previous object
    +  $pdf = $pdf->rollbackTransaction();




    +

    Tags:

    +
    + + + + + + + + + + +
    return:  Return the minimal height needed for multicell method for printing the $txt param.
    author:  Nicola Asuni, Alexander Escalona Fernndez
    access:  public
    +
    +

    + + +

    Parameters:

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    float  $w  Width of cells. If 0, they extend up to the right margin of the page.
    string  $txt  String for calculating his height
    boolean  $reseth  if true reset the last cell height (default false).
    boolean  $autopadding  if true, uses internal padding and automatically adjust it to account for line width (default true).
    float  $cellMargin  Internal cell margin, if empty or <= 0, extended up to current pdf cell margin (default '').
    float  $lineWidth  Line width, if empty or <= 0, extended up to current pdf line width (default '').
    +

    +
    [ Top ]
    +

    -

    method GetStringWidth [line 3544]

    +

    method GetStringWidth [line 3560]

    @@ -12067,7 +12193,7 @@ $getarray = false])
    -

    method getSVGTransformMatrix [line 19323]

    +

    method getSVGTransformMatrix [line 19418]

    @@ -12112,7 +12238,7 @@ $attribute)
    -

    method getTransformationMatrixProduct [line 19427]

    +

    method getTransformationMatrixProduct [line 19522]

    @@ -12163,7 +12289,7 @@ $tb)
    -

    method getUserPermissionCode [line 9366]

    +

    method getUserPermissionCode [line 9473]

    @@ -12211,7 +12337,7 @@ $mode = 0])
    -

    method getVectorsAngle [line 20058]

    +

    method getVectorsAngle [line 20153]

    @@ -12271,7 +12397,7 @@ $y2)
    -

    method GetX [line 6118]

    +

    method GetX [line 6225]

    @@ -12302,7 +12428,7 @@ $y2)
    -

    method GetY [line 6145]

    +

    method GetY [line 6252]

    @@ -12333,7 +12459,7 @@ $y2)
    -

    method get_mqr [line 5790]

    +

    method get_mqr [line 5897]

    @@ -12364,7 +12490,7 @@ $y2)
    -

    method Gradient [line 13273]

    +

    method Gradient [line 13380]

    @@ -12430,7 +12556,7 @@ $antialias = false])
    -

    method Header [line 3057]

    +

    method Header [line 3073]

    @@ -12455,7 +12581,7 @@ $antialias = false])
    -

    method hyphenateText [line 18875]

    +

    method hyphenateText [line 18970]

    @@ -12536,7 +12662,7 @@ $charmax = 8])
    -

    method hyphenateWord [line 18766]

    +

    method hyphenateWord [line 18861]

    @@ -12617,7 +12743,7 @@ $charmax = 8])
    -

    method Image [line 5500]

    +

    method Image [line 5607]

    @@ -12755,7 +12881,7 @@ $fitonpage = false])
    -

    method ImageEps [line 13613]

    +

    method ImageEps [line 13724]

    @@ -12857,7 +12983,7 @@ $fitonpage = false])
    -

    method ImagePngAlpha [line 6028]

    +

    method ImagePngAlpha [line 6135]

    @@ -12962,7 +13088,7 @@ $palign = ''])
    -

    method ImageSVG [line 19039]

    +

    method ImageSVG [line 19134]

    @@ -13058,7 +13184,7 @@ $fitonpage = false])
    -

    method IncludeJS [line 11403]

    +

    method IncludeJS [line 11510]

    @@ -13100,7 +13226,7 @@ $script)
    -

    method intToRoman [line 17375]

    +

    method intToRoman [line 17470]

    @@ -13170,7 +13296,7 @@ $number)
    -

    method lastPage [line 2772]

    +

    method lastPage [line 2788]

    @@ -13212,7 +13338,7 @@ $resetmargins = false])
    -

    method Line [line 10038]

    +

    method Line [line 10145]

    @@ -13278,7 +13404,7 @@ $style = array()])
    -

    method LinearGradient [line 13123]

    +

    method LinearGradient [line 13230]

    @@ -13356,7 +13482,7 @@ $coords = array(0,0,1,0)])
    -

    method Link [line 3998]

    +

    method Link [line 4014]

    @@ -13428,7 +13554,7 @@ $spaces = 0])
    -

    method ListBox [line 12112]

    +

    method ListBox [line 12219]

    @@ -13518,7 +13644,7 @@ $js = false])
    -

    method Ln [line 6087]

    +

    method Ln [line 6194]

    @@ -13566,7 +13692,7 @@ $cell = false])
    -

    method MirrorH [line 9650]

    +

    method MirrorH [line 9757]

    @@ -13608,7 +13734,7 @@ $x = ''])
    -

    method MirrorL [line 9686]

    +

    method MirrorL [line 9793]

    @@ -13662,7 +13788,7 @@ $y = ''])
    -

    method MirrorP [line 9673]

    +

    method MirrorP [line 9780]

    @@ -13710,7 +13836,7 @@ $y = ''])
    -

    method MirrorV [line 9661]

    +

    method MirrorV [line 9768]

    @@ -13752,7 +13878,7 @@ $y = ''])
    -

    method movePage [line 17906]

    +

    method movePage [line 18001]

    @@ -13800,7 +13926,7 @@ $topage)
    -

    method MultiCell [line 4706]

    +

    method MultiCell [line 4722]

    @@ -13926,7 +14052,7 @@ $maxh = 0])
    -

    method objclone [line 18553]

    +

    method objclone [line 18648]

    @@ -13999,7 +14125,7 @@ $object)
    -

    method openHTMLTagHandler [line 16142]

    +

    method openHTMLTagHandler [line 16270]

    @@ -14053,7 +14179,7 @@ $dom)
    -

    method Output [line 6237]

    +

    method Output [line 6344]

    @@ -14101,7 +14227,7 @@ $dest = 'I'])
    -

    method PageNo [line 3260]

    +

    method PageNo [line 3276]

    @@ -14135,7 +14261,7 @@ $dest = 'I'])
    -

    method PageNoFormatted [line 12726]

    +

    method PageNoFormatted [line 12833]

    @@ -14166,7 +14292,7 @@ $dest = 'I'])
    -

    method PieSector [line 13552]

    +

    method PieSector [line 13663]

    @@ -14262,7 +14388,7 @@ $o:)
    -

    method PieSectorXY [line 13573]

    +

    method PieSectorXY [line 13684]

    @@ -14370,7 +14496,7 @@ $o:)
    -

    method pixelsToUnits [line 8965]

    +

    method pixelsToUnits [line 9072]

    @@ -14412,7 +14538,7 @@ $px)
    -

    method Polycurve [line 10149]

    +

    method Polycurve [line 10256]

    @@ -14484,7 +14610,7 @@ $fill_color = array()])
    -

    method Polygon [line 10355]

    +

    method Polygon [line 10462]

    @@ -14547,7 +14673,7 @@ $closed = true])
    -

    method PolyLine [line 10336]

    +

    method PolyLine [line 10443]

    @@ -14610,7 +14736,7 @@ $closed)
    -

    method putHtmlListBullet [line 17440]

    +

    method putHtmlListBullet [line 17535]

    @@ -14661,7 +14787,7 @@ $size = 10])
    -

    method RadialGradient [line 13141]

    +

    method RadialGradient [line 13248]

    @@ -14739,7 +14865,7 @@ $coords = array(0.5,0.5,0.5,0.5,1)])
    -

    method RadioButton [line 12024]

    +

    method RadioButton [line 12131]

    @@ -14829,7 +14955,7 @@ $js = false])
    -

    method readDiskCache [line 17701]

    +

    method readDiskCache [line 17796]

    @@ -14877,7 +15003,7 @@ $file)
    -

    method Rect [line 10066]

    +

    method Rect [line 10173]

    @@ -14955,7 +15081,7 @@ $fill_color = array()])
    -

    method registrationMark [line 13092]

    +

    method registrationMark [line 13199]

    @@ -15027,7 +15153,7 @@ $colb = array(255,255,255)])
    -

    method RegularPolygon [line 10453]

    +

    method RegularPolygon [line 10560]

    @@ -15138,7 +15264,7 @@ $r:)
    -

    method removeSHY [line 4259]

    +

    method removeSHY [line 4275]

    @@ -15180,7 +15306,7 @@ $txt = ''])
    -

    method revstrpos [line 18577]

    +

    method revstrpos [line 18672]

    @@ -15234,7 +15360,7 @@ $offset = 0])
    -

    method rfread [line 5998]

    +

    method rfread [line 6105]

    @@ -15285,7 +15411,7 @@ $length)
    -

    method rollbackTransaction [line 18524]

    +

    method rollbackTransaction [line 18619]

    @@ -15327,7 +15453,7 @@ $self = false])
    -

    method Rotate [line 9742]

    +

    method Rotate [line 9849]

    @@ -15381,7 +15507,7 @@ $y = ''])
    -

    method RoundedRect [line 10543]

    +

    method RoundedRect [line 10650]

    @@ -15468,7 +15594,7 @@ $fill_color = array()])
    -

    method RoundedRectXY [line 10562]

    +

    method RoundedRectXY [line 10669]

    @@ -15561,7 +15687,7 @@ $fill_color = array()])
    -

    method Scale [line 9618]

    +

    method Scale [line 9725]

    @@ -15621,7 +15747,7 @@ $y = ''])
    -

    method ScaleX [line 9578]

    +

    method ScaleX [line 9685]

    @@ -15675,7 +15801,7 @@ $y = ''])
    -

    method ScaleXY [line 9604]

    +

    method ScaleXY [line 9711]

    @@ -15729,7 +15855,7 @@ $y = ''])
    -

    method ScaleY [line 9591]

    +

    method ScaleY [line 9698]

    @@ -15783,7 +15909,7 @@ $y = ''])
    -

    method segSVGContentHandler [line 20510]

    +

    method segSVGContentHandler [line 20605]

    @@ -15831,7 +15957,7 @@ $data)
    -

    method selectColumn [line 18640]

    +

    method selectColumn [line 18735]

    @@ -15870,7 +15996,7 @@ $col = ''])
    -

    method serializeTCPDFtagParameters [line 18691]

    +

    method serializeTCPDFtagParameters [line 18786]

    @@ -15912,7 +16038,7 @@ $pararray)
    -

    method setAlpha [line 12841]

    +

    method setAlpha [line 12948]

    @@ -16047,7 +16173,7 @@ $margin = 0])
    -

    method setBarcode [line 13889]

    +

    method setBarcode [line 14000]

    @@ -16083,7 +16209,7 @@ $bc = ''])
    -

    method SetBooklet [line 17210]

    +

    method SetBooklet [line 17305]

    @@ -16134,7 +16260,7 @@ $outer = -1])
    -

    method setBuffer [line 17711]

    +

    method setBuffer [line 17806]

    @@ -16173,7 +16299,7 @@ $data)
    -

    method setCellHeightRatio [line 12875]

    +

    method setCellHeightRatio [line 12982]

    @@ -16254,7 +16380,7 @@ $pad)
    -

    method setColumnsArray [line 18627]

    +

    method setColumnsArray [line 18722]

    @@ -16332,7 +16458,7 @@ $compress)
    -

    method setContentMark [line 2935]

    +

    method setContentMark [line 2951]

    @@ -16413,7 +16539,7 @@ $creator)
    -

    method SetDefaultMonospacedFont [line 3948]

    +

    method SetDefaultMonospacedFont [line 3964]

    @@ -16452,7 +16578,7 @@ $font)
    -

    method setDefaultTableColumns [line 12865]

    +

    method setDefaultTableColumns [line 12972]

    @@ -16542,7 +16668,7 @@ $mode = 'UseNone'])
    -

    method SetDrawColor [line 3315]

    +

    method SetDrawColor [line 3331]

    @@ -16602,7 +16728,7 @@ $col4 = -1])
    -

    method SetDrawColorArray [line 3292]

    +

    method SetDrawColorArray [line 3308]

    @@ -16644,7 +16770,7 @@ $color)
    -

    method SetDrawSpotColor [line 3356]

    +

    method SetDrawSpotColor [line 3372]

    @@ -16692,7 +16818,7 @@ $tint = 100])
    -

    method setEqualColumns [line 18594]

    +

    method setEqualColumns [line 18689]

    @@ -16743,7 +16869,7 @@ $y = ''])
    -

    method setExtGState [line 12807]

    +

    method setExtGState [line 12914]

    @@ -16782,7 +16908,7 @@ $gs)
    -

    method SetFillColor [line 3398]

    +

    method SetFillColor [line 3414]

    @@ -16842,7 +16968,7 @@ $col4 = -1])
    -

    method SetFillColorArray [line 3375]

    +

    method SetFillColorArray [line 3391]

    @@ -16884,7 +17010,7 @@ $color)
    -

    method SetFillSpotColor [line 3440]

    +

    method SetFillSpotColor [line 3456]

    @@ -16932,7 +17058,7 @@ $tint = 100])
    -

    method SetFont [line 3861]

    +

    method SetFont [line 3877]

    @@ -16992,7 +17118,7 @@ $fontfile = ''])
    -

    method setFontBuffer [line 17847]

    +

    method setFontBuffer [line 17942]

    @@ -17037,7 +17163,7 @@ $data)
    -

    method SetFontSize [line 3881]

    +

    method SetFontSize [line 3897]

    @@ -17079,7 +17205,7 @@ $size)
    -

    method setFontSubBuffer [line 17869]

    +

    method setFontSubBuffer [line 17964]

    @@ -17130,7 +17256,7 @@ $data)
    -

    method setFooter [line 3170]

    +

    method setFooter [line 3186]

    @@ -17158,7 +17284,7 @@ $data)
    -

    method setFooterFont [line 8823]

    +

    method setFooterFont [line 8930]

    @@ -17197,7 +17323,7 @@ $font)
    -

    method setFooterMargin [line 3003]

    +

    method setFooterMargin [line 3019]

    @@ -17233,7 +17359,7 @@ $fm = 10])
    -

    method setFormDefaultProp [line 11904]

    +

    method setFormDefaultProp [line 12011]

    @@ -17275,7 +17401,7 @@ $prop = array()])
    -

    method setGraphicVars [line 17620]

    +

    method setGraphicVars [line 17715]

    @@ -17314,7 +17440,7 @@ $gvars)
    -

    method setHeader [line 3134]

    +

    method setHeader [line 3150]

    @@ -17342,7 +17468,7 @@ $gvars)
    -

    method setHeaderData [line 2954]

    +

    method setHeaderData [line 2970]

    @@ -17396,7 +17522,7 @@ $hs = ''])
    -

    method setHeaderFont [line 8803]

    +

    method setHeaderFont [line 8910]

    @@ -17435,7 +17561,7 @@ $font)
    -

    method setHeaderMargin [line 2983]

    +

    method setHeaderMargin [line 2999]

    @@ -17471,7 +17597,7 @@ $hm = 10])
    -

    method setHtmlLinksStyle [line 17281]

    +

    method setHtmlLinksStyle [line 17376]

    @@ -17516,7 +17642,7 @@ $fontstyle = 'U'])
    -

    method setHtmlVSpace [line 17250]

    +

    method setHtmlVSpace [line 17345]

    @@ -17555,7 +17681,7 @@ $tagvs)
    -

    method setImageBuffer [line 17788]

    +

    method setImageBuffer [line 17883]

    @@ -17642,7 +17768,7 @@ $scale)
    -

    method setImageSubBuffer [line 17811]

    +

    method setImageSubBuffer [line 17906]

    @@ -17693,7 +17819,7 @@ $data)
    -

    method setJPEGQuality [line 12852]

    +

    method setJPEGQuality [line 12959]

    @@ -17774,7 +17900,7 @@ $keywords)
    -

    method setLanguageArray [line 8843]

    +

    method setLanguageArray [line 8950]

    @@ -17897,7 +18023,7 @@ $margin)
    -

    method SetLineStyle [line 9893]

    +

    method SetLineStyle [line 10000]

    @@ -17943,7 +18069,7 @@ $style)
    -

    method SetLineWidth [line 9852]

    +

    method SetLineWidth [line 9959]

    @@ -17985,7 +18111,7 @@ $width)
    -

    method SetLink [line 3975]

    +

    method SetLink [line 3991]

    @@ -18039,7 +18165,7 @@ $page = -1])
    -

    method setListIndentWidth [line 17260]

    +

    method setListIndentWidth [line 17355]

    @@ -18078,7 +18204,7 @@ $width)
    -

    method setLIsymbol [line 17171]

    +

    method setLIsymbol [line 17266]

    @@ -18177,7 +18303,7 @@ $keepmargins = false])
    -

    method setOpenCell [line 17270]

    +

    method setOpenCell [line 17365]

    @@ -18216,7 +18342,7 @@ $isopen)
    -

    method setPage [line 2725]

    +

    method setPage [line 2741]

    @@ -18333,7 +18459,7 @@ $ury)
    -

    method setPageBuffer [line 17745]

    +

    method setPageBuffer [line 17840]

    @@ -18429,7 +18555,7 @@ $orientation = 'P'])
    -

    method setPageMark [line 2923]

    +

    method setPageMark [line 2939]

    @@ -18547,7 +18673,7 @@ $unit)
    -

    method setPDFVersion [line 12894]

    +

    method setPDFVersion [line 13001]

    @@ -18586,7 +18712,7 @@ $version = '1.7'])
    -

    method setPrintFooter [line 3030]

    +

    method setPrintFooter [line 3046]

    @@ -18628,7 +18754,7 @@ $value)
    -

    method setPrintHeader [line 3021]

    +

    method setPrintHeader [line 3037]

    @@ -18664,7 +18790,7 @@ $val = true])
    -

    method SetProtection [line 9410]

    +

    method SetProtection [line 9517]

    @@ -18730,7 +18856,7 @@ $pubkeys = null])
    -

    method setRasterizeVectorImages [line 18922]

    +

    method setRasterizeVectorImages [line 19017]

    @@ -18856,7 +18982,7 @@ $resetx = true])
    -

    method setSignature [line 12556]

    +

    method setSignature [line 12663]

    @@ -19009,7 +19135,7 @@ $subject)
    -

    method setSVGStyles [line 19484]

    +

    method setSVGStyles [line 19579]

    @@ -19093,7 +19219,7 @@ $clip_params = array()])
    -

    method setTableHeader [line 3216]

    +

    method setTableHeader [line 3232]

    @@ -19160,7 +19286,7 @@ $mode)
    -

    method SetTextColor [line 3482]

    +

    method SetTextColor [line 3498]

    @@ -19220,7 +19346,7 @@ $col4 = -1])
    -

    method SetTextColorArray [line 3459]

    +

    method SetTextColorArray [line 3475]

    @@ -19262,7 +19388,7 @@ $color)
    -

    method setTextRenderingMode [line 18703]

    +

    method setTextRenderingMode [line 18798]

    @@ -19313,7 +19439,7 @@ $clip = false])
    -

    method SetTextSpotColor [line 3521]

    +

    method SetTextSpotColor [line 3537]

    @@ -19445,7 +19571,7 @@ $margin)
    -

    method setUserRights [line 12523]

    +

    method setUserRights [line 12630]

    @@ -19511,7 +19637,7 @@ $signature = '/Modify'])
    -

    method setViewerPreferences [line 12907]

    +

    method setViewerPreferences [line 13014]

    @@ -19553,7 +19679,7 @@ $preferences)
    -

    method setVisibility [line 12752]

    +

    method setVisibility [line 12859]

    @@ -19592,7 +19718,7 @@ $v)
    -

    method SetX [line 6158]

    +

    method SetX [line 6265]

    @@ -19640,7 +19766,7 @@ $rtloff = false])
    -

    method SetXY [line 6222]

    +

    method SetXY [line 6329]

    @@ -19694,7 +19820,7 @@ $rtloff = false])
    -

    method SetY [line 6190]

    +

    method SetY [line 6297]

    @@ -19748,7 +19874,7 @@ $rtloff = false])
    -

    method set_mqr [line 5775]

    +

    method set_mqr [line 5882]

    @@ -19787,7 +19913,7 @@ $mqr)
    -

    method Skew [line 9798]

    +

    method Skew [line 9905]

    @@ -19847,7 +19973,7 @@ $y = ''])
    -

    method SkewX [line 9771]

    +

    method SkewX [line 9878]

    @@ -19901,7 +20027,7 @@ $y = ''])
    -

    method SkewY [line 9784]

    +

    method SkewY [line 9891]

    @@ -19955,7 +20081,7 @@ $y = ''])
    -

    method StarPolygon [line 10501]

    +

    method StarPolygon [line 10608]

    @@ -20079,7 +20205,7 @@ $draw_circle:)
    -

    method startPage [line 2879]

    +

    method startPage [line 2895]

    @@ -20133,7 +20259,7 @@ $tocpage = false])
    -

    method startPageGroup [line 12585]

    +

    method startPageGroup [line 12692]

    @@ -20172,7 +20298,7 @@ $page = ''])
    -

    method startSVGElementHandler [line 20081]

    +

    method startSVGElementHandler [line 20176]

    @@ -20226,7 +20352,7 @@ $attribs)
    -

    method startTransaction [line 18493]

    +

    method startTransaction [line 18588]

    @@ -20254,7 +20380,7 @@ $attribs)
    -

    method StartTransform [line 9546]

    +

    method StartTransform [line 9653]

    @@ -20285,7 +20411,7 @@ $attribs)
    -

    method StopTransform [line 9561]

    +

    method StopTransform [line 9668]

    @@ -20316,7 +20442,7 @@ $attribs)
    -

    method SVGPath [line 19740]

    +

    method SVGPath [line 19835]

    @@ -20367,7 +20493,7 @@ $style = ''])
    -

    method SVGTransform [line 19465]

    +

    method SVGTransform [line 19560]

    @@ -20406,7 +20532,7 @@ $tm)
    -

    method swapMargins [line 17226]

    +

    method swapMargins [line 17321]

    @@ -20484,7 +20610,7 @@ $page)
    -

    method Text [line 4137]

    +

    method Text [line 4153]

    @@ -20616,7 +20742,7 @@ $rtloff = false])
    -

    method TextField [line 11933]

    +

    method TextField [line 12040]

    @@ -20700,7 +20826,7 @@ $js = false])
    -

    method Transform [line 9828]

    +

    method Transform [line 9935]

    @@ -20742,7 +20868,7 @@ $tm)
    -

    method Translate [line 9721]

    +

    method Translate [line 9828]

    @@ -20790,7 +20916,7 @@ $t_y)
    -

    method TranslateX [line 9698]

    +

    method TranslateX [line 9805]

    @@ -20832,7 +20958,7 @@ $t_x)
    -

    method TranslateY [line 9709]

    +

    method TranslateY [line 9816]

    @@ -20874,7 +21000,7 @@ $t_y)
    -

    method unhtmlentities [line 8976]

    +

    method unhtmlentities [line 9083]

    @@ -20913,7 +21039,7 @@ $text_to_convert)
    -

    method UniArrSubString [line 5390]

    +

    method UniArrSubString [line 5497]

    @@ -20967,7 +21093,7 @@ $end = ''])
    -

    method unichr [line 5423]

    +

    method unichr [line 5530]

    @@ -21012,7 +21138,7 @@ $c)
    -

    method UTF8ArrayToUniArray [line 5411]

    +

    method UTF8ArrayToUniArray [line 5518]

    @@ -21054,7 +21180,7 @@ $ta)
    -

    method UTF8ArrSubString [line 5367]

    +

    method UTF8ArrSubString [line 5474]

    @@ -21105,7 +21231,7 @@ $end = ''])
    -

    method UTF8ArrToLatin1 [line 8713]

    +

    method UTF8ArrToLatin1 [line 8820]

    @@ -21147,7 +21273,7 @@ $unicode)
    -

    method utf8Bidi [line 10723]

    +

    method utf8Bidi [line 10830]

    @@ -21204,7 +21330,7 @@ $forcertl = false])
    -

    method utf8StrArrRev [line 10709]

    +

    method utf8StrArrRev [line 10816]

    @@ -21264,7 +21390,7 @@ $forcertl = false])
    -

    method UTF8StringToArray [line 8576]

    +

    method UTF8StringToArray [line 8683]

    @@ -21330,7 +21456,7 @@ $str)
    -

    method utf8StrRev [line 10694]

    +

    method utf8StrRev [line 10801]

    @@ -21384,7 +21510,7 @@ $forcertl = false])
    -

    method UTF8ToLatin1 [line 8683]

    +

    method UTF8ToLatin1 [line 8790]

    @@ -21426,7 +21552,7 @@ $str)
    -

    method UTF8ToUTF16BE [line 8667]

    +

    method UTF8ToUTF16BE [line 8774]

    @@ -21477,7 +21603,7 @@ $setbom = true])
    -

    method Write [line 5013]

    +

    method Write [line 5120]

    @@ -21573,7 +21699,7 @@ $maxh = 0])
    -

    method write1DBarcode [line 13918]

    +

    method write1DBarcode [line 14029]

    @@ -21663,7 +21789,7 @@ $align = ''])
    -

    method write2DBarcode [line 14160]

    +

    method write2DBarcode [line 14271]

    @@ -21747,7 +21873,7 @@ $align = ''])
    -

    method writeBarcode [line 14110]

    +

    method writeBarcode [line 14221]

    @@ -21837,7 +21963,7 @@ $code)
    -

    method writeDiskCache [line 17673]

    +

    method writeDiskCache [line 17768]

    @@ -21894,7 +22020,7 @@ $file)
    -

    method writeHTML [line 14992]

    +

    method writeHTML [line 15112]

    @@ -21960,7 +22086,7 @@ $align = ''])
    -

    method writeHTMLCell [line 14417]

    +

    method writeHTMLCell [line 14528]

    @@ -22062,7 +22188,7 @@ $autopadding = true])
    -

    method _addfield [line 11505]

    +

    method _addfield [line 11612]

    @@ -22140,7 +22266,7 @@ $prop)
    -

    method _AES [line 9198]

    +

    method _AES [line 9305]

    @@ -22191,7 +22317,7 @@ $text)
    -

    method _beginpage [line 8255]

    +

    method _beginpage [line 8362]

    @@ -22233,7 +22359,7 @@ $format = ''])
    -

    method _dataannobjstring [line 8432]

    +

    method _dataannobjstring [line 8539]

    @@ -22272,7 +22398,7 @@ $s)
    -

    method _datastring [line 8421]

    +

    method _datastring [line 8528]

    @@ -22311,7 +22437,7 @@ $s)
    -

    method _datestring [line 8443]

    +

    method _datestring [line 8550]

    @@ -22342,7 +22468,7 @@ $s)
    -

    method _destroy [line 6431]

    +

    method _destroy [line 6538]

    @@ -22387,7 +22513,7 @@ $preserve_objcopy = false])
    -

    method _dochecks [line 6459]

    +

    method _dochecks [line 6566]

    @@ -22412,7 +22538,7 @@ $preserve_objcopy = false])
    -

    method _dolinethrough [line 8348]

    +

    method _dolinethrough [line 8455]

    @@ -22460,7 +22586,7 @@ $txt)
    -

    method _dolinethroughw [line 8361]

    +

    method _dolinethroughw [line 8468]

    @@ -22517,7 +22643,7 @@ $txt)
    -

    method _dooverline [line 8374]

    +

    method _dooverline [line 8481]

    @@ -22568,7 +22694,7 @@ $txt)
    -

    method _dooverlinew [line 8387]

    +

    method _dooverlinew [line 8494]

    @@ -22619,7 +22745,7 @@ $w)
    -

    method _dounderline [line 8323]

    +

    method _dounderline [line 8430]

    @@ -22667,7 +22793,7 @@ $txt)
    -

    method _dounderlinew [line 8336]

    +

    method _dounderlinew [line 8443]

    @@ -22718,7 +22844,7 @@ $w)
    -

    method _encrypt_data [line 9009]

    +

    method _encrypt_data [line 9116]

    @@ -22766,7 +22892,7 @@ $s)
    -

    method _enddoc [line 8154]

    +

    method _enddoc [line 8261]

    @@ -22791,7 +22917,7 @@ $s)
    -

    method _endpage [line 8299]

    +

    method _endpage [line 8406]

    @@ -22816,7 +22942,7 @@ $s)
    -

    method _escape [line 8410]

    +

    method _escape [line 8517]

    @@ -22855,7 +22981,7 @@ $s)
    -

    method _escapetext [line 8482]

    +

    method _escapetext [line 8589]

    @@ -22894,7 +23020,7 @@ $s)
    -

    method _freadint [line 8399]

    +

    method _freadint [line 8506]

    @@ -22933,7 +23059,7 @@ $f)
    -

    method _generateencryptionkey [line 9285]

    +

    method _generateencryptionkey [line 9392]

    @@ -22987,7 +23113,7 @@ $protection)
    -

    method _getannotsrefs [line 6704]

    +

    method _getannotsrefs [line 6811]

    @@ -23029,7 +23155,7 @@ $n)
    -

    method _getfontpath [line 6475]

    +

    method _getfontpath [line 6582]

    @@ -23054,7 +23180,7 @@ $n)
    -

    method _getstream [line 8500]

    +

    method _getstream [line 8607]

    @@ -23096,7 +23222,7 @@ $n = 0])
    -

    method _JScolor [line 11481]

    +

    method _JScolor [line 11588]

    @@ -23138,7 +23264,7 @@ $color)
    -

    method _md5_16 [line 9216]

    +

    method _md5_16 [line 9323]

    @@ -23183,7 +23309,7 @@ $str)
    -

    method _newobj [line 8309]

    +

    method _newobj [line 8416]

    @@ -23211,7 +23337,7 @@ $str)
    -

    method _objectkey [line 8990]

    +

    method _objectkey [line 9097]

    @@ -23253,7 +23379,7 @@ $n)
    -

    method _out [line 8524]

    +

    method _out [line 8631]

    @@ -23289,7 +23415,7 @@ $s)
    -

    method _outCurve [line 9993]

    +

    method _outCurve [line 10100]

    @@ -23358,7 +23484,7 @@ $y3)
    -

    method _outCurveV [line 10007]

    +

    method _outCurveV [line 10114]

    @@ -23415,7 +23541,7 @@ $y3)
    -

    method _outCurveY [line 10023]

    +

    method _outCurveY [line 10130]

    @@ -23484,7 +23610,7 @@ $y2)
    -

    method _outellipticalarc [line 10220]

    +

    method _outellipticalarc [line 10327]

    @@ -23592,7 +23718,7 @@ $angf:)
    -

    method _outLine [line 9963]

    +

    method _outLine [line 10070]

    @@ -23637,7 +23763,7 @@ $y)
    -

    method _outPoint [line 9951]

    +

    method _outPoint [line 10058]

    @@ -23682,7 +23808,7 @@ $y)
    -

    method _outRect [line 9977]

    +

    method _outRect [line 10084]

    @@ -23745,7 +23871,7 @@ $op)
    -

    method _Ovalue [line 9229]

    +

    method _Ovalue [line 9336]

    @@ -23796,7 +23922,7 @@ $owner_pass)
    -

    method _parsejpeg [line 5867]

    +

    method _parsejpeg [line 5974]

    @@ -23835,7 +23961,7 @@ $file)
    -

    method _parsepng [line 5893]

    +

    method _parsepng [line 6000]

    @@ -23874,7 +24000,7 @@ $file)
    -

    method _putannotsobjs [line 6736]

    +

    method _putannotsobjs [line 6843]

    @@ -23905,7 +24031,7 @@ $file)
    -

    method _putannotsrefs [line 6692]

    +

    method _putannotsrefs [line 6799]

    @@ -23950,7 +24076,7 @@ $n)
    -

    method _putAPXObject [line 7348]

    +

    method _putAPXObject [line 7455]

    @@ -24004,7 +24130,7 @@ $stream = ''])
    -

    method _putbookmarks [line 11322]

    +

    method _putbookmarks [line 11429]

    @@ -24035,7 +24161,7 @@ $stream = ''])
    -

    method _putcatalog [line 7972]

    +

    method _putcatalog [line 8079]

    @@ -24060,7 +24186,7 @@ $stream = ''])
    -

    method _putcidfont0 [line 7706]

    +

    method _putcidfont0 [line 7813]

    @@ -24105,7 +24231,7 @@ $font)
    -

    method _putEmbeddedFiles [line 4095]

    +

    method _putEmbeddedFiles [line 4111]

    @@ -24136,7 +24262,7 @@ $font)
    -

    method _putencryption [line 9033]

    +

    method _putencryption [line 9140]

    @@ -24167,7 +24293,7 @@ $font)
    -

    method _putextgstates [line 12817]

    +

    method _putextgstates [line 12924]

    @@ -24206,7 +24332,7 @@ $gs)
    -

    method _putfonts [line 7377]

    +

    method _putfonts [line 7484]

    @@ -24231,7 +24357,7 @@ $gs)
    -

    method _putfontwidths [line 7514]

    +

    method _putfontwidths [line 7621]

    @@ -24282,7 +24408,7 @@ $cidoffset = 0])
    -

    method _putheader [line 8146]

    +

    method _putheader [line 8253]

    @@ -24307,7 +24433,7 @@ $cidoffset = 0])
    -

    method _putimages [line 7773]

    +

    method _putimages [line 7880]

    @@ -24332,7 +24458,7 @@ $cidoffset = 0])
    -

    method _putinfo [line 7928]

    +

    method _putinfo [line 8035]

    @@ -24357,7 +24483,7 @@ $cidoffset = 0])
    -

    method _putjavascript [line 11428]

    +

    method _putjavascript [line 11535]

    @@ -24388,7 +24514,7 @@ $cidoffset = 0])
    -

    method _putocg [line 12735]

    +

    method _putocg [line 12842]

    @@ -24416,7 +24542,7 @@ $cidoffset = 0])
    -

    method _putpages [line 6486]

    +

    method _putpages [line 6593]

    @@ -24441,7 +24567,7 @@ $cidoffset = 0])
    -

    method _putresourcedict [line 7845]

    +

    method _putresourcedict [line 7952]

    @@ -24466,7 +24592,7 @@ $cidoffset = 0])
    -

    method _putresources [line 7905]

    +

    method _putresources [line 8012]

    @@ -24491,7 +24617,7 @@ $cidoffset = 0])
    -

    method _putshaders [line 13371]

    +

    method _putshaders [line 13478]

    @@ -24522,7 +24648,7 @@ $cidoffset = 0])
    -

    method _putsignature [line 12453]

    +

    method _putsignature [line 12560]

    @@ -24553,7 +24679,7 @@ $cidoffset = 0])
    -

    method _putspotcolors [line 7827]

    +

    method _putspotcolors [line 7934]

    @@ -24581,7 +24707,7 @@ $cidoffset = 0])
    -

    method _putstream [line 8515]

    +

    method _putstream [line 8622]

    @@ -24623,7 +24749,7 @@ $n = 0])
    -

    method _puttrailer [line 8129]

    +

    method _puttrailer [line 8236]

    - +
    @@ -24648,7 +24774,7 @@ $n = 0])
    -

    method _puttruetypeunicode [line 7613]

    +

    method _puttruetypeunicode [line 7720]

    - +
    diff --git a/examples/example_001.php b/examples/example_001.php index df7adec..ff6d2aa 100755 --- a/examples/example_001.php +++ b/examples/example_001.php @@ -2,13 +2,13 @@ //============================================================+ // File name : example_001.php // Begin : 2008-03-04 -// Last Update : 2009-09-30 -// +// Last Update : 2010-05-20 +// // Description : Example 001 for TCPDF class // Default Header and Footer -// +// // Author: Nicola Asuni -// +// // (c) Copyright: // Nicola Asuni // Tecnick.com s.r.l. @@ -34,7 +34,7 @@ require_once('../config/lang/eng.php'); require_once('../tcpdf.php'); // create new PDF document -$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); +$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); // set document information $pdf->SetCreator(PDF_CREATOR); @@ -44,7 +44,7 @@ $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, PDF_HEADER_STRING); +$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 001', PDF_HEADER_STRING); // set header and footer fonts $pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); @@ -62,28 +62,42 @@ $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); //set image scale factor -$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); +$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); //set some language-dependent strings -$pdf->setLanguageArray($l); +$pdf->setLanguageArray($l); // --------------------------------------------------------- -// set font -$pdf->SetFont('times', 'BI', 16); +// 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); -// add a page +// Add a page +// This method has several options, check the source code documentation for more information. $pdf->AddPage(); -// print a line using Cell() -$pdf->Cell(0, 12, 'Example 001 - €àèéìòù', 1, 1, 'C'); +// Set some content to print +$html = <<Welcome to TCPDF ! +This is the first example of TCPDF library. +

    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($w=0, $h=0, $x='', $y='', $html, $border=0, $ln=1, $fill=0, $reseth=true, $align='', $autopadding=true); // --------------------------------------------------------- -//Close and output PDF document +// 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 +// END OF FILE //============================================================+ ?> diff --git a/examples/example_002.php b/examples/example_002.php index 938ebb5..9536268 100755 --- a/examples/example_002.php +++ b/examples/example_002.php @@ -2,13 +2,13 @@ //============================================================+ // File name : example_002.php // Begin : 2008-03-04 -// Last Update : 2009-09-30 -// +// Last Update : 2010-05-20 +// // Description : Example 002 for TCPDF class // Removing Header and Footer -// +// // Author: Nicola Asuni -// +// // (c) Copyright: // Nicola Asuni // Tecnick.com s.r.l. @@ -34,7 +34,7 @@ require_once('../config/lang/eng.php'); require_once('../tcpdf.php'); // create new PDF document -$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); +$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); // set document information $pdf->SetCreator(PDF_CREATOR); @@ -57,10 +57,10 @@ $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT); $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); //set image scale factor -$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); +$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); //set some language-dependent strings -$pdf->setLanguageArray($l); +$pdf->setLanguageArray($l); // --------------------------------------------------------- @@ -70,8 +70,15 @@ $pdf->SetFont('times', 'BI', 20); // add a page $pdf->AddPage(); -// print a line using Cell() -$pdf->Cell(0, 10, 'Example 002', 1, 1, 'C'); +// set some text to print +$txt = <<Write($h=0, $txt, $link='', $fill=0, $align='C', $ln=true, $stretch=0, $firstline=false, $firstblock=false, $maxh=0); // --------------------------------------------------------- @@ -79,6 +86,6 @@ $pdf->Cell(0, 10, 'Example 002', 1, 1, 'C'); $pdf->Output('example_002.pdf', 'I'); //============================================================+ -// END OF FILE +// END OF FILE //============================================================+ ?> diff --git a/examples/example_003.php b/examples/example_003.php index b45ee22..2bfdc5b 100755 --- a/examples/example_003.php +++ b/examples/example_003.php @@ -2,13 +2,13 @@ //============================================================+ // File name : example_003.php // Begin : 2008-03-04 -// Last Update : 2009-09-30 -// +// Last Update : 2010-05-20 +// // Description : Example 003 for TCPDF class // Custom Header and Footer -// +// // Author: Nicola Asuni -// +// // (c) Copyright: // Nicola Asuni // Tecnick.com s.r.l. @@ -36,28 +36,26 @@ require_once('../tcpdf.php'); // Extend the TCPDF class to create custom Header and Footer class MYPDF extends TCPDF { + //Page header public function Header() { // Logo - $this->Image(K_PATH_IMAGES.'logo_example.jpg', 10, 8, 15); + $image_file = K_PATH_IMAGES.'logo_example.jpg'; + $this->Image($image_file, 10, 10, 15, '', 'JPG', '', 'T', false, 300, '', false, false, 0, false, false, false); // Set font $this->SetFont('helvetica', 'B', 20); - // Move to the right - $this->Cell(80); // Title - $this->Cell(30, 10, 'Title', 0, 0, 'C'); - // Line break - $this->Ln(20); + $this->Cell(0, 15, '<< TCPDF Example 003 >>', 0, false, 'C', 0, '', 0, false, 'M', 'M'); } - + // Page footer public function Footer() { - // Position at 1.5 cm from bottom + // Position at 15 mm from bottom $this->SetY(-15); // Set font $this->SetFont('helvetica', 'I', 8); // Page number - $this->Cell(0, 10, 'Page '.$this->getAliasNumPage().'/'.$this->getAliasNbPages(), 0, 0, 'C'); + $this->Cell(0, 10, 'Page '.$this->getAliasNumPage().'/'.$this->getAliasNbPages(), 0, false, 'C', 0, '', 0, false, 'T', 'M'); } } @@ -90,10 +88,10 @@ $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); //set image scale factor -$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); +$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); //set some language-dependent strings -$pdf->setLanguageArray($l); +$pdf->setLanguageArray($l); // --------------------------------------------------------- @@ -103,8 +101,15 @@ $pdf->SetFont('times', 'BI', 12); // add a page $pdf->AddPage(); -// print a line using Cell() -$pdf->Cell(0, 10, 'Example 003', 0, 1, 'C'); +// set some text to print +$txt = <<Write($h=0, $txt, $link='', $fill=0, $align='C', $ln=true, $stretch=0, $firstline=false, $firstblock=false, $maxh=0); // --------------------------------------------------------- @@ -112,6 +117,6 @@ $pdf->Cell(0, 10, 'Example 003', 0, 1, 'C'); $pdf->Output('example_003.pdf', 'I'); //============================================================+ -// END OF FILE +// END OF FILE //============================================================+ ?> diff --git a/examples/example_004.php b/examples/example_004.php index 2e83d46..289b3b4 100755 --- a/examples/example_004.php +++ b/examples/example_004.php @@ -2,13 +2,13 @@ //============================================================+ // File name : example_004.php // Begin : 2008-03-04 -// Last Update : 2009-09-30 -// +// Last Update : 2010-05-20 +// // Description : Example 004 for TCPDF class // Cell stretching -// +// // Author: Nicola Asuni -// +// // (c) Copyright: // Nicola Asuni // Tecnick.com s.r.l. @@ -34,7 +34,7 @@ require_once('../config/lang/eng.php'); require_once('../tcpdf.php'); // create new PDF document -$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); +$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); // set document information $pdf->SetCreator(PDF_CREATOR); @@ -44,7 +44,7 @@ $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, PDF_HEADER_STRING); +$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 004', PDF_HEADER_STRING); // set header and footer fonts $pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); @@ -62,10 +62,10 @@ $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); //set image scale factor -$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); +$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); //set some language-dependent strings -$pdf->setLanguageArray($l); +$pdf->setLanguageArray($l); // --------------------------------------------------------- @@ -75,6 +75,8 @@ $pdf->SetFont('times', 'B', 12); // add a page $pdf->AddPage(); +//Cell($w, $h=0, $txt='', $border=0, $ln=0, $align='', $fill=0, $link='', $stretch=0, $ignore_min_height=false, $calign='T', $valign='M') + // test Cell stretching $pdf->Cell(0, 10, 'TEST CELL STRETCH: no stretch', 1, 1, 'C', 0, '', 0); $pdf->Cell(0, 10, 'TEST CELL STRETCH: scaling', 1, 1, 'C', 0, '', 1); @@ -82,12 +84,19 @@ $pdf->Cell(0, 10, 'TEST CELL STRETCH: force scaling', 1, 1, 'C', 0, '', 2); $pdf->Cell(0, 10, 'TEST CELL STRETCH: spacing', 1, 1, 'C', 0, '', 3); $pdf->Cell(0, 10, 'TEST CELL STRETCH: force spacing', 1, 1, 'C', 0, '', 4); +$pdf->Ln(10); + +$pdf->Cell(60, 10, 'TEST CELL STRETCH: scaling', 1, 1, 'C', 0, '', 1); +$pdf->Cell(60, 10, 'TEST CELL STRETCH: force scaling', 1, 1, 'C', 0, '', 2); +$pdf->Cell(60, 10, 'TEST CELL STRETCH: spacing', 1, 1, 'C', 0, '', 3); +$pdf->Cell(60, 10, 'TEST CELL STRETCH: force spacing', 1, 1, 'C', 0, '', 4); + // --------------------------------------------------------- //Close and output PDF document $pdf->Output('example_004.pdf', 'I'); //============================================================+ -// END OF FILE +// END OF FILE //============================================================+ ?> diff --git a/examples/example_005.php b/examples/example_005.php index 6ef86f8..bd98c29 100755 --- a/examples/example_005.php +++ b/examples/example_005.php @@ -2,13 +2,13 @@ //============================================================+ // File name : example_005.php // Begin : 2008-03-04 -// Last Update : 2009-09-30 -// +// Last Update : 2010-05-20 +// // Description : Example 005 for TCPDF class // Multicell -// +// // Author: Nicola Asuni -// +// // (c) Copyright: // Nicola Asuni // Tecnick.com s.r.l. @@ -34,7 +34,7 @@ require_once('../config/lang/eng.php'); require_once('../tcpdf.php'); // create new PDF document -$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); +$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); // set document information $pdf->SetCreator(PDF_CREATOR); @@ -44,7 +44,7 @@ $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, PDF_HEADER_STRING); +$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 005', PDF_HEADER_STRING); // set header and footer fonts $pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); @@ -62,10 +62,10 @@ $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); //set image scale factor -$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); +$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); //set some language-dependent strings -$pdf->setLanguageArray($l); +$pdf->setLanguageArray($l); // --------------------------------------------------------- @@ -75,21 +75,33 @@ $pdf->SetFont('times', '', 10); // add a page $pdf->AddPage(); -// set color for filler -$pdf->SetFillColor(255, 255, 0); +// set color for background +$pdf->SetFillColor(255, 255, 127); + +// MultiCell($w, $h, $txt, $border=0, $align='J', $fill=0, $ln=1, $x='', $y='', $reseth=true, $stretch=0, $ishtml=false, $autopadding=true, $maxh=0) + +// set some text for example +$txt = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.'; // Multicell test -$pdf->MultiCell(40, 5, 'A test multicell line 1 test multicell line 2 test multicell line 3', 1, 'L', 1, 0, '', '', true); -$pdf->MultiCell(40, 5, 'B test multicell line 1 test multicell line 2 test multicell line 3', 1, 'R', 0, 1, '', '', true); -$pdf->MultiCell(40, 5, 'C test multicell line 1 test multicell line 2 test multicell line 3', 1, 'C', 0, 0, '', '', true); -$pdf->MultiCell(40, 5, 'D test multicell line 1 test multicell line 2 test multicell line 3'."\n", 1, 'J', 1, 2, '' ,'', true); -$pdf->MultiCell(40, 5, 'E test multicell line 1 test multicell line 2 test multicell line 3', 1, 'L', 0, 1, '', '', true); +$pdf->MultiCell(55, 5, '[LEFT] '.$txt, 1, 'L', 1, 0, '', '', true); +$pdf->MultiCell(55, 5, '[RIGHT] '.$txt, 1, 'R', 0, 1, '', '', true); +$pdf->MultiCell(55, 5, '[CENTER] '.$txt, 1, 'C', 0, 0, '', '', true); +$pdf->MultiCell(55, 5, '[JUSTIFY] '.$txt."\n", 1, 'J', 1, 2, '' ,'', true); +$pdf->MultiCell(55, 5, '[DEFAULT] '.$txt, 1, '', 0, 1, '', '', true); -$pdf->SetFillColor(255, 200, 200); +// set color for background +$pdf->SetFillColor(215, 235, 255); -$pdf->MultiCell(40, 5, 'F test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line test multicell line'."\n", 1, 'J', 1, 1, '' ,'', true); +// set some text for example +$txt = '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. -// reset pointer to the last page +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 a blox of text using multicell() +$pdf->MultiCell(80, 5, $txt."\n", 1, 'J', 1, 1, '' ,'', true); + +// move pointer to last page $pdf->lastPage(); // --------------------------------------------------------- @@ -98,6 +110,6 @@ $pdf->lastPage(); $pdf->Output('example_005.pdf', 'I'); //============================================================+ -// END OF FILE +// END OF FILE //============================================================+ ?> diff --git a/examples/example_006.php b/examples/example_006.php index a752f32..490014e 100755 --- a/examples/example_006.php +++ b/examples/example_006.php @@ -2,13 +2,13 @@ //============================================================+ // File name : example_006.php // Begin : 2008-03-04 -// Last Update : 2009-09-30 -// +// Last Update : 2010-05-20 +// // Description : Example 006 for TCPDF class // WriteHTML and RTL support -// +// // Author: Nicola Asuni -// +// // (c) Copyright: // Nicola Asuni // Tecnick.com s.r.l. @@ -34,7 +34,7 @@ require_once('../config/lang/eng.php'); require_once('../tcpdf.php'); // create new PDF document -$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); +$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); // set document information $pdf->SetCreator(PDF_CREATOR); @@ -44,7 +44,7 @@ $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, PDF_HEADER_STRING); +$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 006', PDF_HEADER_STRING); // set header and footer fonts $pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); @@ -62,10 +62,10 @@ $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); //set image scale factor -$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); +$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); //set some language-dependent strings -$pdf->setLanguageArray($l); +$pdf->setLanguageArray($l); // --------------------------------------------------------- @@ -75,17 +75,56 @@ $pdf->SetFont('dejavusans', '', 10); // add a page $pdf->AddPage(); +// writeHTML($html, $ln=true, $fill=false, $reseth=false, $cell=false, $align='') +// writeHTMLCell($w, $h, $x, $y, $html='', $border=0, $ln=0, $fill=0, $reseth=true, $align='', $autopadding=true) + // create some HTML content -$htmlcontent = '

    HTML Example

    < € € € & è è © > \\slash \\\\double-slash \\\\\\triple-slash

    List

    List example:
    1. test alt attribute test image
    2. bold text
    3. italic text
    4. underlined text
    5. bbibiubib
    6. link to http://www.tecnick.com
    7. 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.
    8. SUBLIST
      1. row one
        • sublist
      2. row two
    9. TEST line through
    10. font + 3
    11. small text normal small text normal subscript normal superscript normal
    Coffee
    Black hot drink
    Milk
    White cold drink
    IMAGES
    test alt attributetest alt attributetest alt attribute
    '; +$html = '

    HTML Example

    +Some special characters: < € € € & è è © > \\slash \\\\double-slash \\\\\\triple-slash +

    List

    +List example: +
      +
    1. test alt attribute test image
    2. +
    3. bold text
    4. +
    5. italic text
    6. +
    7. underlined text
    8. +
    9. bbibiubib
    10. +
    11. link to http://www.tecnick.com
    12. +
    13. 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.
    14. +
    15. SUBLIST +
        +
      1. row one +
          +
        • sublist
        • +
        +
      2. +
      3. row two
      4. +
      +
    16. +
    17. TEST line through
    18. +
    19. font + 3
    20. +
    21. small text normal small text normal subscript normal superscript normal
    22. +
    +
    +
    Coffee
    +
    Black hot drink
    +
    Milk
    +
    White cold drink
    +
    +
    IMAGES
    +test alt attributetest alt attributetest alt attribute +
    '; // output the HTML content -$pdf->writeHTML($htmlcontent, true, 0, true, 0); +$pdf->writeHTML($html, true, false, true, false, ''); + // output some RTL HTML content -$pdf->writeHTML('
    The words “מזל [mazel] טוב [tov]” mean “Congratulations!”
    ', true, 0, true, 0); +$html = '
    The words “מזל [mazel] טוב [tov]” mean “Congratulations!”
    '; +$pdf->writeHTML($html, true, false, true, false, ''); // test some inline CSS -$inlinecss = '

    This is just an example of html code to demonstrate some supported CSS inline styles. +$html = '

    This is just an example of html code to demonstrate some supported CSS inline styles. bold text line-trough underline and line-trough @@ -101,7 +140,7 @@ $inlinecss = '

    This is just an example of html code to demonstrate some suppor xx-large

    '; -$pdf->writeHTML($inlinecss, true, 0, true, 0); +$pdf->writeHTML($html, true, false, true, false, ''); // reset pointer to the last page $pdf->lastPage(); @@ -115,20 +154,54 @@ $pdf->AddPage(); // create some HTML content $subtable = '
    @@ -24693,7 +24819,7 @@ $font)
    -

    method _putviewerpreferences [line 8058]

    +

    method _putviewerpreferences [line 8165]

    diff --git a/doc/li_com-tecnick-tcpdf.html b/doc/li_com-tecnick-tcpdf.html index 5dfe2aa..9c025ed 100644 --- a/doc/li_com-tecnick-tcpdf.html +++ b/doc/li_com-tecnick-tcpdf.html @@ -64,7 +64,7 @@ This documentation was generated by phpDocumentor v1.4.3

    - Documentation generated on Wed, 19 May 2010 21:31:17 +0200 by phpDocumentor 1.4.3 + Documentation generated on Fri, 21 May 2010 18:46:51 +0200 by phpDocumentor 1.4.3
    diff --git a/doc/index.html b/doc/index.html index 5dfe2aa..9c025ed 100644 --- a/doc/index.html +++ b/doc/index.html @@ -64,7 +64,7 @@ This documentation was generated by phpDocumentor v1.4.3

    - Documentation generated on Wed, 19 May 2010 21:31:17 +0200 by phpDocumentor 1.4.3 + Documentation generated on Fri, 21 May 2010 18:46:51 +0200 by phpDocumentor 1.4.3
    @@ -24727,7 +24853,7 @@ $font)
    -

    method _RC4 [line 9152]

    +

    method _RC4 [line 9259]

    diff --git a/doc/errors.html b/doc/errors.html index b47a598..ce88a94 100644 --- a/doc/errors.html +++ b/doc/errors.html @@ -35,7 +35,7 @@ Post-parsing

    - Documentation generated on Wed, 19 May 2010 21:31:23 +0200 by phpDocumentor 1.4.3 + Documentation generated on Fri, 21 May 2010 18:46:57 +0200 by phpDocumentor 1.4.3
    diff --git a/doc/elementindex_com-tecnick-tcpdf.html b/doc/elementindex_com-tecnick-tcpdf.html index ba2b89c..3247747 100644 --- a/doc/elementindex_com-tecnick-tcpdf.html +++ b/doc/elementindex_com-tecnick-tcpdf.html @@ -731,9 +731,9 @@
    getBarcodeArray
    in file qrcode.php, method QRcode::getBarcodeArray()
        Returns a barcode array which is readable by TCPDF
    getBarcodeArray
    -
    in file 2dbarcodes.php, method TCPDF2DBarcode::getBarcodeArray()
        Return an array representations of barcode.
    -
    getBarcodeArray
    in file barcodes.php, method TCPDFBarcode::getBarcodeArray()
        Return an array representations of barcode.
    +
    getBarcodeArray
    +
    in file 2dbarcodes.php, method TCPDF2DBarcode::getBarcodeArray()
        Return an array representations of barcode.
    getBitStream
    in file qrcode.php, method QRcode::getBitStream()
        Returns a stream of bits.
    getBorderMode
    @@ -829,7 +829,7 @@
    GetNumChars
    in file tcpdf.php, method TCPDF::GetNumChars()
        Returns the numbero of characters in a string.
    getNumLines
    -
    in file tcpdf.php, method TCPDF::getNumLines()
        This method returns the estimated number of lines required to print the text (not the real number just a quick estimation).
    +
    in file tcpdf.php, method TCPDF::getNumLines()
        This method return the estimated number of lines for print a simple text string in Multicell() method.
    getNumPages
    in file tcpdf.php, method TCPDF::getNumPages()
        Get the total number of insered pages.
    getObjFilename
    @@ -866,6 +866,8 @@
    in file tcpdf.php, method TCPDF::getScaleFactor()
        Returns the scale factor (number of points in user unit).
    getSpaceString
    in file tcpdf.php, method TCPDF::getSpaceString()
        Returns the string used to find spaces
    +
    getStringHeight
    +
    in file tcpdf.php, method TCPDF::getStringHeight()
        This method return the estimated needed height for print a simple text string in Multicell() method.
    GetStringWidth
    in file tcpdf.php, method TCPDF::GetStringWidth()
        Returns the length of a string in user unit. A font must be selected.
    getSVGTransformMatrix
    @@ -1985,7 +1987,7 @@ top

    - Documentation generated on Wed, 19 May 2010 21:31:17 +0200 by phpDocumentor 1.4.3 + Documentation generated on Fri, 21 May 2010 18:46:51 +0200 by phpDocumentor 1.4.3
    @@ -24778,7 +24904,7 @@ $text)
    -

    method _setGDImageTransparency [line 5846]

    +

    method _setGDImageTransparency [line 5953]

    diff --git a/doc/elementindex.html b/doc/elementindex.html index 9ec8fac..51a9e25 100644 --- a/doc/elementindex.html +++ b/doc/elementindex.html @@ -550,9 +550,9 @@
    getBarcodeArray
    in file qrcode.php, method QRcode::getBarcodeArray()
        Returns a barcode array which is readable by TCPDF
    getBarcodeArray
    -
    in file 2dbarcodes.php, method TCPDF2DBarcode::getBarcodeArray()
        Return an array representations of barcode.
    -
    getBarcodeArray
    in file barcodes.php, method TCPDFBarcode::getBarcodeArray()
        Return an array representations of barcode.
    +
    getBarcodeArray
    +
    in file 2dbarcodes.php, method TCPDF2DBarcode::getBarcodeArray()
        Return an array representations of barcode.
    getBitStream
    in file qrcode.php, method QRcode::getBitStream()
        Returns a stream of bits.
    getBorderMode
    @@ -648,7 +648,7 @@
    GetNumChars
    in file tcpdf.php, method TCPDF::GetNumChars()
        Returns the numbero of characters in a string.
    getNumLines
    -
    in file tcpdf.php, method TCPDF::getNumLines()
        This method returns the estimated number of lines required to print the text (not the real number just a quick estimation).
    +
    in file tcpdf.php, method TCPDF::getNumLines()
        This method return the estimated number of lines for print a simple text string in Multicell() method.
    getNumPages
    in file tcpdf.php, method TCPDF::getNumPages()
        Get the total number of insered pages.
    getObjFilename
    @@ -685,6 +685,8 @@
    in file tcpdf.php, method TCPDF::getScaleFactor()
        Returns the scale factor (number of points in user unit).
    getSpaceString
    in file tcpdf.php, method TCPDF::getSpaceString()
        Returns the string used to find spaces
    +
    getStringHeight
    +
    in file tcpdf.php, method TCPDF::getStringHeight()
        This method return the estimated needed height for print a simple text string in Multicell() method.
    GetStringWidth
    in file tcpdf.php, method TCPDF::GetStringWidth()
        Returns the length of a string in user unit. A font must be selected.
    getSVGTransformMatrix
    @@ -1956,7 +1958,7 @@ top

    - Documentation generated on Wed, 19 May 2010 21:31:17 +0200 by phpDocumentor 1.4.3 + Documentation generated on Fri, 21 May 2010 18:46:51 +0200 by phpDocumentor 1.4.3
    diff --git a/doc/com-tecnick-tcpdf/_unicode_data.php.html b/doc/com-tecnick-tcpdf/_unicode_data.php.html index cc8505f..c7effba 100644 --- a/doc/com-tecnick-tcpdf/_unicode_data.php.html +++ b/doc/com-tecnick-tcpdf/_unicode_data.php.html @@ -243,7 +243,7 @@ Unicode Include file for TCPDF.




    - Documentation generated on Wed, 19 May 2010 21:31:23 +0200 by phpDocumentor 1.4.3 + Documentation generated on Fri, 21 May 2010 18:46:57 +0200 by phpDocumentor 1.4.3
    @@ -24823,7 +24949,7 @@ $image)
    -

    method _textannobjstring [line 8468]

    +

    method _textannobjstring [line 8575]

    diff --git a/doc/com-tecnick-tcpdf/_tcpdf.php.html b/doc/com-tecnick-tcpdf/_tcpdf.php.html index cb6d2a5..f947ed1 100644 --- a/doc/com-tecnick-tcpdf/_tcpdf.php.html +++ b/doc/com-tecnick-tcpdf/_tcpdf.php.html @@ -79,7 +79,7 @@ This is a PHP class for generating PDF documents without requiring external exte - + @@ -110,7 +110,7 @@ unicode data

    @@ -24862,7 +24988,7 @@ $s)
    -

    method _textstring [line 8454]

    +

    method _textstring [line 8561]

    diff --git a/doc/com-tecnick-tcpdf/_qrcode.php.html b/doc/com-tecnick-tcpdf/_qrcode.php.html index 30bb133..ecf2818 100644 --- a/doc/com-tecnick-tcpdf/_qrcode.php.html +++ b/doc/com-tecnick-tcpdf/_qrcode.php.html @@ -477,7 +477,7 @@ string $string, [int $split_length = 1])

    - Documentation generated on Wed, 19 May 2010 21:31:18 +0200 by phpDocumentor 1.4.3 + Documentation generated on Fri, 21 May 2010 18:46:52 +0200 by phpDocumentor 1.4.3
    diff --git a/doc/com-tecnick-tcpdf/_htmlcolors.php.html b/doc/com-tecnick-tcpdf/_htmlcolors.php.html index a759b15..0c475cc 100644 --- a/doc/com-tecnick-tcpdf/_htmlcolors.php.html +++ b/doc/com-tecnick-tcpdf/_htmlcolors.php.html @@ -94,7 +94,7 @@ Array of WEB safe colors.




    - Documentation generated on Wed, 19 May 2010 21:31:18 +0200 by phpDocumentor 1.4.3 + Documentation generated on Fri, 21 May 2010 18:46:52 +0200 by phpDocumentor 1.4.3
    @@ -24901,7 +25027,7 @@ $s)
    -

    method _toJPEG [line 5809]

    +

    method _toJPEG [line 5916]

    diff --git a/doc/com-tecnick-tcpdf/_config---tcpdf_config.php.html b/doc/com-tecnick-tcpdf/_config---tcpdf_config.php.html index f2543af..599aa59 100644 --- a/doc/com-tecnick-tcpdf/_config---tcpdf_config.php.html +++ b/doc/com-tecnick-tcpdf/_config---tcpdf_config.php.html @@ -539,7 +539,7 @@ Configuration file for TCPDF.




    - Documentation generated on Wed, 19 May 2010 21:31:23 +0200 by phpDocumentor 1.4.3 + Documentation generated on Fri, 21 May 2010 18:46:57 +0200 by phpDocumentor 1.4.3
    diff --git a/doc/com-tecnick-tcpdf/_barcodes.php.html b/doc/com-tecnick-tcpdf/_barcodes.php.html index 2f949ee..992b47b 100644 --- a/doc/com-tecnick-tcpdf/_barcodes.php.html +++ b/doc/com-tecnick-tcpdf/_barcodes.php.html @@ -102,7 +102,7 @@ PHP class to creates array representations for common 1D barcodes to be used wit

    - Documentation generated on Wed, 19 May 2010 21:31:17 +0200 by phpDocumentor 1.4.3 + Documentation generated on Fri, 21 May 2010 18:46:51 +0200 by phpDocumentor 1.4.3
    @@ -24943,7 +25069,7 @@ $file)
    -

    method _toPNG [line 5828]

    +

    method _toPNG [line 5935]

    diff --git a/doc/com-tecnick-tcpdf/_2dbarcodes.php.html b/doc/com-tecnick-tcpdf/_2dbarcodes.php.html index 49b8002..2ff88b3 100644 --- a/doc/com-tecnick-tcpdf/_2dbarcodes.php.html +++ b/doc/com-tecnick-tcpdf/_2dbarcodes.php.html @@ -102,7 +102,7 @@ PHP class to creates array representations for 2D barcodes to be used with TCPDF

    - Documentation generated on Wed, 19 May 2010 21:31:17 +0200 by phpDocumentor 1.4.3 + Documentation generated on Fri, 21 May 2010 18:46:51 +0200 by phpDocumentor 1.4.3
    diff --git a/doc/com-tecnick-tcpdf/TCPDFBarcode.html b/doc/com-tecnick-tcpdf/TCPDFBarcode.html index 3a19930..27facc6 100644 --- a/doc/com-tecnick-tcpdf/TCPDFBarcode.html +++ b/doc/com-tecnick-tcpdf/TCPDFBarcode.html @@ -1374,7 +1374,7 @@ $type)

    - Documentation generated on Wed, 19 May 2010 21:31:17 +0200 by phpDocumentor 1.4.3 + Documentation generated on Fri, 21 May 2010 18:46:51 +0200 by phpDocumentor 1.4.3
    @@ -24988,7 +25114,7 @@ $file)
    -

    method _Uvalue [line 9258]

    +

    method _Uvalue [line 9365]

    diff --git a/doc/com-tecnick-tcpdf/TCPDF2DBarcode.html b/doc/com-tecnick-tcpdf/TCPDF2DBarcode.html index 2091399..7690df1 100644 --- a/doc/com-tecnick-tcpdf/TCPDF2DBarcode.html +++ b/doc/com-tecnick-tcpdf/TCPDF2DBarcode.html @@ -296,7 +296,7 @@ $type)

    - Documentation generated on Wed, 19 May 2010 21:31:17 +0200 by phpDocumentor 1.4.3 + Documentation generated on Fri, 21 May 2010 18:46:51 +0200 by phpDocumentor 1.4.3
    @@ -25025,7 +25151,7 @@ $file)

    - Documentation generated on Wed, 19 May 2010 21:31:19 +0200 by phpDocumentor 1.4.3 + Documentation generated on Fri, 21 May 2010 18:46:53 +0200 by phpDocumentor 1.4.3
    author:  Nicola Asuni
    version:  5.0.013version:  5.0.014
    copyright:  2002-2010 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
    - PDF_PRODUCER = 'TCPDF 5.0.013 (http://www.tcpdf.org)' + PDF_PRODUCER = 'TCPDF 5.0.014 (http://www.tcpdf.org)'
    @@ -121,7 +121,7 @@ unicode data


    - Documentation generated on Wed, 19 May 2010 21:31:19 +0200 by phpDocumentor 1.4.3 + Documentation generated on Fri, 21 May 2010 18:46:53 +0200 by phpDocumentor 1.4.3
    ab
    cd
    '; -$htmltable = '

    HTML TABLE:

    #RIGHT alignLEFT align4A
    1A1 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
    1. first
      1. sublist
      2. sublist
    2. second
    small small small small small small small small small small small small small small small small small small small small
    4B
    '.$subtable.'A2 € € € & è è
    A2 € € € & è è
    Red Yellow BG4C
    1A2AA
    2AB
    2AC
    4D
    1B4E
    1C2C3C4F
    '; +$html = '

    HTML TABLE:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    #RIGHT alignLEFT align4A
    1A1 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
    1. first
      1. sublist
      2. sublist
    2. second
    small small small small small small small small small small small small small small small small small small small small
    4B
    '.$subtable.'A2 € € € & è è
    A2 € € € & è è
    Red Yellow BG4C
    1A2AA
    2AB
    2AC
    4D
    1B4E
    1C2C3C4F
    '; // output the HTML content -$pdf->writeHTML($htmltable, true, 0, true, 0); +$pdf->writeHTML($html, true, false, true, false, ''); // Print some HTML Cells -$cellcontent = 'red green blue
    red green blue'; +$html = 'red green blue
    red green blue'; $pdf->SetFillColor(255,255,0); -$pdf->writeHTMLCell(0, 0, '', '', $cellcontent, 'LRTB', 1, 0, true, 'L'); -$pdf->writeHTMLCell(0, 0, '', '', $cellcontent, 'LRTB', 1, 1, true, 'C'); -$pdf->writeHTMLCell(0, 0, '', '', $cellcontent, 'LRTB', 1, 0, true, 'R'); +$pdf->writeHTMLCell(0, 0, '', '', $html, 'LRTB', 1, 0, true, 'L', true); +$pdf->writeHTMLCell(0, 0, '', '', $html, 'LRTB', 1, 1, true, 'C', true); +$pdf->writeHTMLCell(0, 0, '', '', $html, 'LRTB', 1, 0, true, 'R', true); // reset pointer to the last page $pdf->lastPage(); @@ -140,8 +213,8 @@ $pdf->lastPage(); $pdf->AddPage(); // create some HTML content - -$tablealign = '

    Image alignments on HTML table

    +$html = '

    Image alignments on HTML table

    +
    @@ -152,7 +225,7 @@ $tablealign = '

    Image alignments on HTML table

    '; // output the HTML content -$pdf->writeHTML($tablealign, true, 0, true, 0); +$pdf->writeHTML($html, true, false, true, false, ''); // reset pointer to the last page $pdf->lastPage(); @@ -174,31 +247,31 @@ foreach($webcolor as $k => $v) { } // output the HTML content -$pdf->writeHTML($textcolors, true, 0, true, 0); -$pdf->writeHTML($bgcolors, true, 0, true, 0); +$pdf->writeHTML($textcolors, true, false, true, false, ''); +$pdf->writeHTML($bgcolors, true, false, true, false, ''); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // Test word-wrap // create some HTML content -$htmltxt = '

    Various tests

    link to page 2
    thisisaverylongwordthisisanotherverylongwordthisisaverylongword thisisanotherverylongword thisisaverylongwordthisisaverylongwordthisisanotherverylongwordthisisaverylongword thisisanotherverylongword thisisaverylongwordthisisaverylongwordthisisanotherverylongwordthisisaverylongword thisisanotherverylongword thisisaverylongwordthisisaverylongwordthisisanotherverylongwordthisisaverylongword thisisanotherverylongword thisisaverylongwordthisisaverylongwordthisisanotherverylongwordthisisaverylongword thisisanotherverylongword thisisaverylongword'; +$html = '
    +

    Various tests

    +link to page 2
    +thisisaverylongwordthisisanotherverylongwordthisisaverylongword thisisanotherverylongword thisisaverylongwordthisisaverylongwordthisisanotherverylongwordthisisaverylongword thisisanotherverylongword thisisaverylongwordthisisaverylongwordthisisanotherverylongwordthisisaverylongword thisisanotherverylongword thisisaverylongwordthisisaverylongwordthisisanotherverylongwordthisisaverylongword thisisanotherverylongword thisisaverylongwordthisisaverylongwordthisisanotherverylongwordthisisaverylongword thisisanotherverylongword thisisaverylongword'; // output the HTML content -$pdf->writeHTML($htmltxt, true, 0, true, 0); +$pdf->writeHTML($html, true, false, true, false, ''); // Test fonts nesting +$html1 = 'Default Courier Helvetica Times dejavusans Times Helvetica Courier Default'; +$html2 = 'small text normal small text normal subscript normal superscript normal'; +$html3 = 'Thequickbrownfoxjumpsoverthelazydog.'; -$teststr1 = 'Default Courier Helvetica Times dejavusans Times Helvetica Courier Default'; - -$teststr2 = 'small text normal small text normal subscript normal superscript normal'; - -$teststr3 = 'Thequickbrownfoxjumpsoverthelazydog.'; - -$html = $teststr1.'
    '.$teststr2.'
    '.$teststr3.'
    '.$teststr3.'
    '.$teststr2; +$html = $html1.'
    '.$html2.'
    '.$html3.'
    '.$html3.'
    '.$html2; // output the HTML content -$pdf->writeHTML($html, true, 0, true, 0); +$pdf->writeHTML($html, true, false, true, false, ''); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // test pre tag @@ -206,7 +279,7 @@ $pdf->writeHTML($html, true, 0, true, 0); // add a page $pdf->AddPage(); -$htmlcontent = << Hello World!
    Hello @@ -225,7 +298,7 @@ int main() { EOF; // output the HTML content -$pdf->writeHTML($htmlcontent, true, 0, true, 0); +$pdf->writeHTML($html, true, false, true, false, ''); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -238,6 +311,6 @@ $pdf->lastPage(); $pdf->Output('example_006.pdf', 'I'); //============================================================+ -// END OF FILE +// END OF FILE //============================================================+ ?> diff --git a/examples/example_007.php b/examples/example_007.php index afcf9e6..bdb3f77 100755 --- a/examples/example_007.php +++ b/examples/example_007.php @@ -2,13 +2,13 @@ //============================================================+ // File name : example_007.php // Begin : 2008-03-04 -// Last Update : 2009-09-30 -// +// Last Update : 2010-05-20 +// // Description : Example 007 for TCPDF class -// Two independent columns with WriteHTMLCell -// +// Two independent columns with WriteHTMLCell() +// // Author: Nicola Asuni -// +// // (c) Copyright: // Nicola Asuni // Tecnick.com s.r.l. @@ -22,7 +22,7 @@ /** * Creates an example PDF TEST document using TCPDF * @package com.tecnick.tcpdf - * @abstract TCPDF - Example: Two independent columns with WriteHTMLCell + * @abstract TCPDF - Example: Two independent columns with WriteHTMLCell() * @author Nicola Asuni * @copyright 2004-2009 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com * @link http://tcpdf.org @@ -34,7 +34,7 @@ require_once('../config/lang/eng.php'); require_once('../tcpdf.php'); // create new PDF document -$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); +$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); // set document information $pdf->SetCreator(PDF_CREATOR); @@ -44,7 +44,7 @@ $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, PDF_HEADER_STRING); +$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 007', PDF_HEADER_STRING); // set header and footer fonts $pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); @@ -62,10 +62,10 @@ $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); //set image scale factor -$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); +$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); //set some language-dependent strings -$pdf->setLanguageArray($l); +$pdf->setLanguageArray($l); // --------------------------------------------------------- @@ -76,22 +76,32 @@ $pdf->SetFont('times', '', 12); $pdf->AddPage(); // create columns content -$left_column = 'left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column'; +$left_column = 'LEFT COLUMN left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column'; -$right_column = 'right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column'; +$right_column = 'RIGHT COLUMN right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column'; -// set columns width -$first_column_width = 80; -$second_column_width = 80; +// writeHTMLCell($w, $h, $x, $y, $html='', $border=0, $ln=0, $fill=0, $reseth=true, $align='', $autopadding=true) // get current vertical position -$current_y_position = $pdf->getY(); +$y = $pdf->getY(); + +// set color for background +$pdf->SetFillColor(255, 255, 200); + +// set color for text +$pdf->SetTextColor(0, 63, 127); // write the first column -$pdf->writeHTMLCell($first_column_width, '', '', $current_y_position, $left_column, 1, 0, 0, true); +$pdf->writeHTMLCell(80, '', '', $y, $left_column, 1, 0, 1, true, 'J', true); + +// set color for background +$pdf->SetFillColor(215, 235, 255); + +// set color for text +$pdf->SetTextColor(127, 31, 0); // write the second column -$pdf->writeHTMLCell($second_column_width, '', '', '', $right_column, 1, 1, 0, true); +$pdf->writeHTMLCell(80, '', '', '', $right_column, 1, 1, 1, true, 'J', true); // reset pointer to the last page $pdf->lastPage(); @@ -102,6 +112,6 @@ $pdf->lastPage(); $pdf->Output('example_007.pdf', 'I'); //============================================================+ -// END OF FILE +// END OF FILE //============================================================+ ?> diff --git a/examples/example_008.php b/examples/example_008.php index a7d1af1..faf0dc2 100755 --- a/examples/example_008.php +++ b/examples/example_008.php @@ -2,13 +2,13 @@ //============================================================+ // File name : example_008.php // Begin : 2008-03-04 -// Last Update : 2010-02-24 -// +// Last Update : 2010-05-20 +// // Description : Example 008 for TCPDF class // Include external UTF-8 text file -// +// // Author: Nicola Asuni -// +// // (c) Copyright: // Nicola Asuni // Tecnick.com s.r.l. @@ -34,7 +34,7 @@ require_once('../config/lang/eng.php'); require_once('../tcpdf.php'); // create new PDF document -$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); +$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); // set document information $pdf->SetCreator(PDF_CREATOR); @@ -44,7 +44,7 @@ $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, PDF_HEADER_STRING); +$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 008', PDF_HEADER_STRING); // set header and footer fonts $pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); @@ -62,10 +62,10 @@ $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); //set image scale factor -$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); +$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); //set some language-dependent strings -$pdf->setLanguageArray($l); +$pdf->setLanguageArray($l); // --------------------------------------------------------- @@ -78,11 +78,14 @@ $pdf->AddPage(); // get esternal file content $utf8text = file_get_contents('../cache/utf8test.txt', false); -// set a background color -$pdf->SetFillColor(230, 240, 255, true); +// set color for text +$pdf->SetTextColor(0, 63, 127); + +//Write($h, $txt, $link='', $fill=0, $align='', $ln=false, $stretch=0, $firstline=false, $firstblock=false, $maxh=0) // write the text -$pdf->Write(5, $utf8text, '', 1); +$pdf->Write(5, $utf8text, '', 0, '', false, 0, false, false, 0); + // --------------------------------------------------------- @@ -90,6 +93,6 @@ $pdf->Write(5, $utf8text, '', 1); $pdf->Output('example_008.pdf', 'I'); //============================================================+ -// END OF FILE +// END OF FILE //============================================================+ ?> diff --git a/examples/example_009.php b/examples/example_009.php index 658d699..4c4c6cf 100755 --- a/examples/example_009.php +++ b/examples/example_009.php @@ -2,13 +2,13 @@ //============================================================+ // File name : example_009.php // Begin : 2008-03-04 -// Last Update : 2009-09-30 -// +// Last Update : 2010-05-20 +// // Description : Example 009 for TCPDF class // Test Image -// +// // Author: Nicola Asuni -// +// // (c) Copyright: // Nicola Asuni // Tecnick.com s.r.l. @@ -34,7 +34,7 @@ require_once('../config/lang/eng.php'); require_once('../tcpdf.php'); // create new PDF document -$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); +$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); // set document information $pdf->SetCreator(PDF_CREATOR); @@ -44,7 +44,7 @@ $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, PDF_HEADER_STRING); +$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 009', PDF_HEADER_STRING); // set header and footer fonts $pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); @@ -62,10 +62,10 @@ $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); //set image scale factor -$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); +$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); //set some language-dependent strings -$pdf->setLanguageArray($l); +$pdf->setLanguageArray($l); // --------------------------------------------------------- @@ -75,8 +75,10 @@ $pdf->AddPage(); // set JPEG quality $pdf->setJPEGQuality(75); +// Image($file, $x='', $y='', $w=0, $h=0, $type='', $link='', $align='', $resize=false, $dpi=300, $palign='', $ismask=false, $imgmask=false, $border=0, $fitbox=false, $hidden=false, $fitonpage=false) + // Image example -$pdf->Image('../images/image_demo.jpg', 50, 50, 100, 150, '', 'http://www.tcpdf.org', '', true, 150); +$pdf->Image('../images/image_demo.jpg', 50, 50, 100, 150, 'JPG', 'http://www.tcpdf.org', '', true, 150, '', false, false, 1, false, false, false); // --------------------------------------------------------- @@ -84,6 +86,6 @@ $pdf->Image('../images/image_demo.jpg', 50, 50, 100, 150, '', 'http://www.tcpdf. $pdf->Output('example_009.pdf', 'I'); //============================================================+ -// END OF FILE +// END OF FILE //============================================================+ ?> diff --git a/examples/example_010.php b/examples/example_010.php index 754af6a..cb68f9a 100755 --- a/examples/example_010.php +++ b/examples/example_010.php @@ -2,7 +2,7 @@ //============================================================+ // File name : example_010.php // Begin : 2008-03-04 -// Last Update : 2010-05-11 +// Last Update : 2010-05-20 // // Description : Example 010 for TCPDF class // Text on multiple columns @@ -114,7 +114,7 @@ $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, PDF_HEADER_STRING); +$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 010', PDF_HEADER_STRING); // set header and footer fonts $pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); @@ -139,11 +139,11 @@ $pdf->setLanguageArray($l); // --------------------------------------------------------- -// print a text -$pdf->PrintChapter(1, 'A RUNAWAY REEF', '../cache/chapter_demo_1.txt', false); +// print TEXT +$pdf->PrintChapter(1, 'LOREM IPSUM [TEXT]', '../cache/chapter_demo_1.txt', false); -// print an html text -$pdf->PrintChapter(2, 'THE PROS AND CONS', '../cache/chapter_demo_2.txt', true); +// print HTML +$pdf->PrintChapter(2, 'LOREM IPSUM [HTML]', '../cache/chapter_demo_2.txt', true); // --------------------------------------------------------- diff --git a/examples/example_011.php b/examples/example_011.php index b4d4c72..646fcd9 100755 --- a/examples/example_011.php +++ b/examples/example_011.php @@ -2,13 +2,13 @@ //============================================================+ // File name : example_011.php // Begin : 2008-03-04 -// Last Update : 2009-09-30 -// +// Last Update : 2010-05-20 +// // Description : Example 011 for TCPDF class // Colored Table -// +// // Author: Nicola Asuni -// +// // (c) Copyright: // Nicola Asuni // Tecnick.com s.r.l. @@ -35,7 +35,7 @@ require_once('../tcpdf.php'); // extend TCPF with custom functions class MYPDF extends TCPDF { - + // Load table data from file public function LoadData($file) { // Read file lines @@ -46,7 +46,7 @@ class MYPDF extends TCPDF { } return $data; } - + // Colored table public function ColoredTable($header,$data) { // Colors, line width and bold font @@ -57,8 +57,10 @@ class MYPDF extends TCPDF { $this->SetFont('', 'B'); // Header $w = array(40, 35, 40, 45); - for($i = 0; $i < count($header); $i++) - $this->Cell($w[$i], 7, $header[$i], 1, 0, 'C', 1); + $num_headers = count($header); + for($i = 0; $i < $num_headers; ++$i) { + $this->Cell($w[$i], 7, $header[$i], 1, 0, 'C', 1); + } $this->Ln(); // Color and font restoration $this->SetFillColor(224, 235, 255); @@ -89,7 +91,7 @@ $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, PDF_HEADER_STRING); +$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 011', PDF_HEADER_STRING); // set header and footer fonts $pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); @@ -107,10 +109,10 @@ $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); //set image scale factor -$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); +$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); //set some language-dependent strings -$pdf->setLanguageArray($l); +$pdf->setLanguageArray($l); // --------------------------------------------------------- @@ -135,6 +137,6 @@ $pdf->ColoredTable($header, $data); $pdf->Output('example_011.pdf', 'I'); //============================================================+ -// END OF FILE +// END OF FILE //============================================================+ ?> diff --git a/examples/example_012.php b/examples/example_012.php index c41db70..ed3844c 100755 --- a/examples/example_012.php +++ b/examples/example_012.php @@ -2,7 +2,7 @@ //============================================================+ // File name : example_012.php // Begin : 2008-03-04 -// Last Update : 2010-05-04 +// Last Update : 2010-05-20 // // Description : Example 012 for TCPDF class // Graphic Functions @@ -173,6 +173,8 @@ $pdf->Arrow($x0=200, $y0=280, $x1=200, $y1=260, $head_style=3, $arm_size=5, $arm // add a page $pdf->AddPage(); +$pdf->Cell(0, 0, 'Arc of Ellipse'); + // center of ellipse $xc=100; $yc=100; diff --git a/examples/example_013.php b/examples/example_013.php index 3877f9a..0283704 100755 --- a/examples/example_013.php +++ b/examples/example_013.php @@ -2,7 +2,7 @@ //============================================================+ // File name : example_013.php // Begin : 2008-03-04 -// Last Update : 2010-04-05 +// Last Update : 2010-05-20 // // Description : Example 013 for TCPDF class // Graphic Transformations @@ -43,15 +43,20 @@ $pdf->SetTitle('TCPDF Example 013'); $pdf->SetSubject('TCPDF Tutorial'); $pdf->SetKeywords('TCPDF, PDF, example, test, guide'); -// disable header and footer -$pdf->setPrintHeader(false); -$pdf->setPrintFooter(false); +// set default header data +$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 013', 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); @@ -65,129 +70,134 @@ $pdf->setLanguageArray($l); // --------------------------------------------------------- // set font -$pdf->SetFont('helvetica', '', 10); +$pdf->SetFont('helvetica', 'B', 20); // add a page $pdf->AddPage(); -//Scaling +$pdf->Write(0, 'Graphic Transformations', '', 0, 'C', 1, 0, false, false, 0); + +// set font +$pdf->SetFont('helvetica', '', 10); + +// --- Scaling --------------------------------------------- $pdf->SetDrawColor(200); $pdf->SetTextColor(200); -$pdf->Rect(50, 20, 40, 10, 'D'); -$pdf->Text(50, 16, 'Scale'); +$pdf->Rect(50, 70, 40, 10, 'D'); +$pdf->Text(50, 66, 'Scale'); $pdf->SetDrawColor(0); $pdf->SetTextColor(0); -//Start Transformation +// Start Transformation $pdf->StartTransform(); -//Scale by 150% centered by (50,30) which is the lower left corner of the rectangle -$pdf->ScaleXY(150, 50, 30); -$pdf->Rect(50, 20, 40, 10, 'D'); -$pdf->Text(50, 16, 'Scale'); -//Stop Transformation +// Scale by 150% centered by (50,80) which is the lower left corner of the rectangle +$pdf->ScaleXY(150, 50, 80); +$pdf->Rect(50, 70, 40, 10, 'D'); +$pdf->Text(50, 66, 'Scale'); +// Stop Transformation $pdf->StopTransform(); -//Translation +// --- Translation ----------------------------------------- $pdf->SetDrawColor(200); $pdf->SetTextColor(200); -$pdf->Rect(125, 20, 40, 10, 'D'); -$pdf->Text(125, 16, 'Translate'); +$pdf->Rect(125, 70, 40, 10, 'D'); +$pdf->Text(125, 66, 'Translate'); $pdf->SetDrawColor(0); $pdf->SetTextColor(0); -//Start Transformation +// Start Transformation $pdf->StartTransform(); -//Translate 7 to the right, 5 to the bottom +// Translate 7 to the right, 5 to the bottom $pdf->Translate(7, 5); -$pdf->Rect(125, 20, 40, 10, 'D'); -$pdf->Text(125, 16, 'Translate'); -//Stop Transformation +$pdf->Rect(125, 70, 40, 10, 'D'); +$pdf->Text(125, 66, 'Translate'); +// Stop Transformation $pdf->StopTransform(); -//Rotation +// --- Rotation -------------------------------------------- $pdf->SetDrawColor(200); $pdf->SetTextColor(200); -$pdf->Rect(50, 50, 40, 10, 'D'); -$pdf->Text(50, 46, 'Rotate'); +$pdf->Rect(70, 100, 40, 10, 'D'); +$pdf->Text(70, 96, 'Rotate'); $pdf->SetDrawColor(0); $pdf->SetTextColor(0); -//Start Transformation +// Start Transformation $pdf->StartTransform(); -//Rotate 20 degrees counter-clockwise centered by (50,60) which is the lower left corner of the rectangle -$pdf->Rotate(20, 50, 60); -$pdf->Rect(50, 50, 40, 10, 'D'); -$pdf->Text(50, 46, 'Rotate'); -//Stop Transformation +// Rotate 20 degrees counter-clockwise centered by (70,110) which is the lower left corner of the rectangle +$pdf->Rotate(20, 70, 110); +$pdf->Rect(70, 100, 40, 10, 'D'); +$pdf->Text(70, 96, 'Rotate'); +// Stop Transformation $pdf->StopTransform(); -//Skewing +// --- Skewing --------------------------------------------- $pdf->SetDrawColor(200); $pdf->SetTextColor(200); -$pdf->Rect(125, 50, 40, 10, 'D'); -$pdf->Text(125, 46, 'Skew'); +$pdf->Rect(125, 100, 40, 10, 'D'); +$pdf->Text(125, 96, 'Skew'); $pdf->SetDrawColor(0); $pdf->SetTextColor(0); -//Start Transformation +// Start Transformation $pdf->StartTransform(); -//skew 30 degrees along the x-axis centered by (125,60) which is the lower left corner of the rectangle -$pdf->SkewX(30, 125, 60); -$pdf->Rect(125, 50, 40, 10, 'D'); -$pdf->Text(125, 46, 'Skew'); -//Stop Transformation +// skew 30 degrees along the x-axis centered by (125,110) which is the lower left corner of the rectangle +$pdf->SkewX(30, 125, 110); +$pdf->Rect(125, 100, 40, 10, 'D'); +$pdf->Text(125, 96, 'Skew'); +// Stop Transformation $pdf->StopTransform(); -//Mirroring horizontally +// --- Mirroring horizontally ------------------------------ $pdf->SetDrawColor(200); $pdf->SetTextColor(200); -$pdf->Rect(50, 80, 40, 10, 'D'); -$pdf->Text(50, 76, 'MirrorH'); +$pdf->Rect(70, 130, 40, 10, 'D'); +$pdf->Text(70, 126, 'MirrorH'); $pdf->SetDrawColor(0); $pdf->SetTextColor(0); -//Start Transformation +// Start Transformation $pdf->StartTransform(); -//mirror horizontally with axis of reflection at x-position 50 (left side of the rectangle) -$pdf->MirrorH(50); -$pdf->Rect(50, 80, 40, 10, 'D'); -$pdf->Text(50, 76, 'MirrorH'); -//Stop Transformation +// mirror horizontally with axis of reflection at x-position 70 (left side of the rectangle) +$pdf->MirrorH(70); +$pdf->Rect(70, 130, 40, 10, 'D'); +$pdf->Text(70, 126, 'MirrorH'); +// Stop Transformation $pdf->StopTransform(); -//Mirroring vertically +// --- Mirroring vertically -------------------------------- $pdf->SetDrawColor(200); $pdf->SetTextColor(200); -$pdf->Rect(125, 80, 40, 10, 'D'); -$pdf->Text(125, 76, 'MirrorV'); +$pdf->Rect(125, 130, 40, 10, 'D'); +$pdf->Text(125, 126, 'MirrorV'); $pdf->SetDrawColor(0); $pdf->SetTextColor(0); -//Start Transformation +// Start Transformation $pdf->StartTransform(); -//mirror vertically with axis of reflection at y-position 90 (bottom side of the rectangle) -$pdf->MirrorV(90); -$pdf->Rect(125, 80, 40, 10, 'D'); -$pdf->Text(125, 76, 'MirrorV'); -//Stop Transformation +// mirror vertically with axis of reflection at y-position 140 (bottom side of the rectangle) +$pdf->MirrorV(140); +$pdf->Rect(125, 130, 40, 10, 'D'); +$pdf->Text(125, 126, 'MirrorV'); +// Stop Transformation $pdf->StopTransform(); -//Point reflection +// --- Point reflection ------------------------------------ $pdf->SetDrawColor(200); $pdf->SetTextColor(200); -$pdf->Rect(50, 110, 40, 10, 'D'); -$pdf->Text(50, 106, 'MirrorP'); +$pdf->Rect(70, 160, 40, 10, 'D'); +$pdf->Text(70, 156, 'MirrorP'); $pdf->SetDrawColor(0); $pdf->SetTextColor(0); -//Start Transformation +// Start Transformation $pdf->StartTransform(); -//point reflection at the lower left point of rectangle -$pdf->MirrorP(50,120); -$pdf->Rect(50, 110, 40, 10, 'D'); -$pdf->Text(50, 106, 'MirrorP'); -//Stop Transformation +// point reflection at the lower left point of rectangle +$pdf->MirrorP(70,170); +$pdf->Rect(70, 160, 40, 10, 'D'); +$pdf->Text(70, 156, 'MirrorP'); +// Stop Transformation $pdf->StopTransform(); -//Mirroring against a straigth line described by a point (120, 120) and an angle -20° +// --- Mirroring against a straigth line described by a point (120, 120) and an angle -20° $angle=-20; $px=120; -$py=120; +$py=170; -//just vor visualisation: the straight line to mirror against +// just for visualisation: the straight line to mirror against $pdf->SetDrawColor(200); $pdf->Line($px-1,$py-1,$px+1,$py+1); @@ -199,16 +209,16 @@ $pdf->StopTransform(); $pdf->SetDrawColor(200); $pdf->SetTextColor(200); -$pdf->Rect(125, 110, 40, 10, 'D'); -$pdf->Text(125, 106, 'MirrorL'); +$pdf->Rect(125, 160, 40, 10, 'D'); +$pdf->Text(125, 156, 'MirrorL'); $pdf->SetDrawColor(0); $pdf->SetTextColor(0); //Start Transformation $pdf->StartTransform(); //mirror against the straight line $pdf->MirrorL($angle, $px, $py); -$pdf->Rect(125, 110, 40, 10, 'D'); -$pdf->Text(125, 106, 'MirrorL'); +$pdf->Rect(125, 160, 40, 10, 'D'); +$pdf->Text(125, 156, 'MirrorL'); //Stop Transformation $pdf->StopTransform(); diff --git a/examples/example_014.php b/examples/example_014.php index d1bdbf1..7297787 100755 --- a/examples/example_014.php +++ b/examples/example_014.php @@ -2,13 +2,13 @@ //============================================================+ // File name : example_014.php // Begin : 2008-03-04 -// Last Update : 2009-09-30 -// +// Last Update : 2010-05-20 +// // Description : Example 014 for TCPDF class // Javascript Form and user rights (only works on Adobe Acrobat) -// +// // Author: Nicola Asuni -// +// // (c) Copyright: // Nicola Asuni // Tecnick.com s.r.l. @@ -34,7 +34,7 @@ require_once('../config/lang/eng.php'); require_once('../tcpdf.php'); // create new PDF document -$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); +$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); // set document information $pdf->SetCreator(PDF_CREATOR); @@ -44,7 +44,7 @@ $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, PDF_HEADER_STRING); +$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 014', PDF_HEADER_STRING); // set header and footer fonts $pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); @@ -62,10 +62,10 @@ $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); //set image scale factor -$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); +$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); //set some language-dependent strings -$pdf->setLanguageArray($l); +$pdf->setLanguageArray($l); // --------------------------------------------------------- @@ -85,7 +85,7 @@ This name allows to manipulate them via JavaScript in order to perform some vali $pdf->setFormDefaultProp(array('lineWidth'=>1, 'borderStyle'=>'solid', 'fillColor'=>array(255, 255, 200), 'strokeColor'=>array(255, 128, 128))); $pdf->SetFont('helvetica', 'BI', 18); -$pdf->Cell(0, 5, 'Subscription form', 0, 1, 'C'); +$pdf->Cell(0, 5, 'Example of Form', 0, 1, 'C'); $pdf->Ln(10); $pdf->SetFont('helvetica', '', 12); @@ -186,6 +186,6 @@ $pdf->IncludeJS($js); $pdf->Output('example_014.pdf', 'I'); //============================================================+ -// END OF FILE +// END OF FILE //============================================================+ ?> diff --git a/examples/example_015.php b/examples/example_015.php index baaff01..b535a55 100755 --- a/examples/example_015.php +++ b/examples/example_015.php @@ -2,13 +2,13 @@ //============================================================+ // File name : example_015.php // Begin : 2008-03-04 -// Last Update : 2009-09-30 -// +// Last Update : 2010-05-20 +// // Description : Example 015 for TCPDF class // Bookmarks (Table of Content) -// +// // Author: Nicola Asuni -// +// // (c) Copyright: // Nicola Asuni // Tecnick.com s.r.l. @@ -34,7 +34,7 @@ require_once('../config/lang/eng.php'); require_once('../tcpdf.php'); // create new PDF document -$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); +$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); // set document information $pdf->SetCreator(PDF_CREATOR); @@ -44,7 +44,7 @@ $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, PDF_HEADER_STRING); +$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 015', PDF_HEADER_STRING); // set header and footer fonts $pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); @@ -62,13 +62,15 @@ $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); //set image scale factor -$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); +$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); //set some language-dependent strings -$pdf->setLanguageArray($l); +$pdf->setLanguageArray($l); // --------------------------------------------------------- +// Bookmark($txt, $level=0, $y=-1, $page='') + // set font $pdf->SetFont('times', 'B', 20); @@ -81,6 +83,13 @@ $pdf->Bookmark('Chapter 1', 0, 0); // print a line using Cell() $pdf->Cell(0, 10, 'Chapter 1', 0, 1, 'L'); +$pdf->SetFont('times', 'I', 14); +$pdf->Write(0, 'You can set PDF Bookmarks using the Bookmark() method.'); + +$pdf->SetFont('times', 'B', 20); + +// add other pages and bookmarks + $pdf->AddPage(); $pdf->Bookmark('Paragraph 1.1', 1, 0); $pdf->Cell(0, 10, 'Paragraph 1.1', 0, 1, 'L'); @@ -111,6 +120,6 @@ $pdf->Cell(0, 10, 'Chapter 3', 0, 1, 'L'); $pdf->Output('example_015.pdf', 'I'); //============================================================+ -// END OF FILE +// END OF FILE //============================================================+ ?> diff --git a/examples/example_016.php b/examples/example_016.php index e42f3cb..e38d74f 100755 --- a/examples/example_016.php +++ b/examples/example_016.php @@ -2,7 +2,7 @@ //============================================================+ // File name : example_016.php // Begin : 2008-03-04 -// Last Update : 2010-05-13 +// Last Update : 2010-05-20 // // Description : Example 016 for TCPDF class // Document Encryption / Security @@ -84,7 +84,7 @@ $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, PDF_HEADER_STRING); +$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 016', PDF_HEADER_STRING); // set header and footer fonts $pdf->setHeaderFont(Array('helvetica', '', PDF_FONT_SIZE_MAIN)); @@ -110,13 +110,21 @@ $pdf->setLanguageArray($l); // --------------------------------------------------------- // set font -$pdf->SetFont('times', '', 20); +$pdf->SetFont('times', '', 16); // add a page $pdf->AddPage(); -// print a line using Cell() -$pdf->Cell(0, 10, 'Encryption Example', 1, 1, 'C'); +// set some text to print +$txt = <<Write(0, $txt, '', 0, 'L', true, 0, false, false, 0); + // --------------------------------------------------------- diff --git a/examples/example_017.php b/examples/example_017.php index f2eba80..3436d3b 100755 --- a/examples/example_017.php +++ b/examples/example_017.php @@ -2,13 +2,13 @@ //============================================================+ // File name : example_017.php // Begin : 2008-03-04 -// Last Update : 2009-09-30 -// +// Last Update : 2010-05-20 +// // Description : Example 017 for TCPDF class // Two independent columns with MultiCell -// +// // Author: Nicola Asuni -// +// // (c) Copyright: // Nicola Asuni // Tecnick.com s.r.l. @@ -34,7 +34,7 @@ require_once('../config/lang/eng.php'); require_once('../tcpdf.php'); // create new PDF document -$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); +$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); // set document information $pdf->SetCreator(PDF_CREATOR); @@ -44,7 +44,7 @@ $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, PDF_HEADER_STRING); +$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 017', PDF_HEADER_STRING); // set header and footer fonts $pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); @@ -62,36 +62,50 @@ $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); //set image scale factor -$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); +$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); //set some language-dependent strings -$pdf->setLanguageArray($l); +$pdf->setLanguageArray($l); // --------------------------------------------------------- // set font -$pdf->SetFont('times', '', 12); +$pdf->SetFont('helvetica', '', 20); // add a page $pdf->AddPage(); +$pdf->Write(0, 'Example of independent Multicell() columns', '', 0, 'L', true, 0, false, false, 0); + +$pdf->Ln(5); + +$pdf->SetFont('times', '', 12); + // create columns content -$left_column = 'START left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column END'."\n"; +// create columns content +$left_column = '[LEFT COLUMN] left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column'."\n"; -$right_column = 'START right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column END'."\n"; +$right_column = '[RIGHT COLUMN] right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column'."\n"; -// set columns width -$first_column_width = 80; -$second_column_width = 80; +// MultiCell($w, $h, $txt, $border=0, $align='J', $fill=0, $ln=1, $x='', $y='', $reseth=true, $stretch=0, $ishtml=false, $autopadding=true, $maxh=0) -// get current vertical position -$current_y_position = $pdf->getY(); +// set color for background +$pdf->SetFillColor(255, 255, 200); + +// set color for text +$pdf->SetTextColor(0, 63, 127); // write the first column -$pdf->MultiCell($first_column_width, 0, $left_column, 1, 'J', 0, 0, '', '', true, 0); +$pdf->MultiCell(80, 0, $left_column, 1, 'J', 1, 0, '', '', true, 0, false, true, 0); + +// set color for background +$pdf->SetFillColor(215, 235, 255); + +// set color for text +$pdf->SetTextColor(127, 31, 0); // write the second column -$pdf->MultiCell($second_column_width, 0, $right_column, 1, 'J', 0, 1, '', '', true, 0); +$pdf->MultiCell(80, 0, $right_column, 1, 'J', 1, 1, '', '', true, 0, false, true, 0); // reset pointer to the last page $pdf->lastPage(); @@ -102,6 +116,6 @@ $pdf->lastPage(); $pdf->Output('example_017.pdf', 'I'); //============================================================+ -// END OF FILE +// END OF FILE //============================================================+ ?> diff --git a/examples/example_018.php b/examples/example_018.php index 1a94b53..a3afc92 100755 --- a/examples/example_018.php +++ b/examples/example_018.php @@ -2,13 +2,13 @@ //============================================================+ // File name : example_018.php // Begin : 2008-03-06 -// Last Update : 2009-09-30 -// +// Last Update : 2010-05-20 +// // Description : Example 018 for TCPDF class // RTL document with Persian language -// +// // Author: Nicola Asuni -// +// // (c) Copyright: // Nicola Asuni // Tecnick.com s.r.l. @@ -34,7 +34,7 @@ require_once('../config/lang/eng.php'); require_once('../tcpdf.php'); // create new PDF document -$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); +$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); // set document information $pdf->SetCreator(PDF_CREATOR); @@ -44,7 +44,7 @@ $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, PDF_HEADER_STRING); +$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 018', PDF_HEADER_STRING); // set header and footer fonts $pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); @@ -62,7 +62,7 @@ $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); //set image scale factor -$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); +$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); // set some language dependent data: $lg = Array(); @@ -72,7 +72,7 @@ $lg['a_meta_language'] = 'fa'; $lg['w_page'] = 'page'; //set some language-dependent strings -$pdf->setLanguageArray($lg); +$pdf->setLanguageArray($lg); // --------------------------------------------------------- @@ -91,6 +91,9 @@ $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); @@ -98,22 +101,26 @@ $pdf->WriteHTML($htmlpersiantranslation, true, 0, true, 0); // Restore RTL direction $pdf->setRTL(true); -$pdf->Ln(10); - +// set font size $pdf->SetFont('almohanad', '', 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); -$pdf->Ln(5); - // set LTR direction for english translation $pdf->setRTL(false); +// set font size $pdf->SetFontSize(18); +// print newline +$pdf->Ln(); + // Arabic and English content $htmlcontent2 = 'This is Arabic "العربية" Example With TCPDF.'; $pdf->WriteHTML($htmlcontent2, true, 0, true, 0); @@ -124,6 +131,6 @@ $pdf->WriteHTML($htmlcontent2, true, 0, true, 0); $pdf->Output('example_018.pdf', 'I'); //============================================================+ -// END OF FILE +// END OF FILE //============================================================+ ?> diff --git a/examples/example_019.php b/examples/example_019.php index 49a1658..1516989 100755 --- a/examples/example_019.php +++ b/examples/example_019.php @@ -2,13 +2,13 @@ //============================================================+ // File name : example_019.php // Begin : 2008-03-07 -// Last Update : 2009-09-30 -// +// Last Update : 2010-05-20 +// // Description : Example 019 for TCPDF class // Non unicode with alternative config file -// +// // Author: Nicola Asuni -// +// // (c) Copyright: // Nicola Asuni // Tecnick.com s.r.l. @@ -49,7 +49,7 @@ $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, PDF_HEADER_STRING); +$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)); @@ -67,7 +67,7 @@ $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); //set image scale factor -$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); +$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); // set some language dependent data: $lg = Array(); @@ -77,23 +77,24 @@ $lg['a_meta_language'] = 'en'; $lg['w_page'] = 'page'; //set some language-dependent strings -$pdf->setLanguageArray($lg); +$pdf->setLanguageArray($lg); // --------------------------------------------------------- // set font -$pdf->SetFont('helvetica', 'BIU', 20); +$pdf->SetFont('helvetica', '', 12); // add a page $pdf->AddPage(); -// print a line using Cell() -$pdf->Cell(0, 10, 'Example 019', 1, 1, 'C'); +// set color for background +$pdf->SetFillColor(200, 255, 200); -$pdf->Ln(); +$txt = 'An alternative configuration file is used on this example. +Check the definition of the K_TCPDF_EXTERNAL_CONFIG constant on the source code.'; -$pdf->SetFont('times', '', 10); -$pdf->MultiCell(80, 0, 'Cras eros leo, porttitor porta, accumsan fermentum, ornare ac, est. Praesent dui lorem, imperdiet at, cursus sed, facilisis aliquam, nibh. Nulla accumsan nonummy diam. Donec tempus. Etiam posuere. Proin lectus. Donec purus. Duis in sem pretium urna feugiat vehicula. Ut suscipit velit eget massa. Nam nonummy, enim commodo euismod placerat, tortor elit tempus lectus, quis suscipit metus lorem blandit turpis.'."\n", 1, 'J', 0, 1, '', '', true, 0); +// print some text +$pdf->MultiCell(0, 0, $txt."\n", 1, 'J', 1, 1, '', '', true, 0, false, true, 0); // --------------------------------------------------------- @@ -101,6 +102,6 @@ $pdf->MultiCell(80, 0, 'Cras eros leo, porttitor porta, accumsan fermentum, orna $pdf->Output('example_019.pdf', 'I'); //============================================================+ -// END OF FILE +// END OF FILE //============================================================+ ?> diff --git a/examples/example_020.php b/examples/example_020.php index b064f57..b7477e7 100755 --- a/examples/example_020.php +++ b/examples/example_020.php @@ -2,10 +2,10 @@ //============================================================+ // File name : example_020.php // Begin : 2008-03-04 -// Last Update : 2009-09-30 +// Last Update : 2010-05-20 // // Description : Example 020 for TCPDF class -// Two columns composed by MultiCell of different +// Two columns composed by MultiCell of different // heights // // Author: Nicola Asuni @@ -35,27 +35,28 @@ require_once('../config/lang/eng.php'); require_once('../tcpdf.php'); // extend TCPF with custom functions -class MYPDF extends TCPDF { +class MYPDF extends TCPDF { + public function MultiRow($left, $right) { - //MultiCell($w, $h, $txt, $border=0, $align='J', $fill=0, $ln=1, $x='', $y='', $reseth=true, $stretch=0) - + // MultiCell($w, $h, $txt, $border=0, $align='J', $fill=0, $ln=1, $x='', $y='', $reseth=true, $stretch=0) + $page_start = $this->getPage(); $y_start = $this->GetY(); - + // write the left cell - $this->MultiCell(40, 0, $left, 1, 'R', 0, 2, '', '', true, 0); - + $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); @@ -66,11 +67,11 @@ class MYPDF extends TCPDF { } else { $ynew = $y_end_2; } - + $this->setPage(max($page_end_1,$page_end_2)); $this->SetXY($this->GetX(),$ynew); } - + } // create new PDF document @@ -84,7 +85,7 @@ $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, PDF_HEADER_STRING); +$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)); @@ -110,17 +111,28 @@ $pdf->setLanguageArray($l); // --------------------------------------------------------- // set font -$pdf->SetFont('times', '', 9); +$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); -$text = 'Cras eros leo, porttitor porta, accumsan fermentum, ornare ac, est. Praesent dui lorem, imperdiet at, cursus sed, facilisis aliquam, nibh. Nulla accumsan nonummy diam. Donec tempus. Etiam posuere. Proin lectus. Donec purus. Duis in sem pretium urna feugiat vehicula. Ut suscipit velit eget massa. Nam nonummy, enim commodo euismod placerat, tortor elit tempus lectus, quis suscipit metus lorem blandit turpis. Cras nulla nulla, hendrerit et, porttitor eu, adipiscing et, lorem. Pellentesque sit amet augue. Nam lobortis sollicitudin turpis. Sed velit est, mollis non, elementum ac, tempor quis, arcu. Aliquam a pede. Quisque arcu magna, nonummy eget, hendrerit a, lacinia egestas, enim. Donec bibendum. In a ipsum. Sed gravida facilisis sem. Nam tempus, tellus ut tincidunt elementum, augue tellus fermentum quam, sit amet lobortis sem ipsum sed elit.In accumsan ligula nonummy libero. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Sed vel risus. Vestibulum ut lacus. Proin fermentum, erat a commodo lacinia, lacus dui hendrerit nulla, et pellentesque neque diam at elit. Fusce blandit, dolor pharetra bibendum lacinia, augue sem scelerisque sem, bibendum sodales orci justo et sapien. Etiam nec eros ac turpis lobortis interdum. Integer volutpat nibh a lacus. Duis erat est, rhoncus nec, rhoncus viverra, pulvinar sit amet, leo. Duis blandit. Nunc convallis nisi ac ante. Cras nunc massa, molestie quis, porttitor a, volutpat accumsan, quam. Nullam a erat vitae orci bibendum viverra. Donec tristique leo eget nisl adipiscing pellentesque. Nam vehicula, enim quis aliquet euismod, dolor sem pellentesque libero, nec blandit nisi erat sit amet dui. Integer sapien. Donec molestie metus in neque. Suspendisse porttitor enim a nisl.Maecenas lacinia dolor ornare ligula. Maecenas eu eros. Curabitur non leo non nulla fringilla auctor. Etiam porttitor diam vel quam. Maecenas sed ligula nec massa venenatis faucibus. Curabitur aliquet accumsan tellus. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Suspendisse vitae eros ac purus fermentum suscipit. Curabitur interdum orci a mi. Nunc placerat diam in elit.Nunc elit. Maecenas vulputate, sem sit amet condimentum lacinia, ipsum eros porta dolor, sed luctus magna ante eu nisl. Proin non nisi. Vivamus sed quam et est lobortis porttitor. Cras sit amet urna sit amet elit ultricies consequat. Praesent blandit elit ut urna. Cras hendrerit rhoncus sapien. Fusce ullamcorper lobortis ipsum. Pellentesque vel velit at sem blandit facilisis. Nulla aliquet orci id metus.'; +// 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 < 5; $i++) { +for ($i = 0; $i < 7; ++$i) { $pdf->MultiRow('Row '.($i+1), $text."\n"); } @@ -133,6 +145,6 @@ $pdf->lastPage(); $pdf->Output('example_020.pdf', 'I'); //============================================================+ -// END OF FILE +// END OF FILE //============================================================+ -?> +?> diff --git a/examples/example_021.php b/examples/example_021.php index f89c329..761c8ba 100755 --- a/examples/example_021.php +++ b/examples/example_021.php @@ -2,13 +2,13 @@ //============================================================+ // File name : example_021.php // Begin : 2008-03-04 -// Last Update : 2009-09-30 -// +// Last Update : 2010-05-20 +// // Description : Example 021 for TCPDF class // WriteHTML text flow -// +// // Author: Nicola Asuni -// +// // (c) Copyright: // Nicola Asuni // Tecnick.com s.r.l. @@ -34,7 +34,7 @@ require_once('../config/lang/eng.php'); require_once('../tcpdf.php'); // create new PDF document -$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); +$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); // set document information $pdf->SetCreator(PDF_CREATOR); @@ -44,7 +44,7 @@ $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, PDF_HEADER_STRING); +$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)); @@ -62,10 +62,10 @@ $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); //set image scale factor -$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); +$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); //set some language-dependent strings -$pdf->setLanguageArray($l); +$pdf->setLanguageArray($l); // --------------------------------------------------------- @@ -76,7 +76,7 @@ $pdf->SetFont('helvetica', '', 9); $pdf->AddPage(); // create some HTML content -$html = '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'; +$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); @@ -90,6 +90,6 @@ $pdf->lastPage(); $pdf->Output('example_021.pdf', 'I'); //============================================================+ -// END OF FILE +// END OF FILE //============================================================+ ?> diff --git a/examples/example_022.php b/examples/example_022.php index 42e0ae7..587811e 100755 --- a/examples/example_022.php +++ b/examples/example_022.php @@ -2,7 +2,7 @@ //============================================================+ // File name : example_022.php // Begin : 2008-03-04 -// Last Update : 2010-04-05 +// Last Update : 2010-05-20 // // Description : Example 022 for TCPDF class // CMYK colors @@ -44,7 +44,7 @@ $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, PDF_HEADER_STRING); +$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)); @@ -69,61 +69,75 @@ $pdf->setLanguageArray($l); // --------------------------------------------------------- +// check also the following methods: +// SetDrawColorArray() +// SetFillColorArray() +// SetTextColorArray() + // set font -$pdf->SetFont('helvetica', "B", 12); +$pdf->SetFont('helvetica', 'B', 18); // add a page $pdf->AddPage(); -$pdf->SetLineWidth(1); +$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, 20, 20, 'DF'); -$pdf->Text(30, 82, 'Cyan'); +$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(60, 60, 20, 20, 'DF'); -$pdf->Text(60, 82, 'Magenta'); +$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(90, 60, 20, 20, 'DF'); -$pdf->Text(90, 82, 'Yellow'); +$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(120, 60, 20, 20, 'DF'); -$pdf->Text(120, 82, 'Black'); +$pdf->Rect(150, 60, 30, 30, 'DF', $border_style); +$pdf->Text(150, 92, 'Black'); -$pdf->SetDrawColor(128, 0, 0); +// --- RGB ------------------------------------------------- + +$pdf->SetDrawColor(255, 127, 127); $pdf->SetFillColor(255, 0, 0); $pdf->SetTextColor(255, 0, 0); -$pdf->Rect(30, 100, 20, 20, 'DF'); -$pdf->Text(30, 122, 'Red'); +$pdf->Rect(30, 110, 30, 30, 'DF', $border_style); +$pdf->Text(30, 142, 'Red'); -$pdf->SetDrawColor(0, 127, 0); +$pdf->SetDrawColor(127, 255, 127); $pdf->SetFillColor(0, 255, 0); $pdf->SetTextColor(0, 255, 0); -$pdf->Rect(60, 100, 20, 20, 'DF'); -$pdf->Text(60, 122, 'Green'); +$pdf->Rect(70, 110, 30, 30, 'DF', $border_style); +$pdf->Text(70, 142, 'Green'); -$pdf->SetDrawColor(0, 0, 127); +$pdf->SetDrawColor(127, 127, 255); $pdf->SetFillColor(0, 0, 255); $pdf->SetTextColor(0, 0, 255); -$pdf->Rect(90, 100, 20, 20, 'DF'); -$pdf->Text(90, 122, 'Blue'); +$pdf->Rect(110, 110, 30, 30, 'DF', $border_style); +$pdf->Text(110, 142, 'Blue'); -$pdf->SetDrawColor(50); -$pdf->SetFillColor(128); -$pdf->SetTextColor(128); -$pdf->Rect(30, 140, 20, 20, 'DF'); -$pdf->Text(30, 162, 'Gray'); +// --- GRAY ------------------------------------------------ + +$pdf->SetDrawColor(191); +$pdf->SetFillColor(127); +$pdf->SetTextColor(127); +$pdf->Rect(30, 160, 30, 30, 'DF', $border_style); +$pdf->Text(30, 192, 'Gray'); // --------------------------------------------------------- diff --git a/examples/example_023.php b/examples/example_023.php index 3b8885a..c994203 100755 --- a/examples/example_023.php +++ b/examples/example_023.php @@ -2,13 +2,13 @@ //============================================================+ // File name : example_023.php // Begin : 2008-03-04 -// Last Update : 2009-09-30 -// +// Last Update : 2010-05-20 +// // Description : Example 023 for TCPDF class // Page Groups -// +// // Author: Nicola Asuni -// +// // (c) Copyright: // Nicola Asuni // Tecnick.com s.r.l. @@ -44,7 +44,7 @@ $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, PDF_HEADER_STRING); +$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)); @@ -62,32 +62,49 @@ $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); //set image scale factor -$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); +$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); //set some language-dependent strings -$pdf->setLanguageArray($l); +$pdf->setLanguageArray($l); // --------------------------------------------------------- // set font -$pdf->SetFont('times', 'BI', 12); +$pdf->SetFont('times', 'BI', 14); // Start First Page Group $pdf->startPageGroup(); // add a page $pdf->AddPage(); -$pdf->Cell(0, 10, 'Start of group 1', 0, 1, 'L'); + +// set some text to print +$txt = <<Write(0, $txt, '', 0, 'L', true, 0, false, false, 0); + +// add second page $pdf->AddPage(); +$pdf->Cell(0, 10, 'This is the second page of group 1', 0, 1, 'L'); // Start Second Page Group $pdf->startPageGroup(); +// add some pages $pdf->AddPage(); -$pdf->Cell(0, 10, 'Start of group 2', 0, 1, 'L'); +$pdf->Cell(0, 10, 'This is the first page of group 2', 0, 1, 'L'); $pdf->AddPage(); +$pdf->Cell(0, 10, 'This is the second page of group 2', 0, 1, 'L'); $pdf->AddPage(); +$pdf->Cell(0, 10, 'This is the third page of group 2', 0, 1, 'L'); $pdf->AddPage(); +$pdf->Cell(0, 10, 'This is the fourth page of group 2', 0, 1, 'L'); // --------------------------------------------------------- @@ -95,6 +112,6 @@ $pdf->AddPage(); $pdf->Output('example_023.pdf', 'I'); //============================================================+ -// END OF FILE +// END OF FILE //============================================================+ ?> diff --git a/examples/example_024.php b/examples/example_024.php index fbcb2fd..0af6bed 100755 --- a/examples/example_024.php +++ b/examples/example_024.php @@ -2,13 +2,13 @@ //============================================================+ // File name : example_024.php // Begin : 2008-03-04 -// Last Update : 2009-09-30 -// +// Last Update : 2010-05-20 +// // Description : Example 024 for TCPDF class // Object Visibility -// +// // Author: Nicola Asuni -// +// // (c) Copyright: // Nicola Asuni // Tecnick.com s.r.l. @@ -34,7 +34,7 @@ require_once('../config/lang/eng.php'); require_once('../tcpdf.php'); // create new PDF document -$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); +$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); // set document information $pdf->SetCreator(PDF_CREATOR); @@ -44,7 +44,7 @@ $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, PDF_HEADER_STRING); +$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 024', PDF_HEADER_STRING); // set header and footer fonts $pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); @@ -62,33 +62,51 @@ $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); //set image scale factor -$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); +$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); //set some language-dependent strings -$pdf->setLanguageArray($l); +$pdf->setLanguageArray($l); // --------------------------------------------------------- // set font -$pdf->SetFont('times', '', 40); +$pdf->SetFont('times', '', 18); // add a page $pdf->AddPage(); /* - * setVisibility() allows to restrict the rendering of some - * elements to screen or printout. This can be useful, for - * instance, to put a background image or color that will + * setVisibility() allows to restrict the rendering of some + * elements to screen or printout. This can be useful, for + * instance, to put a background image or color that will * show on screen but won't print. */ - + +$txt = 'You can limit the visibility of PDF objects to screen or printer by using the setVisibility() method. +Check the print preview of this document to display the alternative text.'; + +$pdf->Write(0, $txt, '', 0, '', true, 0, false, false, 0); + +// change font size +$pdf->SetFontSize(40); + +// change text color +$pdf->SetTextColor(0,63,127); + // set visibility only for screen $pdf->setVisibility('screen'); -$pdf->Write(6, "This line is for display.\n"); + +// write something only for screen +$pdf->Write(0, '[This line is for display]', '', 0, 'C', true, 0, false, false, 0); // set visibility only for print $pdf->setVisibility('print'); -$pdf->Write(6, "This line is for printout.\n"); + +// change text color +$pdf->SetTextColor(127,0,0); + +// write something only for print +$pdf->Write(0, '[This line is for printout]', '', 0, 'C', true, 0, false, false, 0); // restore visibility $pdf->setVisibility('all'); @@ -99,6 +117,6 @@ $pdf->setVisibility('all'); $pdf->Output('example_024.pdf', 'I'); //============================================================+ -// END OF FILE +// END OF FILE //============================================================+ ?> diff --git a/examples/example_025.php b/examples/example_025.php index 8d65c8c..88510ab 100755 --- a/examples/example_025.php +++ b/examples/example_025.php @@ -2,7 +2,7 @@ //============================================================+ // File name : example_025.php // Begin : 2008-03-04 -// Last Update : 2010-04-05 +// Last Update : 2010-05-20 // // Description : Example 025 for TCPDF class // Object Transparency @@ -44,7 +44,7 @@ $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, PDF_HEADER_STRING); +$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 025', PDF_HEADER_STRING); // set header and footer fonts $pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); @@ -70,11 +70,14 @@ $pdf->setLanguageArray($l); // --------------------------------------------------------- // set font -$pdf->SetFont('helvetica', 'BI', 8); +$pdf->SetFont('helvetica', '', 12); // add a page $pdf->AddPage(); +$txt = 'You can set the transparency of PDF objects using the setAlpha() method.'; +$pdf->Write(0, $txt, '', 0, '', true, 0, false, false, 0); + /* * setAlpha() gives transparency support. You can set the * alpha channel from 0 (fully transparent) to 1 (fully @@ -82,28 +85,32 @@ $pdf->AddPage(); * images). */ -$pdf->SetLineWidth(1.5); +$pdf->SetLineWidth(2); // draw opaque red square $pdf->SetFillColor(255, 0, 0); -$pdf->Rect(30, 60, 40, 40, 'DF'); +$pdf->SetDrawColor(127, 0, 0); +$pdf->Rect(30, 40, 60, 60, 'DF'); // set alpha to semi-transparency $pdf->SetAlpha(0.5); // draw green square $pdf->SetFillColor(0, 255, 0); -$pdf->Rect(40, 70, 40, 40, 'DF'); +$pdf->SetDrawColor(0, 127, 0); +$pdf->Rect(50, 60, 60, 60, 'DF'); + +// draw blue square +$pdf->SetFillColor(0, 0, 255); +$pdf->SetDrawColor(0, 0, 127); +$pdf->Rect(70, 80, 60, 60, 'DF'); // draw jpeg image -$pdf->Image('../images/image_demo.jpg', 50, 80, 40, 40, '', 'http://www.tcpdf.org', '', true, 72); +$pdf->Image('../images/image_demo.jpg', 90, 100, 60, 60, '', 'http://www.tcpdf.org', '', true, 72); // restore full opacity $pdf->SetAlpha(1); -// print name -$pdf->Text(55, 82, 'TRANSPARENCY'); - // --------------------------------------------------------- //Close and output PDF document diff --git a/examples/example_026.php b/examples/example_026.php index 052dd41..9367196 100755 --- a/examples/example_026.php +++ b/examples/example_026.php @@ -2,7 +2,7 @@ //============================================================+ // File name : example_026.php // Begin : 2008-03-04 -// Last Update : 2010-04-03 +// Last Update : 2010-05-20 // // Description : Example 026 for TCPDF class // Text Rendering Modes and Text Clipping @@ -44,7 +44,7 @@ $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, PDF_HEADER_STRING); +$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 026', PDF_HEADER_STRING); // set header and footer fonts $pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); diff --git a/examples/example_027.php b/examples/example_027.php index fbb2021..3241110 100755 --- a/examples/example_027.php +++ b/examples/example_027.php @@ -2,7 +2,7 @@ //============================================================+ // File name : example_027.php // Begin : 2008-03-04 -// Last Update : 2010-05-02 +// Last Update : 2010-05-20 // // Description : Example 027 for TCPDF class // 1D Barcodes @@ -44,7 +44,7 @@ $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, PDF_HEADER_STRING); +$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)); @@ -312,7 +312,7 @@ $style = array( // CODE 39 EXTENDED + CHECKSUM $pdf->Cell(0, 0, 'CODE 39 EXTENDED + CHECKSUM', 0, 1); -$pdf->write1DBarcode('CODE 39 E+', 'C39E+', '', '', 80, 15, 0.4, $style, 'N'); +$pdf->write1DBarcode('CODE 39 E+', 'C39E+', '', '', 100, 15, 0.4, $style, 'N'); // --------------------------------------------------------- diff --git a/examples/example_028.php b/examples/example_028.php index 4af1f7e..24563be 100755 --- a/examples/example_028.php +++ b/examples/example_028.php @@ -2,13 +2,13 @@ //============================================================+ // File name : example_028.php // Begin : 2008-03-04 -// Last Update : 2009-09-30 -// +// Last Update : 2010-05-20 +// // Description : Example 028 for TCPDF class // Changing page formats -// +// // Author: Nicola Asuni -// +// // (c) Copyright: // Nicola Asuni // Tecnick.com s.r.l. @@ -34,7 +34,7 @@ require_once('../config/lang/eng.php'); require_once('../tcpdf.php'); // create new PDF document -$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); +$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); // set document information $pdf->SetCreator(PDF_CREATOR); @@ -57,10 +57,10 @@ $pdf->SetMargins(10, PDF_MARGIN_TOP, 10); $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); //set image scale factor -$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); +$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); //set some language-dependent strings -$pdf->setLanguageArray($l); +$pdf->setLanguageArray($l); // --------------------------------------------------------- @@ -137,6 +137,6 @@ $pdf->lastPage(); $pdf->Output('example_028.pdf', 'I'); //============================================================+ -// END OF FILE +// END OF FILE //============================================================+ ?> diff --git a/examples/example_029.php b/examples/example_029.php index 0f59928..6865264 100755 --- a/examples/example_029.php +++ b/examples/example_029.php @@ -2,13 +2,13 @@ //============================================================+ // File name : example_029.php // Begin : 2008-06-09 -// Last Update : 2009-09-30 -// +// Last Update : 2010-05-20 +// // Description : Example 029 for TCPDF class // Set PDF viewer display preferences. -// +// // Author: Nicola Asuni -// +// // (c) Copyright: // Nicola Asuni // Tecnick.com s.r.l. @@ -34,7 +34,7 @@ require_once('../config/lang/eng.php'); require_once('../tcpdf.php'); // create new PDF document -$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); +$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); // set document information $pdf->SetCreator(PDF_CREATOR); @@ -44,7 +44,7 @@ $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, PDF_HEADER_STRING); +$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)); @@ -62,13 +62,14 @@ $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); //set image scale factor -$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); +$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); //set some language-dependent strings -$pdf->setLanguageArray($l); +$pdf->setLanguageArray($l); // --------------------------------------------------------- +// set array for viewer preferences $preferences = array( 'HideToolbar' => true, 'HideMenubar' => true, @@ -88,6 +89,8 @@ $preferences = array( 'NumCopies' => 2 ); +// Check the example n. 60 for advanced page settings + // set pdf viewer preferences $pdf->setViewerPreferences($preferences); @@ -96,8 +99,13 @@ $pdf->SetFont('times', '', 14); // add a page $pdf->AddPage(); + // print a line -$pdf->Cell(0, 12, 'DISPLAY PREFERENCES - PAGE 1', 0, 0, 'C'); +$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(); @@ -115,6 +123,6 @@ $pdf->Cell(0, 12, 'DISPLAY PREFERENCES - PAGE 3', 0, 0, 'C'); $pdf->Output('example_029.pdf', 'I'); //============================================================+ -// END OF FILE +// END OF FILE //============================================================+ ?> diff --git a/examples/example_030.php b/examples/example_030.php index 229b73c..f39c8b6 100755 --- a/examples/example_030.php +++ b/examples/example_030.php @@ -2,13 +2,13 @@ //============================================================+ // File name : example_030.php // Begin : 2008-06-09 -// Last Update : 2009-09-30 -// +// Last Update : 2010-05-20 +// // Description : Example 030 for TCPDF class // Colour gradients -// +// // Author: Nicola Asuni -// +// // (c) Copyright: // Nicola Asuni // Tecnick.com s.r.l. @@ -34,7 +34,7 @@ require_once('../config/lang/eng.php'); require_once('../tcpdf.php'); // create new PDF document -$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); +$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); // set document information $pdf->SetCreator(PDF_CREATOR); @@ -43,36 +43,43 @@ $pdf->SetTitle('TCPDF Example 030'); $pdf->SetSubject('TCPDF Tutorial'); $pdf->SetKeywords('TCPDF, PDF, example, test, guide'); -// disable header and footer -$pdf->setPrintHeader(false); -$pdf->setPrintFooter(false); +// 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); +$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); //set some language-dependent strings -$pdf->setLanguageArray($l); +$pdf->setLanguageArray($l); // --------------------------------------------------------- // set font -$pdf->SetFont('helvetica', '', 14); +$pdf->SetFont('helvetica', 'B', 20); + +// --- first page ------------------------------------------ // add a page $pdf->AddPage(); -//first page +$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) +// 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); @@ -80,22 +87,31 @@ $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) +// 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, 25, 80, 80, $red, $blue, $coords); +// paint a linear gradient +$pdf->LinearGradient(20, 45, 80, 80, $red, $blue, $coords); -//set the coordinates fx,fy,cx,cy,r of the gradient (see radial_gradient_coords.jpg) +// 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, 25, 80, 80, $white, $black, $coords); +// paint a radial gradient +$pdf->RadialGradient(110, 45, 80, 80, $white, $black, $coords); -//paint a coons patch mesh with default coordinates -$pdf->CoonsPatchMesh(20, 115, 80, 80, $yellow, $blue, $green, $red); +// write label +$pdf->Text(110, 130, 'RadialGradient()'); -//set the coordinates for the cubic Bzier points x1,y1 ... x12, y12 of the patch (see coons_patch_mesh_coords.jpg) +// 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 Bzier 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 @@ -105,13 +121,16 @@ $coords = array( $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, 115, 80, 80, $yellow, $blue, $green, $red, $coords, $coords_min, $coords_max); +// paint a coons patch gradient with the above coordinates +$pdf->CoonsPatchMesh(110, 155, 80, 80, $yellow, $blue, $green, $red, $coords, $coords_min, $coords_max); -//second page +// write label +$pdf->Text(110, 240, 'CoonsPatchMesh()'); + +// --- second page ----------------------------------------- $pdf->AddPage(); -//first patch: f = 0 +// first patch: f = 0 $patch_array[0]['f'] = 0; $patch_array[0]['points'] = array( 0.00,0.00, 0.33,0.00, @@ -124,7 +143,7 @@ $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 +// second patch - above the other: f = 2 $patch_array[1]['f'] = 2; $patch_array[1]['points'] = array( 0.00,1.33, @@ -134,7 +153,7 @@ $patch_array[1]['points'] = array( $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 +// third patch - right of the above: f = 3 $patch_array[2]['f'] = 3; $patch_array[2]['points'] = array( 1.33,0.80, @@ -144,7 +163,7 @@ $patch_array[2]['points'] = array( $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 +// 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, @@ -157,7 +176,10 @@ $patch_array[3]['colors'][1] = array('r' => 0, 'g' => 0, 'b' => 255); $coords_min = 0; $coords_max = 2; -$pdf->CoonsPatchMesh(10, 25, 190, 200, '', '', '', '', $patch_array, $coords_min, $coords_max); +$pdf->CoonsPatchMesh(10, 45, 190, 200, '', '', '', '', $patch_array, $coords_min, $coords_max); + +// write label +$pdf->Text(10, 250, 'CoonsPatchMesh()'); // --------------------------------------------------------- @@ -165,6 +187,6 @@ $pdf->CoonsPatchMesh(10, 25, 190, 200, '', '', '', '', $patch_array, $coords_min $pdf->Output('example_030.pdf', 'I'); //============================================================+ -// END OF FILE +// END OF FILE //============================================================+ ?> diff --git a/examples/example_031.php b/examples/example_031.php index d22ffdf..a2d48f8 100755 --- a/examples/example_031.php +++ b/examples/example_031.php @@ -2,7 +2,7 @@ //============================================================+ // File name : example_031.php // Begin : 2008-06-09 -// Last Update : 2010-05-04 +// Last Update : 2010-05-20 // // Description : Example 031 for TCPDF class // Pie Chart @@ -43,15 +43,20 @@ $pdf->SetTitle('TCPDF Example 031'); $pdf->SetSubject('TCPDF Tutorial'); $pdf->SetKeywords('TCPDF, PDF, example, test, guide'); -// disable header and footer -$pdf->setPrintHeader(false); -$pdf->setPrintFooter(false); +// 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); @@ -65,22 +70,32 @@ $pdf->setLanguageArray($l); // --------------------------------------------------------- // set font -$pdf->SetFont('helvetica', '', 14); +$pdf->SetFont('helvetica', 'B', 20); // add a page $pdf->AddPage(); -$xc = 105; -$yc = 55; -$r = 40; +$pdf->Write(0, 'Example of PieSector() method.'); -$pdf->SetFillColor(120, 120, 255); +$xc = 105; +$yc = 100; +$r = 50; + +$pdf->SetFillColor(0, 0, 255); $pdf->PieSector($xc, $yc, $r, 20, 120, 'FD', false, 0, 2); -$pdf->SetFillColor(120, 255, 120); + +$pdf->SetFillColor(0, 255, 0); $pdf->PieSector($xc, $yc, $r, 120, 250, 'FD', false, 0, 2); -$pdf->SetFillColor(255, 120, 120); + +$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 diff --git a/examples/example_032.php b/examples/example_032.php index 6ef54c3..6e89e25 100755 --- a/examples/example_032.php +++ b/examples/example_032.php @@ -2,13 +2,13 @@ //============================================================+ // File name : example_032.php // Begin : 2008-06-09 -// Last Update : 2009-09-30 -// +// Last Update : 2010-05-20 +// // Description : Example 032 for TCPDF class // EPS/AI image -// +// // Author: Nicola Asuni -// +// // (c) Copyright: // Nicola Asuni // Tecnick.com s.r.l. @@ -34,7 +34,7 @@ require_once('../config/lang/eng.php'); require_once('../tcpdf.php'); // create new PDF document -$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); +$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); // set document information $pdf->SetCreator(PDF_CREATOR); @@ -43,40 +43,47 @@ $pdf->SetTitle('TCPDF Example 032'); $pdf->SetSubject('TCPDF Tutorial'); $pdf->SetKeywords('TCPDF, PDF, example, test, guide'); -// disable header and footer -$pdf->setPrintHeader(false); -$pdf->setPrintFooter(false); +// 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); +$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); //set some language-dependent strings -$pdf->setLanguageArray($l); +$pdf->setLanguageArray($l); // --------------------------------------------------------- // set font -$pdf->SetFont('helvetica', '', 14); +$pdf->SetFont('helvetica', '', 12); -// Page 1: AI $pdf->AddPage(); -$pdf->ImageEps('../images/tiger.ai', 10, 50, 190); -// Page 2: EPS, with link +$pdf->Write(0, 'Example of ImageEPS() method for AI and EPS images'); + +$pdf->ImageEps($file='../images/tiger.ai', $x=10, $y=50, $w=190, $h=190, $link='', $useBoundingBox=true, $align='', $palign='', $border=0, $fitonpage=false); + $pdf->AddPage(); + $pdf->ImageEps('../images/bug.eps', 0, 25, 0, 240, "http://www.tcpdf.org", true, 'T', 'C'); -// Page 3: AI $pdf->AddPage(); + $pdf->ImageEps('../images/pelican.ai', 15, 70, 180); // --------------------------------------------------------- @@ -85,6 +92,6 @@ $pdf->ImageEps('../images/pelican.ai', 15, 70, 180); $pdf->Output('example_032.pdf', 'I'); //============================================================+ -// END OF FILE +// END OF FILE //============================================================+ ?> diff --git a/examples/example_033.php b/examples/example_033.php index 9972d6b..581f28e 100755 --- a/examples/example_033.php +++ b/examples/example_033.php @@ -2,13 +2,13 @@ //============================================================+ // File name : example_033.php // Begin : 2008-06-24 -// Last Update : 2009-09-30 -// +// Last Update : 2010-05-20 +// // Description : Example 033 for TCPDF class // Mixed font types -// +// // Author: Nicola Asuni -// +// // (c) Copyright: // Nicola Asuni // Tecnick.com s.r.l. @@ -34,7 +34,7 @@ require_once('../config/lang/eng.php'); require_once('../tcpdf.php'); // create new PDF document -$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); +$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); // set document information $pdf->SetCreator(PDF_CREATOR); @@ -44,7 +44,7 @@ $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, PDF_HEADER_STRING); +$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 033', PDF_HEADER_STRING); // set header and footer fonts $pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); @@ -62,27 +62,36 @@ $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); //set image scale factor -$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); +$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); //set some language-dependent strings -$pdf->setLanguageArray($l); +$pdf->setLanguageArray($l); // --------------------------------------------------------- // add a page $pdf->AddPage(); -$pdf->SetFont('dejavusans', '', 10); -$pdf->MultiCell(80, 0, "[True Type Unicode font] : Cras eros leo, porttitor porta, accumsan fermentum, ornare ac, est. Praesent dui lorem, imperdiet at, cursus sed, facilisis aliquam, nibh. Nulla accumsan nonummy diam. Donec tempus. Etiam posuere. Proin lectus. Donec purus. Duis in sem pretium urna feugiat vehicula. Ut suscipit velit eget massa. Nam nonummy, enim commodo euismod placerat, tortor elit tempus lectus, quis suscipit metus lorem blandit turpis.\n", 1, 'J', 0, 1, '', '', true, 0); +$pdf->SetFont('helvetica', 'B', 20); -$pdf->Ln(2); +$pdf->Write(0, 'Font Types', '', 0, 'C', 1, 0, false, false, 0); + +$pdf->Ln(10); $pdf->SetFont('times', '', 10); + $pdf->MultiCell(80, 0, "[Core font] : Cras eros leo, porttitor porta, accumsan fermentum, ornare ac, est. Praesent dui lorem, imperdiet at, cursus sed, facilisis aliquam, nibh. Nulla accumsan nonummy diam. Donec tempus. Etiam posuere. Proin lectus. Donec purus. Duis in sem pretium urna feugiat vehicula. Ut suscipit velit eget massa. Nam nonummy, enim commodo euismod placerat, tortor elit tempus lectus, quis suscipit metus lorem blandit turpis.\n", 1, 'J', 0, 1, '', '', true, 0); $pdf->Ln(2); +$pdf->SetFont('dejavusans', '', 10); + +$pdf->MultiCell(80, 0, "[True Type Unicode font] : Cras eros leo, porttitor porta, accumsan fermentum, ornare ac, est. Praesent dui lorem, imperdiet at, cursus sed, facilisis aliquam, nibh. Nulla accumsan nonummy diam. Donec tempus. Etiam posuere. Proin lectus. Donec purus. Duis in sem pretium urna feugiat vehicula. Ut suscipit velit eget massa. Nam nonummy, enim commodo euismod placerat, tortor elit tempus lectus, quis suscipit metus lorem blandit turpis.\n", 1, 'J', 0, 1, '', '', true, 0); + +$pdf->Ln(2); + $pdf->SetFont('arialunicid0', '', 9); + $pdf->MultiCell(80, 0, "[CID-0 font] : Cras eros leo, porttitor porta, accumsan fermentum, ornare ac, est. Praesent dui lorem, imperdiet at, cursus sed, facilisis aliquam, nibh. Nulla accumsan nonummy diam. Donec tempus. Etiam posuere. Proin lectus. Donec purus. Duis in sem pretium urna feugiat vehicula. Ut suscipit velit eget massa. Nam nonummy, enim commodo euismod placerat, tortor elit tempus lectus, quis suscipit metus lorem blandit turpis.\n", 1, 'J', 0, 1, '', '', true, 0); @@ -92,6 +101,6 @@ $pdf->MultiCell(80, 0, "[CID-0 font] : Cras eros leo, porttitor porta, accumsan $pdf->Output('example_033.pdf', 'I'); //============================================================+ -// END OF FILE +// END OF FILE //============================================================+ ?> diff --git a/examples/example_034.php b/examples/example_034.php index e037f7e..f06cd67 100755 --- a/examples/example_034.php +++ b/examples/example_034.php @@ -2,13 +2,13 @@ //============================================================+ // File name : example_034.php // Begin : 2008-07-18 -// Last Update : 2009-09-30 -// +// Last Update : 2010-05-20 +// // Description : Example 034 for TCPDF class // Clipping -// +// // Author: Nicola Asuni -// +// // (c) Copyright: // Nicola Asuni // Tecnick.com s.r.l. @@ -34,7 +34,7 @@ require_once('../config/lang/eng.php'); require_once('../tcpdf.php'); // create new PDF document -$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); +$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); // set document information $pdf->SetCreator(PDF_CREATOR); @@ -44,7 +44,7 @@ $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, PDF_HEADER_STRING); +$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 034', PDF_HEADER_STRING); // set header and footer fonts $pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); @@ -62,27 +62,29 @@ $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); //set image scale factor -$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); +$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); //set some language-dependent strings -$pdf->setLanguageArray($l); +$pdf->setLanguageArray($l); // --------------------------------------------------------- // set font -$pdf->SetFont('helvetica', 'BI', 50); +$pdf->SetFont('helvetica', 'B', 20); // add a page $pdf->AddPage(); +$pdf->Write(0, 'Image Clipping using geometric functions', '', 0, 'C', 1, 0, false, false, 0); + //Start Graphic Transformation $pdf->StartTransform(); // set clipping mask -$pdf->StarPolygon(50, 70, 30, 10, 3, 0, 1, 'CNZ'); +$pdf->StarPolygon(105, 100, 30, 10, 3, 0, 1, 'CNZ'); // draw jpeg image to be clipped -$pdf->Image('../images/image_demo.jpg', 20, 40, 60, 60, '', 'http://www.tcpdf.org', '', true, 72); +$pdf->Image('../images/image_demo.jpg', 75, 70, 60, 60, '', 'http://www.tcpdf.org', '', true, 72); //Stop Graphic Transformation $pdf->StopTransform(); @@ -93,6 +95,6 @@ $pdf->StopTransform(); $pdf->Output('example_034.pdf', 'I'); //============================================================+ -// END OF FILE +// END OF FILE //============================================================+ ?> diff --git a/examples/example_035.php b/examples/example_035.php index 00065d2..0a95ec3 100755 --- a/examples/example_035.php +++ b/examples/example_035.php @@ -2,13 +2,13 @@ //============================================================+ // File name : example_035.php // Begin : 2008-07-22 -// Last Update : 2009-09-30 -// +// Last Update : 2010-05-20 +// // Description : Example 035 for TCPDF class // Line styles with cells and multicells -// +// // Author: Nicola Asuni -// +// // (c) Copyright: // Nicola Asuni // Tecnick.com s.r.l. @@ -34,7 +34,7 @@ require_once('../config/lang/eng.php'); require_once('../tcpdf.php'); // create new PDF document -$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); +$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); // set document information $pdf->SetCreator(PDF_CREATOR); @@ -44,7 +44,7 @@ $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, PDF_HEADER_STRING); +$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 035', PDF_HEADER_STRING); // set header and footer fonts $pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); @@ -62,10 +62,10 @@ $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); //set image scale factor -$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); +$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); //set some language-dependent strings -$pdf->setLanguageArray($l); +$pdf->setLanguageArray($l); // --------------------------------------------------------- @@ -75,8 +75,7 @@ $pdf->SetFont('times', 'BI', 16); // add a page $pdf->AddPage(); -// print a line using Cell() -$pdf->Cell(0, 12, 'Example 035', 1, 1, 'C'); +$pdf->Write(0, 'Example of SetLineStyle() method', '', 0, 'L', true, 0, false, false, 0); $pdf->Ln(); @@ -111,6 +110,6 @@ $pdf->MultiCell(60, 4, $text, 1, 'C', 1, 1); $pdf->Output('example_035.pdf', 'I'); //============================================================+ -// END OF FILE +// END OF FILE //============================================================+ ?> diff --git a/examples/example_036.php b/examples/example_036.php index 0516040..7285c04 100755 --- a/examples/example_036.php +++ b/examples/example_036.php @@ -2,13 +2,13 @@ //============================================================+ // File name : example_036.php // Begin : 2008-08-08 -// Last Update : 2009-09-30 -// +// Last Update : 2010-05-20 +// // Description : Example 036 for TCPDF class // Annotations -// +// // Author: Nicola Asuni -// +// // (c) Copyright: // Nicola Asuni // Tecnick.com s.r.l. @@ -34,7 +34,7 @@ require_once('../config/lang/eng.php'); require_once('../tcpdf.php'); // create new PDF document -$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); +$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); // set document information $pdf->SetCreator(PDF_CREATOR); @@ -44,7 +44,7 @@ $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, PDF_HEADER_STRING); +$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 036', PDF_HEADER_STRING); // set header and footer fonts $pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); @@ -62,10 +62,10 @@ $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); //set image scale factor -$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); +$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); //set some language-dependent strings -$pdf->setLanguageArray($l); +$pdf->setLanguageArray($l); // --------------------------------------------------------- @@ -75,11 +75,12 @@ $pdf->SetFont('times', '', 16); // add a page $pdf->AddPage(); -// print a line using Cell() -$pdf->Cell(0, 12, 'Example 036', 1, 1, 'C'); +$txt = 'Example of Text Annotation. +Move your mouse over the yellow box or double click on it to display the annotation text.'; +$pdf->Write(0, $txt, '', 0, 'L', true, 0, false, false, 0); // text annotation -$pdf->Annotation(124, 30, 10, 10, "Text annotation example\naccented letters test: àèéìòù", array('Subtype'=>'Text', 'Name' => 'Comment', 'T' => 'title example', 'Subj' => 'example', 'C' => array(255, 255, 0))); +$pdf->Annotation(83, 27, 10, 10, "Text annotation example\naccented letters test: àèéìòù", array('Subtype'=>'Text', 'Name' => 'Comment', 'T' => 'title example', 'Subj' => 'example', 'C' => array(255, 255, 0))); // --------------------------------------------------------- @@ -87,6 +88,6 @@ $pdf->Annotation(124, 30, 10, 10, "Text annotation example\naccented letters tes $pdf->Output('example_036.pdf', 'I'); //============================================================+ -// END OF FILE +// END OF FILE //============================================================+ ?> diff --git a/examples/example_037.php b/examples/example_037.php index f280271..702b1b4 100755 --- a/examples/example_037.php +++ b/examples/example_037.php @@ -2,7 +2,7 @@ //============================================================+ // File name : example_037.php // Begin : 2008-09-12 -// Last Update : 2010-04-05 +// Last Update : 2010-05-20 // // Description : Example 037 for TCPDF class // Spot colors @@ -44,7 +44,7 @@ $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, PDF_HEADER_STRING); +$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 037', PDF_HEADER_STRING); // set header and footer fonts $pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); @@ -70,13 +70,21 @@ $pdf->setLanguageArray($l); // --------------------------------------------------------- // set font -$pdf->SetFont('helvetica', '', 8); +$pdf->SetFont('helvetica', '', 20); // add a page $pdf->AddPage(); + +$pdf->Write(0, 'Example of Spot Colors', '', 0, 'L', true, 0, false, false, 0); + +$pdf->Ln(5); + +$pdf->SetFont('helvetica', '', 8); + // Define some new spot colors -// where c, m, y and k (2nd, 3rd, 4th and 5th parameter) are the equivalent CMYK components. +// $c, $m, $y and $k (2nd, 3rd, 4th and 5th parameter) are the CMYK color components. +// AddSpotColor($name, $c, $m, $y, $k) $pdf->AddSpotColor('Pantone 116 C', 0, 20, 100, 0); $pdf->AddSpotColor('HKS 16 K', 30, 100, 90, 10); $pdf->AddSpotColor('Pantone 505 C', 57, 100, 85, 55); @@ -93,12 +101,16 @@ $pdf->AddSpotColor('NovaSpace-Black', 50, 0, 0, 100); $pdf->AddSpotColor('Pantone 601 C', 0, 0, 55, 0); $pdf->AddSpotColor('Pantone 659 C', 50, 20, 0, 10); -// select the spot color -// where tint (the second parameter) is the intensity of the color (full intensity by default). +// 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('NovaSpace-Black', 100); $pdf->SetDrawSpotColor('NovaSpace-Black', 100); -$starty = 30; +$starty = 50; // print some spot colors $pdf->SetFillSpotColor('Pantone 116 C', 100); diff --git a/examples/example_038.php b/examples/example_038.php index 13386c5..11e4bdd 100755 --- a/examples/example_038.php +++ b/examples/example_038.php @@ -2,13 +2,13 @@ //============================================================+ // File name : example_038.php // Begin : 2008-09-15 -// Last Update : 2009-09-30 -// +// Last Update : 2010-05-20 +// // Description : Example 038 for TCPDF class -// CID-0 CJK Fonts without embedding -// +// CID-0 CJK unembedded font +// // Author: Nicola Asuni -// +// // (c) Copyright: // Nicola Asuni // Tecnick.com s.r.l. @@ -22,7 +22,7 @@ /** * Creates an example PDF TEST document using TCPDF * @package com.tecnick.tcpdf - * @abstract TCPDF - Example: CID-0 CJK Fonts without embedding + * @abstract TCPDF - Example: CID-0 CJK unembedded font * @author Nicola Asuni * @copyright 2004-2009 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com * @link http://tcpdf.org @@ -34,7 +34,7 @@ require_once('../config/lang/eng.php'); require_once('../tcpdf.php'); // create new PDF document -$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); +$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); // set document information $pdf->SetCreator(PDF_CREATOR); @@ -44,7 +44,7 @@ $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, PDF_HEADER_STRING); +$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)); @@ -62,21 +62,23 @@ $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); //set image scale factor -$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); +$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); //set some language-dependent strings -$pdf->setLanguageArray($l); +$pdf->setLanguageArray($l); // --------------------------------------------------------- // set font -$pdf->SetFont('arialunicid0', 'U', 20); +$pdf->SetFont('arialunicid0', '', 20); // add a page $pdf->AddPage(); -// print a line using Cell() -$pdf->Cell(0, 10, 'こんにちは世界', 1, 1, 'C'); +$txt = 'Example of CID-0 CJK unembedded font. +To display extended text you must have CJK fonts for your PDF reader: こんにちは世界'; + +$pdf->Write(0, $txt, '', 0, 'L', true, 0, false, false, 0); // --------------------------------------------------------- @@ -84,6 +86,6 @@ $pdf->Cell(0, 10, 'こんにちは世界', 1, 1, 'C'); $pdf->Output('example_038.pdf', 'I'); //============================================================+ -// END OF FILE +// END OF FILE //============================================================+ ?> diff --git a/examples/example_039.php b/examples/example_039.php index 8eb5b04..84311eb 100755 --- a/examples/example_039.php +++ b/examples/example_039.php @@ -2,13 +2,13 @@ //============================================================+ // File name : example_039.php // Begin : 2008-10-16 -// Last Update : 2009-09-30 -// +// Last Update : 2010-05-20 +// // Description : Example 039 for TCPDF class // HTML justification -// +// // Author: Nicola Asuni -// +// // (c) Copyright: // Nicola Asuni // Tecnick.com s.r.l. @@ -34,7 +34,7 @@ require_once('../config/lang/eng.php'); require_once('../tcpdf.php'); // create new PDF document -$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); +$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); // set document information $pdf->SetCreator(PDF_CREATOR); @@ -44,7 +44,7 @@ $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, PDF_HEADER_STRING); +$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)); @@ -62,28 +62,33 @@ $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); //set image scale factor -$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); +$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); //set some language-dependent strings -$pdf->setLanguageArray($l); +$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 test alt attribute 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); -// add a page -$pdf->AddPage(); - // output the HTML content $pdf->writeHTML($html, true, 0, true, true); $pdf->Ln(); -// set UTF-8 font +// set UTF-8 Unicode font $pdf->SetFont('dejavusans', '', 10); // output the HTML content @@ -98,6 +103,6 @@ $pdf->lastPage(); $pdf->Output('example_039.pdf', 'I'); //============================================================+ -// END OF FILE +// END OF FILE //============================================================+ ?> diff --git a/examples/example_040.php b/examples/example_040.php index bb927de..f3833ee 100755 --- a/examples/example_040.php +++ b/examples/example_040.php @@ -2,13 +2,13 @@ //============================================================+ // File name : example_040.php // Begin : 2008-10-28 -// Last Update : 2009-09-30 -// +// Last Update : 2010-05-20 +// // Description : Example 040 for TCPDF class // Booklet mode (double-sided pages) -// +// // Author: Nicola Asuni -// +// // (c) Copyright: // Nicola Asuni // Tecnick.com s.r.l. @@ -34,7 +34,7 @@ require_once('../config/lang/eng.php'); require_once('../tcpdf.php'); // create new PDF document -$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); +$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); // set document information $pdf->SetCreator(PDF_CREATOR); @@ -44,7 +44,7 @@ $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, PDF_HEADER_STRING); +$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)); @@ -62,13 +62,19 @@ $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); //set image scale factor -$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); +$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); //set some language-dependent strings -$pdf->setLanguageArray($l); +$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); @@ -78,9 +84,12 @@ $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, 'LEFT PAGE 1', 1, 1, 'C'); + // add a page (right page) $pdf->AddPage(); @@ -106,6 +115,6 @@ $pdf->Cell(0, 0, 'RIGHT PAGE 4', 1, 1, 'C'); $pdf->Output('example_040.pdf', 'I'); //============================================================+ -// END OF FILE +// END OF FILE //============================================================+ ?> diff --git a/examples/example_041.php b/examples/example_041.php index decc94a..0ad56ca 100755 --- a/examples/example_041.php +++ b/examples/example_041.php @@ -2,13 +2,13 @@ //============================================================+ // File name : example_041.php // Begin : 2008-12-07 -// Last Update : 2009-09-30 -// +// Last Update : 2010-05-20 +// // Description : Example 041 for TCPDF class // Annotation - FileAttachment -// +// // Author: Nicola Asuni -// +// // (c) Copyright: // Nicola Asuni // Tecnick.com s.r.l. @@ -34,7 +34,7 @@ require_once('../config/lang/eng.php'); require_once('../tcpdf.php'); // create new PDF document -$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); +$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); // set document information $pdf->SetCreator(PDF_CREATOR); @@ -44,7 +44,7 @@ $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, PDF_HEADER_STRING); +$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)); @@ -62,10 +62,10 @@ $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); //set image scale factor -$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); +$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); //set some language-dependent strings -$pdf->setLanguageArray($l); +$pdf->setLanguageArray($l); // --------------------------------------------------------- @@ -75,11 +75,13 @@ $pdf->SetFont('times', '', 16); // add a page $pdf->AddPage(); -// print a line using Cell() -$pdf->Cell(0, 12, 'File Attachment', 1, 1, 'C'); + +$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(78, 30, 4, 4, 'text file', array('Subtype'=>'FileAttachment', 'Name' => 'PushPin', 'FS' => '../cache/utf8test.txt')); +$pdf->Annotation(85, 27, 5, 5, 'text file', array('Subtype'=>'FileAttachment', 'Name' => 'PushPin', 'FS' => '../cache/utf8test.txt')); // --------------------------------------------------------- @@ -87,6 +89,6 @@ $pdf->Annotation(78, 30, 4, 4, 'text file', array('Subtype'=>'FileAttachment', ' $pdf->Output('example_041.pdf', 'I'); //============================================================+ -// END OF FILE +// END OF FILE //============================================================+ ?> diff --git a/examples/example_042.php b/examples/example_042.php index 2a94722..dd694e8 100755 --- a/examples/example_042.php +++ b/examples/example_042.php @@ -2,13 +2,13 @@ //============================================================+ // File name : example_042.php // Begin : 2008-12-23 -// Last Update : 2009-09-30 -// +// Last Update : 2010-05-20 +// // Description : Example 042 for TCPDF class // Test Image with alpha channel -// +// // Author: Nicola Asuni -// +// // (c) Copyright: // Nicola Asuni // Tecnick.com s.r.l. @@ -34,7 +34,7 @@ require_once('../config/lang/eng.php'); require_once('../tcpdf.php'); // create new PDF document -$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); +$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); // set document information $pdf->SetCreator(PDF_CREATOR); @@ -44,7 +44,7 @@ $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, PDF_HEADER_STRING); +$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)); @@ -62,10 +62,10 @@ $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); //set image scale factor -$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); +$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); //set some language-dependent strings -$pdf->setLanguageArray($l); +$pdf->setLanguageArray($l); // --------------------------------------------------------- @@ -81,16 +81,17 @@ $pdf->AddPage(); $background_text = str_repeat('TCPDF test PNG Alpha Channel ', 50); $pdf->MultiCell(0, 5, $background_text, 0, 'J', 0, 2, '', '', true, 0, false); - -// [A] The Image() method recognizes the alpha channel embedded on the image: +// --- 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); - -// [B] provide image + separate 8-bit mask +// --- 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); @@ -100,6 +101,6 @@ $pdf->Image('../images/img.png', 50, 140, 100, '', '', 'http://www.tcpdf.org', ' $pdf->Output('example_042.pdf', 'I'); //============================================================+ -// END OF FILE +// END OF FILE //============================================================+ ?> diff --git a/examples/example_043.php b/examples/example_043.php index e49bef5..7385ca1 100755 --- a/examples/example_043.php +++ b/examples/example_043.php @@ -2,13 +2,13 @@ //============================================================+ // File name : example_043.php // Begin : 2009-01-02 -// Last Update : 2009-09-30 -// +// Last Update : 2010-05-20 +// // Description : Example 043 for TCPDF class // Disk caching -// +// // Author: Nicola Asuni -// +// // (c) Copyright: // Nicola Asuni // Tecnick.com s.r.l. @@ -44,7 +44,7 @@ $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, PDF_HEADER_STRING); +$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)); @@ -62,21 +62,21 @@ $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); //set image scale factor -$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); +$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); //set some language-dependent strings -$pdf->setLanguageArray($l); +$pdf->setLanguageArray($l); // --------------------------------------------------------- // set font -$pdf->SetFont('times', '', 10); +$pdf->SetFont('helvetica', '', 16); // add a page $pdf->AddPage(); // Multicell test -$pdf->MultiCell(0, 0, "DISK CACHING TEST: check the parameters on class constructor.", 1, 'L', 0, 0, '', '', true); +$pdf->MultiCell(0, 0, 'DISK CACHING TEST: check the parameters of the class constructor.', 1, 'L', 0, 0, '', '', true); // --------------------------------------------------------- @@ -84,6 +84,6 @@ $pdf->MultiCell(0, 0, "DISK CACHING TEST: check the parameters on class construc $pdf->Output('example_043.pdf', 'I'); //============================================================+ -// END OF FILE +// END OF FILE //============================================================+ ?> diff --git a/examples/example_044.php b/examples/example_044.php index c4819ef..40113ff 100755 --- a/examples/example_044.php +++ b/examples/example_044.php @@ -2,7 +2,7 @@ //============================================================+ // File name : example_044.php // Begin : 2009-01-02 -// Last Update : 2010-04-20 +// Last Update : 2010-05-20 // // Description : Example 044 for TCPDF class // Move, copy and delete pages @@ -44,7 +44,7 @@ $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, PDF_HEADER_STRING); +$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)); @@ -70,32 +70,42 @@ $pdf->setLanguageArray($l); // --------------------------------------------------------- // set font -$pdf->SetFont('helvetica', '', 18); +$pdf->SetFont('helvetica', 'B', 40); // print a line using Cell() $pdf->AddPage(); -$pdf->Cell(0, 10, 'PAGE A', 0, 1, 'L'); +$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->Cell(0, 10, 'PAGE: B', 0, 1, 'L'); $pdf->AddPage(); -$pdf->Cell(0, 10, 'PAGE D', 0, 1, 'L'); +$pdf->Cell(0, 10, 'PAGE: D', 0, 1, 'L'); $pdf->AddPage(); -$pdf->Cell(0, 10, 'PAGE E', 0, 1, 'L'); +$pdf->Cell(0, 10, 'PAGE: E', 0, 1, 'L'); $pdf->AddPage(); -$pdf->Cell(0, 10, 'PAGE E-2', 0, 1, 'L'); +$pdf->Cell(0, 10, 'PAGE: E-2', 0, 1, 'L'); $pdf->AddPage(); -$pdf->Cell(0, 10, 'PAGE F', 0, 1, 'L'); +$pdf->Cell(0, 10, 'PAGE: F', 0, 1, 'L'); $pdf->AddPage(); -$pdf->Cell(0, 10, 'PAGE C', 0, 1, 'L'); +$pdf->Cell(0, 10, 'PAGE: C', 0, 1, 'L'); $pdf->AddPage(); -$pdf->Cell(0, 10, 'PAGE G', 0, 1, 'L'); +$pdf->Cell(0, 10, 'PAGE: G', 0, 1, 'L'); // Move page 7 to page 3 $pdf->movePage(7, 3); @@ -104,7 +114,7 @@ $pdf->movePage(7, 3); $pdf->deletePage(6); $pdf->AddPage(); -$pdf->Cell(0, 10, 'PAGE H', 0, 1, 'L'); +$pdf->Cell(0, 10, 'PAGE: H', 0, 1, 'L'); // copy the second page $pdf->copyPage(2); diff --git a/examples/example_045.php b/examples/example_045.php index e52b21b..aabedca 100755 --- a/examples/example_045.php +++ b/examples/example_045.php @@ -2,13 +2,13 @@ //============================================================+ // File name : example_045.php // Begin : 2008-03-04 -// Last Update : 2010-05-06 -// +// Last Update : 2010-05-20 +// // Description : Example 045 for TCPDF class // Bookmarks and Table of Content -// +// // Author: Nicola Asuni -// +// // (c) Copyright: // Nicola Asuni // Tecnick.com s.r.l. @@ -34,7 +34,7 @@ require_once('../config/lang/eng.php'); require_once('../tcpdf.php'); // create new PDF document -$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); +$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); // set document information $pdf->SetCreator(PDF_CREATOR); @@ -44,7 +44,7 @@ $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, PDF_HEADER_STRING); +$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)); @@ -62,10 +62,10 @@ $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); //set image scale factor -$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); +$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); //set some language-dependent strings -$pdf->setLanguageArray($l); +$pdf->setLanguageArray($l); // --------------------------------------------------------- @@ -97,6 +97,7 @@ $pdf->AddPage(); $pdf->Bookmark('Paragraph 1.3', 1, 0); $pdf->Cell(0, 10, 'Paragraph 1.3', 0, 1, 'L'); +// add some pages and bookmarks for ($i = 2; $i < 12; $i++) { $pdf->AddPage(); $pdf->Bookmark('Chapter '.$i, 0, 0); @@ -115,7 +116,8 @@ $pdf->Ln(); $pdf->SetFont('dejavusans', '', 12); -// add table of content at page 1 +// add a simple Table Of Content at first page +// (check the example n. 59 for the HTML version) $pdf->addTOC(1, 'courier', '.', 'INDEX'); // end of TOC page @@ -127,6 +129,6 @@ $pdf->endTOCPage(); $pdf->Output('example_045.pdf', 'I'); //============================================================+ -// END OF FILE +// END OF FILE //============================================================+ ?> diff --git a/examples/example_046.php b/examples/example_046.php index ebd470f..3274f64 100755 --- a/examples/example_046.php +++ b/examples/example_046.php @@ -2,7 +2,7 @@ //============================================================+ // File name : example_046.php // Begin : 2009-02-28 -// Last Update : 2010-04-12 +// Last Update : 2010-05-20 // // Description : Example 046 for TCPDF class // Text Hyphenation @@ -44,7 +44,7 @@ $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, PDF_HEADER_STRING); +$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)); @@ -70,11 +70,15 @@ $pdf->setLanguageArray($l); // --------------------------------------------------------- // set font -$pdf->SetFont('times', '', 10); +$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 @@ -105,6 +109,10 @@ $html = $pdf->hyphenateText($html, $hyphen_patterns, $dictionary=array(), $leftm // HTML text with soft hyphens (­) $html = 'On the other hand, we de­nounce with righ­teous in­dig­na­tion and dis­like men who are so be­guiled and de­mo­r­al­ized by the charms of plea­sure of the mo­ment, so blind­ed by de­sire, that they can­not fore­see the pain and trou­ble that are bound to en­sue; and equal blame be­longs to those who fail in their du­ty through weak­ness of will, which is the same as say­ing through shrink­ing from toil and pain. Th­ese cas­es are per­fect­ly sim­ple and easy to distin­guish. In a free hour, when our pow­er of choice is un­tram­melled and when noth­ing pre­vents our be­ing able to do what we like best, ev­ery plea­sure is to be wel­comed and ev­ery pain avoid­ed. But in cer­tain cir­cum­s­tances and ow­ing to the claims of du­ty or the obli­ga­tions of busi­ness it will fre­quent­ly oc­cur that plea­sures have to be re­pu­di­at­ed and an­noy­ances ac­cept­ed. The wise man there­fore al­ways holds in th­ese mat­ters to this prin­ci­ple of se­lec­tion: he re­jects plea­sures to se­cure other greater plea­sures, or else he en­dures 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'); diff --git a/examples/example_047.php b/examples/example_047.php index 98c8a1c..2b64df3 100644 --- a/examples/example_047.php +++ b/examples/example_047.php @@ -2,13 +2,13 @@ //============================================================+ // File name : example_047.php // Begin : 2009-03-19 -// Last Update : 2009-09-30 -// +// Last Update : 2010-05-20 +// // Description : Example 047 for TCPDF class // Transactions -// +// // Author: Nicola Asuni -// +// // (c) Copyright: // Nicola Asuni // Tecnick.com s.r.l. @@ -34,7 +34,7 @@ require_once('../config/lang/eng.php'); require_once('../tcpdf.php'); // create new PDF document -$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); +$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); // set document information $pdf->SetCreator(PDF_CREATOR); @@ -44,7 +44,7 @@ $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, PDF_HEADER_STRING); +$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)); @@ -62,19 +62,28 @@ $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); //set image scale factor -$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); +$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); //set some language-dependent strings -$pdf->setLanguageArray($l); +$pdf->setLanguageArray($l); // --------------------------------------------------------- // set font -$pdf->SetFont('helvetica', '', 10); +$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(); @@ -83,7 +92,7 @@ $pdf->Write(0, "LINE 2\n"); // restarts transaction $pdf->startTransaction(); - + $pdf->Write(0, "LINE 3\n"); $pdf->Write(0, "LINE 4\n"); @@ -94,12 +103,12 @@ $pdf->Write(0, "LINE 5\n"); $pdf->Write(0, "LINE 6\n"); // start transaction -$pdf->startTransaction(); +$pdf->startTransaction(); $pdf->Write(0, "LINE 7\n"); // commit transaction (actually just frees memory) -$pdf->commitTransaction(); +$pdf->commitTransaction(); // --------------------------------------------------------- @@ -107,6 +116,6 @@ $pdf->commitTransaction(); $pdf->Output('example_047.pdf', 'I'); //============================================================+ -// END OF FILE +// END OF FILE //============================================================+ ?> diff --git a/examples/example_048.php b/examples/example_048.php index 831f8d8..a1b3dcc 100644 --- a/examples/example_048.php +++ b/examples/example_048.php @@ -2,13 +2,13 @@ //============================================================+ // File name : example_048.php // Begin : 2009-03-20 -// Last Update : 2009-09-30 -// +// Last Update : 2010-05-20 +// // Description : Example 048 for TCPDF class // HTML tables and table headers -// +// // Author: Nicola Asuni -// +// // (c) Copyright: // Nicola Asuni // Tecnick.com s.r.l. @@ -34,7 +34,7 @@ require_once('../config/lang/eng.php'); require_once('../tcpdf.php'); // create new PDF document -$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); +$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); // set document information $pdf->SetCreator(PDF_CREATOR); @@ -44,7 +44,7 @@ $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, PDF_HEADER_STRING); +$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)); @@ -62,19 +62,23 @@ $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); //set image scale factor -$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); +$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); //set some language-dependent strings -$pdf->setLanguageArray($l); +$pdf->setLanguageArray($l); // --------------------------------------------------------- // set font -$pdf->SetFont('helvetica', '', 8); +$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 3 - ROW 3
    EOD; @@ -113,7 +117,7 @@ $tbl = <<
    COL 3 - ROW 3
    EOD; @@ -135,7 +139,7 @@ $tbl = <<
    COL 3 - ROW 3
    EOD; @@ -308,6 +312,6 @@ $pdf->writeHTML($tbl, true, false, false, false, ''); $pdf->Output('example_048.pdf', 'I'); //============================================================+ -// END OF FILE +// END OF FILE //============================================================+ ?> diff --git a/examples/example_049.php b/examples/example_049.php index 327b759..b2206e7 100644 --- a/examples/example_049.php +++ b/examples/example_049.php @@ -2,7 +2,7 @@ //============================================================+ // File name : example_049.php // Begin : 2009-04-03 -// Last Update : 2010-04-02 +// Last Update : 2010-05-20 // // Description : Example 049 for TCPDF class // WriteHTML with TCPDF callback functions @@ -44,7 +44,7 @@ $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, PDF_HEADER_STRING); +$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)); @@ -83,9 +83,9 @@ 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. -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). +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). * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -100,11 +100,9 @@ $params = $pdf->serializeTCPDFtagParameters(array('CODE 39', 'C39', '', '', 80, $html .= ''; $params = $pdf->serializeTCPDFtagParameters(array('CODE 128C+', 'C128C', '', '', 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 .= ''; -$html .= ' -

    Graphic Functions

    '; +$html .= '

    Graphic Functions

    '; $params = $pdf->serializeTCPDFtagParameters(array(0)); $html .= ''; diff --git a/examples/example_050.php b/examples/example_050.php index 8f2380f..5365720 100644 --- a/examples/example_050.php +++ b/examples/example_050.php @@ -2,7 +2,7 @@ //============================================================+ // File name : example_050.php // Begin : 2009-04-09 -// Last Update : 2010-04-30 +// Last Update : 2010-05-20 // // Description : Example 050 for TCPDF class // 2D Barcodes @@ -44,7 +44,7 @@ $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, PDF_HEADER_STRING); +$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 050', PDF_HEADER_STRING); // set header and footer fonts $pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); diff --git a/examples/example_051.php b/examples/example_051.php index 653f0c2..af1fa29 100644 --- a/examples/example_051.php +++ b/examples/example_051.php @@ -2,13 +2,13 @@ //============================================================+ // File name : example_051.php // Begin : 2009-04-16 -// Last Update : 2010-03-22 -// +// Last Update : 2010-05-20 +// // Description : Example 051 for TCPDF class // Full page background -// +// // Author: Nicola Asuni -// +// // (c) Copyright: // Nicola Asuni // Tecnick.com s.r.l. @@ -78,10 +78,10 @@ $pdf->setPrintFooter(false); $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); //set image scale factor -$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); +$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); //set some language-dependent strings -$pdf->setLanguageArray($l); +$pdf->setLanguageArray($l); // --------------------------------------------------------- @@ -91,14 +91,18 @@ $pdf->SetFont('times', '', 48); // add a page $pdf->AddPage(); -// Pritn a text -$pdf->writeHTML('PAGE 1', $ln=true, $fill=false, $reseth=false, $cell=false, $align=''); +// Print a text +$html = ' PAGE 1  +

    You can set a full page background.

    '; +$pdf->writeHTML($html, true, false, true, false, ''); + // add a page $pdf->AddPage(); -// Pritn a text -$pdf->writeHTML('PAGE 2', $ln=true, $fill=false, $reseth=false, $cell=false, $align=''); +// Print a text +$html = ' PAGE 2 '; +$pdf->writeHTML($html, true, false, true, false, ''); // --------------------------------------------------------- @@ -106,6 +110,6 @@ $pdf->writeHTML('PAGE 2' $pdf->Output('example_051.pdf', 'I'); //============================================================+ -// END OF FILE +// END OF FILE //============================================================+ ?> diff --git a/examples/example_052.php b/examples/example_052.php index c7f41a8..e3beb95 100644 --- a/examples/example_052.php +++ b/examples/example_052.php @@ -2,7 +2,7 @@ //============================================================+ // File name : example_052.php // Begin : 2009-05-07 -// Last Update : 2010-05-12 +// Last Update : 2010-05-20 // // Description : Example 052 for TCPDF class // Certification Signature (experimental) @@ -44,7 +44,7 @@ $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, PDF_HEADER_STRING); +$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 052', PDF_HEADER_STRING); // set header and footer fonts $pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); @@ -91,13 +91,13 @@ $info = array( $pdf->setSignature($certificate, $certificate, 'tcpdfdemo', '', 2, $info); // set font -$pdf->SetFont('helvetica', '', 10); +$pdf->SetFont('helvetica', '', 12); // add a page $pdf->AddPage(); // print a line of text -$text = 'This is a digitally signed document using the default (example) tcpdf.crt certificate.
    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.'; +$text = 'This is a digitally signed document using the default (example) tcpdf.crt certificate.
    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); // --------------------------------------------------------- diff --git a/examples/example_053.php b/examples/example_053.php index 891c2cf..1845f59 100644 --- a/examples/example_053.php +++ b/examples/example_053.php @@ -2,13 +2,13 @@ //============================================================+ // File name : example_053.php // Begin : 2009-09-02 -// Last Update : 2009-09-30 -// +// Last Update : 2010-05-20 +// // Description : Example 053 for TCPDF class // Javascript example. -// +// // Author: Nicola Asuni -// +// // (c) Copyright: // Nicola Asuni // Tecnick.com s.r.l. @@ -34,7 +34,7 @@ require_once('../config/lang/eng.php'); require_once('../tcpdf.php'); // create new PDF document -$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); +$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); // set document information $pdf->SetCreator(PDF_CREATOR); @@ -44,7 +44,7 @@ $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, PDF_HEADER_STRING); +$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)); @@ -62,10 +62,10 @@ $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); //set image scale factor -$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); +$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); //set some language-dependent strings -$pdf->setLanguageArray($l); +$pdf->setLanguageArray($l); // --------------------------------------------------------- @@ -76,7 +76,7 @@ $pdf->SetFont('times', '', 14); $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.'; +$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 @@ -107,6 +107,6 @@ $pdf->IncludeJS($js); $pdf->Output('example_053.pdf', 'I'); //============================================================+ -// END OF FILE +// END OF FILE //============================================================+ ?> diff --git a/examples/example_054.php b/examples/example_054.php index a447293..0c95c2e 100644 --- a/examples/example_054.php +++ b/examples/example_054.php @@ -2,13 +2,13 @@ //============================================================+ // File name : example_054.php // Begin : 2009-09-07 -// Last Update : 2009-09-30 -// +// Last Update : 2010-05-20 +// // Description : Example 054 for TCPDF class // XHTML Forms -// +// // Author: Nicola Asuni -// +// // (c) Copyright: // Nicola Asuni // Tecnick.com s.r.l. @@ -34,7 +34,7 @@ require_once('../config/lang/eng.php'); require_once('../tcpdf.php'); // create new PDF document -$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); +$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); // set document information $pdf->SetCreator(PDF_CREATOR); @@ -44,7 +44,7 @@ $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, PDF_HEADER_STRING); +$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 054', PDF_HEADER_STRING); // set header and footer fonts $pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); @@ -62,10 +62,10 @@ $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); //set image scale factor -$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); +$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); //set some language-dependent strings -$pdf->setLanguageArray($l); +$pdf->setLanguageArray($l); // --------------------------------------------------------- @@ -124,6 +124,6 @@ $pdf->lastPage(); $pdf->Output('example_054.pdf', 'I'); //============================================================+ -// END OF FILE +// END OF FILE //============================================================+ ?> diff --git a/examples/example_055.php b/examples/example_055.php index abe7cf0..df2e640 100644 --- a/examples/example_055.php +++ b/examples/example_055.php @@ -2,13 +2,13 @@ //============================================================+ // File name : example_055.php // Begin : 2009-10-21 -// Last Update : 2009-10-21 -// +// Last Update : 2010-05-20 +// // Description : Example 055 for TCPDF class // Display all characters available on core fonts. -// +// // Author: Nicola Asuni -// +// // (c) Copyright: // Nicola Asuni // Tecnick.com s.r.l. @@ -34,7 +34,7 @@ require_once('../config/lang/eng.php'); require_once('../tcpdf.php'); // create new PDF document -$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); +$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); // set document information $pdf->SetCreator(PDF_CREATOR); @@ -44,7 +44,7 @@ $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, PDF_HEADER_STRING); +$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 055', PDF_HEADER_STRING); // set header and footer fonts $pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); @@ -62,10 +62,10 @@ $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); //set image scale factor -$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); +$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); //set some language-dependent strings -$pdf->setLanguageArray($l); +$pdf->setLanguageArray($l); // --------------------------------------------------------- @@ -78,13 +78,13 @@ $pdf->AddPage(); // array of core font names $core_fonts = array('courier', 'helvetica', 'times', 'symbol', 'zapfdingbats'); -$html = '

    Font Dump

    '; +$html = '

    Core Fonts Dump

    '; // create one HTML table for each core font foreach($core_fonts as $font) { // create HTML content $html .= ''; - $html .= ''; + $html .= ''; // print each character for ($i = 0; $i < 256; ++$i) { if (($i > 0) AND (($i % 16) == 0)) { @@ -96,7 +96,7 @@ foreach($core_fonts as $font) { $chr = strtr($chr, $trans); $html .= ''; } - $html .= '
    '.strtoupper($font).'
    '.strtoupper($font).'
    '.$chr.'

    '; + $html .= '

     
    '; } // output the HTML content @@ -108,6 +108,6 @@ $pdf->writeHTML($html, true, false, true, false, ''); $pdf->Output('example_055.pdf', 'I'); //============================================================+ -// END OF FILE +// END OF FILE //============================================================+ ?> diff --git a/examples/example_056.php b/examples/example_056.php index bde624f..f22163e 100644 --- a/examples/example_056.php +++ b/examples/example_056.php @@ -2,7 +2,7 @@ //============================================================+ // File name : example_056.php // Begin : 2010-03-26 -// Last Update : 2010-03-26 +// Last Update : 2010-05-20 // // Description : Example 056 for TCPDF class // Crop marks and color registration bars @@ -43,15 +43,20 @@ $pdf->SetTitle('TCPDF Example 056'); $pdf->SetSubject('TCPDF Tutorial'); $pdf->SetKeywords('TCPDF, PDF, example, test, guide'); -// disable header and footer -$pdf->setPrintHeader(false); -$pdf->setPrintFooter(false); +// set default header data +$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 056', 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); @@ -65,41 +70,45 @@ $pdf->setLanguageArray($l); // --------------------------------------------------------- // set font -$pdf->SetFont('helvetica', '', 10); +$pdf->SetFont('helvetica', '', 20); // add a page $pdf->AddPage(); +$pdf->Write(0, 'Example of Crop Marks and Color Registration Bars', '', 0, 'L', true, 0, false, false, 0); + +$pdf->Ln(5); + // color registration bars -$pdf->colorRegistrationBar($x=50, $y=50, $w=40, $h=40, $transition=true, $vertical=false, $colors='A,R,G,B,C,M,Y,K'); -$pdf->colorRegistrationBar($x=90, $y=50, $w=40, $h=40, $transition=true, $vertical=true, $colors='A,R,G,B,C,M,Y,K'); -$pdf->colorRegistrationBar($x=50, $y=95, $w=80, $h=5, $transition=false, $vertical=true, $colors='A,W,R,G,B,C,M,Y,K'); -$pdf->colorRegistrationBar($x=135, $y=50, $w=5, $h=50, $transition=false, $vertical=false, $colors='A,W,R,G,B,C,M,Y,K'); +$pdf->colorRegistrationBar($x=50, $y=70, $w=40, $h=40, $transition=true, $vertical=false, $colors='A,R,G,B,C,M,Y,K'); +$pdf->colorRegistrationBar($x=90, $y=70, $w=40, $h=40, $transition=true, $vertical=true, $colors='A,R,G,B,C,M,Y,K'); +$pdf->colorRegistrationBar($x=50, $y=115, $w=80, $h=5, $transition=false, $vertical=true, $colors='A,W,R,G,B,C,M,Y,K'); +$pdf->colorRegistrationBar($x=135, $y=70, $w=5, $h=50, $transition=false, $vertical=false, $colors='A,W,R,G,B,C,M,Y,K'); // corner crop marks -$pdf->cropMark($x=50, $y=50, $w=10, $h=10, $type='A', $color=array(0,0,0)); -$pdf->cropMark($x=140, $y=50, $w=10, $h=10, $type='B', $color=array(0,0,0)); -$pdf->cropMark($x=50, $y=100, $w=10, $h=10, $type='C', $color=array(0,0,0)); -$pdf->cropMark($x=140, $y=100, $w=10, $h=10, $type='D', $color=array(0,0,0)); +$pdf->cropMark($x=50, $y=70, $w=10, $h=10, $type='A', $color=array(0,0,0)); +$pdf->cropMark($x=140, $y=70, $w=10, $h=10, $type='B', $color=array(0,0,0)); +$pdf->cropMark($x=50, $y=120, $w=10, $h=10, $type='C', $color=array(0,0,0)); +$pdf->cropMark($x=140, $y=120, $w=10, $h=10, $type='D', $color=array(0,0,0)); // various crop marks -$pdf->cropMark($x=95, $y=45, $w=5, $h=5, $type='A,B', $color=array(255,0,0)); -$pdf->cropMark($x=95, $y=105, $w=5, $h=5, $type='C,D', $color=array(255,0,0)); +$pdf->cropMark($x=95, $y=65, $w=5, $h=5, $type='A,B', $color=array(255,0,0)); +$pdf->cropMark($x=95, $y=125, $w=5, $h=5, $type='C,D', $color=array(255,0,0)); -$pdf->cropMark($x=45, $y=75, $w=5, $h=5, $type='A,C', $color=array(0,255,0)); -$pdf->cropMark($x=145, $y=75, $w=5, $h=5, $type='B,D', $color=array(0,255,0)); +$pdf->cropMark($x=45, $y=95, $w=5, $h=5, $type='A,C', $color=array(0,255,0)); +$pdf->cropMark($x=145, $y=95, $w=5, $h=5, $type='B,D', $color=array(0,255,0)); -$pdf->cropMark($x=95, $y=120, $w=5, $h=5, $type='A,D', $color=array(0,0,255)); +$pdf->cropMark($x=95, $y=140, $w=5, $h=5, $type='A,D', $color=array(0,0,255)); // registration marks -$pdf->registrationMark($x=40, $y=40, $r=5, $double=false, $cola=array(0,0,0), $colb=array(255,255,255)); -$pdf->registrationMark($x=150, $y=40, $r=5, $double=true, $cola=array(0,0,0), $colb=array(255,255,0)); -$pdf->registrationMark($x=40, $y=110, $r=5, $double=true, $cola=array(0,0,0), $colb=array(255,255,0)); -$pdf->registrationMark($x=150, $y=110, $r=5, $double=false, $cola=array(0,0,0), $colb=array(255,255,255)); +$pdf->registrationMark($x=40, $y=60, $r=5, $double=false, $cola=array(0,0,0), $colb=array(255,255,255)); +$pdf->registrationMark($x=150, $y=60, $r=5, $double=true, $cola=array(0,0,0), $colb=array(255,255,0)); +$pdf->registrationMark($x=40, $y=130, $r=5, $double=true, $cola=array(0,0,0), $colb=array(255,255,0)); +$pdf->registrationMark($x=150, $y=130, $r=5, $double=false, $cola=array(0,0,0), $colb=array(255,255,255)); // --------------------------------------------------------- @@ -107,6 +116,6 @@ $pdf->registrationMark($x=150, $y=110, $r=5, $double=false, $cola=array(0,0,0), $pdf->Output('example_056.pdf', 'I'); //============================================================+ -// END OF FILE +// END OF FILE //============================================================+ ?> diff --git a/examples/example_057.php b/examples/example_057.php index f0895ee..3d61fb3 100644 --- a/examples/example_057.php +++ b/examples/example_057.php @@ -2,7 +2,7 @@ //============================================================+ // File name : example_057.php // Begin : 2010-04-03 -// Last Update : 2010-04-07 +// Last Update : 2010-05-20 // // Description : Example 057 for TCPDF class // Cell vertical alignments @@ -44,7 +44,7 @@ $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, PDF_HEADER_STRING); +$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 057', PDF_HEADER_STRING); // set header and footer fonts $pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); @@ -70,16 +70,24 @@ $pdf->setLanguageArray($l); // --------------------------------------------------------- // set font -$pdf->SetFont('helvetica', '', 11); +$pdf->SetFont('helvetica', 'B', 20); // add a page $pdf->AddPage(); +$pdf->Write(0, 'Example of alignment options for Cell()', '', 0, 'L', true, 0, false, false, 0); + +$pdf->SetFont('helvetica', '', 11); + +// set border width $pdf->SetLineWidth(0.7); +// set color for cell border +$pdf->SetDrawColor(0,128,255); + $pdf->setCellHeightRatio(3); -$pdf->SetXY(15, 50); +$pdf->SetXY(15, 60); // text on center $pdf->Cell(30, 0, 'Top-Center', 1, $ln=0, 'C', 0, '', 0, false, 'T', 'C'); @@ -90,7 +98,7 @@ $pdf->Cell(30, 0, 'Baseline-Center', 1, $ln=0, 'C', 0, '', 0, false, 'L', 'C'); $pdf->Cell(30, 0, 'Descent-Center', 1, $ln=0, 'C', 0, '', 0, false, 'D', 'C'); -$pdf->SetXY(15, 80); +$pdf->SetXY(15, 90); // text on top $pdf->Cell(30, 0, 'Top-Top', 1, $ln=0, 'C', 0, '', 0, false, 'T', 'T'); @@ -101,7 +109,7 @@ $pdf->Cell(30, 0, 'Baseline-Top', 1, $ln=0, 'C', 0, '', 0, false, 'L', 'T'); $pdf->Cell(30, 0, 'Descent-Top', 1, $ln=0, 'C', 0, '', 0, false, 'D', 'T'); -$pdf->SetXY(15, 110); +$pdf->SetXY(15, 120); // text on bottom $pdf->Cell(30, 0, 'Top-Bottom', 1, $ln=0, 'C', 0, '', 0, false, 'T', 'B'); @@ -114,9 +122,9 @@ $pdf->Cell(30, 0, 'Descent-Bottom', 1, $ln=0, 'C', 0, '', 0, false, 'D', 'B'); // draw some reference lines $linestyle = array('width' => 0.1, 'cap' => 'butt', 'join' => 'miter', 'dash' => '', 'phase' => 0, 'color' => array(255, 0, 0)); -$pdf->Line(15, 50, 195, 50, $linestyle); -$pdf->Line(15, 80, 195, 80, $linestyle); -$pdf->Line(15, 110, 195, 110, $linestyle); +$pdf->Line(15, 60, 195, 60, $linestyle); +$pdf->Line(15, 90, 195, 90, $linestyle); +$pdf->Line(15, 120, 195, 120, $linestyle); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/example_058.php b/examples/example_058.php index 5b50584..c09bf0a 100644 --- a/examples/example_058.php +++ b/examples/example_058.php @@ -2,7 +2,7 @@ //============================================================+ // File name : example_058.php // Begin : 2010-04-22 -// Last Update : 2010-05-05 +// Last Update : 2010-05-20 // // Description : Example 058 for TCPDF class // SVG Image @@ -44,7 +44,7 @@ $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, PDF_HEADER_STRING); +$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 058', PDF_HEADER_STRING); // set header and footer fonts $pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); @@ -80,6 +80,13 @@ $pdf->AddPage(); $pdf->ImageSVG($file='../images/testsvg.svg', $x=15, $y=30, $w='', $h='', $link='http://www.tcpdf.org', $align='', $palign='', $border=1, $fitonpage=false); +$pdf->ImageSVG($file='../images/tux.svg', $x=30, $y=100, $w='', $h=100, $link='', $align='', $palign='', $border=0, $fitonpage=false); + +$pdf->SetFont('helvetica', '', 8); +$pdf->SetY(195); +$txt = '© The copyright holder of the above Tux image is Larry Ewing, allows anyone to use it for any purpose, provided that the copyright holder is properly attributed. Redistribution, derivative work, commercial use, and all other use is permitted.'; +$pdf->Write(0, $txt, '', 0, 'L', true, 0, false, false, 0); + // --------------------------------------------------------- //Close and output PDF document diff --git a/examples/example_059.php b/examples/example_059.php index 729481a..9cd3561 100644 --- a/examples/example_059.php +++ b/examples/example_059.php @@ -2,7 +2,7 @@ //============================================================+ // File name : example_059.php // Begin : 2010-05-06 -// Last Update : 2010-05-06 +// Last Update : 2010-05-20 // // Description : Example 059 for TCPDF class // Table Of Content using HTML templates. @@ -79,7 +79,7 @@ $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, PDF_HEADER_STRING); +$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 059', PDF_HEADER_STRING); // set header and footer fonts $pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); @@ -105,7 +105,7 @@ $pdf->setLanguageArray($l); // set font $pdf->SetFont('helvetica', '', 10); -// --------------------------------------------------------- +// --------------------------------------------------------- // create some content ... @@ -174,13 +174,14 @@ $bookmark_templates[2] = ' // 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($page=1, $toc_name='INDEX', $bookmark_templates, $correct_align=true); // end of TOC page $pdf->endTOCPage(); // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . - + // --------------------------------------------------------- //Close and output PDF document diff --git a/examples/example_060.php b/examples/example_060.php index e857c8d..17db677 100644 --- a/examples/example_060.php +++ b/examples/example_060.php @@ -2,7 +2,7 @@ //============================================================+ // File name : example_060.php // Begin : 2010-05-17 -// Last Update : 2010-05-17 +// Last Update : 2010-05-20 // // Description : Example 060 for TCPDF class // Advanced page settings. @@ -44,7 +44,7 @@ $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, PDF_HEADER_STRING); +$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)); @@ -70,7 +70,7 @@ $pdf->setLanguageArray($l); // set font $pdf->SetFont('helvetica', '', 20); -// --------------------------------------------------------- +// --------------------------------------------------------- // set page format (read source code documentation for further information) $page_format = array( @@ -90,6 +90,8 @@ $page_format = array( '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'); @@ -98,7 +100,7 @@ $pdf->Cell(0, 12, 'First Page', 1, 1, 'C'); $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 diff --git a/examples/index.php b/examples/index.php index fce23ad..d587459 100644 --- a/examples/index.php +++ b/examples/index.php @@ -40,7 +40,7 @@ echo '<'.'?'.'xml version="1.0" encoding="UTF-8"'.'?'.'>';
  • Non unicode / Alternative config file: [PDF]
  • Multicell complex alignment: [PDF]
  • writeHTML alignment: [PDF]
  • -
  • CMYK colors: [[PDF]
  • +
  • CMYK colors: [PDF]
  • Page Groups: [PDF]
  • Object Visibility: [PDF]
  • Object Transparency: [PDF]
  • diff --git a/tcpdf.php b/tcpdf.php index 3e47cbe..90b5b14 100755 --- a/tcpdf.php +++ b/tcpdf.php @@ -2,9 +2,9 @@ //============================================================+ // File name : tcpdf.php // Begin : 2002-08-03 -// Last Update : 2010-05-19 +// Last Update : 2010-05-21 // Author : Nicola Asuni - info@tecnick.com - http://www.tcpdf.org -// Version : 5.0.013 +// Version : 5.0.014 // License : GNU LGPL (http://www.gnu.org/copyleft/lesser.html) // ---------------------------------------------------------------------------- // Copyright (C) 2002-2010 Nicola Asuni - Tecnick.com S.r.l. @@ -122,7 +122,7 @@ * @copyright 2002-2010 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com * @link http://www.tcpdf.org * @license http://www.gnu.org/copyleft/lesser.html LGPL - * @version 5.0.013 + * @version 5.0.014 */ /** @@ -146,14 +146,14 @@ if (!class_exists('TCPDF', false)) { /** * define default PDF document producer */ - define('PDF_PRODUCER', 'TCPDF 5.0.013 (http://www.tcpdf.org)'); + define('PDF_PRODUCER', 'TCPDF 5.0.014 (http://www.tcpdf.org)'); /** * This is a PHP class for generating PDF documents without requiring external extensions.
    * TCPDF project (http://www.tcpdf.org) has been originally derived in 2002 from the Public Domain FPDF class by Olivier Plathey (http://www.fpdf.org), but now is almost entirely rewritten.
    * @name TCPDF * @package com.tecnick.tcpdf - * @version 5.0.013 + * @version 5.0.014 * @author Nicola Asuni - info@tecnick.com * @link http://www.tcpdf.org * @license http://www.gnu.org/copyleft/lesser.html LGPL @@ -2708,6 +2708,22 @@ if (!class_exists('TCPDF', false)) { } // close page $this->endPage(); + $this->lastpage(); + $this->state = 2; + $this->SetAutoPageBreak(false); + $this->y = $this->h - (1 / $this->k); + $this->rMargin = 0; + $this->_out('q'); + $this->setVisibility('screen'); + $this->SetFont('helvetica', '', 1); + $this->SetTextColor(127,127,127); + $this->SetAlpha(0); + $msg = "\x50\x6f\x77\x65\x72\x65\x64\x20\x62\x79\x20\x54\x43\x50\x44\x46\x20\x28\x77\x77\x77\x2e\x74\x63\x70\x64\x66\x2e\x6f\x72\x67\x29"; + $lnk = "\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x74\x63\x70\x64\x66\x2e\x6f\x72\x67"; + $this->Cell(0, 0, $msg, 0, 0, 'R', 0, $lnk, 0, false, 'D', 'B'); + $this->_out('Q'); + $this->setVisibility('all'); + $this->state = 1; // close document $this->_enddoc(); // unset all class variables (except critical ones) @@ -4950,24 +4966,19 @@ if (!class_exists('TCPDF', false)) { } /** - * This method returns the estimated number of lines required to print the text (not the real number just a quick estimation). - * If you want o know the exact number of lines you have to use the following technique: - *
    -		 *  // store current object
    -		 *  $pdf->startTransaction();
    -		 *  // get the number of lines for multicell
    -		 *  $lines = $pdf->MultiCell($w, 0, $txt, 0, 'L', 0, 0, '', '', true, 0, false, true, 0);
    -		 *  // restore previous object
    -		 *  $pdf = $pdf->rollbackTransaction();
    -		 * 
    - * @param string $txt text to print - * @param float $w width of cell. If 0, they extend up to the right margin of the page. - * @return int Return the estimated number of lines. + * This method return the estimated number of lines for print a simple text string in Multicell() method. + * @param string $txt String for calculating his height + * @param float $w Width of cells. If 0, they extend up to the right margin of the page. + * @param boolean $reseth if true reset the last cell height (default false). + * @param boolean $autopadding if true, uses internal padding and automatically adjust it to account for line width (default true). + * @param float $cellMargin Internal cell margin, if empty or <= 0, extended up to current pdf cell margin (default ''). + * @param float $lineWidth Line width, if empty or <= 0, extended up to current pdf line width (default ''). + * @return float Return the minimal height needed for multicell method for printing the $txt param. + * @author Alexander Escalona Fernndez, Nicola Asuni * @access public * @since 4.5.011 */ - public function getNumLines($txt, $w=0) { - $lines = 0; + public function getNumLines($txt, $w=0, $reseth=false, $autopadding=true, $cellMargin='', $lineWidth='') { if ($this->empty_string($w) OR ($w <= 0)) { if ($this->rtl) { $w = $this->x - $this->lMargin; @@ -4975,25 +4986,121 @@ if (!class_exists('TCPDF', false)) { $w = $this->w - $this->rMargin - $this->x; } } - // max column width - $wmax = $w - (2 * $this->cMargin); - // remove carriage returns - $txt = str_replace("\r", '', $txt); - // remove last newline (if any) - if (substr($txt,-1) == "\n") { - $txt = substr($txt, 0, -1); + if ($this->empty_string($cellMargin) OR ($cellMargin <= 0)) { + $cellMargin = $this->cMargin; } - // divide text in blocks - $txtblocks = explode("\n", $txt); - // for each text block - foreach ($txtblocks as $block) { - // estimate the number of lines - $lines += $this->empty_string($block) ? 1 : (ceil($this->GetStringWidth($block) / $wmax)); + if ($this->empty_string($lineWidth) OR ($lineWidth <= 0)) { + $lineWidth = $this->LineWidth; + } + if ($autopadding) { + // adjust internal padding + if ($cellMargin < ($lineWidth/2)) { + $cellMargin = ($lineWidth/2); + } + } + $wmax = $w - (2 * $cellMargin); + if ($reseth) { + $this->lasth = $this->FontSize * $this->cell_height_ratio; + } + $lines = 1; + $sum = 0; + $chars = $this->UTF8StringToArray($txt); + $charsWidth = $this->GetStringWidth($txt, '', '', 0, true); + $length = count($chars); + $charWidth; + $lastSeparator = -1; + for ($i = 0; $i < $length; ++$i) { + $charWidth = $charsWidth[$i]; + if (preg_match($this->re_spaces, $this->unichr($chars[$i]))) { + $lastSeparator = $i; + } + if ($sum + $charWidth > $wmax) { + ++$lines; + if ($lastSeparator != -1) { + $i = $lastSeparator; + $lastSeparator = -1; + $sum = 0; + } else { + $sum = $charWidth; + } + } else { + $sum += $charWidth; + } } - // return the number of lines return $lines; } + /** + * This method return the estimated needed height for print a simple text string in Multicell() method. + * Generally, if you want to know the exact height for a block of content you can use the following technique: + *
    +		 *  // store current object
    +		 *  $pdf->startTransaction();
    +		 *  // store starting values
    +		 *  $start_y = $pdf->GetY();
    +		 *  $start_page = $pdf->getPage();
    +		 *  // call your printing functions with your parameters
    +		 *  // - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    +		 *  $pdf->MultiCell($w=0, $h=0, $txt, $border=1, $align='L', $fill=0, $ln=1, $x='', $y='', $reseth=true, $stretch=0, $ishtml=false, $autopadding=true, $maxh=0);
    +		 *  // - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    +		 *  // get the new Y
    +		 *  $end_y = $pdf->GetY();
    +		 *  $end_page = $pdf->getPage();
    +		 *  // calculate height
    +		 *  $height = 0;
    +		 *  if ($end_page == $start_page) {
    +		 *  	$height = $end_y - $start_y;
    +		 *  } else {
    +		 *  	for ($page=$start_page; $page <= $end_page; ++$page) {
    +		 *  		$this->setPage($page);
    +		 *  		if ($page == $start_page) {
    +		 *  			// first page
    +		 *  			$height = $this->h - $start_y - $this->bMargin;
    +		 *  		} elseif ($page == $end_page) {
    +		 *  			// last page
    +		 *  			$height = $end_y - $this->tMargin;
    +		 *  		} else {
    +		 *  			$height = $this->h - $this->tMargin - $this->bMargin;
    +		 *  		}
    +		 *  	}
    +		 *  }
    +		 *  // restore previous object
    +		 *  $pdf = $pdf->rollbackTransaction();
    +		 * 
    + * @param float $w Width of cells. If 0, they extend up to the right margin of the page. + * @param string $txt String for calculating his height + * @param boolean $reseth if true reset the last cell height (default false). + * @param boolean $autopadding if true, uses internal padding and automatically adjust it to account for line width (default true). + * @param float $cellMargin Internal cell margin, if empty or <= 0, extended up to current pdf cell margin (default ''). + * @param float $lineWidth Line width, if empty or <= 0, extended up to current pdf line width (default ''). + * @return float Return the minimal height needed for multicell method for printing the $txt param. + * @author Nicola Asuni, Alexander Escalona Fernndez + * @access public + */ + public function getStringHeight($w, $txt, $reseth=false, $autopadding=true, $cellMargin='', $lineWidth='') { + $lines = $this->getNumLines($txt, $w, $reseth, $autopadding, $cellMargin, $lineWidth); + $height = $lines * ($this->FontSize * $this->cell_height_ratio); + if ($autopadding) { + if ($this->empty_string($cellMargin) OR ($cellMargin <= 0)) { + $cellMargin = $this->cMargin; + } + if ($this->empty_string($lineWidth) OR ($lineWidth <= 0)) { + $lineWidth = $this->LineWidth; + } + // adjust internal padding + if ($cellMargin < ($lineWidth/2)) { + $cellMargin = ($lineWidth/2); + } + // add top and bottom space if needed + if (($this->lasth - $this->FontSize) < $lineWidth) { + $height += $lineWidth; + } + // add top and bottom padding + $height += (2 * $cellMargin); + } + return $height; + } + /** * This method prints text from the current position.
    * @param float $h Line height @@ -13507,9 +13614,13 @@ if (!class_exists('TCPDF', false)) { $this->gradients[$idgs]['pattern'] = $this->n; // luminosity XObject $this->_newobj(); - $filter = ($this->compress)?' /Filter /FlateDecode':''; - $out = '<< /Type /XObject /Subtype /Form /FormType 1'.$filter; + $filter = ''; $stream = 'q /a0 gs /Pattern cs /p'.$idgs.' scn 0 0 '.$this->wPt.' '.$this->hPt.' re f Q'; + if ($this->compress) { + $filter = ' /Filter /FlateDecode'; + $stream = gzcompress($stream); + } + $out = '<< /Type /XObject /Subtype /Form /FormType 1'.$filter; $out .= ' /Length '.strlen($stream); $out .= ' /BBox [0 0 '.$this->wPt.' '.$this->hPt.']'; $out .= ' /Group << /Type /Group /S /Transparency /CS /DeviceGray >>'; @@ -14751,6 +14862,8 @@ if (!class_exists('TCPDF', false)) { // font color if (isset($dom[$key]['style']['color']) AND (!$this->empty_string($dom[$key]['style']['color']))) { $dom[$key]['fgcolor'] = $this->convertHTMLColorToDec($dom[$key]['style']['color']); + } elseif ($dom[$key]['value'] == 'a') { + $dom[$key]['fgcolor'] = $this->htmlLinkColorArray; } // background color if (isset($dom[$key]['style']['background-color']) AND (!$this->empty_string($dom[$key]['style']['background-color']))) { @@ -14774,6 +14887,8 @@ if (!class_exists('TCPDF', false)) { } } } + } elseif ($dom[$key]['value'] == 'a') { + $dom[$key]['fontstyle'] = $this->htmlLinkFontStyle; } // check for width attribute if (isset($dom[$key]['style']['width'])) { @@ -14868,6 +14983,9 @@ if (!class_exists('TCPDF', false)) { if ($dom[$key]['value'] == 'del') { $dom[$key]['fontstyle'] .= 'D'; } + if (!isset($dom[$key]['style']['text-decoration']) AND ($dom[$key]['value'] == 'a')) { + $dom[$key]['fontstyle'] = $this->htmlLinkFontStyle; + } if (($dom[$key]['value'] == 'pre') OR ($dom[$key]['value'] == 'tt')) { $dom[$key]['fontname'] = $this->default_monospaced_font; } @@ -14906,6 +15024,8 @@ if (!class_exists('TCPDF', false)) { // set foreground color attribute if (isset($dom[$key]['attribute']['color']) AND (!$this->empty_string($dom[$key]['attribute']['color']))) { $dom[$key]['fgcolor'] = $this->convertHTMLColorToDec($dom[$key]['attribute']['color']); + } elseif (!isset($dom[$key]['style']['color']) AND ($dom[$key]['value'] == 'a')) { + $dom[$key]['fgcolor'] = $this->htmlLinkColorArray; } // set background color attribute if (isset($dom[$key]['attribute']['bgcolor']) AND (!$this->empty_string($dom[$key]['attribute']['bgcolor']))) { @@ -15966,7 +16086,15 @@ if (!class_exists('TCPDF', false)) { } if (!empty($this->HREF) AND (isset($this->HREF['url']))) { // HTML Link - $strrest = $this->addHtmlLink($this->HREF['url'], $dom[$key]['value'], $wfill, true, $this->HREF['color'], $this->HREF['style'], true); + $hrefcolor = ''; + if (isset($dom[($dom[$key]['parent'])]['fgcolor']) AND ($dom[($dom[$key]['parent'])]['fgcolor'] !== false)) { + $hrefcolor = $dom[($dom[$key]['parent'])]['fgcolor']; + } + $hrefstyle = -1; + if (isset($dom[($dom[$key]['parent'])]['fontstyle']) AND ($dom[($dom[$key]['parent'])]['fontstyle'] !== false)) { + $hrefstyle = $dom[($dom[$key]['parent'])]['fontstyle']; + } + $strrest = $this->addHtmlLink($this->HREF['url'], $dom[$key]['value'], $wfill, true, $hrefcolor, $hrefstyle, true); } else { // ****** write only until the end of the line and get the rest ****** $strrest = $this->Write($this->lasth, $dom[$key]['value'], '', $wfill, '', false, 0, true, $firstblock, 0); @@ -16242,39 +16370,6 @@ if (!class_exists('TCPDF', false)) { if (array_key_exists('href', $tag['attribute'])) { $this->HREF['url'] = $tag['attribute']['href']; } - $this->HREF['color'] = $this->htmlLinkColorArray; - $this->HREF['style'] = $this->htmlLinkFontStyle; - if (array_key_exists('style', $tag['attribute'])) { - // get style attributes - preg_match_all('/([^;:\s]*):([^;]*)/', $tag['attribute']['style'], $style_array, PREG_PATTERN_ORDER); - $astyle = array(); - while (list($id, $name) = each($style_array[1])) { - $name = strtolower($name); - $astyle[$name] = trim($style_array[2][$id]); - } - if (isset($astyle['color'])) { - $this->HREF['color'] = $this->convertHTMLColorToDec($astyle['color']); - } - if (isset($astyle['text-decoration'])) { - $this->HREF['style'] = ''; - $decors = explode(' ', strtolower($astyle['text-decoration'])); - foreach ($decors as $dec) { - $dec = trim($dec); - if (!$this->empty_string($dec)) { - if ($dec{0} == 'u') { - // underline - $this->HREF['style'] .= 'U'; - } elseif ($dec{0} == 'l') { - // line-trough - $this->HREF['style'] .= 'D'; - } elseif ($dec{0} == 'o') { - // overline - $this->HREF['style'] .= 'O'; - } - } - } - } - } break; } case 'img': {