mirror of
https://github.com/vdm-io/tcpdf.git
synced 2024-11-22 12:55:10 +00:00
5.0.014
This commit is contained in:
parent
0c3b729f12
commit
dda292d19c
@ -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.
|
||||
|
||||
|
@ -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:
|
||||
|
29
cache/chapter_demo_1.txt
vendored
29
cache/chapter_demo_1.txt
vendored
@ -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.
|
||||
|
44
cache/chapter_demo_2.txt
vendored
44
cache/chapter_demo_2.txt
vendored
@ -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.
|
||||
<p><strong>Lorem ipsum</strong> 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.</p>
|
||||
|
||||
"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!"
|
||||
<img src="../images/image_demo.jpg" width="54mm" height="80mm" />
|
||||
|
||||
<p style="background-color:yellow;"><i>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.</i></p>
|
||||
|
||||
<p>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.</p>
|
||||
|
||||
<p style="color:navy;">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.</p>
|
||||
|
||||
<p>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.</p>
|
||||
|
||||
<p><strong>Lorem ipsum</strong> 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.</p>
|
||||
|
||||
<img src="../images/image_demo.jpg" width="54mm" height="80mm" />
|
||||
|
||||
<p style="background-color:yellow;"><i>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.</i></p>
|
||||
|
||||
<p>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.</p>
|
||||
|
||||
<p style="color:navy;">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.</p>
|
||||
|
||||
<p>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.</p>
|
||||
|
@ -55,7 +55,7 @@
|
||||
|
||||
<div class="credit">
|
||||
<hr />
|
||||
Documentation generated on Wed, 19 May 2010 21:31:17 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
|
||||
Documentation generated on Fri, 21 May 2010 18:46:51 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
|
||||
</div>
|
||||
</td></tr></table>
|
||||
</td>
|
||||
|
@ -5548,7 +5548,7 @@ $frame)</code>
|
||||
|
||||
<div class="credit">
|
||||
<hr />
|
||||
Documentation generated on Wed, 19 May 2010 21:31:18 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
|
||||
Documentation generated on Fri, 21 May 2010 18:46:52 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
|
||||
</div>
|
||||
</td></tr></table>
|
||||
</td>
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -296,7 +296,7 @@ $type)</code>
|
||||
|
||||
<div class="credit">
|
||||
<hr />
|
||||
Documentation generated on Wed, 19 May 2010 21:31:17 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
|
||||
Documentation generated on Fri, 21 May 2010 18:46:51 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
|
||||
</div>
|
||||
</td></tr></table>
|
||||
</td>
|
||||
|
@ -1374,7 +1374,7 @@ $type)</code>
|
||||
|
||||
<div class="credit">
|
||||
<hr />
|
||||
Documentation generated on Wed, 19 May 2010 21:31:17 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
|
||||
Documentation generated on Fri, 21 May 2010 18:46:51 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
|
||||
</div>
|
||||
</td></tr></table>
|
||||
</td>
|
||||
|
@ -102,7 +102,7 @@ PHP class to creates array representations for 2D barcodes to be used with TCPDF
|
||||
|
||||
<div class="credit">
|
||||
<hr />
|
||||
Documentation generated on Wed, 19 May 2010 21:31:17 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
|
||||
Documentation generated on Fri, 21 May 2010 18:46:51 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
|
||||
</div>
|
||||
</td></tr></table>
|
||||
</td>
|
||||
|
@ -102,7 +102,7 @@ PHP class to creates array representations for common 1D barcodes to be used wit
|
||||
|
||||
<div class="credit">
|
||||
<hr />
|
||||
Documentation generated on Wed, 19 May 2010 21:31:17 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
|
||||
Documentation generated on Fri, 21 May 2010 18:46:51 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
|
||||
</div>
|
||||
</td></tr></table>
|
||||
</td>
|
||||
|
@ -539,7 +539,7 @@ Configuration file for TCPDF.<br /><br /><br /><br />
|
||||
|
||||
<div class="credit">
|
||||
<hr />
|
||||
Documentation generated on Wed, 19 May 2010 21:31:23 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
|
||||
Documentation generated on Fri, 21 May 2010 18:46:57 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
|
||||
</div>
|
||||
</td></tr></table>
|
||||
</td>
|
||||
|
@ -94,7 +94,7 @@ Array of WEB safe colors.<br /><br /><br /><br />
|
||||
|
||||
<div class="credit">
|
||||
<hr />
|
||||
Documentation generated on Wed, 19 May 2010 21:31:18 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
|
||||
Documentation generated on Fri, 21 May 2010 18:46:52 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
|
||||
</div>
|
||||
</td></tr></table>
|
||||
</td>
|
||||
|
@ -477,7 +477,7 @@ string $string, [int $split_length = 1])</code>
|
||||
|
||||
<div class="credit">
|
||||
<hr />
|
||||
Documentation generated on Wed, 19 May 2010 21:31:18 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
|
||||
Documentation generated on Fri, 21 May 2010 18:46:52 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
|
||||
</div>
|
||||
</td></tr></table>
|
||||
</td>
|
||||
|
@ -79,7 +79,7 @@ This is a PHP class for generating PDF documents without requiring external exte
|
||||
<td><b>author:</b> </td><td>Nicola Asuni</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>version:</b> </td><td>5.0.013</td>
|
||||
<td><b>version:</b> </td><td>5.0.014</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>copyright:</b> </td><td>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</td>
|
||||
@ -110,7 +110,7 @@ unicode data<br /><br /></div>
|
||||
<div class="tags">
|
||||
<table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code_border">
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">
|
||||
<code>PDF_PRODUCER = 'TCPDF 5.0.013 (http://www.tcpdf.org)'</code>
|
||||
<code>PDF_PRODUCER = 'TCPDF 5.0.014 (http://www.tcpdf.org)'</code>
|
||||
</td></tr></table>
|
||||
</td></tr></table>
|
||||
|
||||
@ -121,7 +121,7 @@ unicode data<br /><br /></div>
|
||||
|
||||
<div class="credit">
|
||||
<hr />
|
||||
Documentation generated on Wed, 19 May 2010 21:31:19 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
|
||||
Documentation generated on Fri, 21 May 2010 18:46:53 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
|
||||
</div>
|
||||
</td></tr></table>
|
||||
</td>
|
||||
|
@ -243,7 +243,7 @@ Unicode Include file for TCPDF.<br /><br /><br /><br />
|
||||
|
||||
<div class="credit">
|
||||
<hr />
|
||||
Documentation generated on Wed, 19 May 2010 21:31:23 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
|
||||
Documentation generated on Fri, 21 May 2010 18:46:57 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
|
||||
</div>
|
||||
</td></tr></table>
|
||||
</td>
|
||||
|
@ -550,9 +550,9 @@
|
||||
<dt><b>getBarcodeArray</b></dt>
|
||||
<dd>in file qrcode.php, method <a href="com-tecnick-tcpdf/QRcode.html#methodgetBarcodeArray">QRcode::getBarcodeArray()</a><br> Returns a barcode array which is readable by TCPDF</dd>
|
||||
<dt><b>getBarcodeArray</b></dt>
|
||||
<dd>in file 2dbarcodes.php, method <a href="com-tecnick-tcpdf/TCPDF2DBarcode.html#methodgetBarcodeArray">TCPDF2DBarcode::getBarcodeArray()</a><br> Return an array representations of barcode.</dd>
|
||||
<dt><b>getBarcodeArray</b></dt>
|
||||
<dd>in file barcodes.php, method <a href="com-tecnick-tcpdf/TCPDFBarcode.html#methodgetBarcodeArray">TCPDFBarcode::getBarcodeArray()</a><br> Return an array representations of barcode.</dd>
|
||||
<dt><b>getBarcodeArray</b></dt>
|
||||
<dd>in file 2dbarcodes.php, method <a href="com-tecnick-tcpdf/TCPDF2DBarcode.html#methodgetBarcodeArray">TCPDF2DBarcode::getBarcodeArray()</a><br> Return an array representations of barcode.</dd>
|
||||
<dt><b>getBitStream</b></dt>
|
||||
<dd>in file qrcode.php, method <a href="com-tecnick-tcpdf/QRcode.html#methodgetBitStream">QRcode::getBitStream()</a><br> Returns a stream of bits.</dd>
|
||||
<dt><b>getBorderMode</b></dt>
|
||||
@ -648,7 +648,7 @@
|
||||
<dt><b>GetNumChars</b></dt>
|
||||
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodGetNumChars">TCPDF::GetNumChars()</a><br> Returns the numbero of characters in a string.</dd>
|
||||
<dt><b>getNumLines</b></dt>
|
||||
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodgetNumLines">TCPDF::getNumLines()</a><br> This method returns the estimated number of lines required to print the text (not the real number just a quick estimation).</dd>
|
||||
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodgetNumLines">TCPDF::getNumLines()</a><br> This method return the estimated number of lines for print a simple text string in Multicell() method.</dd>
|
||||
<dt><b>getNumPages</b></dt>
|
||||
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodgetNumPages">TCPDF::getNumPages()</a><br> Get the total number of insered pages.</dd>
|
||||
<dt><b>getObjFilename</b></dt>
|
||||
@ -685,6 +685,8 @@
|
||||
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodgetScaleFactor">TCPDF::getScaleFactor()</a><br> Returns the scale factor (number of points in user unit).</dd>
|
||||
<dt><b>getSpaceString</b></dt>
|
||||
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodgetSpaceString">TCPDF::getSpaceString()</a><br> Returns the string used to find spaces</dd>
|
||||
<dt><b>getStringHeight</b></dt>
|
||||
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodgetStringHeight">TCPDF::getStringHeight()</a><br> This method return the estimated needed height for print a simple text string in Multicell() method.</dd>
|
||||
<dt><b>GetStringWidth</b></dt>
|
||||
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodGetStringWidth">TCPDF::GetStringWidth()</a><br> Returns the length of a string in user unit. A font must be selected.<br /></dd>
|
||||
<dt><b>getSVGTransformMatrix</b></dt>
|
||||
@ -1956,7 +1958,7 @@
|
||||
<a href="elementindex.html#top">top</a><br>
|
||||
<div class="credit">
|
||||
<hr />
|
||||
Documentation generated on Wed, 19 May 2010 21:31:17 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
|
||||
Documentation generated on Fri, 21 May 2010 18:46:51 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
|
||||
</div>
|
||||
</td></tr></table>
|
||||
</td>
|
||||
|
@ -731,9 +731,9 @@
|
||||
<dt><b>getBarcodeArray</b></dt>
|
||||
<dd>in file qrcode.php, method <a href="com-tecnick-tcpdf/QRcode.html#methodgetBarcodeArray">QRcode::getBarcodeArray()</a><br> Returns a barcode array which is readable by TCPDF</dd>
|
||||
<dt><b>getBarcodeArray</b></dt>
|
||||
<dd>in file 2dbarcodes.php, method <a href="com-tecnick-tcpdf/TCPDF2DBarcode.html#methodgetBarcodeArray">TCPDF2DBarcode::getBarcodeArray()</a><br> Return an array representations of barcode.</dd>
|
||||
<dt><b>getBarcodeArray</b></dt>
|
||||
<dd>in file barcodes.php, method <a href="com-tecnick-tcpdf/TCPDFBarcode.html#methodgetBarcodeArray">TCPDFBarcode::getBarcodeArray()</a><br> Return an array representations of barcode.</dd>
|
||||
<dt><b>getBarcodeArray</b></dt>
|
||||
<dd>in file 2dbarcodes.php, method <a href="com-tecnick-tcpdf/TCPDF2DBarcode.html#methodgetBarcodeArray">TCPDF2DBarcode::getBarcodeArray()</a><br> Return an array representations of barcode.</dd>
|
||||
<dt><b>getBitStream</b></dt>
|
||||
<dd>in file qrcode.php, method <a href="com-tecnick-tcpdf/QRcode.html#methodgetBitStream">QRcode::getBitStream()</a><br> Returns a stream of bits.</dd>
|
||||
<dt><b>getBorderMode</b></dt>
|
||||
@ -829,7 +829,7 @@
|
||||
<dt><b>GetNumChars</b></dt>
|
||||
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodGetNumChars">TCPDF::GetNumChars()</a><br> Returns the numbero of characters in a string.</dd>
|
||||
<dt><b>getNumLines</b></dt>
|
||||
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodgetNumLines">TCPDF::getNumLines()</a><br> This method returns the estimated number of lines required to print the text (not the real number just a quick estimation).</dd>
|
||||
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodgetNumLines">TCPDF::getNumLines()</a><br> This method return the estimated number of lines for print a simple text string in Multicell() method.</dd>
|
||||
<dt><b>getNumPages</b></dt>
|
||||
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodgetNumPages">TCPDF::getNumPages()</a><br> Get the total number of insered pages.</dd>
|
||||
<dt><b>getObjFilename</b></dt>
|
||||
@ -866,6 +866,8 @@
|
||||
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodgetScaleFactor">TCPDF::getScaleFactor()</a><br> Returns the scale factor (number of points in user unit).</dd>
|
||||
<dt><b>getSpaceString</b></dt>
|
||||
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodgetSpaceString">TCPDF::getSpaceString()</a><br> Returns the string used to find spaces</dd>
|
||||
<dt><b>getStringHeight</b></dt>
|
||||
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodgetStringHeight">TCPDF::getStringHeight()</a><br> This method return the estimated needed height for print a simple text string in Multicell() method.</dd>
|
||||
<dt><b>GetStringWidth</b></dt>
|
||||
<dd>in file tcpdf.php, method <a href="com-tecnick-tcpdf/TCPDF.html#methodGetStringWidth">TCPDF::GetStringWidth()</a><br> Returns the length of a string in user unit. A font must be selected.<br /></dd>
|
||||
<dt><b>getSVGTransformMatrix</b></dt>
|
||||
@ -1985,7 +1987,7 @@
|
||||
<a href="elementindex_com-tecnick-tcpdf.html#top">top</a><br>
|
||||
<div class="credit">
|
||||
<hr />
|
||||
Documentation generated on Wed, 19 May 2010 21:31:17 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
|
||||
Documentation generated on Fri, 21 May 2010 18:46:51 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
|
||||
</div>
|
||||
</td></tr></table>
|
||||
</td>
|
||||
|
@ -35,7 +35,7 @@
|
||||
<a href="#Post-parsing">Post-parsing</a><br>
|
||||
<div class="credit">
|
||||
<hr />
|
||||
Documentation generated on Wed, 19 May 2010 21:31:23 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
|
||||
Documentation generated on Fri, 21 May 2010 18:46:57 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
|
||||
</div>
|
||||
</td></tr></table>
|
||||
</td>
|
||||
|
@ -64,7 +64,7 @@
|
||||
This documentation was generated by <a href="http://www.phpdoc.org">phpDocumentor v1.4.3</a><br />
|
||||
<div class="credit">
|
||||
<hr />
|
||||
Documentation generated on Wed, 19 May 2010 21:31:17 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
|
||||
Documentation generated on Fri, 21 May 2010 18:46:51 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
|
||||
</div>
|
||||
</td></tr></table>
|
||||
</td>
|
||||
|
@ -64,7 +64,7 @@
|
||||
This documentation was generated by <a href="http://www.phpdoc.org">phpDocumentor v1.4.3</a><br />
|
||||
<div class="credit">
|
||||
<hr />
|
||||
Documentation generated on Wed, 19 May 2010 21:31:17 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
|
||||
Documentation generated on Fri, 21 May 2010 18:46:51 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.3</a>
|
||||
</div>
|
||||
</td></tr></table>
|
||||
</td>
|
||||
|
@ -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 = <<<EOD
|
||||
<h1>Welcome to <a href="http://www.tcpdf.org" style="text-decoration:none;color:black;"><span style="background-color:#CC0000;"> TC<span style="color:white;">PDF</span> </span></a>!</h1>
|
||||
<i>This is the first example of TCPDF library.</i>
|
||||
<p>This text is printed using the <i>writeHTMLCell()</i> method but you can also use: <i>Multicell(), writeHTML(), Write(), Cell() and Text()</i>.</p>
|
||||
<p>Please check the source code documentation and other examples for further information.</p>
|
||||
<p style="color:#CC0000;">TO IMPROVE AND EXPAND TCPDF I NEED YOUR SUPPORT, PLEASE <a href="http://sourceforge.net/donate/index.php?group_id=128076">MAKE A DONATION!</a></p>
|
||||
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
|
||||
//============================================================+
|
||||
?>
|
||||
|
@ -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 = <<<EOD
|
||||
TCPDF Example 002
|
||||
|
||||
Default page header and footer are disabled using setPrintHeader() and setPrintFooter() methods.
|
||||
EOD;
|
||||
|
||||
// print a block of text using Write()
|
||||
$pdf->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
|
||||
//============================================================+
|
||||
?>
|
||||
|
@ -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 = <<<EOD
|
||||
TCPDF Example 003
|
||||
|
||||
Custom page header and footer are defined by extending the TCPDF class and overriding the Header() and Footer() methods.
|
||||
EOD;
|
||||
|
||||
// print a block of text using Write()
|
||||
$pdf->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
|
||||
//============================================================+
|
||||
?>
|
||||
|
@ -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
|
||||
//============================================================+
|
||||
?>
|
||||
|
@ -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
|
||||
//============================================================+
|
||||
?>
|
||||
|
@ -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 = '<h1>HTML Example</h1>< € € € & è è © > \\slash \\\\double-slash \\\\\\triple-slash<h2>List</h2>List example:<ol><li><img src="../images/logo_example.png" alt="test alt attribute" width="30" height="30" border="0" /> test image</li><li><b>bold text</b></li><li><i>italic text</i></li><li><u>underlined text</u></li><li><b>b<i>bi<u>biu</u>bi</i>b</b></li><li><a href="http://www.tecnick.com" dir="ltr">link to http://www.tecnick.com</a></li><li>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.<br />Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.</li><li>SUBLIST<ol><li>row one<ul><li>sublist</li></ul></li><li>row two</li></ol></li><li><b>T</b>E<i>S</i><u>T</u> <del>line through</del></li><li><font size="+3">font + 3</font></li><li><small>small text</small> normal <small>small text</small> normal <sub>subscript</sub> normal <sup>superscript</sup> normal</li></ol><dl><dt>Coffee</dt><dd>Black hot drink</dd><dt>Milk</dt><dd>White cold drink</dd></dl><div style="text-align:center">IMAGES<br /><img src="../images/logo_example.png" alt="test alt attribute" width="100" height="100" border="0" /><img src="../images/tiger.ai" alt="test alt attribute" width="100" height="100" border="0" /><img src="../images/logo_example.jpg" alt="test alt attribute" width="100" height="100" border="0" /></div>';
|
||||
$html = '<h1>HTML Example</h1>
|
||||
Some special characters: < € € € & è è © > \\slash \\\\double-slash \\\\\\triple-slash
|
||||
<h2>List</h2>
|
||||
List example:
|
||||
<ol>
|
||||
<li><img src="../images/logo_example.png" alt="test alt attribute" width="30" height="30" border="0" /> test image</li>
|
||||
<li><b>bold text</b></li>
|
||||
<li><i>italic text</i></li>
|
||||
<li><u>underlined text</u></li>
|
||||
<li><b>b<i>bi<u>biu</u>bi</i>b</b></li>
|
||||
<li><a href="http://www.tecnick.com" dir="ltr">link to http://www.tecnick.com</a></li>
|
||||
<li>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.<br />Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.</li>
|
||||
<li>SUBLIST
|
||||
<ol>
|
||||
<li>row one
|
||||
<ul>
|
||||
<li>sublist</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>row two</li>
|
||||
</ol>
|
||||
</li>
|
||||
<li><b>T</b>E<i>S</i><u>T</u> <del>line through</del></li>
|
||||
<li><font size="+3">font + 3</font></li>
|
||||
<li><small>small text</small> normal <small>small text</small> normal <sub>subscript</sub> normal <sup>superscript</sup> normal</li>
|
||||
</ol>
|
||||
<dl>
|
||||
<dt>Coffee</dt>
|
||||
<dd>Black hot drink</dd>
|
||||
<dt>Milk</dt>
|
||||
<dd>White cold drink</dd>
|
||||
</dl>
|
||||
<div style="text-align:center">IMAGES<br />
|
||||
<img src="../images/logo_example.png" alt="test alt attribute" width="100" height="100" border="0" /><img src="../images/tiger.ai" alt="test alt attribute" width="100" height="100" border="0" /><img src="../images/logo_example.jpg" alt="test alt attribute" width="100" height="100" border="0" />
|
||||
</div>';
|
||||
|
||||
// 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('<div style="text-align:center">The words “<span dir="rtl">מזל [mazel] טוב [tov]</span>” mean “Congratulations!”</div>', true, 0, true, 0);
|
||||
$html = '<div style="text-align:center">The words “<span dir="rtl">מזל [mazel] טוב [tov]</span>” mean “Congratulations!”</div>';
|
||||
$pdf->writeHTML($html, true, false, true, false, '');
|
||||
|
||||
// test some inline CSS
|
||||
$inlinecss = '<p>This is just an example of html code to demonstrate some supported CSS inline styles.
|
||||
$html = '<p>This is just an example of html code to demonstrate some supported CSS inline styles.
|
||||
<span style="font-weight: bold;">bold text</span>
|
||||
<span style="text-decoration: line-through;">line-trough</span>
|
||||
<span style="text-decoration: underline line-through;">underline and line-trough</span>
|
||||
@ -101,7 +140,7 @@ $inlinecss = '<p>This is just an example of html code to demonstrate some suppor
|
||||
<span style="font-size: xx-large;">xx-large</span>
|
||||
</p>';
|
||||
|
||||
$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 = '<table border="1" cellspacing="1" cellpadding="1"><tr><td>a</td><td>b</td></tr><tr><td>c</td><td>d</td></tr></table>';
|
||||
|
||||
$htmltable = '<h2>HTML TABLE:</h2><table border="1" cellspacing="2" cellpadding="2"><tr><th>#</th><th align="right">RIGHT align</th><th align="left">LEFT align</th><th>4A</th></tr><tr><td>1</td><td bgcolor="#cccccc" align="center" colspan="2">A1 ex<i>amp</i>le <a href="http://www.tcpdf.org">link</a> column span. One two tree four five six seven eight nine ten.<br />line after br<br /><small>small text</small> normal <sub>subscript</sub> normal <sup>superscript</sup> normal bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla<ol><li>first<ol><li>sublist</li><li>sublist</li></ol></li><li>second</li></ol><small color="#FF0000" bgcolor="#FFFF00">small small small small small small small small small small small small small small small small small small small small</small></td><td>4B</td></tr><tr><td>'.$subtable.'</td><td bgcolor="#0000FF" color="yellow" align="center">A2 € € € & è è<br/>A2 € € € & è è</td><td bgcolor="#FFFF00" align="left"><font color="#FF0000">Red</font> Yellow BG</td><td>4C</td></tr><tr><td>1A</td><td rowspan="2" colspan="2" bgcolor="#FFFFCC">2AA<br />2AB<br />2AC</td><td bgcolor="#FF0000">4D</td></tr><tr><td>1B</td><td>4E</td></tr><tr><td>1C</td><td>2C</td><td>3C</td><td>4F</td></tr></table>';
|
||||
$html = '<h2>HTML TABLE:</h2>
|
||||
<table border="1" cellspacing="2" cellpadding="2">
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th align="right">RIGHT align</th>
|
||||
<th align="left">LEFT align</th>
|
||||
<th>4A</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>1</td>
|
||||
<td bgcolor="#cccccc" align="center" colspan="2">A1 ex<i>amp</i>le <a href="http://www.tcpdf.org">link</a> column span. One two tree four five six seven eight nine ten.<br />line after br<br /><small>small text</small> normal <sub>subscript</sub> normal <sup>superscript</sup> normal bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla<ol><li>first<ol><li>sublist</li><li>sublist</li></ol></li><li>second</li></ol><small color="#FF0000" bgcolor="#FFFF00">small small small small small small small small small small small small small small small small small small small small</small></td>
|
||||
<td>4B</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>'.$subtable.'</td>
|
||||
<td bgcolor="#0000FF" color="yellow" align="center">A2 € € € & è è<br/>A2 € € € & è è</td>
|
||||
<td bgcolor="#FFFF00" align="left"><font color="#FF0000">Red</font> Yellow BG</td>
|
||||
<td>4C</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>1A</td>
|
||||
<td rowspan="2" colspan="2" bgcolor="#FFFFCC">2AA<br />2AB<br />2AC</td>
|
||||
<td bgcolor="#FF0000">4D</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>1B</td>
|
||||
<td>4E</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>1C</td>
|
||||
<td>2C</td>
|
||||
<td>3C</td>
|
||||
<td>4F</td>
|
||||
</tr>
|
||||
</table>';
|
||||
|
||||
// output the HTML content
|
||||
$pdf->writeHTML($htmltable, true, 0, true, 0);
|
||||
$pdf->writeHTML($html, true, false, true, false, '');
|
||||
|
||||
// Print some HTML Cells
|
||||
|
||||
$cellcontent = '<span color="red">red</span> <span color="green">green</span> <span color="blue">blue</span><br /><span color="red">red</span> <span color="green">green</span> <span color="blue">blue</span>';
|
||||
$html = '<span color="red">red</span> <span color="green">green</span> <span color="blue">blue</span><br /><span color="red">red</span> <span color="green">green</span> <span color="blue">blue</span>';
|
||||
|
||||
$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 = '<h1>Image alignments on HTML table</h1><table cellpadding="1" cellspacing="1" border="1" style="text-align:center;">
|
||||
$html = '<h1>Image alignments on HTML table</h1>
|
||||
<table cellpadding="1" cellspacing="1" border="1" style="text-align:center;">
|
||||
<tr><td><img src="../images/logo_example.png" border="0" height="41" width="41" /></td></tr>
|
||||
<tr style="text-align:left;"><td><img src="../images/logo_example.png" border="0" height="41" width="41" align="top" /></td></tr>
|
||||
<tr style="text-align:center;"><td><img src="../images/logo_example.png" border="0" height="41" width="41" align="middle" /></td></tr>
|
||||
@ -152,7 +225,7 @@ $tablealign = '<h1>Image alignments on HTML table</h1><table cellpadding="1" cel
|
||||
</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 = '<hr /><h1>Various tests</h1><a href="#2">link to page 2</a><br /><font face="courier"><b>thisisaverylongword</b></font> <font face="helvetica"><i>thisisanotherverylongword</i></font> <font face="times"><b>thisisaverylongword</b></font> thisisanotherverylongword <font face="times">thisisaverylongword</font> <font face="courier"><b>thisisaverylongword</b></font> <font face="helvetica"><i>thisisanotherverylongword</i></font> <font face="times"><b>thisisaverylongword</b></font> thisisanotherverylongword <font face="times">thisisaverylongword</font> <font face="courier"><b>thisisaverylongword</b></font> <font face="helvetica"><i>thisisanotherverylongword</i></font> <font face="times"><b>thisisaverylongword</b></font> thisisanotherverylongword <font face="times">thisisaverylongword</font> <font face="courier"><b>thisisaverylongword</b></font> <font face="helvetica"><i>thisisanotherverylongword</i></font> <font face="times"><b>thisisaverylongword</b></font> thisisanotherverylongword <font face="times">thisisaverylongword</font> <font face="courier"><b>thisisaverylongword</b></font> <font face="helvetica"><i>thisisanotherverylongword</i></font> <font face="times"><b>thisisaverylongword</b></font> thisisanotherverylongword <font face="times">thisisaverylongword</font>';
|
||||
$html = '<hr />
|
||||
<h1>Various tests</h1>
|
||||
<a href="#2">link to page 2</a><br />
|
||||
<font face="courier"><b>thisisaverylongword</b></font> <font face="helvetica"><i>thisisanotherverylongword</i></font> <font face="times"><b>thisisaverylongword</b></font> thisisanotherverylongword <font face="times">thisisaverylongword</font> <font face="courier"><b>thisisaverylongword</b></font> <font face="helvetica"><i>thisisanotherverylongword</i></font> <font face="times"><b>thisisaverylongword</b></font> thisisanotherverylongword <font face="times">thisisaverylongword</font> <font face="courier"><b>thisisaverylongword</b></font> <font face="helvetica"><i>thisisanotherverylongword</i></font> <font face="times"><b>thisisaverylongword</b></font> thisisanotherverylongword <font face="times">thisisaverylongword</font> <font face="courier"><b>thisisaverylongword</b></font> <font face="helvetica"><i>thisisanotherverylongword</i></font> <font face="times"><b>thisisaverylongword</b></font> thisisanotherverylongword <font face="times">thisisaverylongword</font> <font face="courier"><b>thisisaverylongword</b></font> <font face="helvetica"><i>thisisanotherverylongword</i></font> <font face="times"><b>thisisaverylongword</b></font> thisisanotherverylongword <font face="times">thisisaverylongword</font>';
|
||||
|
||||
// output the HTML content
|
||||
$pdf->writeHTML($htmltxt, true, 0, true, 0);
|
||||
$pdf->writeHTML($html, true, false, true, false, '');
|
||||
|
||||
// Test fonts nesting
|
||||
$html1 = 'Default <font face="courier">Courier <font face="helvetica">Helvetica <font face="times">Times <font face="dejavusans">dejavusans </font>Times </font>Helvetica </font>Courier </font>Default';
|
||||
$html2 = '<small>small text</small> normal <small>small text</small> normal <sub>subscript</sub> normal <sup>superscript</sup> normal';
|
||||
$html3 = '<font size="10" color="#ff7f50">The</font> <font size="10" color="#6495ed">quick</font> <font size="14" color="#dc143c">brown</font> <font size="18" color="#008000">fox</font> <font size="22"><a href="http://www.tcpdf.org">jumps</a></font> <font size="22" color="#a0522d">over</font> <font size="18" color="#da70d6">the</font> <font size="14" color="#9400d3">lazy</font> <font size="10" color="#4169el">dog</font>.';
|
||||
|
||||
$teststr1 = 'Default <font face="courier">Courier <font face="helvetica">Helvetica <font face="times">Times <font face="dejavusans">dejavusans </font>Times </font>Helvetica </font>Courier </font>Default';
|
||||
|
||||
$teststr2 = '<small>small text</small> normal <small>small text</small> normal <sub>subscript</sub> normal <sup>superscript</sup> normal';
|
||||
|
||||
$teststr3 = '<font size="10" color="#ff7f50">The</font> <font size="10" color="#6495ed">quick</font> <font size="14" color="#dc143c">brown</font> <font size="18" color="#008000">fox</font> <font size="22"><a href="http://www.tcpdf.org">jumps</a></font> <font size="22" color="#a0522d">over</font> <font size="18" color="#da70d6">the</font> <font size="14" color="#9400d3">lazy</font> <font size="10" color="#4169el">dog</font>.';
|
||||
|
||||
$html = $teststr1.'<br />'.$teststr2.'<br />'.$teststr3.'<br />'.$teststr3.'<br />'.$teststr2;
|
||||
$html = $html1.'<br />'.$html2.'<br />'.$html3.'<br />'.$html3.'<br />'.$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 = <<<EOF
|
||||
$html = <<<EOF
|
||||
<div style="background-color:#880000;color:white;">
|
||||
Hello World!<br />
|
||||
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
|
||||
//============================================================+
|
||||
?>
|
||||
|
@ -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 = '<b>left column</b> left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column';
|
||||
$left_column = '<b>LEFT COLUMN</b> left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column left column 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 = '<b>right column</b> right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column';
|
||||
$right_column = '<b>RIGHT COLUMN</b> right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column right column 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
|
||||
//============================================================+
|
||||
?>
|
||||
|
@ -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
|
||||
//============================================================+
|
||||
?>
|
||||
|
@ -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
|
||||
//============================================================+
|
||||
?>
|
||||
|
@ -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);
|
||||
|
||||
// ---------------------------------------------------------
|
||||
|
||||
|
@ -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
|
||||
//============================================================+
|
||||
?>
|
||||
|
@ -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;
|
||||
|
@ -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();
|
||||
|
||||
|
@ -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
|
||||
//============================================================+
|
||||
?>
|
||||
|
@ -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
|
||||
//============================================================+
|
||||
?>
|
||||
|
@ -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 = <<<EOD
|
||||
Encryption Example
|
||||
|
||||
Consult the source code documentation for the SetProtection() method.
|
||||
EOD;
|
||||
|
||||
// print a block of text using Write()
|
||||
$pdf->Write(0, $txt, '', 0, 'L', true, 0, false, false, 0);
|
||||
|
||||
|
||||
// ---------------------------------------------------------
|
||||
|
||||
|
@ -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
|
||||
//============================================================+
|
||||
?>
|
||||
|
@ -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 = '<span color="#0000ff">Hi, At last Problem of Persian PDF Solved completely. This is a example for it.<br />Problem of "jeh" letter in some word like "ویژه" (=special) fix too.<br />The joining of laa and alf letter fix now.<br />Special thanks to "Nicola Asuni" and "Mohamad Ali Golkar" for Persian support.</span>';
|
||||
$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 = 'تمَّ بِحمد الله حلّ مشكلة الكتابة باللغة العربية في ملفات الـ<span color="#FF0000">PDF</span> مع دعم الكتابة <span color="#0000FF">من اليمين إلى اليسار</span> و<span color="#009900">الحركَات</span> .<br />تم الحل بواسطة <span color="#993399">صالح المطرفي و Asuni Nicola</span> . ';
|
||||
$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 = '<span color="#0000ff">This is Arabic "العربية" Example With TCPDF.</span>';
|
||||
$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
|
||||
//============================================================+
|
||||
?>
|
||||
|
@ -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
|
||||
//============================================================+
|
||||
?>
|
||||
|
@ -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
|
||||
//============================================================+
|
||||
?>
|
||||
?>
|
||||
|
@ -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. <em>Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur?</em> <em>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?</em><br /><br /><b>A</b> + <b>B</b> = <b>C</b> -> <i>C</i> - <i>B</i> = <i>A</i> -> <i>C</i> - <i>A</i> = <i>B</i> -> <b>A</b> + <b>B</b> = <b>C</b> -> <i>C</i> - <i>B</i> = <i>A</i> -> <i>C</i> - <i>A</i> = <i>B</i> -> <b>A</b> + <b>B</b> = <b>C</b> -> <i>C</i> - <i>B</i> = <i>A</i> -> <i>C</i> - <i>A</i> = <i>B</i> -> <b>A</b> + <b>B</b> = <b>C</b> -> <i>C</i> - <i>B</i> = <i>A</i> -> <i>C</i> - <i>A</i> = <i>B</i> -> <b>A</b> + <b>B</b> = <b>C</b> -> <i>C</i> - <i>B</i> = <i>A</i> -> <i>C</i> - <i>A</i> = <i>B</i> -> <b>A</b> + <b>B</b> = <b>C</b> -> <i>C</i> - <i>B</i> = <i>A</i> -> <i>C</i> - <i>A</i> = <i>B</i> -> <b>A</b> + <b>B</b> = <b>C</b> -> <i>C</i> - <i>B</i> = <i>A</i> -> <i>C</i> - <i>A</i> = <i>B</i> -> <b>A</b> + <b>B</b> = <b>C</b> -> <i>C</i> - <i>B</i> = <i>A</i> -> <i>C</i> - <i>A</i> = <i>B</i><br /><br /><b>Bold</b><i>Italic</i><u>Underlined</u> <b>Bold</b><i>Italic</i><u>Underlined</u> <b>Bold</b><i>Italic</i><u>Underlined</u> <b>Bold</b><i>Italic</i><u>Underlined</u> <b>Bold</b><i>Italic</i><u>Underlined</u> <b>Bold</b><i>Italic</i><u>Underlined</u> <b>Bold</b><i>Italic</i><u>Underlined</u> <b>Bold</b><i>Italic</i><u>Underlined</u> <b>Bold</b><i>Italic</i><u>Underlined</u> <b>Bold</b><i>Italic</i><u>Underlined</u> <b>Bold</b><i>Italic</i><u>Underlined</u> <b>Bold</b><i>Italic</i><u>Underlined</u> <b>Bold</b><i>Italic</i><u>Underlined</u> <b>Bold</b><i>Italic</i><u>Underlined</u> <b>Bold</b><i>Italic</i><u>Underlined</u>';
|
||||
$html = '<h1>Example of HTML text flow</h1>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. <em>Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur?</em> <em>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?</em><br /><br /><b>A</b> + <b>B</b> = <b>C</b> -> <i>C</i> - <i>B</i> = <i>A</i> -> <i>C</i> - <i>A</i> = <i>B</i> -> <b>A</b> + <b>B</b> = <b>C</b> -> <i>C</i> - <i>B</i> = <i>A</i> -> <i>C</i> - <i>A</i> = <i>B</i> -> <b>A</b> + <b>B</b> = <b>C</b> -> <i>C</i> - <i>B</i> = <i>A</i> -> <i>C</i> - <i>A</i> = <i>B</i> -> <b>A</b> + <b>B</b> = <b>C</b> -> <i>C</i> - <i>B</i> = <i>A</i> -> <i>C</i> - <i>A</i> = <i>B</i> -> <b>A</b> + <b>B</b> = <b>C</b> -> <i>C</i> - <i>B</i> = <i>A</i> -> <i>C</i> - <i>A</i> = <i>B</i> -> <b>A</b> + <b>B</b> = <b>C</b> -> <i>C</i> - <i>B</i> = <i>A</i> -> <i>C</i> - <i>A</i> = <i>B</i> -> <b>A</b> + <b>B</b> = <b>C</b> -> <i>C</i> - <i>B</i> = <i>A</i> -> <i>C</i> - <i>A</i> = <i>B</i> -> <b>A</b> + <b>B</b> = <b>C</b> -> <i>C</i> - <i>B</i> = <i>A</i> -> <i>C</i> - <i>A</i> = <i>B</i><br /><br /><b>Bold</b><i>Italic</i><u>Underlined</u> <b>Bold</b><i>Italic</i><u>Underlined</u> <b>Bold</b><i>Italic</i><u>Underlined</u> <b>Bold</b><i>Italic</i><u>Underlined</u> <b>Bold</b><i>Italic</i><u>Underlined</u> <b>Bold</b><i>Italic</i><u>Underlined</u> <b>Bold</b><i>Italic</i><u>Underlined</u> <b>Bold</b><i>Italic</i><u>Underlined</u> <b>Bold</b><i>Italic</i><u>Underlined</u> <b>Bold</b><i>Italic</i><u>Underlined</u> <b>Bold</b><i>Italic</i><u>Underlined</u> <b>Bold</b><i>Italic</i><u>Underlined</u> <b>Bold</b><i>Italic</i><u>Underlined</u> <b>Bold</b><i>Italic</i><u>Underlined</u> <b>Bold</b><i>Italic</i><u>Underlined</u>';
|
||||
|
||||
// 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
|
||||
//============================================================+
|
||||
?>
|
||||
|
@ -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');
|
||||
|
||||
// ---------------------------------------------------------
|
||||
|
||||
|
@ -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 = <<<EOD
|
||||
Example of page groups.
|
||||
Check the page numbers on the page footer.
|
||||
|
||||
This is the first page of group 1.
|
||||
EOD;
|
||||
|
||||
// print a block of text using Write()
|
||||
$pdf->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
|
||||
//============================================================+
|
||||
?>
|
||||
|
@ -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
|
||||
//============================================================+
|
||||
?>
|
||||
|
@ -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
|
||||
|
@ -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));
|
||||
|
@ -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');
|
||||
|
||||
// ---------------------------------------------------------
|
||||
|
||||
|
@ -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
|
||||
//============================================================+
|
||||
?>
|
||||
|
@ -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
|
||||
//============================================================+
|
||||
?>
|
||||
|
@ -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 Bézier 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 Bézier points x1,y1 ... x12, y12 of the patch (see coons_patch_mesh_coords.jpg)
|
||||
$coords = array(
|
||||
0.00,0.00, 0.33,0.20, //lower left
|
||||
0.67,0.00, 1.00,0.00, 0.80,0.33, //lower right
|
||||
@ -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
|
||||
//============================================================+
|
||||
?>
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
//============================================================+
|
||||
?>
|
||||
|
@ -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
|
||||
//============================================================+
|
||||
?>
|
||||
|
@ -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
|
||||
//============================================================+
|
||||
?>
|
||||
|
@ -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
|
||||
//============================================================+
|
||||
?>
|
||||
|
@ -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
|
||||
//============================================================+
|
||||
?>
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
//============================================================+
|
||||
?>
|
||||
|
@ -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 = '<span style="text-align:justify;">a <u>abc</u> abcdefghijkl abcdef abcdefg <b>abcdefghi</b> a abc abcd <img src="../images/logo_example.png" border="0" height="41" width="41" /> <img src="../images/tiger.ai" alt="test alt attribute" width="100" height="100" border="0" /> abcdef abcdefg <b>abcdefghi</b> a abc abcd abcdef abcdefg <b>abcdefghi</b> a abc abcd abcdef abcdefg <b>abcdefghi</b> a <u>abc</u> abcd abcdef abcdefg <b>abcdefghi</b> a abc abcd abcdef abcdefg <b>abcdefghi</b> a abc abcd abcdef abcdefg <b>abcdefghi</b> a abc abcd abcdef abcdefg <b>abcdefghi</b> a abc abcd abcdef abcdefg <b>abcdefghi</b> a abc abcd abcdef abcdefg abcdefghi a abc abcd <a href="http://tcpdf.org">abcdef abcdefg</a> start a abc before <span style="background-color:yellow">yellow color</span> 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<br />abcd abcdef abcdefg abcdefghi<br />abcd abcde abcdef</span>';
|
||||
|
||||
// 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
|
||||
//============================================================+
|
||||
?>
|
||||
|
@ -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
|
||||
//============================================================+
|
||||
?>
|
||||
|
@ -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
|
||||
//============================================================+
|
||||
?>
|
||||
|
@ -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
|
||||
//============================================================+
|
||||
?>
|
||||
|
@ -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
|
||||
//============================================================+
|
||||
?>
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
//============================================================+
|
||||
?>
|
||||
|
@ -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');
|
||||
|
||||
|
@ -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
|
||||
//============================================================+
|
||||
?>
|
||||
|
@ -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 = <<<EOD
|
||||
@ -91,7 +95,7 @@ $tbl = <<<EOD
|
||||
<tr>
|
||||
<td>COL 3 - ROW 3</td>
|
||||
</tr>
|
||||
|
||||
|
||||
</table>
|
||||
EOD;
|
||||
|
||||
@ -113,7 +117,7 @@ $tbl = <<<EOD
|
||||
<tr>
|
||||
<td>COL 3 - ROW 3</td>
|
||||
</tr>
|
||||
|
||||
|
||||
</table>
|
||||
EOD;
|
||||
|
||||
@ -135,7 +139,7 @@ $tbl = <<<EOD
|
||||
<tr>
|
||||
<td>COL 3 - ROW 3</td>
|
||||
</tr>
|
||||
|
||||
|
||||
</table>
|
||||
EOD;
|
||||
|
||||
@ -308,6 +312,6 @@ $pdf->writeHTML($tbl, true, false, false, false, '');
|
||||
$pdf->Output('example_048.pdf', 'I');
|
||||
|
||||
//============================================================+
|
||||
// END OF FILE
|
||||
// END OF FILE
|
||||
//============================================================+
|
||||
?>
|
||||
|
@ -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 .= '<tcpdf method="write1DBarcode" params="'.$params.'" />';
|
||||
|
||||
$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 .= '<tcpdf method="write1DBarcode" params="'.$params.'" />';
|
||||
|
||||
$html .= '<tcpdf method="AddPage" />
|
||||
<h2> Graphic Functions</h2>';
|
||||
$html .= '<tcpdf method="AddPage" /><h2>Graphic Functions</h2>';
|
||||
|
||||
$params = $pdf->serializeTCPDFtagParameters(array(0));
|
||||
$html .= '<tcpdf method="SetDrawColor" params="'.$params.'" />';
|
||||
|
@ -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));
|
||||
|
@ -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('<span style="background-color:yellow;color:blue">PAGE 1</span>', $ln=true, $fill=false, $reseth=false, $cell=false, $align='');
|
||||
// Print a text
|
||||
$html = '<span style="background-color:yellow;color:blue;"> PAGE 1 </span>
|
||||
<p stroke="0.2" fill="true" strokecolor="yellow" color="blue" style="font-family:helvetica;font-weight:bold;font-size:26pt;">You can set a full page background.</p>';
|
||||
$pdf->writeHTML($html, true, false, true, false, '');
|
||||
|
||||
|
||||
// add a page
|
||||
$pdf->AddPage();
|
||||
|
||||
// Pritn a text
|
||||
$pdf->writeHTML('<span style="background-color:yellow;color:blue">PAGE 2</span>', $ln=true, $fill=false, $reseth=false, $cell=false, $align='');
|
||||
// Print a text
|
||||
$html = '<span style="background-color:yellow;color:blue;"> PAGE 2 </span>';
|
||||
$pdf->writeHTML($html, true, false, true, false, '');
|
||||
|
||||
// ---------------------------------------------------------
|
||||
|
||||
@ -106,6 +110,6 @@ $pdf->writeHTML('<span style="background-color:yellow;color:blue">PAGE 2</span>'
|
||||
$pdf->Output('example_051.pdf', 'I');
|
||||
|
||||
//============================================================+
|
||||
// END OF FILE
|
||||
// END OF FILE
|
||||
//============================================================+
|
||||
?>
|
||||
|
@ -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 <b color="#FF0000">digitally signed document</b> using the default (example) <b>tcpdf.crt</b> certificate.<br />To validate this signature you have to load the <b>tcpdf.fdf</b> on the Arobat Reader to add the certificate to List of Trusted Identities.<br /><br />For more information check the source code of this example and the source code documentation for the <i>setSignature()</i> method.<br /><br /><a href="http://www.tcpdf.org">www.tcpdf.org</a>.';
|
||||
$text = 'This is a <b color="#FF0000">digitally signed document</b> using the default (example) <b>tcpdf.crt</b> certificate.<br />To validate this signature you have to load the <b color="#006600">tcpdf.fdf</b> on the Arobat Reader to add the certificate to <i>List of Trusted Identities</i>.<br /><br />For more information check the source code of this example and the source code documentation for the <i>setSignature()</i> method.<br /><br /><a href="http://www.tcpdf.org">www.tcpdf.org</a>';
|
||||
$pdf->writeHTML($text, true, 0, true, 0);
|
||||
|
||||
// ---------------------------------------------------------
|
||||
|
@ -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.<br /><br />For more information check the source code of this example, the source code documentation for the <i>IncludeJS()</i> method and the <i>JavaScript for Acrobat API Reference</i> guide.<br /><br /><a href="http://www.tcpdf.org">www.tcpdf.org</a>.';
|
||||
$text = 'This is an example of <strong>JavaScript</strong> usage on PDF documents.<br /><br />For more information check the source code of this example, the source code documentation for the <i>IncludeJS()</i> method and the <i>JavaScript for Acrobat API Reference</i> guide.<br /><br /><a href="http://www.tcpdf.org">www.tcpdf.org</a>';
|
||||
$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
|
||||
//============================================================+
|
||||
?>
|
||||
|
@ -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
|
||||
//============================================================+
|
||||
?>
|
||||
|
@ -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 = '<h1>Font Dump</h1>';
|
||||
$html = '<h1>Core Fonts Dump</h1>';
|
||||
|
||||
// create one HTML table for each core font
|
||||
foreach($core_fonts as $font) {
|
||||
// create HTML content
|
||||
$html .= '<table cellpadding="1" cellspacing="0" border="1" nobr="true" style="font-family:'.$font.';text-align:center;">';
|
||||
$html .= '<tr><td colspan="16" style="font-family:helvetica;font-weight:bold">'.strtoupper($font).'</td></tr><tr>';
|
||||
$html .= '<tr style="background-color:yellow;"><td colspan="16" style="font-family:helvetica;font-weight:bold">'.strtoupper($font).'</td></tr><tr>';
|
||||
// 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 .= '<td>'.$chr.'</td>';
|
||||
}
|
||||
$html .= '</tr></table><br />';
|
||||
$html .= '</tr></table><br /> <br />';
|
||||
}
|
||||
|
||||
// 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
|
||||
//============================================================+
|
||||
?>
|
||||
|
@ -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
|
||||
//============================================================+
|
||||
?>
|
||||
|
@ -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);
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
|
@ -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
|
||||
|
@ -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] = '<table border="0" cellpadding="0" cellspacing="0"><tr>
|
||||
// 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
|
||||
|
@ -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
|
||||
|
@ -40,7 +40,7 @@ echo '<'.'?'.'xml version="1.0" encoding="UTF-8"'.'?'.'>';
|
||||
<li>Non unicode / Alternative config file: [<a href="example_019.php" title="PDF [new window]" target="_blank">PDF</a>]</li>
|
||||
<li>Multicell complex alignment: [<a href="example_020.php" title="PDF [new window]" target="_blank">PDF</a>]</li>
|
||||
<li>writeHTML alignment: [<a href="example_021.php" title="PDF [new window]" target="_blank">PDF</a>]</li>
|
||||
<li>CMYK colors: [[<a href="example_022.php" title="PDF [new window]" target="_blank">PDF</a>]</li>
|
||||
<li>CMYK colors: [<a href="example_022.php" title="PDF [new window]" target="_blank">PDF</a>]</li>
|
||||
<li>Page Groups: [<a href="example_023.php" title="PDF [new window]" target="_blank">PDF</a>]</li>
|
||||
<li>Object Visibility: [<a href="example_024.php" title="PDF [new window]" target="_blank">PDF</a>]</li>
|
||||
<li>Object Transparency: [<a href="example_025.php" title="PDF [new window]" target="_blank">PDF</a>]</li>
|
||||
|
235
tcpdf.php
235
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.<br>
|
||||
* 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.<br>
|
||||
* @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:
|
||||
* <pre>
|
||||
* // 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();
|
||||
* </pre>
|
||||
* @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 Fernández, 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:
|
||||
* <pre>
|
||||
* // 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();
|
||||
* </pre>
|
||||
* @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 Fernández
|
||||
* @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.<br />
|
||||
* @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 <a> 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': {
|
||||
|
Loading…
Reference in New Issue
Block a user