Initial commit

This commit is contained in:
2022-11-21 09:47:28 +01:00
commit 76cec83d26
11652 changed files with 1980467 additions and 0 deletions

19
html2pdf-master/.gitignore vendored Normal file
View File

@ -0,0 +1,19 @@
# Eclipse
/.settings/
/.buildpath
/.project
/nbproject
# PHPStorm
/.idea
# Examples
/test/*.pdf
# PhpUnit
/build/
# Composer
/bin/
/vendor/
/composer.lock

View File

@ -0,0 +1,13 @@
language: php
php:
- 5.6
- 7.0
- 7.1
- 7.2
- 7.3
- 7.4
before_script:
- composer selfupdate
- composer install --dev --prefer-dist

View File

@ -0,0 +1,516 @@
# Change Log
All notable changes to this project will be documented in this file.
## [5.2.3](https://github.com/spipu/html2pdf/compare/v5.2.2...master) - unreleased
* fix issue on write2DBarcode parameters - thanks to @Sarigue
## [5.2.2](https://github.com/spipu/html2pdf/compare/v5.2.1...v5.2.2) - 2020-03-22
* allow usage of [[page_cu]] in css class names - thanks to @marbetschar - see example 15
* add support for BASE64 encoded images - thanks to @darius-heavy
* add Chinese local file - thanks to @Jaggle
* add powershell test script
* bump supported version from 5.4-7.2 to 5.6-7.4 - thanks to @coffeemedia
* fix issue on \_drawRectangle where array offset was being accessed on value of type null - thanks to @coffeemedia
* fix issue on lower-roman style - thanks to @jigneshsolanki
* fix issue on composer autoload warning - thanks to @adrienfr
## [5.2.1](https://github.com/spipu/html2pdf/compare/v5.2.0...v5.2.1) - 2018-10-26
* add `cert` tag - thanks to @LittleBigFox
* add `balloon` example - issue #385
* change the name of all the examples from `exemple` to `example`
* fix tag parser - css style corruption
* fix issue on relative margin calculation
* fix issue on border radius calculation
* fix issue on page background image width - issue #394
* fix issue on qrcode value with multi lines - issue #390
* fix issue on colspan usage when all the columns don't really exist - issue #360
* fix documentation - thanks to @noxlux and @tpohchai
## [5.2.0](https://github.com/spipu/html2pdf/compare/v5.1.0...v5.2.0) - 2018-07-31
* change the name of `CoreExtension` to `Core\HtmlExtension`
* change the namespace of all the html tags from `Tag\` to `Tag\Html`
* change all the svg tag from internal methods to new external tags
* add the extension `Core\SvgExtension`
* add locale fi - thanks to @RWAP
* add `$marginTop` parameter on the `createIndex` method - issue #333
* add `xx-large` to `xx-small` font-size management - issue #320
* add `colgoup` html tag - issue #306
* fix locale pt - thanks to @marcoshenzel
* fix issue on testing the filename when asking for string output
* fix issue - clean locale before PDF generation - thanks to @quimcalpe
* fix issue on radio/checkbow width - thanks to @Ohda
* fix issue on line number when using style tag - issue #338
* fix issue on svg draw path - relative move was not implemented
* fix issue on svg draw path when Z directive is not separate from the next directive - issue #308
* fix issue on justify text with an inline html tag at the end of a line - issue #258
* fix better doc
## [5.1.0](https://github.com/spipu/html2pdf/compare/v5.0.1...v5.1.0) - 2018-01-23
* add support of css `page-break-before:always` and `page-break-after:always` on `DIV` tag, based on PR #190 and PR #204
* add no-html mode for debug output
* add php 7.2 compatibility
* add some unit tests, better coverage
* fix lots of bad method names and minor improvements, from PR #147
* fix bad cleaning after output or exception
* fix bad format detecting on `page` tag - issue #260
* fix changelog file
## [5.0.1](https://github.com/spipu/html2pdf/compare/v5.0.0...v5.0.1) - 2017-06-15
* fix issue #200 pb with absolute path when saving the pdf file on server
## [5.0.0](https://github.com/spipu/html2pdf/compare/v4.6.1...v5.0.0) - 2017-06-15
**BREAK COMPATIBILITY**
This new version is not compatible with the 4.x.x version.
Lots of classes / methods have been renamed, moved, deleted, exploded.
* change licence to OSL-3.0
* change PHP minimum compatibility to 5.4
* change Using Namespaces
* change all the classes have moved
* change all the classes have been renamed
* change new tag structure : one class per tag
* change output method does not allow bool value on `$dest` parameter anymore
* change output method has been renamed from `Output` to `output`
* change values for the footer`attribute` of the `page` tag
* add PHP 7.0 and 7.1 compatibility
* add improve string handling for UTF8
* add better exception management
* add unit testing
* add support 'start' attribute for ordered list
* add russian language https://github.com/spipu/html2pdf/pull/131
* add Dimension-Parameter on barcode (for PDF417, Datamatrix = 2D) https://github.com/spipu/html2pdf/pull/127
* add `pdfa` parameter on Html2Pdf constructor https://github.com/spipu/html2pdf/pull/122
* add new documentation folder `./doc/`
* add new attribute to page tag `hidefooter` which accepts a list of pages that gonna skip footer https://github.com/spipu/html2pdf/issues/162
* add protection on the fallback image if it does not exist
* add protection on thead and tfoot tags: they must contain at least one tr tag
* add norwegian locale
* fix a infinite loop case when reading a svg path
* fix issue from https://github.com/spipu/html2pdf/pull/177
* fix issue from https://github.com/spipu/html2pdf/pull/163
* fix bug on div position https://github.com/spipu/html2pdf/issues/73
* fix margin-bottom on table https://github.com/spipu/html2pdf/issues/108
* fix position of fallback image
* fix li bullet points altered by uppercase styles
* fix save PDF file on server https://github.com/spipu/html2pdf/issues/164
* remove old barcode type compatibility
## [4.6.1](https://github.com/spipu/html2pdf/compare/v4.6.0...v4.6.1) - 2016-04-05
* fix css font-family lowercase check on inherit value
## [4.6.0](https://github.com/spipu/html2pdf/compare/v4.5.1...v4.6.0) - 2016-03-30
* add Support 'start' attribute for ordered list
* add Enable RTL languages support
* add fallback support for images
## [4.5.1](https://github.com/spipu/html2pdf/compare/v4.5.0...v4.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](https://github.com/spipu/html2pdf/compare/v4.4.0...v4.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](https://github.com/spipu/html2pdf/compare/v4.03...v4.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

View File

@ -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 <insert your license name here>" 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.

48
html2pdf-master/README.md Normal file
View File

@ -0,0 +1,48 @@
# Html2Pdf
Html2Pdf is a HTML to PDF converter written in PHP, and compatible with PHP **5.6** to **7.4**.
It allows the conversion of valid HTML in PDF format, to generate documents like invoices, documentation, ...
You have to write a code of HTML for Html2Pdf, and not try to convert directly an already existing html page.
Specific tags have been implemented, to adapt the html standard to a PDF usage.
You must use Composer to install this library.
It uses TCPDF for the PDF part.
## Requirements
Html2Pdf works with PHP >5.6 and Composer.
You will also need at least the following php extensions:
* gd
* mbstring
## Documentation
You will find the install documentation [here](./doc/install.md).
You will find all the documentation [here](./doc/README.md).
You will find lots of examples [here](./examples/).
## Donate
You can support this project by making a [donation](http://html2pdf.fr/en/donate).
## Change log
See the [./CHANGELOG.md](./CHANGELOG.md) file.
## Help & Support
For questions and bug reports, please use the GitHub issues page.
## License
This program is distributed under the OSL License. For more information see the [./LICENSE.md](./LICENSE.md) file.
Copyright 2008-2018 by Laurent Minguet

View File

@ -0,0 +1,34 @@
{
"name": "spipu/html2pdf",
"type": "library",
"description": "Html2Pdf is a HTML to PDF converter written in PHP5 (it uses TCPDF). OFFICIAL PACKAGE",
"keywords": ["html", "pdf", "html2pdf"],
"homepage": "http://html2pdf.fr/",
"license": "OSL-3.0",
"authors": [
{
"name": "Spipu",
"homepage": "https://github.com/spipu",
"role": "Developer"
}
],
"require": {
"php": "^5.6 || ^7.0",
"ext-mbstring": "*",
"ext-gd": "*",
"tecnickcom/tcpdf": "^6.2"
},
"require-dev": {
"phpunit/phpunit": "^5.0",
"phake/phake": "^2.0"
},
"suggest": {
"fagundes/zff-html2pdf": "if you need to integrate Html2Pdf with Zend Framework 2 (zf2)",
"ext-gd": "Allows to embed images into the PDF"
},
"autoload": {
"psr-4": {
"Spipu\\Html2Pdf\\": "src/"
}
}
}

View File

@ -0,0 +1,68 @@
# Html2Pdf Documentation
## Documentation
* [How to Install Html2Pdf](./install.md)
* [Basic Usage](./basic.md)
* [Page and Margin](./page.md)
* [Output](./output.md)
* [Barcode](./barcode.md)
* [Bookmark](./bookmark.md)
* [Font](./font.md)
* [SVG](./svg.md)
* [Electronic Signature](./cert.md)
* [Extensions](./extension.md)
* [Exceptions](./exception.md)
* [Useful Methods](./methods.md)
* [Tcpdf Methods](./tcpdf_methods.md)
## Recommandations
* It is very important to provide valid HTML 4.01 to the converter, but only what is in the `<body>`.
* Use the `<page>` tag. Does not use the `<html>` or `<body>` tag.
* for borders: it is advised that they are like `solid 1mm #000000`
* for padding, they are applicable only on tags `table`, `th`, `td`, `div`, `li`
* A default font can be specified, if the requested font does not exist or if no font is specified: `$html2pdf->setDefaultFont('Arial');`
* The possibility to protect your PDF is present, CF Example 7.
* Some tests can be enabled (true) or disabled (false):
* `setTestIsImage` method: test that images must exist
* `setTestTdInOnePage` method: test that the contents of TDs fit on one page
* A DEBUG mode to know the resources used is present. It is activated by adding the following command just after the contructor (see Example 0): `$html2pdf->setModeDebug();`
* Some specific tags have been introduced:
* `<page></page>` (CF Exemple 7)
* Determines the orientation, margins left, right, top and bottom, the background image and the background color of a page, its size and position, the footer.
* It is also possible to keep the header and footer of the previous pages, through the attribut `pageset="old"` (see Example 3 & 4)
* `<page_header></page_header>` (CF Example 3)
* `<page_footer></page_footer>` (CF Example 3)
* `<nobreak></nobreak>`
* Used to force the display of a section on the same page.
* If this section does not fit into the rest of the page, a page break is done before.
* `<barcode></barcode>` (CF Examples 0 & 9)
* Can insert barcodes in pdfs, CF Examples 0 and 9.
* the possible types of codebar are alls of TCPDF.
* `<qrcode></qrcode>` (CF Example 13)
* can insert QRcode 2D barcodes
* (QR Code is registered trademark of DENSO WAVE INCORPORATED)
* `<bookmark></bookmark>` (CF Examples 7 & About)
* Can insert bookmark in pdfs, CF Example 7 and About.
* It is also possible to automatically create an index at the end of document (CF Example About)
* `<end_last_page end_height="30mm"></end_last_page>` (CF Example 5)
* css property `rotate`:
* Values : 0, 90, 180, 270
* Works only on div (cf example 8)

View File

@ -0,0 +1,89 @@
# BarCode
[back](./README.md)
## tag barcode
You can add barcode, by directly inserting the `<barcode>` tag in the HTML to convert :
```html
<barcode dimension="1D" type="EAN13" value="45" label="label" style="width:30mm; height:6mm; color: #770000; font-size: 4mm"></barcode>
```
### attributes
Attribute| Default | Description
---------|---------|-------------
dimension | 1D | create a 1D or 2D barcode
type| C39 | type of barcode to use
value| 0 | value to convert into barcode
label| label | indicates that the label must be present below the bar code (label) or not (none) (not required)
style| | sets the color for the bar, its width and height (without the label) and the size of the label if it is displayed (not required)
### 1D types
For 1D bar-codes, the possible values for `type` attribute are:
Type| Description
----|------------
C39| CODE 39 - ANSI MH10.8M-1983 - USD-3 - 3 of 9.
C39+| CODE 39 with checksum
C39E| CODE 39 EXTENDED
C39E+| CODE 39 EXTENDED + CHECKSUM
C93| CODE 93 - USS-93
S25| Standard 2 of 5
S25+| Standard 2 of 5 + CHECKSUM
I25| Interleaved 2 of 5
I25+| Interleaved 2 of 5 + CHECKSUM
C128| CODE 128
C128A| CODE 128 A
C128B| CODE 128 B
C128C| CODE 128 C
EAN2| 2-Digits UPC-Based Extension
EAN5| 5-Digits UPC-Based Extension
EAN8| EAN 8
EAN13| EAN 13
UPCA| UPC-A
UPCE| UPC-E
MSI| MSI (Variation of Plessey code)
MSI+| MSI + CHECKSUM (modulo 11)
POSTNET| POSTNET
PLANET| PLANET
RMS4CC| RMS4CC (Royal Mail 4-state Customer Code) - CBC (Customer Bar Code)
KIX| KIX (Klant index - Customer index)
IMB| IMB - Intelligent Mail Barcode - Onecode - USPS-B-3200
IMBPRE| IMB - Intelligent Mail Barcode - Onecode - USPS-B-3200- pre-processed
CODABAR| CODABAR
CODE11| CODE 11
PHARMA| PHARMACODE
PHARMA2T| PHARMACODE TWO-TRACKS
### 2D types
For 2D barcodes, the possible values for `type` attribute are:
Type| Description
----|------------
DATAMATRIX| DATAMATRIX (ISO/IEC 16022)
PDF417| PDF417 (ISO/IEC 15438:2006)
QRCODE| QR-CODE
RAW| RAW MODE
RAW2| RAW MODE
## tag qrcode
You can directly add bar-codes to two-dimensional QR-Code, by inserting the tag QRcode directly in the HTML to convert:
```html
<qrcode value="Value to Coder" ec="H" style="width: 50mm; background-color: white; color: black;"></qrcode>
```
### attributes
Attribute| Default | Description
---------|---------|-------------
value| | value to convert into barcode
ec| H | level of error correction (L, M, Q, H)
style| | sets the width, color, background-color, and border of the qrcode
[back](./README.md)

View File

@ -0,0 +1,75 @@
# Basic Usage
[back](./README.md)
## PHP Constructor
The main class of this library is `\Spipu\Html2Pdf\Html2Pdf`.
The PHP constructor takes the following parameters:
Variable | Default value |Description
---------|---------------|--------------
$orientation | P | The default page orientation, can be P (portrait) or L (landscape)
$format | A4 | The default page format used for pages. The list of the available value are [here](https://github.com/tecnickcom/TCPDF/blob/485956db63b5a225760e80fa2278bdb22eca4650/include/tcpdf_static.php#L2129). You can also give a array with 2 values the width and the height in mm.
$lang | fr | Language to use, for some minor translations. The list of the available languages are [here](https://github.com/spipu/html2pdf/tree/master/src/locale)
$unicode | true | means that the input HTML string is unicode
$encoding |UTF-8 | charset encoding of the input HTML string
$margins | array(5, 5, 5, 8) | Main margins of the page (left, top, right, bottom) in mm
$pdfa | false | If TRUE set the document to PDF/A mode
In most of the case, you will just use the 3 first parameters :
```php
$html2pdf = new \Spipu\Html2Pdf\Html2Pdf('P', 'A4', 'en');
```
## Convert the HTML
The main method to use is `writeHTML`.
It takes one parameter : the HTML in string format that you want to convert into PDF.
```php
$html2pdf->writeHTML('<h1>HelloWorld</h1>This is my first test');
```
You can call it more than one time, if you want to split the conversion in order to use less memory. It will continue on the same page, directly at the end of the last converted part.
```php
$html2pdf->writeHTML('<h1>HelloWorld</h1>This is my first text');
$html2pdf->writeHTML('<h1>HelloWorld</h1>This is my second text');
```
If you want to separate on a new page, you can use the specific HTML tag `page`.
```php
$html2pdf->writeHTML('<page><h1>HelloWorld</h1>This is my first page</page>');
$html2pdf->writeHTML('<page><h1>HelloWorld</h1>This is my second page</page>');
```
You can find more information about this specific tag on the [page](page.md) documentation.
## Get the PDF
The main method to use is `output`.
It takes two not required parameters. You can find more information on the [output](output.md) documentation.
If you do not give any parameters, it will send the PDF file to the browser, to display it.
```php
$html2pdf->output();
```
## Full Example
Here is the full code for a helloworld example:
```php
$html2pdf = new \Spipu\Html2Pdf\Html2Pdf('P', 'A4', 'en');
$html2pdf->writeHTML('<h1>HelloWorld</h1>This is my first page');
$html2pdf->output();
```
[back](./README.md)

View File

@ -0,0 +1,228 @@
# Bookmark
[back](./README.md)
## tag bookmark
You can add automatic bookmark, by directly inserting the `<bookmark>` tag in the HTML to convert :
```html
<bookmark title="My Title" level="0" ></bookmark>
```
### attributes
Attribute| Default | Description
---------|---------|-------------
title | | Title of the bookmark
level | 0 | Level of the bookmark, must be a positive integer. Level 0 is the main level
## Page Index
You can insert an index (summary) of all bookmarks automatically, using the following function :
```php
$html2pdf->createIndex($titre, $sizeTitle, $sizeBookmark, $bookmarkTitle, $displayPage, $onPage, $fontName, $marginTop);
```
### parameters
Parameter| Default | Description
---------|---------|-------------
$title | Index | index title
$sizeTitle | 20 | font size of the index title, in mm
$sizeBookmark | 15 | font size of the index, in mm
$bookmarkTitle | true | add a bookmark for the index, at his beginning
$displayPage | true | display the page numbers
$onPage | null | if null : at the end of the document on a new page, else on the $onPage page
$fontName | null | font name to use. If null, use helvetica
$marginTop | null | margin top to use on the index page
**IMPORTANT**:
If you want the summary index on a specific page (using $onPage) you must have anticipated this page during the creation of HTML (see example below).
Furthermore, if the summary index takes more than one page, you must have provided the necessary number of pages...
## Example with automatic index on last page
```html
<style type="text/css">
<!--
table.page_header {width: 100%; border: none; background-color: #DDDDFF; border-bottom: solid 1mm #AAAADD; padding: 2mm }
table.page_footer {width: 100%; border: none; background-color: #DDDDFF; border-top: solid 1mm #AAAADD; padding: 2mm}
h1 {color: #000033}
h2 {color: #000055}
h3 {color: #000077}
div.standard
{
padding-left: 5mm;
}
-->
</style>
<page backtop="14mm" backbottom="14mm" backleft="10mm" backright="10mm" style="font-size: 12pt">
<page_header>
<table class="page_header">
<tr>
<td style="width: 100%; text-align: left">
Example of using bookmarks
</td>
</tr>
</table>
</page_header>
<page_footer>
<table class="page_footer">
<tr>
<td style="width: 100%; text-align: right">
page [[page_cu]]/[[page_nb]]
</td>
</tr>
</table>
</page_footer>
<bookmark title="Chapter 1" level="0" ></bookmark><h1>Chapter 1</h1>
<div class="standard">
Contents of Chapter 1
</div>
</page>
<page pageset="old">
<bookmark title="Chapter 2" level="0" ></bookmark><h1>Chapter 2</h1>
<div class="standard">
Intro to Chapter 2
<bookmark title="Chapter 2.1" level="1" ></bookmark><h2>Chapter 2.1</h2>
<div class="standard">
Contents of Chapter 2.1
</div>
<bookmark title="Chapter 2.2" level="1" ></bookmark><h2>Chapter 2.2</h2>
<div class="standard">
Contents of Chapter 2.2
</div>
<bookmark title="Chapter 2.3" level="1" ></bookmark><h2>Chapter 2.3</h2>
<div class="standard">
Contents of Chapter 2.3
</div>
</div>
</page>
<page pageset="old">
<bookmark title="Chapter 3" level="0" ></bookmark><h1>Chapter 3</h1>
<div class="standard">
Intro to Chapter 3
<bookmark title="Chapter 3.1" level="1" ></bookmark><h2>Chapter 3.1</h2>
<div class="standard">
Contents of Chapter 3.1
</div>
<bookmark title="Chapter 3.2" level="1" ></bookmark><h2>Chapter 3.2</h2>
<div class="standard">
Intro to Chapter 3.2
<bookmark title="Chapter 3.2.1" level="2" ></bookmark><h3>Chapter 3.2.1</h3>
<div class="standard">
Contents of Chapter 3.2.1
</div>
<bookmark title="Chapter 3.2.2" level="2" ></bookmark><h3>Chapter 3.2.2</h3>
<div class="standard">
Contents of Chapter 3.2.2
</div>
</div>
</div>
</page>
```
```php
$html2pdf = new Spipu\Html2Pdf\Html2Pdf('P','A4','en');
$html2pdf->writeHTML($html);
$html2pdf->createIndex('Summary', 25, 12, true, true);
$html2pdf->output();
```
## Example with automatic index on specific page
```html
<style type="text/css">
<!--
table.page_header {width: 100%; border: none; background-color: #DDDDFF; border-bottom: solid 1mm #AAAADD; padding: 2mm }
table.page_footer {width: 100%; border: none; background-color: #DDDDFF; border-top: solid 1mm #AAAADD; padding: 2mm}
h1 {color: #000033}
h2 {color: #000055}
h3 {color: #000077}
div.standard
{
padding-left: 5mm;
}
-->
</style>
<page backtop="14mm" backbottom="14mm" backleft="10mm" backright="10mm" style="font-size: 12pt">
<page_header>
<table class="page_header">
<tr>
<td style="width: 100%; text-align: left">
Example of using bookmarks
</td>
</tr>
</table>
</page_header>
<page_footer>
<table class="page_footer">
<tr>
<td style="width: 100%; text-align: right">
page [[page_cu]]/[[page_nb]]
</td>
</tr>
</table>
</page_footer>
<bookmark title="Summary" level="0" ></bookmark>
</page>
<page pageset="old">
<bookmark title="Chapter 1" level="0" ></bookmark><h1>Chapter 1</h1>
<div class="standard">
Contents of Chapter 1
</div>
</page>
<page pageset="old">
<bookmark title="Chapter 2" level="0" ></bookmark><h1>Chapter 2</h1>
<div class="standard">
Intro to Chapter 2
<bookmark title="Chapter 2.1" level="1" ></bookmark><h2>Chapter 2.1</h2>
<div class="standard">
Contents of Chapter 2.1
</div>
<bookmark title="Chapter 2.2" level="1" ></bookmark><h2>Chapter 2.2</h2>
<div class="standard">
Contents of Chapter 2.2
</div>
<bookmark title="Chapter 2.3" level="1" ></bookmark><h2>Chapter 2.3</h2>
<div class="standard">
Contents of Chapter 2.3
</div>
</div>
</page>
<page pageset="old">
<bookmark title="Chapter 3" level="0" ></bookmark><h1>Chapter 3</h1>
<div class="standard">
Intro to Chapter 3
<bookmark title="Chapter 3.1" level="1" ></bookmark><h2>Chapter 3.1</h2>
<div class="standard">
Contents of Chapter 3.1
</div>
<bookmark title="Chapter 3.2" level="1" ></bookmark><h2>Chapter 3.2</h2>
<div class="standard">
Intro to Chapter 3.2
<bookmark title="Chapter 3.2.1" level="2" ></bookmark><h3>Chapter 3.2.1</h3>
<div class="standard">
Contents of Chapter 3.2.1
</div>
<bookmark title="Chapter 3.2.2" level="2" ></bookmark><h3>Chapter 3.2.2</h3>
<div class="standard">
Contents of Chapter 3.2.2
</div>
</div>
</div>
</page>
```
```php
$html2pdf = new Spipu\Html2Pdf\Html2Pdf('P','A4','en');
$html2pdf->writeHTML($html);
$html2pdf->createIndex('Summary', 25, 12, false, true, 1);
$html2pdf->output();
```
[back](./README.md)

View File

@ -0,0 +1,32 @@
# Electronic Signature
[back](./README.md)
You can add an electronic signature to the PDF, by using the following specific html TAG:
```
<cert
src="/path/to/cert.pem"
privkey="/path/to/priv.pem"
name="sender_name"
location="sender_location"
reason="sender_reason"
contactinfo="sender_contact"
>
/** html **/
</cert>
```
Attribute | Description | Example 1 | Example 2
------------|-----------------------------------|---------------------|-------------------
src | Path to the Cert | /www/certs/my.pem | /www/certs/my.crt
privkey | Private key of the Cert if needed | /www/certs/priv.pem | nothing
name | Name of the Cert | My.org Cert |
location | Country of the Cert | France |
reason | Purpose of the Cert | Invoice validation |
contactinfo | EMail of organisation's contact | contact@my.org |
/** HTML **/
part could be any HTML formatted string, img, etc...
[back](./README.md)

View File

@ -0,0 +1,48 @@
# Exception
[back](./README.md)
## Exceptions
All the specific Html2Pdf exceptions are under the namespace `\Spipu\Html2Pdf\Exception`;
Exception|Error Code|Additional Info|Description
---------|----------|---------------|-----------
Html2PdfException | 0 | | Occurs for every generic error during the process
HtmlParsingException | 1 | <ul><li>getInvalidTag</li><li>getHtmlLine</li></ul> | Occurs if the html is no valid
ImageException | 2 | <ul><li>getImage</li></ul> | Occurs if the asked image does not exist
LongSentenceException | 3 | <ul><li>getSentence</li><li>getWidthBox</li><li>getLength</li></ul> | Occurs is a sentence is too long and does not fit in the current box
TableException | 4 | | Occurs if the content of a TD does not fit on only one page
## Exception Format
An exception formatter can be used to display the exceptions: `\Spipu\Html2Pdf\Exception\ExceptionFormatter`.
It takes the current exception as a parameter of the constructor.
It provides 2 methods
* getMessage()
* getHtmlMessage();
Usage example:
```php
try {
use Spipu\Html2Pdf\Html2Pdf;
use Spipu\Html2Pdf\Exception\Html2PdfException;
use Spipu\Html2Pdf\Exception\ExceptionFormatter;
$html2pdf = new Html2Pdf('P', 'A4', 'fr');
$html2pdf->setDefaultFont('Arial');
$html2pdf->writeHTML($htmlContent);
$html2pdf->output();
} catch (Html2PdfException $e) {
$html2pdf->clean();
$formatter = new ExceptionFormatter($e);
echo $formatter->getHtmlMessage();
}
```
[back](./README.md)

View File

@ -0,0 +1,141 @@
# Extensions and Tags
[back](./README.md)
## Html Tags
All the existing tags are under the namespace `\Spipu\Html2Pdf\Tag`.
A tag must implement the interface `\Spipu\Html2Pdf\Tag\TagInterface`.
A tag can extends the abstract class `\Spipu\Html2Pdf\Tag\AbstractTag` to implement some generic methods.
Here is a tag example that will do nothing:
```php
<?php
namespace Example\Html2Pdf\Tag;
use \Spipu\Html2Pdf\Tag\AbstractTag;
/**
* Tag Example
*/
class Example extends AbstractTag
{
/**
* get the name of the tag
*
* @return string
*/
public function getName()
{
return 'example';
}
/**
* Open the HTML tag
*
* @param array $properties properties of the HTML tag
*
* @return boolean
*/
public function open($properties)
{
// there is nothing to do here
return true;
}
/**
* Close the HTML tag
*
* @param array $properties properties of the HTML tag
*
* @return boolean
*/
public function close($properties)
{
// there is nothing to do here
return true;
}
}
```
Then, you will be able to use the `<example>` html tag.
Look at all the existing tags in the `/src/Tag` folder to see examples.
## Extensions
In order to add your new tags to Html2Pdf, you must a extension.
An extension must implement the interface `\Spipu\Html2Pdf\Extension\ExtensionInterface`.
You must implement the `getTags` method that will return a list of tag objects.
```php
<?php
/**
* Extension Example
*/
namespace Example\Html2Pdf\Extension;
use \Spipu\Html2Pdf\Extension\ExtensionInterface;
/**
* Class MyExtension
*/
class MyExtension implements ExtensionInterface
{
/**
* @var array
*/
private $tagDefinitions = array();
/**
* {@inheritDoc}
*/
public function getName()
{
return 'example_extension';
}
/**
* {@inheritDoc}
*/
public function getTags()
{
if (empty($this->tagDefinitions)) {
$this->tagDefinitions = array(
new \Example\Html2Pdf\Tag\Example(),
new \Example\Html2Pdf\Tag\Other(),
);
}
return $this->tagDefinitions;
}
}
```
Then, you can add your extension to Html2Pdf with the following method:
```php
$html2pdf->addExtension(new \Example\Html2Pdf\Extension\MyExtension());
```
The following core extensions are automatically added to Html2pdf:
* `\Spipu\Html2Pdf\Extension\Core\HtmlExtension`
* `\Spipu\Html2Pdf\Extension\Core\SvgExtension`
It contains all the native tags.
## Overriding
If an extension has the same name that an already added extension, it will replace the first one.
If tag has the same name that an already added tag throw an extension, it will replace the first one.
[back](./README.md)

View File

@ -0,0 +1,44 @@
# Font
[back](./README.md)
## Creating new Font
To create new font, you should use this tutorial from TCPDF:
https://tcpdf.org/docs/fonts/
## Adding new font
To use this new font, you must add it to Html2Pdf, by using the following method:
```php
$html2pdf->addFont($family, $style, $file);
```
The parameters are:
Parameter| Default | Description
---------|---------|-------------
$family | | Font family. The name can be chosen arbitrarily. If it is a standard family name, it will override the corresponding font.
$style | | Font style. Possible values are (case insensitive):<ul><li>empty string: regular (default)</li><li>B: bold</li><li>I: italic</li><li>BI or IB: bold italic</li></ul>
$file | | The font definition file. By default, the name is built from the family and style, in lower case with no spaces.
If you want to add font for normal and for bold style, you must call the `addFont` method twice, one for each font file.
**WARNING**:
In 4em parameter constructor of Html2pdf, you must specify whether you use a Unicode font (true) or an old font (false).
## Using new font
You have just to se the new font family name in your css.
## Setting the default font
You can set the default font to use with the following method:
```php
$html2pdf->setDefaultFont($default);
```
[back](./README.md)

View File

@ -0,0 +1,64 @@
# How to Install Html2Pdf
[back](./README.md)
## Composer and Packagist
You must use Composer to install Html2Pdf.
If you do not know what is Composer, you are a few years late...
It is used by all the modern PHP applications (Magento2, Drupal, EasyPlatform, Symfony, ...).
You can read all the pages on https://getcomposer.org/doc/
You can find all the available packages on https://packagist.org/
For example, you can find Html2Pdf: https://packagist.org/packages/spipu/html2pdf
You have to commit the `composer.json` and `composer.lock` files, but **never** commit the `vendor` folder.
If you do not understand why, it is because you have not read the Composer documentation...
## Install
You have just to launch the following command on the root folder of your project:
```bash
composer require spipu/html2pdf
```
### First Test
Here is a HelloWorld example, that you can put on the root folder of your project.
```php
require __DIR__.'/vendor/autoload.php';
use Spipu\Html2Pdf\Html2Pdf;
$html2pdf = new Html2Pdf();
$html2pdf->writeHTML('<h1>HelloWorld</h1>This is my first test');
$html2pdf->output();
```
Html2Pdf use the PSR-4 autoloader of Composer. You have just to require it. Never require manually the classes, it will not work at all. You must use the Composer functionnalities.
Then, you have just to use the main class `Spipu\Html2Pdf\Html2Pdf`, with the 2 main methods `writeHTML` and `output`.
### And on production ?
You have **not** to install composer on your production server.
You have to install composer **only** on your dev environement. Composer is a dev tool.
To deliver you app on a server, you have to (on you dev environement) :
* Git clone the tag/branch that you want to deliver
* Launch the command `composer install --no-dev`
* Remove the useless files (like the `.git` folder)
* Zip all
That's all, you have a beautifull package that can be deliver on a server !
[back](./README.md)

View File

@ -0,0 +1,65 @@
# Useful Methods
[back](./README.md)
## Image Must Exist
By default, if you try to use an image that Html2Pdf can not read, it will throw an `ImageException`.
You can disable this test with the following method:
```php
$html2pdf->setTestIsImage(false);
```
If you disable the test, and if an image does not exist, it will display a 16x16 grey square instead.
## FallBack Image
If you disable the "Image Must Exist" test, you can specify a fallback image with the following method:
```php
$html2pdf->setFallbackImage($imageFilename);
```
## Can not split TD content
By default, the content of a TD should not exceed one page.
You can disable this protection with the following method:
```php
$html2pdf->setTestTdInOnePage(false);
```
**WARNING**:
If you disable this test, you may have big layouts problems on tables in multiple columns.
Rather than disabling this test it is better to break the TD content in smaller ones.
**We do not support the consequencies of disable this test.**
## Debug Mode
You can enable a debug mode by using the following method:
```php
$html2pdf->setModeDebug();
```
You can specify your own debugger. It must implement `\Spipu\Html2Pdf\Debug\DebugInterface`.
```php
$debug = new \Spipu\Html2Pdf\Debug\Debug();
$html2pdf->setModeDebug($debug);
```
## Version
You can get the current Html2Pdf version with the following methods:
```php
$html2pdf->getVersion();
$html2pdf->getVersionAsArray();
```
[back](./README.md)

View File

@ -0,0 +1,50 @@
# Output
[back](./README.md)
The main method to use is `output`.
It takes two not required parameters.
## Parameters
Parameter| Default | Description
---------|---------|-------------
$name | document.pdf | The name of the file when saved. Note that special characters are removed and blanks characters are replaced with the underscore character.
$dest | I | Destination where to send the document. It can take one of the following values:<ul><li>I: send the file inline to the browser (default). The plug-in is used if available. The name given by name is used when one selects the "Save as" option on the link generating the PDF.</li><li>D: send to the browser and force a file download with the name given by name.</li><li>F: save to a local server file with the name given by name.</li><li>S: return the document as a string (name is ignored).</li><li>FI: equivalent to F + I option</li><li>FD: equivalent to F + D option</li><li>E: return the document as base64 mime multi-part email attachment (RFC 2045)</li></ul>
## Examples
### Send PDF to browser without specifying a name
```php
$html2pdf->output();
```
### Send the PDF document in browser with a specific name
```php
$html2pdf->output('my_doc.pdf');
```
### Forcing the download of PDF via web browser, with a specific name
```php
$html2pdf->output('my_doc.pdf', 'D');
```
### Write the contents of a PDF file on the server
```php
$html2pdf->output('/absolute/path/file_xxxx.pdf', 'F');
```
### Retrieve the contents of the PDF and then do whatever you want
```php
$pdfContent = $html2pdf->output('my_doc.pdf', 'S');
```
Then, you can send it by email, using a Bin Attachment document.
[back](./README.md)

138
html2pdf-master/doc/page.md Normal file
View File

@ -0,0 +1,138 @@
# Page Management
[back](./README.md)
To facilitate the layout, three specific tags have been added:
* `<page>`
* `<page_header>`
* `<page_footer>`
They must be used as follow:
```html
<page>
<page_header>
...
</page_header>
<page_footer>
...
</page_footer>
...
</page>
```
You **must not** use `<body>` and `<html>` tags.
## Page tag
### Attributes
You can use the main following attributes:
Attribute| Default | Description
---------|---------|-------------
pageset | new | Specify if we want to use the previous page definition (old) or a new one (new)
pagegroup | old | Specify if we are in the same page group (old) or in a new one (new)
hideheader | | comma-separate page numbers on which we want to hide the header
hidefooter | | comma-separate page numbers on which we want to hide the footer
orientation | | Portrait (P) or Lanscape (L). By default, the orientation specified in the Html2Pdf constructor
format | | Format to use The list of the available values are [here](https://github.com/tecnickcom/TCPDF/blob/master/include/tcpdf_static.php#L2097). By default, the orientation specified in the Html2Pdf constructor
style | | css style
class | | css class
You can use the following attributes to manage page margin:
Attribute| Default | Description
---------|---------|-------------
backtop | 0 | value with unit (mm, px, pt, % )
backbottom | 0 | value with unit (mm, px, pt, % )
backleft | 0 | value with unit (mm, px, pt, % )
backright | 0 | value with unit (mm, px, pt, % )
You can use the following attributes to manage page background:
Attribute| Default | Description
---------|---------|-------------
backcolor | transparent | css color value
backimg | | url of the image to use
backimgx | center | x position of the image on the page background: left / center / right / value with unit (mm, px, pt, % )
backimgy | middle | y position of the image on the page background: top / middle / bottom / value with unit (mm, px, pt, % )
backimgw | 100% | width on the image on the page background: value with unit (mm, px, pt, % )
You can add a light footer by using the attribute footer. It takes coma-separated values:
Value| Description
-----|-------------
page | display the current page
date | display the generation date
time | display the generation time
form | display a disclamer about form compatibility
### explanation
It allows to define, for the entire html code included within the layout :
* margins left, right, top, bottom (backleft, backright, backtop, backbottom)
* background image, with its position and size (backimg, backimgx, backimgy, backimgw)
* the background color (backcolor)
* orientation (orientation) and format (format)
* simple automatic footer (footer)
* a header and a footer complex HTML (using tags page_header and page_footer).
It does not limit it-self to one final page of the PDF, but to a set of pages.
Any HTML code will be included automatically within the same layout.
It is possible to reuse the layout of the previous tag page using property pageset = “old.” This also automatically resume the header and the footer.
## Page Header tag
Its allows you to use complex HTML as the header of the current page.
Its definition must necessarily be located just after the opening of the `<page>` tag.
It can contain any valid HTML.
It is **REQUIRED** to specify the top margin, using the `backtop` attribute on the `<page>` tag.
You can use ̀`css` and `class` attribute on this specific tag.
## Page Footer tag
Its allows you to use complex HTML as the header of the current page.
Its definition must necessarily be located just after the opening of the `<page>` tag.
It can contain any valid HTML.
It is **REQUIRED** to specify the top margin, using the `backtop` attribute on the `<page>` tag.
You can use `css` and `class` attribute on this specific tag.
## Margin Explanation
Here's a little explanation of different margins:
```html
<page backtop="7mm" backbottom="7mm" backleft="10mm" backright="10mm">
<page_header>
Page Header
</page_header>
<page_footer>
Page Footer
</page_footer>
Page Content
</page>
```
```php
$pdf = new \Spipu\Html2Pdf\Html2Pdf('P','A4','en', false, 'UTF-8', array(mL, mT, mR, mB));
$pdf->writeHTML($htmlContent);
$pdf->Output();
```
![Margins](res/margins.jpg "Margins")
[back](./README.md)

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 KiB

View File

@ -0,0 +1,53 @@
# SVG tags
[back](./README.md)
## Tag draw
A new html tag `<draw>` has been implemented.
It allows to insert a SVG image in your PDF.
The only allowed attributes are `css` and `class`.
Example:
```html
<page>
<draw style="margin: auto; width:150mm; height:100mm; background: #000000; border: solid 0.5mm #777777;">
<line style="stroke:#FF0000; stroke-width:1mm" x1="10mm" y1="10mm" x2="140mm" y2="10mm" >
<rect style="stroke:#770077; stroke-width:1mm; fill:#008888" x="15%" y="15%" w="70%" h="70%">
<ellipse style="stroke:#000077; stroke-width:1mm; fill:#888800" cx="50%" cy="50%" rx="30%" ry="30%">
<circle style="stroke:#0000AA; stroke-width:1mm; fill:#AAAA00" cx="50%" cy="50%" r="15%">
</draw><br>
<draw style="margin: auto; width:150mm; height:100mm; background: #000000; border: solid 0.5mm #777777;">
<path style="fill:#AAAA00; stroke:#0000AA; stroke-width:1mm" d="M20mm,10mm H130mm A10mm,10mm 0,0,0 140mm,20mm V80mm A10mm,10mm 0,0,0 130mm,90mm H20mm A10mm,10mm 0,0,0 10mm,80mm V20mm A10mm,10mm 0,0,0 20mm,10mm">
<path style="fill:#770000; stroke:#AA0033; stroke-width:0.5mm" d="M 20mm,40mm a16mm,8mm 0,0,0 16mm,8mm" />
<path style="fill:#770000; stroke:#00AA33; stroke-width:0.5mm" d="M 20mm,40mm l16mm,8mm" />
<path style="fill:#770000; stroke:#AA0033; stroke-width:0.5mm" d="M 40mm,40mm a16mm,8mm 0,0,1 16mm,8mm" />
<path style="fill:#770000; stroke:#00AA33; stroke-width:0.5mm" d="M 40mm,40mm l16mm,8mm" />
<path style="fill:#770000; stroke:#AA0033; stroke-width:0.5mm" d="M 80mm,40mm a16mm,8mm 0,1,0 16mm,8mm" />
<path style="fill:#770000; stroke:#00AA33; stroke-width:0.5mm" d="M 80mm,40mm l16mm,8mm" />
<path style="fill:#770000; stroke:#AA0033; stroke-width:0.5mm" d="M100mm,40mm a16mm,8mm 0,1,1 16mm,8mm" />
<path style="fill:#770000; stroke:#00AA33; stroke-width:0.5mm" d="M100mm,40mm l16mm,8mm" />
</draw><br>
<br>
</page>
```
## Allowed SVG tags
* LINE
* RECT
* CIRCLE
* ELLIPSE
* PATH
* POLYGON
* POLYLINE
* G
## SVG Documentation
See http://www.w3.org/TR/SVG11/expanded-toc.html
[back](./README.md)

View File

@ -0,0 +1,62 @@
# TCPDF Methods
[back](./README.md)
All the TCPDF methods can be used, by using the `pdf` property:
```php
$html2pdf->pdf->...
```
## Display Mode
You can change how your PDF document will be displayed, with the `SetDisplayMode` method:
```php
$html2pdf = new \Spipu\Html2Pdf\Html2Pdf('P', 'A4', 'en');
$html2pdf->pdf->SetDisplayMode('fullpage');
$html2pdf->writeHTML($htmlContent);
$html2pdf->output();
```
The parameters are:
Parameter| Default | Description
---------|---------|-------------
$zoom | | The zoom to use. It can be one of the following string values or a number indicating the zooming factor to use. <ul><li>fullpage: displays the entire page on screen </li><li>fullwidth: uses maximum width of window</li><li>real: uses real size (equivalent to 100% zoom)</li><li>default: uses viewer default mode</li></ul>
$layout | SinglePage | The page layout. Possible values are:<ul><li>SinglePage Display one page at a time</li><li>OneColumn Display the pages in one column</li><li>TwoColumnLeft Display the pages in two columns, with odd-numbered pages on the left</li><li>TwoColumnRight Display the pages in two columns, with odd-numbered pages on the right</li><li>TwoPageLeft (PDF 1.5) Display the pages two at a time, with odd-numbered pages on the left</li><li>TwoPageRight (PDF 1.5) Display the pages two at a time, with odd-numbered pages on the right</li></ul>
$mode | UseNone | A name object specifying how the document should be displayed when opened:<ul><li>UseNone Neither document outline nor thumbnail images visible</li><li>UseOutlines Document outline visible</li><li>UseThumbs Thumbnail images visible</li><li>FullScreen Full-screen mode, with no menu bar, window controls, or any other window visible</li><li>UseOC (PDF 1.5) Optional content group panel visible</li><li>UseAttachments (PDF 1.6) Attachments panel visible</li></ul>
## Document Information
You can change the document information, with the following methods:
```php
$html2pdf = new \Spipu\Html2Pdf\Html2Pdf('P', 'A4', 'en');
$html2pdf->pdf->SetAuthor('LAST-NAME Frist-Name');
$html2pdf->pdf->SetTitle('My Pdf Document');
$html2pdf->pdf->SetSubject('it will be about something important');
$html2pdf->pdf->SetKeywords('example, keywords, others');
$html2pdf->writeHTML($htmlContent);
$html2pdf->output();
```
## Document Protection
You can protect your PDF document, with the `setProtection` method:
```php
$html2pdf->pdf->SetProtection($permissions, $userPass, $ownerPass, $mode, $pubkeys);
```
The parameters are:
Parameter| Default | Description
---------|---------|-------------
$permissions | | the set of permissions (specify the ones you want to block):<ul><li>print : Print the document;</li><li>modify : Modify the contents of the document by operations other than those controlled by 'fill-forms', 'extract' and 'assemble';</li><li>copy : Copy or otherwise extract text and graphics from the document;</li><li>annot-forms : Add or modify text annotations, fill in interactive form fields, and, if 'modify' is also set, create or modify interactive form fields (including signature fields);</li><li>fill-forms : Fill in existing interactive form fields (including signature fields), even if 'annot-forms' is not specified;</li><li>extract : Extract text and graphics (in support of accessibility to users with disabilities or for other purposes);</li><li>assemble : Assemble the document (insert, rotate, or delete pages and create bookmarks or thumbnail images), even if 'modify' is not set;</li><li>print-high : Print the document to a representation from which a faithful digital copy of the PDF content could be generated. When this is not set, printing is limited to a low-level representation of the appearance, possibly of degraded quality.</li><li>owner : (inverted logic - only for public-key) when set permits change of encryption and enables all other permissions.</li></ul>
$userPass | | user password. Empty by default.
$ownerPass | null | owner password. If not specified, a random value is used.
$mode | 0 | encryption strength: 0 = RC4 40 bit; 1 = RC4 128 bit; 2 = AES 128 bit; 3 = AES 256 bit.
$pubkeys | null| array of recipients containing public-key certificates ('c') and permissions ('p'). For example: array(array('c' => 'file://../examples/data/cert/tcpdf.crt', 'p' => array('print')))
[back](./README.md)

View File

@ -0,0 +1,34 @@
<?php
/**
* Html2Pdf Library - example
*
* HTML => PDF converter
* distributed under the OSL-3.0 License
*
* @package Html2pdf
* @author Laurent MINGUET <webmaster@html2pdf.fr>
* @copyright 2017 Laurent MINGUET
*/
require_once dirname(__FILE__).'/../vendor/autoload.php';
use Spipu\Html2Pdf\Html2Pdf;
use Spipu\Html2Pdf\Exception\Html2PdfException;
use Spipu\Html2Pdf\Exception\ExceptionFormatter;
try {
$html2pdf = new Html2Pdf('P', 'A4', 'fr', true, 'UTF-8', array(0, 0, 0, 0));
$html2pdf->pdf->SetDisplayMode('fullpage');
ob_start();
include dirname(__FILE__).'/res/about.php';
$content = ob_get_clean();
$html2pdf->writeHTML($content);
$html2pdf->createIndex('Sommaire', 30, 12, false, true, 2, null, '10mm');
$html2pdf->output('about.pdf');
} catch (Html2PdfException $e) {
$html2pdf->clean();
$formatter = new ExceptionFormatter($e);
echo $formatter->getHtmlMessage();
}

View File

@ -0,0 +1,31 @@
<?php
/**
* Html2Pdf Library - example
*
* HTML => PDF converter
* distributed under the OSL-3.0 License
*
* @package Html2pdf
* @author Laurent MINGUET <webmaster@html2pdf.fr>
* @copyright 2017 Laurent MINGUET
*/
require_once dirname(__FILE__).'/../vendor/autoload.php';
use Spipu\Html2Pdf\Html2Pdf;
use Spipu\Html2Pdf\Exception\Html2PdfException;
use Spipu\Html2Pdf\Exception\ExceptionFormatter;
try {
ob_start();
include dirname(__FILE__).'/res/balloon.php';
$content = ob_get_clean();
$html2pdf = new Html2Pdf('P', 'A4', 'fr');
$html2pdf->writeHTML($content);
$html2pdf->output('baloon.pdf');
} catch (Html2PdfException $e) {
$html2pdf->clean();
$formatter = new ExceptionFormatter($e);
echo $formatter->getHtmlMessage();
}

View File

@ -0,0 +1,32 @@
<?php
/**
* Html2Pdf Library - example
*
* HTML => PDF converter
* distributed under the OSL-3.0 License
*
* @package Html2pdf
* @author Laurent MINGUET <webmaster@html2pdf.fr>
* @copyright 2017 Laurent MINGUET
*/
require_once dirname(__FILE__).'/../vendor/autoload.php';
use Spipu\Html2Pdf\Html2Pdf;
use Spipu\Html2Pdf\Exception\Html2PdfException;
use Spipu\Html2Pdf\Exception\ExceptionFormatter;
try {
ob_start();
include dirname(__FILE__).'/res/bookmark.php';
$content = ob_get_clean();
$html2pdf = new Html2Pdf('P', 'A4', 'fr', true, 'UTF-8', 0);
$html2pdf->writeHTML($content);
$html2pdf->createIndex('Sommaire', 25, 12, false, true, 1);
$html2pdf->output('bookmark.pdf');
} catch (Html2PdfException $e) {
$html2pdf->clean();
$formatter = new ExceptionFormatter($e);
echo $formatter->getHtmlMessage();
}

View File

@ -0,0 +1,32 @@
<?php
/**
* Html2Pdf Library - example
*
* HTML => PDF converter
* distributed under the OSL-3.0 License
*
* @package Html2pdf
* @author Laurent MINGUET <webmaster@html2pdf.fr>
* @copyright 2017 Laurent MINGUET
*/
require_once dirname(__FILE__).'/../vendor/autoload.php';
use Spipu\Html2Pdf\Html2Pdf;
use Spipu\Html2Pdf\Exception\Html2PdfException;
use Spipu\Html2Pdf\Exception\ExceptionFormatter;
try {
ob_start();
include dirname(__FILE__).'/res/example00.php';
$content = ob_get_clean();
$html2pdf = new Html2Pdf('P', 'A4', 'fr');
$html2pdf->setDefaultFont('Arial');
$html2pdf->writeHTML($content);
$html2pdf->output('example00.pdf');
} catch (Html2PdfException $e) {
$html2pdf->clean();
$formatter = new ExceptionFormatter($e);
echo $formatter->getHtmlMessage();
}

View File

@ -0,0 +1,31 @@
<?php
/**
* Html2Pdf Library - example
*
* HTML => PDF converter
* distributed under the OSL-3.0 License
*
* @package Html2pdf
* @author Laurent MINGUET <webmaster@html2pdf.fr>
* @copyright 2017 Laurent MINGUET
*/
require_once dirname(__FILE__).'/../vendor/autoload.php';
use Spipu\Html2Pdf\Html2Pdf;
use Spipu\Html2Pdf\Exception\Html2PdfException;
use Spipu\Html2Pdf\Exception\ExceptionFormatter;
try {
ob_start();
include dirname(__FILE__).'/res/example01.php';
$content = ob_get_clean();
$html2pdf = new Html2Pdf('P', 'A4', 'fr');
$html2pdf->writeHTML($content);
$html2pdf->output('example01.pdf');
} catch (Html2PdfException $e) {
$html2pdf->clean();
$formatter = new ExceptionFormatter($e);
echo $formatter->getHtmlMessage();
}

View File

@ -0,0 +1,32 @@
<?php
/**
* Html2Pdf Library - example
*
* HTML => PDF converter
* distributed under the OSL-3.0 License
*
* @package Html2pdf
* @author Laurent MINGUET <webmaster@html2pdf.fr>
* @copyright 2017 Laurent MINGUET
*/
require_once dirname(__FILE__).'/../vendor/autoload.php';
use Spipu\Html2Pdf\Html2Pdf;
use Spipu\Html2Pdf\Exception\Html2PdfException;
use Spipu\Html2Pdf\Exception\ExceptionFormatter;
try {
ob_start();
include dirname(__FILE__).'/res/example02.php';
$content = ob_get_clean();
$html2pdf = new Html2Pdf('P', 'A4', 'fr', true, 'UTF-8', array(15, 5, 15, 5));
$html2pdf->pdf->SetDisplayMode('fullpage');
$html2pdf->writeHTML($content);
$html2pdf->output('example02.pdf');
} catch (Html2PdfException $e) {
$html2pdf->clean();
$formatter = new ExceptionFormatter($e);
echo $formatter->getHtmlMessage();
}

View File

@ -0,0 +1,32 @@
<?php
/**
* Html2Pdf Library - example
*
* HTML => PDF converter
* distributed under the OSL-3.0 License
*
* @package Html2pdf
* @author Laurent MINGUET <webmaster@html2pdf.fr>
* @copyright 2017 Laurent MINGUET
*/
require_once dirname(__FILE__).'/../vendor/autoload.php';
use Spipu\Html2Pdf\Html2Pdf;
use Spipu\Html2Pdf\Exception\Html2PdfException;
use Spipu\Html2Pdf\Exception\ExceptionFormatter;
try {
ob_start();
include dirname(__FILE__).'/res/example03.php';
$content = ob_get_clean();
$html2pdf = new Html2Pdf('P', 'A4', 'fr', true, 'UTF-8', 3);
$html2pdf->pdf->SetDisplayMode('fullpage');
$html2pdf->writeHTML($content);
$html2pdf->output('example03.pdf');
} catch (Html2PdfException $e) {
$html2pdf->clean();
$formatter = new ExceptionFormatter($e);
echo $formatter->getHtmlMessage();
}

View File

@ -0,0 +1,32 @@
<?php
/**
* Html2Pdf Library - example
*
* HTML => PDF converter
* distributed under the OSL-3.0 License
*
* @package Html2pdf
* @author Laurent MINGUET <webmaster@html2pdf.fr>
* @copyright 2017 Laurent MINGUET
*/
require_once dirname(__FILE__).'/../vendor/autoload.php';
use Spipu\Html2Pdf\Html2Pdf;
use Spipu\Html2Pdf\Exception\Html2PdfException;
use Spipu\Html2Pdf\Exception\ExceptionFormatter;
try {
ob_start();
include dirname(__FILE__).'/res/example04.php';
$content = ob_get_clean();
$html2pdf = new Html2Pdf('P', 'A4', 'fr');
$html2pdf->pdf->SetDisplayMode('fullpage');
$html2pdf->writeHTML($content);
$html2pdf->output('example04.pdf');
} catch (Html2PdfException $e) {
$html2pdf->clean();
$formatter = new ExceptionFormatter($e);
echo $formatter->getHtmlMessage();
}

View File

@ -0,0 +1,32 @@
<?php
/**
* Html2Pdf Library - example
*
* HTML => PDF converter
* distributed under the OSL-3.0 License
*
* @package Html2pdf
* @author Laurent MINGUET <webmaster@html2pdf.fr>
* @copyright 2017 Laurent MINGUET
*/
require_once dirname(__FILE__).'/../vendor/autoload.php';
use Spipu\Html2Pdf\Html2Pdf;
use Spipu\Html2Pdf\Exception\Html2PdfException;
use Spipu\Html2Pdf\Exception\ExceptionFormatter;
try {
ob_start();
include dirname(__FILE__).'/res/example05.php';
$content = ob_get_clean();
$html2pdf = new Html2Pdf('P', 'A4', 'fr');
$html2pdf->pdf->SetDisplayMode('fullpage');
$html2pdf->writeHTML($content);
$html2pdf->output('example05.pdf');
} catch (Html2PdfException $e) {
$html2pdf->clean();
$formatter = new ExceptionFormatter($e);
echo $formatter->getHtmlMessage();
}

View File

@ -0,0 +1,31 @@
<?php
/**
* Html2Pdf Library - example
*
* HTML => PDF converter
* distributed under the OSL-3.0 License
*
* @package Html2pdf
* @author Laurent MINGUET <webmaster@html2pdf.fr>
* @copyright 2017 Laurent MINGUET
*/
require_once dirname(__FILE__).'/../vendor/autoload.php';
use Spipu\Html2Pdf\Html2Pdf;
use Spipu\Html2Pdf\Exception\Html2PdfException;
use Spipu\Html2Pdf\Exception\ExceptionFormatter;
try {
ob_start();
include dirname(__FILE__).'/res/example06.php';
$content = ob_get_clean();
$html2pdf = new Html2Pdf('P', 'A4', 'fr');
$html2pdf->writeHTML($content);
$html2pdf->output('example06.pdf');
} catch (Html2PdfException $e) {
$html2pdf->clean();
$formatter = new ExceptionFormatter($e);
echo $formatter->getHtmlMessage();
}

View File

@ -0,0 +1,34 @@
<?php
/**
* Html2Pdf Library - example
*
* HTML => PDF converter
* distributed under the OSL-3.0 License
*
* @package Html2pdf
* @author Laurent MINGUET <webmaster@html2pdf.fr>
* @copyright 2017 Laurent MINGUET
*/
require_once dirname(__FILE__).'/../vendor/autoload.php';
use Spipu\Html2Pdf\Html2Pdf;
use Spipu\Html2Pdf\Exception\Html2PdfException;
use Spipu\Html2Pdf\Exception\ExceptionFormatter;
try {
// get the HTML
ob_start();
include dirname(__FILE__).'/res/example07a.php';
include dirname(__FILE__).'/res/example07b.php';
$content = ob_get_clean();
$html2pdf = new Html2Pdf('P', 'A4', 'fr');
$html2pdf->pdf->SetDisplayMode('fullpage');
$html2pdf->writeHTML($content);
$html2pdf->output('example07.pdf');
} catch (Html2PdfException $e) {
$html2pdf->clean();
$formatter = new ExceptionFormatter($e);
echo $formatter->getHtmlMessage();
}

View File

@ -0,0 +1,31 @@
<?php
/**
* Html2Pdf Library - example
*
* HTML => PDF converter
* distributed under the OSL-3.0 License
*
* @package Html2pdf
* @author Laurent MINGUET <webmaster@html2pdf.fr>
* @copyright 2017 Laurent MINGUET
*/
require_once dirname(__FILE__).'/../vendor/autoload.php';
use Spipu\Html2Pdf\Html2Pdf;
use Spipu\Html2Pdf\Exception\Html2PdfException;
use Spipu\Html2Pdf\Exception\ExceptionFormatter;
try {
ob_start();
include dirname(__FILE__).'/res/example08.php';
$content = ob_get_clean();
$html2pdf = new Html2Pdf('P', 'A4', 'fr', true, 'UTF-8', 0);
$html2pdf->writeHTML($content);
$html2pdf->output('example08.pdf');
} catch (Html2PdfException $e) {
$html2pdf->clean();
$formatter = new ExceptionFormatter($e);
echo $formatter->getHtmlMessage();
}

View File

@ -0,0 +1,88 @@
<?php
/**
* Html2Pdf Library - example
*
* HTML => PDF converter
* distributed under the OSL-3.0 License
*
* @package Html2pdf
* @author Laurent MINGUET <webmaster@html2pdf.fr>
* @copyright 2017 Laurent MINGUET
*/
require_once dirname(__FILE__).'/../vendor/autoload.php';
use Spipu\Html2Pdf\Html2Pdf;
use Spipu\Html2Pdf\Exception\Html2PdfException;
use Spipu\Html2Pdf\Exception\ExceptionFormatter;
if (isset($_SERVER['REQUEST_URI'])) {
$generate = isset($_GET['make_pdf']);
$nom = isset($_GET['nom']) ? $_GET['nom'] : 'inconnu';
$url = dirname($_SERVER['REQUEST_URI']);
if (substr($url, 0, 7)!=='http://') {
$url = 'http://'.$_SERVER['HTTP_HOST'].$url;
}
} else {
$generate = true;
$nom = 'spipu';
$url = 'http://localhost/html2pdf/examples/';
}
$nom = substr(preg_replace('/[^a-zA-Z0-9]/isU', '', $nom), 0, 26);
$url.= '/res/example09.png.php?px=5&amp;py=20';
if ($generate) {
ob_start();
} else {
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" >
<title>Exemple d'auto génération de PDF</title>
</head>
<body>
<?php
}
?>
<br>
Ceci est un exemple de génération de PDF via un bouton :)<br>
<br>
<img src="<?php echo $url; ?>" alt="image_php" ><br>
<br>
<?php
if ($generate) {
?>
Bonjour <b><?php echo $nom; ?></b>, ton nom peut s'écrire : <br>
<barcode type="C39" value="<?php echo strtoupper($nom); ?>" style="color: #770000" ></barcode><hr>
<br>
<?php
}
?>
<br>
<?php
if ($generate) {
$content = ob_get_clean();
try {
$html2pdf = new Html2Pdf('P', 'A4', 'fr');
$html2pdf->writeHTML($content);
$html2pdf->output('example09.pdf');
exit;
} catch (Html2PdfException $e) {
$html2pdf->clean();
$formatter = new ExceptionFormatter($e);
echo $formatter->getHtmlMessage();
exit;
}
}
?>
<form method="get" action="">
<input type="hidden" name="make_pdf" value="">
Ton nom : <input type="text" name="nom" value=""> -
<input type="submit" value="Generer le PDF" >
</form>
</body>
</html>

View File

@ -0,0 +1,30 @@
<?php
/**
* Html2Pdf Library - example
*
* HTML => PDF converter
* distributed under the OSL-3.0 License
*
* @package Html2pdf
* @author Laurent MINGUET <webmaster@html2pdf.fr>
* @copyright 2017 Laurent MINGUET
*/
require_once dirname(__FILE__).'/../vendor/autoload.php';
use Spipu\Html2Pdf\Html2Pdf;
use Spipu\Html2Pdf\Exception\Html2PdfException;
use Spipu\Html2Pdf\Exception\ExceptionFormatter;
try {
ob_start();
include dirname(__FILE__).'/res/example10.php';
$content = ob_get_clean();
$html2pdf = new Html2Pdf('P', 'A4', 'fr');
$html2pdf->writeHTML($content);
$html2pdf->output('example10.pdf');
} catch (Html2PdfException $e) {
$html2pdf->clean();
$formatter = new ExceptionFormatter($e);
echo $formatter->getHtmlMessage();
}

View File

@ -0,0 +1,32 @@
<?php
/**
* Html2Pdf Library - example
*
* HTML => PDF converter
* distributed under the OSL-3.0 License
*
* @package Html2pdf
* @author Laurent MINGUET <webmaster@html2pdf.fr>
* @copyright 2017 Laurent MINGUET
*/
require_once dirname(__FILE__).'/../vendor/autoload.php';
use Spipu\Html2Pdf\Html2Pdf;
use Spipu\Html2Pdf\Exception\Html2PdfException;
use Spipu\Html2Pdf\Exception\ExceptionFormatter;
try {
ob_start();
include dirname(__FILE__).'/res/example11.php';
$content = ob_get_clean();
$html2pdf = new Html2Pdf('P', 'A4', 'fr');
$html2pdf->setTestTdInOnePage(false);
$html2pdf->writeHTML($content);
$html2pdf->output('example11.pdf');
} catch (Html2PdfException $e) {
$html2pdf->clean();
$formatter = new ExceptionFormatter($e);
echo $formatter->getHtmlMessage();
}

View File

@ -0,0 +1,31 @@
<?php
/**
* Html2Pdf Library - example
*
* HTML => PDF converter
* distributed under the OSL-3.0 License
*
* @package Html2pdf
* @author Laurent MINGUET <webmaster@html2pdf.fr>
* @copyright 2017 Laurent MINGUET
*/
require_once dirname(__FILE__).'/../vendor/autoload.php';
use Spipu\Html2Pdf\Html2Pdf;
use Spipu\Html2Pdf\Exception\Html2PdfException;
use Spipu\Html2Pdf\Exception\ExceptionFormatter;
try {
ob_start();
include dirname(__FILE__).'/res/example12.php';
$content = ob_get_clean();
$html2pdf = new Html2Pdf('P', 'A4', 'fr');
$html2pdf->writeHTML($content);
$html2pdf->output('example12.pdf');
} catch (Html2PdfException $e) {
$html2pdf->clean();
$formatter = new ExceptionFormatter($e);
echo $formatter->getHtmlMessage();
}

View File

@ -0,0 +1,31 @@
<?php
/**
* Html2Pdf Library - example
*
* HTML => PDF converter
* distributed under the OSL-3.0 License
*
* @package Html2pdf
* @author Laurent MINGUET <webmaster@html2pdf.fr>
* @copyright 2017 Laurent MINGUET
*/
require_once dirname(__FILE__).'/../vendor/autoload.php';
use Spipu\Html2Pdf\Html2Pdf;
use Spipu\Html2Pdf\Exception\Html2PdfException;
use Spipu\Html2Pdf\Exception\ExceptionFormatter;
try {
ob_start();
include dirname(__FILE__).'/res/example13.php';
$content = ob_get_clean();
$html2pdf = new Html2Pdf('P', 'A4', 'fr');
$html2pdf->writeHTML($content);
$html2pdf->output('example13.pdf');
} catch (Html2PdfException $e) {
$html2pdf->clean();
$formatter = new ExceptionFormatter($e);
echo $formatter->getHtmlMessage();
}

View File

@ -0,0 +1,33 @@
<?php
/**
* Html2Pdf Library - example
*
* HTML => PDF converter
* distributed under the OSL-3.0 License
*
* @package Html2pdf
* @author Laurent MINGUET <webmaster@html2pdf.fr>
* @copyright 2017 Laurent MINGUET
*/
require_once dirname(__FILE__).'/../vendor/autoload.php';
use Spipu\Html2Pdf\Html2Pdf;
use Spipu\Html2Pdf\Exception\Html2PdfException;
use Spipu\Html2Pdf\Exception\ExceptionFormatter;
try {
ob_start();
include dirname(__FILE__).'/res/example14.php';
$content = ob_get_clean();
$html2pdf = new Html2Pdf('P', 'A4', 'fr');
$html2pdf->setTestIsImage(false);
$html2pdf->setFallbackImage('./res/off.png');
$html2pdf->writeHTML($content);
$html2pdf->output('example14.pdf');
} catch (Html2PdfException $e) {
$html2pdf->clean();
$formatter = new ExceptionFormatter($e);
echo $formatter->getHtmlMessage();
}

View File

@ -0,0 +1,31 @@
<?php
/**
* Html2Pdf Library - example
*
* HTML => PDF converter
* distributed under the OSL-3.0 License
*
* @package Html2pdf
* @author Laurent MINGUET <webmaster@html2pdf.fr>
* @copyright 2017 Laurent MINGUET
*/
require_once dirname(__FILE__).'/../vendor/autoload.php';
use Spipu\Html2Pdf\Html2Pdf;
use Spipu\Html2Pdf\Exception\Html2PdfException;
use Spipu\Html2Pdf\Exception\ExceptionFormatter;
try {
ob_start();
include dirname(__FILE__).'/res/example15.php';
$content = ob_get_clean();
$html2pdf = new Html2Pdf('P', 'A4', 'fr');
$html2pdf->writeHTML($content);
$html2pdf->output('example15.pdf');
} catch (Html2PdfException $e) {
$html2pdf->clean();
$formatter = new ExceptionFormatter($e);
echo $formatter->getHtmlMessage();
}

View File

@ -0,0 +1,40 @@
<?php
/**
* Html2Pdf Library - example
*
* HTML => PDF converter
* distributed under the OSL-3.0 License
*
* @package Html2pdf
* @author Laurent MINGUET <webmaster@html2pdf.fr>
* @copyright 2017 Laurent MINGUET
*/
require_once dirname(__FILE__).'/../vendor/autoload.php';
use Spipu\Html2Pdf\Html2Pdf;
use Spipu\Html2Pdf\Exception\Html2PdfException;
use Spipu\Html2Pdf\Exception\ExceptionFormatter;
// for display the post information
if (isset($_POST['test'])) {
echo '<pre>';
echo htmlentities(print_r($_POST, true));
echo '</pre>';
exit;
}
try {
ob_start();
require dirname(__FILE__).'/res/forms.php';
$content = ob_get_clean();
$html2pdf = new Html2Pdf('P', 'A4', 'fr');
$html2pdf->pdf->SetDisplayMode('fullpage');
$html2pdf->writeHTML($content);
$html2pdf->output('forms.pdf');
} catch (Html2PdfException $e) {
$html2pdf->clean();
$formatter = new ExceptionFormatter($e);
echo $formatter->getHtmlMessage();
}

View File

@ -0,0 +1,32 @@
<?php
/**
* Html2Pdf Library - example
*
* HTML => PDF converter
* distributed under the OSL-3.0 License
*
* @package Html2pdf
* @author Laurent MINGUET <webmaster@html2pdf.fr>
* @copyright 2017 Laurent MINGUET
*/
require_once dirname(__FILE__).'/../vendor/autoload.php';
use Spipu\Html2Pdf\Html2Pdf;
use Spipu\Html2Pdf\Exception\Html2PdfException;
use Spipu\Html2Pdf\Exception\ExceptionFormatter;
try {
ob_start();
include dirname(__FILE__).'/res/groups.php';
$content = ob_get_clean();
$html2pdf = new Html2Pdf('P', 'A4', 'fr', true, 'UTF-8', 0);
$html2pdf->pdf->SetDisplayMode('fullpage');
$html2pdf->writeHTML($content);
$html2pdf->output('groups.pdf');
} catch (Html2PdfException $e) {
$html2pdf->clean();
$formatter = new ExceptionFormatter($e);
echo $formatter->getHtmlMessage();
}

View File

@ -0,0 +1,32 @@
<?php
/**
* Html2Pdf Library - example
*
* HTML => PDF converter
* distributed under the OSL-3.0 License
*
* @package Html2pdf
* @author Laurent MINGUET <webmaster@html2pdf.fr>
* @copyright 2017 Laurent MINGUET
*/
require_once dirname(__FILE__).'/../vendor/autoload.php';
use Spipu\Html2Pdf\Html2Pdf;
use Spipu\Html2Pdf\Exception\Html2PdfException;
use Spipu\Html2Pdf\Exception\ExceptionFormatter;
try {
ob_start();
include dirname(__FILE__).'/res/measure.php';
$content = ob_get_clean();
$html2pdf = new Html2Pdf('L', 'A4', 'fr', true, 'UTF-8', 10);
$html2pdf->pdf->SetDisplayMode('fullpage');
$html2pdf->writeHTML($content);
$html2pdf->output('measure.pdf');
} catch (Html2PdfException $e) {
$html2pdf->clean();
$formatter = new ExceptionFormatter($e);
echo $formatter->getHtmlMessage();
}

View File

@ -0,0 +1,32 @@
<?php
/**
* Html2Pdf Library - example
*
* HTML => PDF converter
* distributed under the OSL-3.0 License
*
* @package Html2pdf
* @author Laurent MINGUET <webmaster@html2pdf.fr>
* @copyright 2017 Laurent MINGUET
*/
require_once dirname(__FILE__).'/../vendor/autoload.php';
use Spipu\Html2Pdf\Html2Pdf;
use Spipu\Html2Pdf\Exception\Html2PdfException;
use Spipu\Html2Pdf\Exception\ExceptionFormatter;
try {
ob_start();
include dirname(__FILE__).'/res/qrcode.php';
$content = ob_get_clean();
$html2pdf = new Html2Pdf('P', 'A4', 'fr');
$html2pdf->pdf->SetDisplayMode('fullpage');
$html2pdf->writeHTML($content);
$html2pdf->output('qrcode.pdf');
} catch (Html2PdfException $e) {
$html2pdf->clean();
$formatter = new ExceptionFormatter($e);
echo $formatter->getHtmlMessage();
}

View File

@ -0,0 +1,31 @@
<?php
/**
* Html2Pdf Library - example
*
* HTML => PDF converter
* distributed under the OSL-3.0 License
*
* @package Html2pdf
* @author Laurent MINGUET <webmaster@html2pdf.fr>
* @copyright 2017 Laurent MINGUET
*/
require_once dirname(__FILE__).'/../vendor/autoload.php';
use Spipu\Html2Pdf\Html2Pdf;
use Spipu\Html2Pdf\Exception\Html2PdfException;
use Spipu\Html2Pdf\Exception\ExceptionFormatter;
try {
ob_start();
include dirname(__FILE__).'/res/radius.php';
$content = ob_get_clean();
$html2pdf = new Html2Pdf('P', 'A4', 'fr');
$html2pdf->writeHTML($content);
$html2pdf->output('radius.pdf');
} catch (Html2PdfException $e) {
$html2pdf->clean();
$formatter = new ExceptionFormatter($e);
echo $formatter->getHtmlMessage();
}

View File

@ -0,0 +1,242 @@
<style type="text/css">
<!--
table.page_header {width: 100%; border: none; background-color: #DDDDFF; border-bottom: solid 1mm #AAAADD; padding: 2mm }
table.page_footer {width: 100%; border: none; background-color: #DDDDFF; border-top: solid 1mm #AAAADD; padding: 2mm}
div.note {border: solid 1mm #DDDDDD;background-color: #EEEEEE; padding: 2mm; border-radius: 2mm; width: 100%; }
ul.main { width: 95%; list-style-type: square; }
ul.main li { padding-bottom: 2mm; }
h1 { text-align: center; font-size: 20mm}
h3 { text-align: center; font-size: 14mm}
-->
</style>
<page backtop="14mm" backbottom="14mm" backleft="10mm" backright="10mm" style="font-size: 12pt">
<page_header>
<table class="page_header">
<tr>
<td style="width: 50%; text-align: left">
A propos de ...
</td>
<td style="width: 50%; text-align: right">
Html2Pdf v<?php echo $html2pdf->getVersion(); ?>
</td>
</tr>
</table>
</page_header>
<page_footer>
<table class="page_footer">
<tr>
<td style="width: 33%; text-align: left;">
http://html2pdf.fr/
</td>
<td style="width: 34%; text-align: center">
page [[page_cu]]/[[page_nb]]
</td>
<td style="width: 33%; text-align: right">
&copy;Spipu 2008-<?php echo date('Y'); ?>
</td>
</tr>
</table>
</page_footer>
<bookmark title="Présentation" level="0" ></bookmark>
<br><br><br><br><br><br><br><br>
<h1>Html2Pdf</h1>
<h3>v<?php echo $html2pdf->getVersion(); ?></h3><br>
<br><br><br><br><br>
<div style="text-align: center; width: 100%;">
<br>
<img src="./res/logo.png" alt="Logo Html2Pdf" style="width: 150mm">
<br>
</div>
<br><br><br><br><br>
<div class="note">
Html2Pdf est un convertisseur de code HTML vers PDF écrit en PHP5, utilisant la librairie <a href="http://tcpdf.org">TCPDF.</a><br>
<br>
Il permet la conversion d'HTML et d'xHTML valide au format PDF, et est distribué sous licence OSL-3.0.<br>
<br>
Cette librairie a été conçue pour gérer principalement les TABLE imbriquées afin de générer des factures, bon de livraison, et autres documents officiels.<br>
<br>
Vous pouvez télécharger la dernière version de Html2Pdf ici : <a href="http://html2pdf.fr/">http://html2pdf.fr/</a>.<br>
</div>
</page>
<page pageset="old">
<bookmark title="Sommaire" level="0" ></bookmark>
<!-- here will be the automatic index -->
</page>
<page pageset="old">
<bookmark title="Compatibilité" level="0" ></bookmark>
<bookmark title="Balises HTML" level="1" ></bookmark>
<bookmark title="Balises classiques" level="2" ></bookmark>
<div class="note">
La liste des balises HTML utilisables est la suivante :<br>
</div>
<br>
<ul class="main">
<li>&lt;a&gt; : Ceci est un lien vers <a href="http://html2pdf.fr">le site de Html2Pdf</a></li>
<li>&lt;b&gt;, &lt;strong&gt; : Ecrire en <b>gras</b>.</li>
<li>&lt;big&gt; : Ecrire plus <big>gros</big>.</li>
<li>&lt;br&gt; : Permet d'aller à la ligne</li>
<li>&lt;cite&gt; : <cite>Ceci est une citation</cite></li>
<li>&lt;code&gt;, &lt;pre&gt;</li>
<li>&lt;div&gt; :&nbsp;<div style="border: solid 1px #AADDAA; background: #DDFFDD; text-align: center; width: 50mm">exemple de DIV</div></li>
<li>&lt;em&gt;, &lt;i&gt;, &lt;samp&gt; : Ecrire en <em>italique</em>.</li>
<li>&lt;font&gt;, &lt;span&gt; : <font style="color: #000066; font-family: times">Exemple d'utilisation</font></li>
<li>&lt;h1&gt;, &lt;h2&gt;, &lt;h3&gt;, &lt;h4&gt;, &lt;h5&gt;, &lt;h6&gt;</li>
<li>&lt;hr&gt; : barre horizontale</li>
<li>&lt;img&gt; : <img src="./res/tcpdf_logo.jpg" style="width: 10mm"></li>
<li>&lt;p&gt; : Ecrire dans un paragraphe</li>
<li>&lt;s&gt; : Texte <s>barré</s></li>
<li>&lt;small&gt; : Ecrire plus <small>petit</small>.</li>
<li>&lt;style&gt;</li>
<li>&lt;sup&gt; : Exemple<sup>haut</sup>.</li>
<li>&lt;sub&gt; : Exemple<sub>bas</sub>.</li>
<li>&lt;u&gt; : Texte <u>souligné</u></li>
<li>&lt;table&gt;, &lt;td&gt;, &lt;th&gt;, &lt;tr&gt;, &lt;thead&gt;, &lt;tbody&gt;, &lt;tfoot&gt;, &lt;col&gt;, &lt;colgroup&gt; </li>
<li>&lt;ol&gt;, &lt;ul&gt;, &lt;li&gt;</li>
<li>&lt;form&gt;, &lt;input&gt;, &lt;textarea&gt;, &lt;select&gt;, &lt;option&gt;</li>
<li>&lt;fieldset&gt;, &lt;legend&gt;</li>
<li>&lt;del&gt;, &lt;ins&gt;</li>
<li>&lt;draw&gt;, &lt;line&gt;, &lt;rect&gt;, &lt;circle&gt;, &lt;ellipse&gt;, &lt;polygone&gt;, &lt;polyline&gt;, &lt;path&gt;</li>
</ul>
<bookmark title="Balises spécifiques" level="2" ></bookmark>
<div class="note">
Les balises spécifiques suivantes ont été ajoutées :<br>
</div>
<br>
<ul class="main" >
<li>&lt;page&gt;</li>
<li>&lt;page_header&gt;</li>
<li>&lt;page_footer&gt;</li>
<li>&lt;end_last_page&gt;</li>
<li>&lt;nobreak&gt;</li>
<li>&lt;barcode&gt;</li>
<li>&lt;bookmark&gt;</li>
<li>&lt;qrcode&gt;</li>
</ul>
</page>
<page pageset="old">
<bookmark title="Styles CSS" level="1" ></bookmark>
<div class="note">
La liste des styles CSS utilisables est la suivante :<br>
</div>
<br>
<table style="width: 100%">
<tr style="vertical-align: top">
<td style="width: 50%">
<ul class="main">
<li>color</li>
<li>font-family</li>
<li>font-weight</li>
<li>font-style</li>
<li>font-size</li>
<li>text-decoration</li>
<li>text-indent</li>
<li>text-align</li>
<li>text-transform</li>
<li>vertical-align</li>
<li>width</li>
<li>height</li>
<li>line-height</li>
<li>padding</li>
<li>padding-top</li>
<li>padding-right</li>
<li>padding-bottom</li>
<li>padding-left</li>
<li>margin</li>
<li>margin-top</li>
<li>margin-right</li>
<li>margin-bottom</li>
<li>margin-left</li>
<li>position</li>
<li>top</li>
<li>bottom</li>
<li>left</li>
<li>right</li>
<li>float</li>
<li>rotate</li>
<li>background</li>
<li>background-color</li>
<li>background-image</li>
<li>background-position</li>
<li>background-repeat</li>
</ul>
</td>
<td style="width: 50%">
<ul class="main">
<li>border</li>
<li>border-style</li>
<li>border-color</li>
<li>border-width</li>
<li>border-collapse</li>
<li>border-top</li>
<li>border-top-style</li>
<li>border-top-color</li>
<li>border-top-width</li>
<li>border-right</li>
<li>border-right-style</li>
<li>border-right-color</li>
<li>border-right-width</li>
<li>border-bottom</li>
<li>border-bottom-style</li>
<li>border-bottom-color</li>
<li>border-bottom-width</li>
<li>border-left</li>
<li>border-left-style</li>
<li>border-left-color</li>
<li>border-left-width</li>
<li>border-radius</li>
<li>border-top-left-radius</li>
<li>border-top-right-radius</li>
<li>border-bottom-left-radius</li>
<li>border-bottom-right-radius</li>
<li>list-style</li>
<li>list-style-type</li>
<li>list-style-image</li>
</ul>
</td>
</tr>
</table>
</page>
<page pageset="old">
<bookmark title="Propriétés" level="1" ></bookmark>
<div class="note">
La liste des propriétés utilisables est la suivante :<br>
</div>
<br>
<table style="width: 100%">
<tr style="vertical-align: top">
<td style="width: 50%">
<ul class="main">
<li>cellpadding</li>
<li>cellspacing</li>
<li>colspan</li>
<li>rowspan</li>
<li>width</li>
<li>height</li>
</ul>
</td>
<td style="width: 50%">
<ul class="main">
<li>align</li>
<li>valign</li>
<li>bgcolor</li>
<li>bordercolor</li>
<li>border</li>
<li>type</li>
<li>value</li>
</ul>
</td>
</tr>
</table>
<bookmark title="Limitations" level="0" ></bookmark>
<div class="note">
Cette librairie comporte des limitations :<br>
</div>
<br>
<ul class="main">
<li>Les float ne sont gérés que pour la balise IMG.</li>
<li>Elle ne permet généralement pas la conversion directe d'une page HTML en PDF, ni la conversion du résultat d'un WYSIWYG en PDF.</li>
<li>Cette librairie est là pour faciliter la génération de documents PDF, pas pour convertir n'importe quelle page HTML.</li>
<li>Les formulaires ne marchent pas avec tous les viewers PDFs...</li>
<li>Lisez bien la documentation : <a href="https://github.com/spipu/html2pdf/blob/master/doc/README.md">https://github.com/spipu/html2pdf/blob/master/doc/README.md</a>.</li>
</ul>
</page>

View File

@ -0,0 +1,104 @@
<style type="text/css">
.balloon {
width: 75%;
position: relative;
}
.on-left {
margin-left: 0;
}
.on-right {
margin-left: 25%;
}
.balloon .balloon-content {
position: relative;
padding: 4mm;
padding: 4mm;
margin-left: 2.8mm;
margin-right: 2.8mm;
margin-bottom: 4mm;
border: 0.1mm solid grey;
border-top: none;
border-radius: 2mm;
text-align: left;
color: black;
}
.balloon .balloon-corner {
width: 0;
height: 0;
border: none;
margin: 0;
padding: 0;
position: absolute;
top: 0;
}
.on-left .balloon-content {
background-color: #FEFEFE;
border-top-left-radius: 0;
}
.on-right .balloon-content {
background-color: #E2FECB;
border-top-right-radius: 0;
}
.on-left .balloon-corner {
border-top: solid 3mm #FEFEFE;
border-left: solid 3mm transparent;
left: 0;
}
.on-right .balloon-corner {
border-top: solid 3mm #E2FECB;
border-right: solid 3mm transparent;
right: 0;
}
.balloon .balloon-status {
color: grey;
position: absolute;
right: 2mm;
bottom: 2mm;
font-size: 80%
}
.balloon .balloon-status img {
width: 3mm;
}
</style>
<page backcolor="#DDD">
<div class="balloon on-right">
<div class="balloon-content">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam lacinia lectus ut lobortis vestibulum. In id consectetur enim. Donec eu erat ut magna consectetur vestibulum ac malesuada turpis. Suspendisse turpis risus, feugiat id gravida eu, euismod id orci. Nunc egestas ut erat molestie rutrum. Morbi posuere posuere sapien sed mattis. Fusce dapibus nunc leo, viverra mollis massa varius non. Ut in maximus quam. Aliquam volutpat consectetur odio, sed viverra eros tincidunt non. Ut consequat mi maximus congue faucibus. Morbi id finibus nisi.
<div class="balloon-status">10:01 PM <img src="./res/check.png" alt="check" /></div>
</div>
<div class="balloon-corner"></div>
</div>
<div class="balloon on-left">
<div class="balloon-content">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam lacinia lectus ut lobortis vestibulum. In id consectetur enim. Donec eu erat ut magna consectetur vestibulum ac malesuada turpis. Suspendisse turpis risus, feugiat id gravida eu, euismod id orci. Nunc egestas ut erat molestie rutrum. Morbi posuere posuere sapien sed mattis. Fusce dapibus nunc leo, viverra mollis massa varius non. Ut in maximus quam. Aliquam volutpat consectetur odio, sed viverra eros tincidunt non. Ut consequat mi maximus congue faucibus. Morbi id finibus nisi.
<div class="balloon-status">10:02 PM <img src="./res/check.png" alt="check" /></div>
</div>
<div class="balloon-corner"></div>
</div>
<div class="balloon on-right">
<div class="balloon-content">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam lacinia lectus ut lobortis vestibulum.
<div class="balloon-status">10:03 PM</div>
</div>
<div class="balloon-corner"></div>
</div>
<div class="balloon on-left">
<div class="balloon-content">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam lacinia lectus ut lobortis vestibulum.
<div class="balloon-status">10:04 PM</div>
</div>
<div class="balloon-corner"></div>
</div>
</page>

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -0,0 +1,81 @@
<style type="text/css">
<!--
table.page_header {width: 100%; border: none; background-color: #DDDDFF; border-bottom: solid 1mm #AAAADD; padding: 2mm }
table.page_footer {width: 100%; border: none; background-color: #DDDDFF; border-top: solid 1mm #AAAADD; padding: 2mm}
h1 {color: #000033}
h2 {color: #000055}
h3 {color: #000077}
div.niveau
{
padding-left: 5mm;
}
-->
</style>
<page backtop="14mm" backbottom="14mm" backleft="10mm" backright="10mm" style="font-size: 12pt">
<page_header>
<table class="page_header">
<tr>
<td style="width: 100%; text-align: left">
Exemple d'utilisation des bookmarks
</td>
</tr>
</table>
</page_header>
<page_footer>
<table class="page_footer">
<tr>
<td style="width: 100%; text-align: right">
page [[page_cu]]/[[page_nb]]
</td>
</tr>
</table>
</page_footer>
<bookmark title="Sommaire" level="0" ></bookmark>
</page>
<page pageset="old">
<bookmark title="Chapitre 1" level="0" ></bookmark><h1>Chapitre 1</h1>
<div class="niveau">
Contenu du chapitre 1
</div>
</page>
<page pageset="old">
<bookmark title="Chapitre 2" level="0" ></bookmark><h1>Chapitre 2</h1>
<div class="niveau">
intro au chapitre 2
<bookmark title="Chapitre 2.1" level="1" ></bookmark><h2>Chapitre 2.1</h2>
<div class="niveau">
Contenu du chapitre 2.1
</div>
<bookmark title="Chapitre 2.2" level="1" ></bookmark><h2>Chapitre 2.2</h2>
<div class="niveau">
Contenu du chapitre 2.2
</div>
<bookmark title="Chapitre 2.3" level="1" ></bookmark><h2>Chapitre 2.3</h2>
<div class="niveau">
Contenu du chapitre 2.3
</div>
</div>
</page>
<page pageset="old">
<bookmark title="Chapitre 3" level="0" ></bookmark><h1>Chapitre 3</h1>
<div class="niveau">
intro au chapitre 3
<bookmark title="Chapitre 3.1" level="1" ></bookmark><h2>Chapitre 3.1</h2>
<div class="niveau">
Contenu du chapitre 3.1
</div>
<bookmark title="Chapitre 3.2" level="1" ></bookmark><h2>Chapitre 3.2</h2>
<div class="niveau">
intro au chapitre 3.2
<bookmark title="Chapitre 3.2.1" level="2" ></bookmark><h3>Chapitre 3.2.1</h3>
<div class="niveau">
Contenu du chapitre 3.2.1
</div>
<bookmark title="Chapitre 3.2.2" level="2" ></bookmark><h3>Chapitre 3.2.2</h3>
<div class="niveau">
Contenu du chapitre 3.2.2
</div>
</div>
</div>
</page>

Binary file not shown.

After

Width:  |  Height:  |  Size: 448 B

View File

@ -0,0 +1,86 @@
<style type="text/Css">
<!--
.test1
{
border: solid 1px #FF0000;
background: #FFFFFF;
border-collapse: collapse;
}
-->
</style>
<page style="font-size: 14px">
<span style="font-weight: bold; font-size: 18pt; color: #FF0000; font-family: Times">Bonjour, voici quelques exemples<br></span>
<br>
Retours à la ligne autorisés : &lt;br&gt;, &lt;br &gt;, &lt;br/&gt;, &lt;br /&gt; <br />
<br>
Barre horizontale &lt;hr&gt;<hr style="height: 4mm; background: #AA5500; border: solid 1mm #0055AA">
Exemple de lien : <a href="http://html2pdf.fr/" >le site Html2Pdf</a><br>
<br>
Image : <img src="./res/logo.gif" alt="Logo" width=150 /><br>
<br>
Alignement horizontal des DIVs et TABLEs<br />
<table style="text-align: center; border: solid 2px red; background: #FFEEEE;width: 40%" align="center"><tr><td style="width: 100%">Test 1</td></tr></table><br />
<table style="text-align: center; border: solid 2px red; background: #FFEEEE;width: 40%; margin: auto"><tr><td style="width: 100%">Test 2</td></tr></table><br />
<div style="text-align: center; border: solid 2px red; background: #FFEEEE;width: 40%; margin: auto">Test 3</div><br />
test de tableau imbriqué :<br>
<table border="1" bordercolor="#007" bgcolor="#AAAAAA" align="center">
<tr>
<td border="1">
<table style="border: solid 1px #FF0000; background: #FFFFFF; width: 100%; text-align: center">
<tr>
<th style="border: solid 1px #007700;width: 50%">C1 «</th>
<td style="border: solid 1px #007700;width: 50%">C2 «</td>
</tr>
<tr>
<td style="border: solid 1px #007700;width: 50%">D1 &euro; &laquo;</td>
<th style="border: solid 1px #007700;width: 50%">D2 &euro; &laquo;</th>
</tr>
</table>
</td>
<td border="1">A2</td>
<td border="1">AAAAAAAA</td>
</tr>
<tr>
<td border="1">B1</td>
<td border="1" rowspan="2">
<table class="test1">
<tr>
<td style="border: solid 2px #007700">E1</td>
<td style="border: solid 2px #000077; padding: 2mm">
<table style="border: solid 1px #445500">
<tr>
<td>
<img src="./res/logo.gif" alt="Logo" width=100 />
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td style="border: solid 2px #770000">F1</td>
<td style="border: solid 2px #007777">F2</td>
</tr>
</table>
</td>
<td border="1"><barcode type="EAN13" value="45" style="width: 30mm; height: 6mm; font-size: 4mm"></barcode></td>
</tr>
<tr>
<td border="1"><barcode type="C39" value="Html2Pdf" label="none" style="width: 35mm; height: 8mm"></barcode></td>
<td border="1">A2</td>
</tr>
</table>
<br>
Exemple avec border et padding : <br>
<table style="border: solid 5mm #770000; padding: 5mm;" cellspacing="0" >
<tr>
<td style="border: solid 3mm #007700; padding: 2mm;"><img src="./res/off.png" alt="" style="width: 20mm"></td>
</tr>
</table>
<img src="./res/off.png" style="width: 10mm;"><img src="./res/off.png" style="width: 10mm;"><img src="./res/off.png" style="width: 10mm;"><img src="./res/off.png" style="width: 10mm;"><img src="./res/off.png" style="width: 10mm;"><br>
<br>
<table style="border: solid 1px #440000; width: 150px" cellspacing="0"><tr><td style="width: 100%">Largeur : 150px</td></tr></table><br>
<table style="border: solid 1px #440000; width: 150pt" cellspacing="0"><tr><td style="width: 100%">Largeur : 150pt</td></tr></table><br>
<table style="border: solid 1px #440000; width: 100mm" cellspacing="0"><tr><td style="width: 100%">Largeur : 100mm</td></tr></table><br>
<table style="border: solid 1px #440000; width: 5in" cellspacing="0"><tr><td style="width: 100%">Largeur : 5in</td></tr></table><br>
<table style="border: solid 1px #440000; width: 80%" cellspacing="0"><tr><td style="width: 100%">Largeur : 80% </td></tr></table><br>
</page>

View File

@ -0,0 +1,96 @@
<style type="text/css">
<!--
table.morpion
{
border: dashed 1px #444444;
}
table.morpion td
{
font-size: 15pt;
font-weight: bold;
border: solid 1px #000000;
padding: 1px;
text-align: center;
width: 25px;
}
table.morpion td.j1 { color: #0A0; }
table.morpion td.j2 { color: #A00; }
-->
</style>
<page style="font-size: 10pt">
<span style="font-weight: bold; font-size: 20pt; color: #F00">Bonjour, voici quelques exemples</span><br>
Bonjour, ceci est un test <b>de gras</b>, <i>d'italic</i>, <b><i>et des 2 ensembles</i></b>.<br>
<br>
<span style="background: red; color: white;">Ceci est un message important</span><br>
<br>
<small>Texte écrit avec small</small>, Texte écrit normalement, <big>Texte écrit avec big</big><br>
<span style="font-size: 20px">A<sub>test d'<b>indice</b></sub> et N<sup>test d'<b>exposant</b></sup>,
test<sub>test<sub>test</sub></sub>,
test<sup>test<sup>test</sup></sup>,
test<sub>test<sup>test</sup></sub>.
</span><br>
<br>
<table align="center" style="border-radius: 6mm; border-top: solid 3mm #000077; border-right: solid 2mm #007700; border-bottom: solid 1mm #770000; border-left: solid 2mm #007777; background: #DDDDAA;" ><tr><td style="width: 100mm; height: 20mm; text-align: center; ">Coucou ! ceci est un border solid avec un radius !!! </td></tr></table>
<br>
<table align="center" style="border-radius: 6mm; border: none; background: #DDDDAA;" ><tr><td style="width: 100mm; height: 20mm; text-align: center; ">Coucou ! ceci est un background avec un radius !!! </td></tr></table>
<br>
<table align="center" style="border: solid 1px #000000;"><tr><td style="border-top: solid 4mm #000077; border-right: solid 3mm #007700; border-bottom: solid 2mm #770000; border-left: solid 1mm #007777; padding: 2mm 4mm 6mm 8mm; width: 100mm; background: #FFDDDD">Coucou ! ceci est un border solid</td></tr></table><br>
<table align="center" style="border: solid 1px #000000;"><tr><td style="border-top: dotted 4mm #000077; border-right: dotted 3mm #007700; border-bottom: dotted 2mm #770000; border-left: dotted 1mm #007777; padding: 2mm 4mm 6mm 8mm; width: 100mm; background: #FFDDDD">Coucou ! ceci est un border dotted</td></tr></table><br>
<table align="center" style="border: solid 1px #000000;"><tr><td style="border-top: dashed 4mm #000077; border-right: dashed 3mm #007700; border-bottom: dashed 2mm #770000; border-left: dashed 1mm #007777; padding: 2mm 4mm 6mm 8mm; width: 100mm; background: #FFDDDD">Coucou ! ceci est un border dashed</td></tr></table><br>
<table align="center" style="border: solid 1px #000000;"><tr><td style="border-top: double 4mm #000077; border-right: double 3mm #007700; border-bottom: double 2mm #770000; border-left: double 1mm #007777; padding: 2mm 4mm 6mm 8mm; width: 100mm; background: #FFDDDD">Coucou ! ceci est un border double</td></tr></table><br>
<?php $back = 'background-image: url(./res/off.png); background-position: left top; background-repeat: repeat; '; ?>
<table style="background: #FFAAAA; color: #000022; border: 3px solid #555555;">
<tr>
<td style="width: 40mm; border: solid 1px #000000; <?php echo $back; ?>color: #003300">Case A1</td>
<td style="width: 50mm; border: solid 1px #000000; <?php echo $back; ?>font-weight: bold;">Case A2</td>
<td style="width: 60mm; border: solid 1px #000000; <?php echo $back; ?>font-size: 20px;">Case A3</td>
</tr>
<tr>
<td style="border: solid 1px #000000; text-align: left; <?php echo $back; ?>vertical-align: top; ">Case B1</td>
<td style="border: solid 1px #000000; text-align: center; <?php echo $back; ?>vertical-align: middle; height: 20mm">Case B2<hr style="color: #22AA22">test de hr</td>
<td style="border: solid 1px #000000; text-align: right; <?php echo $back; ?>vertical-align: bottom; border-radius: 3mm; ">Case B3</td>
</tr>
</table>
<br>
<table style="border: solid 2px #550000; background: #000022 url(./res/logo.png) center center no-repeat; color: #FFFFFF;">
<tr >
<td style="border: solid 1px #AAAAAA;">Case A1<BR>avec tests diverses</td>
<td style="border: solid 1px #AAAAAA;">Case A2</td>
<td style="border: solid 1px #AAAAAA;">Case A3 classic</td>
</tr>
<tr>
<td style="border: solid 1px #AAAAAA;">Case B1<br>toto</td>
<td style="border: solid 1px #AAAAAA;background: #FF0000">Case B2</td>
<td style="border: solid 1px #AAAAAA;">Case B3</td>
</tr>
</table>
<br>
<table class="morpion" cellspacing="5px">
<tr>
<td class="j1">X</td>
<td class="j2">O</td>
<td class="j1">X</td>
</tr>
<tr>
<td class="j2">O</td>
<td class="j1">X</td>
<td ></td>
</tr>
<tr>
<td class="j2">O</td>
<td></td>
<td class="j1">X</td>
</tr>
</table>
<br>
<table style="border: dotted 1mm #FFFFFF; background: #AAAAFF">
<tr>
<td style="width: 42mm; text-align: center;font-size: 5mm">
Ceci est un test
</td>
</tr>
</table>
</page>

View File

@ -0,0 +1,118 @@
<?php
$content = 'A Test overflow<br>A Test overflow<br>A Test overflow<br>
<img src="./res/logo.gif" alt="logo" style="width: XXXmm"><br>
B Test overflow<br>B Test overflow<br>B Test overflow<br>
<img src="./res/logo.gif" alt="logo" style="width: XXXmm"><br>
C Test overflow<br>C Test overflow<br>C Test overflow<br>';
?>
<style type="text/css">
<!--
div.zone
{
border: solid 2mm #66AACC;
border-radius: 3mm;
padding: 1mm;
background-color: #FFEEEE;
color: #440000;
}
div.zone_over
{
width: 30mm;
height: 35mm;
overflow: hidden;
}
-->
</style>
<page style="font-size: 10pt">
<span style="font-size: 16pt ; font-weight: bold">Démonstration des images</span><br>
<br>
<b>Dans un tableau :</b><br>
<table style="width: 50%;border: solid 3px #5544DD" align="center">
<tr>
<td style="width: 30%; text-align: left; ">Text à gauche<br>avec retour à<br>la ligne</td>
<td style="width: 40%; text-align: center;"><img src="./res/logo.gif" alt="" ><br><i>légende</i></td>
<td style="width: 30%; text-align: right; ">Texte à droite</td>
</tr>
</table>
<br>
Texte <span style="text-decoration: underline">souligné</span>,
texte <span style="text-decoration: overline">surligné</span>,
texte <span style="text-decoration: line-through">barré</span>,
texte <span style="text-decoration: underline overline line-through">avec les trois</span>.<br>
<br>
<b>Dans un texte :</b><br>
texte à la suite d'une image, <img src="./res/logo.gif" alt="" style="height: 10mm">
texte à la suite d'une image, répétitif car besoin d'un retour à la ligne
texte à la suite d'une image, répétitif car besoin d'un retour à la ligne
texte à la suite d'une image, répétitif car besoin d'un retour à la ligne
texte à la suite d'une image, répétitif car besoin d'un retour à la ligne<br>
<br>
<br>
Test différentes tailles texte
<span style="font-size: 18pt;">Test Size</span>
<span style="font-size: 16pt;">Test Size</span>
<span style="font-size: 14pt;">Test Size</span>
<span style="font-size: 12pt;">Test Size</span>
Test différentes tailles texte, répétitif car besoin d'un retour à la ligne
Test différentes tailles texte, répétitif car besoin d'un retour à la ligne
Test différentes tailles texte, répétitif car besoin d'un retour à la ligne
Test différentes tailles texte, répétitif car besoin d'un retour à la ligne
<br>
<br>
<b>Exemple de couleur : </b><br>
<span style="color: RGB(255, 0, 0)">Texte de couleur</span><br>
<span style="color: RGB(0, 1.0, 0)">Texte de couleur</span><br>
<span style="color: RGB(0, 0, 100%)">Texte de couleur</span><br>
<span style="color: CMYK(255, 0, 0, 0)">Texte de couleur</span><br>
<span style="color: CMYK(0, 1.0, 0, 0)">Texte de couleur</span><br>
<span style="color: CMYK(0, 0, 100%, 0)">Texte de couleur</span><br>
<span style="color: CMYK(0, 0, 0, 255)">Texte de couleur</span><br>
<br>
<table>
<tr style="vertical-align: top">
<td>
<u>Exemple 0 :</u><br><br>
<div class="zone" ><?php echo str_replace('XXX', '40', $content); ?></div>
sans overflow
</td>
<td>
<u>Exemple 1 :</u><br><br>
<div class="zone zone_over" style="text-align: left; vertical-align: top; "><?php echo str_replace('XXX', '40', $content); ?></div>
hidden left top
</td>
<td>
<u>Exemple 2 :</u><br><br>
<div class="zone zone_over" style="text-align: center; vertical-align: middle;"><?php echo str_replace('XXX', '40', $content); ?></div>
hidden center middle
</td>
<td>
<u>Exemple 3 :</u><br><br>
<div class="zone zone_over" style="text-align: right; vertical-align: bottom;"><?php echo str_replace('XXX', '40', $content); ?></div>
hidden right bottom
</td>
</tr>
<tr style="vertical-align: top">
<td>
<u>Exemple 0 :</u><br><br>
<div class="zone" ><?php echo str_replace('XXX', '20', $content); ?></div>
sans overflow
</td>
<td>
<u>Exemple 1 :</u><br><br>
<div class="zone zone_over" style="text-align: left; vertical-align: top; "><?php echo str_replace('XXX', '20', $content); ?></div>
hidden left top
</td>
<td>
<u>Exemple 2 :</u><br><br>
<div class="zone zone_over" style="text-align: center; vertical-align: middle;"><?php echo str_replace('XXX', '20', $content); ?></div>
hidden center middle
</td>
<td>
<u>Exemple 3 :</u><br><br>
<div class="zone zone_over" style="text-align: right; vertical-align: bottom;"><?php echo str_replace('XXX', '20', $content); ?></div>
hidden right bottom
</td>
</tr>
</table>
</page>

View File

@ -0,0 +1,87 @@
<page backtop="10mm" backbottom="10mm" backleft="20mm" backright="20mm">
<page_header>
<table style="width: 100%; border: solid 1px black;">
<tr>
<td style="text-align: left; width: 33%">html2pdf</td>
<td style="text-align: center; width: 34%">Test d'header</td>
<td style="text-align: right; width: 33%"><?php echo date('d/m/Y'); ?></td>
</tr>
</table>
</page_header>
<page_footer>
<table style="width: 100%; border: solid 1px black;">
<tr>
<td style="text-align: left; width: 50%">html2pdf.fr</td>
<td style="text-align: right; width: 50%">page [[page_cu]]/[[page_nb]]</td>
</tr>
</table>
</page_footer>
<span style="font-size: 20px; font-weight: bold">Démonstration des retour à la ligne automatique, ainsi que des sauts de page automatique</span><br>
<br>
<br>
<table style="width: 80%;border: solid 1px #5544DD; border-collapse: collapse" align="center">
<thead>
<tr>
<th style="width: 30%; text-align: left; border: solid 1px #337722; background: #CCFFCC">Header 1</th>
<th style="width: 30%; text-align: left; border: solid 1px #337722; background: #CCFFCC">Header 2</th>
</tr>
</thead>
<tbody>
<?php
for ($k=0; $k<13; $k++) {
?>
<tr>
<td style="width: 30%; text-align: left; border: solid 1px #55DD44">
test de texte assez long pour engendrer des retours à la ligne automatique...
a b c d e f g h i j k l m n o p q r s t u v w x y z
a b c d e f g h i j k l m n o p q r s t u v w x y z
</td>
<td style="width: 70%; text-align: left; border: solid 1px #55DD44">
test de texte assez long pour engendrer des retours à la ligne automatique...
a b c d e f g h i j k l m n o p q r s t u v w x y z
a b c d e f g h i j k l m n o p q r s t u v w x y z
</td>
</tr>
<?php
}
?>
</tbody>
<tfoot>
<tr>
<th style="width: 30%; text-align: left; border: solid 1px #337722; background: #CCFFCC">Footer 1</th>
<th style="width: 30%; text-align: left; border: solid 1px #337722; background: #CCFFCC">Footer 2</th>
</tr>
</tfoot>
</table>
<br>
Ca marche !!!<br>
refaisons un test : <br>
<table style="width: 80%;border: solid 1px #5544DD">
<?php
for ($k=0; $k<12; $k++) {
?>
<tr>
<td style="width: 30%; text-align: left; border: solid 1px #55DD44">
test de texte assez long pour engendrer des retours à la ligne automatique...
a b c d e f g h i j k l m n o p q r s t u v w x y z
a b c d e f g h i j k l m n o p q r s t u v w x y z
</td>
<td style="width: 70%; text-align: left; border: solid 1px #55DD44">
test de texte assez long pour engendrer des retours à la ligne automatique...
a b c d e f g h i j k l m n o p q r s t u v w x y z
a b c d e f g h i j k l m n o p q r s t u v w x y z
</td>
</tr>
<?php
}
?>
</table>
<br>
Ca marche toujours !<br>
De plus, vous pouvez faire des sauts de page manuellement en utilisant les balises &lt;page&gt; &lt;/page&gt;, comme ici par exemple :
</page>
<page pageset="old">
Nouvelle page !!!!
</page>

View File

@ -0,0 +1,89 @@
<style type="text/css">
<!--
div.special { margin: auto; width:95%; border:1px solid #000000; padding: 2px; }
div.special table { width:100%; border:1px solid #000000; font-size:10px; border-collapse:collapse; }
.topLeftRight { border-top:1px solid #000; border-left:1px solid #000; border-right:1px solid #000;}
.topLeftBottom { border-top:1px solid #000; border-left:1px solid #000; border-bottom:1px solid #000; }
.topLeft { border-top:1px solid #000; border-left:1px solid #000; }
.bottomLeft { border-bottom:1px solid #000; border-left:1px solid #000; }
.topRight { border-top:1px solid #000; border-right:1px solid #000; }
.bottomRight { border-bottom:1px solid #000; border-right:1px solid #000; }
.topRightBottom { border-top:1px solid #000; border-bottom:1px solid #000; border-right:1px solid #000; }
-->
</style>
<page style="font-size: 16px" >
Vous pouvez choisir le format et l'orientation de votre document, en utilisant ceci :<br>
<br>
&lt;page orientation="portrait" format="A5" &gt; <i>A5 en portrait</i> &lt;/page&gt; <br>
<br>
&lt;page orientation="paysage" format="100x200" &gt; <i>100mm x 200mm en paysage</i> &lt;/page&gt;<br>
<br>
En voici un petit exemple !
</page>
<page orientation="paysage" style="font-size: 18px">
Ceci est une page en paysage<br>
<table style="width: 100%; border: solid 1px #FFFFFF;">
<tr>
<td style="width: 30%; border: solid 1px #FF0000;">AAA</td>
<td style="width: 40%; border: solid 1px #00FF00;">BBB</td>
<td style="width: 30%; border: solid 1px #0000FF;">CCC</td>
</tr>
<tr>
<td style="width: 30%; border: solid 1px #FF0000;">AAA</td>
<td style="width: 40%; border: solid 1px #00FF00;">BBB</td>
<td style="width: 30%; border: solid 1px #0000FF;">CCC</td>
</tr>
<tr>
<td style="width: 30%; border: solid 1px #FF0000;">AAA</td>
<td style="width: 40%; border: solid 1px #00FF00;">BBB</td>
<td style="width: 30%; border: solid 1px #0000FF;">CCC</td>
</tr>
</table>
<div style="width: 70%; border: solid 1mm #770000; margin: 1mm; padding: 2mm; font-size: 4mm; line-height: normal; text-align: justify">
<img src="./res/logo.gif" alt="logo html2pdf" style="float: left; width: 60mm; margin: 2mm;">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed elementum, nibh eu ultricies scelerisque, est lorem dignissim elit, quis tempus tortor eros non ipsum. Mauris convallis augue ac sapien. In scelerisque dignissim elit. Donec consequat semper lectus. Sed in quam. Nunc molestie hendrerit ipsum. Curabitur elit risus, rhoncus ut, mattis a, convallis eu, neque. Morbi luctus est sit amet nunc. In nisl. Donec magna libero, aliquet eu, vestibulum ut, mollis sed, felis.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed elementum, nibh eu ultricies scelerisque, est lorem dignissim elit, quis tempus tortor eros non ipsum. Mauris convallis augue ac sapien. In scelerisque dignissim elit. Donec consequat semper lectus. Sed in quam. Nunc molestie hendrerit ipsum. Curabitur elit risus, rhoncus ut, mattis a, convallis eu, neque. Morbi luctus est sit amet nunc. In nisl. Donec magna libero, aliquet eu, vestibulum ut, mollis sed, felis.
</div>
<div style="width: 70%; border: solid 1mm #770000; margin: 1mm; padding: 2mm; font-size: 4mm; line-height: 150%;text-align: right;">
<img src="./res/logo.gif" alt="logo html2pdf" style="float: right; width: 60mm; margin: 2mm; ">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed elementum, nibh eu ultricies scelerisque, est lorem dignissim elit, quis tempus tortor eros non ipsum. Mauris convallis augue ac sapien. In scelerisque dignissim elit. Donec consequat semper lectus. Sed in quam. Nunc molestie hendrerit ipsum. Curabitur elit risus, rhoncus ut, mattis a, convallis eu, neque. Morbi luctus est sit amet nunc. In nisl. Donec magna libero, aliquet eu, vestibulum ut, mollis sed, felis.
</div>
<fieldset style="width: 70%; border: solid 1mm #770000; margin: 1mm; padding: 2mm; padding-top: 0mm; font-size: 4mm; line-height: normal; background: #FFFFFF;">
<legend style=" background: #FFFFFF; padding: 1; border: solid 1px #440000;">Ceci est un exemple de fieldset</legend>
<img src="./res/logo.gif" alt="logo html2pdf" style="float: left; width: 60mm; margin: 2mm; ">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed elementum, nibh eu ultricies scelerisque, est lorem dignissim elit, quis tempus tortor eros non ipsum. Mauris convallis augue ac sapien. In scelerisque dignissim elit. Donec consequat semper lectus. Sed in quam. Nunc molestie hendrerit ipsum. Curabitur elit risus, rhoncus ut, mattis a, convallis eu, neque. Morbi luctus est sit amet nunc. In nisl. Donec magna libero, aliquet eu, vestibulum ut, mollis sed, felis.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed elementum, nibh eu ultricies scelerisque, est lorem dignissim elit, quis tempus tortor eros non ipsum. Mauris convallis augue ac sapien. In scelerisque dignissim elit. Donec consequat semper lectus. Sed in quam. Nunc molestie hendrerit ipsum. Curabitur elit risus, rhoncus ut, mattis a, convallis eu, neque. Morbi luctus est sit amet nunc. In nisl. Donec magna libero, aliquet eu, vestibulum ut, mollis sed, felis.
</fieldset>
</page>
<page orientation="portrait" format="150x200" style="font-size: 18px">
Ceci est une page en portrait de 150mm x 200mm<br>
<table style="width: 100%; border: solid 1px #FFFFFF;">
<tr>
<td style="width: 30%; border: solid 1px #FF0000;">AAA</td>
<td style="width: 40%; border: solid 1px #00FF00;">BBB</td>
<td style="width: 30%; border: solid 1px #0000FF;">CCC</td>
</tr>
<tr>
<td style="width: 30%; border: solid 1px #FF0000;">AAA</td>
<td style="width: 40%; border: solid 1px #00FF00;">BBB</td>
<td style="width: 30%; border: solid 1px #0000FF;">CCC</td>
</tr>
<tr>
<td style="width: 30%; border: solid 1px #FF0000;">AAA</td>
<td style="width: 40%; border: solid 1px #00FF00;">BBB</td>
<td style="width: 30%; border: solid 1px #0000FF;">CCC</td>
</tr>
</table>
<br>
<div class="special">
<table>
<tr>
<td colspan="2" class="topLeftRight" style="width: 100%; text-align:left;border-bottom:1px dashed #000000">blabla blabla</td>
</tr>
<tr>
<td class="bottomLeft" style="width:70%;border-right:1px dashed #000000;text-align:left;">blabla blabla</td>
<td class="bottomRight" style="width: 30%; text-align:left;vertical-align:top;">Date :<br /> Signature :</td>
</tr>
</table>
</div>
</page>

View File

@ -0,0 +1,87 @@
<style type="text/css">
<!--
table
{
width: 100%;
border: solid 1px #5544DD;
}
th
{
text-align: center;
border: solid 1px #113300;
background: #EEFFEE;
}
td
{
text-align: left;
border: solid 1px #55DD44;
}
td.col1
{
border: solid 1px red;
text-align: right;
}
end_last_page div
{
border: solid 1mm red;
height: 27mm;
margin: 0;
padding: 0;
text-align: center;
font-weight: bold;
}
-->
</style>
<span style="font-size: 20px; font-weight: bold">Démonstration des retour à la ligne automatique, ainsi que des sauts de page automatique<br></span>
<br>
<br>
<table>
<colgroup>
<col style="width: 5%" class="col1">
<col style="width: 25%">
<col style="width: 30%">
<col style="width: 40%">
</colgroup>
<thead>
<tr>
<th rowspan="2"></th>
<th colspan="3" style="font-size: 16px;">
Titre du tableau
</th>
</tr>
<tr>
<th>Colonne 1</th>
<th>Colonne 2</th>
<th>Colonne 3</th>
</tr>
</thead>
<?php
for ($k=0; $k<50; $k++) {
?>
<tr>
<td><?php echo $k; ?></td>
<td>test de texte assez long pour engendrer des retours à la ligne automatique...</td>
<td>test de texte assez long pour engendrer des retours à la ligne automatique...</td>
<td>test de texte assez long pour engendrer des retours à la ligne automatique...</td>
</tr>
<?php
}
?>
<tfoot>
<tr>
<th colspan="4" style="font-size: 16px;">
bas du tableau
</th>
</tr>
</tfoot>
</table>
Cool non ?<br>
<end_last_page end_height="30mm">
<div>
Ceci est un test de fin de page
</div>
</end_last_page>

View File

@ -0,0 +1,12 @@
.titre
{
text-decoration: underline;
}
* {color: #FF0000; }
H1 {color: #AA0055; }
H2 {color: #990066; }
H3 {color: #880077; }
H4 {color: #770088; }
H5 {color: #660099; }
H6 {color: #5500AA; }

View File

@ -0,0 +1,45 @@
<link type="text/css" href="./res/example06.css" rel="stylesheet" />
<style type="text/css">
<!--
/* commentaire dans un css */
table, td { border: solid 1px #000000; color: #0000AA; }
td.col1 { color: #00AA00; }
/* autre commentaire */
table.liste { border: solid 2px #FF0000; }
table.liste td { background: #DDDDDD; }
table.liste td.col1 { color: #FF0000; }
-->
</style>
<page>
<table>
<tr>
<td>Ceci est un</td>
<td class="col1">test de style</td>
</tr>
</table>
<br>
<table class="liste">
<tr>
<td>Ceci est un</td>
<td class="col1">test de style</td>
</tr>
</table>
<br>
<H1>Essai de titre en H1</H1>
<H2>Essai de titre en H2</H2>
<H3>Essai de titre en H3</H3>
<H4>Essai de titre en H4</H4>
<H5>Essai de titre en H5</H5>
<H6>Essai de titre en H6</H6>
<H6 class="titre">Essai de titre en H6</H6>
<H5 class="titre">Essai de titre en H5</H5>
<H4 class="titre">Essai de titre en H4</H4>
<H3 class="titre">Essai de titre en H3</H3>
<H2 class="titre">Essai de titre en H2</H2>
<H1 class="titre">Essai de titre en H1</H1>
<br>
<s>Texte barré !</s><br>
<br>
<span>Texte avec la couleur par défault (style *)</span><br>
</page>

View File

@ -0,0 +1,138 @@
<style type="text/css">
<!--
table { vertical-align: top; }
tr { vertical-align: top; }
td { vertical-align: top; }
-->
</style>
<page backcolor="#FEFEFE" backimg="./res/bas_page.png" backimgx="center" backimgy="bottom" backimgw="100%" backtop="0" backbottom="30mm" footer="date;time;page" style="font-size: 12pt">
<bookmark title="Lettre" level="0" ></bookmark>
<table cellspacing="0" style="width: 100%; text-align: center; font-size: 14px">
<tr>
<td style="width: 75%;">
</td>
<td style="width: 25%; color: #444444;">
<img style="width: 100%;" src="./res/logo.gif" alt="Logo"><br>
RELATION CLIENT
</td>
</tr>
</table>
<br>
<br>
<table cellspacing="0" style="width: 100%; text-align: left; font-size: 11pt;">
<tr>
<td style="width:50%;"></td>
<td style="width:14%; ">Client :</td>
<td style="width:36%">M. Albert Dupont</td>
</tr>
<tr>
<td style="width:50%;"></td>
<td style="width:14%; ">Adresse :</td>
<td style="width:36%">
Résidence perdue<br>
1, rue sans nom<br>
00 000 - Pas de Ville<br>
</td>
</tr>
<tr>
<td style="width:50%;"></td>
<td style="width:14%; ">Email :</td>
<td style="width:36%">nomail@domain.com</td>
</tr>
<tr>
<td style="width:50%;"></td>
<td style="width:14%; ">Tel :</td>
<td style="width:36%">33 (0) 1 00 00 00 00</td>
</tr>
</table>
<br>
<br>
<table cellspacing="0" style="width: 100%; text-align: left;font-size: 10pt">
<tr>
<td style="width:50%;"></td>
<td style="width:50%; ">Spipu Ville, le <?php echo date('d/m/Y'); ?></td>
</tr>
</table>
<br>
<i>
<b><u>Objet </u>: &laquo; Bon de Retour &raquo;</b><br>
Compte client : 00C4520100A<br>
Référence du Dossier : 71326<br>
</i>
<br>
<br>
Madame, Monsieur, Cher Client,<br>
<br>
<br>
Nous souhaitons vous informer que le dossier <b>71326</b> concernant un &laquo; Bon de Retour &raquo; pour les articles suivants a été accepté.<br>
<br>
<table cellspacing="0" style="width: 100%; border: solid 1px black; background: #F7F7F7; font-size: 10pt;">
<colgroup>
<col style="width: 12%; text-align: left">
<col style="width: 52%; text-align: left">
<col style="width: 13%; text-align: right">
<col style="width: 10%; text-align: center">
<col style="width: 13%; text-align: right">
</colgroup>
<thead>
<tr style="background: #E7E7E7;">
<th style="border-bottom: solid 1px black;">Produit</th>
<th style="border-bottom: solid 1px black;">Désignation</th>
<th style="border-bottom: solid 1px black;">Prix Unitaire</th>
<th style="border-bottom: solid 1px black;">Quantité</th>
<th style="border-bottom: solid 1px black;">Prix Net</th>
</tr>
</thead>
<tbody>
<?php
$nb = rand(5, 11);
$produits = array();
$total = 0;
for ($k=0; $k<$nb; $k++) {
$num = rand(100000, 999999);
$nom = "le produit n°".rand(1, 100);
$qua = rand(1, 20);
$prix = rand(100, 9999)/100.;
$total+= $prix*$qua;
$produits[] = array($num, $nom, $qua, $prix, rand(0, $qua));
?>
<tr>
<td><?php echo $num; ?></td>
<td><?php echo $nom; ?></td>
<td><?php echo number_format($prix, 2, ',', ' '); ?> &euro;</td>
<td><?php echo $qua; ?></td>
<td><?php echo number_format($prix*$qua, 2, ',', ' '); ?> &euro;</td>
</tr>
<?php
}
?>
<tr style="background: #E7E7E7;">
<th colspan="4" style="border-top: solid 1px black; text-align: right;">Total : </th>
<th style="border-top: solid 1px black;"><?php echo number_format($total, 2, ',', ' '); ?> &euro;</th>
</tr>
</tbody>
</table>
<br>
Cette reprise concerne la quantité et les matériels dont la référence figure sur le <a href="#document_reprise">document de reprise joint</a>.<br>
Nous vous demandons de nous retourner ces produits en parfait état et dans leur emballage d'origine.<br>
<br>
Nous vous demandons également de coller impérativement l'autorisation de reprise jointe, sur le colis à reprendre afin de faciliter le traitement à l'entrepôt.<br>
<br>
Notre Service Clients ne manquera pas de revenir vers vous dès que l'avoir de ces matériels sera établi.<br>
<nobreak>
<br>
Dans cette attente, nous vous prions de recevoir, Madame, Monsieur, Cher Client, nos meilleures salutations.<br>
<br>
<table cellspacing="0" style="width: 100%; text-align: left;">
<tr>
<td style="width:50%;"></td>
<td style="width:50%; ">
Mle Jesuis CELIBATAIRE<br>
Service Relation Client<br>
Tel : 33 (0) 1 00 00 00 00<br>
Email : on_va@chez.moi<br>
</td>
</tr>
</table>
</nobreak>
</page>

View File

@ -0,0 +1,176 @@
<page orientation="paysage" >
<bookmark title="Document" level="0" ></bookmark>
<a name="document_reprise"></a>
<table cellspacing="0" style="width: 100%;">
<tr>
<td style="width: 10%;">
<img style="width: 100%" src="./res/logo.gif" alt="Logo Html2Pdf" >
</td>
<td style="width: 80%; text-align: center; text-decoration: underline; font-weight: bold; font-size: 20pt;">
<span style="font-size: 10pt"><br></span>
ACCORD DE RETOUR
</td>
<td style="width: 10%;">
</td>
</tr>
</table>
<table cellspacing="0" style="width: 100%;">
<tr>
<td style="width: 55% ">
<table cellspacing="0" style="width: 100%; border: solid 2px #000000; ">
<tr>
<td style="width: 100%; font-size: 12pt;">
<span style="font-size: 15pt; font-weight: bold;">ADRESSE DE RETOUR<br></span>
<br>
<b>Entrepot des Bois</b><br>
sur une grande route<br>
00000 - Spipu Ville<br>
<br>
Date : <?php echo date('d/m/Y'); ?><br>
Dossier suivi par <b>Mle Jesuis CELIBATAIRE</b><br>
Tel : 33 (0) 1 00 00 00 00<br>
Email : on_va@chez.moi<br>
</td>
</tr>
</table>
<br>&nbsp;
</td>
<td style="width: 4%"></td>
<td style="width: 37% ">
<table cellspacing="0" style="width: 100%; border: solid 2px #000000; font-size: 12pt;">
<tr><td style="width: 40%;">Référence : </td><td style="width: 60%;">71326</td></tr>
<tr><td style="width: 40%;">Client : </td><td style="width: 60%;">M. Albert Dupont</td></tr>
<tr><td style="width: 40%;">Adresse : </td><td style="width: 60%;">Résidence perdue<br>1, rue sans nom<br>00 000 - Pas de Ville</td></tr>
<tr><td style="width: 40%;">TEL : </td><td style="width: 60%;">33 (0) 1 00 00 00 00</td></tr>
<tr><td style="width: 40%;">FAX : </td><td style="width: 60%;">33 (0) 1 00 00 00 01</td></tr>
<tr><td style="width: 40%;">Code Client : </td><td style="width: 60%;">00C4520100A</td></tr>
</table>
<table cellspacing="0" style="width: 100%; border: solid 2px #000000">
<tr>
<th style="width: 40%;">Motif de la Reprise</th>
<td style="width: 60%;">Produit non Conforme</td>
</tr>
</table>
<br>
</td>
<td style="width: 4%"></td>
</tr>
<tr>
<td style="width:55%;">
<table cellspacing="0" style="padding: 1px; width: 100%; border: solid 2px #000000; font-size: 11pt; ">
<tr>
<th style="width: 100%; text-align: center; border: solid 1px #000000;" colspan="4">
Partie réservée à Spipu Corp
</th>
</tr>
<tr>
<th style="width: 100%; text-align: center; border: solid 1px #000000;" colspan="4">
QUANTITE PREVUE AU CHARGEMENT
</th>
</tr>
<tr>
<th style="width: 15%; border: solid 1px #000000;">Produit</th>
<th style="width: 55%; border: solid 1px #000000;">Designation</th>
<th style="width: 15%; border: solid 1px #000000;">Neuf</th>
<th style="width: 15%; border: solid 1px #000000;">Abîmé</th>
</tr>
<?php
$i=0;
foreach ($produits as $produit) {
$i++;
?>
<tr>
<td style="width: 15%; border: solid 1px #000000;"><?php echo $produit[0]; ?></td>
<td style="width: 55%; border: solid 1px #000000;text-align: left;"><?php echo $produit[1]; ?></td>
<td style="width: 15%; border: solid 1px #000000;"><?php echo $produit[4]; ?></td>
<td style="width: 15%; border: solid 1px #000000;"><?php echo $produit[2]-$produit[4]; ?></td>
</tr>
<?php
}
for ($i; $i<12; $i++) {
?>
<tr>
<td style="width: 15%; border: solid 1px #000000;">&nbsp;</td>
<td style="width: 55%; border: solid 1px #000000;">&nbsp;</td>
<td style="width: 15%; border: solid 1px #000000;">&nbsp;</td>
<td style="width: 15%; border: solid 1px #000000;">&nbsp;</td>
</tr>
<?php
}
?>
</table>
<br>
<table cellspacing="0" style="width: 100%; text-align: left; font-size: 8pt">
<tr>
<td style="width: 100%">
<b><u>Conditions des Retours</u></b><br>
1 - il faut des conditions<br>
2 - encore des conditions<br>
3 - toujours des conditions<br>
</td>
</tr>
</table>
<br>
<table cellspacing="0" style="width: 100%; border: solid 2px #000000; text-align: center; font-size: 10pt">
<tr>
<td style="width: 30%"></td>
<td style="width: 40%">ACCORD SOCIETE</td>
<td style="width: 30%"></td>
</tr>
<tr>
<td style="width: 30%"><br><br>M. XX</td>
<td style="width: 40%"></td>
<td style="width: 30%"><br><br>Mme XY</td>
</tr>
</table>
</td>
<td style="width: 4%"></td>
<td style="width: 37%;">
<table cellspacing="0" style="padding: 1px; width: 100%; border: solid 2px #000000; font-size: 11pt; ">
<tr>
<th style="width: 100%; text-align: center; border: solid 1px #000000;" colspan="2">
Partie réservée à l'entrepôt
</th>
</tr>
<tr>
<th style="width: 100%; text-align: center; border: solid 1px #000000;" colspan="2">
QUANTITE PREVUE AU CHARGEMENT
</th>
</tr>
<tr>
<th style="width: 50%; border: solid 1px #000000;">Produit neuf </th>
<th style="width: 50%; border: solid 1px #000000;">Produit à reconditionner </th>
</tr>
<?php
for ($i=0; $i<12; $i++) {
?>
<tr>
<td style="width: 50%; border: solid 1px #000000;">&nbsp;</td>
<td style="width: 50%; border: solid 1px #000000;">&nbsp;</td>
</tr>
<?php
}
?>
</table>
<br>
<table cellspacing="0" style="width: 100%; border: solid 2px #000000; text-align: left; font-size: 10pt">
<tr>
<th style="width: 30%;">
Commentaire<br>
Retour :<br>
&nbsp;<br>
&nbsp;<br>
</th>
<td style="width: 70%;">
</td>
</tr>
</table>
<br>
<br>
<span style="font-size: 13pt"><b><u>A COLLER IMPERATIVEMENT SUR LES COLIS</u></b></span>
</td>
<td style="width: 4%"></td>
</tr>
</table>
</page>

View File

@ -0,0 +1,114 @@
<style type="text/css">
<!--
table
{
padding: 0;
border: solid 1mm LawnGreen;
font-size: 12pt;
background: #FFFFFF;
text-align: center;
vertical-align: middle;
}
td
{
padding: 1mm;
border: solid 1mm black;
}
td.div
{
width: 110px;
height: 110px;
text-align: left;
padding: 0
}
td.div div
{
margin: auto;
background: yellow;
border: solid 2px blue;
color: red;
width: 100px;
height: 65px;
text-align: center;
}
-->
</style>
<page backcolor="#AACCFF" backleft="5mm" backright="5mm" backtop="10mm" backbottom="10mm" >
<table>
<tr>
<td class="div"><div style="rotate: 0;">Hello ! ceci <b>est</b> un test !<br><img src="./res/logo.png" style="width: 80px;" alt="logo"></div></td>
<td class="div"><div style="rotate: 270;">Hello ! ceci <b>est</b> un test !<br><img src="./res/logo.png" style="width: 80px;" alt="logo"></div></td>
</tr>
<tr>
<td class="div"><div style="rotate: 90;">Hello ! ceci <b>est</b> un test !<br><img src="./res/logo.png" style="width: 80px;" alt="logo"></div></td>
<td class="div"><div style="rotate: 180;">Hello ! ceci <b>est</b> un test !<br><img src="./res/logo.png" style="width: 80px;" alt="logo"></div></td>
</tr>
</table>
<br>
<table cellspacing="4">
<tr>
<td>a A1</td>
<td>aa A2</td>
<td>aaa A3</td>
<td>aaaa A4</td>
</tr>
<tr>
<td rowspan="2">B1</td>
<td style="font-size: 16pt">B2</td>
<td colspan="2">B3</td>
</tr>
<tr>
<td>C1</td>
<td>C2</td>
<td>C3</td>
</tr>
<tr>
<td colspan="2">D1</td>
<td colspan="2">D2</td>
</tr>
</table>
<hr>
<table>
<tr>
<td colspan="2">CoucouCoucou !</td>
<td>B</td>
<td>CC</td>
</tr>
<tr>
<td>AA</td>
<td colspan="2">CoucouCoucou !</td>
<td>CC</td>
</tr>
<tr>
<td>AA</td>
<td>B</td>
<td colspan="2">CoucouCoucou !</td>
</tr>
</table>
<hr>
<table style="background: #FFFFFF">
<tr>
<td>AA</td>
<td>AA</td>
<td>AA</td>
<td rowspan="2">AA</td>
</tr>
<tr>
<td>AA</td>
<td rowspan="2" colspan="2" >CoucouCoucou !</td>
</tr>
<tr>
<td>AA</td>
<td>CC</td>
</tr>
<tr>
<td colspan="2">D1</td>
<td colspan="2">D2</td>
</tr>
</table>
<hr>
</page>

View File

@ -0,0 +1,35 @@
<?php
$px = isset($_GET['px']) ? $_GET['px'] : 0;
$px = preg_replace('/[^0-9]/isU', '', $px);
$py = isset($_GET['py']) ? $_GET['py'] : 0;
$py = preg_replace('/[^0-9]/isU', '', $py);
if ($px<1) {
$px = 5;
}
if ($py<1) {
$py = 5;
}
if ($px>20) {
$px = 20;
}
if ($py>20) {
$py = 20;
}
$width = 100;
$height = 100;
$im = imagecreatetruecolor($width, $height);
for ($y=0; $y<$height; $y+= $py) {
for ($x=0; $x<$width; $x+= $px) {
$c = imagecolorallocate($im, 200-$x, 100+$y, 100+$x-$y);
imagefilledrectangle($im, $x, $y, $x+$px, $y+$py, $c);
}
}
header("Content-type: image/png");
imagepng($im);
imagedestroy($im);

View File

@ -0,0 +1,120 @@
<style type="text/css">
<!--
div.minifiche
{
position: relative;
overflow: hidden;
width: 454px;
height: 138px;
padding: 0;
font-size: 11px;
text-align: left;
font-weight: normal;
background-image: url(./res/example10a.gif);
}
div.minifiche img.icone { position: absolute; border: none; left: 5px; top: 5px; width: 240px; height: 128px;overflow: hidden; }
div.minifiche div.zone1 { position: absolute; border: none; left: 257px; top: 8px; width: 188px; height: 14px; padding-top: 1px; overflow: hidden; text-align: center; font-weight: bold; }
div.minifiche div.zone2 { position: absolute; border: none; left: 315px; top: 28px; width: 131px; height: 14px; padding-top: 1px; overflow: hidden; text-align: left; font-weight: normal; }
div.minifiche div.zone3 { position: absolute; border: none; left: 315px; top: 48px; width: 131px; height: 14px; padding-top: 1px; overflow: hidden; text-align: left; font-weight: normal; }
div.minifiche div.zone4 { position: absolute; border: none; left: 315px; top: 68px; width: 131px; height: 14px; padding-top: 1px; overflow: hidden; text-align: left; font-weight: normal; }
div.minifiche div.zone5 { position: absolute; border: none; left: 315px; top: 88px; width: 131px; height: 14px; padding-top: 1px; overflow: hidden; text-align: left; font-weight: normal; }
div.minifiche div.download { position: absolute; border: none; left: 257px; top: 108px;width: 188px; height: 22px; overflow: hidden; text-align: center; font-weight: normal; }
-->
</style>
<page>
<div style="position: absolute; width: 10mm; height: 10mm; left: 0; top: 0; border: solid 2px #0000EE; background: #AAAAEE"></div>
<div style="position: absolute; width: 10mm; height: 10mm; right: 0; top: 0; border: solid 2px #00EE00; background: #AAEEAA"></div>
<div style="position: absolute; width: 10mm; height: 10mm; left: 0; bottom: 0; border: solid 2px #EE0000; background: #EEAAAA"></div>
<div style="position: absolute; width: 10mm; height: 10mm; right: 0; bottom: 0; border: solid 2px #EEEE00; background: #EEEEAA"></div>
<table style="width: 100%">
<tr>
<td style="text-indent: 10mm; border: solid 1px #007700; width: 80%">
<p>
Ligne dans un paragraphe,
test de texte assez long pour engendrer des retours à la ligne automatique... a b c d e f g h i j k l m n o p q r s t u v w x y z a b c d e f g h i j k l m n o p q r s t u v w x y z
test de texte assez long pour engendrer des retours à la ligne automatique... a b c d e f g h i j k l m n o p q r s t u v w x y z a b c d e f g h i j k l m n o p q r s t u v w x y z
</p>
<p>
Ligne dans un paragraphe,
test de texte assez long pour engendrer des retours à la ligne automatique... a b c d e f g h i j k l m n o p q r s t u v w x y z a b c d e f g h i j k l m n o p q r s t u v w x y z
test de texte assez long pour engendrer des retours à la ligne automatique... a b c d e f g h i j k l m n o p q r s t u v w x y z a b c d e f g h i j k l m n o p q r s t u v w x y z
</p>
</td>
<td style="border: solid 1px #000077; width: 20%">
Test de paragraphe :)
</td>
</tr>
</table>
<hr>
<div class="minifiche" >
<img class="icone" src="./res/example10b.jpg" alt="Html2Pdf" >
<div class="zone1">Html2Pdf</div>
<div class="zone2">PHP</div>
<div class="zone3">Utilitaire</div>
<div class="zone4">1.00</div>
<div class="zone5">01/01/1901</div>
<div class="download"><img src="./res/example10c.gif" alt="" style="border: none;"></div>
</div>
<hr>
<div style="border: solid 1px #000000; margin: 0; padding: 0; background: rgb(255, 255, 255); width: 400px; height: 300px; position: relative;">
<div style="border-style: solid; border-color: transparent rgb(170, 34, 34) rgb(170, 34, 34) transparent; border-width: 39.5px 59px; position: absolute; left: 101px; top: 52px; height: 0pt; width: 0pt;"></div>
<div style="border-style: solid; border-color: rgb(34, 170, 34) rgb(34, 170, 34) transparent transparent; border-width: 59px 39.5px; position: absolute; left: 101px; top: 131px; height: 0pt; width: 0pt;"></div>
<div style="border-style: solid; border-color: rgb(34, 34, 170) transparent transparent rgb(34, 34, 170); border-width: 39.5px 59px; position: absolute; left: 180px; top: 170px; height: 0pt; width: 0pt;"></div>
<div style="border-style: solid; border-color: transparent transparent rgb(170, 170, 34) rgb(170, 170, 34); border-width: 59px 39.5px; position: absolute; left: 219px; top: 52px; height: 0pt; width: 0pt;"></div>
<div style="position: absolute; left: 10px; top: 10px; font-size: 20px; font-family: Arial;">Exemple</div>
</div>
<hr>
<pre><?php
ob_start();
readfile(dirname(__FILE__).'/../example10.php');
echo htmlentities(ob_get_clean());
?></pre>
</page>
<page orientation="paysage" >
<style type="text/css">
<!--
div.main
{
padding: 0;
margin: 0;
position: relative;
left: 50%;
margin-left: -80mm;
width: 160mm;
height: 100mm;
text-align: center;
border: solid 10px #111111;
background: #222222;
color: #FFFFFF;
font-size: 10pt;
font-weight: bold;
text-align: center;
}
div.main a
{
text-decoration: none;
color: #EEEEEE;
}
div.main a:hover
{
text-decoration: underline;
color: #FFFFFF;
}
-->
</style>
<div class="main">
<div style="position: absolute; top: 5mm; left: 5mm; font-size:12pt;text-align: left;">Spipu.net</div><br>
<div style="position: absolute; bottom: 5mm; right: 5mm; font-size:12pt; text-align: right; ">(c)<?php echo date('Y'); ?> Spipu</div>
<br><br><br>
<a href="http://cineblog.spipu.net/" >Cineblog by Spipu </a><br><br>
<a href="http://html2pdf.fr/" >Html2Pdf </a><br><br>
<a href="http://lambda.spipu.net/" >Lambda Finder </a><br><br>
<a href="http://open.spipu.net/" >Gestion des Opens - Yaronet </a><br><br>
<a href="http://perso.spipu.net/" >A propos de moi </a><br><br>
<a href="http://prgm.spipu.net/" >Programmes by Spipu </a><br><br>
<br><br><br>
</div>
</page>

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 625 B

View File

@ -0,0 +1,27 @@
<div style="border: 1px solid rgb(0, 0, 0); margin: 0; padding: 0; background: rgb(255, 255, 255); width: 400px; height: 300px;">
<div style="border-style: solid; border-color: transparent rgb(170, 34, 170) rgb(170, 34, 170) transparent; border-width: 18px 56px; position: absolute; left: 111px; top: 69px; height: 0pt; width: 0pt;"></div><div style="border-style: solid; border-color: rgb(170, 34, 170) transparent transparent rgb(170, 34, 170); border-width: 18px 9px; position: absolute; left: 223px; top: 69px; height: 0pt; width: 0pt;"></div><div style="border-style: solid; border-color: transparent rgb(170, 34, 170) rgb(170, 34, 170) transparent; border-width: 3px 9px; position: absolute; left: 223px; top: 63px; height: 0pt; width: 0pt;"></div><div style="border-style: solid; border-color: rgb(170, 34, 170) transparent transparent rgb(170, 34, 170); border-width: 3px 1.5px; position: absolute; left: 241px; top: 63px; height: 0pt; width: 0pt;"></div><div style="border-style: solid; border-color: transparent rgb(170, 34, 170) rgb(170, 34, 170) transparent; border-width: 0.5px 1.5px; position: absolute; left: 241px; top: 62px; height: 0pt; width: 0pt;"></div><div style="border-style: solid; border-color: rgb(170, 34, 170) rgb(170, 34, 170) transparent transparent; border-width: 67px 22px; position: absolute; left: 111px; top: 105px; height: 0pt; width: 0pt;"></div><div style="border-style: solid; border-color: rgb(170, 34, 170) transparent transparent rgb(170, 34, 170); border-width: 67px 34px; position: absolute; left: 155px; top: 105px; height: 0pt; width: 0pt;"></div><div style="border-style: solid; border-color: transparent rgb(34, 170, 170) rgb(34, 170, 170) transparent; border-width: 67px 33.5px; position: absolute; left: 178px; top: 61px; height: 0pt; width: 0pt;"></div><div style="border-style: solid; border-color: transparent transparent rgb(34, 170, 170) rgb(34, 170, 170); border-width: 67px 22px; position: absolute; left: 245px; top: 61px; height: 0pt; width: 0pt;"></div><div style="border-style: solid; border-color: rgb(34, 170, 170) transparent transparent rgb(34, 170, 170); border-width: 18px 55.5px; position: absolute; left: 178px; top: 195px; height: 0pt; width: 0pt;"></div><div style="border-style: solid; border-color: transparent rgb(34, 170, 170) rgb(34, 170, 170) transparent; border-width: 18px 9px; position: absolute; left: 160px; top: 195px; height: 0pt; width: 0pt;"></div><div style="border-style: solid; border-color: rgb(34, 170, 170) transparent transparent rgb(34, 170, 170); border-width: 3px 9px; position: absolute; left: 160px; top: 231px; height: 0pt; width: 0pt;"></div><div style="border-style: solid; border-color: transparent rgb(34, 170, 170) rgb(34, 170, 170) transparent; border-width: 3px 1.5px; position: absolute; left: 157px; top: 231px; height: 0pt; width: 0pt;"></div><div style="border-style: solid; border-color: rgb(34, 170, 170) transparent transparent rgb(34, 170, 170); border-width: 0.5px 1.5px; position: absolute; left: 157px; top: 237px; height: 0pt; width: 0pt;"></div>
</div>
<hr>
<table style="width:100%;">
<tr>
<td id="mon_td_trop_grand" style="width:100%;">
Test de TD très grand, en désactivant le test de TD ne devant pas depasser une page<br>
via la méthode <b>setTestTdInOnePage</b>.<br>
<table style="width:100%;">
<?php
for ($i=0; $i<=40; $i++) {
?>
<tr>
<td style="border:1px solid red;width:100%;">
test de texte assez long pour engendrer des retours à la ligne automatique...
a b c d e f g h i j k l m n o p q r s t u v w x y z
a b c d e f g h i j k l m n o p q r s t u v w x y z
</td>
</tr>
<?php
}
?>
</table>
</td>
</tr>
</table>

View File

@ -0,0 +1,114 @@
<?php
$chaine = 'test de texte assez long pour engendrer des retours à la ligne automatique...';
$chaine.= ', répétitif car besoin d\'un retour à la ligne';
$chaine.= ', répétitif car besoin d\'un retour à la ligne';
$chaine.= ', répétitif car besoin d\'un retour à la ligne';
$chaine.= ', répétitif car besoin d\'un retour à la ligne';
?>
<style type="text/css">
<!--
ul
{
background: #FFDDDD;
border: solid 1px #FF0000;
}
ol
{
background: #DDFFDD;
border: solid 1px #00FF00;
}
ul li
{
background: #DDFFAA;
border: solid 1px #AAFF00;
}
ol li
{
background: #AADDFF;
border: solid 1px #00AAFF;
}
-->
</style>
<page style="font-size: 11px">
<ul style="list-style-type: disc; width: 80%">
<li>
Point 1 :<br><?php echo $chaine; ?>
</li>
<li>
Point 2 :<br><?php echo $chaine; ?>
<ul style="list-style-type: circle">
<li>
Point 1 :<br><?php echo $chaine; ?>
</li>
<li>
Point 2 :<br><?php echo $chaine; ?>
<ul style="list-style-type: square">
<li>
Point 1 :<br><?php echo $chaine; ?>
</li>
<li>
Point 2 :<br><?php echo $chaine; ?>
</li>
<li>
Point 3 :<br><?php echo $chaine; ?>
<ul style="list-style-image: url(./res/puce.gif)">
<li>
Puce en image 1 :<br><?php echo $chaine; ?>
</li>
<li>
Puce en image 2 :<br><?php echo $chaine; ?>
</li>
<li>
Puce en image 3 :<br><?php echo $chaine; ?>
</li>
</ul>
</li>
</ul>
</li>
<li>
Point 3 :<br><?php echo $chaine; ?>
</li>
</ul>
</li>
<li>
Point 3 :<br><?php echo $chaine; ?>
</li>
</ul>
<hr><hr>
<ol style="list-style-type: upper-roman">
<li>
Point 1 :<br><?php echo $chaine; ?>
</li>
<li>
Point 2 :<br><?php echo $chaine; ?>
<ol style="list-style-type: lower-alpha">
<li>
Point 1 :<br><?php echo $chaine; ?>
</li>
<li>
Point 2 :<br><?php echo $chaine; ?>
<ol style="list-style-type: decimal">
<li>
Point 1 :<br><?php echo $chaine; ?>
</li>
<li>
Point 2 :<br><?php echo $chaine; ?>
</li>
<li>
Point 3 :<br><?php echo $chaine; ?>
</li>
</ol>
</li>
<li>
Point 3 :<br><?php echo $chaine; ?>
</li>
</ol>
</li>
<li>
Point 3 :<br><?php echo $chaine; ?>
</li>
</ol>
</page>

View File

@ -0,0 +1,88 @@
<style type="text/css">
<!--
table.tableau { text-align: left; }
table.tableau td { width: 15mm; font-family: courier; }
table.tableau th { width: 15mm; font-family: courier; }
.ul1
{
list-style-image: url(./res/puce2.gif);
}
.ul1 li
{
color:#F19031;
}
.ul2
{
list-style: square;
}
.ul2 li
{
color:#31F190;
}
.ul3
{
list-style: none;
}
.ul3 li
{
color:#9031F1;
}
-->
</style>
Exemple de liste avec puce personnalisée :<br>
<table style="width: 100%;" >
<tr>
<td style="width: 33%;">
<ul class="ul1">
<li>Votre ligne 1</li>
<li>Votre ligne 2</li>
<li>Votre ligne 3</li>
</ul>
</td>
<td style="width: 34%;">
<ul class="ul2">
<li>Votre ligne 1</li>
<li>Votre ligne 2</li>
<li>Votre ligne 3</li>
</ul>
</td>
<td style="width: 33%;">
<ul class="ul3">
<li>Votre ligne 1</li>
<li>Votre ligne 2</li>
<li>Votre ligne 3</li>
</ul>
</td>
</tr>
</table>
Exemple de caracteres :<br>
<table class="tableau" >
<tr><th>0</th><th>a</th><th>e</th><th>i</th><th>o</th><th>u</th></tr>
<tr><th>1</th><td>&agrave;</td><td>&egrave;</td><td>&igrave;</td><td>&ograve;</td><td>&ugrave;</td></tr>
<tr><th>2</th><td>&aacute;</td><td>&eacute;</td><td>&iacute;</td><td>&oacute;</td><td>&uacute;</td></tr>
<tr><th>3</th><td>&acirc;</td><td>&ecirc;</td><td>&icirc;</td><td>&ocirc;</td><td>&ucirc;</td></tr>
<tr><th>4</th><td>&auml;</td><td>&euml;</td><td>&iuml;</td><td>&ouml;</td><td>&uuml;</td></tr>
<tr><th>5</th><td>&atilde;</td><td> </td><td> </td><td>&otilde;</td><td> </td></tr>
<tr><th>6</th><td>&aring;</td><td> </td><td> </td><td> </td><td> </td></tr>
<tr><th>7</th><td>&euro;</td><td>&laquo;</td><td> </td><td>&oslash;</td><td> </td></tr>
</table>
<br>
<?php
$phrase = "ceci est un exemple avec <b>du gras</b>, ";
$phrase.= "<i>de l'italique</i>, ";
$phrase.= "<u>du souligné</u>, ";
$phrase.= "<u><i><b>et une image</b></i></u> : ";
$phrase.= "<img src='./res/logo.gif' alt='logo' style='width: 15mm'>";
?>
Table :<br>
<table style="border: solid 1px red; width: 105mm">
<tr><td style="width: 100%; border: solid 1px green; text-align: left; "><?php echo $phrase; ?></td></tr>
<tr><td style="width: 100%; border: solid 1px green; text-align: center;"><?php echo $phrase; ?></td></tr>
<tr><td style="width: 100%; border: solid 1px green; text-align: right; "><?php echo $phrase; ?></td></tr>
</table>
<br>
Div :<br>
<div style="width: 103mm; border: solid 1px green; text-align: left; margin: 1mm 0 1mm 0;padding: 1mm;"><?php echo $phrase; ?></div>
<div style="width: 103mm; border: solid 1px green; text-align: center;margin: 1mm 0 1mm 0;padding: 1mm;"><?php echo $phrase; ?></div>
<div style="width: 103mm; border: solid 1px green; text-align: right; margin: 1mm 0 1mm 0;padding: 1mm;"><?php echo $phrase; ?></div>

View File

@ -0,0 +1,122 @@
<style type="text/css">
.table-bordered {border-width: 0.25mm; border-style: solid; border-color: #aaaaaa;}
</style>
<page backtop="5mm" backbottom="5mm" backleft="5mm" backright="5mm">
<table style="border-top: solid 1px green;">
<col class="table-bordered" style="width: 20mm;">
<col class="table-bordered" style="width: 21mm;">
<col class="table-bordered" style="width: 22mm;">
<tr>
<th style="border-top: solid 1px red">0 0</th>
<th style="border-top: solid 1px red">0 1</th>
<th style="border-top: solid 1px red">0 2</th>
</tr>
<tr>
<td><div>1 0</div></td>
<td>1 1</td>
<td>1 2</td>
</tr>
</table>
<br /><hr /><br />
<table style="border-collapse: collapse;">
<col class="table-bordered" style="width: 20mm;">
<col class="table-bordered" style="width: 21mm;">
<col class="table-bordered" style="width: 22mm;">
<tr>
<th style="border: solid 1px red" >0 0</th>
<th style="border: solid 1px red">0 1</th>
<th style="border: solid 1px red">0 2</th>
</tr>
<tr>
<td><div>1 0</div></td>
<td>1 1</td>
<td>1 2</td>
</tr>
</table>
<br /><hr /><br />
<table border="1" style="width:150mm">
<colgroup>
<col style="width: 33%">
<col style="width: 33%">
<col style="width: 33%">
</colgroup>
<tr>
<td>A</td>
<td>B</td>
<td>C</td>
</tr>
</table>
<br /><hr /><br />
<table border="1" style="width:150mm">
<colgroup>
<col style="width: 33%">
<col style="width: 33%">
<col style="width: 33%">
</colgroup>
<tr>
<td>A</td>
<td>B</td>
<td>C</td>
</tr>
<tr>
<td style="padding: 1cm;">First column</td>
<td colspan="2" style="padding: 1cm;">Second column with a colspan of 2</td>
</tr>
<tr>
<td colspan="3" style="padding: 1cm;">Third column with a colspan of 3</td>
</tr>
</table>
<br /><hr /><br />
<table border="1" style="width:150mm">
<colgroup>
<col style="width: 33%">
<col style="width: 33%">
<col style="width: 33%">
</colgroup>
<tr>
<td style="padding: 1cm;">First column</td>
<td colspan="2" style="padding: 1cm;">Second column with a colspan of 2</td>
</tr>
<tr>
<td colspan="3" style="padding: 1cm;">Third column with a colspan of 3</td>
</tr>
</table>
<br /><hr /><br />
<table border="1" style="width:150mm">
<colgroup>
<col style="width: 33%">
<col style="width: 33%">
<col style="width: 33%">
</colgroup>
<tr>
<td colspan="2" style="padding: 1cm;">Second column with a colspan of 2</td>
<td style="padding: 1cm;">First column</td>
</tr>
<tr>
<td colspan="3" style="padding: 1cm;">Third column with a colspan of 3</td>
</tr>
</table>
<br />
<font color="red">Hello</font><br />
<br />
Image : <img src="./res/logos.png" /><br />
Image : <img src="./res/logo.png" /><br />
<h2>Css Large FontSize</h2>
<span style="font-size: medium;" >text with font-style medium</span><br />
<span style="font-size: large;" >text with font-style large</span><br />
<span style="font-size: x-large;" >text with font-style x-large</span><br />
<span style="font-size: xx-large;">text with font-style xx-large</span><br />
<h2>Css Small FontSize</h2>
<span style="font-size: medium;" >text with font-style medium</span><br />
<span style="font-size: small;" >text with font-style small</span><br />
<span style="font-size: x-small;" >text with font-style x-small</span><br />
<span style="font-size: xx-small;">text with font-style xx-small</span><br />
<h2>Css Relative FontSize</h2>
<span style="font-size: medium;" >text with font-style medium</span><br />
<span style="font-size: smaller;" ><span style="font-size: larger;" >text with font-style smaller larger</span></span><br />
<span style="font-size: larger;" >text with font-style larger</span><br />
<span style="font-size: smaller;" >text with font-style smaller</span><br />
</page>

View File

@ -0,0 +1,23 @@
<style type="text/css">
<!--
div {
border: solid 2mm red;
}
div.content-1 {
background: green;
}
div.content-2 {
background: blue;
}
-->
</style>
<page>
<div class="content-[[page_cu]]">Page [[page_cu]]</div>
</page>
<page>
<div class="content-[[page_cu]]">Page [[page_cu]]</div>
</page>

View File

@ -0,0 +1,71 @@
<?php
if (isset($_SERVER['REQUEST_URI'])) {
$url = $_SERVER['REQUEST_URI'];
if (substr($url, 0, 7)!=='http://') {
$url = 'http://'.$_SERVER['HTTP_HOST'];
if (isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT']!=80) {
$url.= ':'.$_SERVER['SERVER_PORT'];
}
$url.= $_SERVER['REQUEST_URI'];
}
} else {
$url = 'http://localhost/html2pdf/examples/forms.php';
}
?>
<style type="text/css">
li
{ font-size: 10pt; }
input, textarea, select
{
border: dashed 1mm red;
background: #FCC;
color: #400;
text-align: left;
font-size: 11pt;
}
</style>
<page footer="form,date,time">
<h1>Test de formulaire</h1><br>
<br>
<form action="<?php echo $url; ?>">
<input type="hidden" name="test" value="1">
Vous utilisez cette librairie dans le cadre :
<ul style="list-style: none">
<li><input type="checkbox" name="cadre_boulot" checked="checked"> du boulot</li>
<li><input type="checkbox" name="cadre_perso" > perso</li>
</ul>
Vous êtes :
<ul style="list-style: none">
<li><input type="radio" name="sexe" value="homme" checked="checked"> un homme</li>
<li><input type="radio" name="sexe" value="femme"> une femme</li>
</ul>
Vous avez :
<select name="age" >
<option value="15">moins de 15 ans</option>
<option value="20">entre 15 et 20 ans</option>
<option value="25">entre 20 et 25 ans</option>
<option value="30">entre 25 et 30 ans</option>
<option value="40">plus de 30 ans</option>
</select><br>
<br>
Vous aimez :
<select name="aime[]" size="5" multiple="multiple">
<option value="ch1">l'informatique</option>
<option value="ch2">le cinéma</option>
<option value="ch3">le sport</option>
<option value="ch4">la littérature</option>
<option value="ch5">autre</option>
</select><br>
<br>
Votre phrase fétiche : <input type="text" name="phrase" value="cette lib est géniale !!!" style="width: 100mm"><br>
<br>
Un commentaire ?<br>
<textarea name="comment" rows="3" cols="30">rien de particulier</textarea><br>
<br>
<input type="reset" name="btn_reset" value="Initialiser">
<input type="button" name="btn_print" value="Imprimer" onclick="print(true);">
<input type="submit" name="btn_submit" value="Envoyer">
</form>
</page>

View File

@ -0,0 +1,44 @@
<style type="text/css">
<!--
table.page_header {width: 100%; border: none; background-color: #DDDDFF; border-bottom: solid 1mm #AAAADD; padding: 2mm }
table.page_footer {width: 100%; border: none; background-color: #DDDDFF; border-top: solid 1mm #AAAADD; padding: 2mm}
-->
</style>
<page backtop="14mm" backbottom="14mm" backleft="10mm" backright="10mm" pagegroup="new">
<page_header>
<table class="page_header">
<tr>
<td style="width: 100%; text-align: left">
Exemple d'utilisation des groupes de pages
</td>
</tr>
</table>
</page_header>
<page_footer>
<table class="page_footer">
<tr>
<td style="width: 100%; text-align: right">
page [[page_cu]]/[[page_nb]]
</td>
</tr>
</table>
</page_footer>
Ceci est la page 1 du groupe 1
</page>
<page pageset="old">
Ceci est la page 2 du groupe 1
</page>
<page pageset="old">
Ceci est la page 3 du groupe 1
</page>
<?php
for ($k=2; $k<5; $k++) :
?>
<page pageset="old" pagegroup="new">
Ceci est la page 1 du groupe <?php echo $k; ?>
</page>
<page pageset="old">
Ceci est la page 2 du groupe <?php echo $k; ?>
</page>
<?php
endfor;

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View File

@ -0,0 +1,33 @@
<style type="text/css">
<!--
table
{
padding: 0;
margin: 0;
border: none;
border-right: solid 0.2mm black;
}
td
{
padding: 0;
margin: 0;
border: none;
}
img
{
width: 10mm;
}
-->
</style>
<page>
<table cellpadding="0" cellspacing="0">
<tr>
<?php
for ($k=0; $k<28;$k++) {
echo '<td><img src="./res/measure.png" alt="" ><br>'.$k.'</td>';
}
?>
</tr>
</table>
</page>

Binary file not shown.

After

Width:  |  Height:  |  Size: 363 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 898 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 623 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 B

View File

@ -0,0 +1,35 @@
<?php
$msg = "Le site de html2pdf\nhttp://html2pdf.fr/";
?>
<page backtop="10mm" >
<page_header>
<table style="width: 100%; border: solid 1px black;">
<tr>
<td style="text-align: left; width: 50%">html2pdf</td>
<td style="text-align: right; width: 50%">Exemples de QRcode</td>
</tr>
</table>
</page_header>
<h1>Exemples de QRcode</h1>
<h3>Message avec Correction d'erreur L, M, Q, H (valeur par défaut : H)</h3>
<qrcode value="<?php echo $msg; ?>" ec="L" style="width: 30mm;"></qrcode>
<qrcode value="<?php echo $msg; ?>" ec="M" style="width: 30mm;"></qrcode>
<qrcode value="<?php echo $msg; ?>" ec="Q" style="width: 30mm;"></qrcode>
<qrcode value="<?php echo $msg; ?>" ec="H" style="width: 30mm;"></qrcode>
<br>
<h3>Message avec différentes largeurs</h3>
<qrcode value="<?php echo $msg; ?>" style="width: 20mm;"></qrcode>
<qrcode value="<?php echo $msg; ?>" style="width: 30mm;"></qrcode>
<qrcode value="<?php echo $msg; ?>" style="width: 40mm;"></qrcode>
<qrcode value="<?php echo $msg; ?>" style="width: 50mm;"></qrcode>
<br>
<h3>Message de différentes couleurs</h3>
<qrcode value="<?php echo $msg; ?>" style="width: 40mm; background-color: white; color: black;"></qrcode>
<qrcode value="<?php echo $msg; ?>" style="width: 40mm; background-color: yellow; color: red"></qrcode>
<qrcode value="<?php echo $msg; ?>" style="width: 40mm; background-color: #FFCCFF; color: #003300"></qrcode>
<qrcode value="<?php echo $msg; ?>" style="width: 40mm; background-color: #CCFFFF; color: #003333"></qrcode>
<br>
<h3>Message sans border</h3>
<qrcode value="<?php echo $msg; ?>" style="border: none; width: 40mm;"></qrcode>
<br>
</page>

View File

@ -0,0 +1,23 @@
<style type="text/css">
<!--
.div { background: #CCDDCC; color: #002200; text-align: center; width: 70mm; height: 20mm; margin: 2mm; }
.div1 { border: solid 2mm black; border-radius: 5mm; -moz-border-radius: 5mm; }
.div2 { border: solid 2mm black; border-radius: 3mm 10mm 0mm 3mm; -moz-border-radius: 3mm 10mm 0mm 3mm; }
.div3 { border: solid 2mm black; border-radius: 10mm / 7mm; -moz-border-radius: 10mm / 7mm; }
.div4 { border: solid 6mm black; border-radius: 5mm / 10mm; -moz-border-radius: 5mm / 10mm; }
.div5 { border: solid 5mm black; border-top: none; border-bottom: none; border-radius: 5mm; -moz-border-radius: 5mm; }
.div6 { border: solid 5mm black; border-left: none; border-right: none; border-radius: 5mm; -moz-border-radius: 5mm; }
.div7 { border: solid 5mm black; border-left: none; border-top: none; border-radius: 5mm; -moz-border-radius: 5mm; }
.div8 { border-radius: 8mm; -moz-border-radius: 8mm; border-left: solid 2mm #660000; border-top: solid 1mm #006600; border-right: solid 2mm #000066; border-bottom: solid 4mm #004444;}
-->
</style>
<page>
<div class="div div1">Exemple de div</div>
<div class="div div2">Exemple de div</div>
<div class="div div3">Exemple de div</div>
<div class="div div4">Exemple de div</div>
<div class="div div5">Exemple de div</div>
<div class="div div6">Exemple de div</div>
<div class="div div7">Exemple de div</div>
<div class="div div8">Exemple de div</div>
</page>

View File

@ -0,0 +1,40 @@
<style type="text/css">
.main-draw {
margin: auto;
background: #000000;
border: solid 0.5mm #777777;
width:150mm;
height:100mm;
}
.full-stroke {
stroke-width:1mm;
}
.middle-stroke {
stroke-width:0.5mm;
}
</style>
<page>
<draw class="main-draw">
<line class="full-stroke" style="stroke:#FF0000;" x1="10mm" y1="10mm" x2="140mm" y2="10mm" >
<rect class="full-stroke" style="stroke:#770077; fill:#008888" x="15%" y="15%" w="70%" h="70%">
<ellipse class="full-stroke" style="stroke:#000077; fill:#888800" cx="50%" cy="50%" rx="30%" ry="30%">
<circle class="full-stroke" style="stroke:#0000AA; fill:#AAAA00" cx="50%" cy="50%" r="15%">
</draw><br>
<draw class="main-draw">
<path class="full-stroke" style="fill:#AAAA00; stroke:#0000AA;" d="M20mm,10mm H130mm A10mm,10mm 0,0,0 140mm,20mm V80mm A10mm,10mm 0,0,0 130mm,90mm H20mm A10mm,10mm 0,0,0 10mm,80mm V20mm A10mm,10mm 0,0,0 20mm,10mm">
<path class="middle-stroke" style="fill:#770000; stroke:#AA0033;" d="M 20mm,40mm a16mm,8mm 0,0,0 16mm,8mm" />
<path class="middle-stroke" style="fill:#770000; stroke:#00AA33;" d="M 20mm,40mm l16mm,8mm" />
<path class="middle-stroke" style="fill:#770000; stroke:#AA0033;" d="M 40mm,40mm a16mm,8mm 0,0,1 16mm,8mm" />
<path class="middle-stroke" style="fill:#770000; stroke:#00AA33;" d="M 40mm,40mm l16mm,8mm" />
<path class="middle-stroke" style="fill:#770000; stroke:#AA0033;" d="M 80mm,40mm a16mm,8mm 0,1,0 16mm,8mm" />
<path class="middle-stroke" style="fill:#770000; stroke:#00AA33;" d="M 80mm,40mm l16mm,8mm" />
<path class="middle-stroke" style="fill:#770000; stroke:#AA0033;" d="M100mm,40mm a16mm,8mm 0,1,1 16mm,8mm" />
<path class="middle-stroke" style="fill:#770000; stroke:#00AA33;" d="M100mm,40mm l16mm,8mm" />
</draw><br>
<br>
Les balises SVG suivantes sont reconnues : LINE, RECT, CIRCLE, ELLIPSE, PATH, POLYGON, POLYLINE, G<br>
<br>
Spécifications SVG : <a href="http://www.w3.org/TR/SVG11/expanded-toc.html">http://www.w3.org/TR/SVG11/expanded-toc.html</a>
</page>

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,112 @@
<page>
<draw style="margin: auto; width:180mm; height:240mm; background: #444444; border: solid 0.5mm #777777;">
<g transform="translate(90mm,120mm) scale(1.8) translate(-250,-245)">
<path d="M 157.219 412.757 C 158.128 465.467 355.334 465.467 354.425 413.666 C 353.516 358.23 159.036 357.322 157.219 412.757 z " id="path749" sodipodi:nodetypes="ccc" style="fill:#623e35;fill-rule:evenodd;stroke:black;stroke-opacity:1;stroke-width:3.75;stroke-linejoin:bevel;stroke-linecap:butt;fill-opacity:1;stroke-dasharray:none;"/>
<path d="M 212.655 306.43 L 211.746 413.665 C 219.694 425.479 288.517 427.298 299.898 412.757 L 299.898 305.521 C 289.901 320.97 232.647 326.423 212.655 306.43 z " id="path748" sodipodi:nodetypes="ccccc" style="fill:#623e35;fill-rule:evenodd;stroke:black;stroke-opacity:1;stroke-width:4.76806;stroke-linejoin:bevel;stroke-linecap:butt;fill-opacity:1;stroke-dasharray:none;" transform="matrix(0.618557,0.000000,0.000000,1.000000,98.94439,-0.908813)"/>
<path d="M 248.097 24.7078 C 244.462 35.6132 134.5 111.951 71.7941 150.119 C 109.053 250.994 394.412 247.359 425.31 150.121 C 371.692 134.671 250.823 34.7044 248.097 24.7078 z " id="path747" sodipodi:nodetypes="cccc" style="fill:#009500;fill-rule:evenodd;stroke:black;stroke-opacity:1;stroke-width:3.75;stroke-linejoin:bevel;stroke-linecap:butt;fill-opacity:1;stroke-dasharray:none;" transform="translate(0.908775,139.0434)"/>
<path d="M 248.097 24.7078 C 244.462 35.6132 168.125 111.951 105.419 150.119 C 144.496 206.464 356.243 212.826 390.776 148.303 C 337.158 132.853 250.823 34.7044 248.097 24.7078 z " id="path746" sodipodi:nodetypes="cccc" style="fill:#009500;fill-rule:evenodd;stroke:black;stroke-opacity:1;stroke-width:3.75;stroke-linejoin:bevel;stroke-linecap:butt;fill-opacity:1;stroke-dasharray:none;" transform="translate(-3.725290e-7,71.79367)"/>
<path d="M 157.343 412.757 L 158.596 431.841 C 201.308 481.824 340.324 469.226 353.047 431.966 L 354.205 412.757 C 356.023 466.375 160.07 463.649 157.343 412.757 z " id="path750" sodipodi:nodetypes="ccccc" style="fill:#623e35;fill-rule:evenodd;stroke:black;stroke-opacity:1;stroke-width:3.75;stroke-linejoin:bevel;stroke-linecap:butt;fill-opacity:1;stroke-dasharray:none;"/>
<path d="M 248.097 24.7078 C 244.462 35.6132 207.202 107.407 144.497 145.575 C 181.756 190.106 322.618 193.742 357.151 146.485 C 303.533 131.035 250.823 34.7044 248.097 24.7078 z " id="path745" sodipodi:nodetypes="cccc" style="fill:#009500;fill-rule:evenodd;stroke:black;stroke-opacity:1;stroke-width:3.75;stroke-linejoin:bevel;stroke-linecap:butt;fill-opacity:1;stroke-dasharray:none;"/>
<path d="M 247.188 38.3395 C 219.016 91.0487 170.85 136.488 151.766 145.575 C 159.946 160.116 206.293 174.657 225.378 171.931 C 213.564 141.032 216.289 111.951 247.188 38.3395 z " id="path751" sodipodi:nodetypes="cccc" style="fill:#ffffff;fill-rule:evenodd;stroke:none;stroke-opacity:1;stroke-width:1pt;stroke-linejoin:miter;stroke-linecap:butt;fill-opacity:0.5;"/>
<path d="M 179.938 171.93 C 168.124 181.927 125.412 215.552 114.506 222.822 C 106.327 223.731 157.219 251.903 175.395 251.903 C 135.408 228.275 217.199 177.383 179.938 171.93 z " id="path752" sodipodi:nodetypes="cccc" style="fill:#ffffff;fill-rule:evenodd;stroke:none;stroke-opacity:1;stroke-width:1pt;stroke-linejoin:miter;stroke-linecap:butt;fill-opacity:0.498039;"/>
<path d="M 140.861 250.994 C 126.321 260.082 102.692 277.349 78.1551 290.071 C 83.6078 310.065 123.594 335.511 132.682 338.237 C 96.331 292.798 175.395 260.082 140.861 250.994 z " id="path753" sodipodi:nodetypes="cccc" style="fill:#ffffff;fill-rule:evenodd;stroke:none;stroke-opacity:1;stroke-width:1pt;stroke-linejoin:miter;stroke-linecap:butt;fill-opacity:0.498039;"/>
<path d="M 233.308 366.285 C 234.121 379.008 231.643 403.487 233.623 413.293 C 247.255 420.056 256.276 418.554 266.962 418.114 C 253.33 412.661 242.329 402.388 233.308 366.285 z " id="path755" sodipodi:nodetypes="cccc" style="fill:#ffffff;fill-rule:evenodd;stroke:none;stroke-opacity:1;stroke-width:1pt;stroke-linejoin:miter;stroke-linecap:butt;fill-opacity:0.3;"/>
<path d="M 222.459 376.374 C 201.797 379.129 155.308 391.181 161.506 415.975 C 167.705 438.703 213.505 443.18 226.247 446.624 C 220.048 439.392 171.837 405.988 222.459 376.374 z " id="path756" sodipodi:nodetypes="cccc" style="fill:#ffffff;fill-rule:evenodd;stroke:none;stroke-opacity:1;stroke-width:1pt;stroke-linejoin:miter;stroke-linecap:butt;fill-opacity:0.3;"/>
<path d="M 161.162 428.028 C 163.573 429.061 172.871 441.803 208.685 456.955 C 193.532 452.822 163.228 440.425 161.162 428.028 z " id="path757" sodipodi:nodetypes="ccc" style="fill:#ffffff;fill-rule:evenodd;stroke:none;stroke-opacity:1;stroke-width:1pt;stroke-linejoin:miter;stroke-linecap:butt;fill-opacity:0.3;" transform=""/>
<path d="M 315.437 454.544 C 329.556 448.345 346.774 443.524 349.873 432.505 C 355.039 422.174 348.496 436.292 315.437 454.544 z " id="path758" sodipodi:nodetypes="ccc" style="fill:#000011;fill-rule:evenodd;stroke:none;stroke-opacity:1;stroke-width:1pt;stroke-linejoin:miter;stroke-linecap:butt;fill-opacity:0.25;"/>
<path d="M 287.888 377.407 C 326.457 377.407 383.965 411.154 327.834 438.359 C 362.615 398.413 287.888 378.44 287.888 377.407 z " id="path759" sodipodi:nodetypes="ccc" style="fill:#000011;fill-rule:evenodd;stroke:none;stroke-opacity:1;stroke-width:1pt;stroke-linejoin:miter;stroke-linecap:butt;fill-opacity:0.247059;"/>
<path d="M 259.65 366.043 C 259.65 366.043 279.967 363.288 281.345 365.698 C 282.722 368.109 281.689 387.049 281.001 391.87 C 279.968 382.572 282.378 368.798 259.65 366.043 z " id="path760" sodipodi:nodetypes="cccc" style="fill:#000011;fill-rule:evenodd;stroke:none;stroke-opacity:1;stroke-width:1pt;stroke-linejoin:miter;stroke-linecap:butt;fill-opacity:0.247059;"/>
<path d="M 387.929 328.061 C 401.191 322.851 418.716 301.536 421.559 292.536 C 418.243 288.747 385.56 275.484 377.982 268.853 C 383.666 278.326 409.717 297.747 387.929 328.061 z " id="path761" sodipodi:nodetypes="cccc" style="fill:#000011;fill-rule:evenodd;stroke:none;stroke-opacity:1;stroke-width:1pt;stroke-linejoin:miter;stroke-linecap:butt;fill-opacity:0.247059;"/>
<path d="M 352.404 245.644 C 370.876 238.539 382.244 229.065 384.613 222.908 C 375.613 219.119 355.246 205.856 345.299 200.172 C 352.878 208.224 368.509 221.487 352.404 245.644 z " id="path762" sodipodi:nodetypes="cccc" style="fill:#000011;fill-rule:evenodd;stroke:none;stroke-opacity:1;stroke-width:1pt;stroke-linejoin:miter;stroke-linecap:butt;fill-opacity:0.247059;"/>
<path d="M 305.038 115.861 C 312.617 126.755 346.72 147.595 350.51 148.543 C 345.773 156.122 322.09 168.437 313.09 169.384 C 308.354 168.911 336.773 152.806 305.038 115.861 z " id="path763" sodipodi:nodetypes="cccc" style="fill:#000011;fill-rule:evenodd;stroke:none;stroke-opacity:1;stroke-width:1pt;stroke-linejoin:miter;stroke-linecap:butt;fill-opacity:0.247059;"/>
<g id="g771" transform="translate(-249.1874,169.4743)">
<path d="M 424.69 52.5344 C 445.456 51.8645 445.456 82.0082 426.03 82.0082 C 401.245 82.678 404.594 53.2043 424.69 52.5344 z " id="path772" sodipodi:nodetypes="ccc" style="fill:#ff0000;fill-rule:evenodd;stroke:black;stroke-opacity:1;stroke-width:3.75;stroke-linejoin:miter;stroke-linecap:butt;fill-opacity:1;stroke-dasharray:none;"/>
<path d="M 425.36 55.2139 C 423.35 53.2043 401.915 63.922 415.982 75.3096 C 424.691 74.6397 427.37 57.2234 425.36 55.2139 z " id="path773" sodipodi:nodetypes="ccc" style="fill:#ffffff;fill-rule:evenodd;stroke:none;stroke-opacity:1;stroke-width:1pt;stroke-linejoin:miter;stroke-linecap:butt;fill-opacity:0.7;"/>
</g>
<g id="g774" transform="translate(-46.89011,243.8286)">
<path d="M 424.69 52.5344 C 445.456 51.8645 445.456 82.0082 426.03 82.0082 C 401.245 82.678 404.594 53.2043 424.69 52.5344 z " id="path775" sodipodi:nodetypes="ccc" style="fill:#ff0000;fill-rule:evenodd;stroke:black;stroke-opacity:1;stroke-width:3.75;stroke-linejoin:miter;stroke-linecap:butt;fill-opacity:1;stroke-dasharray:none;"/>
<path d="M 425.36 55.2139 C 423.35 53.2043 401.915 63.922 415.982 75.3096 C 424.691 74.6397 427.37 57.2234 425.36 55.2139 z " id="path776" sodipodi:nodetypes="ccc" style="fill:#ffffff;fill-rule:evenodd;stroke:none;stroke-opacity:1;stroke-width:1pt;stroke-linejoin:miter;stroke-linecap:butt;fill-opacity:0.7;"/>
</g>
<g id="g777" transform="translate(-226.4122,271.2928)">
<path d="M 424.69 52.5344 C 445.456 51.8645 445.456 82.0082 426.03 82.0082 C 401.245 82.678 404.594 53.2043 424.69 52.5344 z " id="path778" sodipodi:nodetypes="ccc" style="fill:#ff0000;fill-rule:evenodd;stroke:black;stroke-opacity:1;stroke-width:3.75;stroke-linejoin:miter;stroke-linecap:butt;fill-opacity:1;stroke-dasharray:none;"/>
<path d="M 425.36 55.2139 C 423.35 53.2043 401.915 63.922 415.982 75.3096 C 424.691 74.6397 427.37 57.2234 425.36 55.2139 z " id="path779" sodipodi:nodetypes="ccc" style="fill:#ffffff;fill-rule:evenodd;stroke:none;stroke-opacity:1;stroke-width:1pt;stroke-linejoin:miter;stroke-linecap:butt;fill-opacity:0.7;"/>
</g>
<g id="g780" transform="translate(-117.8951,83.73234)">
<path d="M 424.69 52.5344 C 445.456 51.8645 445.456 82.0082 426.03 82.0082 C 401.245 82.678 404.594 53.2043 424.69 52.5344 z " id="path781" sodipodi:nodetypes="ccc" style="fill:#ff0000;fill-rule:evenodd;stroke:black;stroke-opacity:1;stroke-width:3.75;stroke-linejoin:miter;stroke-linecap:butt;fill-opacity:1;stroke-dasharray:none;"/>
<path d="M 425.36 55.2139 C 423.35 53.2043 401.915 63.922 415.982 75.3096 C 424.691 74.6397 427.37 57.2234 425.36 55.2139 z " id="path782" sodipodi:nodetypes="ccc" style="fill:#ffffff;fill-rule:evenodd;stroke:none;stroke-opacity:1;stroke-width:1pt;stroke-linejoin:miter;stroke-linecap:butt;fill-opacity:0.7;"/>
</g>
<g id="g791" transform="translate(-236.4601,103.1582)">
<path d="M 424.69 52.5344 C 445.456 51.8645 445.456 82.0082 426.03 82.0082 C 401.245 82.678 404.594 53.2043 424.69 52.5344 z " id="path792" sodipodi:nodetypes="ccc" style="font-size:12;fill:#ff00ff;fill-rule:evenodd;stroke:#000000;stroke-width:3.75;fill-opacity:1;"/>
<path d="M 425.36 55.2139 C 423.35 53.2043 401.915 63.922 415.982 75.3096 C 424.691 74.6397 427.37 57.2234 425.36 55.2139 z " id="path793" sodipodi:nodetypes="ccc" style="font-size:12;fill:#ffffff;fill-opacity:0.7;fill-rule:evenodd;stroke-width:1pt;"/>
</g>
<g id="g794" transform="translate(-85.74192,124.5937)">
<path d="M 424.69 52.5344 C 445.456 51.8645 445.456 82.0082 426.03 82.0082 C 401.245 82.678 404.594 53.2043 424.69 52.5344 z " id="path795" sodipodi:nodetypes="ccc" style="font-size:12;fill:#ff00ff;fill-rule:evenodd;stroke:#000000;stroke-width:3.75;fill-opacity:1;"/>
<path d="M 425.36 55.2139 C 423.35 53.2043 401.915 63.922 415.982 75.3096 C 424.691 74.6397 427.37 57.2234 425.36 55.2139 z " id="path796" sodipodi:nodetypes="ccc" style="font-size:12;fill:#ffffff;fill-opacity:0.7;fill-rule:evenodd;stroke-width:1pt;"/>
</g>
<g id="g797" transform="translate(-144.0196,236.4601)">
<path d="M 424.69 52.5344 C 445.456 51.8645 445.456 82.0082 426.03 82.0082 C 401.245 82.678 404.594 53.2043 424.69 52.5344 z " id="path798" sodipodi:nodetypes="ccc" style="font-size:12;fill:#ff00ff;fill-rule:evenodd;stroke:#000000;stroke-width:3.75;fill-opacity:1;"/>
<path d="M 425.36 55.2139 C 423.35 53.2043 401.915 63.922 415.982 75.3096 C 424.691 74.6397 427.37 57.2234 425.36 55.2139 z " id="path799" sodipodi:nodetypes="ccc" style="font-size:12;fill:#ffffff;fill-opacity:0.7;fill-rule:evenodd;stroke-width:1pt;"/>
</g>
<g id="g808" transform="translate(-158.7565,60.28728)">
<path d="M 424.69 52.5344 C 445.456 51.8645 445.456 82.0082 426.03 82.0082 C 401.245 82.678 404.594 53.2043 424.69 52.5344 z " id="path809" sodipodi:nodetypes="ccc" style="font-size:12;fill:#0000ff;fill-rule:evenodd;stroke:#000000;stroke-width:3.75;fill-opacity:1;"/>
<path d="M 425.36 55.2139 C 423.35 53.2043 401.915 63.922 415.982 75.3096 C 424.691 74.6397 427.37 57.2234 425.36 55.2139 z " id="path810" sodipodi:nodetypes="ccc" style="font-size:12;fill:#ffffff;fill-opacity:0.7;fill-rule:evenodd;stroke-width:1pt;"/>
</g>
<g id="g811" transform="translate(-300.7665,212.3452)">
<path d="M 424.69 52.5344 C 445.456 51.8645 445.456 82.0082 426.03 82.0082 C 401.245 82.678 404.594 53.2043 424.69 52.5344 z " id="path812" sodipodi:nodetypes="ccc" style="font-size:12;fill:#0000ff;fill-rule:evenodd;stroke:#000000;stroke-width:3.75;fill-opacity:1;"/>
<path d="M 425.36 55.2139 C 423.35 53.2043 401.915 63.922 415.982 75.3096 C 424.691 74.6397 427.37 57.2234 425.36 55.2139 z " id="path813" sodipodi:nodetypes="ccc" style="font-size:12;fill:#ffffff;fill-opacity:0.7;fill-rule:evenodd;stroke-width:1pt;"/>
</g>
<g id="g814" transform="translate(-109.1869,185.5508)">
<path d="M 424.69 52.5344 C 445.456 51.8645 445.456 82.0082 426.03 82.0082 C 401.245 82.678 404.594 53.2043 424.69 52.5344 z " id="path815" sodipodi:nodetypes="ccc" style="font-size:12;fill:#0000ff;fill-rule:evenodd;stroke:#000000;stroke-width:3.75;fill-opacity:1;"/>
<path d="M 425.36 55.2139 C 423.35 53.2043 401.915 63.922 415.982 75.3096 C 424.691 74.6397 427.37 57.2234 425.36 55.2139 z " id="path816" sodipodi:nodetypes="ccc" style="font-size:12;fill:#ffffff;fill-opacity:0.7;fill-rule:evenodd;stroke-width:1pt;"/>
</g>
<g id="g822" transform="translate(-192.9193,111.8663)">
<path d="M 424.69 52.5344 C 445.456 51.8645 445.456 82.0082 426.03 82.0082 C 401.245 82.678 404.594 53.2043 424.69 52.5344 z " id="path823" sodipodi:nodetypes="ccc" style="font-size:12;fill:#00ffff;fill-rule:evenodd;stroke:#000000;stroke-width:3.75;fill-opacity:1;"/>
<path d="M 425.36 55.2139 C 423.35 53.2043 401.915 63.922 415.982 75.3096 C 424.691 74.6397 427.37 57.2234 425.36 55.2139 z " id="path824" sodipodi:nodetypes="ccc" style="font-size:12;fill:#ffffff;fill-opacity:0.7;fill-rule:evenodd;stroke-width:1pt;"/>
</g>
<g id="g825" transform="translate(-101.1486,279.3311)">
<path d="M 424.69 52.5344 C 445.456 51.8645 445.456 82.0082 426.03 82.0082 C 401.245 82.678 404.594 53.2043 424.69 52.5344 z " id="path826" sodipodi:nodetypes="ccc" style="font-size:12;fill:#00ffff;fill-rule:evenodd;stroke:#000000;stroke-width:3.75;fill-opacity:1;"/>
<path d="M 425.36 55.2139 C 423.35 53.2043 401.915 63.922 415.982 75.3096 C 424.691 74.6397 427.37 57.2234 425.36 55.2139 z " id="path827" sodipodi:nodetypes="ccc" style="font-size:12;fill:#ffffff;fill-opacity:0.7;fill-rule:evenodd;stroke-width:1pt;"/>
</g>
<g id="g836" transform="translate(-293.3981,267.9435)">
<path d="M 424.69 52.5344 C 445.456 51.8645 445.456 82.0082 426.03 82.0082 C 401.245 82.678 404.594 53.2043 424.69 52.5344 z " id="path837" sodipodi:nodetypes="ccc" style="font-size:12;fill:#00ff00;fill-rule:evenodd;stroke:#000000;stroke-width:3.75;fill-opacity:1;"/>
<path d="M 425.36 55.2139 C 423.35 53.2043 401.915 63.922 415.982 75.3096 C 424.691 74.6397 427.37 57.2234 425.36 55.2139 z " id="path838" sodipodi:nodetypes="ccc" style="font-size:12;fill:#ffffff;fill-opacity:0.7;fill-rule:evenodd;stroke-width:1pt;"/>
</g>
<g id="g839" transform="translate(-203.6370,194.9289)">
<path d="M 424.69 52.5344 C 445.456 51.8645 445.456 82.0082 426.03 82.0082 C 401.245 82.678 404.594 53.2043 424.69 52.5344 z " id="path840" sodipodi:nodetypes="ccc" style="font-size:12;fill:#00ff00;fill-rule:evenodd;stroke:#000000;stroke-width:3.75;fill-opacity:1;"/>
<path d="M 425.36 55.2139 C 423.35 53.2043 401.915 63.922 415.982 75.3096 C 424.691 74.6397 427.37 57.2234 425.36 55.2139 z " id="path841" sodipodi:nodetypes="ccc" style="font-size:12;fill:#ffffff;fill-opacity:0.7;fill-rule:evenodd;stroke-width:1pt;"/>
</g>
<g id="g851" transform="translate(-81.05289,214.3548)">
<path d="M 424.69 52.5344 C 445.456 51.8645 445.456 82.0082 426.03 82.0082 C 401.245 82.678 404.594 53.2043 424.69 52.5344 z " id="path852" sodipodi:nodetypes="ccc" style="font-size:12;fill:#ffff00;fill-rule:evenodd;stroke:#000000;stroke-width:3.75;fill-opacity:1;"/>
<path d="M 425.36 55.2139 C 423.35 53.2043 401.915 63.922 415.982 75.3096 C 424.691 74.6397 427.37 57.2234 425.36 55.2139 z " id="path853" sodipodi:nodetypes="ccc" style="font-size:12;fill:#ffffff;fill-opacity:0.7;fill-rule:evenodd;stroke-width:1pt;"/>
</g>
<g id="g854" transform="translate(-146.0292,146.0292)">
<path d="M 424.69 52.5344 C 445.456 51.8645 445.456 82.0082 426.03 82.0082 C 401.245 82.678 404.594 53.2043 424.69 52.5344 z " id="path855" sodipodi:nodetypes="ccc" style="font-size:12;fill:#ffff00;fill-rule:evenodd;stroke:#000000;stroke-width:3.75;fill-opacity:1;"/>
<path d="M 425.36 55.2139 C 423.35 53.2043 401.915 63.922 415.982 75.3096 C 424.691 74.6397 427.37 57.2234 425.36 55.2139 z " id="path856" sodipodi:nodetypes="ccc" style="font-size:12;fill:#ffffff;fill-opacity:0.7;fill-rule:evenodd;stroke-width:1pt;"/>
</g>
<g id="g857" transform="translate(-231.7711,227.7519)">
<path d="M 424.69 52.5344 C 445.456 51.8645 445.456 82.0082 426.03 82.0082 C 401.245 82.678 404.594 53.2043 424.69 52.5344 z " id="path858" sodipodi:nodetypes="ccc" style="font-size:12;fill:#ffff00;fill-rule:evenodd;stroke:#000000;stroke-width:3.75;fill-opacity:1;"/>
<path d="M 425.36 55.2139 C 423.35 53.2043 401.915 63.922 415.982 75.3096 C 424.691 74.6397 427.37 57.2234 425.36 55.2139 z " id="path859" sodipodi:nodetypes="ccc" style="font-size:12;fill:#ffffff;fill-opacity:0.7;fill-rule:evenodd;stroke-width:1pt;"/>
</g>
<g id="g865" transform="translate(-202.9672,64.97627)">
<path d="M 424.69 52.5344 C 445.456 51.8645 445.456 82.0082 426.03 82.0082 C 401.245 82.678 404.594 53.2043 424.69 52.5344 z " id="path866" sodipodi:nodetypes="ccc" style="font-size:12;fill:#ff9300;fill-rule:evenodd;stroke:#000000;stroke-width:3.75;fill-opacity:1;"/>
<path d="M 425.36 55.2139 C 423.35 53.2043 401.915 63.922 415.982 75.3096 C 424.691 74.6397 427.37 57.2234 425.36 55.2139 z " id="path867" sodipodi:nodetypes="ccc" style="font-size:12;fill:#ffffff;fill-opacity:0.7;fill-rule:evenodd;stroke-width:1pt;"/>
</g>
<g id="g868" transform="translate(-158.0866,287.3694)">
<path d="M 424.69 52.5344 C 445.456 51.8645 445.456 82.0082 426.03 82.0082 C 401.245 82.678 404.594 53.2043 424.69 52.5344 z " id="path869" sodipodi:nodetypes="ccc" style="font-size:12;fill:#ff9300;fill-rule:evenodd;stroke:#000000;stroke-width:3.75;fill-opacity:1;"/>
<path d="M 425.36 55.2139 C 423.35 53.2043 401.915 63.922 415.982 75.3096 C 424.691 74.6397 427.37 57.2234 425.36 55.2139 z " id="path870" sodipodi:nodetypes="ccc" style="font-size:12;fill:#ffffff;fill-opacity:0.7;fill-rule:evenodd;stroke-width:1pt;"/>
</g>
<g id="g871" transform="translate(-152.7278,188.2303)">
<path d="M 424.69 52.5344 C 445.456 51.8645 445.456 82.0082 426.03 82.0082 C 401.245 82.678 404.594 53.2043 424.69 52.5344 z " id="path872" sodipodi:nodetypes="ccc" style="font-size:12;fill:#ff9300;fill-rule:evenodd;stroke:#000000;stroke-width:3.75;fill-opacity:1;"/>
<path d="M 425.36 55.2139 C 423.35 53.2043 401.915 63.922 415.982 75.3096 C 424.691 74.6397 427.37 57.2234 425.36 55.2139 z " id="path873" sodipodi:nodetypes="ccc" style="font-size:12;fill:#ffffff;fill-opacity:0.7;fill-rule:evenodd;stroke-width:1pt;"/>
</g>
<g id="g880" transform="translate(-140.0000,25.00000)">
<polygon id="polygon878" points="418.662,76.6493 399.532,56.5037 376.859,72.5587 390.107,48.1396 367.832,31.538 395.15,36.5918 404.055,10.2764 407.69,37.819 435.47,38.1568 410.399,50.1252 418.662,76.6493 " sodipodi:arg1="1.04002345" sodipodi:arg2="1.66834199" sodipodi:cx="400.575500" sodipodi:cy="45.8358383" sodipodi:r1="35.7292557" sodipodi:r2="10.7187767" sodipodi:sides="5" sodipodi:type="star" style="font-size:12;fill:#ff0000;fill-rule:evenodd;stroke-width:3.75;stroke:#000000;stroke-opacity:1;stroke-dasharray:none;fill-opacity:1;" transform="matrix(0.994342,-0.106230,0.106230,0.994342,-2.344353,42.91328)"/>
<path d="M 388.532 62.8101 C 401.79 40.713 380.796 41.775 381.792 39.3513 C 399.139 44.4405 399.022 35.5462 400.79 24.014 C 403.441 40.3242 406.708 43.765 388.532 62.8101 z " id="path879" sodipodi:nodetypes="cccc" style="fill:#ffffff;fill-rule:evenodd;stroke:none;stroke-opacity:1;stroke-width:1pt;stroke-linejoin:miter;stroke-linecap:butt;fill-opacity:0.5;"/>
</g>
<g id="g883" transform="translate(-216.1370,24.92889)">
<path d="M 424.69 52.5344 C 445.456 51.8645 445.456 82.0082 426.03 82.0082 C 401.245 82.678 404.594 53.2043 424.69 52.5344 z " id="path884" sodipodi:nodetypes="ccc" style="font-size:12;fill:#00ff00;fill-rule:evenodd;stroke:#000000;stroke-width:3.75;fill-opacity:1;"/>
<path d="M 425.36 55.2139 C 423.35 53.2043 401.915 63.922 415.982 75.3096 C 424.691 74.6397 427.37 57.2234 425.36 55.2139 z " id="path885" sodipodi:nodetypes="ccc" style="font-size:12;fill:#ffffff;fill-opacity:0.7;fill-rule:evenodd;stroke-width:1pt;"/>
</g>
</g>
</draw>
</page>

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

@ -0,0 +1,68 @@
<?php
$num = 'CMD01-'.date('ymd');
$nom = 'DUPONT Alphonse';
$date = '31/12/'.date('Y');
?>
<style type="text/css">
<!--
div.zone { border: none; border-radius: 6mm; background: #FFFFFF; border-collapse: collapse; padding:3mm; font-size: 2.7mm;}
h1 { padding: 0; margin: 0; color: #DD0000; font-size: 7mm; }
h2 { padding: 0; margin: 0; color: #222222; font-size: 5mm; position: relative; }
-->
</style>
<page format="100x200" orientation="L" backcolor="#AAAACC" style="font: arial;">
<div style="rotate: 90; position: absolute; width: 100mm; height: 4mm; left: 195mm; top: 0; font-style: italic; font-weight: normal; text-align: center; font-size: 2.5mm;">
Ceci est votre e-ticket à présenter au contrôle d'accès -
billet généré par <a href="http://html2pdf.fr/" style="color: #222222; text-decoration: none;">html2pdf</a>
</div>
<table style="width: 99%;border: none;" cellspacing="4mm" cellpadding="0">
<tr>
<td colspan="2" style="width: 100%">
<div class="zone" style="height: 34mm;position: relative;font-size: 5mm;">
<div style="position: absolute; right: 3mm; top: 3mm; text-align: right; font-size: 4mm; ">
<b><?php echo $nom; ?></b><br>
</div>
<div style="position: absolute; right: 3mm; bottom: 3mm; text-align: right; font-size: 4mm; ">
<b>1</b> place <b>plein tarif</b><br>
Prix unitaire TTC : <b>45,00&euro;</b><br>
N° commande : <b><?php echo $num; ?></b><br>
Date d'achat : <b><?php echo date('d/m/Y à H:i:s'); ?></b><br>
</div>
<h1>Billet soirée spécial Html2Pdf</h1>
&nbsp;&nbsp;&nbsp;&nbsp;<b>Valable le <?php echo $date; ?> à 20h30</b><br>
<img src="./res/logo.gif" alt="logo" style="margin-top: 3mm; margin-left: 20mm">
</div>
</td>
</tr>
<tr>
<td style="width: 25%;">
<div class="zone" style="height: 40mm;vertical-align: middle;text-align: center;">
<qrcode value="<?php echo $num."\n".$nom."\n".$date; ?>" ec="Q" style="width: 37mm; border: none;" ></qrcode>
</div>
</td>
<td style="width: 75%">
<div class="zone" style="height: 40mm;vertical-align: middle; text-align: justify">
<b>Conditions d'utilisation du billet</b><br>
Le billet est soumis aux conditions générales de vente que vous avez
acceptées avant l'achat du billet. Le billet d'entrée est uniquement
valable s'il est imprimé sur du papier A4 blanc, vierge recto et verso.
L'entrée est soumise au contrôle de la validité de votre billet. Une bonne
qualité d'impression est nécessaire. Les billets partiellement imprimés,
souillés, endommagés ou illisibles ne seront pas acceptés et seront
considérés comme non valables. En cas d'incident ou de mauvaise qualité
d'impression, vous devez imprimer à nouveau votre fichier. Pour vérifier
la bonne qualité de l'impression, assurez-vous que les informations écrites
sur le billet, ainsi que les pictogrammes (code à barres 2D) sont bien
lisibles. Ce titre doit être conservé jusqu'à la fin de la manifestation.
Une pièce d'identité pourra être demandée conjointement à ce billet. En
cas de non respect de l'ensemble des règles précisées ci-dessus, ce billet
sera considéré comme non valable.<br>
<br>
<i>Ce billet est reconnu électroniquement lors de votre
arrivée sur site. A ce titre, il ne doit être ni dupliqué, ni photocopié.
Toute reproduction est frauduleuse et inutile.</i>
</div>
</td>
</tr>
</table>
</page>

View File

@ -0,0 +1,32 @@
<?php
/**
* Html2Pdf Library - example
*
* HTML => PDF converter
* distributed under the OSL-3.0 License
*
* @package Html2pdf
* @author Laurent MINGUET <webmaster@html2pdf.fr>
* @copyright 2017 Laurent MINGUET
*/
require_once dirname(__FILE__).'/../vendor/autoload.php';
use Spipu\Html2Pdf\Html2Pdf;
use Spipu\Html2Pdf\Exception\Html2PdfException;
use Spipu\Html2Pdf\Exception\ExceptionFormatter;
try {
ob_start();
include dirname(__FILE__).'/res/svg.php';
$content = ob_get_clean();
$html2pdf = new Html2Pdf('P', 'A4', 'fr');
$html2pdf->pdf->SetDisplayMode('fullpage');
$html2pdf->writeHTML($content);
$html2pdf->output('svg.pdf');
} catch (Html2PdfException $e) {
$html2pdf->clean();
$formatter = new ExceptionFormatter($e);
echo $formatter->getHtmlMessage();
}

View File

@ -0,0 +1,32 @@
<?php
/**
* Html2Pdf Library - example
*
* HTML => PDF converter
* distributed under the OSL-3.0 License
*
* @package Html2pdf
* @author Laurent MINGUET <webmaster@html2pdf.fr>
* @copyright 2017 Laurent MINGUET
*/
require_once dirname(__FILE__).'/../vendor/autoload.php';
use Spipu\Html2Pdf\Html2Pdf;
use Spipu\Html2Pdf\Exception\Html2PdfException;
use Spipu\Html2Pdf\Exception\ExceptionFormatter;
try {
ob_start();
include dirname(__FILE__).'/res/svg_tiger.php';
$content = ob_get_clean();
$html2pdf = new Html2Pdf('L', 'A4', 'fr');
$html2pdf->pdf->SetDisplayMode('fullpage');
$html2pdf->writeHTML($content);
$html2pdf->output('svg_tiger.pdf');
} catch (Html2PdfException $e) {
$html2pdf->clean();
$formatter = new ExceptionFormatter($e);
echo $formatter->getHtmlMessage();
}

View File

@ -0,0 +1,32 @@
<?php
/**
* Html2Pdf Library - example
*
* HTML => PDF converter
* distributed under the OSL-3.0 License
*
* @package Html2pdf
* @author Laurent MINGUET <webmaster@html2pdf.fr>
* @copyright 2017 Laurent MINGUET
*/
require_once dirname(__FILE__).'/../vendor/autoload.php';
use Spipu\Html2Pdf\Html2Pdf;
use Spipu\Html2Pdf\Exception\Html2PdfException;
use Spipu\Html2Pdf\Exception\ExceptionFormatter;
try {
ob_start();
include dirname(__FILE__).'/res/svg_tree.php';
$content = ob_get_clean();
$html2pdf = new Html2Pdf('P', 'A4', 'fr');
$html2pdf->pdf->SetDisplayMode('fullpage');
$html2pdf->writeHTML($content);
$html2pdf->output('svg_tree.pdf');
} catch (Html2PdfException $e) {
$html2pdf->clean();
$formatter = new ExceptionFormatter($e);
echo $formatter->getHtmlMessage();
}

View File

@ -0,0 +1,32 @@
<?php
/**
* Html2Pdf Library - example
*
* HTML => PDF converter
* distributed under the OSL-3.0 License
*
* @package Html2pdf
* @author Laurent MINGUET <webmaster@html2pdf.fr>
* @copyright 2017 Laurent MINGUET
*/
require_once dirname(__FILE__).'/../vendor/autoload.php';
use Spipu\Html2Pdf\Html2Pdf;
use Spipu\Html2Pdf\Exception\Html2PdfException;
use Spipu\Html2Pdf\Exception\ExceptionFormatter;
try {
ob_start();
include dirname(__FILE__).'/res/ticket.php';
$content = ob_get_clean();
$html2pdf = new Html2Pdf('P', 'A4', 'fr', true, 'UTF-8', 0);
$html2pdf->pdf->SetDisplayMode('fullpage');
$html2pdf->writeHTML($content);
$html2pdf->output('ticket.pdf');
} catch (Html2PdfException $e) {
$html2pdf->clean();
$formatter = new ExceptionFormatter($e);
echo $formatter->getHtmlMessage();
}

View File

@ -0,0 +1,33 @@
<?php
/**
* Html2Pdf Library - example
*
* HTML => PDF converter
* distributed under the OSL-3.0 License
*
* @package Html2pdf
* @author Laurent MINGUET <webmaster@html2pdf.fr>
* @copyright 2017 Laurent MINGUET
*/
require_once dirname(__FILE__).'/../vendor/autoload.php';
use Spipu\Html2Pdf\Html2Pdf;
use Spipu\Html2Pdf\Exception\Html2PdfException;
use Spipu\Html2Pdf\Exception\ExceptionFormatter;
try {
$html2pdf = new Html2Pdf('P', 'A4', 'fr');
$content = file_get_contents(K_PATH_MAIN.'examples/data/utf8test.txt');
$content = '<page style="font-family: freeserif"><br />'.nl2br($content).'</page>';
$html2pdf->pdf->SetDisplayMode('real');
$html2pdf->writeHTML($content);
$html2pdf->output('utf8.pdf');
} catch (Html2PdfException $e) {
$html2pdf->clean();
$formatter = new ExceptionFormatter($e);
echo $formatter->getHtmlMessage();
}

View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
bootstrap="./vendor/autoload.php" colors="true" backupGlobals="false"
backupStaticAttributes="false"
verbose="true"
>
<testsuites>
<testsuite name="unit">
<directory>src/Tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist addUncoveredFilesFromWhiteList="true">
<directory suffix=".php">src</directory>
<exclude>
<directory>src/Tests</directory>
<directory>src/config</directory>
</exclude>
</whitelist>
</filter>
<!-- logging>
<log type="coverage-html" target="build/logs/coverage" charset="UTF-8" yui="true" highlight="true"/>
<log type="coverage-clover" target="build/logs/clover.xml"/>
</logging -->
</phpunit>

View File

@ -0,0 +1,405 @@
<?php
/**
* Html2Pdf Library
*
* HTML => PDF converter
* distributed under the OSL-3.0 License
*
* @package Html2pdf
* @author Laurent MINGUET <webmaster@html2pdf.fr>
* @copyright 2017 Laurent MINGUET
*/
namespace Spipu\Html2Pdf;
/**
* Class CssConverter
*/
class CssConverter
{
private $htmlColor = array(); // list of the HTML colors
/**
* fontsize ratios
* @var float[]
*/
private $fontSizeRatio = [
'smaller' => 0.8,
'larger' => 1.25,
'xx-small' => 0.512,
'x-small' => 0.64,
'small' => 0.8,
'medium' => 1.,
'large' => 1.25,
'x-large' => 1.5625,
'xx-large' => 1.953125,
];
public function __construct()
{
$this->htmlColor = \TCPDF_COLORS::$webcolor;
}
/**
* convert a distance to mm
*
* @param string $css distance to convert
* @param float $old parent distance
*
* @return float
*/
public function convertToMM($css, $old = 0.)
{
$css = trim($css);
if (preg_match('/^[0-9\.\-]+$/isU', $css)) {
$css.= 'px';
}
if (preg_match('/^[0-9\.\-]+px$/isU', $css)) {
$css = 25.4/96. * str_replace('px', '', $css);
} elseif (preg_match('/^[0-9\.\-]+pt$/isU', $css)) {
$css = 25.4/72. * str_replace('pt', '', $css);
} elseif (preg_match('/^[0-9\.\-]+in$/isU', $css)) {
$css = 25.4 * str_replace('in', '', $css);
} elseif (preg_match('/^[0-9\.\-]+mm$/isU', $css)) {
$css = 1.*str_replace('mm', '', $css);
} elseif (preg_match('/^[0-9\.\-]+%$/isU', $css)) {
$css = 1.*$old*str_replace('%', '', $css)/100.;
} else {
$css = null;
}
return $css;
}
/**
* @param string $css font size to convert
* @param float $parent parent font size
* @return float
*/
public function convertFontSize($css, $parent = 0.)
{
$css = trim($css);
if (array_key_exists($css, $this->fontSizeRatio)) {
$css = ($this->fontSizeRatio[$css] * $parent).'mm';
}
return $this->convertToMM($css, $parent);
}
/**
* convert a css radius
*
* @access public
* @param string $css
* @return float $value
*/
public function convertToRadius($css)
{
// explode the value
$css = explode(' ', $css);
foreach ($css as $k => $v) {
$v = trim($v);
if ($v !== '') {
$v = $this->convertToMM($v, 0);
if ($v !== null) {
$css[$k] = $v;
} else {
unset($css[$k]);
}
} else {
unset($css[$k]);
}
}
return array_values($css);
}
/**
* convert a css color to an RGB array
*
* @param string $css
* @param &boolean $res
*
* @return array (r, g, b)
*/
public function convertToColor($css, &$res)
{
// prepare the value
$css = trim($css);
$res = true;
// if transparent => return null
if (strtolower($css) === 'transparent') {
return array(null, null, null);
}
// HTML color
if (isset($this->htmlColor[strtolower($css)])) {
$css = $this->htmlColor[strtolower($css)];
$r = floatVal(hexdec(substr($css, 0, 2)));
$g = floatVal(hexdec(substr($css, 2, 2)));
$b = floatVal(hexdec(substr($css, 4, 2)));
return array($r, $g, $b);
}
// like #FFFFFF
if (preg_match('/^#[0-9A-Fa-f]{6}$/isU', $css)) {
$r = floatVal(hexdec(substr($css, 1, 2)));
$g = floatVal(hexdec(substr($css, 3, 2)));
$b = floatVal(hexdec(substr($css, 5, 2)));
return array($r, $g, $b);
}
// like #FFF
if (preg_match('/^#[0-9A-F]{3}$/isU', $css)) {
$r = floatVal(hexdec(substr($css, 1, 1).substr($css, 1, 1)));
$g = floatVal(hexdec(substr($css, 2, 1).substr($css, 2, 1)));
$b = floatVal(hexdec(substr($css, 3, 1).substr($css, 3, 1)));
return array($r, $g, $b);
}
// like rgb(100, 100, 100)
$sub = '[\s]*([0-9%\.]+)[\s]*';
if (preg_match('/rgb\('.$sub.','.$sub.','.$sub.'\)/isU', $css, $match)) {
$r = $this->convertSubColor($match[1]);
$g = $this->convertSubColor($match[2]);
$b = $this->convertSubColor($match[3]);
return array($r * 255., $g * 255., $b * 255.);
}
// like cmyk(100, 100, 100, 100)
$sub = '[\s]*([0-9%\.]+)[\s]*';
if (preg_match('/cmyk\('.$sub.','.$sub.','.$sub.','.$sub.'\)/isU', $css, $match)) {
$c = $this->convertSubColor($match[1]);
$m = $this->convertSubColor($match[2]);
$y = $this->convertSubColor($match[3]);
$k = $this->convertSubColor($match[4]);
return array($c * 100., $m * 100., $y * 100., $k * 100.);
}
$res = false;
return array(0., 0., 0.);
}
/**
* color value to convert
*
* @access protected
* @param string $c
* @return float $c 0.->1.
*/
protected function convertSubColor($c)
{
if (substr($c, -1) === '%') {
$c = floatVal(substr($c, 0, -1)) / 100.;
} else {
$c = floatVal($c);
if ($c > 1) {
$c = $c / 255.;
}
}
return $c;
}
/**
* Analyse a background
*
* @param string $css css background properties
* @param &array $value parsed values (by reference, because, ther is a legacy of the parent CSS properties)
*
* @return void
*/
public function convertBackground($css, &$value)
{
// is there a image ?
$text = '/url\(([^)]*)\)/isU';
if (preg_match($text, $css, $match)) {
// get the image
$value['image'] = $this->convertBackgroundImage($match[0]);
// remove if from the css properties
$css = preg_replace($text, '', $css);
$css = preg_replace('/[\s]+/', ' ', $css);
}
// protect some spaces
$css = preg_replace('/,[\s]+/', ',', $css);
// explode the values
$css = explode(' ', $css);
// background position to parse
$pos = '';
// foreach value
foreach ($css as $val) {
// try to parse the value as a color
$ok = false;
$color = $this->convertToColor($val, $ok);
// if ok => it is a color
if ($ok) {
$value['color'] = $color;
// else if transparent => no coloàr
} elseif ($val === 'transparent') {
$value['color'] = null;
// else
} else {
// try to parse the value as a repeat
$repeat = $this->convertBackgroundRepeat($val);
// if ok => it is repeat
if ($repeat) {
$value['repeat'] = $repeat;
// else => it could only be a position
} else {
$pos.= ($pos ? ' ' : '').$val;
}
}
}
// if we have a position to parse
if ($pos) {
// try to read it
$pos = $this->convertBackgroundPosition($pos, $ok);
if ($ok) {
$value['position'] = $pos;
}
}
}
/**
* Parse a background color
*
* @param string $css
*
* @return string|null $value
*/
public function convertBackgroundColor($css)
{
$res = null;
if ($css === 'transparent') {
return null;
}
return $this->convertToColor($css, $res);
}
/**
* Parse a background image
*
* @param string $css
*
* @return string|null $value
*/
public function convertBackgroundImage($css)
{
if ($css === 'none') {
return null;
}
if (preg_match('/^url\(([^)]*)\)$/isU', $css, $match)) {
return $match[1];
}
return null;
}
/**
* Parse a background position
*
* @param string $css
* @param boolean &$res flag if convert is ok or not
*
* @return array (x, y)
*/
public function convertBackgroundPosition($css, &$res)
{
// init the res
$res = false;
// explode the value
$css = explode(' ', $css);
// we must have 2 values. if 0 or >2 : error. if 1 => put center for 2
if (count($css)<2) {
if (!$css[0]) {
return null;
}
$css[1] = 'center';
}
if (count($css)>2) {
return null;
}
// prepare the values
$x = 0;
$y = 0;
$res = true;
// convert the first value
if ($css[0] === 'left') {
$x = '0%';
} elseif ($css[0] === 'center') {
$x = '50%';
} elseif ($css[0] === 'right') {
$x = '100%';
} elseif ($css[0] === 'top') {
$y = '0%';
} elseif ($css[0] === 'bottom') {
$y = '100%';
} elseif (preg_match('/^[-]?[0-9\.]+%$/isU', $css[0])) {
$x = $css[0];
} elseif ($this->convertToMM($css[0])) {
$x = $this->convertToMM($css[0]);
} else {
$res = false;
}
// convert the second value
if ($css[1] === 'left') {
$x = '0%';
} elseif ($css[1] === 'right') {
$x = '100%';
} elseif ($css[1] === 'top') {
$y = '0%';
} elseif ($css[1] === 'center') {
$y = '50%';
} elseif ($css[1] === 'bottom') {
$y = '100%';
} elseif (preg_match('/^[-]?[0-9\.]+%$/isU', $css[1])) {
$y = $css[1];
} elseif ($this->convertToMM($css[1])) {
$y = $this->convertToMM($css[1]);
} else {
$res = false;
}
// return the values
return array($x, $y);
}
/**
* Parse a background repeat
*
* @param string $css
*
* @return array|null background repeat as array
*/
public function convertBackgroundRepeat($css)
{
switch ($css) {
case 'repeat':
return array(true, true);
case 'repeat-x':
return array(true, false);
case 'repeat-y':
return array(false, true);
case 'no-repeat':
return array(false, false);
}
return null;
}
}

View File

@ -0,0 +1,143 @@
<?php
/**
* Html2Pdf Library
*
* HTML => PDF converter
* distributed under the OSL-3.0 License
*
* @package Html2pdf
* @author Laurent MINGUET <webmaster@html2pdf.fr>
* @copyright 2017 Laurent MINGUET
*/
namespace Spipu\Html2Pdf\Debug;
/**
* Class Debug
*/
class Debug implements DebugInterface
{
/**
* @var float
*/
protected $startTime;
/**
* @var float
*/
protected $lastTime;
/**
* @var int
*/
protected $level = 0;
/**
* @var bool
*/
protected $htmlOutput;
/**
* Debug constructor
*
* @param bool $htmlOutput
*/
public function __construct($htmlOutput = true)
{
$this->htmlOutput = $htmlOutput;
}
/**
* display a debug line
*
* @param string $name
* @param string $timeTotal
* @param string $timeStep
* @param string $memoryUsage
* @param string $memoryPeak
*
* @return void
*/
protected function displayLine($name, $timeTotal, $timeStep, $memoryUsage, $memoryPeak)
{
$output =
str_pad($name, 30, ' ', STR_PAD_RIGHT).
str_pad($timeTotal, 12, ' ', STR_PAD_LEFT).
str_pad($timeStep, 12, ' ', STR_PAD_LEFT).
str_pad($memoryUsage, 15, ' ', STR_PAD_LEFT).
str_pad($memoryPeak, 15, ' ', STR_PAD_LEFT);
if ($this->htmlOutput) {
$output = '<pre style="padding:0; margin:0">'.$output.'</pre>';
}
echo $output."\n";
}
/**
* Start the debugger
*
* @return Debug
*/
public function start()
{
$time = microtime(true);
$this->startTime = $time;
$this->lastTime = $time;
$this->displayLine('step', 'time', 'delta', 'memory', 'peak');
$this->addStep('Init debug');
return $this;
}
/**
* stop the debugger
*
* @return Debug
*/
public function stop()
{
$this->addStep('Before output');
return $this;
}
/**
* add a debug step
*
* @param string $name step name
* @param boolean $level (true=up, false=down, null=nothing to do)
*
* @return Debug
*/
public function addStep($name, $level = null)
{
// if true : UP
if ($level === true) {
$this->level++;
}
$time = microtime(true);
$usage = memory_get_usage();
$peak = memory_get_peak_usage();
$type = ($level === true ? ' Begin' : ($level === false ? ' End' : ''));
$this->displayLine(
str_repeat(' ', $this->level) . $name . $type,
number_format(($time - $this->startTime)*1000, 1, '.', ' ').' ms',
number_format(($time - $this->lastTime)*1000, 1, '.', ' ').' ms',
number_format($usage/1024, 1, '.', ' ').' Ko',
number_format($peak/1024, 1, '.', ' ').' Ko'
);
$this->lastTime = $time;
// it false : DOWN
if ($level === false) {
$this->level--;
}
return $this;
}
}

View File

@ -0,0 +1,40 @@
<?php
/**
* Html2Pdf Library - Debug
*
* HTML => PDF converter
* distributed under the OSL-3.0 License
*
* @package Html2pdf
* @author Laurent MINGUET <webmaster@html2pdf.fr>
* @copyright 2017 Laurent MINGUET
*/
namespace Spipu\Html2Pdf\Debug;
interface DebugInterface
{
/**
* Start the debugger
*
* @return DebugInterface
*/
public function start();
/**
* Stop the debugger
*
* @return DebugInterface
*/
public function stop();
/**
* add a debug step
*
* @param string $name step name
* @param boolean $level (true=up, false=down, null=nothing to do)
*
* @return DebugInterface
*/
public function addStep($name, $level = null);
}

View File

@ -0,0 +1,152 @@
<?php
/**
* Html2Pdf Library - Exception class
*
* HTML => PDF converter
* distributed under the OSL-3.0 License
*
* @package Html2pdf
* @author Laurent MINGUET <webmaster@html2pdf.fr>
* @copyright 2017 Laurent MINGUET
*/
namespace Spipu\Html2Pdf\Exception;
/**
* Exception Formatter
*/
class ExceptionFormatter
{
/**
* the text message
* @var string
*/
protected $message;
/**
* the html message
* @var string
*/
protected $htmlMessage;
/**
* PHP Constructor
*
* @param Html2PdfException $e the exception to format
*
* @return ExceptionFormatter
*/
public function __construct(Html2PdfException $e)
{
$data = $this->getAdditionalData($e);
$this->buildTextMessage($e, $data);
$this->buildHtmlMessage($e, $data);
}
/**
* get the txt message
*
* @return string
*/
public function getMessage()
{
return $this->message;
}
/**
* get tht HTML message
*
* @return string
*/
public function getHtmlMessage()
{
return $this->htmlMessage;
}
/**
* get the additional data from the exception
*
* @param Html2PdfException $e the exception to display
*
* @return array
*/
protected function getAdditionalData(Html2PdfException $e)
{
$data = array();
// read the error
switch ($e->getCode()) {
case HtmlParsingException::ERROR_CODE:
/** @var HtmlParsingException $e */
$data['invalid tag'] = $e->getInvalidTag();
$data['html line'] = $e->getHtmlLine();
break;
case ImageException::ERROR_CODE:
/** @var ImageException $e */
$data['image src'] = $e->getImage();
break;
case LongSentenceException::ERROR_CODE:
/** @var LongSentenceException $e */
$data['sentence'] = $e->getSentence();
$data['box width'] = $e->getWidthBox();
$data['length'] = $e->getLength();
break;
case TableException::ERROR_CODE:
case Html2PdfException::ERROR_CODE:
default:
break;
}
return $data;
}
/**
* Build the text message
*
* @param Html2PdfException $e the exception of the error
* @param array $data additionnal data
*
* @return void
*/
protected function buildTextMessage(Html2PdfException $e, $data)
{
$this->message = 'Html2Pdf Error ['.$e->getCode().']'."\n";
$this->message.= $e->getMessage()."\n";
$this->message.= ' File: '.$e->getFile()."\n";
$this->message.= ' Line: '.$e->getLine()."\n";
if (!empty($data)) {
foreach ($data as $key => $value) {
$this->message .= ' '.ucwords($key).': '.trim($value)."\n";
}
}
}
/**
* build the html message
*
* @param Html2PdfException $e the exception of the error
* @param array $data additional data
*
* @return void
*/
protected function buildHtmlMessage(Html2PdfException $e, $data)
{
$this->htmlMessage = '<span style="color: #A00; font-weight: bold;">';
$this->htmlMessage.= 'Html2Pdf Error ['.$e->getCode().']';
$this->htmlMessage.= '</span><br />'."\n";
$this->htmlMessage.= htmlentities($e->getMessage())."<br />\n";
$this->htmlMessage.= ' File: '.$e->getFile()."<br />\n";
$this->htmlMessage.= ' Line: '.$e->getLine()."<br />\n";
if (!empty($data)) {
foreach ($data as $key => $value) {
$this->htmlMessage .= ' '.ucwords($key).': '.trim(htmlentities($value))."<br />\n";
}
}
}
}

View File

@ -0,0 +1,37 @@
<?php
/**
* Html2Pdf Library - Exception class
*
* HTML => PDF converter
* distributed under the OSL-3.0 License
*
* @package Html2pdf
* @author Laurent MINGUET <webmaster@html2pdf.fr>
* @copyright 2017 Laurent MINGUET
*/
namespace Spipu\Html2Pdf\Exception;
/**
* Html2Pdf Exception
*/
class Html2PdfException extends \Exception
{
/**
* ERROR CODE 0
* @var int
*/
const ERROR_CODE = 0;
/**
* Construct the exception.
*
* @param string $message The Exception message to throw.
*
* @return Html2PdfException
*/
public function __construct($message)
{
parent::__construct($message, static::ERROR_CODE);
}
}

View File

@ -0,0 +1,81 @@
<?php
/**
* Html2Pdf Library - Exception class
*
* HTML => PDF converter
* distributed under the OSL-3.0 License
*
* @package Html2pdf
* @author Laurent MINGUET <webmaster@html2pdf.fr>
* @copyright 2017 Laurent MINGUET
*/
namespace Spipu\Html2Pdf\Exception;
/**
* Html Parsing Exception
*/
class HtmlParsingException extends Html2PdfException
{
/**
* ERROR CODE 1
* @var int
*/
const ERROR_CODE = 1;
/**
* invalid tag
* @var string
*/
protected $invalidTag;
/**
* the line in HTML data where the error occurred
* @var int
*/
protected $htmlLine;
/**
* set the invalid Tag
*
* @param string $value the value
*
* @return HtmlParsingException
*/
public function setInvalidTag($value)
{
$this->invalidTag = $value;
return $this;
}
/**
* get the invalid Tag
*
* @return string
*/
public function getInvalidTag()
{
return $this->invalidTag;
}
/**
* @param int $lineNumber the value
*
* @return HtmlParsingException
*/
public function setHtmlLine($lineNumber)
{
$this->htmlLine = $lineNumber;
return $this;
}
/**
* @return int
*/
public function getHtmlLine()
{
return $this->htmlLine;
}
}

View File

@ -0,0 +1,55 @@
<?php
/**
* Html2Pdf Library - Exception class
*
* HTML => PDF converter
* distributed under the OSL-3.0 License
*
* @package Html2pdf
* @author Laurent MINGUET <webmaster@html2pdf.fr>
* @copyright 2017 Laurent MINGUET
*/
namespace Spipu\Html2Pdf\Exception;
/**
* Image Exception
*/
class ImageException extends Html2PdfException
{
/**
* ERROR CODE 2
* @var int
*/
const ERROR_CODE = 2;
/**
* asked unknown image
* @var string
*/
protected $image;
/**
* set the image in error
*
* @param string $value the value
*
* @return ImageException
*/
public function setImage($value)
{
$this->image = $value;
return $this;
}
/**
* get the image in error
*
* @return string
*/
public function getImage()
{
return $this->image;
}
}

Some files were not shown because too many files have changed in this diff Show More