diff --git a/.gitignore b/.gitignore index 19c190cc..1b46033d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,16 +1,16 @@ -#Eclipse +# Eclipse /.settings/ /.buildpath /.project -nbproject +/nbproject -#PHPStorm +# PHPStorm /.idea -#examples +# Examples /test/*.pdf -bin/ -vendor/ -composer.lock -composer.phar +# Composer +/bin/ +/vendor/ +/composer.lock diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..4f544d46 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,422 @@ +# Change Log + +All notable changes to this project will be documented in this file. + +## [Unreleased] + + * improve string handling for UTF8 + * PHP 5.4 compatibility + * Using Namespaces + * all the classes have moved + * all the classes have been renamed + * new tag structure : one class per tag + * better exception management + * add unit testing + * fix a infinite loop case when reading a svg path + * add support 'start' attribute for ordered list + +## [4.6.0] - 2016-03-30 + + * Support 'start' attribute for ordered list + * Enable RTL languages support + * Add a fallback support for images + +## [4.5.1] - 2016-03-03 + + * Support the "inherit" value for font-family + * Allow the HTML font tag to define a color attribute + * Support for max-width and max-height attributes for images + * Fix "border: 0" being displayed + +## [4.5.0] - 2015-12-18 + + * add tag 'end_last_page' with property 'end_height'. Update example 5 to use it + * better composer.json file + * update TCPDF from 5.0.002 to v6.2.12 => important changes. See the TCPDF changelogs + +## [4.4.0] - 2015-12-11 + + * includes a new attribute to page tag 'hideheader' which accepts a list of pages that gonna skip header. + * some doc fixes, rephrasing and removing french words + * add composer management + * Update autoload type + * README more readable + * add automatic generation of pdf test files + + * script ./test/generate.sh + * You must have the html2pdf folder in http:/localhost/html2pdf/ + + * fix: Set default font from PDF_FONT_NAME_MAIN constant from TCPDF, if available + * fix: Make space-collapsing regexp Unicode-aware + * fix: some pbs on examples to generate them automatically + +## [4.03] - 2011-05-27 + + * correction de l'exemple "form.php" : vulnérabilité cross-site scripting corrigée + * correction sur la gestion des retours à la ligne automatique + * correction sur le calcul de la hauteur des balises H1->H6 + * amélioration de la gestion des exceptions + +## [4.02] - 2011-04-29 + + * ATTENTION : beaucoup de changements dans la structure du projet. version 3.xx abandonnée + * uniformisation des fichiers du projet (standard Zend) + * conversion des fichiers de langue en CSV, déplacement dans le répertoire "locale". création d'une classe spécifique à la gestion des locales + * amélioration de la gestion de certaines erreurs + * modification du nom de toutes les sous classes + * déplacement de toutes les sous classes + * modification du nom de toutes les méthodes protected + * correction sur la gestion des tables + * correction sur la lecture des path des SVG + * premiere version de text-align:justify + * correction sur la gestion de la balise BLOCKQUOTE + * correction sur la gestion de la balise P + * gestion des styles CSS pour les balises TEXTAREA, SELECT, INPUT + * ajout de la propriété pagegroup="new" sur la balise PAGE + * correction pour la balise INPUT de type radio : checked au lieu de selected + +## [3.30 / 4.01] - 2010-05-07 + + * correction sur la gestion des textes + * correction sur le parseur HTML + * correction sur la gestion de border-collapse + * correction sur la gestion des TDs, H1->H6 + * ajout des balises fieldset et legend (cf exemple 4) + * ajout de la langue CS + * nombreuses améliorations + * v4.01 uniquement : Utilisation de TCPDF 5.0.002 + * v4.01 uniquement : Utilisation des QR-code de TCPDF, il n'y a plus besoin d'une librairie externe + * v4.01 uniquement : Utilisation des exceptions PHP pour les erreurs. Tous les exemples ont été mis à jour en consequence + * (merci à Pavel Kochman pour ses sugestions et ses ajouts) + +## [4.00] - 2010-03-17 + + * modification des barcodes. ATTENTION : bar_w et bar_h n'existent plus ! + * correction sur la gestion de page_footer + * correction sur la gestion des html entities + * correction sur le positionnement des textes + * correction sur le positionnement des tableaux + * nombreuses corrections sur les positionnements, les couleurs, ... + * amélioration de la partie SVG (balise G, ...) + * amélioration sur createIndex + * harmonisation des noms des méthodes + * correction sur la gestion des textes + * v4.00 uniquement : Html2Pdf est maintenant écrit en PHP5 et basé sur TCPDF (=> unicode, utf8, ...) + * v4.00 uniquement : utilisation de TCPDF pour les formulaires et les barcodes + * v4.00 uniquement : amélioration de la partie SVG (alpha) + +## [3.28] - 2010-01-18 + + * ajout de la gestion de la balise label + * correction pour compatibilité PHP4 + +## [3.27] - 2010-01-11 + + * correction sur page_header et page_footer + * ajout de la possibilité de pouvoir mettre l'index automatique dans la page que l'on veut + * correction sur la gestion du canal alpha pour les PNGs + * correction sur la gestion des border-radius (cf exemple radius) conforme au CSS3 + * correction sur la gestion du background-color + * correction sur la gestion de thead, tfoot, et tbody + * ajout du dessin verctoriel (cf exemples draw, tigre, sapin) + * ajout de la propriété label="none/label" pour la balise barcode + * nombreux petits correctifs + +## [3.26] - 2009-11-16 + + * correction pour support des images générés en CGI + * ajout de la gestion du canal alpha pour les PNGs (nécessite GD2) + * ajout de la méthode setDefaultFont permettant de spécifier une fonte par défaut + * ajout de la propriété format pour la balise page (cf exemple 4) + * amélioration de la gestion des couleurs css RGB (cf exemple 2) + * ajout de la gestion des couleurs css CMYK (cf exemple 2) + * ajout de la propriété css overflow:hidden pour la balise div (cf exemple 2) + * correction sur page_header et page_footer + * ajout de la possibilité de pouvoir directement convertir le résultat d'une vraie page HTML + * nombreux petits correctifs sur les styles + +## [3.25] - 2009-10-07 + + * correctif sur le calcul des tableaux dans le page_footer + * correctif sur l'interprétation des espaces entre certaines balises + * correction sur la gestion des balises H1, H2, H3, H4, H5, H6 + * correction sur la gestion de la balise table + * support des balises xhtml du type span + * ajout des balises COL (cf exemple 5), DEL, INS, et QRCODE (cf exemple 13) + * ajout de la propriété css text-transform + * ajout de la propriété css rotate (uniquement sur les DIV, cf exemple 8) + * ne plus rendre obligatoire l'existence d'une image (nouvelle méthode setTestIsImage) + * ajout d'un mode DEBUG - les anciennes fonction d'analyse des ressources ont été supprimées + * ajout de la méthode setEncoding + * ajout de la langue danoise DA (merci à Daniel K.) + +## [3.24] - 2009-08-05 + + * correction sur le calcul de la largeur des divs + * modification pour compatibilité avec la localisation PHP + * modification pour compatibilité avec PHP 5.3.0 + +## [3.23] - 2009-07-30 + + * correction sur le calcul des DIVs + * correction sur l'interpretation de certains styles CSS + * correction de la fonction de creation d'index automatique CreateIndex + * ATTENTION : la methode d'appel de CreateIndex a changé. Regardez l'exemple About !!!! + +## [3.22a (2009-06-16 + + * redistribution de Html2Pdf sous la licence LGPL !!! (au lieu de GPL) + +## [3.22] - 2009-06-08 + + * correction sur le background-color + * refonte totale de la gestion de text-align. les valeurs center et right marchent maintenant meme en cas de contenu riche + +## [3.21] - 2009-05-05 + + * ajout de la propriété css FLOAT pour la balise IMG + * correction sur la gestion des TFOOT + * correction sur le positionnement des images + +## [3.20] - 2009-04-06 + + * ajout de la gestion des margins pour la balise DIV + * ajout de la gestion de la propriete css LINE-HEIGHT + * correction sur l'interpretation de la valeur de certains styles CSS (background-image, background-position, ...) + * correction sur la reconnaissance des balises thead et tfoot + * correction sur la balise select + * correction sur les fichiers de langue (merci à Sinan) + +## [3.19] - 2009-03-11 + + * optimisation du parseur HTML - merci à Jezelinside + * ajout de la balise TFOOT + * amélioration de la gestion des tableaux : les contenus des balises THEAD et TFOOT sont maintenant répétés sur chaque page. + * ajout de la balise spécifique BOOKMARK afin de créer des "marques-page" + * possibilité de rajouter un index automatique en fin de fichier + * ajout de la langue turque TR (merci à Hidayet) + * amélioration de la méthode Output. Elle est maintenant également utilisable comme celle de FPDF + +## [3.18] - 2009-02-22 + + * correction sur les sauts de page automatique pour les balises TABLE, UL, OL + * correction sur l'interpretation des styles pour la balise HR + * correction sur l'interpretation du style border-collapse pour la balise TABLE + * prise en compte de margin:auto pour les tables et les divs + * les commentaires dans les CSS sont acceptés + +## [3.17] - 2008-12-30 + + * ajout de la gestion des balises INPUT (text, radio, checkbox, button, hidden, ...), SELECT, OPTION, TEXTAREA (cf exemple 14) + * ajout de la possibilité de mettre des scripts dans le pdf (cf exemples JS) + * correction sur le saut de page automatique pour les images + * correction sur les sauts de lignes automatiques pour certaines balises (UL, P, ...) + * ajout de la langue NL (merci à Roland) + +## [3.16] - 2008-12-09 + + * ajout de la gestion de list-style: none (cf exemple 13) + * correction dans la gestion des fontes ajoutées à fpdf (via la méthode AddFont) + * nombreuses corrections sur le calcul des largeurs des éléments table, div, hr, td, th + * ajout de l'exemple about.php + * (pour info, les PDF générés à partir des exemples sont maintenant dans le répertoire /exemples/pdf/, et sont supprimables) + +## [3.15] - 2008-12-01 + + * correction sur l'identification des styles en cas de valeurs multiples dans la propriete class + * prise en compte de border-radius pour la limite des backgrounds (color et image) + * ajout des proprietes CSS border-top-*, border-right-*, border-bottom-*, border-left-* + * ajout de la propriété CSS list-style-image (cf exemple 12) + * pour la balise table, ajout de l'interprétation de align="center" et align="right" (cf exemple 1) + * correction dans le positionnement des images + * correction de quelques bugs + * ajout d'une fonction d'analyse des ressources getTimerDebug (cf début du fichier html2pdf.class.php) + +## [3.14] - 2008-11-17 + + * ajout d'une langue (pt : Brazilian Portuguese language) et amelioration de la methode vueHTML (merci à Rodrigo) + * correction du positionnement du contenu des DIVs. gestion des proprietes valign et align + * ajout de la propriete CSS border-collapse (cf exemple 0) + * ajout de la propriete CSS border-radius (cf exemple 1) + * correction de quelques bugs + +## [3.13] - 2008-09-24 + + * reecriture de la balise hr, avec prise en compte des styles (cf exemple 0) + * ajout de la propriete backcolor pour la balise page (cf exemple 9) + * ajout des proprietes backleft et backright pour la balise page afin de pouvoir changer les marges des pages (cf exemple 8) + * nombreuses corrections sur les balises et les styles + +## [3.12] - 2008-09-16 + + * ajout des balises ol, ul, li (cf exemple 12) + * correction sur le calcul de la taille des td en cas de colspan et rowspan + * ajout de la méthode setTestTdInOnePage afin de pouvoir desactiver le test sur la taille des TD (cf exemple 11) + * correction de quelques bugs + +## [3.11] - 2008-08-29 + + * ajout des balises div, p, pre, s + * gestion des styles CSS position (relative, absolute), left, top, right, bottom (cf exemple 10) + * meilleur gestion des border : border-style, border-color, border-width (cf exemple 10) + * possibilité d'indiquer les marges par défault, via le constructeur (cf exemple 2) + +## [3.10a] - 2008-08-26 + + * correction pour compatibilité php4 / php5 + +## [3.10] - 2008-08-25 + + * ajout des liens internes (cf exemple 7) + * gestion complete des background : image, repeat, position, color (cf exemple 1) + * gestion de underline, overline, linethrough (cf exemple 2) + * correction de quelques bugs + +## [3.09] + + * mise à jour vers fpdf version 1.6, ajout de barcode, correction de l'affichage de certains caractères spéciaux + * correction du calcul de la hauteur de ligne de la balise br + * detection en cas de contenu trop grand dans un TD + * amélioration de la balise page (ajout de l'attribue pageset, avec les valeurs new et old) + * ajout de FPDF_PROTECTION, accesible via $pdf->pdf->SetProtection(...) + +## [3.08] + + * version opérationnelle de page_header + * ajout de page_footer + * correction des borders des tableaux + +## [3.07] + + * correction de l'interpretation de cellspacing, + * amélioration de la balise page_header + +## [3.06] + + * première gestion de la balise page_header + * correction des dimensions des tableaux + +## [3.05] + + * ajout de la propriété vertical-align + * ajout de la gestion des fichiers de langue + +## [3.04] + + * correction du saut de page automatique pour les tableaux + * Ajout de propriétés à la balise PAGE + +## [3.03] + + * correction de bugs au niveau de la gestion des images PHP par FPDF + * meilleure gestion des erreurs + +## [3.02] + + * ajout de la gestion des noms des couleurs + * correction de la gestion des images générées par php + * correction de quelques bugs + +## [3.01] + + * correction de quelques bugs + * ajout d'une protection pour les balises non existantes + +## [3.00] + + * refonte totale du calcul des tableaux + * Prise en compte des colspan et rowspan + * +## [2.85] + + * ajout de la propriété cellspacing + * nouvelle gestion des padding des tableaux + +## [2.80] + + * ajout des types de border dotted et dasheds + +## [2.75] + + * ajout des top, left, right, bottom pour padding et border + +## [2.70] + + * correction de la balise HR, ajout de la propriété padding pour les table, th, td + * correction des dimensions, les unités px, mm, in, pt sont enfin réellement reproduites, correction de font-size, border, ... + * ajout d'une propriété à la balise page : footer + * correction dans l'affichage et le calcul des tables + +## [2.55] + + * vérification de la validité du code (ouverture / fermeture) + * ajout des unités mm, in, pt + +## [2.50] + + * correction de nobreak + * correction des marges + * ajout de nombreuses balises + +## [2.40] + + * refonte totale de l'identification des styles CSS (Les héritages marchent) + +## [2.39] + + * corrections diverses + * ajout de certaines propriétés (bgcolor, ...) + +## [2.38] + + * meilleur identification des propriétés border et color + +## [2.37] + + * nombreuses corrections : + + * balise A + * couleur de fond + * retour à la ligne + * gestion des images dans un texte + +## [2.36] + + * ajout de la balises STRONG + * ajout de la balise EM + +## [2.35] + + * amélioration de la gestion des feuilles de style + +## [2.31] + + * correction de quelques bugs + +## [2.30] + + * première version opérationnel des feuilles de style + +## [2.25] + + * ajout de la balise LINK pour le type text/css + +## [2.20] + + * premier jet de la gestion des feuilles de style, ajout de la balise STYLE + +## [2.15] + + * n'interpréte plus l'HTML en commentaire + +## [2.10] + + * ajout des balises H1 -> H6 + +## [2.01] + + * correction de quelques bugs + +## [2.00] + + * première version diffusée diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 755013bb..00000000 --- a/LICENSE +++ /dev/null @@ -1,165 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - - This version of the GNU Lesser General Public License incorporates -the terms and conditions of version 3 of the GNU General Public -License, supplemented by the additional permissions listed below. - - 0. Additional Definitions. - - As used herein, "this License" refers to version 3 of the GNU Lesser -General Public License, and the "GNU GPL" refers to version 3 of the GNU -General Public License. - - "The Library" refers to a covered work governed by this License, -other than an Application or a Combined Work as defined below. - - An "Application" is any work that makes use of an interface provided -by the Library, but which is not otherwise based on the Library. -Defining a subclass of a class defined by the Library is deemed a mode -of using an interface provided by the Library. - - A "Combined Work" is a work produced by combining or linking an -Application with the Library. The particular version of the Library -with which the Combined Work was made is also called the "Linked -Version". - - The "Minimal Corresponding Source" for a Combined Work means the -Corresponding Source for the Combined Work, excluding any source code -for portions of the Combined Work that, considered in isolation, are -based on the Application, and not on the Linked Version. - - The "Corresponding Application Code" for a Combined Work means the -object code and/or source code for the Application, including any data -and utility programs needed for reproducing the Combined Work from the -Application, but excluding the System Libraries of the Combined Work. - - 1. Exception to Section 3 of the GNU GPL. - - You may convey a covered work under sections 3 and 4 of this License -without being bound by section 3 of the GNU GPL. - - 2. Conveying Modified Versions. - - If you modify a copy of the Library, and, in your modifications, a -facility refers to a function or data to be supplied by an Application -that uses the facility (other than as an argument passed when the -facility is invoked), then you may convey a copy of the modified -version: - - a) under this License, provided that you make a good faith effort to - ensure that, in the event an Application does not supply the - function or data, the facility still operates, and performs - whatever part of its purpose remains meaningful, or - - b) under the GNU GPL, with none of the additional permissions of - this License applicable to that copy. - - 3. Object Code Incorporating Material from Library Header Files. - - The object code form of an Application may incorporate material from -a header file that is part of the Library. You may convey such object -code under terms of your choice, provided that, if the incorporated -material is not limited to numerical parameters, data structure -layouts and accessors, or small macros, inline functions and templates -(ten or fewer lines in length), you do both of the following: - - a) Give prominent notice with each copy of the object code that the - Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the object code with a copy of the GNU GPL and this license - document. - - 4. Combined Works. - - You may convey a Combined Work under terms of your choice that, -taken together, effectively do not restrict modification of the -portions of the Library contained in the Combined Work and reverse -engineering for debugging such modifications, if you also do each of -the following: - - a) Give prominent notice with each copy of the Combined Work that - the Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the Combined Work with a copy of the GNU GPL and this license - document. - - c) For a Combined Work that displays copyright notices during - execution, include the copyright notice for the Library among - these notices, as well as a reference directing the user to the - copies of the GNU GPL and this license document. - - d) Do one of the following: - - 0) Convey the Minimal Corresponding Source under the terms of this - License, and the Corresponding Application Code in a form - suitable for, and under terms that permit, the user to - recombine or relink the Application with a modified version of - the Linked Version to produce a modified Combined Work, in the - manner specified by section 6 of the GNU GPL for conveying - Corresponding Source. - - 1) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (a) uses at run time - a copy of the Library already present on the user's computer - system, and (b) will operate properly with a modified version - of the Library that is interface-compatible with the Linked - Version. - - e) Provide Installation Information, but only if you would otherwise - be required to provide such information under section 6 of the - GNU GPL, and only to the extent that such information is - necessary to install and execute a modified version of the - Combined Work produced by recombining or relinking the - Application with a modified version of the Linked Version. (If - you use option 4d0, the Installation Information must accompany - the Minimal Corresponding Source and Corresponding Application - Code. If you use option 4d1, you must provide the Installation - Information in the manner specified by section 6 of the GNU GPL - for conveying Corresponding Source.) - - 5. Combined Libraries. - - 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 that are not Applications and are not covered by this -License, and convey such a combined library under terms of your -choice, if you do both of the following: - - a) Accompany the combined library with a copy of the same work based - on the Library, uncombined with any other library facilities, - conveyed under the terms of this License. - - b) Give prominent notice with the combined library that part of it - is a work based on the Library, and explaining where to find the - accompanying uncombined form of the same work. - - 6. Revised Versions of the GNU Lesser General Public License. - - The Free Software Foundation may publish revised and/or new versions -of the GNU 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 as you received it specifies that a certain numbered version -of the GNU Lesser General Public License "or any later version" -applies to it, you have the option of following the terms and -conditions either of that published version or of any later version -published by the Free Software Foundation. If the Library as you -received it does not specify a version number of the GNU Lesser -General Public License, you may choose any version of the GNU Lesser -General Public License ever published by the Free Software Foundation. - - If the Library as you received it specifies that a proxy can decide -whether future versions of the GNU Lesser General Public License shall -apply, that proxy's public statement of acceptance of any version is -permanent authorization for you to choose that version for the -Library. diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 00000000..9934ef28 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,54 @@ +Open Software License v. 3.0 (OSL-3.0) +====================================== + +This Open Software License (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following licensing notice adjacent to the copyright notice for the Original Work: + +Licensed under the Open Software License version 3.0 + +1. **Grant of Copyright License.** Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, for the duration of the copyright, to do the following: + + 1. to reproduce the Original Work in copies, either alone or as part of a collective work; + + 2. to translate, adapt, alter, transform, modify, or arrange the Original Work, thereby creating derivative works ("Derivative Works") based upon the Original Work; + + 3. to distribute or communicate copies of the Original Work and Derivative Works to the public, with the proviso that copies of Original Work or Derivative Works that You distribute or communicate shall be licensed under this Open Software License; + + 4. to perform the Original Work publicly; and + + 5. to display the Original Work publicly. + +2. **Grant** of Patent License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, under patent claims owned or controlled by the Licensor that are embodied in the Original Work as furnished by the Licensor, for the duration of the patents, to make, use, sell, offer for sale, have made, and import the Original Work and Derivative Works. + +3. **Grant** of Source Code License. The term "Source Code" means the preferred form of the Original Work for making modifications to it and all available documentation describing how to modify the Original Work. Licensor agrees to provide a machine-readable copy of the Source Code of the Original Work along with each copy of the Original Work that Licensor distributes. Licensor reserves the right to satisfy this obligation by placing a machine-readable copy of the Source Code in an information repository reasonably calculated to permit inexpensive and convenient access by You for as long as Licensor continues to distribute the Original Work. + +4. **Exclusions From License Grant.** Neither the names of Licensor, nor the names of any contributors to the Original Work, nor any of their trademarks or service marks, may be used to endorse or promote products derived from this Original Work without express prior permission of the Licensor. Except as expressly stated herein, nothing in this License grants any license to Licensor's trademarks, copyrights, patents, trade secrets or any other intellectual property. No patent license is granted to make, use, sell, offer for sale, have made, or import embodiments of any patent claims other than the licensed claims defined in Section 2. No license is granted to the trademarks of Licensor even if such marks are included in the Original Work. Nothing in this License shall be interpreted to prohibit Licensor from licensing under terms different from this License any Original Work that Licensor otherwise would have a right to license. + +5. **External Deployment.** The term "External Deployment" means the use, distribution, or communication of the Original Work or Derivative Works in any way such that the Original Work or Derivative Works may be used by anyone other than You, whether those works are distributed or communicated to those persons or made available as an application intended for use over a network. As an express condition for the grants of license hereunder, You must treat any External Deployment by You of the Original Work or a Derivative Work as a distribution under section 1(c). + +6. **Attribution Rights.** You must retain, in the Source Code of any Derivative Works that You create, all copyright, patent, or trademark notices from the Source Code of the Original Work, as well as any notices of licensing and any descriptive text identified therein as an "Attribution Notice." You must cause the Source Code for any Derivative Works that You create to carry a prominent Attribution Notice reasonably calculated to inform recipients that You have modified the Original Work. + +7. **Warranty of Provenance and Disclaimer of Warranty.** Licensor warrants that the copyright in and to the Original Work and the patent rights granted herein by Licensor are owned by the Licensor or are sublicensed to You under the terms of this License with the permission of the contributor(s) of those copyrights and patent rights. Except as expressly stated in the immediately preceding sentence, the Original Work is provided under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without limitation, the warranties of non-infringement, merchantability or fitness for a particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No license to the Original Work is granted by this License except under this disclaimer. + +8. **Limitation of Liability.** Under no circumstances and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall the Licensor be liable to anyone for any indirect, special, incidental, or consequential damages of any character arising as a result of this License or the use of the Original Work including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses. This limitation of liability shall not apply to the extent applicable law prohibits such limitation. + +9. **Acceptance and Termination.** If, at any time, You expressly assented to this License, that assent indicates your clear and irrevocable acceptance of this License and all of its terms and conditions. If You distribute or communicate copies of the Original Work or a Derivative Work, You must make a reasonable effort under the circumstances to obtain the express assent of recipients to the terms of this License. This License conditions your rights to undertake the activities listed in Section 1, including your right to create Derivative Works based upon the Original Work, and doing so without honoring these terms and conditions is prohibited by copyright law and international treaty. Nothing in this License is intended to affect copyright exceptions and limitations (including "fair use" or "fair dealing"). This License shall terminate immediately and You may no longer exercise any of the rights granted to You by this License upon your failure to honor the conditions in Section 1(c). + +10. **Termination for Patent Action.** This License shall terminate automatically and You may no longer exercise any of the rights granted to You by this License as of the date You commence an action, including a cross-claim or counterclaim, against Licensor or any licensee alleging that the Original Work infringes a patent. This termination provision shall not apply for an action alleging patent infringement by combinations of the Original Work with other software or hardware. + +11. **Jurisdiction, Venue and Governing Law.** Any action or suit relating to this License may be brought only in the courts of a jurisdiction wherein the Licensor resides or in which Licensor conducts its primary business, and under the laws of that jurisdiction excluding its conflict-of-law provisions. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any use of the Original Work outside the scope of this License or after its termination shall be subject to the requirements and penalties of copyright or patent law in the appropriate jurisdiction. This section shall survive the termination of this License. + +12. **Attorneys' Fees.** In any action to enforce the terms of this License or seeking damages relating thereto, the prevailing party shall be entitled to recover its costs and expenses, including, without limitation, reasonable attorneys' fees and costs incurred in connection with such action, including any appeal of such action. This section shall survive the termination of this License. + +13. **Miscellaneous.** If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. + +14. **Definition of "You" in This License.** "You" throughout this License, whether in upper or lower case, means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with you. For purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +15. **Right to Use.** You may use the Original Work in all ways not otherwise restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You. + +16. **Modification of This License.** This License is Copyright © 2005 Lawrence Rosen. Permission is granted to copy, distribute, or communicate this License without modification. Nothing in this License permits You to modify this License as applied to the Original Work or to Derivative Works. However, You may modify the text of this License and copy, distribute or communicate your modified version (the "Modified License") and apply it to other original works of authorship subject to the following conditions: + + 1. You may not indicate in any way that your Modified License is the "Open Software License" or "OSL" and you may not use those names in the name of your Modified License; + + 2. You must replace the notice specified in the first paragraph above with the notice "Licensed under " or with a notice of your own that is not confusingly similar to the notice in this License; + + 3. You may not claim that your original works are open source software unless your Modified License has been approved by Open Source Initiative (OSI) and You comply with its license review and certification process. \ No newline at end of file diff --git a/README.md b/README.md index 27a2823d..0fc891b4 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,6 @@ -Html2Pdf -======== +# Html2Pdf -Latest stable release : v4.6.0 (2016-03-30) - -How to use: ------------ +## How to use: ### Requirements @@ -12,13 +8,13 @@ HTML2PDF works with PHP 5.3.2 and above. ### Installation -This package can be installed in your project through composer. +This package **must** be installed in your project through composer. ``` composer require spipu/html2pdf ``` -If you wish to try html2pdf outside a main project, you can just clone the project and run composer: +If you want to try html2pdf outside a main project, you can just clone the project and run composer: ``` git clone https://github.com/spipu/html2pdf.git @@ -86,39 +82,18 @@ It is activated by adding the following command just after the contructor (see E * Values : 0, 90, 180, 270 * Works only on div (cf example 8) -Change log: ------------ +## Change log -See on this page: http://html2pdf.fr/en/download +See the [./CHANGELOG.md](./CHANGELOG.md) file -Help & Support: ---------------- +## Help & Support For questions and bug reports, please use the GitHub issues page. -You may also find some help of the official forum (link below). - -Information: ------------- -* Programmer: Spipu -* Web Site : http://html2pdf.fr/ -* Wiki : http://html2pdf.fr/en/wiki -* Support : http://html2pdf.fr/en/forum +## License -License: --------- -``` - This program is distributed under the LGPL License, - for more information see the LICENSE file or go to - http://www.gnu.org/licenses/lgpl.html - - Copyright 2008-2016 by Laurent Minguet -``` +See the [./LICENCE.md](./LICENCE.md) file -Thanks: -------- +This program is distributed under the OSL License. For more information see the LICENSE.md file - * Olivier Plathey: for have made FPDF - * Nicola Asuni: for the changes he has agreed to make to TCPDF - * yAronet: for hosting support forum - * Everyone who helped me to develop this library and to bring the texts +Copyright 2008-2017 by Laurent Minguet diff --git a/_changelog.txt b/_changelog.txt deleted file mode 100644 index 7fe9749d..00000000 --- a/_changelog.txt +++ /dev/null @@ -1,355 +0,0 @@ -@todo : - improve string handling for UTF8 - PHP 5.4 compatibility - Using Namespaces - all the classes have moved - all the classes have been renamed - new tag structure : one class per tag - better exception management - add unit testing - fix a infinite loop case when reading a svg path - add support 'start' attribute for ordered list - -4.6.0 (2016-03-30) - Support 'start' attribute for ordered list - Enable RTL languages support - Add a fallback support for images - -4.5.1 (2016-03-03) - Support the "inherit" value for font-family - Allow the HTML font tag to define a color attribute - Support for max-width and max-height attributes for images - Fix "border: 0" being displayed - -4.5.0 (2015-12-18) - add tag 'end_last_page' with property 'end_height'. Update example 5 to use it - better composer.json file - update TCPDF from 5.0.002 to v6.2.12 => important changes. See the TCPDF changelogs - -4.4.0 (2015-12-11) - includes a new attribute to page tag 'hideheader' which accepts a list of pages that gonna skip header. - some doc fixes, rephrasing and removing french words - add composer management - Update autoload type - README more readable - add automatic generation of pdf test files - script ./test/generate.sh - You must have the html2pdf folder in http:/localhost/html2pdf/ - fix: Set default font from PDF_FONT_NAME_MAIN constant from TCPDF, if available - fix: Make space-collapsing regexp Unicode-aware - fix: some pbs on examples to generate them automatically - -4.03 (2011-05-27) - correction de l'exemple "form.php" : vulnérabilité cross-site scripting corrigée - correction sur la gestion des retours à la ligne automatique - correction sur le calcul de la hauteur des balises H1->H6 - amélioration de la gestion des exceptions - -4.02 (2011-04-29) - ATTENTION : beaucoup de changements dans la structure du projet. version 3.xx abandonnée - uniformisation des fichiers du projet (standard Zend) - conversion des fichiers de langue en CSV, déplacement dans le répertoire "locale". création d'une classe spécifique à la gestion des locales - amélioration de la gestion de certaines erreurs - modification du nom de toutes les sous classes - déplacement de toutes les sous classes - modification du nom de toutes les méthodes protected - correction sur la gestion des tables - correction sur la lecture des path des SVG - premiere version de text-align:justify - correction sur la gestion de la balise BLOCKQUOTE - correction sur la gestion de la balise P - gestion des styles CSS pour les balises TEXTAREA, SELECT, INPUT - ajout de la propriété pagegroup="new" sur la balise PAGE - correction pour la balise INPUT de type radio : checked au lieu de selected - -3.30 / 4.01 (2010-05-07) - correction sur la gestion des textes - correction sur le parseur HTML - correction sur la gestion de border-collapse - correction sur la gestion des TDs, H1->H6 - ajout des balises fieldset et legend (cf exemple 4) - ajout de la langue CS - nombreuses améliorations - v4.01 uniquement : Utilisation de TCPDF 5.0.002 - v4.01 uniquement : Utilisation des QR-code de TCPDF, il n'y a plus besoin d'une librairie externe - v4.01 uniquement : Utilisation des exceptions PHP pour les erreurs. Tous les exemples ont été mis à jour en consequence - (merci à Pavel Kochman pour ses sugestions et ses ajouts) - -3.29 / 4.00 (2010-03-17) - modification des barcodes. ATTENTION : bar_w et bar_h n'existent plus ! - correction sur la gestion de page_footer - correction sur la gestion des html entities - correction sur le positionnement des textes - correction sur le positionnement des tableaux - nombreuses corrections sur les positionnements, les couleurs, ... - amélioration de la partie SVG (balise G, ...) - amélioration sur createIndex - harmonisation des noms des méthodes - correction sur la gestion des textes - v4.00 uniquement : Html2Pdf est maintenant écrit en PHP5 et basé sur TCPDF (=> unicode, utf8, ...) - v4.00 uniquement : utilisation de TCPDF pour les formulaires et les barcodes - v4.00 uniquement : amélioration de la partie SVG (alpha) - -3.28 (2010-01-18) - ajout de la gestion de la balise label - correction pour compatibilité PHP4 - -3.27 (2010-01-11) - correction sur page_header et page_footer - ajout de la possibilité de pouvoir mettre l'index automatique dans la page que l'on veut - correction sur la gestion du canal alpha pour les PNGs - correction sur la gestion des border-radius (cf exemple radius) conforme au CSS3 - correction sur la gestion du background-color - correction sur la gestion de thead, tfoot, et tbody - ajout du dessin verctoriel (cf exemples draw, tigre, sapin) - ajout de la propriété label="none/label" pour la balise - nombreux petits correctifs - -3.26 (2009-11-16) - correction pour support des images générés en CGI - ajout de la gestion du canal alpha pour les PNGs (nécessite GD2) - ajout de la méthode setDefaultFont permettant de spécifier une fonte par défaut - ajout de la propriété format pour la balise (cf exemple 4) - amélioration de la gestion des couleurs css RGB (cf exemple 2) - ajout de la gestion des couleurs css CMYK (cf exemple 2) - ajout de la propriété css overflow:hidden pour la balise
(cf exemple 2) - correction sur page_header et page_footer - ajout de la possibilité de pouvoir directement convertir le résultat d'une vraie page HTML - nombreux petits correctifs sur les styles - -3.25 (2009-10-07) - correctif sur le calcul des tableaux dans le page_footer - correctif sur l'interprétation des espaces entre certaines balises - correction sur la gestion des balises H1, H2, H3, H4, H5, H6 - correction sur la gestion de la balise table - support des balises xhtml du type - ajout des balises COL (cf exemple 5), DEL, INS, et QRCODE (cf exemple 13) - ajout de la propriété css text-transform - ajout de la propriété css rotate (uniquement sur les DIV, cf exemple 8) - ne plus rendre obligatoire l'existence d'une image (nouvelle méthode setTestIsImage) - ajout d'un mode DEBUG - les anciennes fonction d'analyse des ressources ont été supprimées - ajout de la méthode setEncoding - ajout de la langue danoise DA (merci à Daniel K.) - -3.24 (2009-08-05) - correction sur le calcul de la largeur des divs - modification pour compatibilité avec la localisation PHP - modification pour compatibilité avec PHP 5.3.0 - -3.23 (2009-07-30) - correction sur le calcul des DIVs - correction sur l'interpretation de certains styles CSS - correction de la fonction de creation d'index automatique CreateIndex - ATTENTION : la methode d'appel de CreateIndex a changé. Regardez l'exemple About !!!! - -3.22a (2009-06-16) - redistribution de Html2Pdf sous la licence LGPL !!! (au lieu de GPL) - -3.22 (2009-06-08) - correction sur le background-color - refonte totale de la gestion de text-align. les valeurs center et right marchent maintenant meme en cas de contenu riche - -3.21 (2009-05-05) - ajout de la propriété css FLOAT pour la balise IMG - correction sur la gestion des TFOOT - correction sur le positionnement des images - -3.20 (2009-04-06) - ajout de la gestion des margins pour la balise DIV - ajout de la gestion de la propriete css LINE-HEIGHT - correction sur l'interpretation de la valeur de certains styles CSS (background-image, background-position, ...) - correction sur la reconnaissance des balises thead et tfoot - correction sur la balise select - correction sur les fichiers de langue (merci à Sinan) - -3.19 (2009-03-11) - optimisation du parseur HTML - merci à Jezelinside - ajout de la balise TFOOT - amélioration de la gestion des tableaux : les contenus des balises THEAD et TFOOT sont maintenant répétés sur chaque page. - ajout de la balise spécifique BOOKMARK afin de créer des "marques-page" - possibilité de rajouter un index automatique en fin de fichier - ajout de la langue turque TR (merci à Hidayet) - amélioration de la méthode Output. Elle est maintenant également utilisable comme celle de FPDF - -3.18 (2009-02-22) - correction sur les sauts de page automatique pour les balises TABLE, UL, OL - correction sur l'interpretation des styles pour la balise HR - correction sur l'interpretation du style border-collapse pour la balise TABLE - prise en compte de margin:auto pour les tables et les divs - les commentaires dans les CSS sont acceptés - -3.17 (2008-12-30) - ajout de la gestion des balises INPUT (text, radio, checkbox, button, hidden, ...), SELECT, OPTION, TEXTAREA (cf exemple 14) - ajout de la possibilité de mettre des scripts dans le pdf, via $html2pdf->pdf->IncludeJS(...); (cf exemples JS) - correction sur le saut de page automatique pour les images - correction sur les sauts de lignes automatiques pour certaines balises (UL, P, ...) - ajout de la langue NL (merci à Roland) - -3.16 (2008-12-09) - ajout de la gestion de list-style: none (cf exemple 13) - correction dans la gestion des fontes ajoutées à fpdf (via la méthode AddFont) - nombreuses corrections sur le calcul des largeurs des éléments table, div, hr, td, th - ajout de l'exemple about.php - (pour info, les PDF générés à partir des exemples sont maintenant dans le répertoire /exemples/pdf/, et sont supprimables) - -3.15 (2008-12-01) - correction sur l'identification des styles en cas de valeurs multiples dans la propriete class - prise en compte de border-radius pour la limite des backgrounds (color et image) - ajout des proprietes CSS border-top-*, border-right-*, border-bottom-*, border-left-* - ajout de la propriété CSS list-style-image (cf exemple 12) - pour la balise table, ajout de l'interprétation de align="center" et align="right" (cf exemple 1) - correction dans le positionnement des images - correction de quelques bugs - ajout d'une fonction d'analyse des ressources getTimerDebug (cf début du fichier html2pdf.class.php) - -3.14 (2008-11-17) - ajout d'une langue (pt : Brazilian Portuguese language) et amelioration de la methode vueHTML (merci à Rodrigo) - correction du positionnement du contenu des DIVs. gestion des proprietes valign et align - ajout de la propriete CSS border-collapse (cf exemple 0) - ajout de la propriete CSS border-radius (cf exemple 1) - correction de quelques bugs - -3.13 (2008-09-24) - reecriture de la balise hr, avec prise en compte des styles (cf exemple 0) - ajout de la propriete backcolor pour la balise page (cf exemple 9) - ajout des proprietes backleft et backright pour la balise page afin de pouvoir changer les marges des pages (cf exemple 8) - nombreuses corrections sur les balises et les styles - -3.12 (2008-09-16) - ajout des balises ol, ul, li (cf exemple 12) - correction sur le calcul de la taille des td en cas de colspan et rowspan - ajout de la méthode setTestTdInOnePage afin de pouvoir desactiver le test sur la taille des TD (cf exemple 11) - correction de quelques bugs - -3.11 (2008-08-29) - ajout des balises div, p, pre, s - gestion des styles CSS position (relative, absolute), left, top, right, bottom (cf exemple 10) - meilleur gestion des border : border-style, border-color, border-width (cf exemple 10) - possibilité d'indiquer les marges par défault, via le constructeur (cf exemple 2) - -3.10a (2008-08-26) - correction pour compatibilité php4 / php5 - -3.10 (2008-08-25) - ajout des liens internes (cf exemple 7) - gestion complete des background : image, repeat, position, color (cf exemple 1) - gestion de underline, overline, linethrough (cf exemple 2) - correction de quelques bugs - -3.09 - mise à jour vers fpdf version 1.6, ajout de barcode, correction de l'affichage de certains caractères spéciaux - correction du calcul de la hauteur de ligne de la balise br - detection en cas de contenu trop grand dans un TD - amélioration de la balise page (ajout de l'attribue pageset, avec les valeurs new et old) - ajout de FPDF_PROTECTION, accesible via $pdf->pdf->SetProtection(...) - -3.08 - version opérationnelle de page_header - ajout de page_footer - correction des borders des tableaux - -3.07 - correction de l'interpretation de cellspacing, - amélioration de la balise page_header - -3.06 - première gestion de la balise page_header - correction des dimensions des tableaux - -3.05 - ajout de la propriété vertical-align - ajout de la gestion des fichiers de langue - -3.04 - correction du saut de page automatique pour les tableaux - Ajout de propriétés à la balise PAGE - -3.03 - correction de bugs au niveau de la gestion des images PHP par FPDF - meilleure gestion des erreurs - -3.02 - ajout de la gestion des noms des couleurs - correction de la gestion des images générées par php - correction de quelques bugs - -3.01 - correction de quelques bugs - ajout d'une protection pour les balises non existantes - -3.00 - refonte totale du calcul des tableaux - Prise en compte des colspan et rowspan - -2.85 - ajout de la propriété cellspacing - nouvelle gestion des padding des tableaux - -2.80 - ajout des types de border dotted et dasheds - -2.75 - ajout des top, left, right, bottom pour padding et border - -2.70 - correction de la balise HR, ajout de la propriété padding pour les table, th, td - correction des dimensions, les unités px, mm, in, pt sont enfin réellement reproduites, correction de font-size, border, ... - ajout d'une propriété à la balise page : footer - correction dans l'affichage et le calcul des tables - -2.55 - vérification de la validité du code (ouverture / fermeture) - ajout des unités mm, in, pt - -2.50 - correction de nobreak - correction des marges - ajout de nombreuses balises - -2.40 - refonte totale de l'identification des styles CSS (Les héritages marchent) - -2.39 - corrections diverses - ajout de certaines propriétés (bgcolor, ...) - -2.38 - meilleur identification des propriétés border et color - -2.37 - nombreuses corrections : - balise A - couleur de fond - retour à la ligne - gestion des images dans un texte - -2.36 - ajout de la balises STRONG - ajout de la balise EM - -2.35 - amélioration de la gestion des feuilles de style - -2.31 - correction de quelques bugs - -2.30 - première version opérationnel des feuilles de style - -2.25 - ajout de la balise LINK pour le type text/css - -2.20 - premier jet de la gestion des feuilles de style, ajout de la balise STYLE - -2.15 - n'interpréte plus l'HTML en commentaire - -2.10 - ajout des balises H1 -> H6 - -2.01 - correction de quelques bugs - -2.00 - première version diffusée