package.xml0000664000175000017500000003551212653753017011316 0ustar janjan Horde_Pdf pear.horde.org File_PDF Horde PDF library PDF generation using only PHP, without requiring any external libraries. Jan Schneider jan jan@horde.org yes Chuck Hagenbuch chuck chuck@horde.org yes Mike Naberezny mnaberez mike@maintainable.com yes 2016-02-01 2.0.7 1.0.0 stable stable LGPL-2.1 * [jan] Mark PHP 7 as supported. 5.3.0 8.0.0alpha1 8.0.0alpha1 1.7.0 Horde_Exception pear.horde.org 2.0.0 3.0.0alpha1 3.0.0alpha1 Horde_Util pear.horde.org 2.0.0 3.0.0alpha1 3.0.0alpha1 Horde_Test pear.horde.org 2.1.0 3.0.0alpha1 3.0.0alpha1 1.0.0alpha1 1.0.0 alpha alpha 2011-03-08 LGPL-2.1 * First alpha release for Horde 4. 1.0.0beta1 1.0.0 beta beta 2011-03-16 LGPL-2.1 * First beta release for Horde 4. 1.0.0RC1 1.0.0 beta beta 2011-03-22 LGPL-2.1 * First release candidate for Horde 4. 1.0.0RC2 1.0.0 beta beta 2011-03-29 LGPL-2.1 * Second release candidate for Horde 4. 1.0.0 1.0.0 stable stable 2011-04-06 LGPL-2.1 * First stable release for Horde 4. 1.0.1 1.0.0 stable stable 2011-08-30 LGPL-2.1 * [jan] Fix setting Courier fonts with font style (PEAR Bug #18550). 1.0.2 1.0.0 stable stable 2011-11-01 LGPL-2.1 * [gwr] Add missing font files. 2.0.0alpha1 1.0.0 alpha stable 2012-07-05 LGPL-2.1 * First alpha release for Horde 5. 2.0.0beta1 1.0.0 beta stable 2012-07-19 LGPL-2.1 * First beta release for Horde 5. 2.0.0 1.0.0 stable stable 2012-10-30 LGPL-2.1 * First stable release for Horde 5. 2.0.1 1.0.0 stable stable 2012-11-19 LGPL-2.1 * [mms] Use new Horde_Test layout. 2.0.2 1.0.0 stable stable 2013-01-09 LGPL-2.1 * [jan] Fix swapped getFormatHeight() and getFormatWidth() methods (Bug #11762). 2.0.3 1.0.0 stable stable 2013-02-11 LGPL-2.1 * [jan] Fix getFormatHeight() and getFormatWidth() in landscape mode. 2.0.4 1.0.0 stable stable 2015-01-09 LGPL-2.1 * [jan] Add Composer definition. 2.0.5 1.0.0 stable stable 2015-04-28 LGPL-2.1 * [jan] Fix issues with certain locales like Turkish. 2.0.6 1.0.0 stable stable 2015-10-20 LGPL-2.1 * [mjr] Avoid some PHP warnings. 2.0.7 1.0.0 stable stable 2016-02-01 LGPL-2.1 * [jan] Mark PHP 7 as supported. Horde_Pdf-2.0.7/doc/Horde/Pdf/COPYING0000664000175000017500000005764612653753017015063 0ustar janjan GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Horde_Pdf-2.0.7/lib/Horde/Pdf/Font/Courier.php0000664000175000017500000000066212653753017017042 0ustar janjan array( chr(0) => 278, chr(1) => 278, chr(2) => 278, chr(3) => 278, chr(4) => 278, chr(5) => 278, chr(6) => 278, chr(7) => 278, chr(8) => 278, chr(9) => 278, chr(10) => 278, chr(11) => 278, chr(12) => 278, chr(13) => 278, chr(14) => 278, chr(15) => 278, chr(16) => 278, chr(17) => 278, chr(18) => 278, chr(19) => 278, chr(20) => 278, chr(21) => 278, chr(22) => 278, chr(23) => 278, chr(24) => 278, chr(25) => 278, chr(26) => 278, chr(27) => 278, chr(28) => 278, chr(29) => 278, chr(30) => 278, chr(31) => 278, ' ' => 278, '!' => 278, '"' => 355, '#' => 556, '$' => 556, '%' => 889, '&' => 667, '\'' => 191, '(' => 333, ')' => 333, '*' => 389, '+' => 584, ',' => 278, '-' => 333, '.' => 278, '/' => 278, '0' => 556, '1' => 556, '2' => 556, '3' => 556, '4' => 556, '5' => 556, '6' => 556, '7' => 556, '8' => 556, '9' => 556, ':' => 278, ';' => 278, '<' => 584, '=' => 584, '>' => 584, '?' => 556, '@' => 1015, 'A' => 667, 'B' => 667, 'C' => 722, 'D' => 722, 'E' => 667, 'F' => 611, 'G' => 778, 'H' => 722, 'I' => 278, 'J' => 500, 'K' => 667, 'L' => 556, 'M' => 833, 'N' => 722, 'O' => 778, 'P' => 667, 'Q' => 778, 'R' => 722, 'S' => 667, 'T' => 611, 'U' => 722, 'V' => 667, 'W' => 944, 'X' => 667, 'Y' => 667, 'Z' => 611, '[' => 278, '\\' => 278, ']' => 278, '^' => 469, '_' => 556, '`' => 333, 'a' => 556, 'b' => 556, 'c' => 500, 'd' => 556, 'e' => 556, 'f' => 278, 'g' => 556, 'h' => 556, 'i' => 222, 'j' => 222, 'k' => 500, 'l' => 222, 'm' => 833, 'n' => 556, 'o' => 556, 'p' => 556, 'q' => 556, 'r' => 333, 's' => 500, 't' => 278, 'u' => 556, 'v' => 500, 'w' => 722, 'x' => 500, 'y' => 500, 'z' => 500, '{' => 334, '|' => 260, '}' => 334, '~' => 584, chr(127) => 350, chr(128) => 556, chr(129) => 350, chr(130) => 222, chr(131) => 556, chr(132) => 333, chr(133) => 1000, chr(134) => 556, chr(135) => 556, chr(136) => 333, chr(137) => 1000, chr(138) => 667, chr(139) => 333, chr(140) => 1000, chr(141) => 350, chr(142) => 611, chr(143) => 350, chr(144) => 350, chr(145) => 222, chr(146) => 222, chr(147) => 333, chr(148) => 333, chr(149) => 350, chr(150) => 556, chr(151) => 1000, chr(152) => 333, chr(153) => 1000, chr(154) => 500, chr(155) => 333, chr(156) => 944, chr(157) => 350, chr(158) => 500, chr(159) => 667, chr(160) => 278, chr(161) => 333, chr(162) => 556, chr(163) => 556, chr(164) => 556, chr(165) => 556, chr(166) => 260, chr(167) => 556, chr(168) => 333, chr(169) => 737, chr(170) => 370, chr(171) => 556, chr(172) => 584, chr(173) => 333, chr(174) => 737, chr(175) => 333, chr(176) => 400, chr(177) => 584, chr(178) => 333, chr(179) => 333, chr(180) => 333, chr(181) => 556, chr(182) => 537, chr(183) => 278, chr(184) => 333, chr(185) => 333, chr(186) => 365, chr(187) => 556, chr(188) => 834, chr(189) => 834, chr(190) => 834, chr(191) => 611, chr(192) => 667, chr(193) => 667, chr(194) => 667, chr(195) => 667, chr(196) => 667, chr(197) => 667, chr(198) => 1000, chr(199) => 722, chr(200) => 667, chr(201) => 667, chr(202) => 667, chr(203) => 667, chr(204) => 278, chr(205) => 278, chr(206) => 278, chr(207) => 278, chr(208) => 722, chr(209) => 722, chr(210) => 778, chr(211) => 778, chr(212) => 778, chr(213) => 778, chr(214) => 778, chr(215) => 584, chr(216) => 778, chr(217) => 722, chr(218) => 722, chr(219) => 722, chr(220) => 722, chr(221) => 667, chr(222) => 667, chr(223) => 611, chr(224) => 556, chr(225) => 556, chr(226) => 556, chr(227) => 556, chr(228) => 556, chr(229) => 556, chr(230) => 889, chr(231) => 500, chr(232) => 556, chr(233) => 556, chr(234) => 556, chr(235) => 556, chr(236) => 278, chr(237) => 278, chr(238) => 278, chr(239) => 278, chr(240) => 556, chr(241) => 556, chr(242) => 556, chr(243) => 556, chr(244) => 556, chr(245) => 556, chr(246) => 556, chr(247) => 584, chr(248) => 611, chr(249) => 556, chr(250) => 556, chr(251) => 556, chr(252) => 556, chr(253) => 500, chr(254) => 556, chr(255) => 500, )); } } Horde_Pdf-2.0.7/lib/Horde/Pdf/Font/Helveticab.php0000664000175000017500000001613512653753017017502 0ustar janjan array( chr(0) => 278, chr(1) => 278, chr(2) => 278, chr(3) => 278, chr(4) => 278, chr(5) => 278, chr(6) => 278, chr(7) => 278, chr(8) => 278, chr(9) => 278, chr(10) => 278, chr(11) => 278, chr(12) => 278, chr(13) => 278, chr(14) => 278, chr(15) => 278, chr(16) => 278, chr(17) => 278, chr(18) => 278, chr(19) => 278, chr(20) => 278, chr(21) => 278, chr(22) => 278, chr(23) => 278, chr(24) => 278, chr(25) => 278, chr(26) => 278, chr(27) => 278, chr(28) => 278, chr(29) => 278, chr(30) => 278, chr(31) => 278, ' ' => 278, '!' => 333, '"' => 474, '#' => 556, '$' => 556, '%' => 889, '&' => 722, '\'' => 238, '(' => 333, ')' => 333, '*' => 389, '+' => 584, ',' => 278, '-' => 333, '.' => 278, '/' => 278, '0' => 556, '1' => 556, '2' => 556, '3' => 556, '4' => 556, '5' => 556, '6' => 556, '7' => 556, '8' => 556, '9' => 556, ':' => 333, ';' => 333, '<' => 584, '=' => 584, '>' => 584, '?' => 611, '@' => 975, 'A' => 722, 'B' => 722, 'C' => 722, 'D' => 722, 'E' => 667, 'F' => 611, 'G' => 778, 'H' => 722, 'I' => 278, 'J' => 556, 'K' => 722, 'L' => 611, 'M' => 833, 'N' => 722, 'O' => 778, 'P' => 667, 'Q' => 778, 'R' => 722, 'S' => 667, 'T' => 611, 'U' => 722, 'V' => 667, 'W' => 944, 'X' => 667, 'Y' => 667, 'Z' => 611, '[' => 333, '\\' => 278, ']' => 333, '^' => 584, '_' => 556, '`' => 333, 'a' => 556, 'b' => 611, 'c' => 556, 'd' => 611, 'e' => 556, 'f' => 333, 'g' => 611, 'h' => 611, 'i' => 278, 'j' => 278, 'k' => 556, 'l' => 278, 'm' => 889, 'n' => 611, 'o' => 611, 'p' => 611, 'q' => 611, 'r' => 389, 's' => 556, 't' => 333, 'u' => 611, 'v' => 556, 'w' => 778, 'x' => 556, 'y' => 556, 'z' => 500, '{' => 389, '|' => 280, '}' => 389, '~' => 584, chr(127) => 350, chr(128) => 556, chr(129) => 350, chr(130) => 278, chr(131) => 556, chr(132) => 500, chr(133) => 1000, chr(134) => 556, chr(135) => 556, chr(136) => 333, chr(137) => 1000, chr(138) => 667, chr(139) => 333, chr(140) => 1000, chr(141) => 350, chr(142) => 611, chr(143) => 350, chr(144) => 350, chr(145) => 278, chr(146) => 278, chr(147) => 500, chr(148) => 500, chr(149) => 350, chr(150) => 556, chr(151) => 1000, chr(152) => 333, chr(153) => 1000, chr(154) => 556, chr(155) => 333, chr(156) => 944, chr(157) => 350, chr(158) => 500, chr(159) => 667, chr(160) => 278, chr(161) => 333, chr(162) => 556, chr(163) => 556, chr(164) => 556, chr(165) => 556, chr(166) => 280, chr(167) => 556, chr(168) => 333, chr(169) => 737, chr(170) => 370, chr(171) => 556, chr(172) => 584, chr(173) => 333, chr(174) => 737, chr(175) => 333, chr(176) => 400, chr(177) => 584, chr(178) => 333, chr(179) => 333, chr(180) => 333, chr(181) => 611, chr(182) => 556, chr(183) => 278, chr(184) => 333, chr(185) => 333, chr(186) => 365, chr(187) => 556, chr(188) => 834, chr(189) => 834, chr(190) => 834, chr(191) => 611, chr(192) => 722, chr(193) => 722, chr(194) => 722, chr(195) => 722, chr(196) => 722, chr(197) => 722, chr(198) => 1000, chr(199) => 722, chr(200) => 667, chr(201) => 667, chr(202) => 667, chr(203) => 667, chr(204) => 278, chr(205) => 278, chr(206) => 278, chr(207) => 278, chr(208) => 722, chr(209) => 722, chr(210) => 778, chr(211) => 778, chr(212) => 778, chr(213) => 778, chr(214) => 778, chr(215) => 584, chr(216) => 778, chr(217) => 722, chr(218) => 722, chr(219) => 722, chr(220) => 722, chr(221) => 667, chr(222) => 667, chr(223) => 611, chr(224) => 556, chr(225) => 556, chr(226) => 556, chr(227) => 556, chr(228) => 556, chr(229) => 556, chr(230) => 889, chr(231) => 556, chr(232) => 556, chr(233) => 556, chr(234) => 556, chr(235) => 556, chr(236) => 278, chr(237) => 278, chr(238) => 278, chr(239) => 278, chr(240) => 611, chr(241) => 611, chr(242) => 611, chr(243) => 611, chr(244) => 611, chr(245) => 611, chr(246) => 611, chr(247) => 584, chr(248) => 611, chr(249) => 611, chr(250) => 611, chr(251) => 611, chr(252) => 611, chr(253) => 556, chr(254) => 611, chr(255) => 556, )); } } Horde_Pdf-2.0.7/lib/Horde/Pdf/Font/Helveticabi.php0000664000175000017500000001613712653753017017655 0ustar janjan array( chr(0) => 278, chr(1) => 278, chr(2) => 278, chr(3) => 278, chr(4) => 278, chr(5) => 278, chr(6) => 278, chr(7) => 278, chr(8) => 278, chr(9) => 278, chr(10) => 278, chr(11) => 278, chr(12) => 278, chr(13) => 278, chr(14) => 278, chr(15) => 278, chr(16) => 278, chr(17) => 278, chr(18) => 278, chr(19) => 278, chr(20) => 278, chr(21) => 278, chr(22) => 278, chr(23) => 278, chr(24) => 278, chr(25) => 278, chr(26) => 278, chr(27) => 278, chr(28) => 278, chr(29) => 278, chr(30) => 278, chr(31) => 278, ' ' => 278, '!' => 333, '"' => 474, '#' => 556, '$' => 556, '%' => 889, '&' => 722, '\'' => 238, '(' => 333, ')' => 333, '*' => 389, '+' => 584, ',' => 278, '-' => 333, '.' => 278, '/' => 278, '0' => 556, '1' => 556, '2' => 556, '3' => 556, '4' => 556, '5' => 556, '6' => 556, '7' => 556, '8' => 556, '9' => 556, ':' => 333, ';' => 333, '<' => 584, '=' => 584, '>' => 584, '?' => 611, '@' => 975, 'A' => 722, 'B' => 722, 'C' => 722, 'D' => 722, 'E' => 667, 'F' => 611, 'G' => 778, 'H' => 722, 'I' => 278, 'J' => 556, 'K' => 722, 'L' => 611, 'M' => 833, 'N' => 722, 'O' => 778, 'P' => 667, 'Q' => 778, 'R' => 722, 'S' => 667, 'T' => 611, 'U' => 722, 'V' => 667, 'W' => 944, 'X' => 667, 'Y' => 667, 'Z' => 611, '[' => 333, '\\' => 278, ']' => 333, '^' => 584, '_' => 556, '`' => 333, 'a' => 556, 'b' => 611, 'c' => 556, 'd' => 611, 'e' => 556, 'f' => 333, 'g' => 611, 'h' => 611, 'i' => 278, 'j' => 278, 'k' => 556, 'l' => 278, 'm' => 889, 'n' => 611, 'o' => 611, 'p' => 611, 'q' => 611, 'r' => 389, 's' => 556, 't' => 333, 'u' => 611, 'v' => 556, 'w' => 778, 'x' => 556, 'y' => 556, 'z' => 500, '{' => 389, '|' => 280, '}' => 389, '~' => 584, chr(127) => 350, chr(128) => 556, chr(129) => 350, chr(130) => 278, chr(131) => 556, chr(132) => 500, chr(133) => 1000, chr(134) => 556, chr(135) => 556, chr(136) => 333, chr(137) => 1000, chr(138) => 667, chr(139) => 333, chr(140) => 1000, chr(141) => 350, chr(142) => 611, chr(143) => 350, chr(144) => 350, chr(145) => 278, chr(146) => 278, chr(147) => 500, chr(148) => 500, chr(149) => 350, chr(150) => 556, chr(151) => 1000, chr(152) => 333, chr(153) => 1000, chr(154) => 556, chr(155) => 333, chr(156) => 944, chr(157) => 350, chr(158) => 500, chr(159) => 667, chr(160) => 278, chr(161) => 333, chr(162) => 556, chr(163) => 556, chr(164) => 556, chr(165) => 556, chr(166) => 280, chr(167) => 556, chr(168) => 333, chr(169) => 737, chr(170) => 370, chr(171) => 556, chr(172) => 584, chr(173) => 333, chr(174) => 737, chr(175) => 333, chr(176) => 400, chr(177) => 584, chr(178) => 333, chr(179) => 333, chr(180) => 333, chr(181) => 611, chr(182) => 556, chr(183) => 278, chr(184) => 333, chr(185) => 333, chr(186) => 365, chr(187) => 556, chr(188) => 834, chr(189) => 834, chr(190) => 834, chr(191) => 611, chr(192) => 722, chr(193) => 722, chr(194) => 722, chr(195) => 722, chr(196) => 722, chr(197) => 722, chr(198) => 1000, chr(199) => 722, chr(200) => 667, chr(201) => 667, chr(202) => 667, chr(203) => 667, chr(204) => 278, chr(205) => 278, chr(206) => 278, chr(207) => 278, chr(208) => 722, chr(209) => 722, chr(210) => 778, chr(211) => 778, chr(212) => 778, chr(213) => 778, chr(214) => 778, chr(215) => 584, chr(216) => 778, chr(217) => 722, chr(218) => 722, chr(219) => 722, chr(220) => 722, chr(221) => 667, chr(222) => 667, chr(223) => 611, chr(224) => 556, chr(225) => 556, chr(226) => 556, chr(227) => 556, chr(228) => 556, chr(229) => 556, chr(230) => 889, chr(231) => 556, chr(232) => 556, chr(233) => 556, chr(234) => 556, chr(235) => 556, chr(236) => 278, chr(237) => 278, chr(238) => 278, chr(239) => 278, chr(240) => 611, chr(241) => 611, chr(242) => 611, chr(243) => 611, chr(244) => 611, chr(245) => 611, chr(246) => 611, chr(247) => 584, chr(248) => 611, chr(249) => 611, chr(250) => 611, chr(251) => 611, chr(252) => 611, chr(253) => 556, chr(254) => 611, chr(255) => 556, )); } } Horde_Pdf-2.0.7/lib/Horde/Pdf/Font/Helveticai.php0000664000175000017500000001613612653753017017512 0ustar janjan array( chr(0) => 278, chr(1) => 278, chr(2) => 278, chr(3) => 278, chr(4) => 278, chr(5) => 278, chr(6) => 278, chr(7) => 278, chr(8) => 278, chr(9) => 278, chr(10) => 278, chr(11) => 278, chr(12) => 278, chr(13) => 278, chr(14) => 278, chr(15) => 278, chr(16) => 278, chr(17) => 278, chr(18) => 278, chr(19) => 278, chr(20) => 278, chr(21) => 278, chr(22) => 278, chr(23) => 278, chr(24) => 278, chr(25) => 278, chr(26) => 278, chr(27) => 278, chr(28) => 278, chr(29) => 278, chr(30) => 278, chr(31) => 278, ' ' => 278, '!' => 278, '"' => 355, '#' => 556, '$' => 556, '%' => 889, '&' => 667, '\'' => 191, '(' => 333, ')' => 333, '*' => 389, '+' => 584, ',' => 278, '-' => 333, '.' => 278, '/' => 278, '0' => 556, '1' => 556, '2' => 556, '3' => 556, '4' => 556, '5' => 556, '6' => 556, '7' => 556, '8' => 556, '9' => 556, ':' => 278, ';' => 278, '<' => 584, '=' => 584, '>' => 584, '?' => 556, '@' => 1015, 'A' => 667, 'B' => 667, 'C' => 722, 'D' => 722, 'E' => 667, 'F' => 611, 'G' => 778, 'H' => 722, 'I' => 278, 'J' => 500, 'K' => 667, 'L' => 556, 'M' => 833, 'N' => 722, 'O' => 778, 'P' => 667, 'Q' => 778, 'R' => 722, 'S' => 667, 'T' => 611, 'U' => 722, 'V' => 667, 'W' => 944, 'X' => 667, 'Y' => 667, 'Z' => 611, '[' => 278, '\\' => 278, ']' => 278, '^' => 469, '_' => 556, '`' => 333, 'a' => 556, 'b' => 556, 'c' => 500, 'd' => 556, 'e' => 556, 'f' => 278, 'g' => 556, 'h' => 556, 'i' => 222, 'j' => 222, 'k' => 500, 'l' => 222, 'm' => 833, 'n' => 556, 'o' => 556, 'p' => 556, 'q' => 556, 'r' => 333, 's' => 500, 't' => 278, 'u' => 556, 'v' => 500, 'w' => 722, 'x' => 500, 'y' => 500, 'z' => 500, '{' => 334, '|' => 260, '}' => 334, '~' => 584, chr(127) => 350, chr(128) => 556, chr(129) => 350, chr(130) => 222, chr(131) => 556, chr(132) => 333, chr(133) => 1000, chr(134) => 556, chr(135) => 556, chr(136) => 333, chr(137) => 1000, chr(138) => 667, chr(139) => 333, chr(140) => 1000, chr(141) => 350, chr(142) => 611, chr(143) => 350, chr(144) => 350, chr(145) => 222, chr(146) => 222, chr(147) => 333, chr(148) => 333, chr(149) => 350, chr(150) => 556, chr(151) => 1000, chr(152) => 333, chr(153) => 1000, chr(154) => 500, chr(155) => 333, chr(156) => 944, chr(157) => 350, chr(158) => 500, chr(159) => 667, chr(160) => 278, chr(161) => 333, chr(162) => 556, chr(163) => 556, chr(164) => 556, chr(165) => 556, chr(166) => 260, chr(167) => 556, chr(168) => 333, chr(169) => 737, chr(170) => 370, chr(171) => 556, chr(172) => 584, chr(173) => 333, chr(174) => 737, chr(175) => 333, chr(176) => 400, chr(177) => 584, chr(178) => 333, chr(179) => 333, chr(180) => 333, chr(181) => 556, chr(182) => 537, chr(183) => 278, chr(184) => 333, chr(185) => 333, chr(186) => 365, chr(187) => 556, chr(188) => 834, chr(189) => 834, chr(190) => 834, chr(191) => 611, chr(192) => 667, chr(193) => 667, chr(194) => 667, chr(195) => 667, chr(196) => 667, chr(197) => 667, chr(198) => 1000, chr(199) => 722, chr(200) => 667, chr(201) => 667, chr(202) => 667, chr(203) => 667, chr(204) => 278, chr(205) => 278, chr(206) => 278, chr(207) => 278, chr(208) => 722, chr(209) => 722, chr(210) => 778, chr(211) => 778, chr(212) => 778, chr(213) => 778, chr(214) => 778, chr(215) => 584, chr(216) => 778, chr(217) => 722, chr(218) => 722, chr(219) => 722, chr(220) => 722, chr(221) => 667, chr(222) => 667, chr(223) => 611, chr(224) => 556, chr(225) => 556, chr(226) => 556, chr(227) => 556, chr(228) => 556, chr(229) => 556, chr(230) => 889, chr(231) => 500, chr(232) => 556, chr(233) => 556, chr(234) => 556, chr(235) => 556, chr(236) => 278, chr(237) => 278, chr(238) => 278, chr(239) => 278, chr(240) => 556, chr(241) => 556, chr(242) => 556, chr(243) => 556, chr(244) => 556, chr(245) => 556, chr(246) => 556, chr(247) => 584, chr(248) => 611, chr(249) => 556, chr(250) => 556, chr(251) => 556, chr(252) => 556, chr(253) => 500, chr(254) => 556, chr(255) => 500, )); } } Horde_Pdf-2.0.7/lib/Horde/Pdf/Font/Symbol.php0000664000175000017500000001601512653753017016676 0ustar janjan array( chr(0) => 250, chr(1) => 250, chr(2) => 250, chr(3) => 250, chr(4) => 250, chr(5) => 250, chr(6) => 250, chr(7) => 250, chr(8) => 250, chr(9) => 250, chr(10) => 250, chr(11) => 250, chr(12) => 250, chr(13) => 250, chr(14) => 250, chr(15) => 250, chr(16) => 250, chr(17) => 250, chr(18) => 250, chr(19) => 250, chr(20) => 250, chr(21) => 250, chr(22) => 250, chr(23) => 250, chr(24) => 250, chr(25) => 250, chr(26) => 250, chr(27) => 250, chr(28) => 250, chr(29) => 250, chr(30) => 250, chr(31) => 250, ' ' => 250, '!' => 333, '"' => 713, '#' => 500, '$' => 549, '%' => 833, '&' => 778, '\'' => 439, '(' => 333, ')' => 333, '*' => 500, '+' => 549, ',' => 250, '-' => 549, '.' => 250, '/' => 278, '0' => 500, '1' => 500, '2' => 500, '3' => 500, '4' => 500, '5' => 500, '6' => 500, '7' => 500, '8' => 500, '9' => 500, ':' => 278, ';' => 278, '<' => 549, '=' => 549, '>' => 549, '?' => 444, '@' => 549, 'A' => 722, 'B' => 667, 'C' => 722, 'D' => 612, 'E' => 611, 'F' => 763, 'G' => 603, 'H' => 722, 'I' => 333, 'J' => 631, 'K' => 722, 'L' => 686, 'M' => 889, 'N' => 722, 'O' => 722, 'P' => 768, 'Q' => 741, 'R' => 556, 'S' => 592, 'T' => 611, 'U' => 690, 'V' => 439, 'W' => 768, 'X' => 645, 'Y' => 795, 'Z' => 611, '[' => 333, '\\' => 863, ']' => 333, '^' => 658, '_' => 500, '`' => 500, 'a' => 631, 'b' => 549, 'c' => 549, 'd' => 494, 'e' => 439, 'f' => 521, 'g' => 411, 'h' => 603, 'i' => 329, 'j' => 603, 'k' => 549, 'l' => 549, 'm' => 576, 'n' => 521, 'o' => 549, 'p' => 549, 'q' => 521, 'r' => 549, 's' => 603, 't' => 439, 'u' => 576, 'v' => 713, 'w' => 686, 'x' => 493, 'y' => 686, 'z' => 494, '{' => 480, '|' => 200, '}' => 480, '~' => 549, chr(127) => 0, chr(128) => 0, chr(129) => 0, chr(130) => 0, chr(131) => 0, chr(132) => 0, chr(133) => 0, chr(134) => 0, chr(135) => 0, chr(136) => 0, chr(137) => 0, chr(138) => 0, chr(139) => 0, chr(140) => 0, chr(141) => 0, chr(142) => 0, chr(143) => 0, chr(144) => 0, chr(145) => 0, chr(146) => 0, chr(147) => 0, chr(148) => 0, chr(149) => 0, chr(150) => 0, chr(151) => 0, chr(152) => 0, chr(153) => 0, chr(154) => 0, chr(155) => 0, chr(156) => 0, chr(157) => 0, chr(158) => 0, chr(159) => 0, chr(160) => 750, chr(161) => 620, chr(162) => 247, chr(163) => 549, chr(164) => 167, chr(165) => 713, chr(166) => 500, chr(167) => 753, chr(168) => 753, chr(169) => 753, chr(170) => 753, chr(171) => 1042, chr(172) => 987, chr(173) => 603, chr(174) => 987, chr(175) => 603, chr(176) => 400, chr(177) => 549, chr(178) => 411, chr(179) => 549, chr(180) => 549, chr(181) => 713, chr(182) => 494, chr(183) => 460, chr(184) => 549, chr(185) => 549, chr(186) => 549, chr(187) => 549, chr(188) => 1000, chr(189) => 603, chr(190) => 1000, chr(191) => 658, chr(192) => 823, chr(193) => 686, chr(194) => 795, chr(195) => 987, chr(196) => 768, chr(197) => 768, chr(198) => 823, chr(199) => 768, chr(200) => 768, chr(201) => 713, chr(202) => 713, chr(203) => 713, chr(204) => 713, chr(205) => 713, chr(206) => 713, chr(207) => 713, chr(208) => 768, chr(209) => 713, chr(210) => 790, chr(211) => 790, chr(212) => 890, chr(213) => 823, chr(214) => 549, chr(215) => 250, chr(216) => 713, chr(217) => 603, chr(218) => 603, chr(219) => 1042, chr(220) => 987, chr(221) => 603, chr(222) => 987, chr(223) => 603, chr(224) => 494, chr(225) => 329, chr(226) => 790, chr(227) => 790, chr(228) => 786, chr(229) => 713, chr(230) => 384, chr(231) => 384, chr(232) => 384, chr(233) => 384, chr(234) => 384, chr(235) => 384, chr(236) => 494, chr(237) => 494, chr(238) => 494, chr(239) => 494, chr(240) => 0, chr(241) => 329, chr(242) => 274, chr(243) => 686, chr(244) => 686, chr(245) => 686, chr(246) => 384, chr(247) => 384, chr(248) => 384, chr(249) => 384, chr(250) => 384, chr(251) => 384, chr(252) => 494, chr(253) => 494, chr(254) => 494, chr(255) => 0, )); } } Horde_Pdf-2.0.7/lib/Horde/Pdf/Font/Times.php0000664000175000017500000001612012653753017016507 0ustar janjan array( chr(0) => 250, chr(1) => 250, chr(2) => 250, chr(3) => 250, chr(4) => 250, chr(5) => 250, chr(6) => 250, chr(7) => 250, chr(8) => 250, chr(9) => 250, chr(10) => 250, chr(11) => 250, chr(12) => 250, chr(13) => 250, chr(14) => 250, chr(15) => 250, chr(16) => 250, chr(17) => 250, chr(18) => 250, chr(19) => 250, chr(20) => 250, chr(21) => 250, chr(22) => 250, chr(23) => 250, chr(24) => 250, chr(25) => 250, chr(26) => 250, chr(27) => 250, chr(28) => 250, chr(29) => 250, chr(30) => 250, chr(31) => 250, ' ' => 250, '!' => 333, '"' => 408, '#' => 500, '$' => 500, '%' => 833, '&' => 778, '\'' => 180, '(' => 333, ')' => 333, '*' => 500, '+' => 564, ',' => 250, '-' => 333, '.' => 250, '/' => 278, '0' => 500, '1' => 500, '2' => 500, '3' => 500, '4' => 500, '5' => 500, '6' => 500, '7' => 500, '8' => 500, '9' => 500, ':' => 278, ';' => 278, '<' => 564, '=' => 564, '>' => 564, '?' => 444, '@' => 921, 'A' => 722, 'B' => 667, 'C' => 667, 'D' => 722, 'E' => 611, 'F' => 556, 'G' => 722, 'H' => 722, 'I' => 333, 'J' => 389, 'K' => 722, 'L' => 611, 'M' => 889, 'N' => 722, 'O' => 722, 'P' => 556, 'Q' => 722, 'R' => 667, 'S' => 556, 'T' => 611, 'U' => 722, 'V' => 722, 'W' => 944, 'X' => 722, 'Y' => 722, 'Z' => 611, '[' => 333, '\\' => 278, ']' => 333, '^' => 469, '_' => 500, '`' => 333, 'a' => 444, 'b' => 500, 'c' => 444, 'd' => 500, 'e' => 444, 'f' => 333, 'g' => 500, 'h' => 500, 'i' => 278, 'j' => 278, 'k' => 500, 'l' => 278, 'm' => 778, 'n' => 500, 'o' => 500, 'p' => 500, 'q' => 500, 'r' => 333, 's' => 389, 't' => 278, 'u' => 500, 'v' => 500, 'w' => 722, 'x' => 500, 'y' => 500, 'z' => 444, '{' => 480, '|' => 200, '}' => 480, '~' => 541, chr(127) => 350, chr(128) => 500, chr(129) => 350, chr(130) => 333, chr(131) => 500, chr(132) => 444, chr(133) => 1000, chr(134) => 500, chr(135) => 500, chr(136) => 333, chr(137) => 1000, chr(138) => 556, chr(139) => 333, chr(140) => 889, chr(141) => 350, chr(142) => 611, chr(143) => 350, chr(144) => 350, chr(145) => 333, chr(146) => 333, chr(147) => 444, chr(148) => 444, chr(149) => 350, chr(150) => 500, chr(151) => 1000, chr(152) => 333, chr(153) => 980, chr(154) => 389, chr(155) => 333, chr(156) => 722, chr(157) => 350, chr(158) => 444, chr(159) => 722, chr(160) => 250, chr(161) => 333, chr(162) => 500, chr(163) => 500, chr(164) => 500, chr(165) => 500, chr(166) => 200, chr(167) => 500, chr(168) => 333, chr(169) => 760, chr(170) => 276, chr(171) => 500, chr(172) => 564, chr(173) => 333, chr(174) => 760, chr(175) => 333, chr(176) => 400, chr(177) => 564, chr(178) => 300, chr(179) => 300, chr(180) => 333, chr(181) => 500, chr(182) => 453, chr(183) => 250, chr(184) => 333, chr(185) => 300, chr(186) => 310, chr(187) => 500, chr(188) => 750, chr(189) => 750, chr(190) => 750, chr(191) => 444, chr(192) => 722, chr(193) => 722, chr(194) => 722, chr(195) => 722, chr(196) => 722, chr(197) => 722, chr(198) => 889, chr(199) => 667, chr(200) => 611, chr(201) => 611, chr(202) => 611, chr(203) => 611, chr(204) => 333, chr(205) => 333, chr(206) => 333, chr(207) => 333, chr(208) => 722, chr(209) => 722, chr(210) => 722, chr(211) => 722, chr(212) => 722, chr(213) => 722, chr(214) => 722, chr(215) => 564, chr(216) => 722, chr(217) => 722, chr(218) => 722, chr(219) => 722, chr(220) => 722, chr(221) => 722, chr(222) => 556, chr(223) => 500, chr(224) => 444, chr(225) => 444, chr(226) => 444, chr(227) => 444, chr(228) => 444, chr(229) => 444, chr(230) => 667, chr(231) => 444, chr(232) => 444, chr(233) => 444, chr(234) => 444, chr(235) => 444, chr(236) => 278, chr(237) => 278, chr(238) => 278, chr(239) => 278, chr(240) => 500, chr(241) => 500, chr(242) => 500, chr(243) => 500, chr(244) => 500, chr(245) => 500, chr(246) => 500, chr(247) => 564, chr(248) => 500, chr(249) => 500, chr(250) => 500, chr(251) => 500, chr(252) => 500, chr(253) => 500, chr(254) => 500, chr(255) => 500, )); } } Horde_Pdf-2.0.7/lib/Horde/Pdf/Font/Timesb.php0000664000175000017500000001612712653753017016660 0ustar janjan array( chr(0) => 250, chr(1) => 250, chr(2) => 250, chr(3) => 250, chr(4) => 250, chr(5) => 250, chr(6) => 250, chr(7) => 250, chr(8) => 250, chr(9) => 250, chr(10) => 250, chr(11) => 250, chr(12) => 250, chr(13) => 250, chr(14) => 250, chr(15) => 250, chr(16) => 250, chr(17) => 250, chr(18) => 250, chr(19) => 250, chr(20) => 250, chr(21) => 250, chr(22) => 250, chr(23) => 250, chr(24) => 250, chr(25) => 250, chr(26) => 250, chr(27) => 250, chr(28) => 250, chr(29) => 250, chr(30) => 250, chr(31) => 250, ' ' => 250, '!' => 333, '"' => 555, '#' => 500, '$' => 500, '%' => 1000, '&' => 833, '\'' => 278, '(' => 333, ')' => 333, '*' => 500, '+' => 570, ',' => 250, '-' => 333, '.' => 250, '/' => 278, '0' => 500, '1' => 500, '2' => 500, '3' => 500, '4' => 500, '5' => 500, '6' => 500, '7' => 500, '8' => 500, '9' => 500, ':' => 333, ';' => 333, '<' => 570, '=' => 570, '>' => 570, '?' => 500, '@' => 930, 'A' => 722, 'B' => 667, 'C' => 722, 'D' => 722, 'E' => 667, 'F' => 611, 'G' => 778, 'H' => 778, 'I' => 389, 'J' => 500, 'K' => 778, 'L' => 667, 'M' => 944, 'N' => 722, 'O' => 778, 'P' => 611, 'Q' => 778, 'R' => 722, 'S' => 556, 'T' => 667, 'U' => 722, 'V' => 722, 'W' => 1000, 'X' => 722, 'Y' => 722, 'Z' => 667, '[' => 333, '\\' => 278, ']' => 333, '^' => 581, '_' => 500, '`' => 333, 'a' => 500, 'b' => 556, 'c' => 444, 'd' => 556, 'e' => 444, 'f' => 333, 'g' => 500, 'h' => 556, 'i' => 278, 'j' => 333, 'k' => 556, 'l' => 278, 'm' => 833, 'n' => 556, 'o' => 500, 'p' => 556, 'q' => 556, 'r' => 444, 's' => 389, 't' => 333, 'u' => 556, 'v' => 500, 'w' => 722, 'x' => 500, 'y' => 500, 'z' => 444, '{' => 394, '|' => 220, '}' => 394, '~' => 520, chr(127) => 350, chr(128) => 500, chr(129) => 350, chr(130) => 333, chr(131) => 500, chr(132) => 500, chr(133) => 1000, chr(134) => 500, chr(135) => 500, chr(136) => 333, chr(137) => 1000, chr(138) => 556, chr(139) => 333, chr(140) => 1000, chr(141) => 350, chr(142) => 667, chr(143) => 350, chr(144) => 350, chr(145) => 333, chr(146) => 333, chr(147) => 500, chr(148) => 500, chr(149) => 350, chr(150) => 500, chr(151) => 1000, chr(152) => 333, chr(153) => 1000, chr(154) => 389, chr(155) => 333, chr(156) => 722, chr(157) => 350, chr(158) => 444, chr(159) => 722, chr(160) => 250, chr(161) => 333, chr(162) => 500, chr(163) => 500, chr(164) => 500, chr(165) => 500, chr(166) => 220, chr(167) => 500, chr(168) => 333, chr(169) => 747, chr(170) => 300, chr(171) => 500, chr(172) => 570, chr(173) => 333, chr(174) => 747, chr(175) => 333, chr(176) => 400, chr(177) => 570, chr(178) => 300, chr(179) => 300, chr(180) => 333, chr(181) => 556, chr(182) => 540, chr(183) => 250, chr(184) => 333, chr(185) => 300, chr(186) => 330, chr(187) => 500, chr(188) => 750, chr(189) => 750, chr(190) => 750, chr(191) => 500, chr(192) => 722, chr(193) => 722, chr(194) => 722, chr(195) => 722, chr(196) => 722, chr(197) => 722, chr(198) => 1000, chr(199) => 722, chr(200) => 667, chr(201) => 667, chr(202) => 667, chr(203) => 667, chr(204) => 389, chr(205) => 389, chr(206) => 389, chr(207) => 389, chr(208) => 722, chr(209) => 722, chr(210) => 778, chr(211) => 778, chr(212) => 778, chr(213) => 778, chr(214) => 778, chr(215) => 570, chr(216) => 778, chr(217) => 722, chr(218) => 722, chr(219) => 722, chr(220) => 722, chr(221) => 722, chr(222) => 611, chr(223) => 556, chr(224) => 500, chr(225) => 500, chr(226) => 500, chr(227) => 500, chr(228) => 500, chr(229) => 500, chr(230) => 722, chr(231) => 444, chr(232) => 444, chr(233) => 444, chr(234) => 444, chr(235) => 444, chr(236) => 278, chr(237) => 278, chr(238) => 278, chr(239) => 278, chr(240) => 500, chr(241) => 556, chr(242) => 500, chr(243) => 500, chr(244) => 500, chr(245) => 500, chr(246) => 500, chr(247) => 570, chr(248) => 500, chr(249) => 556, chr(250) => 556, chr(251) => 556, chr(252) => 556, chr(253) => 500, chr(254) => 556, chr(255) => 500, )); } } Horde_Pdf-2.0.7/lib/Horde/Pdf/Font/Timesbi.php0000664000175000017500000001612512653753017017027 0ustar janjan array( chr(0) => 250, chr(1) => 250, chr(2) => 250, chr(3) => 250, chr(4) => 250, chr(5) => 250, chr(6) => 250, chr(7) => 250, chr(8) => 250, chr(9) => 250, chr(10) => 250, chr(11) => 250, chr(12) => 250, chr(13) => 250, chr(14) => 250, chr(15) => 250, chr(16) => 250, chr(17) => 250, chr(18) => 250, chr(19) => 250, chr(20) => 250, chr(21) => 250, chr(22) => 250, chr(23) => 250, chr(24) => 250, chr(25) => 250, chr(26) => 250, chr(27) => 250, chr(28) => 250, chr(29) => 250, chr(30) => 250, chr(31) => 250, ' ' => 250, '!' => 389, '"' => 555, '#' => 500, '$' => 500, '%' => 833, '&' => 778, '\'' => 278, '(' => 333, ')' => 333, '*' => 500, '+' => 570, ',' => 250, '-' => 333, '.' => 250, '/' => 278, '0' => 500, '1' => 500, '2' => 500, '3' => 500, '4' => 500, '5' => 500, '6' => 500, '7' => 500, '8' => 500, '9' => 500, ':' => 333, ';' => 333, '<' => 570, '=' => 570, '>' => 570, '?' => 500, '@' => 832, 'A' => 667, 'B' => 667, 'C' => 667, 'D' => 722, 'E' => 667, 'F' => 667, 'G' => 722, 'H' => 778, 'I' => 389, 'J' => 500, 'K' => 667, 'L' => 611, 'M' => 889, 'N' => 722, 'O' => 722, 'P' => 611, 'Q' => 722, 'R' => 667, 'S' => 556, 'T' => 611, 'U' => 722, 'V' => 667, 'W' => 889, 'X' => 667, 'Y' => 611, 'Z' => 611, '[' => 333, '\\' => 278, ']' => 333, '^' => 570, '_' => 500, '`' => 333, 'a' => 500, 'b' => 500, 'c' => 444, 'd' => 500, 'e' => 444, 'f' => 333, 'g' => 500, 'h' => 556, 'i' => 278, 'j' => 278, 'k' => 500, 'l' => 278, 'm' => 778, 'n' => 556, 'o' => 500, 'p' => 500, 'q' => 500, 'r' => 389, 's' => 389, 't' => 278, 'u' => 556, 'v' => 444, 'w' => 667, 'x' => 500, 'y' => 444, 'z' => 389, '{' => 348, '|' => 220, '}' => 348, '~' => 570, chr(127) => 350, chr(128) => 500, chr(129) => 350, chr(130) => 333, chr(131) => 500, chr(132) => 500, chr(133) => 1000, chr(134) => 500, chr(135) => 500, chr(136) => 333, chr(137) => 1000, chr(138) => 556, chr(139) => 333, chr(140) => 944, chr(141) => 350, chr(142) => 611, chr(143) => 350, chr(144) => 350, chr(145) => 333, chr(146) => 333, chr(147) => 500, chr(148) => 500, chr(149) => 350, chr(150) => 500, chr(151) => 1000, chr(152) => 333, chr(153) => 1000, chr(154) => 389, chr(155) => 333, chr(156) => 722, chr(157) => 350, chr(158) => 389, chr(159) => 611, chr(160) => 250, chr(161) => 389, chr(162) => 500, chr(163) => 500, chr(164) => 500, chr(165) => 500, chr(166) => 220, chr(167) => 500, chr(168) => 333, chr(169) => 747, chr(170) => 266, chr(171) => 500, chr(172) => 606, chr(173) => 333, chr(174) => 747, chr(175) => 333, chr(176) => 400, chr(177) => 570, chr(178) => 300, chr(179) => 300, chr(180) => 333, chr(181) => 576, chr(182) => 500, chr(183) => 250, chr(184) => 333, chr(185) => 300, chr(186) => 300, chr(187) => 500, chr(188) => 750, chr(189) => 750, chr(190) => 750, chr(191) => 500, chr(192) => 667, chr(193) => 667, chr(194) => 667, chr(195) => 667, chr(196) => 667, chr(197) => 667, chr(198) => 944, chr(199) => 667, chr(200) => 667, chr(201) => 667, chr(202) => 667, chr(203) => 667, chr(204) => 389, chr(205) => 389, chr(206) => 389, chr(207) => 389, chr(208) => 722, chr(209) => 722, chr(210) => 722, chr(211) => 722, chr(212) => 722, chr(213) => 722, chr(214) => 722, chr(215) => 570, chr(216) => 722, chr(217) => 722, chr(218) => 722, chr(219) => 722, chr(220) => 722, chr(221) => 611, chr(222) => 611, chr(223) => 500, chr(224) => 500, chr(225) => 500, chr(226) => 500, chr(227) => 500, chr(228) => 500, chr(229) => 500, chr(230) => 722, chr(231) => 444, chr(232) => 444, chr(233) => 444, chr(234) => 444, chr(235) => 444, chr(236) => 278, chr(237) => 278, chr(238) => 278, chr(239) => 278, chr(240) => 500, chr(241) => 556, chr(242) => 500, chr(243) => 500, chr(244) => 500, chr(245) => 500, chr(246) => 500, chr(247) => 570, chr(248) => 500, chr(249) => 556, chr(250) => 556, chr(251) => 556, chr(252) => 556, chr(253) => 444, chr(254) => 500, chr(255) => 444, )); } } Horde_Pdf-2.0.7/lib/Horde/Pdf/Font/Timesi.php0000664000175000017500000001612012653753017016660 0ustar janjan array( chr(0) => 250, chr(1) => 250, chr(2) => 250, chr(3) => 250, chr(4) => 250, chr(5) => 250, chr(6) => 250, chr(7) => 250, chr(8) => 250, chr(9) => 250, chr(10) => 250, chr(11) => 250, chr(12) => 250, chr(13) => 250, chr(14) => 250, chr(15) => 250, chr(16) => 250, chr(17) => 250, chr(18) => 250, chr(19) => 250, chr(20) => 250, chr(21) => 250, chr(22) => 250, chr(23) => 250, chr(24) => 250, chr(25) => 250, chr(26) => 250, chr(27) => 250, chr(28) => 250, chr(29) => 250, chr(30) => 250, chr(31) => 250, ' ' => 250, '!' => 333, '"' => 420, '#' => 500, '$' => 500, '%' => 833, '&' => 778, '\'' => 214, '(' => 333, ')' => 333, '*' => 500, '+' => 675, ',' => 250, '-' => 333, '.' => 250, '/' => 278, '0' => 500, '1' => 500, '2' => 500, '3' => 500, '4' => 500, '5' => 500, '6' => 500, '7' => 500, '8' => 500, '9' => 500, ':' => 333, ';' => 333, '<' => 675, '=' => 675, '>' => 675, '?' => 500, '@' => 920, 'A' => 611, 'B' => 611, 'C' => 667, 'D' => 722, 'E' => 611, 'F' => 611, 'G' => 722, 'H' => 722, 'I' => 333, 'J' => 444, 'K' => 667, 'L' => 556, 'M' => 833, 'N' => 667, 'O' => 722, 'P' => 611, 'Q' => 722, 'R' => 611, 'S' => 500, 'T' => 556, 'U' => 722, 'V' => 611, 'W' => 833, 'X' => 611, 'Y' => 556, 'Z' => 556, '[' => 389, '\\' => 278, ']' => 389, '^' => 422, '_' => 500, '`' => 333, 'a' => 500, 'b' => 500, 'c' => 444, 'd' => 500, 'e' => 444, 'f' => 278, 'g' => 500, 'h' => 500, 'i' => 278, 'j' => 278, 'k' => 444, 'l' => 278, 'm' => 722, 'n' => 500, 'o' => 500, 'p' => 500, 'q' => 500, 'r' => 389, 's' => 389, 't' => 278, 'u' => 500, 'v' => 444, 'w' => 667, 'x' => 444, 'y' => 444, 'z' => 389, '{' => 400, '|' => 275, '}' => 400, '~' => 541, chr(127) => 350, chr(128) => 500, chr(129) => 350, chr(130) => 333, chr(131) => 500, chr(132) => 556, chr(133) => 889, chr(134) => 500, chr(135) => 500, chr(136) => 333, chr(137) => 1000, chr(138) => 500, chr(139) => 333, chr(140) => 944, chr(141) => 350, chr(142) => 556, chr(143) => 350, chr(144) => 350, chr(145) => 333, chr(146) => 333, chr(147) => 556, chr(148) => 556, chr(149) => 350, chr(150) => 500, chr(151) => 889, chr(152) => 333, chr(153) => 980, chr(154) => 389, chr(155) => 333, chr(156) => 667, chr(157) => 350, chr(158) => 389, chr(159) => 556, chr(160) => 250, chr(161) => 389, chr(162) => 500, chr(163) => 500, chr(164) => 500, chr(165) => 500, chr(166) => 275, chr(167) => 500, chr(168) => 333, chr(169) => 760, chr(170) => 276, chr(171) => 500, chr(172) => 675, chr(173) => 333, chr(174) => 760, chr(175) => 333, chr(176) => 400, chr(177) => 675, chr(178) => 300, chr(179) => 300, chr(180) => 333, chr(181) => 500, chr(182) => 523, chr(183) => 250, chr(184) => 333, chr(185) => 300, chr(186) => 310, chr(187) => 500, chr(188) => 750, chr(189) => 750, chr(190) => 750, chr(191) => 500, chr(192) => 611, chr(193) => 611, chr(194) => 611, chr(195) => 611, chr(196) => 611, chr(197) => 611, chr(198) => 889, chr(199) => 667, chr(200) => 611, chr(201) => 611, chr(202) => 611, chr(203) => 611, chr(204) => 333, chr(205) => 333, chr(206) => 333, chr(207) => 333, chr(208) => 722, chr(209) => 667, chr(210) => 722, chr(211) => 722, chr(212) => 722, chr(213) => 722, chr(214) => 722, chr(215) => 675, chr(216) => 722, chr(217) => 722, chr(218) => 722, chr(219) => 722, chr(220) => 722, chr(221) => 556, chr(222) => 611, chr(223) => 500, chr(224) => 500, chr(225) => 500, chr(226) => 500, chr(227) => 500, chr(228) => 500, chr(229) => 500, chr(230) => 667, chr(231) => 444, chr(232) => 444, chr(233) => 444, chr(234) => 444, chr(235) => 444, chr(236) => 278, chr(237) => 278, chr(238) => 278, chr(239) => 278, chr(240) => 500, chr(241) => 500, chr(242) => 500, chr(243) => 500, chr(244) => 500, chr(245) => 500, chr(246) => 500, chr(247) => 675, chr(248) => 500, chr(249) => 500, chr(250) => 500, chr(251) => 500, chr(252) => 500, chr(253) => 444, chr(254) => 500, chr(255) => 444, )); } } Horde_Pdf-2.0.7/lib/Horde/Pdf/Font/Zapfdingbats.php0000664000175000017500000001576012653753017020053 0ustar janjan array( chr(0) => 0, chr(1) => 0, chr(2) => 0, chr(3) => 0, chr(4) => 0, chr(5) => 0, chr(6) => 0, chr(7) => 0, chr(8) => 0, chr(9) => 0, chr(10) => 0, chr(11) => 0, chr(12) => 0, chr(13) => 0, chr(14) => 0, chr(15) => 0, chr(16) => 0, chr(17) => 0, chr(18) => 0, chr(19) => 0, chr(20) => 0, chr(21) => 0, chr(22) => 0, chr(23) => 0, chr(24) => 0, chr(25) => 0, chr(26) => 0, chr(27) => 0, chr(28) => 0, chr(29) => 0, chr(30) => 0, chr(31) => 0, ' ' => 278, '!' => 974, '"' => 961, '#' => 974, '$' => 980, '%' => 719, '&' => 789, '\'' => 790, '(' => 791, ')' => 690, '*' => 960, '+' => 939, ',' => 549, '-' => 855, '.' => 911, '/' => 933, '0' => 911, '1' => 945, '2' => 974, '3' => 755, '4' => 846, '5' => 762, '6' => 761, '7' => 571, '8' => 677, '9' => 763, ':' => 760, ';' => 759, '<' => 754, '=' => 494, '>' => 552, '?' => 537, '@' => 577, 'A' => 692, 'B' => 786, 'C' => 788, 'D' => 788, 'E' => 790, 'F' => 793, 'G' => 794, 'H' => 816, 'I' => 823, 'J' => 789, 'K' => 841, 'L' => 823, 'M' => 833, 'N' => 816, 'O' => 831, 'P' => 923, 'Q' => 744, 'R' => 723, 'S' => 749, 'T' => 790, 'U' => 792, 'V' => 695, 'W' => 776, 'X' => 768, 'Y' => 792, 'Z' => 759, '[' => 707, '\\' => 708, ']' => 682, '^' => 701, '_' => 826, '`' => 815, 'a' => 789, 'b' => 789, 'c' => 707, 'd' => 687, 'e' => 696, 'f' => 689, 'g' => 786, 'h' => 787, 'i' => 713, 'j' => 791, 'k' => 785, 'l' => 791, 'm' => 873, 'n' => 761, 'o' => 762, 'p' => 762, 'q' => 759, 'r' => 759, 's' => 892, 't' => 892, 'u' => 788, 'v' => 784, 'w' => 438, 'x' => 138, 'y' => 277, 'z' => 415, '{' => 392, '|' => 392, '}' => 668, '~' => 668, chr(127) => 0, chr(128) => 390, chr(129) => 390, chr(130) => 317, chr(131) => 317, chr(132) => 276, chr(133) => 276, chr(134) => 509, chr(135) => 509, chr(136) => 410, chr(137) => 410, chr(138) => 234, chr(139) => 234, chr(140) => 334, chr(141) => 334, chr(142) => 0, chr(143) => 0, chr(144) => 0, chr(145) => 0, chr(146) => 0, chr(147) => 0, chr(148) => 0, chr(149) => 0, chr(150) => 0, chr(151) => 0, chr(152) => 0, chr(153) => 0, chr(154) => 0, chr(155) => 0, chr(156) => 0, chr(157) => 0, chr(158) => 0, chr(159) => 0, chr(160) => 0, chr(161) => 732, chr(162) => 544, chr(163) => 544, chr(164) => 910, chr(165) => 667, chr(166) => 760, chr(167) => 760, chr(168) => 776, chr(169) => 595, chr(170) => 694, chr(171) => 626, chr(172) => 788, chr(173) => 788, chr(174) => 788, chr(175) => 788, chr(176) => 788, chr(177) => 788, chr(178) => 788, chr(179) => 788, chr(180) => 788, chr(181) => 788, chr(182) => 788, chr(183) => 788, chr(184) => 788, chr(185) => 788, chr(186) => 788, chr(187) => 788, chr(188) => 788, chr(189) => 788, chr(190) => 788, chr(191) => 788, chr(192) => 788, chr(193) => 788, chr(194) => 788, chr(195) => 788, chr(196) => 788, chr(197) => 788, chr(198) => 788, chr(199) => 788, chr(200) => 788, chr(201) => 788, chr(202) => 788, chr(203) => 788, chr(204) => 788, chr(205) => 788, chr(206) => 788, chr(207) => 788, chr(208) => 788, chr(209) => 788, chr(210) => 788, chr(211) => 788, chr(212) => 894, chr(213) => 838, chr(214) => 1016, chr(215) => 458, chr(216) => 748, chr(217) => 924, chr(218) => 748, chr(219) => 918, chr(220) => 927, chr(221) => 928, chr(222) => 928, chr(223) => 834, chr(224) => 873, chr(225) => 828, chr(226) => 924, chr(227) => 924, chr(228) => 917, chr(229) => 930, chr(230) => 931, chr(231) => 463, chr(232) => 883, chr(233) => 836, chr(234) => 836, chr(235) => 867, chr(236) => 867, chr(237) => 696, chr(238) => 696, chr(239) => 874, chr(240) => 0, chr(241) => 874, chr(242) => 760, chr(243) => 946, chr(244) => 771, chr(245) => 865, chr(246) => 771, chr(247) => 888, chr(248) => 967, chr(249) => 888, chr(250) => 831, chr(251) => 873, chr(252) => 927, chr(253) => 970, chr(254) => 918, chr(255) => 0, )); } } Horde_Pdf-2.0.7/lib/Horde/Pdf/Exception.php0000664000175000017500000000053112653753017016455 0ustar janjan * Copyright 2003-2016 Horde LLC (http://www.horde.org/) * * @author Olivier Plathey * @author Marko Djukic * @author Jan Schneider * @license http://www.horde.org/licenses/lgpl21 * @category Horde * @package Pdf */ /** * The Horde_Pdf_Writer class provides a PHP-only implementation of a PDF * library. No external libs or PHP extensions are required. * * @category Horde * @package Pdf */ class Horde_Pdf_Writer { /** * Current page number. * * @var integer */ protected $_page = 0; /** * Current object number. * * @var integer */ protected $_n = 2; /** * Array of object offsets. * * @var array */ protected $_offsets = array(); /** * Buffer holding in-memory Pdf. * * @var string */ protected $_buffer = ''; /** * Buffer length, including already flushed content. * * @var integer */ protected $_buflen = 0; /** * Whether the buffer has been flushed already. * * @var boolean */ protected $_flushed = false; /** * Array containing the pages. * * @var array */ protected $_pages = array(); /** * Current document state.
     *   0 - initial state
     *   1 - document opened
     *   2 - page opened
     *   3 - document closed
     * 
* * @var integer */ protected $_state = 0; /** * Flag indicating if PDF file is to be compressed or not. * * @var boolean */ protected $_compress; /** * The default page orientation. * * @var string */ protected $_default_orientation; /** * The current page orientation. * * @var string */ protected $_current_orientation; /** * Array indicating orientation changes. * * @var array */ protected $_orientation_changes = array(); /** * Current width of page format in points. * * @var float */ public $fwPt; /** * Current height of page format in points. * * @var float */ public $fhPt; /** * Current width of page format in user units. * * @var float */ public $fw; /** * Current height of page format in user units. * * @var float */ public $fh; /** * Current width of page in points. * * @var float */ public $wPt; /** * Current height of page in points. * * @var float */ public $hPt; /** * Current width of page in user units * * @var float */ public $w; /** * Current height of page in user units * * @var float */ public $h; /** * Scale factor (number of points in user units). * * @var float */ protected $_scale; /** * Left page margin size. * * @var float */ protected $_left_margin; /** * Top page margin size. * * @var float */ protected $_top_margin; /** * Right page margin size. * * @var float */ protected $_right_margin; /** * Break page margin size, the bottom margin which triggers a page break. * * @var float */ protected $_break_margin; /** * Cell margin size. * * @var float */ protected $_cell_margin; /** * The current horizontal position for cell positioning. * Value is set in user units and is calculated from the top left corner * as origin. * * @var float */ public $x; /** * The current vertical position for cell positioning. * Value is set in user units and is calculated from the top left corner * as origin. * * @var float */ public $y; /** * The height of the last cell printed. * * @var float */ protected $_last_height; /** * Line width in user units. * * @var float */ protected $_line_width; /** * An array of standard font names. * * @var array */ protected $_core_fonts = array('courier' => 'Courier', 'courierB' => 'Courier-Bold', 'courierI' => 'Courier-Oblique', 'courierBI' => 'Courier-BoldOblique', 'helvetica' => 'Helvetica', 'helveticaB' => 'Helvetica-Bold', 'helveticaI' => 'Helvetica-Oblique', 'helveticaBI' => 'Helvetica-BoldOblique', 'times' => 'Times-Roman', 'timesB' => 'Times-Bold', 'timesI' => 'Times-Italic', 'timesBI' => 'Times-BoldItalic', 'symbol' => 'Symbol', 'zapfdingbats' => 'ZapfDingbats'); /** * An array of used fonts. * * @var array */ protected $_fonts = array(); /** * An array of font files. * * @var array */ protected $_font_files = array(); /** * Widths of specific font files * * @var array */ protected static $_font_widths = array(); /** * An array of encoding differences. * * @var array */ protected $_diffs = array(); /** * An array of used images. * * @var array */ protected $_images = array(); /** * An array of links in pages. * * @var array */ protected $_page_links; /** * An array of internal links. * * @var array */ protected $_links = array(); /** * Current font family. * * @var string */ protected $_font_family = ''; /** * Current font style. * * @var string */ protected $_font_style = ''; /** * Underlining flag. * * @var boolean */ protected $_underline = false; /** * An array containing current font info. * * @var array */ protected $_current_font; /** * Current font size in points. * * @var float */ protected $_font_size_pt = 12; /** * Current font size in user units. * * @var float */ protected $_font_size = 12; /** * Commands for filling color. * * @var string */ protected $_fill_color = '0 g'; /** * Commands for text color. * * @var string */ protected $_text_color = '0 g'; /** * Whether text color is different from fill color. * * @var boolean */ protected $_color_flag = false; /** * Commands for drawing color. * * @var string */ protected $_draw_color = '0 G'; /** * Word spacing. * * @var integer */ protected $_word_spacing = 0; /** * Automatic page breaking. * * @var boolean */ protected $_auto_page_break; /** * Threshold used to trigger page breaks. * * @var float */ protected $_page_break_trigger; /** * Flag set when processing footer. * * @var boolean */ protected $_in_footer = false; /** * Zoom display mode. * * @var string */ protected $_zoom_mode; /** * Layout display mode. * * @var string */ protected $_layout_mode; /** * An array containing the document info, consisting of: * - title * - subject * - author * - keywords * - creator * * @var array */ protected $_info = array(); /** * Alias for total number of pages. * * @var string */ protected $_alias_nb_pages = '{nb}'; /** * Constructor * * It allows to set up the page format, the orientation and the units of * measurement used in all the methods (except for the font sizes). * * Example: * * $pdf = new Horde_Pdf_Writer(array('orientation' => 'P', * 'unit' => 'mm', * 'format' => 'A4')); * * * @param array $params A hash with parameters for the created PDF object. * Possible parameters are: * - orientation - Default page orientation. Possible * values are (case insensitive): * - P or Portrait (default) * - L or Landscape * - unit - User measure units. Possible values * values are: * - pt: point * - mm: millimeter (default) * - cm: centimeter * - in: inch * A point equals 1/72 of inch, that is to say * about 0.35 mm (an inch being 2.54 cm). This is a * very common unit in typography; font sizes are * expressed in that unit. * - format - The format used for pages. It can be * either one of the following values (case * insensitive): * - A3 * - A4 (default) * - A5 * - Letter * - Legal * or a custom format in the form of a two-element * array containing the width and the height * (expressed in the unit given by the unit * parameter). */ public function __construct($params = array()) { /* Default parameters. */ $defaults = array('orientation' => 'P', 'unit' => 'mm', 'format' => 'A4'); $params = array_merge($defaults, $params); /* Scale factor. */ if ($params['unit'] == 'pt') { $this->_scale = 1; } elseif ($params['unit'] == 'mm') { $this->_scale = 72 / 25.4; } elseif ($params['unit'] == 'cm') { $this->_scale = 72 / 2.54; } elseif ($params['unit'] == 'in') { $this->_scale = 72; } else { throw new Horde_Pdf_Exception(sprintf('Incorrect units: %s', $params['unit'])); } /* Page format. */ if (is_string($params['format'])) { $params['format'] = Horde_String::lower($params['format']); if ($params['format'] == 'a3') { $params['format'] = array(841.89, 1190.55); } elseif ($params['format'] == 'a4') { $params['format'] = array(595.28, 841.89); } elseif ($params['format'] == 'a5') { $params['format'] = array(420.94, 595.28); } elseif ($params['format'] == 'letter') { $params['format'] = array(612, 792); } elseif ($params['format'] == 'legal') { $params['format'] = array(612, 1008); } else { throw new Horde_Pdf_Exception(sprintf('Unknown page format: %s', $params['format'])); } $this->fwPt = $params['format'][0]; $this->fhPt = $params['format'][1]; } else { $this->fwPt = $params['format'][0] * $this->_scale; $this->fhPt = $params['format'][1] * $this->_scale; } $this->fw = $this->fwPt / $this->_scale; $this->fh = $this->fhPt / $this->_scale; /* Page orientation. */ $params['orientation'] = Horde_String::lower($params['orientation']); if ($params['orientation'] == 'p' || $params['orientation'] == 'portrait') { $this->_default_orientation = 'P'; $this->wPt = $this->fwPt; $this->hPt = $this->fhPt; } elseif ($params['orientation'] == 'l' || $params['orientation'] == 'landscape') { $this->_default_orientation = 'L'; $this->wPt = $this->fhPt; $this->hPt = $this->fwPt; } else { throw new Horde_Pdf_Exception(sprintf('Incorrect orientation: %s', $params['orientation'])); } $this->_current_orientation = $this->_default_orientation; $this->w = $this->wPt / $this->_scale; $this->h = $this->hPt / $this->_scale; /* Page margins (1 cm) */ $margin = 28.35 / $this->_scale; $this->setMargins($margin, $margin); /* Interior cell margin (1 mm) */ $this->_cell_margin = $margin / 10; /* Line width (0.2 mm) */ $this->_line_width = .567 / $this->_scale; /* Automatic page break */ $this->setAutoPageBreak(true, 2 * $margin); /* Full width display mode */ $this->setDisplayMode('fullwidth'); /* Compression */ $this->setCompression(true); } /** * Defines the left, top and right margins. * * By default, they equal 1 cm. Call this method to change them. * * @param float $left Left margin. * @param float $top Top margin. * @param float $right Right margin. If not specified default to the value * of the left one. * * @see setAutoPageBreak() * @see setLeftMargin() * @see setRightMargin() * @see setTopMargin() */ public function setMargins($left, $top, $right = null) { /* Set left and top margins. */ $this->_left_margin = $left; $this->_top_margin = $top; /* If no right margin set default to same as left. */ $this->_right_margin = (is_null($right) ? $left : $right); } /** * Defines the left margin. * * The method can be called before creating the first page. If the * current abscissa gets out of page, it is brought back to the margin. * * @param float $margin The margin. * * @see setAutoPageBreak() * @see setMargins() * @see setRightMargin() * @see setTopMargin() */ public function setLeftMargin($margin) { $this->_left_margin = $margin; /* If there is a current page and the current X position is less than * margin set the X position to the margin value. */ if ($this->_page > 0 && $this->x < $margin) { $this->x = $margin; } } /** * Defines the top margin. * * The method can be called before creating the first page. * * @param float $margin The margin. */ public function setTopMargin($margin) { $this->_top_margin = $margin; } /** * Defines the right margin. * * The method can be called before creating the first page. * * @param float $margin The margin. */ public function setRightMargin($margin) { $this->_right_margin = $margin; } /** * Returns the actual page width. * * @return float The page width. */ public function getPageWidth() { return ($this->w - $this->_right_margin - $this->_left_margin); } /** * Returns the actual page height. * * @return float The page height. */ public function getPageHeight() { return ($this->h - $this->_top_margin - $this->_break_margin); } /** * Enables or disables the automatic page breaking mode. * * When enabling, the second parameter is the distance from the bottom of * the page that defines the triggering limit. By default, the mode is on * and the margin is 2 cm. * * @param boolean $auto Boolean indicating if mode should be on or off. * @param float $margin Distance from the bottom of the page. */ public function setAutoPageBreak($auto, $margin = 0) { $this->_auto_page_break = $auto; $this->_break_margin = $margin; $this->_page_break_trigger = $this->h - $margin; } /** * Defines the way the document is to be displayed by the viewer. * * The zoom level can be set: pages can be displayed entirely on screen, * occupy the full width of the window, use real size, be scaled by a * specific zooming factor or use viewer default (configured in the * Preferences menu of Acrobat). The page layout can be specified too: * single at once, continuous display, two columns or viewer default. By * default, documents use the full width mode with continuous display. * * @param mixed $zoom The zoom to use. It can be one of the following * string values: * - fullpage: entire page on screen * - fullwidth: maximum width of window * - real: uses real size (100% zoom) * - default: uses viewer default mode * or a number indicating the zooming factor. * @param string layout The page layout. Possible values are: * - single: one page at once * - continuous: pages in continuously * - two: two pages on two columns * - default: uses viewer default mode * Default value is continuous. */ public function setDisplayMode($zoom, $layout = 'continuous') { $zoom = Horde_String::lower($zoom); if ($zoom == 'fullpage' || $zoom == 'fullwidth' || $zoom == 'real' || $zoom == 'default' || !is_string($zoom)) { $this->_zoom_mode = $zoom; } elseif ($zoom == 'zoom') { $this->_zoom_mode = $layout; } else { throw new Horde_Pdf_Exception(sprintf('Incorrect zoom display mode: %s', $zoom)); } $layout = Horde_String::lower($layout); if ($layout == 'single' || $layout == 'continuous' || $layout == 'two' || $layout == 'default') { $this->_layout_mode = $layout; } elseif ($zoom != 'zoom') { throw new Horde_Pdf_Exception(sprintf('Incorrect layout display mode: %s', $layout)); } } /** * Activates or deactivates page compression. * * When activated, the internal representation of each page is compressed, * which leads to a compression ratio of about 2 for the resulting * document. Compression is on by default. * * Note: the {@link http://www.php.net/zlib/ zlib extension} is required * for this feature. If not present, compression will be turned off. * * @param boolean $compress Boolean indicating if compression must be * enabled or not. */ public function setCompression($compress) { /* If no gzcompress function is available then default to false. */ $this->_compress = (function_exists('gzcompress') ? $compress : false); } /** * Set the info to a document. * * Possible info settings are: * - title * - subject * - author * - keywords * - creator * * @param array|string $info If passed as an array then the complete hash * containing the info to be inserted into the * document. Otherwise the name of setting to be * set. * @param string $value The value of the setting. */ public function setInfo($info, $value = '') { if (is_array($info)) { $this->_info = $info; } else { $this->_info[$info] = $value; } } /** * Defines an alias for the total number of pages. * * It will be substituted as the document is closed. * * Example: * * class My_Pdf extends Horde_Pdf_Writer { * function footer() * { * // Go to 1.5 cm from bottom * $this->setY(-15); * // Select Arial italic 8 * $this->setFont('Arial', 'I', 8); * // Print current and total page numbers * $this->cell(0, 10, 'Page ' . $this->getPageNo() . '/{nb}', 0, * 0, 'C'); * } * } * $pdf = new My_Pdf(); * $pdf->aliasNbPages(); * * * @param string $alias The alias. * * @see getPageNo() * @see footer() */ public function aliasNbPages($alias = '{nb}') { $this->_alias_nb_pages = $alias; } /** * This method begins the generation of the PDF document; it must be * called before any output commands. * * No page is created by this method, therefore it is necessary to call * {@link addPage()}. * * @see addPage() * @see close() */ public function open() { $this->_beginDoc(); } /** * Terminates the PDF document. * * If the document contains no page, {@link addPage()} is called to * prevent from getting an invalid document. * * @see open() */ public function close() { // Terminate document if ($this->_page == 0) { $this->addPage(); } // Page footer $this->_in_footer = true; $this->x = $this->_left_margin; $this->footer(); $this->_in_footer = false; // Close page and document $this->_endPage(); $this->_endDoc(); } /** * Adds a new page to the document. * * If a page is already present, the {@link footer()} method is called * first to output the footer. Then the page is added, the current * position set to the top-left corner according to the left and top * margins, and {@link header()} is called to display the header. * * The font which was set before calling is automatically restored. There * is no need to call {@link setFont()} again if you want to continue with * the same font. The same is true for colors and line width. The origin * of the coordinate system is at the top-left corner and increasing * ordinates go downwards. * * @param string $orientation Page orientation. Possible values * are (case insensitive): * - P or Portrait * - L or Landscape * The default value is the one passed to the * constructor. * * @see header() * @see footer() * @see setMargins() */ public function addPage($orientation = '') { /* For good measure make sure this is called. */ $this->_beginDoc(); /* Save style settings so that they are not overridden by * footer() or header(). */ $lw = $this->_line_width; $dc = $this->_draw_color; $fc = $this->_fill_color; $tc = $this->_text_color; $cf = $this->_color_flag; $font_family = $this->_font_family; $font_style = $this->_font_style . ($this->_underline ? 'U' : ''); $font_size = $this->_font_size_pt; if ($this->_page > 0) { /* Page footer. */ $this->_in_footer = true; $this->x = $this->_left_margin; $this->footer(); $this->_in_footer = false; /* Close page. */ $this->_endPage(); } /* Start new page. */ $this->_beginPage($orientation); /* Set line cap style to square. */ $this->_out('2 J'); /* Set line width. */ $this->_line_width = $lw; $this->_out(sprintf('%.2F w', $lw * $this->_scale)); /* Force the setting of the font. Each new page requires a new * call. */ if ($font_family) { $this->setFont($font_family, $font_style, $font_size, true); } /* Restore styles. */ if ($this->_fill_color != $fc) { $this->_fill_color = $fc; $this->_out($this->_fill_color); } if ($this->_draw_color != $dc) { $this->_draw_color = $dc; $this->_out($this->_draw_color); } $this->_text_color = $tc; $this->_color_flag = $cf; /* Page header. */ $this->header(); /* Restore styles. */ if ($this->_line_width != $lw) { $this->_line_width = $lw; $this->_out(sprintf('%.2F w', $lw * $this->_scale)); } $this->setFont($font_family, $font_style, $font_size); if ($this->_fill_color != $fc) { $this->_fill_color = $fc; $this->_out($this->_fill_color); } if ($this->_draw_color != $dc) { $this->_draw_color = $dc; $this->_out($this->_draw_color); } $this->_text_color = $tc; $this->_color_flag = $cf; } /** * This method is used to render the page header. * * It is automatically called by {@link addPage()} and should not be * called directly by the application. The implementation in Horde_Pdf_Writer is * empty, so you have to subclass it and override the method if you want a * specific processing. * * Example: * * class My_Pdf extends Horde_Pdf_Writer { * function header() * { * // Select Arial bold 15 * $this->setFont('Arial', 'B', 15); * // Move to the right * $this->cell(80); * // Framed title * $this->cell(30, 10, 'Title', 1, 0, 'C'); * // Line break * $this->newLine(20); * } * } * * * @see footer() */ public function header() { /* To be implemented in your own inherited class. */ } /** * This method is used to render the page footer. * * It is automatically called by {@link addPage()} and {@link close()} and * should not be called directly by the application. The implementation in * Horde_Pdf_Writer is empty, so you have to subclass it and override the method * if you want a specific processing. * * Example: * * class My_Pdf extends Horde_Pdf_Writer { * function footer() * { * // Go to 1.5 cm from bottom * $this->setY(-15); * // Select Arial italic 8 * $this->setFont('Arial', 'I', 8); * // Print centered page number * $this->cell(0, 10, 'Page ' . $this->getPageNo(), 0, 0, 'C'); * } * } * * * @see header() */ public function footer() { /* To be implemented in your own inherited class. */ } /** * Returns the current page number. * * @return integer * * @see aliasNbPages() */ public function getPageNo() { return $this->_page; } /** * Sets the fill color. * * Depending on the colorspace called, the number of color component * parameters required can be either 1, 3 or 4. The method can be called * before the first page is created and the color is retained from page to * page. * * @param string $cs Indicates the colorspace which can be either 'rgb', * 'hex', 'cmyk', or 'gray'. Defaults to 'rgb'. * @param float $c1 First color component, floating point value between 0 * and 1. Required for gray, rgb and cmyk. * @param float $c2 Second color component, floating point value * between 0 and 1. Required for rgb and cmyk. * @param float $c3 Third color component, floating point value between 0 * and 1. Required for rgb and cmyk. * @param float $c4 Fourth color component, floating point value * between 0 and 1. Required for cmyk. * * @see setTextColor() * @see setDrawColor() * @see rect() * @see cell() * @see multiCell() */ public function setFillColor($cs = 'rgb', $c1 = 0, $c2 = 0, $c3 = 0, $c4 = 0) { $cs = Horde_String::lower($cs); // convert hex to rgb if ($cs == 'hex') { $cs = 'rgb'; list($c1, $c2, $c3) = $this->_hexToRgb($c1); } if ($cs == 'rgb') { $this->_fill_color = sprintf('%.3F %.3F %.3F rg', $c1, $c2, $c3); } elseif ($cs == 'cmyk') { $this->_fill_color = sprintf('%.3F %.3F %.3F %.3F k', $c1, $c2, $c3, $c4); } else { $this->_fill_color = sprintf('%.3F g', $c1); } if ($this->_page > 0) { $this->_out($this->_fill_color); } $this->_color_flag = $this->_fill_color != $this->_text_color; } /** * Get the fill color * * @return string */ public function getFillColor() { return $this->_fill_color; } /** * Sets the text color. * * Depending on the colorspace called, the number of color component * parameters required can be either 1, 3 or 4. The method can be called * before the first page is created and the color is retained from page to * page. * * @param string $cs Indicates the colorspace which can be either 'rgb', * 'hex', 'cmyk' or 'gray'. Defaults to 'rgb'. * @param float $c1 First color component, floating point value between 0 * and 1. Required for gray, rgb and cmyk. * @param float $c2 Second color component, floating point value * between 0 and 1. Required for rgb and cmyk. * @param float $c3 Third color component, floating point value between 0 * and 1. Required for rgb and cmyk. * @param float $c4 Fourth color component, floating point value * between 0 and 1. Required for cmyk. * * @see setFillColor() * @see setDrawColor() * @see rect() * @see cell() * @see multiCell() */ public function setTextColor($cs = 'rgb', $c1 = 0, $c2 = 0, $c3 = 0, $c4 = 0) { $cs = Horde_String::lower($cs); // convert hex to rgb if ($cs == 'hex') { $cs = 'rgb'; list($c1, $c2, $c3) = $this->_hexToRgb($c1); } if ($cs == 'rgb') { $this->_text_color = sprintf('%.3F %.3F %.3F rg', $c1, $c2, $c3); } elseif ($cs == 'cmyk') { $this->_text_color = sprintf('%.3F %.3F %.3F %.3F k', $c1, $c2, $c3, $c4); } else { $this->_text_color = sprintf('%.3F g', $c1); } $this->_color_flag = $this->_fill_color != $this->_text_color; } /** * Get the text color * * @return string */ public function getTextColor() { return $this->_text_color; } /** * Sets the draw color, used when drawing lines. * * Depending on the colorspace called, the number of color component * parameters required can be either 1, 3 or 4. The method can be called * before the first page is created and the color is retained from page to * page. * * @param string $cs Indicates the colorspace which can be either 'rgb', * 'hex', 'cmyk' or 'gray'. Defaults to 'rgb'. * @param float $c1 First color component, floating point value between 0 * and 1. Required for gray, rgb and cmyk. * @param float $c2 Second color component, floating point value * between 0 and 1. Required for rgb and cmyk. * @param float $c3 Third color component, floating point value between 0 * and 1. Required for rgb and cmyk. * @param float $c4 Fourth color component, floating point value * between 0 and 1. Required for cmyk. * * @see setFillColor() * @see line() * @see rect() * @see cell() * @see multiCell() */ public function setDrawColor($cs = 'rgb', $c1 = 0, $c2 = 0, $c3 = 0, $c4 = 0) { $cs = Horde_String::lower($cs); // convert hex to rgb if ($cs == 'hex') { $cs = 'rgb'; list($c1, $c2, $c3) = $this->_hexToRgb($c1); } if ($cs == 'rgb') { $this->_draw_color = sprintf('%.3F %.3F %.3F RG', $c1, $c2, $c3); } elseif ($cs == 'cmyk') { $this->_draw_color = sprintf('%.3F %.3F %.3F %.3F K', $c1, $c2, $c3, $c4); } else { $this->_draw_color = sprintf('%.3F G', $c1); } if ($this->_page > 0) { $this->_out($this->_draw_color); } } /** * Get the draw color * * @return string */ public function getDrawColor() { return $this->_draw_color; } /** * Returns the length of a text string. A font must be selected. * * @param string $text The text whose length is to be computed. * @param boolean $pt Whether the width should be returned in points or * user units. * * @return float */ public function getStringWidth($text, $pt = false) { $text = (string)$text; $width = 0; $length = strlen($text); for ($i = 0; $i < $length; $i++) { $width += $this->_current_font['cw'][$text{$i}]; } /* Adjust for word spacing. */ $width += $this->_word_spacing * substr_count($text, ' ') * $this->_current_font['cw'][' ']; if ($pt) { return $width * $this->_font_size_pt / 1000; } else { return $width * $this->_font_size / 1000; } } /** * Defines the line width. * * By default, the value equals 0.2 mm. The method can be called before * the first page is created and the value is retained from page to page. * * @param float $width The width. * * @see line() * @see rect() * @see cell() * @see multiCell() */ public function setLineWidth($width) { $this->_line_width = $width; if ($this->_page > 0) { $this->_out(sprintf('%.2F w', $width * $this->_scale)); } } /** * P (portrait) or L (landscape) * * @return string */ public function getDefaultOrientation() { return $this->_default_orientation; } /** * @return integer */ public function getScale() { return $this->_scale; } /** * @return float */ public function getFormatHeight() { return $this->_default_orientation == 'P' ? $this->fhPt : $this->fwPt; } /** * @return float */ public function getFormatWidth() { return $this->_default_orientation == 'P' ? $this->fwPt : $this->fhPt; } /** * Draws a line between two points. * * All coordinates can be negative to provide values from the right or * bottom edge of the page (since File_Pdf 0.2.0, Horde 3.2). * * @param float $x1 Abscissa of first point. * @param float $y1 Ordinate of first point. * @param float $x2 Abscissa of second point. * @param float $y2 Ordinate of second point. * * @see setLineWidth() * @see setDrawColor() */ public function line($x1, $y1, $x2, $y2) { if ($x1 < 0) { $x1 += $this->w; } if ($y1 < 0) { $y1 += $this->h; } if ($x2 < 0) { $x2 += $this->w; } if ($y2 < 0) { $y2 += $this->h; } $this->_out(sprintf('%.2F %.2F m %.2F %.2F l S', $x1 * $this->_scale, ($this->h - $y1) * $this->_scale, $x2 * $this->_scale, ($this->h - $y2) * $this->_scale)); } /** * Outputs a rectangle. * * It can be drawn (border only), filled (with no border) or both. * * All coordinates can be negative to provide values from the right or * bottom edge of the page (since File_Pdf 0.2.0, Horde 3.2). * * @param float $x Abscissa of upper-left corner. * @param float $y Ordinate of upper-left corner. * @param float $width Width. * @param float $height Height. * @param float $style Style of rendering. Possible values are: * - D or empty string: draw (default) * - F: fill * - DF or FD: draw and fill * * @see setLineWidth() * @see setDrawColor() * @see setFillColor() */ public function rect($x, $y, $width, $height, $style = '') { if ($x < 0) { $x += $this->w; } if ($y < 0) { $y += $this->h; } $style = Horde_String::upper($style); if ($style == 'F') { $op = 'f'; } elseif ($style == 'FD' || $style == 'DF') { $op = 'B'; } else { $op = 'S'; } $x = $this->_toPt($x); $y = $this->_toPt($y); $width = $this->_toPt($width); $height = $this->_toPt($height); $this->_out(sprintf('%.2F %.2F %.2F %.2F re %s', $x, $this->hPt - $y, $width, -$height, $op)); } /** * Outputs a circle. It can be drawn (border only), filled (with no * border) or both. * * All coordinates can be negative to provide values from the right or * bottom edge of the page (since File_Pdf 0.2.0, Horde 3.2). * * @param float $x Abscissa of the center of the circle. * @param float $y Ordinate of the center of the circle. * @param float $r Circle radius. * @param string $style Style of rendering. Possible values are: * - D or empty string: draw (default) * - F: fill * - DF or FD: draw and fill */ public function circle($x, $y, $r, $style = '') { if ($x < 0) { $x += $this->w; } if ($y < 0) { $y += $this->h; } $style = Horde_String::lower($style); if ($style == 'f') { $op = 'f'; // Style is fill only. } elseif ($style == 'fd' || $style == 'df') { $op = 'B'; // Style is fill and stroke. } else { $op = 'S'; // Style is stroke only. } $x = $this->_toPt($x); $y = $this->_toPt($y); $r = $this->_toPt($r); /* Invert the y scale. */ $y = $this->hPt - $y; /* Length of the Bezier control. */ $b = $r * 0.552; /* Move from the given origin and set the current point * to the start of the first Bezier curve. */ $c = sprintf('%.2F %.2F m', $x - $r, $y); $x = $x - $r; /* First circle quarter. */ $c .= sprintf(' %.2F %.2F %.2F %.2F %.2F %.2F c', $x, $y + $b, // First control point. $x + $r - $b, $y + $r, // Second control point. $x + $r, $y + $r); // Final point. /* Set x/y to the final point. */ $x = $x + $r; $y = $y + $r; /* Second circle quarter. */ $c .= sprintf(' %.2F %.2F %.2F %.2F %.2F %.2F c', $x + $b, $y, $x + $r, $y - $r + $b, $x + $r, $y - $r); /* Set x/y to the final point. */ $x = $x + $r; $y = $y - $r; /* Third circle quarter. */ $c .= sprintf(' %.2F %.2F %.2F %.2F %.2F %.2F c', $x, $y - $b, $x - $r + $b, $y - $r, $x - $r, $y - $r); /* Set x/y to the final point. */ $x = $x - $r; $y = $y - $r; /* Fourth circle quarter. */ $c .= sprintf(' %.2F %.2F %.2F %.2F %.2F %.2F c %s', $x - $b, $y, $x - $r, $y + $r - $b, $x - $r, $y + $r, $op); /* Output the whole string. */ $this->_out($c); } /** * Imports a TrueType or Type1 font and makes it available. It is * necessary to generate a font definition file first with the * makefont.php utility. * The location of the definition file (and the font file itself when * embedding) must be found at the full path name included. * * Example: * * $pdf->addFont('Comic', 'I'); * is equivalent to: * $pdf->addFont('Comic', 'I', 'comici.php'); * * * @param string $family Font family. The name can be chosen arbitrarily. * If it is a standard family name, it will * override the corresponding font. * @param string $style Font style. Possible values are (case * insensitive): * - empty string: regular (default) * - B: bold * - I: italic * - BI or IB: bold italic * @param string $file The font definition file. By default, the name is * built from the family and style, in lower case * with no space. * * @see setFont() * @todo Fonts use a class instead of a definition file */ public function addFont($family, $style = '', $file = '') { $family = Horde_String::lower($family); if ($family == 'arial') { $family = 'helvetica'; } $style = Horde_String::upper($style); if ($style == 'IB') { $style = 'BI'; } if (isset($this->_fonts[$family . $style])) { throw new Horde_Pdf_Exception(sprintf('Font already added: %s %s', $family, $style)); } if ($file == '') { $file = str_replace(' ', '', $family) . Horde_String::lower($style) . '.php'; } include $file; if (!isset($name)) { throw new Horde_Pdf_Exception('Could not include font definition file'); } $i = count($this->_fonts) + 1; $this->_fonts[$family . $style] = array('i' => $i, 'type' => $type, 'name' => $name, 'desc' => $desc, 'up' => $up, 'ut' => $ut, 'cw' => $cw, 'enc' => $enc, 'file' => $file); if ($diff) { /* Search existing encodings. */ $d = 0; $nb = count($this->_diffs); for ($i = 1; $i <= $nb; $i++) { if ($this->_diffs[$i] == $diff) { $d = $i; break; } } if ($d == 0) { $d = $nb + 1; $this->_diffs[$d] = $diff; } $this->_fonts[$family . $style]['diff'] = $d; } if ($file) { if ($type == 'TrueType') { $this->_font_files[$file] = array('length1' => $originalsize); } else { $this->_font_files[$file] = array('length1' => $size1, 'length2' => $size2); } } } /** * Sets the font used to print character strings. * * It is mandatory to call this method at least once before printing text * or the resulting document would not be valid. The font can be either a * standard one or a font added via the {@link addFont()} method. Standard * fonts use Windows encoding cp1252 (Western Europe). * * The method can be called before the first page is created and the font * is retained from page to page. * * If you just wish to change the current font size, it is simpler to call * {@link setFontSize()}. * * @param string $family Family font. It can be either a name defined by * {@link addFont()} or one of the standard families * (case insensitive): * - Courier (fixed-width) * - Helvetica or Arial (sans serif) * - Times (serif) * - Symbol (symbolic) * - ZapfDingbats (symbolic) * It is also possible to pass an empty string. In * that case, the current family is retained. * @param string $style Font style. Possible values are (case * insensitive): * - empty string: regular * - B: bold * - I: italic * - U: underline * or any combination. Bold and italic styles do not * apply to Symbol and ZapfDingbats. * @param integer $size Font size in points. The default value is the * current size. If no size has been specified since * the beginning of the document, the value taken * is 12. * @param boolean $force Force the setting of the font. Each new page will * require a new call to {@link setFont()} and * setting this to true will make sure that the * checks for same font calls will be skipped. * * @see addFont() * @see setFontSize() * @see cell() * @see multiCell() * @see write() */ public function setFont($family, $style = '', $size = null, $force = false) { $family = Horde_String::lower($family); if (empty($family)) { $family = $this->_font_family; } if ($family == 'arial') { /* Use helvetica instead of arial. */ $family = 'helvetica'; } elseif ($family == 'symbol' || $family == 'zapfdingbats') { /* These two fonts do not have styles available. */ $style = ''; } $style = Horde_String::upper($style); /* Underline is handled separately, if specified in the style var * remove it from the style and set the underline flag. */ if (strpos($style, 'U') !== false) { $this->_underline = true; $style = str_replace('U', '', $style); } else { $this->_underline = false; } if ($style == 'IB') { $style = 'BI'; } /* If no size specified, use current size. */ if (is_null($size)) { $size = $this->_font_size_pt; } /* If font requested is already the current font and no force setting * of the font is requested (eg. when adding a new page) don't bother * with the rest of the function and simply return. */ if ($this->_font_family == $family && $this->_font_style == $style && $this->_font_size_pt == $size && !$force) { return; } /* Set the font key. */ $fontkey = $family . $style; /* Test if already cached. */ if (!isset($this->_fonts[$fontkey])) { /* Get the character width definition file. */ $font_widths = self::_getFontFile($fontkey); $i = count($this->_fonts) + 1; $this->_fonts[$fontkey] = array( 'i' => $i, 'type' => 'core', 'name' => $this->_core_fonts[$fontkey], 'up' => -100, 'ut' => 50, 'cw' => $font_widths[$fontkey]); } /* Store font information as current font. */ $this->_font_family = $family; $this->_font_style = $style; $this->_font_size_pt = $size; $this->_font_size = $size / $this->_scale; $this->_current_font = $this->_fonts[$fontkey]; /* Output font information if at least one page has been defined. */ if ($this->_page > 0) { $this->_out(sprintf('BT /F%d %.2F Tf ET', $this->_current_font['i'], $this->_font_size_pt)); } } /** * Defines the size of the current font. * * @param float $size The size (in points). * * @see setFont() */ public function setFontSize($size) { /* If the font size is already the current font size, just return. */ if ($this->_font_size_pt == $size) { return; } /* Set the current font size, both in points and scaled to user * units. */ $this->_font_size_pt = $size; $this->_font_size = $size / $this->_scale; /* Output font information if at least one page has been defined. */ if ($this->_page > 0) { $this->_out(sprintf('BT /F%d %.2F Tf ET', $this->_current_font['i'], $this->_font_size_pt)); } } /** * Defines the style of the current font. * * @param string $style The font style. * * @see setFont() */ public function setFontStyle($style) { $this->setFont($this->_font_family, $style); } /** * Creates a new internal link and returns its identifier. * * An internal link is a clickable area which directs to another place * within the document. * * The identifier can then be passed to {@link cell()}, {@link()} write, * {@link image()} or {@link link()}. The destination is defined with * {@link setLink()}. * * @see cell() * @see write() * @see image() * @see link() * @see setLink() */ public function addLink() { $n = count($this->_links) + 1; $this->_links[$n] = array(0, 0); return $n; } /** * Defines the page and position a link points to. * * @param integer $link The link identifier returned by {@link addLink()}. * @param float $y Ordinate of target position; -1 indicates the * current position. The default value is 0 (top of * page). * @param integer $page Number of target page; -1 indicates the current * page. * * @see addLink() */ public function setLink($link, $y = 0, $page = -1) { if ($y == -1) { $y = $this->y; } if ($page == -1) { $page = $this->_page; } $this->_links[$link] = array($page, $y); } /** * Puts a link on a rectangular area of the page. * * Text or image links are generally put via {@link cell()}, {@link * write()} or {@link image()}, but this method can be useful for instance * to define a clickable area inside an image. * * All coordinates can be negative to provide values from the right or * bottom edge of the page (since File_Pdf 0.2.0, Horde 3.2). * * @param float $x Abscissa of the upper-left corner of the * rectangle. * @param float $y Ordinate of the upper-left corner of the * rectangle. * @param float $width Width of the rectangle. * @param float $height Height of the rectangle. * @param mixed $link URL or identifier returned by {@link addLink()}. * * @see addLink() * @see cell() * @see write() * @see image() */ public function link($x, $y, $width, $height, $link) { if ($x < 0) { $x += $this->w; } if ($y < 0) { $y += $this->h; } /* Set up the coordinates with correct scaling in pt. */ $x = $this->_toPt($x); $y = $this->hPt - $this->_toPt($y); $width = $this->_toPt($width); $height = $this->_toPt($height); /* Save link to page links array. */ $this->_link($x, $y, $width, $height, $link); } /** * Prints a character string. * * The origin is on the left of the first character, on the baseline. This * method allows to place a string precisely on the page, but it is * usually easier to use {@link cell()}, {@link multiCell()} or {@link * write()} which are the standard methods to print text. * * All coordinates can be negative to provide values from the right or * bottom edge of the page (since File_Pdf 0.2.0, Horde 3.2). * * @param float $x Abscissa of the origin. * @param float $y Ordinate of the origin. * @param string $text String to print. * * @see setFont() * @see cell() * @see multiCell() * @see write() */ public function text($x, $y, $text) { if ($x < 0) { $x += $this->w; } if ($y < 0) { $y += $this->h; } /* Scale coordinates into points and set correct Y position. */ $x = $this->_toPt($x); $y = $this->hPt - $this->_toPt($y); /* Escape any potentially harmful characters. */ $text = $this->_escape($text); $out = sprintf('BT %.2F %.2F Td (%s) Tj ET', $x, $y, $text); if ($this->_underline && $text != '') { $out .= ' ' . $this->_doUnderline($x, $y, $text); } if ($this->_color_flag) { $out = sprintf('q %s %s Q', $this->_text_color, $out); } $this->_out($out); } /** * Whenever a page break condition is met, the method is called, and the * break is issued or not depending on the returned value. The default * implementation returns a value according to the mode selected by * {@link setAutoPageBreak()}. * This method is called automatically and should not be called directly * by the application. * * @return boolean * * @see setAutoPageBreak() */ public function acceptPageBreak() { return $this->_auto_page_break; } /** * Prints a cell (rectangular area) with optional borders, background * color and character string. * * The upper-left corner of the cell corresponds to the current * position. The text can be aligned or centered. After the call, the * current position moves to the right or to the next line. It is possible * to put a link on the text. If automatic page breaking is enabled and * the cell goes beyond the limit, a page break is done before outputting. * * @param float $width Cell width. If 0, the cell extends up to the right * margin. * @param float $height Cell height. * @param string $text String to print. * @param mixed $border Indicates if borders must be drawn around the * cell. The value can be either a number: * - 0: no border (default) * - 1: frame * or a string containing some or all of the * following characters (in any order): * - L: left * - T: top * - R: right * - B: bottom * @param integer $ln Indicates where the current position should go * after the call. Possible values are: * - 0: to the right (default) * - 1: to the beginning of the next line * - 2: below * Putting 1 is equivalent to putting 0 and calling * {@link newLine()} just after. * @param string $align Allows to center or align the text. Possible * values are: * - L or empty string: left (default) * - C: center * - R: right * @param integer $fill Indicates if the cell fill type. Possible values * are: * - 0: transparent (default) * - 1: painted * @param string $link URL or identifier returned by {@link addLink()}. * * @see setFont() * @see setDrawColor() * @see setFillColor() * @see setLineWidth() * @see addLink() * @see newLine() * @see multiCell() * @see write() * @see setAutoPageBreak() */ public function cell($width, $height = 0, $text = '', $border = 0, $ln = 0, $align = '', $fill = 0, $link = '') { $k = $this->_scale; if ($this->y + $height > $this->_page_break_trigger && !$this->_in_footer && $this->acceptPageBreak()) { $x = $this->x; $ws = $this->_word_spacing; if ($ws > 0) { $this->_word_spacing = 0; $this->_out('0 Tw'); } $this->addPage($this->_current_orientation); $this->x = $x; if ($ws > 0) { $this->_word_spacing = $ws; $this->_out(sprintf('%.3F Tw', $ws * $k)); } } if ($width == 0) { $width = $this->w - $this->_right_margin - $this->x; } $s = ''; if ($fill == 1 || $border == 1) { if ($fill == 1) { $op = ($border == 1) ? 'B' : 'f'; } else { $op = 'S'; } $s = sprintf('%.2F %.2F %.2F %.2F re %s ', $this->x * $k, ($this->h - $this->y) * $k, $width * $k, -$height * $k, $op); } if (is_string($border)) { if (strpos($border, 'L') !== false) { $s .= sprintf('%.2F %.2F m %.2F %.2F l S ', $this->x * $k, ($this->h - $this->y) * $k, $this->x * $k, ($this->h - ($this->y + $height)) * $k); } if (strpos($border, 'T') !== false) { $s .= sprintf('%.2F %.2F m %.2F %.2F l S ', $this->x * $k, ($this->h - $this->y) * $k, ($this->x + $width) * $k, ($this->h - $this->y) * $k); } if (strpos($border, 'R') !== false) { $s .= sprintf('%.2F %.2F m %.2F %.2F l S ', ($this->x + $width) * $k, ($this->h - $this->y) * $k, ($this->x + $width) * $k, ($this->h - ($this->y + $height)) * $k); } if (strpos($border, 'B') !== false) { $s .= sprintf('%.2F %.2F m %.2F %.2F l S ', $this->x * $k, ($this->h - ($this->y + $height)) * $k, ($this->x + $width) * $k, ($this->h - ($this->y + $height)) * $k); } } if ($text != '') { if ($align == 'R') { $dx = $width - $this->_cell_margin - $this->getStringWidth($text); } elseif ($align == 'C') { $dx = ($width - $this->getStringWidth($text)) / 2; } else { $dx = $this->_cell_margin; } if ($this->_color_flag) { $s .= 'q ' . $this->_text_color . ' '; } $text = str_replace(')', '\\)', str_replace('(', '\\(', str_replace('\\', '\\\\', $text))); $test2 = ((.5 * $height) + (.3 * $this->_font_size)); $test1 = $this->fhPt - (($this->y + $test2) * $k); $x = ($this->x + $dx) * $k; $y = ($this->h - ($this->y + .5 * $height + .3 * $this->_font_size)) * $k; $s .= sprintf('BT %.2F %.2F Td (%s) Tj ET', $x, $y, $text); if ($this->_underline) { $s .= ' ' . $this->_doUnderline($x, $y, $text); } if ($this->_color_flag) { $s .= ' Q'; } if ($link) { $this->link($this->x + $dx, $this->y + .5 * $height- .5 * $this->_font_size, $this->getStringWidth($text), $this->_font_size, $link); } } if ($s) { $this->_out($s); } $this->_last_height = $height; if ($ln > 0) { // Go to next line. $this->y += $height; if ($ln == 1) { $this->x = $this->_left_margin; } } else { $this->x += $width; } } /** * This method allows printing text with line breaks. * * They can be automatic (as soon as the text reaches the right border of * the cell) or explicit (via the \n character). As many cells as * necessary are output, one below the other. Text can be aligned, * centered or justified. The cell block can be framed and the background * painted. * * @param float $width Width of cells. If 0, they extend up to the right * margin of the page. * @param float $height Height of cells. * @param string $text String to print. * @param mixed $border Indicates if borders must be drawn around the cell * block. The value can be either a number: * - 0: no border (default) * - 1: frame * or a string containing some or all of the * following characters (in any order): * - L: left * - T: top * - R: right * - B: bottom * @param string $align Sets the text alignment. Possible values are: * - L: left alignment * - C: center * - R: right alignment * - J: justification (default value) * @param integer $fill Indicates if the cell background must: * - 0: transparent (default) * - 1: painted * * @see setFont() * @see setDrawColor() * @see setFillColor() * @see setLineWidth() * @see cell() * @see write() * @see setAutoPageBreak() */ public function multiCell($width, $height, $text, $border = 0, $align = 'J', $fill = 0) { $cw = $this->_current_font['cw']; if ($width == 0) { $width = $this->w - $this->_right_margin - $this->x; } $wmax = ($width-2 * $this->_cell_margin) * 1000 / $this->_font_size; $s = str_replace("\r", '', $text); $nb = strlen($s); if ($nb > 0 && $s[$nb-1] == "\n") { $nb--; } $b = 0; if ($border) { if ($border == 1) { $border = 'LTRB'; $b = 'LRT'; $b2 = 'LR'; } else { $b2 = ''; if (strpos($border, 'L') !== false) { $b2 .= 'L'; } if (strpos($border, 'R') !== false) { $b2 .= 'R'; } $b = (strpos($border, 'T') !== false) ? $b2 . 'T' : $b2; } } $sep = -1; $i = 0; $j = 0; $l = 0; $ns = 0; $nl = 1; while ($i < $nb) { // Get next character. $c = $s[$i]; if ($c == "\n") { // Explicit line break. if ($this->_word_spacing > 0) { $this->_word_spacing = 0; $this->_out('0 Tw'); } $this->cell($width, $height, substr($s, $j, $i-$j), $b, 2, $align, $fill); $i++; $sep = -1; $j = $i; $l = 0; $ns = 0; $nl++; if ($border && $nl == 2) { $b = $b2; } continue; } if ($c == ' ') { $sep = $i; $ls = $l; $ns++; } $l += $cw[$c]; if ($l > $wmax) { // Automatic line break. if ($sep == -1) { if ($i == $j) { $i++; } if ($this->_word_spacing > 0) { $this->_word_spacing = 0; $this->_out('0 Tw'); } $this->cell($width, $height, substr($s, $j, $i - $j), $b, 2, $align, $fill); } else { if ($align == 'J') { $this->_word_spacing = ($ns>1) ? ($wmax - $ls)/1000 * $this->_font_size / ($ns - 1) : 0; $this->_out(sprintf('%.3F Tw', $this->_word_spacing * $this->_scale)); } $this->cell($width, $height, substr($s, $j, $sep - $j), $b, 2, $align, $fill); $i = $sep + 1; } $sep = -1; $j = $i; $l = 0; $ns = 0; $nl++; if ($border && $nl == 2) { $b = $b2; } } else { $i++; } } // Last chunk. if ($this->_word_spacing > 0) { $this->_word_spacing = 0; $this->_out('0 Tw'); } if ($border && strpos($border, 'B') !== false) { $b .= 'B'; } $this->cell($width, $height, substr($s, $j, $i), $b, 2, $align, $fill); $this->x = $this->_left_margin; } /** * This method prints text from the current position. * * When the right margin is reached (or the \n character is met) a line * break occurs and text continues from the left margin. Upon method exit, * the current position is left just at the end of the text. * * It is possible to put a link on the text. * * Example: * * // Begin with regular font * $pdf->setFont('Arial', '', 14); * $pdf->write(5, 'Visit '); * // Then put a blue underlined link * $pdf->setTextColor(0, 0, 255); * $pdf->setFont('', 'U'); * $pdf->write(5, 'www.fpdf.org', 'http://www.fpdf.org'); * * * @param float $height Line height. * @param string $text String to print. * @param mixed $link URL or identifier returned by {@link addLink()}. * * @see setFont() * @see addLink() * @see multiCell() * @see setAutoPageBreak() */ public function write($height, $text, $link = '') { $cw = $this->_current_font['cw']; $width = $this->w - $this->_right_margin - $this->x; $wmax = ($width - 2 * $this->_cell_margin) * 1000 / $this->_font_size; $s = str_replace("\r", '', $text); $nb = strlen($s); $sep = -1; $i = 0; $j = 0; $l = 0; $nl = 1; while ($i < $nb) { // Get next character. $c = $s{$i}; if ($c == "\n") { // Explicit line break. $this->cell($width, $height, substr($s, $j, $i - $j), 0, 2, '', 0, $link); $i++; $sep = -1; $j = $i; $l = 0; if ($nl == 1) { $this->x = $this->_left_margin; $width = $this->w - $this->_right_margin - $this->x; $wmax = ($width - 2 * $this->_cell_margin) * 1000 / $this->_font_size; } $nl++; continue; } if ($c == ' ') { $sep = $i; $ls = $l; } $l += (isset($cw[$c]) ? $cw[$c] : 0); if ($l > $wmax) { // Automatic line break. if ($sep == -1) { if ($this->x > $this->_left_margin) { // Move to next line. $this->x = $this->_left_margin; $this->y += $height; $width = $this->w - $this->_right_margin - $this->x; $wmax = ($width - 2 * $this->_cell_margin) * 1000 / $this->_font_size; $i++; $nl++; continue; } if ($i == $j) { $i++; } $this->cell($width, $height, substr($s, $j, $i - $j), 0, 2, '', 0, $link); } else { $this->cell($width, $height, substr($s, $j, $sep - $j), 0, 2, '', 0, $link); $i = $sep + 1; } $sep = -1; $j = $i; $l = 0; if ($nl == 1) { $this->x = $this->_left_margin; $width = $this->w - $this->_right_margin - $this->x; $wmax = ($width - 2 * $this->_cell_margin) * 1000 / $this->_font_size; } $nl++; } else { $i++; } } // Last chunk. if ($i != $j) { $this->cell($l / 1000 * $this->_font_size, $height, substr($s, $j, $i), 0, 0, '', 0, $link); } } /** * Writes text at an angle. * * All coordinates can be negative to provide values from the right or * bottom edge of the page (since File_Pdf 0.2.0, Horde 3.2). * * @param integer $x X coordinate. * @param integer $y Y coordinate. * @param string $text Text to write. * @param float $text_angle Angle to rotate (Eg. 90 = bottom to top). * @param float $font_angle Rotate characters as well as text. * * @see setFont() */ public function writeRotated($x, $y, $text, $text_angle, $font_angle = 0) { if ($x < 0) { $x += $this->w; } if ($y < 0) { $y += $this->h; } // Escape text. $text = $this->_escape($text); $font_angle += 90 + $text_angle; $text_angle *= M_PI / 180; $font_angle *= M_PI / 180; $text_dx = cos($text_angle); $text_dy = sin($text_angle); $font_dx = cos($font_angle); $font_dy = sin($font_angle); $s= sprintf('BT %.2F %.2F %.2F %.2F %.2F %.2F Tm (%s) Tj ET', $text_dx, $text_dy, $font_dx, $font_dy, $x * $this->_scale, ($this->h-$y) * $this->_scale, $text); if ($this->_draw_color) { $s = 'q ' . $this->_draw_color . ' ' . $s . ' Q'; } $this->_out($s); } /** * Prints an image in the page. * * The upper-left corner and at least one of the dimensions must be * specified; the height or the width can be calculated automatically in * order to keep the image proportions. Supported formats are JPEG and * PNG. * * All coordinates can be negative to provide values from the right or * bottom edge of the page (since File_Pdf 0.2.0, Horde 3.2). * * For JPEG, all flavors are allowed: * - gray scales * - true colors (24 bits) * - CMYK (32 bits) * * For PNG, are allowed: * - gray scales on at most 8 bits (256 levels) * - indexed colors * - true colors (24 bits) * but are not supported: * - Interlacing * - Alpha channel * * If a transparent color is defined, it will be taken into account (but * will be only interpreted by Acrobat 4 and above). * The format can be specified explicitly or inferred from the file * extension. * It is possible to put a link on the image. * * Remark: if an image is used several times, only one copy will be * embedded in the file. * * @param string $file Name of the file containing the image. * @param float $x Abscissa of the upper-left corner. * @param float $y Ordinate of the upper-left corner. * @param float $width Width of the image in the page. If equal to zero, * it is automatically calculated to keep the * original proportions. * @param float $height Height of the image in the page. If not specified * or equal to zero, it is automatically calculated * to keep the original proportions. * @param string $type Image format. Possible values are (case * insensitive): JPG, JPEG, PNG. If not specified, * the type is inferred from the file extension. * @param mixed $link URL or identifier returned by {@link addLink()}. * * @see addLink() */ public function image($file, $x, $y, $width = 0, $height = 0, $type = '', $link = '') { if ($x < 0) { $x += $this->w; } if ($y < 0) { $y += $this->h; } if (!isset($this->_images[$file])) { // First use of image, get some file info. if ($type == '') { $pos = strrpos($file, '.'); if ($pos === false) { throw new Horde_Pdf_Exception(sprintf('Image file has no extension and no type was specified: %s', $file)); } $type = substr($file, $pos + 1); } $mqr = get_magic_quotes_runtime(); if ($mqr) { set_magic_quotes_runtime(0); } $type = Horde_String::lower($type); if ($type == 'jpg' || $type == 'jpeg') { $info = $this->_parseJPG($file); } elseif ($type == 'png') { $info = $this->_parsePNG($file); } else { throw new Horde_Pdf_Exception(sprintf('Unsupported image file type: %s', $type)); } if ($mqr) { set_magic_quotes_runtime($mqr); } $info['i'] = count($this->_images) + 1; $this->_images[$file] = $info; } else { $info = $this->_images[$file]; } // Make sure all vars are converted to pt scale. $x = $this->_toPt($x); $y = $this->hPt - $this->_toPt($y); $width = $this->_toPt($width); $height = $this->_toPt($height); // If not specified do automatic width and height calculations. if (empty($width) && empty($height)) { $width = $info['w']; $height = $info['h']; } elseif (empty($width)) { $width = $height * $info['w'] / $info['h']; } elseif (empty($height)) { $height = $width * $info['h'] / $info['w']; } $this->_out(sprintf('q %.2F 0 0 %.2F %.2F %.2F cm /I%d Do Q', $width, $height, $x, $y - $height, $info['i'])); // Set any link if requested. if ($link) { $this->_link($x, $y, $width, $height, $link); } } /** * Performs a line break. * * The current abscissa goes back to the left margin and the ordinate * increases by the amount passed in parameter. * * @param float $height The height of the break. By default, the value * equals the height of the last printed cell. * * @see cell() */ public function newLine($height = '') { $this->x = $this->_left_margin; if (is_string($height)) { $this->y += $this->_last_height; } else { $this->y += $height; } } /** * Get the current page * * @return integer */ public function getPage() { return $this->_page; } /** * Set the current page * @param integer $page */ public function setPage($page) { $this->_page = $page; } /** * Returns the abscissa of the current position in user units. * * @return float * * @see setX() * @see getY() * @see setY() */ public function getX() { return $this->x; } /** * Defines the abscissa of the current position. * * If the passed value is negative, it is relative to the right of the * page. * * @param float $x The value of the abscissa. * * @see getX() * @see getY() * @see setY() * @see setXY() */ public function setX($x) { if ($x >= 0) { // Absolute value. $this->x = $x; } else { // Negative, so relative to right edge of the page. $this->x = $this->w + $x; } } /** * Returns the ordinate of the current position in user units. * * @return float * * @see setY() * @see getX() * @see setX() */ public function getY() { return $this->y; } /** * Defines the ordinate of the current position. * * If the passed value is negative, it is relative to the bottom of the * page. * * @param float $y The value of the ordinate. * * @see getX() * @see getY() * @see setY() * @see setXY() */ public function setY($y) { if ($y >= 0) { // Absolute value. $this->y = $y; } else { // Negative, so relative to bottom edge of the page. $this->y = $this->h + $y; } } /** * Defines the abscissa and ordinate of the current position. * * If the passed values are negative, they are relative respectively to * the right and bottom of the page. * * @param float $x The value of the abscissa. * @param float $y The value of the ordinate. * * @see setX() * @see setY() */ public function setXY($x, $y) { $this->setY($y); $this->setX($x); } /** * Returns the current buffer content and resets the buffer. * * Use this method when creating large files to avoid memory problems. * This method doesn't work in combination with the save() method, * use getOutput() at the end. Calling this method doubles the * memory usage during the call. * * @see getOutput() */ public function flush() { // Make sure we have the file header. $this->_beginDoc(); $buffer = $this->_buffer; $this->_buffer = ''; $this->_flushed = true; $this->_buflen += strlen($buffer); return $buffer; } /** * Returns the raw Pdf file. * * @see flush() */ public function getOutput() { // Check whether file has been closed. if ($this->_state < 3) { $this->close(); } return $this->_buffer; } /** * Saves the PDF file on the filesystem. * * @param string $filename The filename for the output file. */ public function save($filename = 'unknown.pdf') { // Check whether the buffer has been flushed already. if ($this->_flushed) { throw new Horde_Pdf_Exception('The buffer has been flushed already, don\'t use save() in combination with flush().'); } // Check whether file has been closed. if ($this->_state < 3) { $this->close(); } $f = fopen($filename, 'wb'); if (!$f) { throw new Horde_Pdf_Exception(sprintf('Unable to save Pdf file: %s', $filename)); } fwrite($f, $this->_buffer, strlen($this->_buffer)); fclose($f); } /** * Scale a value. * * @param integer $val Value * @return integer Value multiplied by scale */ protected function _toPt($val) { return $val * $this->_scale; } /** * Load information about a font from its key name. * * @param string $fontkey Font name key * @return array Array of all font widths, including this font. */ protected static function _getFontFile($fontkey) { if (!isset(self::$_font_widths[$fontkey])) { $fontClass = 'Horde_Pdf_Font_' . Horde_String::ucfirst(Horde_String::lower($fontkey)); if (!class_exists($fontClass)) { throw new Horde_Pdf_Exception(sprintf('Could not include font metric class: %s', $fontClass)); } $font = new $fontClass; self::$_font_widths = array_merge(self::$_font_widths, $font->getWidths()); if (!isset(self::$_font_widths[$fontkey])) { throw new Horde_Pdf_Exception(sprintf('Could not include font metric class: %s', $fontClass)); } } return self::$_font_widths; } /** * Save link to page links array. * * @param integer $x X-coordinate * @param integer $y Y-coordinate * @param integer $width Width * @param integer $height Height * @param string $link Link * @return void */ protected function _link($x, $y, $width, $height, $link) { $this->_page_links[$this->_page][] = array($x, $y, $width, $height, $link); } /** * Begin the PDF document. * * @return void */ protected function _beginDoc() { // Start document, but only if not yet started. if ($this->_state < 1) { $this->_state = 1; $this->_out('%PDF-1.3'); } } /** * Write the PDF pages. * * @return void */ protected function _putPages() { $nb = $this->_page; if (!empty($this->_alias_nb_pages)) { // Replace number of pages. for ($n = 1; $n <= $nb; $n++) { $this->_pages[$n] = str_replace($this->_alias_nb_pages, $nb, $this->_pages[$n]); } } if ($this->_default_orientation == 'P') { $wPt = $this->fwPt; $hPt = $this->fhPt; } else { $wPt = $this->fhPt; $hPt = $this->fwPt; } $filter = ($this->_compress) ? '/Filter /FlateDecode ' : ''; for ($n = 1; $n <= $nb; $n++) { // Page $this->_newobj(); $this->_out('<_out('/Parent 1 0 R'); if (isset($this->_orientation_changes[$n])) { $this->_out(sprintf('/MediaBox [0 0 %.2F %.2F]', $hPt, $wPt)); } $this->_out('/Resources 2 0 R'); if (isset($this->_page_links[$n])) { // Links $annots = '/Annots ['; foreach ($this->_page_links[$n] as $pl) { $rect = sprintf('%.2F %.2F %.2F %.2F', $pl[0], $pl[1], $pl[0] + $pl[2], $pl[1] - $pl[3]); $annots .= '<_textString($pl[4]) . '>>>>'; } else { $l = $this->_links[$pl[4]]; $height = isset($this->_orientation_changes[$l[0]]) ? $wPt : $hPt; $annots .= sprintf('/Dest [%d 0 R /XYZ 0 %.2F null]>>', 1 + 2 * $l[0], $height - $l[1] * $this->_scale); } } $this->_out($annots . ']'); } $this->_out('/Contents ' . ($this->_n + 1) . ' 0 R>>'); $this->_out('endobj'); // Page content $p = ($this->_compress) ? gzcompress($this->_pages[$n]) : $this->_pages[$n]; $this->_newobj(); $this->_out('<<' . $filter . '/Length ' . strlen($p) . '>>'); $this->_putStream($p); $this->_out('endobj'); } // Pages root $this->_offsets[1] = $this->_buflen + strlen($this->_buffer); $this->_out('1 0 obj'); $this->_out('<_out($kids . ']'); $this->_out('/Count ' . $nb); $this->_out(sprintf('/MediaBox [0 0 %.2F %.2F]', $wPt, $hPt)); $this->_out('>>'); $this->_out('endobj'); } /** * Write the PDF fonts. * * @return void */ protected function _putFonts() { $nf = $this->_n; foreach ($this->_diffs as $diff) { // Encodings $this->_newobj(); $this->_out('<>'); $this->_out('endobj'); } $mqr = get_magic_quotes_runtime(); if ($mqr) { set_magic_quotes_runtime(0); } foreach ($this->_font_files as $file => $info) { // Font file embedding. $this->_newobj(); $this->_font_files[$file]['n'] = $this->_n; $size = filesize($file); if (!$size) { throw new Horde_Pdf_Exception('Font file not found'); } $this->_out('<_out('/Filter /FlateDecode'); } $this->_out('/Length1 ' . $info['length1']); if (isset($info['length2'])) { $this->_out('/Length2 ' . $info['length2'] . ' /Length3 0'); } $this->_out('>>'); $f = fopen($file, 'rb'); $this->_putStream(fread($f, $size)); fclose($f); $this->_out('endobj'); } if ($mqr) { set_magic_quotes_runtime($mqr); } foreach ($this->_fonts as $k => $font) { // Font objects $this->_newobj(); $this->_fonts[$k]['n'] = $this->_n; $name = $font['name']; $this->_out('<_out('/BaseFont /' . $name); if ($font['type'] == 'core') { // Standard font. $this->_out('/Subtype /Type1'); if ($name != 'Symbol' && $name != 'ZapfDingbats') { $this->_out('/Encoding /WinAnsiEncoding'); } } else { // Additional font. $this->_out('/Subtype /' . $font['type']); $this->_out('/FirstChar 32'); $this->_out('/LastChar 255'); $this->_out('/Widths ' . ($this->_n + 1) . ' 0 R'); $this->_out('/FontDescriptor ' . ($this->_n + 2) . ' 0 R'); if ($font['enc']) { if (isset($font['diff'])) { $this->_out('/Encoding ' . ($nf + $font['diff']) . ' 0 R'); } else { $this->_out('/Encoding /WinAnsiEncoding'); } } } $this->_out('>>'); $this->_out('endobj'); if ($font['type'] != 'core') { // Widths. $this->_newobj(); $cw = $font['cw']; $s = '['; for ($i = 32; $i <= 255; $i++) { $s .= $cw[chr($i)] . ' '; } $this->_out($s . ']'); $this->_out('endobj'); // Descriptor. $this->_newobj(); $s = '< $v) { $s .= ' /' . $k . ' ' . $v; } $file = $font['file']; if ($file) { $s .= ' /FontFile' . ($font['type'] == 'Type1' ? '' : '2') . ' ' . $this->_font_files[$file]['n'] . ' 0 R'; } $this->_out($s . '>>'); $this->_out('endobj'); } } } /** * Write the PDF images. * * @return void */ protected function _putImages() { $filter = ($this->_compress) ? '/Filter /FlateDecode ' : ''; foreach ($this->_images as $file => $info) { $this->_newobj(); $this->_images[$file]['n'] = $this->_n; $this->_out('<_out('/Subtype /Image'); $this->_out('/Width ' . $info['w']); $this->_out('/Height ' . $info['h']); if ($info['cs'] == 'Indexed') { $this->_out('/ColorSpace [/Indexed /DeviceRGB ' . (strlen($info['pal'])/3 - 1) . ' ' . ($this->_n + 1) . ' 0 R]'); } else { $this->_out('/ColorSpace /' . $info['cs']); if ($info['cs'] == 'DeviceCMYK') { $this->_out('/Decode [1 0 1 0 1 0 1 0]'); } } $this->_out('/BitsPerComponent ' . $info['bpc']); $this->_out('/Filter /' . $info['f']); if (isset($info['parms'])) { $this->_out($info['parms']); } if (isset($info['trns']) && is_array($info['trns'])) { $trns = ''; $i_max = count($info['trns']); for ($i = 0; $i < $i_max; $i++) { $trns .= $info['trns'][$i] . ' ' . $info['trns'][$i] . ' '; } $this->_out('/Mask [' . $trns . ']'); } $this->_out('/Length ' . strlen($info['data']) . '>>'); $this->_putStream($info['data']); $this->_out('endobj'); // Palette. if ($info['cs'] == 'Indexed') { $this->_newobj(); $pal = ($this->_compress) ? gzcompress($info['pal']) : $info['pal']; $this->_out('<<' . $filter . '/Length ' . strlen($pal) . '>>'); $this->_putStream($pal); $this->_out('endobj'); } } } /** * Write the PDF resources. * * @return void */ protected function _putResources() { $this->_putFonts(); $this->_putImages(); // Resource dictionary $this->_offsets[2] = $this->_buflen + strlen($this->_buffer); $this->_out('2 0 obj'); $this->_out('<_out('/Font <<'); foreach ($this->_fonts as $font) { $this->_out('/F' . $font['i'] . ' ' . $font['n'] . ' 0 R'); } $this->_out('>>'); if (count($this->_images)) { $this->_out('/XObject <<'); foreach ($this->_images as $image) { $this->_out('/I' . $image['i'] . ' ' . $image['n'] . ' 0 R'); } $this->_out('>>'); } $this->_out('>>'); $this->_out('endobj'); } /** * Write the PDF information. * * @return void */ protected function _putInfo() { $this->_out('/Producer ' . $this->_textString('Horde PDF')); if (!empty($this->_info['title'])) { $this->_out('/Title ' . $this->_textString($this->_info['title'])); } if (!empty($this->_info['subject'])) { $this->_out('/Subject ' . $this->_textString($this->_info['subject'])); } if (!empty($this->_info['author'])) { $this->_out('/Author ' . $this->_textString($this->_info['author'])); } if (!empty($this->keywords)) { $this->_out('/Keywords ' . $this->_textString($this->keywords)); } if (!empty($this->creator)) { $this->_out('/Creator ' . $this->_textString($this->creator)); } if (!isset($this->_info['CreationDate'])) { $this->_info['CreationDate'] = 'D:' . date('YmdHis', time()); } $this->_out('/CreationDate ' . $this->_textString($this->_info['CreationDate'])); } /** * Write the PDF catalog. * * @return void */ protected function _putCatalog() { $this->_out('/Type /Catalog'); $this->_out('/Pages 1 0 R'); if ($this->_zoom_mode == 'fullpage') { $this->_out('/OpenAction [3 0 R /Fit]'); } elseif ($this->_zoom_mode == 'fullwidth') { $this->_out('/OpenAction [3 0 R /FitH null]'); } elseif ($this->_zoom_mode == 'real') { $this->_out('/OpenAction [3 0 R /XYZ null null 1]'); } elseif (!is_string($this->_zoom_mode)) { $this->_out('/OpenAction [3 0 R /XYZ null null ' . ($this->_zoom_mode / 100) . ']'); } if ($this->_layout_mode == 'single') { $this->_out('/PageLayout /SinglePage'); } elseif ($this->_layout_mode == 'continuous') { $this->_out('/PageLayout /OneColumn'); } elseif ($this->_layout_mode == 'two') { $this->_out('/PageLayout /TwoColumnLeft'); } } /** * Write the PDF trailer. * * @return void */ protected function _putTrailer() { $this->_out('/Size ' . ($this->_n + 1)); $this->_out('/Root ' . $this->_n . ' 0 R'); $this->_out('/Info ' . ($this->_n - 1) . ' 0 R'); } /** * End the PDF document * * @return void */ protected function _endDoc() { $this->_putPages(); $this->_putResources(); // Info $this->_newobj(); $this->_out('<<'); $this->_putInfo(); $this->_out('>>'); $this->_out('endobj'); // Catalog $this->_newobj(); $this->_out('<<'); $this->_putCatalog(); $this->_out('>>'); $this->_out('endobj'); // Cross-ref $o = $this->_buflen + strlen($this->_buffer); $this->_out('xref'); $this->_out('0 ' . ($this->_n + 1)); $this->_out('0000000000 65535 f '); for ($i = 1; $i <= $this->_n; $i++) { $this->_out(sprintf('%010d 00000 n ', $this->_offsets[$i])); } // Trailer $this->_out('trailer'); $this->_out('<<'); $this->_putTrailer(); $this->_out('>>'); $this->_out('startxref'); $this->_out($o); $this->_out('%%EOF'); $this->_state = 3; } /** * Begin a new page. * * @param string $orientation Orientation code * @return void */ protected function _beginPage($orientation) { $this->_page++; // only assign page contents if it is new if (!isset($this->_pages[$this->_page])) { $this->_pages[$this->_page] = ''; } $this->_state = 2; $this->x = $this->_left_margin; $this->y = $this->_top_margin; $this->_last_height = 0; // Page orientation if (!$orientation) { $orientation = $this->_default_orientation; } else { $orientation = Horde_String::upper($orientation[0]); if ($orientation != $this->_default_orientation) { $this->_orientation_changes[$this->_page] = true; } } if ($orientation != $this->_current_orientation) { // Change orientation if ($orientation == 'P') { $this->wPt = $this->fwPt; $this->hPt = $this->fhPt; $this->w = $this->fw; $this->h = $this->fh; } else { $this->wPt = $this->fhPt; $this->hPt = $this->fwPt; $this->w = $this->fh; $this->h = $this->fw; } $this->_page_break_trigger = $this->h - $this->_break_margin; $this->_current_orientation = $orientation; } } /** * Set the end of page contents. * * @return void */ protected function _endPage() { $this->_state = 1; } /** * Begin a new object. * * @return void */ protected function _newobj() { $this->_n++; $this->_offsets[$this->_n] = $this->_buflen + strlen($this->_buffer); $this->_out($this->_n . ' 0 obj'); } /** * Underline a block of text. * * @param integer $x X-coordinate * @param integer $y Y-coordinate * @param string $text Text to underline * @return string Underlined string */ protected function _doUnderline($x, $y, $text) { // Set the rectangle width according to text width. $width = $this->getStringWidth($text, true); /* Set rectangle position and height, using underline position and * thickness settings scaled by the font size. */ $y = $y + ($this->_current_font['up'] * $this->_font_size_pt / 1000); $height = -$this->_current_font['ut'] * $this->_font_size_pt / 1000; return sprintf('%.2F %.2F %.2F %.2F re f', $x, $y, $width, $height); } /** * Extract info from a JPEG file. * * @param string $file Filename of JPEG image * @return array Assoc. array of info */ protected function _parseJPG($file) { // Extract info from a JPEG file. $img = @getimagesize($file); if (!$img) { throw new Horde_Pdf_Exception(sprintf('Missing or incorrect image file: %s', $file)); } if ($img[2] != 2) { throw new Horde_Pdf_Exception(sprintf('Not a JPEG file: %s', $file)); } if (!isset($img['channels']) || $img['channels'] == 3) { $colspace = 'DeviceRGB'; } elseif ($img['channels'] == 4) { $colspace = 'DeviceCMYK'; } else { $colspace = 'DeviceGray'; } $bpc = isset($img['bits']) ? $img['bits'] : 8; // Read whole file. $f = fopen($file, 'rb'); $data = fread($f, filesize($file)); fclose($f); return array('w' => $img[0], 'h' => $img[1], 'cs' => $colspace, 'bpc' => $bpc, 'f' => 'DCTDecode', 'data' => $data); } /** * Extract info from a PNG file. * * @param string $file Filename of PNG image * @return array Assoc. array of info */ protected function _parsePNG($file) { // Extract info from a PNG file. $f = fopen($file, 'rb'); if (!$f) { throw new Horde_Pdf_Exception(sprintf('Unable to open image file: %s', $file)); } // Check signature. if (fread($f, 8) != chr(137) . 'PNG' . chr(13) . chr(10) . chr(26) . chr(10)) { throw new Horde_Pdf_Exception(sprintf('Not a PNG file: %s', $file)); } // Read header chunk. fread($f, 4); if (fread($f, 4) != 'IHDR') { throw new Horde_Pdf_Exception(sprintf('Incorrect PNG file: %s', $file)); } $width = $this->_freadInt($f); $height = $this->_freadInt($f); $bpc = ord(fread($f, 1)); if ($bpc > 8) { throw new Horde_Pdf_Exception(sprintf('16-bit depth not supported: %s', $file)); } $ct = ord(fread($f, 1)); if ($ct == 0) { $colspace = 'DeviceGray'; } elseif ($ct == 2) { $colspace = 'DeviceRGB'; } elseif ($ct == 3) { $colspace = 'Indexed'; } else { throw new Horde_Pdf_Exception(sprintf('Alpha channel not supported: %s', $file)); } if (ord(fread($f, 1)) != 0) { throw new Horde_Pdf_Exception(sprintf('Unknown compression method: %s', $file)); } if (ord(fread($f, 1)) != 0) { throw new Horde_Pdf_Exception(sprintf('Unknown filter method: %s', $file)); } if (ord(fread($f, 1)) != 0) { throw new Horde_Pdf_Exception(sprintf('Interlacing not supported: %s', $file)); } fread($f, 4); $parms = '/DecodeParms <>'; // Scan chunks looking for palette, transparency and image data. $pal = ''; $trns = ''; $data = ''; do { $n = $this->_freadInt($f); $type = fread($f, 4); if ($type == 'PLTE') { // Read palette $pal = fread($f, $n); fread($f, 4); } elseif ($type == 'tRNS') { // Read transparency info $t = fread($f, $n); if ($ct == 0) { $trns = array(ord(substr($t, 1, 1))); } elseif ($ct == 2) { $trns = array(ord(substr($t, 1, 1)), ord(substr($t, 3, 1)), ord(substr($t, 5, 1))); } else { $pos = strpos($t, chr(0)); if (is_int($pos)) { $trns = array($pos); } } fread($f, 4); } elseif ($type == 'IDAT') { // Read image data block $data .= fread($f, $n); fread($f, 4); } elseif ($type == 'IEND') { break; } else { fread($f, $n + 4); } } while ($n); if ($colspace == 'Indexed' && empty($pal)) { throw new Horde_Pdf_Exception(sprintf('Missing palette in: %s', $file)); } fclose($f); return array('w' => $width, 'h' => $height, 'cs' => $colspace, 'bpc' => $bpc, 'f' => 'FlateDecode', 'parms' => $parms, 'pal' => $pal, 'trns' => $trns, 'data' => $data); } /** * Read a 4-byte integer from stream. * * @param resource $f Stream resource * @return integer Byte */ protected function _freadInt($f) { $i = ord(fread($f, 1)) << 24; $i += ord(fread($f, 1)) << 16; $i += ord(fread($f, 1)) << 8; $i += ord(fread($f, 1)); return $i; } /** * Format a text string by escaping and wrapping in parentheses. * * @param string $s String to format. * @param string Formatted string. * @return string */ protected function _textString($s) { return '(' . $this->_escape($s) . ')'; } /** * Escape parentheses and forward slash. * * @param string $s String to escape. * @return string Escaped string. */ protected function _escape($s) { return str_replace(array('\\', ')', '('), array('\\\\', '\\)', '\\('), $s); } /** * Add a line to the document wrapped in 'stream' and 'endstream'. * * @param string $s Line to add. * @return void */ protected function _putStream($s) { $this->_out('stream'); $this->_out($s); $this->_out('endstream'); } /** * Add a line to the document. * * @param string $s Line to add. * @return void */ protected function _out($s) { if ($this->_state == 2) { $this->_pages[$this->_page] .= $s . "\n"; } else { $this->_buffer .= $s . "\n"; } } /** * Convert hex-based color to RGB */ protected function _hexToRgb($hex) { if (substr($hex, 0, 1) == '#') { $hex = substr($hex, 1); } if (strlen($hex) == 6) { list($r, $g, $b) = array(substr($hex, 0, 2), substr($hex, 2, 2), substr($hex, 4, 2)); } elseif (strlen($hex) == 3) { list($r, $g, $b) = array(substr($hex, 0, 1).substr($hex, 0, 1), substr($hex, 1, 1).substr($hex, 1, 1), substr($hex, 2, 1).substr($hex, 2, 1)); } $r = hexdec($r)/255; $g = hexdec($g)/255; $b = hexdec($b)/255; return array($r, $g, $b); } } Horde_Pdf-2.0.7/test/Horde/Pdf/fixtures/20k_c1.txt0000664000175000017500000001257612653753017017624 0ustar janjanThe 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 Lacpde, 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. Horde_Pdf-2.0.7/test/Horde/Pdf/fixtures/20k_c2.txt0000664000175000017500000001616412653753017017622 0ustar janjanDuring 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. "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!" Horde_Pdf-2.0.7/test/Horde/Pdf/fixtures/auto_break.pdf0000664000175000017500000000236312653753017020704 0ustar janjan%PDF-1.3 3 0 obj <> endobj 4 0 obj <> stream 2 J 0.57 w BT /F1 10.00 Tf ET BT 2.83 42.00 Td (Hello) Tj ET BT 2.83 32.00 Td (Hello) Tj ET BT 2.83 22.00 Td (Hello) Tj ET BT 2.83 12.00 Td (Hello) Tj ET BT 2.83 2.00 Td (Hello) Tj ET endstream endobj 5 0 obj <> endobj 6 0 obj <> stream 2 J 0.57 w BT /F1 10.00 Tf ET BT 2.83 42.00 Td (Hello) Tj ET BT 2.83 32.00 Td (Hello) Tj ET endstream endobj 1 0 obj <> endobj 7 0 obj <> endobj 2 0 obj <> >> endobj 8 0 obj << /Producer (Horde PDF) /CreationDate (D:20071105152947) >> endobj 9 0 obj << /Type /Catalog /Pages 1 0 R /OpenAction [3 0 R /FitH null] /PageLayout /OneColumn >> endobj xref 0 10 0000000000 65535 f 0000000538 00000 n 0000000723 00000 n 0000000009 00000 n 0000000087 00000 n 0000000320 00000 n 0000000398 00000 n 0000000629 00000 n 0000000811 00000 n 0000000887 00000 n trailer << /Size 10 /Root 9 0 R /Info 8 0 R >> startxref 990 %%EOF Horde_Pdf-2.0.7/test/Horde/Pdf/fixtures/change_page.pdf0000664000175000017500000000213212653753017021003 0ustar janjan%PDF-1.3 3 0 obj <> endobj 4 0 obj <> stream 2 J 0.57 w BT /F1 10.00 Tf ET BT 2.83 72.00 Td (Hello) Tj ET BT 2.83 72.00 Td (Goodbye) Tj ET endstream endobj 5 0 obj <> endobj 6 0 obj <> stream 2 J 0.57 w BT /F1 10.00 Tf ET endstream endobj 1 0 obj <> endobj 7 0 obj <> endobj 2 0 obj <> >> endobj 8 0 obj << /Producer (Horde PDF) /CreationDate (D:20071105152947) >> endobj 9 0 obj << /Type /Catalog /Pages 1 0 R /OpenAction [3 0 R /FitH null] /PageLayout /OneColumn >> endobj xref 0 10 0000000000 65535 f 0000000385 00000 n 0000000570 00000 n 0000000009 00000 n 0000000087 00000 n 0000000229 00000 n 0000000307 00000 n 0000000476 00000 n 0000000658 00000 n 0000000734 00000 n trailer << /Size 10 /Root 9 0 R /Info 8 0 R >> startxref 837 %%EOF Horde_Pdf-2.0.7/test/Horde/Pdf/fixtures/header_footer_styles.pdf0000664000175000017500000005340312653753017023002 0ustar janjan%PDF-1.3 3 0 obj <> endobj 4 0 obj <> stream 2 J 0.57 w BT /F1 15.00 Tf ET 0.000 0.314 0.706 RG 0.902 0.902 0.000 rg 2.83 w 179.09 813.54 237.10 -25.51 re B q 0.863 0.196 0.196 rg BT 187.59 796.28 Td (20000 Leagues Under the Seas) Tj ET Q 0.57 w BT /F2 12.00 Tf ET 0 g 0 G 0.784 0.863 1.000 rg 28.35 759.68 538.58 -17.01 re f q 0 g BT 31.19 747.58 Td (Chapter 1 : A RUNAWAY REEF) Tj ET Q BT /F3 12.00 Tf ET 0.002 Tw q 0 g BT 31.19 720.65 Td (The year 1866 was marked by a bizarre development, an unexplained and downright inexplicable phenomenon) Tj ET Q 1.585 Tw q 0 g BT 31.19 706.48 Td (that surely no one has forgotten. Without getting into those rumors that upset civilians in the seaports and) Tj ET Q 1.022 Tw q 0 g BT 31.19 692.30 Td (deranged the public mind even far inland, it must be said that professional seamen were especially alarmed.) Tj ET Q 2.336 Tw q 0 g BT 31.19 678.13 Td (Traders, shipowners, captains of vessels, skippers, and master mariners from Europe and America, naval) Tj ET Q 0.314 Tw q 0 g BT 31.19 663.96 Td (officers from every country, and at their heels the various national governments on these two continents, were) Tj ET Q 0 Tw q 0 g BT 31.19 649.78 Td (all extremely disturbed by the business.) Tj ET Q 3.660 Tw q 0 g BT 31.19 635.61 Td (In essence, over a period of time several ships had encountered "an enormous thing" at sea, a long) Tj ET Q 2.306 Tw q 0 g BT 31.19 621.44 Td (spindle-shaped object, sometimes giving off a phosphorescent glow, infinitely bigger and faster than any) Tj ET Q 0 Tw q 0 g BT 31.19 607.26 Td (whale.) Tj ET Q 0.589 Tw q 0 g BT 31.19 593.09 Td (The relevant data on this apparition, as recorded in various logbooks, agreed pretty closely as to the structure) Tj ET Q 0.125 Tw q 0 g BT 31.19 578.92 Td (of the object or creature in question, its unprecedented speed of movement, its startling locomotive power, and) Tj ET Q 1.556 Tw q 0 g BT 31.19 564.74 Td (the unique vitality with which it seemed to be gifted. If it was a cetacean, it exceeded in bulk any whale) Tj ET Q 1.192 Tw q 0 g BT 31.19 550.57 Td (previously classified by science. No naturalist, neither Cuvier nor Lacpde, neither Professor Dumeril nor) Tj ET Q 1.159 Tw q 0 g BT 31.19 536.40 Td (Professor de Quatrefages, would have accepted the existence of such a monster sight unseen -- specifically,) Tj ET Q 0 Tw q 0 g BT 31.19 522.22 Td (unseen by their own scientific eyes.) Tj ET Q 1.520 Tw q 0 g BT 31.19 508.05 Td (Striking an average of observations taken at different times -- rejecting those timid estimates that gave the) Tj ET Q 2.544 Tw q 0 g BT 31.19 493.88 Td (object a length of 200 feet, and ignoring those exaggerated views that saw it as a mile wide and three) Tj ET Q 1.356 Tw q 0 g BT 31.19 479.70 Td (long--you could still assert that this phenomenal creature greatly exceeded the dimensions of anything then) Tj ET Q 0 Tw q 0 g BT 31.19 465.53 Td (known to ichthyologists, if it existed at all.) Tj ET Q 0.232 Tw q 0 g BT 31.19 451.36 Td (Now then, it did exist, this was an undeniable fact; and since the human mind dotes on objects of wonder, you) Tj ET Q 0.292 Tw q 0 g BT 31.19 437.18 Td (can understand the worldwide excitement caused by this unearthly apparition. As for relegating it to the realm) Tj ET Q 0 Tw q 0 g BT 31.19 423.01 Td (of fiction, that charge had to be dropped.) Tj ET Q 3.687 Tw q 0 g BT 31.19 408.84 Td (In essence, on July 20, 1866, the steamer Governor Higginson, from the Calcutta & Burnach Steam) Tj ET Q 0.332 Tw q 0 g BT 31.19 394.66 Td (Navigation Co., encountered this moving mass five miles off the eastern shores of Australia. Captain Baker at) Tj ET Q 0.413 Tw q 0 g BT 31.19 380.49 Td (first thought he was in the presence of an unknown reef; he was even about to fix its exact position when two) Tj ET Q 0.593 Tw q 0 g BT 31.19 366.32 Td (waterspouts shot out of this inexplicable object and sprang hissing into the air some 150 feet. So, unless this) Tj ET Q 0.177 Tw q 0 g BT 31.19 352.14 Td (reef was subject to the intermittent eruptions of a geyser, the Governor Higginson had fair and honest dealings) Tj ET Q 0.662 Tw q 0 g BT 31.19 337.97 Td (with some aquatic mammal, until then unknown, that could spurt from its blowholes waterspouts mixed with) Tj ET Q 0 Tw q 0 g BT 31.19 323.80 Td (air and steam.) Tj ET Q 2.548 Tw q 0 g BT 31.19 309.63 Td (Similar events were likewise observed in Pacific seas, on July 23 of the same year, by the Christopher) Tj ET Q 1.355 Tw q 0 g BT 31.19 295.45 Td (Columbus from the West India & Pacific Steam Navigation Co. Consequently, this extraordinary cetacean) Tj ET Q 0.567 Tw q 0 g BT 31.19 281.28 Td (could transfer itself from one locality to another with startling swiftness, since within an interval of just three) Tj ET Q 1.163 Tw q 0 g BT 31.19 267.11 Td (days, the Governor Higginson and the Christopher Columbus had observed it at two positions on the charts) Tj ET Q 0 Tw q 0 g BT 31.19 252.93 Td (separated by a distance of more than 700 nautical leagues.) Tj ET Q 1.734 Tw q 0 g BT 31.19 238.76 Td (Fifteen days later and 2,000 leagues farther, the Helvetia from the Compagnie Nationale and the Shannon) Tj ET Q 0.050 Tw q 0 g BT 31.19 224.59 Td (from the Royal Mail line, running on opposite tacks in that part of the Atlantic lying between the United States) Tj ET Q 0.167 Tw q 0 g BT 31.19 210.41 Td (and Europe, respectively signaled each other that the monster had been sighted in latitude 42 degrees 15' north) Tj ET Q 0.551 Tw q 0 g BT 31.19 196.24 Td (and longitude 60 degrees 35' west of the meridian of Greenwich. From their simultaneous observations, they) Tj ET Q 0.341 Tw q 0 g BT 31.19 182.07 Td (were able to estimate the mammal's minimum length at more than 350 English feet; this was because both the) Tj ET Q 0.146 Tw q 0 g BT 31.19 167.89 Td (Shannon and the Helvetia were of smaller dimensions, although each measured 100 meters stem to stern. Now) Tj ET Q 0.377 Tw q 0 g BT 31.19 153.72 Td (then, the biggest whales, those rorqual whales that frequent the waterways of the Aleutian Islands, have never) Tj ET Q 0 Tw q 0 g BT 31.19 139.55 Td (exceeded a length of 56 meters--if they reach even that.) Tj ET Q 0.293 Tw q 0 g BT 31.19 125.37 Td (One after another, reports arrived that would profoundly affect public opinion: new observations taken by the) Tj ET Q 0.893 Tw q 0 g BT 31.19 111.20 Td (transatlantic liner Pereire, the Inman line's Etna running afoul of the monster, an official report drawn up by) Tj ET Q 0.051 Tw q 0 g BT 31.19 97.03 Td (officers on the French frigate Normandy, dead-earnest reckonings obtained by the general staff of Commodore) Tj ET Q 1.236 Tw q 0 g BT 31.19 82.85 Td (Fitz-James aboard the Lord Clyde. In lighthearted countries, people joked about this phenomenon, but such) Tj ET Q 0 Tw q 0 g BT 31.19 68.68 Td (serious, practical countries as England, America, and Germany were deeply concerned.) Tj ET Q 0.060 Tw 0 Tw BT /F4 8.00 Tf ET q 0.502 g BT 284.96 25.95 Td (Page 1) Tj ET Q endstream endobj 5 0 obj <> endobj 6 0 obj <> stream 2 J 0.57 w BT /F3 12.00 Tf ET BT /F1 15.00 Tf ET 0.000 0.314 0.706 RG 0.902 0.902 0.000 rg 2.83 w 179.09 813.54 237.10 -25.51 re B q 0.863 0.196 0.196 rg BT 187.59 796.28 Td (20000 Leagues Under the Seas) Tj ET Q 0.57 w BT /F3 12.00 Tf ET 0.784 0.863 1.000 rg 0 G 0.060 Tw q 0 g BT 31.19 749.00 Td (In every big city the monster was the latest rage; they sang about it in the coffee houses, they ridiculed it in the) Tj ET Q 0.034 Tw q 0 g BT 31.19 734.82 Td (newspapers, they dramatized it in the theaters. The tabloids found it a fine opportunity for hatching all sorts of) Tj ET Q 1.315 Tw q 0 g BT 31.19 720.65 Td (hoaxes. In those newspapers short of copy, you saw the reappearance of every gigantic imaginary creature,) Tj ET Q 0.742 Tw q 0 g BT 31.19 706.48 Td (from "Moby Dick," that dreadful white whale from the High Arctic regions, to the stupendous kraken whose) Tj ET Q 1.315 Tw q 0 g BT 31.19 692.30 Td (tentacles could entwine a 500-ton craft and drag it into the ocean depths. They even reprinted reports from) Tj ET Q 0.707 Tw q 0 g BT 31.19 678.13 Td (ancient times: the views of Aristotle and Pliny accepting the existence of such monsters, then the Norwegian) Tj ET Q 0.936 Tw q 0 g BT 31.19 663.96 Td (stories of Bishop Pontoppidan, the narratives of Paul Egede, and finally the reports of Captain Harrington --) Tj ET Q 0.980 Tw q 0 g BT 31.19 649.78 Td (whose good faith is above suspicion--in which he claims he saw, while aboard the Castilian in 1857, one of) Tj ET Q 1.389 Tw q 0 g BT 31.19 635.61 Td (those enormous serpents that, until then, had frequented only the seas of France's old extremist newspaper,) Tj ET Q 0 Tw q 0 g BT 31.19 621.44 Td (The Constitutionalist. ) Tj ET Q BT /F5 12.00 Tf ET q 0 g BT 31.19 593.09 Td (\(end of extract\)) Tj ET Q BT /F4 8.00 Tf ET q 0.502 g BT 284.96 25.95 Td (Page 2) Tj ET Q endstream endobj 7 0 obj <> endobj 8 0 obj <> stream 2 J 0.57 w BT /F5 12.00 Tf ET BT /F1 15.00 Tf ET 0.000 0.314 0.706 RG 0.902 0.902 0.000 rg 2.83 w 179.09 813.54 237.10 -25.51 re B q 0.863 0.196 0.196 rg BT 187.59 796.28 Td (20000 Leagues Under the Seas) Tj ET Q 0.57 w BT /F5 12.00 Tf ET 0.784 0.863 1.000 rg 0 G BT /F2 12.00 Tf ET 0.784 0.863 1.000 rg 28.35 759.68 538.58 -17.01 re f q 0 g BT 31.19 747.58 Td (Chapter 2 : THE PROS AND CONS) Tj ET Q BT /F3 12.00 Tf ET 1.002 Tw q 0 g BT 31.19 720.65 Td (During the period in which these developments were occurring, I had returned from a scientific undertaking) Tj ET Q 0.608 Tw q 0 g BT 31.19 706.48 Td (organized to explore the Nebraska badlands in the United States. In my capacity as Assistant Professor at the) Tj ET Q 1.687 Tw q 0 g BT 31.19 692.30 Td (Paris Museum of Natural History, I had been attached to this expedition by the French government. After) Tj ET Q 2.020 Tw q 0 g BT 31.19 678.13 Td (spending six months in Nebraska, I arrived in New York laden with valuable collections near the end of) Tj ET Q 1.649 Tw q 0 g BT 31.19 663.96 Td (March. My departure for France was set for early May. In the meantime, then, I was busy classifying my) Tj ET Q 0 Tw q 0 g BT 31.19 649.78 Td (mineralogical, botanical, and zoological treasures when that incident took place with the Scotia.) Tj ET Q 0.471 Tw q 0 g BT 31.19 635.61 Td (I was perfectly abreast of this question, which was the big news of the day, and how could I not have been? I) Tj ET Q 0.782 Tw q 0 g BT 31.19 621.44 Td (had read and reread every American and European newspaper without being any farther along. This mystery) Tj ET Q 0.516 Tw q 0 g BT 31.19 607.26 Td (puzzled me. Finding it impossible to form any views, I drifted from one extreme to the other. Something was) Tj ET Q 1.601 Tw q 0 g BT 31.19 593.09 Td (out there, that much was certain, and any doubting Thomas was invited to place his finger on the Scotia's) Tj ET Q 0 Tw q 0 g BT 31.19 578.92 Td (wound.) Tj ET Q 1.249 Tw q 0 g BT 31.19 564.74 Td (When I arrived in New York, the question was at the boiling point. The hypothesis of a drifting islet or an) Tj ET Q 1.561 Tw q 0 g BT 31.19 550.57 Td (elusive reef, put forward by people not quite in their right minds, was completely eliminated. And indeed,) Tj ET Q 0 Tw q 0 g BT 31.19 536.40 Td (unless this reef had an engine in its belly, how could it move about with such prodigious speed?) Tj ET Q 0.779 Tw q 0 g BT 31.19 522.22 Td (Also discredited was the idea of a floating hull or some other enormous wreckage, and again because of this) Tj ET Q 0 Tw q 0 g BT 31.19 508.05 Td (speed of movement.) Tj ET Q 1.114 Tw q 0 g BT 31.19 493.88 Td (So only two possible solutions to the question were left, creating two very distinct groups of supporters: on) Tj ET Q 0.914 Tw q 0 g BT 31.19 479.70 Td (one side, those favoring a monster of colossal strength; on the other, those favoring an "underwater boat" of) Tj ET Q 0 Tw q 0 g BT 31.19 465.53 Td (tremendous motor power.) Tj ET Q 3.674 Tw q 0 g BT 31.19 451.36 Td (Now then, although the latter hypothesis was completely admissible, it couldn't stand up to inquiries) Tj ET Q 0.227 Tw q 0 g BT 31.19 437.18 Td (conducted in both the New World and the Old. That a private individual had such a mechanism at his disposal) Tj ET Q 0 Tw q 0 g BT 31.19 423.01 Td (was less than probable. Where and when had he built it, and how could he have built it in secret?) Tj ET Q 0.395 Tw q 0 g BT 31.19 408.84 Td (Only some government could own such an engine of destruction, and in these disaster-filled times, when men) Tj ET Q 1.331 Tw q 0 g BT 31.19 394.66 Td (tax their ingenuity to build increasingly powerful aggressive weapons, it was possible that, unknown to the) Tj ET Q 0.106 Tw q 0 g BT 31.19 380.49 Td (rest of the world, some nation could have been testing such a fearsome machine. The Chassepot rifle led to the) Tj ET Q 0.490 Tw q 0 g BT 31.19 366.32 Td (torpedo, and the torpedo has led to this underwater battering ram, which in turn will lead to the world putting) Tj ET Q 0 Tw q 0 g BT 31.19 352.14 Td (its foot down. At least I hope it will.) Tj ET Q 1.078 Tw q 0 g BT 31.19 337.97 Td (But this hypothesis of a war machine collapsed in the face of formal denials from the various governments.) Tj ET Q 0.251 Tw q 0 g BT 31.19 323.80 Td (Since the public interest was at stake and transoceanic travel was suffering, the sincerity of these governments) Tj ET Q 0.979 Tw q 0 g BT 31.19 309.63 Td (could not be doubted. Besides, how could the assembly of this underwater boat have escaped public notice?) Tj ET Q 3.430 Tw q 0 g BT 31.19 295.45 Td (Keeping a secret under such circumstances would be difficult enough for an individual, and certainly) Tj ET Q 0 Tw q 0 g BT 31.19 281.28 Td (impossible for a nation whose every move is under constant surveillance by rival powers.) Tj ET Q 0.422 Tw q 0 g BT 31.19 267.11 Td (So, after inquiries conducted in England, France, Russia, Prussia, Spain, Italy, America, and even Turkey, the) Tj ET Q 0 Tw q 0 g BT 31.19 252.93 Td (hypothesis of an underwater Monitor was ultimately rejected.) Tj ET Q 2.481 Tw q 0 g BT 31.19 238.76 Td (After I arrived in New York, several people did me the honor of consulting me on the phenomenon in) Tj ET Q 0.569 Tw q 0 g BT 31.19 224.59 Td (question. In France I had published a two-volume work, in quarto, entitled The Mysteries of the Great Ocean) Tj ET Q 0.862 Tw q 0 g BT 31.19 210.41 Td (Depths. Well received in scholarly circles, this book had established me as a specialist in this pretty obscure) Tj ET Q 1.833 Tw q 0 g BT 31.19 196.24 Td (field of natural history. My views were in demand. As long as I could deny the reality of the business, I) Tj ET Q 0.058 Tw q 0 g BT 31.19 182.07 Td (confined myself to a flat "no comment." But soon, pinned to the wall, I had to explain myself straight out. And) Tj ET Q 1.637 Tw q 0 g BT 31.19 167.89 Td (in this vein, "the honorable Pierre Aronnax, Professor at the Paris Museum," was summoned by The New) Tj ET Q 0 Tw q 0 g BT 31.19 153.72 Td (York Herald to formulate his views no matter what.) Tj ET Q 0.697 Tw q 0 g BT 31.19 139.55 Td (I complied. Since I could no longer hold my tongue, I let it wag. I discussed the question in its every aspect,) Tj ET Q 0.017 Tw q 0 g BT 31.19 125.37 Td (both political and scientific, and this is an excerpt from the well-padded article I published in the issue of April) Tj ET Q 0 Tw q 0 g BT 31.19 111.20 Td (30.) Tj ET Q 2.226 Tw q 0 g BT 31.19 82.85 Td ("Therefore," I wrote, "after examining these different hypotheses one by one, we are forced, every other) Tj ET Q 0 Tw q 0 g BT 31.19 68.68 Td (supposition having been refuted, to accept the existence of an extremely powerful marine animal.) Tj ET Q 0.550 Tw 0 Tw BT /F4 8.00 Tf ET q 0.502 g BT 284.96 25.95 Td (Page 3) Tj ET Q endstream endobj 9 0 obj <> endobj 10 0 obj <> stream 2 J 0.57 w BT /F3 12.00 Tf ET BT /F1 15.00 Tf ET 0.000 0.314 0.706 RG 0.902 0.902 0.000 rg 2.83 w 179.09 813.54 237.10 -25.51 re B q 0.863 0.196 0.196 rg BT 187.59 796.28 Td (20000 Leagues Under the Seas) Tj ET Q 0.57 w BT /F3 12.00 Tf ET 0.784 0.863 1.000 rg 0 G 0.550 Tw q 0 g BT 31.19 749.00 Td ("The deepest parts of the ocean are totally unknown to us. No soundings have been able to reach them. What) Tj ET Q 0.352 Tw q 0 g BT 31.19 734.82 Td (goes on in those distant depths? What creatures inhabit, or could inhabit, those regions twelve or fifteen miles) Tj ET Q 0 Tw q 0 g BT 31.19 720.65 Td (beneath the surface of the water? What is the constitution of these animals? It's almost beyond conjecture.) Tj ET Q 3.495 Tw q 0 g BT 31.19 706.48 Td ("However, the solution to this problem submitted to me can take the form of a choice between two) Tj ET Q 0 Tw q 0 g BT 31.19 692.30 Td (alternatives.) Tj ET Q q 0 g BT 31.19 678.13 Td ("Either we know every variety of creature populating our planet, or we do not.) Tj ET Q 1.250 Tw q 0 g BT 31.19 663.96 Td ("If we do not know every one of them, if nature still keeps ichthyological secrets from us, nothing is more) Tj ET Q 0.231 Tw q 0 g BT 31.19 649.78 Td (admissible than to accept the existence of fish or cetaceans of new species or even new genera, animals with a) Tj ET Q 3.022 Tw q 0 g BT 31.19 635.61 Td (basically 'cast-iron' constitution that inhabit strata beyond the reach of our soundings, and which some) Tj ET Q 1.589 Tw q 0 g BT 31.19 621.44 Td (development or other, an urge or a whim if you prefer, can bring to the upper level of the ocean for long) Tj ET Q 0 Tw q 0 g BT 31.19 607.26 Td (intervals.) Tj ET Q 0.321 Tw q 0 g BT 31.19 593.09 Td ("If, on the other hand, we do know every living species, we must look for the animal in question among those) Tj ET Q 1.409 Tw q 0 g BT 31.19 578.92 Td (marine creatures already cataloged, and in this event I would be inclined to accept the existence of a giant) Tj ET Q 0 Tw q 0 g BT 31.19 564.74 Td (narwhale.) Tj ET Q 0.008 Tw q 0 g BT 31.19 550.57 Td ("The common narwhale, or sea unicorn, often reaches a length of sixty feet. Increase its dimensions fivefold or) Tj ET Q 0.352 Tw q 0 g BT 31.19 536.40 Td (even tenfold, then give this cetacean a strength in proportion to its size while enlarging its offensive weapons,) Tj ET Q 1.251 Tw q 0 g BT 31.19 522.22 Td (and you have the animal we're looking for. It would have the proportions determined by the officers of the) Tj ET Q 0 Tw q 0 g BT 31.19 508.05 Td (Shannon, the instrument needed to perforate the Scotia, and the power to pierce a steamer's hull.) Tj ET Q 0.130 Tw q 0 g BT 31.19 493.88 Td ("In essence, the narwhale is armed with a sort of ivory sword, or lance, as certain naturalists have expressed it.) Tj ET Q 1.326 Tw q 0 g BT 31.19 479.70 Td (It's a king-sized tooth as hard as steel. Some of these teeth have been found buried in the bodies of baleen) Tj ET Q 3.771 Tw q 0 g BT 31.19 465.53 Td (whales, which the narwhale attacks with invariable success. Others have been wrenched, not without) Tj ET Q 0.119 Tw q 0 g BT 31.19 451.36 Td (difficulty, from the undersides of vessels that narwhales have pierced clean through, as a gimlet pierces a wine) Tj ET Q 0.649 Tw q 0 g BT 31.19 437.18 Td (barrel. The museum at the Faculty of Medicine in Paris owns one of these tusks with a length of 2.25 meters) Tj ET Q 0 Tw q 0 g BT 31.19 423.01 Td (and a width at its base of forty-eight centimeters!) Tj ET Q 0.467 Tw q 0 g BT 31.19 408.84 Td ("All right then! Imagine this weapon to be ten times stronger and the animal ten times more powerful, launch) Tj ET Q 0.980 Tw q 0 g BT 31.19 394.66 Td (it at a speed of twenty miles per hour, multiply its mass times its velocity, and you get just the collision we) Tj ET Q 0 Tw q 0 g BT 31.19 380.49 Td (need to cause the specified catastrophe.) Tj ET Q 1.067 Tw q 0 g BT 31.19 366.32 Td ("So, until information becomes more abundant, I plump for a sea unicorn of colossal dimensions, no longer) Tj ET Q 0.631 Tw q 0 g BT 31.19 352.14 Td (armed with a mere lance but with an actual spur, like ironclad frigates or those warships called 'rams,' whose) Tj ET Q 0 Tw q 0 g BT 31.19 337.97 Td (mass and motor power it would possess simultaneously.) Tj ET Q 1.992 Tw q 0 g BT 31.19 323.80 Td ("This inexplicable phenomenon is thus explained away--unless it's something else entirely, which, despite) Tj ET Q 0 Tw q 0 g BT 31.19 309.63 Td (everything that has been sighted, studied, explored and experienced, is still possible!" ) Tj ET Q BT /F5 12.00 Tf ET q 0 g BT 31.19 281.28 Td (\(end of extract\)) Tj ET Q BT /F4 8.00 Tf ET q 0.502 g BT 284.96 25.95 Td (Page 4) Tj ET Q endstream endobj 1 0 obj <> endobj 11 0 obj <> endobj 12 0 obj <> endobj 13 0 obj <> endobj 14 0 obj <> endobj 15 0 obj <> endobj 2 0 obj <> >> endobj 16 0 obj << /Producer (Horde PDF) /Title (20000 Leagues Under the Seas) /Author (Jules Verne) /CreationDate (D:20071105152947) >> endobj 17 0 obj << /Type /Catalog /Pages 1 0 R /OpenAction [3 0 R /FitH null] /PageLayout /OneColumn >> endobj xref 0 18 0000000000 65535 f 0000020852 00000 n 0000021460 00000 n 0000000009 00000 n 0000000087 00000 n 0000007099 00000 n 0000007177 00000 n 0000009074 00000 n 0000009152 00000 n 0000016015 00000 n 0000016094 00000 n 0000020957 00000 n 0000021059 00000 n 0000021156 00000 n 0000021255 00000 n 0000021360 00000 n 0000021593 00000 n 0000021730 00000 n trailer << /Size 18 /Root 17 0 R /Info 16 0 R >> startxref 21834 %%EOF Horde_Pdf-2.0.7/test/Horde/Pdf/fixtures/hello_world_compressed.pdf0000664000175000017500000000250712653753017023326 0ustar janjan%PDF-1.3 3 0 obj <> endobj 4 0 obj <> stream 2 J 0.57 w BT /F1 8.00 Tf ET BT 283.46 558.43 Td (First page) Tj ET BT /F1 20.00 Tf ET BT 283.46 274.96 Td (HELLO WORLD!) Tj ET endstream endobj 5 0 obj <> endobj 6 0 obj <> stream 2 J 0.57 w BT /F1 20.00 Tf ET BT /F2 12.00 Tf ET BT 283.46 558.43 Td (Second page) Tj ET endstream endobj 1 0 obj <> endobj 7 0 obj <> endobj 8 0 obj <> endobj 2 0 obj <> >> endobj 9 0 obj << /Producer (Horde PDF) /CreationDate (D:20071105152947) >> endobj 10 0 obj << /Type /Catalog /Pages 1 0 R /OpenAction [3 0 R /FitH null] /PageLayout /OneColumn >> endobj xref 0 11 0000000000 65535 f 0000000479 00000 n 0000000774 00000 n 0000000009 00000 n 0000000087 00000 n 0000000264 00000 n 0000000342 00000 n 0000000572 00000 n 0000000666 00000 n 0000000872 00000 n 0000000948 00000 n trailer << /Size 11 /Root 10 0 R /Info 9 0 R >> startxref 1052 %%EOF Horde_Pdf-2.0.7/test/Horde/Pdf/fixtures/hello_world_uncompressed.pdf0000664000175000017500000000250712653753017023671 0ustar janjan%PDF-1.3 3 0 obj <> endobj 4 0 obj <> stream 2 J 0.57 w BT /F1 8.00 Tf ET BT 283.46 558.43 Td (First page) Tj ET BT /F1 20.00 Tf ET BT 283.46 274.96 Td (HELLO WORLD!) Tj ET endstream endobj 5 0 obj <> endobj 6 0 obj <> stream 2 J 0.57 w BT /F1 20.00 Tf ET BT /F2 12.00 Tf ET BT 283.46 558.43 Td (Second page) Tj ET endstream endobj 1 0 obj <> endobj 7 0 obj <> endobj 8 0 obj <> endobj 2 0 obj <> >> endobj 9 0 obj << /Producer (Horde PDF) /CreationDate (D:20071105152947) >> endobj 10 0 obj << /Type /Catalog /Pages 1 0 R /OpenAction [3 0 R /FitH null] /PageLayout /OneColumn >> endobj xref 0 11 0000000000 65535 f 0000000479 00000 n 0000000774 00000 n 0000000009 00000 n 0000000087 00000 n 0000000264 00000 n 0000000342 00000 n 0000000572 00000 n 0000000666 00000 n 0000000872 00000 n 0000000948 00000 n trailer << /Size 11 /Root 10 0 R /Info 9 0 R >> startxref 1052 %%EOF Horde_Pdf-2.0.7/test/Horde/Pdf/fixtures/horde-power1.png0000664000175000017500000000427012653753017021116 0ustar janjanPNG  IHDRT}9IDATxpdKWYۻ mYٶg/9U&77x֩?ny}.UO8t:###}4 SȮ=^Oqq+W;IV[[ci9s[7+7&&&<.2dȐ_'e\7nܐAZY;_!V>w7nZ>#j)ؘZ[QVV&;wt-S8>f -))y9 F iӦ.]ԩScƌAGF Ǐ7oЄ Ν;}ٳgxt ('Yje˰>CՁ?{'׀tGÇwy /{1q<'}Z8]f#Fj~_^ںu z":~³єxEƆowH߉+>ڼy# )&{l{x@fpg6bHjo@\l2ڟ>WE}aÀo,_j'.ٙ1Q&>r9ƛoߞ۵k'>l5dGZ%oٵTZUTwߟtϟO (((HKO [7&!򼼼ݻZI"С孷_Q{%kuN&~Q#_W>c{4W\\O+׿u3Gi 1#|%?O?rjJ0AhNBBiҳbǖE@ͧA"B`HUUU9990PDN2P]]Y r3f&+^} LYYY{m|yyyT< fPJZE.1՜g '.DDD()99Y6j`~^f`7M4b>0` OhSd| nw4MJ: OU#fDju3gX|۶mU[n0>|SN: Phh({e:QDS0 oBf׽Fy4 $`zgѼ^>EhxIII|ϟ/ whS#%LRk_*PK/́5YEFy#*,<ܝ>Y|Vn¨pGS R_jdS-N# R @0@'<ڵk*Qrm)3;yIjiژdSP3RQ!GĄxU)x\[ )(\Ő! }`(UPHYCxB. Gوn=x~z*Kpܓ,YB6s)YYmYISw^O%2P y^1BLxܕvꂘy[!#Hx{j}G+^nڬw_k>33%-kEtZ!p.́R-kP瞾Ѫ򗣗i.kwʂHC/Bks¡ĥ#%!V14^4H4$|灊JgΜy衇䱤9+W'd\T"ucx?=\4$ր| r86~,d%yS``P׵kWCs*ܒV :?'|-M=uy9S;ڋ< ?H7nQHFvm٣=b@~eϬAY [7%"W CP=uܹn)hUg@׏i^>qMLM8 jVG֕MaJ1fnTdlY駟6֭[-DvTS~g"' ru]%ԜgHHBo( By!|>r/!oszBIpR̳AZ𰈡0Ȧ3gp~/Q"Ӽѽ_̾B{ZA܄cu?TGEEaDTg|G%IENDB`Horde_Pdf-2.0.7/test/Horde/Pdf/fixtures/links.pdf0000664000175000017500000000775012653753017017715 0ustar janjan%PDF-1.3 3 0 obj <>>><>] /Contents 4 0 R>> endobj 4 0 obj <> stream 2 J 0.57 w BT /F1 12.00 Tf ET BT 31.19 788.68 Td (Horde) Tj ET 31.19 787.48 32.68 -0.60 re f BT 31.19 746.16 Td (here) Tj ET 31.19 744.96 24.01 -0.60 re f endstream endobj 5 0 obj <>>>] /Contents 6 0 R>> endobj 6 0 obj <> stream 2 J 0.57 w BT /F1 12.00 Tf ET q 84.00 0 0 31.00 42.52 768.37 cm /I1 Do Q endstream endobj 1 0 obj <> endobj 7 0 obj <> endobj 8 0 obj <> /Length 2175>> stream xpdKWYۻ mYٶg/9U&77x֩?ny}.UO8t:###}4 SȮ=^Oqq+W;IV[[ci9s[7+7&&&<.2dȐ_'e\7nܐAZY;_!V>w7nZ>#j)ؘZ[QVV&;wt-S8>f -))y9 F iӦ.]ԩScƌAGF Ǐ7oЄ Ν;}ٳgxt ('Yje˰>CՁ?{'׀tGÇwy /{1q<'}Z8]f#Fj~_^ںu z":~³єxEƆowH߉+>ڼy# )&{l{x@fpg6bHjo@\l2ڟ>WE}aÀo,_j'.ٙ1Q&>r9ƛoߞ۵k'>l5dGZ%oٵTZUTwߟtϟO (((HKO [7&!򼼼ݻZI"С孷_Q{%kuN&~Q#_W>c{4W\\O+׿u3Gi 1#|%?O?rjJ0AhNBBiҳbǖE@ͧA"B`HUUU9990PDN2P]]Y r3f&+^} LYYY{m|yyyT< fPJZE.1՜g '.DDD()99Y6j`~^f`7M4b>0` OhSd| nw4MJ: OU#fDju3gX|۶mU[n0>|SN: Phh({e:QDS0 oBf׽Fy4 $`zgѼ^>EhxIII|ϟ/ whS#%LRk_*PK/́5YEFy#*,<ܝ>Y|Vn¨pGS R_jdS-N# R @0@'<ڵk*Qrm)3;yIjiژdSP3RQ!GĄxU)x\[ )(\Ő! }`(UPHYCxB. Gوn=x~z*Kpܓ,YB6s)YYmYISw^O%2P y^1BLxܕvꂘy[!#Hx{j}G+^nڬw_k>33%-kEtZ!p.́R-kP瞾Ѫ򗣗i.kwʂHC/Bks¡ĥ#%!V14^4H4$|灊JgΜy衇䱤9+W'd\T"ucx?=\4$ր| r86~,d%yS``P׵kWCs*ܒV :?'|-M=uy9S;ڋ< ?H7nQHFvm٣=b@~eϬAY [7%"W CP=uܹn)hUg@׏i^>qMLM8 jVG֕MaJ1fnTdlY駟6֭[-DvTS~g"' ru]%ԜgHHBo( By!|>r/!oszBIpR̳AZ𰈡0Ȧ3gp~/Q"Ӽѽ_̾B{ZA܄cu?TGEEaDTg|G endstream endobj 2 0 obj <> /XObject << /I1 8 0 R >> >> endobj 9 0 obj << /Producer (Horde PDF) /CreationDate (D:20071105152947) >> endobj 10 0 obj << /Type /Catalog /Pages 1 0 R /OpenAction [3 0 R /FitH null] /PageLayout /OneColumn >> endobj xref 0 11 0000000000 65535 f 0000000877 00000 n 0000003480 00000 n 0000000009 00000 n 0000000336 00000 n 0000000540 00000 n 0000000756 00000 n 0000000970 00000 n 0000001066 00000 n 0000003593 00000 n 0000003669 00000 n trailer << /Size 11 /Root 10 0 R /Info 9 0 R >> startxref 3773 %%EOF Horde_Pdf-2.0.7/test/Horde/Pdf/fixtures/text_color.pdf0000664000175000017500000000175012653753017020751 0ustar janjan%PDF-1.3 3 0 obj <> endobj 4 0 obj <> stream 2 J 0.57 w BT /F1 48.00 Tf ET 50.000 0.000 0.000 RG 0.000 0.000 50.000 rg 28.35 813.54 538.58 -141.73 re B q 0.000 50.000 0.000 rg BT 156.28 728.27 Td (Hello Colors) Tj ET Q endstream endobj 1 0 obj <> endobj 5 0 obj <> endobj 2 0 obj <> >> endobj 6 0 obj << /Producer (Horde PDF) /CreationDate (D:20071105152947) >> endobj 7 0 obj << /Type /Catalog /Pages 1 0 R /OpenAction [3 0 R /FitH null] /PageLayout /OneColumn >> endobj xref 0 8 0000000000 65535 f 0000000310 00000 n 0000000498 00000 n 0000000009 00000 n 0000000087 00000 n 0000000397 00000 n 0000000586 00000 n 0000000662 00000 n trailer << /Size 8 /Root 7 0 R /Info 6 0 R >> startxref 765 %%EOF Horde_Pdf-2.0.7/test/Horde/Pdf/fixtures/underline.pdf0000664000175000017500000000213512653753017020552 0ustar janjan%PDF-1.3 3 0 obj <>>>] /Contents 4 0 R>> endobj 4 0 obj <> stream 2 J 0.57 w BT /F1 12.00 Tf ET BT 31.19 788.68 Td (Underlined) Tj ET 31.19 787.48 58.02 -0.60 re f BT 31.19 746.16 Td (Horde) Tj ET 31.19 744.96 32.68 -0.60 re f endstream endobj 1 0 obj <> endobj 5 0 obj <> endobj 2 0 obj <> >> endobj 6 0 obj << /Producer (Horde PDF) /CreationDate (D:20071105152947) >> endobj 7 0 obj << /Type /Catalog /Pages 1 0 R /OpenAction [3 0 R /FitH null] /PageLayout /OneColumn >> endobj xref 0 8 0000000000 65535 f 0000000432 00000 n 0000000615 00000 n 0000000009 00000 n 0000000222 00000 n 0000000519 00000 n 0000000703 00000 n 0000000779 00000 n trailer << /Size 8 /Root 7 0 R /Info 6 0 R >> startxref 882 %%EOF Horde_Pdf-2.0.7/test/Horde/Pdf/AllTests.php0000664000175000017500000000013212653753017016460 0ustar janjanrun(); Horde_Pdf-2.0.7/test/Horde/Pdf/bootstrap.php0000664000175000017500000000014312653753017016744 0ustar janjan Horde_Pdf-2.0.7/test/Horde/Pdf/WriterTest.php0000664000175000017500000002214512653753017017051 0ustar janjan 'L', 'unit' => 'pt', 'format' => 'A3'); $pdf = new Horde_Pdf_Writer($options); $this->assertEquals('L', $pdf->getDefaultOrientation()); $this->assertEquals(841.89, $pdf->getFormatHeight()); $this->assertEquals(1190.55, $pdf->getFormatWidth()); } public function testFactoryWithDefaults() { $pdf = new Horde_Pdf_Writer(); $this->assertEquals('P', $pdf->getDefaultOrientation()); $this->assertTrue(abs($pdf->getScale() - 2.8346456692913) < 0.000001); $this->assertEquals(841.89, $pdf->getFormatHeight()); $this->assertEquals(595.28, $pdf->getFormatWidth()); } public function testHelloWorldUncompressed() { $pdf = new Horde_Pdf_Writer(array('orientation' => 'P', 'format' => 'A4')); $pdf->setInfo('CreationDate', $this->fixtureCreationDate()); $pdf->open(); $pdf->setCompression(false); $pdf->addPage(); $pdf->setFont('Courier', '', 8); $pdf->text(100, 100, 'First page'); $pdf->setFontSize(20); $pdf->text(100, 200, 'HELLO WORLD!'); $pdf->addPage(); $pdf->setFont('Arial', 'BI', 12); $pdf->text(100, 100, 'Second page'); $actual = $pdf->getOutput(); $expected = $this->fixture('hello_world_uncompressed'); $this->assertEquals($expected, $actual); } public function testHelloWorldCompressed() { $pdf = new Horde_Pdf_Writer(array('orientation' => 'P', 'format' => 'A4')); $pdf->setInfo('CreationDate', $this->fixtureCreationDate()); $pdf->open(); $pdf->setCompression(false); $pdf->addPage(); $pdf->setFont('Courier', '', 8); $pdf->text(100, 100, 'First page'); $pdf->setFontSize(20); $pdf->text(100, 200, 'HELLO WORLD!'); $pdf->addPage(); $pdf->setFont('Arial', 'BI', 12); $pdf->text(100, 100, 'Second page'); $actual = $pdf->getOutput(); $expected = $this->fixture('hello_world_compressed'); $this->assertEquals($expected, $actual); } public function testAutoBreak() { $pdf = new Horde_Pdf_Writer(array('format' => array(50, 50), 'unit' => 'pt')); $pdf->setInfo('CreationDate', $this->fixtureCreationDate()); $pdf->setCompression(false); $pdf->setMargins(0, 0); $pdf->setAutoPageBreak(true); $pdf->open(); $pdf->addPage(); $pdf->setFont('Courier', '', 10); $pdf->write(10, "Hello\nHello\nHello\nHello\nHello\nHello\nHello\n"); $actual = $pdf->getOutput(); $expected = $this->fixture('auto_break'); $this->assertEquals($expected, $actual); } public function testChangePage() { $pdf = new Horde_Pdf_Writer(array('format' => array(80, 80), 'unit' => 'pt')); $pdf->setInfo('CreationDate', $this->fixtureCreationDate()); $pdf->setCompression(false); $pdf->setMargins(0, 0); $pdf->open(); // first page $pdf->addPage(); $pdf->setFont('Courier', '', 10); $pdf->write(10, "Hello"); // second page $pdf->addPage(); // back to first page again $pdf->setPage(1); $pdf->write(10, "Goodbye"); // back to second page $pdf->setPage(2); $expected = $this->fixture('change_page'); $this->assertEquals($expected, $pdf->getOutput()); } public function testTextColor() { $pdf = new Horde_Pdf_Writer(); $pdf->setInfo('CreationDate', $this->fixtureCreationDate()); $pdf->setCompression(false); $pdf->open(); $pdf->addPage(); $pdf->setFont('Helvetica', 'B', 48); $pdf->setDrawColor('rgb', 50, 0, 0); $pdf->setTextColor('rgb', 0, 50, 0); $pdf->setFillColor('rgb', 0, 0, 50); $pdf->cell(0, 50, 'Hello Colors', 1, 0, 'C', 1); $actual = $pdf->getOutput(); $expected = $this->fixture('text_color'); $this->assertEquals($expected, $actual); } public function testTextColorUsingHex() { $pdf = new Horde_Pdf_Writer(); $pdf->setInfo('timestamp', $this->fixtureCreationDate()); $pdf->setCompression(false); $pdf->open(); $pdf->addPage(); $pdf->setFont('Helvetica', 'B', 48); $pdf->setDrawColor('hex', '#F00'); $pdf->setTextColor('hex', '#0F0'); $pdf->setFillColor('hex', '#00F'); $this->assertEquals('1.000 0.000 0.000 RG', $pdf->getDrawColor()); $this->assertEquals('0.000 1.000 0.000 rg', $pdf->getTextColor()); $this->assertEquals('0.000 0.000 1.000 rg', $pdf->getFillColor()); } public function testUnderline() { $pdf = new Horde_Pdf_Writer(array('orientation' => 'P', 'format' => 'A4')); $pdf->setInfo('CreationDate', $this->fixtureCreationDate()); $pdf->open(); $pdf->setCompression(false); $pdf->addPage(); $pdf->setFont('Helvetica', 'U', 12); $pdf->write(15, "Underlined\n"); $pdf->write(15, 'Horde', 'http://www.horde.org'); $actual = $pdf->getOutput(); $expected = $this->fixture('underline'); $this->assertEquals($expected, $actual); } /** * PEAR Bug #12310 */ public function testHeaderFooterStyles() { $pdf = new HeaderFooterStylesPdf(array( 'orientation' => 'P', 'unit' => 'mm', 'format' => 'A4', )); $pdf->setCompression(false); $pdf->setInfo('title', '20000 Leagues Under the Seas'); $pdf->setInfo('author', 'Jules Verne'); $pdf->setInfo('CreationDate', $this->fixtureCreationDate()); $pdf->printChapter(1, 'A RUNAWAY REEF', '20k_c1.txt'); $pdf->printChapter(2, 'THE PROS AND CONS', '20k_c2.txt'); $actual = $pdf->getOutput(); $expected = $this->fixture('header_footer_styles'); $this->assertEquals($expected, $actual); } /** * Horde Bug #5964 */ public function testLinks() { $pdf = new Horde_Pdf_Writer(array('orientation' => 'P', 'format' => 'A4')); $pdf->setInfo('CreationDate', $this->fixtureCreationDate()); $pdf->open(); $pdf->setCompression(false); $pdf->addPage(); $pdf->setFont('Helvetica', 'U', 12); $pdf->write(15, 'Horde', 'http://www.horde.org'); $pdf->write(15, "\n"); $link = $pdf->addLink(); $pdf->write(15, 'here', $link); $pdf->addPage(); $pdf->setLink($link); $pdf->image(__DIR__ . '/fixtures/horde-power1.png', 15, 15, 0, 0, '', 'http://pear.horde.org/'); $actual = $pdf->getOutput(); $expected = $this->fixture('links'); $this->assertEquals($expected, $actual); } /** * PEAR Bug #12310 */ public function testCourierStyle() { $pdf = new Horde_Pdf_Writer(); $pdf->setFont('courier', 'B', 10); } // Test Helpers protected function fixture($name) { $filename = __DIR__ . "/fixtures/{$name}.pdf"; $fixture = file_get_contents($filename); $this->assertInternalType('string', $fixture); return $fixture; } protected function fixtureCreationDate() { return 'D:20071105152947'; } } class HeaderFooterStylesPdf extends Horde_Pdf_Writer { public function header() { $this->setFont('Arial', 'B', 15); $w = $this->getStringWidth($this->_info['title']) + 6; $this->setX((210 - $w) / 2); $this->setDrawColor('rgb', 0/255, 80/255, 180/255); $this->setFillColor('rgb', 230/255, 230/255, 0/255); $this->setTextColor('rgb', 220/255, 50/255, 50/255); $this->setLineWidth(1); $this->cell($w, 9, $this->_info['title'], 1, 1, 'C', 1); $this->newLine(10); } public function footer() { $this->setY(-15); $this->setFont('Arial', 'I', 8); $this->setTextColor('gray', 128/255); $this->cell(0, 10, 'Page ' . $this->getPageNo(), 0, 0, 'C'); } public function chapterTitle($num, $label) { $this->setFont('Arial', '', 12); $this->setFillColor('rgb', 200/255, 220/255, 255/255); $this->cell(0, 6, "Chapter $num : $label", 0, 1, 'L', 1); $this->newLine(4); } public function chapterBody($file) { $filename = __DIR__ . "/fixtures/$file"; $text = file_get_contents($filename); $this->setFont('Times', '', 12); $this->multiCell(0, 5, $text); $this->newLine(); $this->setFont('', 'I'); $this->cell(0, 5, '(end of extract)'); } public function printChapter($num, $title, $file) { $this->addPage(); $this->chapterTitle($num, $title); $this->chapterBody($file); } }