Gravity PDF - Version 3.3.4

Version Description

  • Bug - Fixed issue linking to PDF from front end
  • Housekeeping - Removed autoredirect to initialisation page
Download this release

Release Info

Developer Blue Liquid Designs
Plugin Icon 128x128 Gravity PDF
Version 3.3.4
Comparing to
See all releases

Code changes from version 3.6.0 to 3.3.4

Files changed (46) hide show
  1. LICENSE +0 -339
  2. README.txt +26 -201
  3. depreciated.php +0 -24
  4. helper/api.php +256 -0
  5. helper/data.php +0 -31
  6. helper/installation-update-manager.php +437 -437
  7. helper/notices.php +0 -376
  8. helper/pdf-common.php +135 -137
  9. helper/pdf-configuration-indexer.php +53 -194
  10. helper/pdf-entry-detail.php +696 -1389
  11. helper/pdf-render.php +36 -94
  12. initialisation/configuration.php.example +81 -171
  13. initialisation/template.css +0 -132
  14. initialisation/templates/default-template-no-style.php +29 -23
  15. initialisation/templates/default-template-two-rows.php +30 -23
  16. initialisation/templates/default-template.php +24 -18
  17. initialisation/templates/example-advanced-headers_07.php +85 -81
  18. initialisation/templates/example-backgrounds-and-borders02.php +105 -89
  19. initialisation/templates/example-basic-html01.php +142 -119
  20. initialisation/templates/example-different-page-size_08.php +45 -56
  21. initialisation/templates/example-float-and-positioning05.php +144 -129
  22. initialisation/templates/example-header-and-footer_06.php +74 -82
  23. initialisation/templates/example-images03.php +221 -214
  24. initialisation/templates/example-tables04.php +1139 -1697
  25. initialisation/templates/example-template.php +70 -53
  26. initialisation/templates/example-watermark09.php +0 -136
  27. languages/pdfextended-en_GB.po +0 -856
  28. languages/pdfextended-fr_FR.mo +0 -0
  29. languages/pdfextended-fr_FR.po +0 -1024
  30. mPDF.zip +0 -0
  31. mPDF/CHANGELOG.txt +2766 -22
  32. mPDF/README.txt +145 -2
  33. mPDF/classes/barcode.php +0 -1
  34. mPDF/classes/cssmgr.php +0 -1602
  35. mPDF/classes/svg.php +3 -3
  36. mPDF/classes/tocontents.php +155 -34
  37. mPDF/classes/ttfontsuni.php +3 -4
  38. mPDF/compress.php +0 -172
  39. mPDF/config.php +28 -44
  40. mPDF/config_cp.php +5 -6
  41. mPDF/config_fonts.php +17 -30
  42. mPDF/includes/functions.php +3 -51
  43. mPDF/includes/out.php +2 -3
  44. mPDF/mpdf-extra-lite.php +14 -32
  45. mPDF/mpdf-lite.php +21 -40
  46. mPDF/mpdf.php +1962 -1349
LICENSE DELETED
@@ -1,339 +0,0 @@
1
- GNU GENERAL PUBLIC LICENSE
2
- Version 2, June 1991
3
-
4
- Copyright (C) 1989, 1991 Free Software Foundation, Inc., <http://fsf.org/>
5
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6
- Everyone is permitted to copy and distribute verbatim copies
7
- of this license document, but changing it is not allowed.
8
-
9
- Preamble
10
-
11
- The licenses for most software are designed to take away your
12
- freedom to share and change it. By contrast, the GNU General Public
13
- License is intended to guarantee your freedom to share and change free
14
- software--to make sure the software is free for all its users. This
15
- General Public License applies to most of the Free Software
16
- Foundation's software and to any other program whose authors commit to
17
- using it. (Some other Free Software Foundation software is covered by
18
- the GNU Lesser General Public License instead.) You can apply it to
19
- your programs, too.
20
-
21
- When we speak of free software, we are referring to freedom, not
22
- price. Our General Public Licenses are designed to make sure that you
23
- have the freedom to distribute copies of free software (and charge for
24
- this service if you wish), that you receive source code or can get it
25
- if you want it, that you can change the software or use pieces of it
26
- in new free programs; and that you know you can do these things.
27
-
28
- To protect your rights, we need to make restrictions that forbid
29
- anyone to deny you these rights or to ask you to surrender the rights.
30
- These restrictions translate to certain responsibilities for you if you
31
- distribute copies of the software, or if you modify it.
32
-
33
- For example, if you distribute copies of such a program, whether
34
- gratis or for a fee, you must give the recipients all the rights that
35
- you have. You must make sure that they, too, receive or can get the
36
- source code. And you must show them these terms so they know their
37
- rights.
38
-
39
- We protect your rights with two steps: (1) copyright the software, and
40
- (2) offer you this license which gives you legal permission to copy,
41
- distribute and/or modify the software.
42
-
43
- Also, for each author's protection and ours, we want to make certain
44
- that everyone understands that there is no warranty for this free
45
- software. If the software is modified by someone else and passed on, we
46
- want its recipients to know that what they have is not the original, so
47
- that any problems introduced by others will not reflect on the original
48
- authors' reputations.
49
-
50
- Finally, any free program is threatened constantly by software
51
- patents. We wish to avoid the danger that redistributors of a free
52
- program will individually obtain patent licenses, in effect making the
53
- program proprietary. To prevent this, we have made it clear that any
54
- patent must be licensed for everyone's free use or not licensed at all.
55
-
56
- The precise terms and conditions for copying, distribution and
57
- modification follow.
58
-
59
- GNU GENERAL PUBLIC LICENSE
60
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61
-
62
- 0. This License applies to any program or other work which contains
63
- a notice placed by the copyright holder saying it may be distributed
64
- under the terms of this General Public License. The "Program", below,
65
- refers to any such program or work, and a "work based on the Program"
66
- means either the Program or any derivative work under copyright law:
67
- that is to say, a work containing the Program or a portion of it,
68
- either verbatim or with modifications and/or translated into another
69
- language. (Hereinafter, translation is included without limitation in
70
- the term "modification".) Each licensee is addressed as "you".
71
-
72
- Activities other than copying, distribution and modification are not
73
- covered by this License; they are outside its scope. The act of
74
- running the Program is not restricted, and the output from the Program
75
- is covered only if its contents constitute a work based on the
76
- Program (independent of having been made by running the Program).
77
- Whether that is true depends on what the Program does.
78
-
79
- 1. You may copy and distribute verbatim copies of the Program's
80
- source code as you receive it, in any medium, provided that you
81
- conspicuously and appropriately publish on each copy an appropriate
82
- copyright notice and disclaimer of warranty; keep intact all the
83
- notices that refer to this License and to the absence of any warranty;
84
- and give any other recipients of the Program a copy of this License
85
- along with the Program.
86
-
87
- You may charge a fee for the physical act of transferring a copy, and
88
- you may at your option offer warranty protection in exchange for a fee.
89
-
90
- 2. You may modify your copy or copies of the Program or any portion
91
- of it, thus forming a work based on the Program, and copy and
92
- distribute such modifications or work under the terms of Section 1
93
- above, provided that you also meet all of these conditions:
94
-
95
- a) You must cause the modified files to carry prominent notices
96
- stating that you changed the files and the date of any change.
97
-
98
- b) You must cause any work that you distribute or publish, that in
99
- whole or in part contains or is derived from the Program or any
100
- part thereof, to be licensed as a whole at no charge to all third
101
- parties under the terms of this License.
102
-
103
- c) If the modified program normally reads commands interactively
104
- when run, you must cause it, when started running for such
105
- interactive use in the most ordinary way, to print or display an
106
- announcement including an appropriate copyright notice and a
107
- notice that there is no warranty (or else, saying that you provide
108
- a warranty) and that users may redistribute the program under
109
- these conditions, and telling the user how to view a copy of this
110
- License. (Exception: if the Program itself is interactive but
111
- does not normally print such an announcement, your work based on
112
- the Program is not required to print an announcement.)
113
-
114
- These requirements apply to the modified work as a whole. If
115
- identifiable sections of that work are not derived from the Program,
116
- and can be reasonably considered independent and separate works in
117
- themselves, then this License, and its terms, do not apply to those
118
- sections when you distribute them as separate works. But when you
119
- distribute the same sections as part of a whole which is a work based
120
- on the Program, the distribution of the whole must be on the terms of
121
- this License, whose permissions for other licensees extend to the
122
- entire whole, and thus to each and every part regardless of who wrote it.
123
-
124
- Thus, it is not the intent of this section to claim rights or contest
125
- your rights to work written entirely by you; rather, the intent is to
126
- exercise the right to control the distribution of derivative or
127
- collective works based on the Program.
128
-
129
- In addition, mere aggregation of another work not based on the Program
130
- with the Program (or with a work based on the Program) on a volume of
131
- a storage or distribution medium does not bring the other work under
132
- the scope of this License.
133
-
134
- 3. You may copy and distribute the Program (or a work based on it,
135
- under Section 2) in object code or executable form under the terms of
136
- Sections 1 and 2 above provided that you also do one of the following:
137
-
138
- a) Accompany it with the complete corresponding machine-readable
139
- source code, which must be distributed under the terms of Sections
140
- 1 and 2 above on a medium customarily used for software interchange; or,
141
-
142
- b) Accompany it with a written offer, valid for at least three
143
- years, to give any third party, for a charge no more than your
144
- cost of physically performing source distribution, a complete
145
- machine-readable copy of the corresponding source code, to be
146
- distributed under the terms of Sections 1 and 2 above on a medium
147
- customarily used for software interchange; or,
148
-
149
- c) Accompany it with the information you received as to the offer
150
- to distribute corresponding source code. (This alternative is
151
- allowed only for noncommercial distribution and only if you
152
- received the program in object code or executable form with such
153
- an offer, in accord with Subsection b above.)
154
-
155
- The source code for a work means the preferred form of the work for
156
- making modifications to it. For an executable work, complete source
157
- code means all the source code for all modules it contains, plus any
158
- associated interface definition files, plus the scripts used to
159
- control compilation and installation of the executable. However, as a
160
- special exception, the source code distributed need not include
161
- anything that is normally distributed (in either source or binary
162
- form) with the major components (compiler, kernel, and so on) of the
163
- operating system on which the executable runs, unless that component
164
- itself accompanies the executable.
165
-
166
- If distribution of executable or object code is made by offering
167
- access to copy from a designated place, then offering equivalent
168
- access to copy the source code from the same place counts as
169
- distribution of the source code, even though third parties are not
170
- compelled to copy the source along with the object code.
171
-
172
- 4. You may not copy, modify, sublicense, or distribute the Program
173
- except as expressly provided under this License. Any attempt
174
- otherwise to copy, modify, sublicense or distribute the Program is
175
- void, and will automatically terminate your rights under this License.
176
- However, parties who have received copies, or rights, from you under
177
- this License will not have their licenses terminated so long as such
178
- parties remain in full compliance.
179
-
180
- 5. You are not required to accept this License, since you have not
181
- signed it. However, nothing else grants you permission to modify or
182
- distribute the Program or its derivative works. These actions are
183
- prohibited by law if you do not accept this License. Therefore, by
184
- modifying or distributing the Program (or any work based on the
185
- Program), you indicate your acceptance of this License to do so, and
186
- all its terms and conditions for copying, distributing or modifying
187
- the Program or works based on it.
188
-
189
- 6. Each time you redistribute the Program (or any work based on the
190
- Program), the recipient automatically receives a license from the
191
- original licensor to copy, distribute or modify the Program subject to
192
- these terms and conditions. You may not impose any further
193
- restrictions on the recipients' exercise of the rights granted herein.
194
- You are not responsible for enforcing compliance by third parties to
195
- this License.
196
-
197
- 7. If, as a consequence of a court judgment or allegation of patent
198
- infringement or for any other reason (not limited to patent issues),
199
- conditions are imposed on you (whether by court order, agreement or
200
- otherwise) that contradict the conditions of this License, they do not
201
- excuse you from the conditions of this License. If you cannot
202
- distribute so as to satisfy simultaneously your obligations under this
203
- License and any other pertinent obligations, then as a consequence you
204
- may not distribute the Program at all. For example, if a patent
205
- license would not permit royalty-free redistribution of the Program by
206
- all those who receive copies directly or indirectly through you, then
207
- the only way you could satisfy both it and this License would be to
208
- refrain entirely from distribution of the Program.
209
-
210
- If any portion of this section is held invalid or unenforceable under
211
- any particular circumstance, the balance of the section is intended to
212
- apply and the section as a whole is intended to apply in other
213
- circumstances.
214
-
215
- It is not the purpose of this section to induce you to infringe any
216
- patents or other property right claims or to contest validity of any
217
- such claims; this section has the sole purpose of protecting the
218
- integrity of the free software distribution system, which is
219
- implemented by public license practices. Many people have made
220
- generous contributions to the wide range of software distributed
221
- through that system in reliance on consistent application of that
222
- system; it is up to the author/donor to decide if he or she is willing
223
- to distribute software through any other system and a licensee cannot
224
- impose that choice.
225
-
226
- This section is intended to make thoroughly clear what is believed to
227
- be a consequence of the rest of this License.
228
-
229
- 8. If the distribution and/or use of the Program is restricted in
230
- certain countries either by patents or by copyrighted interfaces, the
231
- original copyright holder who places the Program under this License
232
- may add an explicit geographical distribution limitation excluding
233
- those countries, so that distribution is permitted only in or among
234
- countries not thus excluded. In such case, this License incorporates
235
- the limitation as if written in the body of this License.
236
-
237
- 9. The Free Software Foundation may publish revised and/or new versions
238
- of the General Public License from time to time. Such new versions will
239
- be similar in spirit to the present version, but may differ in detail to
240
- address new problems or concerns.
241
-
242
- Each version is given a distinguishing version number. If the Program
243
- specifies a version number of this License which applies to it and "any
244
- later version", you have the option of following the terms and conditions
245
- either of that version or of any later version published by the Free
246
- Software Foundation. If the Program does not specify a version number of
247
- this License, you may choose any version ever published by the Free Software
248
- Foundation.
249
-
250
- 10. If you wish to incorporate parts of the Program into other free
251
- programs whose distribution conditions are different, write to the author
252
- to ask for permission. For software which is copyrighted by the Free
253
- Software Foundation, write to the Free Software Foundation; we sometimes
254
- make exceptions for this. Our decision will be guided by the two goals
255
- of preserving the free status of all derivatives of our free software and
256
- of promoting the sharing and reuse of software generally.
257
-
258
- NO WARRANTY
259
-
260
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261
- FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262
- OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263
- PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264
- OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265
- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266
- TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267
- PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268
- REPAIR OR CORRECTION.
269
-
270
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271
- WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272
- REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273
- INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274
- OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275
- TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276
- YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277
- PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278
- POSSIBILITY OF SUCH DAMAGES.
279
-
280
- END OF TERMS AND CONDITIONS
281
-
282
- How to Apply These Terms to Your New Programs
283
-
284
- If you develop a new program, and you want it to be of the greatest
285
- possible use to the public, the best way to achieve this is to make it
286
- free software which everyone can redistribute and change under these terms.
287
-
288
- To do so, attach the following notices to the program. It is safest
289
- to attach them to the start of each source file to most effectively
290
- convey the exclusion of warranty; and each file should have at least
291
- the "copyright" line and a pointer to where the full notice is found.
292
-
293
- {description}
294
- Copyright (C) {year} {fullname}
295
-
296
- This program is free software; you can redistribute it and/or modify
297
- it under the terms of the GNU General Public License as published by
298
- the Free Software Foundation; either version 2 of the License, or
299
- (at your option) any later version.
300
-
301
- This program is distributed in the hope that it will be useful,
302
- but WITHOUT ANY WARRANTY; without even the implied warranty of
303
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
304
- GNU General Public License for more details.
305
-
306
- You should have received a copy of the GNU General Public License along
307
- with this program; if not, write to the Free Software Foundation, Inc.,
308
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
309
-
310
- Also add information on how to contact you by electronic and paper mail.
311
-
312
- If the program is interactive, make it output a short notice like this
313
- when it starts in an interactive mode:
314
-
315
- Gnomovision version 69, Copyright (C) year name of author
316
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
317
- This is free software, and you are welcome to redistribute it
318
- under certain conditions; type `show c' for details.
319
-
320
- The hypothetical commands `show w' and `show c' should show the appropriate
321
- parts of the General Public License. Of course, the commands you use may
322
- be called something other than `show w' and `show c'; they could even be
323
- mouse-clicks or menu items--whatever suits your program.
324
-
325
- You should also get your employer (if you work as a programmer) or your
326
- school, if any, to sign a "copyright disclaimer" for the program, if
327
- necessary. Here is a sample; alter the names:
328
-
329
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
330
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
331
-
332
- {signature of Ty Coon}, 1 April 1989
333
- Ty Coon, President of Vice
334
-
335
- This General Public License does not permit incorporating your program into
336
- proprietary programs. If your program is a subroutine library, you may
337
- consider it more useful to permit linking proprietary applications with the
338
- library. If this is what you want to do, use the GNU Lesser General
339
- Public License instead of this License.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
README.txt CHANGED
@@ -1,18 +1,18 @@
1
  === Plugin Name ===
2
  Contributors: blueliquiddesigns
3
- Donate link: https://gravitypdf.com
4
  Tags: gravity, forms, pdf, automation, attachment
5
  Requires at least: 3.5
6
- Tested up to: 4.1
7
- Stable tag: 3.6.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
- Gravity PDF allows you to save/view/download a PDF from the front- and back-end, and automate PDF creation on form submission.
12
 
13
  == Description ==
14
 
15
- Gravity PDF is a powerful developer tool for creating PDF documents using form data captured from Gravity Forms. While the software is targeted at web developers, we've attempted to make it user friendly for hobbyists and DIY business owners. The basic setup can be done in minutes, and there is a huge array of options to configure the PDF as you see fit.
16
 
17
  **Gravity Form Features**
18
 
@@ -48,8 +48,6 @@ Along with the above, the PDF software includes powerful feature such as:
48
  3. GD Library
49
  4. RAM: Recommended: 128MB. Minimum: 64MB.
50
 
51
- *Note:* We've had clients report slow PDF generation times and problems meeting the RAM requirements on cheap shared web hosting. If you experience these problems [we recommend you look into WP Engine's managed hosting platform](http://www.shareasale.com/r.cfm?B=398776&U=955815&M=41388&urllink=) as our software works correctly out of the box.
52
-
53
  **Software Requirements**
54
 
55
  1. [Purchase and install Gravity Forms](https://www.e-junkie.com/ecom/gb.php?cl=54585&c=ib&aff=235154)
@@ -58,202 +56,28 @@ Along with the above, the PDF software includes powerful feature such as:
58
 
59
  **Documentation and Support**
60
 
61
- To view the Development Documentation head to [https://developer.gravitypdf.com](https://developer.gravitypdf.com). If you need support with the plugin please post a topic in our [support forums](https://support.gravitypdf.com).
62
 
63
  == Installation ==
64
 
65
  1. Upload this plugin to your website and activate it
66
  2. Head to Forms -> Settings -> PDF to initialise the plugin.
67
  3. Create a form in Gravity Forms and configure notifications
68
- 4. Get the Form ID and follow the steps below in [the configuration section](http://developer.gravitypdf.com/documentation/getting-started-with-gravity-pdf-configuration/)
69
- 5. Modify the PDF template file ([see the advanced templating section in the documentation](http://developer.gravitypdf.com/documentation/custom-templates-introduction/)) inside your active theme's PDF_EXTENDED_TEMPLATES/ folder.
70
 
71
 
72
  == Frequently Asked Questions ==
73
 
74
- All FAQs can be [viewed on the Gravity PDF website](https://gravitypdf.com/#faqs).
75
 
76
  == Screenshots ==
77
 
78
- 1. The View PDF button is avaliable for each Gravity Form entry
79
- 2. Multiple PDFs can be assigned to a form and is also avaliable on the detailed entry view.
80
- 3. The configuration.php file allows you to easily assign PDFs to Gravity Forms
81
 
82
  == Changelog ==
83
 
84
- = 3.6.0 =
85
- * Feature - Added support for Gravity Form's sub-field middle name (1.9Beta)
86
- * Feature - Patch mPDF with full :nth-child support on TD and TR table cells
87
- * Feature - Added $form_data[products_totals][subtotal] key (total price without shipping costs added)
88
- * Feature - Added formated money to all product fields in the $form_data array
89
- * Feature - Default templates: only show fields who's conditional logic is true. Perfect when used with default-show-html
90
- * Housekeeping - Move PDF_EXTENDED_TEMPLATES folder to the /wp-content/upload/ directory. Get more info about the move (see http://developer.gravitypdf.com/news/migrating-template-directory-means/)
91
- * Housekeeping - Refined when admin resources are loaded
92
- * Housekeeping - Fixed typo during initial initialisation
93
- * Housekeeping - Switched icons back to FontAwesome which is shipped by default with Gravity Forms
94
- * Housekeeping - Display full path to mPDF tmp directory when there are issues writing to it
95
- * Housekeeping - Modified font installation message.
96
- * Housekeeping - Update example-header-and-footer_06.php and example-advanced-headers_07.php to better reflect current mPDF features
97
- * Bug - Fixed issue pulling the correct configuration when multiple nodes were assigned to multiple forms
98
- * Bug - Fixed number field formatting issue which always rounded to two decimal places
99
- * Bug - Fixed JS namespace issue with WordPress Leads plugin
100
- * Bug - Fixed error initialising fonts / backing up PDF_EXTENDED_TEMPLATES directory when using the glob() function
101
- * Bug - Fix issue with PHP 5.0 and 5.1 array_replace_recursive function when used with an array inside the $gf_pdf_config array
102
- * Bug - Fixed fatal error when logged in user attempts to view PDF they don't have access to
103
- * Bug - Fixed issue in $form_data array where single-column list items where being returned as an array and not a HTML list.
104
- * Bug - Prevent unauthorised users auto-initialising the software or migrating the templates folder
105
- * Bug - Fixed up incorrect formatting issue when using custom font name
106
- * Bug - Fixed issue displaying Times New Roman in PDF templates
107
-
108
- = 3.5.11.1 =
109
- * Bug - Fix issue saving and sending blank PDFs due to security fix
110
-
111
- = 3.5.11 =
112
- * Bug - Fix security issue which gave unauthorised users access to Gravity Form entires
113
-
114
- = 3.5.10 =
115
- * Housekeeping - Include individual scoring for Gravity Form Survey Likert field in the $form_data['survey'] array
116
- * Bug - Fix fatal error when Gravity Forms isn't activated, but Gravity PDF is.
117
-
118
- = 3.5.9 =
119
- * Bug - Rollback recent changes that introduced the GFAPI as introduces errors for older versions of Gravity Forms. Will reintroduce in next major release and increase the minimum Gravity Forms version.
120
-
121
- = 3.5.8 =
122
- * Bug - Fixed issue affected some users where a depreciated function was causing a fatal error
123
-
124
- = 3.5.7 =
125
- * Bug - Fixed issue where the PDF settings page was blank for some users
126
-
127
- = 3.5.6 =
128
- * Bug - Fixed issue with last release that affected checks to see if Gravity Forms has submitting
129
- * Bug - Fixed fatal error with servers using PHP5.2 or lower
130
- * Bug - Fixed E_NOTICE for replacement array_replace_recursive() function in PHP5.2 or lower
131
- * Bug - Fixed issue with AJAX spinner showing when submitting support request
132
-
133
- = 3.5.5 =
134
- * Housekeeping - Include French translation (thanks to Marie-Aude Koiransky-Ballouk)
135
- * Housekeeping - Wrap 'Initialise Fonts' text in translation ready _e() function
136
- * Housekeeping - Tidy up System Status CSS styles to accomidate translation text lengths
137
- * Housekeeping - Fix E_NOTICE when viewing entry details page when form has no PDF configuration
138
- * Bug - Fixed load_plugin_textdomain which was incorrectly called.
139
- * Bug - Correctly check if the plugin is loaded correctly before letting the PDF class fully load
140
-
141
- = 3.5.4 =
142
- * Bug - Fixed issue with incorrect PDF name showing on the entry details page
143
- * Bug - Fixed issue with custom fonts being inaccessible without manually reinstalling after upgrading.
144
- * Housekeeping - Added in two new filters to modify the $mpdf object. 'gfpdfe_mpdf_class' and 'gfpdfe_mpdf_class_pre_render' (replaces the gfpdfe_pre_render_pdf filter).
145
-
146
- = 3.5.3 =
147
- * Bug - Mergetags braces ({}) were being encoded before conversion
148
- * Bug - Fixed issue with empty string being passed to array filter
149
- * Housekeeping - Enabled mergetag usage in the pdf_password and pdf_master_password configuration options
150
- * Housekeeping - Correctly call $wpdb->prepare so the variables in are in the second argument
151
-
152
- = 3.5.2 =
153
- * Bug - Initialisation folder .htaccess file was preventing template.css from being loaded by the default templates.
154
-
155
- = 3.5.1 =
156
- * Bug - Fixed issue with core fonts Arial/Helvetica, Times/Times New Roman and Courier not displaying in the PDF.
157
- * Bug - Fixed display issues for multiple PDFs on the details admin entry page
158
- * Housekeeping - Made the details entry page PDF view consistent for single or multiple PDFs
159
- * Housekeeping - Ensured all javascript files are minified and are correctly being used
160
- * Housekeeping - Remove legacy notices from mPDF package
161
-
162
- = 3.5.0 =
163
- * Feature - No longer need to reinitialise every time the software is updated.
164
- * Feature - Add auto-initialiser on initial installation for sites that have direct write access to their server files
165
- * Feature - Add auto-initialiser on initial installation across entire multisite network for sites who have direct write access to their server files.
166
- * Feature - Add auto-PDF_EXTENDED_TEMPLATES theme syncer for sites that have direct write access to their server files
167
- * Feature - Correctly added language support. The .PO file is located in the /language/ folder if anyone would like to do a translation.
168
-
169
- * Housekeeping - Restrict initialisation process to 64MB or greater to counter problems with users reporting a 'white screen' when running in a low-RAM environment.
170
- * Housekeeping - Refractor the admin notices code
171
- * Housekeeping - Create responsive PDF settings page
172
- * Housekeeping - Minify CSS and Javascript files
173
- * Housekeeping - Remove FontAwesome fonts from package and use Wordpress' build-in 'dashicons'
174
- * Housekeeping - Refine action and error messages
175
- * Housekeeping - Update initialisation tab copy for both pre- and post- initialisation
176
- * Housekeeping - Use Gravity Forms get_ip() function instead of custom function
177
- * Housekeeping - The in-built support form uses SSL once again (disabled in the past due to some servers being unable to verify the certificate).
178
-
179
- * Bug - When testing write permissions, file_exist() is throwing false positives for some users which would generate a warning when unlink() is called. Hide warning using '@'.
180
-
181
- = 3.4.1 =
182
- * Bug - Fix typo that effected sites running PHP5.2 or below.
183
-
184
- = 3.4.0.3 =
185
- * Bug - Define array_replace_recursive() if it doesn't exist, as it is PHP 5.3 only.
186
-
187
- = 3.4.0.2 =
188
- * Housekeeping - Wrapped the View PDF and Download buttons in correct language functions - _e()
189
- * Bug - Fix problem displaying the signature field
190
- * Bug - Fix notice errors with new 'save' PDF hook
191
-
192
- = 3.4.0.1 =
193
- * Housekeeping - Add commas on the last line of every config node in the configuration.php file
194
- * Housekeeping - Fix up initialisation error messages
195
- * Bug - Fix up mPDF bugs - soft hyphens, watermarks over SVG images, inline CSS bug
196
-
197
- = 3.4.0 =
198
- * Feature - Added auto-print prompt ability when you add &print=1 to the PDF URL (see https://developer.gravitypdf.com/documentation/display-pdf-in-browser/ for details)
199
- * Feature - Added ability to rotate absolute positioned text 180 degrees (previously only 90 and -90). Note: feature in beta
200
- * Feature - Backup all template files that are overridden when initialising to a folder inside PDF_EXTENDED_TEMPLATES
201
- * Feature - Added SSH initialisation support
202
- * Feature - Allow MERGETAGS to be used in all PDF templates, including default template (but only in the HTML field).
203
- * Feature - Updated mPDF to 3.7.1
204
- * Feature - Enable text/image watermark support. Added new example template example-watermark09.php showing off its usage (see http://gravitypdf.com/documentation-v3-x-x/templates/watermarks/)
205
- * Feature - Added full survey, poll and quiz support to both the default template and $form_data (see https://developer.gravitypdf.com/documentation/accessing-survey-poll-quiz-data/)
206
- * Feature - Shortcodes will now be processed in all templates, including default template (but only in the HTML field).
207
- * Feature - Added 'save' configuration option so PDFs are saved to the local disk when 'notifications' aren't enabled.
208
- * Feature - Added 'dpi' configuration option to modify the PDF image DPI. Default 96dpi. Use 300dpi for printing.
209
- * Feature - Added PDF/A1-b compliance option. Enable with 'pdfa1b' => true. See http://mpdf1.com/manual/index.php?tid=420&searchstring=pdf/a1-b for more details.
210
- * Feature - Added PDF/X1-a compliance option. Enable with 'pdfx1a' => true. See http://mpdf1.com/manual/index.php?tid=481&searchstring=pdf/x-1a for more details.
211
- * Feature - Added new constant option 'PDF_REPACK_FONT' which when enabled may improve function with some PostScript printers (disabled by default). Existing sites will need to add define('PDF_REPACK_FONT', true); to the bottom of their configuration.php file.
212
- * Feature - Added a sleuth of new hooks and filters for developers. See https://developer.gravitypdf.com/documentation/filters-and-hooks/ for examples.
213
- * Feature - Added $form_data['form_description'] key to $form_data array
214
- * Feature - Update $form_data['products'] array key to field ID
215
- * Feature - Added survey Likert output function for custom templates (much like the product table function). It can be used with the following command 'echo GFPDFEntryDetails::get_likert($form, $lead, $field_id);' where $field_id is substituted for the form field ID.
216
- * Feature - Added field descriptions to the $form_data array under the $form_data['field_descriptions'] key.
217
- * Feature - Added pre and post PDF generation filters and actions to pdf-render.php. These include gfpdfe_pre_render_pdf, gfpdfe_pdf_output_type, gfpdfe_pdf_filename and gfpdf_post_pdf_save.
218
- * Feature: $form_data['signature'] et al. keys now contain the signature width and height attributes
219
-
220
- * Housekeeping - Ensure the form and lead IDs are correctly passed throughout the render functions.
221
- * Housekeeping - Update settings page link to match new Gravity Forms URL structure
222
- * Housekeeping - Check if $lead['gfsurvey_score'] exists before assigning to $form_data array
223
- * Housekeeping - Removed table and font checksum debugging from mPDF when WP_DEBUG enabled as they produced inaccurate results.
224
- * Housekeeping - Fixed up mPDF logging location when WP_DEBUG enabled. Files now stored in wp-content/themes/Active_Theme_Folder/PDF_EXTENDED_TEMPLATES/output/ folder.
225
- * Housekeeping - Removed API logging locally when WP_DEBUG is enabled.
226
- * Housekeeping - Increase API timeout interval as some overseas users reported timeout issues
227
- * Housekeeping - Modified mPDF functions Image() and purify_utf8_text() to validate the input data so we don't have to do it every time through the template.
228
- * Housekeeping - Added ability to not re-deploy every update (not enabled this release as template files were all updated)
229
- * Housekeeping - Additional checks on load to see if any of the required file/folder structure is missing. If so, re-initilise.
230
- * Housekeeping - Save resources and turn off automatic rtl identification. Users must set the RTL option when configuring form
231
- * Housekeeping - Turn off mPDFs packTableData setting, decreasing processing time when working with large tables.
232
- * Housekeeping - $gf_pdf_default_configuration options now merge down into existing PDF nodes, instead of applying to only unassigned forms. $gf_pdf_config settings override any in $gf_pdf_default_configuration
233
- * Housekeeping - Center aligned Survey Likery field results
234
- * Housekeeping - Partially refactored the pdf-entry-detail.php code
235
- * Housekeeping - All default and example templates have been tidied. This won't affect custom templates.
236
- * Housekeeping - Set the gform_notification order number to 100 which will prevent other functions (example snippets from Gravity Forms, for instance) from overridding the attached PDF.
237
- * Housekeeping - Fix spelling mistake on initialising fonts
238
- * Housekeeping - Remove wpautop() function from Gravity Form HTML output, which was applied before rendering and was messing up the HTML markup.
239
- * Housekeeping - Remove empty list rows from the $form_data['list'] array in single and multi-column lists.
240
- * Housekeeping - Apply same CSS styles (padding, border and line height) to HTML fields as done to form values in default templates
241
- * Housekeeping - Replaced arbitrary wrapper IDs in the default templates with the actual field ID
242
-
243
- * Bug - Fixed signature rendering issue when custom signature size was being used
244
- * Bug - Fixed static error types in helper/install-update-manager.php file.
245
- * Bug - Fixed redeployment error message which wasn't showing correctly
246
- * Bug - Fixed issue with PDF not attaching to notification using Paypal's delayed notification feature
247
- * Bug - Fixed strict standard warning about calling GFPDF_Settings::settings_page();
248
- * Bug - Fixed strict standard warning about calling GFPDFEntryDetail::pdf_get_lead_field_display();
249
- * Bug - Fixed issue with Gravity Form Post Category field causing fatal error generating PDF
250
- * Bug - Fixed number field formatting issue when displaying on PDF.
251
- * Bug - Do additional check for PHP's MB_String regex functions before initialising ti prevent errors after initialising
252
- * Bug - Fixed problem with multiple nodes assigned to a form using the same template
253
- * Bug - Fixed path to fallback templates when not found
254
- * Bug - Fixed problem with master password setting to user password
255
-
256
-
257
  = 3.3.4 =
258
  * Bug - Fixed issue linking to PDF from front end
259
  * Housekeeping - Removed autoredirect to initialisation page
@@ -276,7 +100,7 @@ All FAQs can be [viewed on the Gravity PDF website](https://gravitypdf.com/#faqs
276
  = 3.3.0 =
277
  * Feature - Overhauled the initialisation process so that the software better reviews the host for potential problems before initialisation. This should help debug issues and make users aware there could be a problem before they begin using the software.
278
  * Feature - Overhauled the settings page to make it easier to access features of the software
279
- * Feature - Added a Support tab to the settings page which allows users to securely (over HTTPS) submit a support ticket to the Gravity PDF support desk
280
  * Feature - Changed select, multiselect and radio fields so that the default templates use the name rather than the value. $form_data now also includes the name and values for all these fields.
281
  * Feature - $form_data now includes all miscellaneous lead information in the $form_data['misc'] array.
282
  * Feature - $form_data now contains 24 and 12 hour time of entry submission.
@@ -286,7 +110,7 @@ All FAQs can be [viewed on the Gravity PDF website](https://gravitypdf.com/#faqs
286
  * Bug - Fixed issue when Gravity Forms in No Conflict Mode
287
  * Bug - Font config.php's array keys now in lower case
288
  * Housekeeping - Moved all initialisation files to a folder called 'initialisation'.
289
- * Housekeeping - Renamed the configuration.php file in the plugin folder to configuration.php.example to alleviate confusion for developers who unwittingly modify the plugin configuration file instead of the file in their active theme's PDF_EXTENDED_TEMPLATES folder.
290
  * Housekeeping - Updated the plugin file system to a more MVC-style approach, with model and view folders.
291
  * Housekeeping - Removed ability to directly access default and example template files.
292
  * Housekeeping - Fixed PHP notices in default templates related to the default template-only configuration options
@@ -295,14 +119,14 @@ All FAQs can be [viewed on the Gravity PDF website](https://gravitypdf.com/#faqs
295
 
296
  = 3.2.0 =
297
  * Feature - Can now view multiple PDFs assigned to a single form via the admin area. Note: You must provide a unique 'filename' parameter in configuration.php for multiple PDFs assigned to a single form.
298
- * Feature - You can exclude a field from the default templates using the class name 'exclude'. See our [FAQ topic](https://gravitypdf.com/#faqs) for more details.
299
  * Bug - Fixed issue viewing own PDF entry when logged in as anything lower than editor.
300
  * Bug - Fixed data return bug in pdf-entry-details.php that was preventing all data returning correctly.
301
  * Bug - Fixed PHP Warning when using products with no options
302
  * Bug - Fixed issue with invalid characters being added to the PDF filename. Most notably the date mergetag.
303
  * Bug - Limit filename length to 150 characters which should work on the majority of web servers.
304
  * Bug - Fixed problem sending duplicate PDF when using mass resend notification feature
305
- * Depreciated - Removed GF_FORM_ID and GF_LEAD_ID constants which were used in v2.x.x of the software. Ensure you follow [v2.x.x upgrade guide](https://developer.gravitypdf.com/news/version-2-3-migration-guide/) to your templates before upgrading.
306
 
307
  = 3.1.4 =
308
  * Bug - Fixed issue with plugin breaking website's when the Gravity Forms plugin wasn't activated.
@@ -331,14 +155,14 @@ All FAQs can be [viewed on the Gravity PDF website](https://gravitypdf.com/#faqs
331
  * Bug - Initialisation error message was being called but the success message was also showing.
332
 
333
  = 3.1.0 =
334
- * Feature - Added defaults to configuration.php which allows users to define the default PDF settings for all Gravity Forms. See the [installation and configuration documentation](https://developer.gravitypdf.com/documentation/getting-started-with-gravity-pdf-configuration/) for more details.
335
- * Feature - Added three new configuration options 'default-show-html', 'default-show-empty' and 'default-show-page-names' which allow different display options to the three default templates. See the [installation and configuration documentation](http://gravitypdf.com/documentation-v3-x-x/installation-and-configuration/#default-template) for more details.
336
- * Feature - Added filter hooks 'gfpdfe_pdf_name' and 'gfpdfe_template' which allows developers to further modify a PDF name and template file, respectively, outside of the configuration.php. This is useful if you have a special case naming convention based on user input. See [https://developer.gravitypdf.com/documentation/filters-and-hooks/](https://developer.gravitypdf.com/documentation/filters-and-hooks/) for more details about using these filters.
337
- * Feature - Custom font support. Any .ttf font file added to the PDF_EXTENDED_TEMPLATES/fonts/ folder will be automatically installed once the plugin has been initialised. Users also have the option to just initialise the fonts via the settings page. See the [font/language documentation ](https://developer.gravitypdf.com/documentation/language-support/#install-custom-fonts) for details.
338
  * Compatability - Use Gravity Forms get_upload_root() and get_upload_url_root() instead of hard coding the signature upload directory in pdf-entry-detail.php
339
  * Compatability - Changed depreciated functions get_themes() and get_theme() to wp_get_theme() (added in Wordpress v3.4).
340
  * Compatability - The plugin now needs to be initialised on fresh installation and upgrade. This allows us to use the WP_Filesystem API for file manipulation.
341
- * Compatability - Automatic copying of PDF_EXTENDED_TEMPLATES folder on a theme change was removed in favour of a user prompt. This allows us to take advantage of the WP_Filesystem API.
342
  * Compatability - Added Wordpress compatibility checker (minimum now 3.4 or higher).
343
  * Bug - Removed ZipArchive in favour of Wordpress's WP_Filesystem API unzip_file() command. Some users reported the plugin would stop their entire website working if this extension wasn't installed.
344
  * Bug - Fixed Gravity Forms compatibility checker which wouldn't return the correct response.
@@ -356,7 +180,7 @@ All FAQs can be [viewed on the Gravity PDF website](https://gravitypdf.com/#faqs
356
  * Feature - Options for default templates to disable HTML fields or empty fields (or both)
357
 
358
  = 3.0.0 =
359
- As of Gravity PDF v3.0.0 we have removed the DOMPDF package from our plugin and integrated the more advanced mPDF system. Along with a new HTML to PDF generator, we've rewritten the entire plugin's base code to make it more user friendly to both hobbyists and rock star web developers. Configuration time is cut in half and advanced features like adding security features is now accessible to users who have little experience with PHP.
360
 
361
  New Features include:
362
 
@@ -381,7 +205,7 @@ Other changes include
381
  * Improved security - further restrictions were placed on non-administrators viewing template files.
382
  * $form_data array tidied up - images won't be wrapped in anchor tags.
383
 
384
- For more details [view the 3.x.x online documentation](https://developer.gravitypdf.com/).
385
 
386
  = 2.2.3 =
387
  * Bug - Fixed mb_string error in the updated DOMPDF package.
@@ -411,7 +235,7 @@ For more details [view the 3.x.x online documentation](https://developer.gravity
411
  * Feature - Product subtotal, shipping and total have been added to $form_data['field'] array to make it easier to work with product details in the custom template.
412
  * Feature - Added two new default template files. One displays field and name in two rows (like you see when viewing an entry in the admin area) and the other removes all styling. See documentation on use.
413
  * Security - Tightened PDF template security so that custom templates couldn't be automatically generated by just anyone. Now only logged in users with the correct privileges and the user who submitted the form (matched against IP) can auto generate a PDF. See documentation on usage.
414
- * Depreciated - Removed form data that was added directly to the $form_data array instead of $form_data['field'] array. Users upgrading will need to update their custom templates if not using field data from the $form_data[�field'] array. If using $form_data['field'] in your custom template this won't affect you.
415
  * Bug - Fixed problem with default template not showing and displaying a timeout error. Removed table tags and replaced with divs that are styled appropriately.
416
  * Bug - The new plugin theme folder will successfully create when upgrading. You won't have to deactivate and reactivate to get it working.
417
  * Bug - some installs had plugins that included the function mb_string which is also included in DOMPDF. DOMPDF will now check if the function exists before creating it.
@@ -465,5 +289,6 @@ For more details [view the 3.x.x online documentation](https://developer.gravity
465
 
466
  == Upgrade Notice ==
467
 
468
- = 3.6.0 =
469
- WARNING: Minimum WordPress and Gravity Forms versions have been bumped to WordPress 3.9+ and Gravity Forms 1.8+. If you aren't running either version of this software DO NOT UPGRADE.
 
1
  === Plugin Name ===
2
  Contributors: blueliquiddesigns
3
+ Donate link: http://www.gravityformspdfextended.com
4
  Tags: gravity, forms, pdf, automation, attachment
5
  Requires at least: 3.5
6
+ Tested up to: 3.8
7
+ Stable tag: 3.3.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
+ Gravity Forms PDF Extended allows you to save/view/download a PDF from the front- and back-end, and automate PDF creation on form submission.
12
 
13
  == Description ==
14
 
15
+ Gravity Forms PDF Extended is a powerful developer tool for creating PDF documents using form data captured from Gravity Forms. While the software is targeted at web developers, we've attempted to make it user friendly for hobbyists and DIY business owners. The basic setup can be done in minutes, and there is a huge array of options to configure the PDF as you see fit.
16
 
17
  **Gravity Form Features**
18
 
48
  3. GD Library
49
  4. RAM: Recommended: 128MB. Minimum: 64MB.
50
 
 
 
51
  **Software Requirements**
52
 
53
  1. [Purchase and install Gravity Forms](https://www.e-junkie.com/ecom/gb.php?cl=54585&c=ib&aff=235154)
56
 
57
  **Documentation and Support**
58
 
59
+ To view the Development Documentation head to [http://www.gravityformspdfextended.com/documentation/](http://www.gravityformspdfextended.com/documentation/). If you need support with the plugin please post a topic in our [support forums](http://gravityformspdfextended.com/support/gravity-forms-pdf-extended/).
60
 
61
  == Installation ==
62
 
63
  1. Upload this plugin to your website and activate it
64
  2. Head to Forms -> Settings -> PDF to initialise the plugin.
65
  3. Create a form in Gravity Forms and configure notifications
66
+ 4. Get the Form ID and follow the steps below in [the configuration section](http://gravityformspdfextended.com/documentation-v3-x-x/installation-and-configuration/)
67
+ 5. Modify the PDF template file ([see the advanced templating section in the documentation](http://gravityformspdfextended.com/documentation-v3-x-x/templates/)) inside your active theme's PDF_EXTENDED_TEMPLATES/ folder.
68
 
69
 
70
  == Frequently Asked Questions ==
71
 
72
+ All FAQs can be [viewed on the Gravity Forms PDF Extended website](http://gravityformspdfextended.com/faq/category/developers/).
73
 
74
  == Screenshots ==
75
 
76
+ 1. View PDF from the Gravity Forms entries list.
77
+ 2. View or download the PDF from a Gravity Forms entry.
 
78
 
79
  == Changelog ==
80
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
81
  = 3.3.4 =
82
  * Bug - Fixed issue linking to PDF from front end
83
  * Housekeeping - Removed autoredirect to initialisation page
100
  = 3.3.0 =
101
  * Feature - Overhauled the initialisation process so that the software better reviews the host for potential problems before initialisation. This should help debug issues and make users aware there could be a problem before they begin using the software.
102
  * Feature - Overhauled the settings page to make it easier to access features of the software
103
+ * Feature - Added a Support tab to the settings page which allows users to securely (over HTTPS) submit a support ticket to the Gravity Form PDF Extended support desk
104
  * Feature - Changed select, multiselect and radio fields so that the default templates use the name rather than the value. $form_data now also includes the name and values for all these fields.
105
  * Feature - $form_data now includes all miscellaneous lead information in the $form_data['misc'] array.
106
  * Feature - $form_data now contains 24 and 12 hour time of entry submission.
110
  * Bug - Fixed issue when Gravity Forms in No Conflict Mode
111
  * Bug - Font config.php's array keys now in lower case
112
  * Housekeeping - Moved all initialisation files to a folder called 'initialisation'.
113
+ * Housekeeping - Renamed the configuration.php file in the plugin folder to configuration.php.example to alleviate confusion for developers who unwittingly modify the plugin configuration file instead of the file in their active theme's PDF_EXTENDED_TEMPLATE folder.
114
  * Housekeeping - Updated the plugin file system to a more MVC-style approach, with model and view folders.
115
  * Housekeeping - Removed ability to directly access default and example template files.
116
  * Housekeeping - Fixed PHP notices in default templates related to the default template-only configuration options
119
 
120
  = 3.2.0 =
121
  * Feature - Can now view multiple PDFs assigned to a single form via the admin area. Note: You must provide a unique 'filename' parameter in configuration.php for multiple PDFs assigned to a single form.
122
+ * Feature - You can exclude a field from the default templates using the class name 'exclude'. See our [FAQ topic](http://gravityformspdfextended.com/faq/can-exclude-field-showing-pdf/) for more details.
123
  * Bug - Fixed issue viewing own PDF entry when logged in as anything lower than editor.
124
  * Bug - Fixed data return bug in pdf-entry-details.php that was preventing all data returning correctly.
125
  * Bug - Fixed PHP Warning when using products with no options
126
  * Bug - Fixed issue with invalid characters being added to the PDF filename. Most notably the date mergetag.
127
  * Bug - Limit filename length to 150 characters which should work on the majority of web servers.
128
  * Bug - Fixed problem sending duplicate PDF when using mass resend notification feature
129
+ * Depreciated - Removed GF_FORM_ID and GF_LEAD_ID constants which were used in v2.x.x of the software. Ensure you follow [v2.x.x upgrade guide](http://gravityformspdfextended.com/documentation-v3-x-x/v3-0-0-migration-guide/) to your templates before upgrading.
130
 
131
  = 3.1.4 =
132
  * Bug - Fixed issue with plugin breaking website's when the Gravity Forms plugin wasn't activated.
155
  * Bug - Initialisation error message was being called but the success message was also showing.
156
 
157
  = 3.1.0 =
158
+ * Feature - Added defaults to configuration.php which allows users to define the default PDF settings for all Gravity Forms. See the [installation and configuration documentation](http://gravityformspdfextended.com/documentation-v3-x-x/installation-and-configuration/#default-configuration-options) for more details.
159
+ * Feature - Added three new configuration options 'default-show-html', 'default-show-empty' and 'default-show-page-names' which allow different display options to the three default templates. See the [installation and configuration documentation](http://gravityformspdfextended.com/documentation-v3-x-x/installation-and-configuration/#default-template-only) for more details.
160
+ * Feature - Added filter hooks 'gfpdfe_pdf_name' and 'gfpdfe_template' which allows developers to further modify a PDF name and template file, respectively, outside of the configuration.php. This is useful if you have a special case naming convention based on user input. See [http://gravityformspdfextended.com/filters-and-hooks/](http://gravityformspdfextended.com/filters-and-hooks/) for more details about using these filters.
161
+ * Feature - Custom font support. Any .ttf font file added to the PDF_EXTENDED_TEMPLATE/fonts/ folder will be automatically installed once the plugin has been initialised. Users also have the option to just initialise the fonts via the settings page. See the [font/language documentation ](http://gravityformspdfextended.com/documentation-v3-x-x/language-support/#installing-fonts) for details.
162
  * Compatability - Use Gravity Forms get_upload_root() and get_upload_url_root() instead of hard coding the signature upload directory in pdf-entry-detail.php
163
  * Compatability - Changed depreciated functions get_themes() and get_theme() to wp_get_theme() (added in Wordpress v3.4).
164
  * Compatability - The plugin now needs to be initialised on fresh installation and upgrade. This allows us to use the WP_Filesystem API for file manipulation.
165
+ * Compatability - Automatic copying of PDF_EXTENDED_TEMPLATE folder on a theme change was removed in favour of a user prompt. This allows us to take advantage of the WP_Filesystem API.
166
  * Compatability - Added Wordpress compatibility checker (minimum now 3.4 or higher).
167
  * Bug - Removed ZipArchive in favour of Wordpress's WP_Filesystem API unzip_file() command. Some users reported the plugin would stop their entire website working if this extension wasn't installed.
168
  * Bug - Fixed Gravity Forms compatibility checker which wouldn't return the correct response.
180
  * Feature - Options for default templates to disable HTML fields or empty fields (or both)
181
 
182
  = 3.0.0 =
183
+ As of Gravity Forms PDF Extended v3.0.0 we have removed the DOMPDF package from our plugin and integrated the more advanced mPDF system. Along with a new HTML to PDF generator, we've rewritten the entire plugin's base code to make it more user friendly to both hobbyists and rock star web developers. Configuration time is cut in half and advanced features like adding security features is now accessible to users who have little experience with PHP.
184
 
185
  New Features include:
186
 
205
  * Improved security - further restrictions were placed on non-administrators viewing template files.
206
  * $form_data array tidied up - images won't be wrapped in anchor tags.
207
 
208
+ For more details [view the 3.x.x online documentation](http://gravityformspdfextended.com/documentation-v3-x-x/introduction/).
209
 
210
  = 2.2.3 =
211
  * Bug - Fixed mb_string error in the updated DOMPDF package.
235
  * Feature - Product subtotal, shipping and total have been added to $form_data['field'] array to make it easier to work with product details in the custom template.
236
  * Feature - Added two new default template files. One displays field and name in two rows (like you see when viewing an entry in the admin area) and the other removes all styling. See documentation on use.
237
  * Security - Tightened PDF template security so that custom templates couldn't be automatically generated by just anyone. Now only logged in users with the correct privileges and the user who submitted the form (matched against IP) can auto generate a PDF. See documentation on usage.
238
+ * Depreciated - Removed form data that was added directly to the $form_data array instead of $form_data['field'] array. Users upgrading will need to update their custom templates if not using field data from the $form_data[�field'] array. If using $form_data['field'] in your custom template this won't affect you.
239
  * Bug - Fixed problem with default template not showing and displaying a timeout error. Removed table tags and replaced with divs that are styled appropriately.
240
  * Bug - The new plugin theme folder will successfully create when upgrading. You won't have to deactivate and reactivate to get it working.
241
  * Bug - some installs had plugins that included the function mb_string which is also included in DOMPDF. DOMPDF will now check if the function exists before creating it.
289
 
290
  == Upgrade Notice ==
291
 
292
+ = 3.3.0 =
293
+
294
+ Support for Wordpress 3.8 and Gravity Forms 1.8. Overhauled the settings page and added a secure in-built support form. Fixed a number of bugs and made modifications at the request of the community.
depreciated.php DELETED
@@ -1,24 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Filename: depreciated.php
5
- * This file contains any depreciated functionality to help preserve backwards compatibility
6
- * with either Gravity Forms, or our template files.
7
- */
8
-
9
-
10
- /*
11
- * Since v3.6
12
- * Moved to the $gfpdfe_data class.
13
- * Can now be accessed using the following:
14
- *
15
- * $gfpdfe_data->template_location
16
- * $gfpdfe_data->template_site_location
17
- * $gfpdfe_data->template_save_location
18
- * $gfpdfe_data->template_font_location
19
- *
20
- */
21
- define('PDF_SAVE_LOCATION', $gfpdfe_data->template_save_location);
22
- define('PDF_FONT_LOCATION', $gfpdfe_data->template_font_location);
23
- define('PDF_TEMPLATE_LOCATION', $gfpdfe_data->template_site_location);
24
- define('PDF_TEMPLATE_URL_LOCATION', $gfpdfe_data->template_site_location_url);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
helper/api.php ADDED
@@ -0,0 +1,256 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ define('PDF_DEBUG', false);
4
+
5
+ /*
6
+ * Change the timeout to 15 seconds
7
+ */
8
+ add_filter( 'http_response_timeout', array('gfpdfe_API', 'http_response_timeout') );
9
+
10
+ class gfpdfe_API
11
+ {
12
+ private $api_url = 'http://gravityformspdfextended.com/api/';
13
+ private $api_version = '1.0';
14
+
15
+ private $username;
16
+ private $secret;
17
+
18
+ public $response_message;
19
+
20
+ public function __construct()
21
+ {
22
+
23
+ /*
24
+ * Set the username and secret if available, otherwise request them from the API
25
+ */
26
+ $this->username = get_option('gfpdfe_api_username');
27
+ $this->secret = get_option('gfpdfe_api_secret');
28
+
29
+ if( $this->username === false || strlen($this->username) == 0 || $this->secret === false || strlen($this->secret) == 0 )
30
+ {
31
+ $this->get_api_access_details();
32
+ }
33
+
34
+ }
35
+
36
+ private function get_api_access_details()
37
+ {
38
+ /*
39
+ * Register User is the correct API path to get new credentials
40
+ */
41
+ $url = $this->api_url . 'registerUser/';
42
+
43
+ $request_args = array(
44
+ 'body' => array(),
45
+ );
46
+
47
+ /*
48
+ * Hash our request for the API
49
+ */
50
+ $request_args = $this->add_headers($request_args);
51
+
52
+ $response = wp_remote_get($url, $request_args);
53
+
54
+ /*
55
+ * Check if there is an error
56
+ */
57
+ if ( is_wp_error($response) )
58
+ {
59
+ print json_encode(array('error' => array('msg' =>$response->get_error_message())));
60
+ exit;
61
+ }
62
+
63
+ /*
64
+ * Check the response codes for errors
65
+ */
66
+ if($this->check_response_code($response) === true)
67
+ {
68
+ /*
69
+ * Store the username and secret key in the DB
70
+ */
71
+ $r_data = json_decode($response['body']);
72
+
73
+ update_option('gfpdfe_api_username', $r_data->username);
74
+ update_option('gfpdfe_api_secret', $r_data->secretkey);
75
+
76
+ $this->username = $r_data->username;
77
+ $this->secret = $r_data->secretkey;
78
+ }
79
+ else
80
+ {
81
+ /*
82
+ * Error
83
+ */
84
+ print json_encode(array('error' => $this->response_message));
85
+ exit;
86
+ }
87
+
88
+ }
89
+
90
+ private function add_headers($request)
91
+ {
92
+ $request['headers'] = array(
93
+ 'API' => (string) $this->api_version,
94
+ 'API_STAMP' => (string) time(),
95
+ 'API_URL' => (string) site_url(),
96
+ );
97
+
98
+ if(strlen($this->username) > 0)
99
+ {
100
+ $request['headers']['API_USER'] = $this->username;
101
+ return $this->create_hash($request, $this->secret);
102
+ }
103
+
104
+ ksort($request);
105
+ return $this->create_hash($request);
106
+ }
107
+
108
+ private function check_response_code($response)
109
+ {
110
+
111
+ switch($response['response']['code'])
112
+ {
113
+ case '200':
114
+ /*
115
+ * Everything okay
116
+ */
117
+ return true;
118
+ break;
119
+
120
+ case '400':
121
+ /*
122
+ * Bad Request
123
+ */
124
+ $this->response_message = __('Bad Request.', 'pdfextended');
125
+ return false;
126
+ break;
127
+
128
+ case '401':
129
+ /*
130
+ * Unauthorized Access
131
+ */
132
+ $this->response_message = __('Unauthorized Access.', 'pdfextended');
133
+
134
+ /*
135
+ * Remove current API access keys
136
+ */
137
+ delete_option('gfpdfe_api_username');
138
+ delete_option('gfpdfe_api_secret');
139
+
140
+ $this->username = false;
141
+ $this->secret = false;
142
+
143
+ /*
144
+ * Automatically regenerate key
145
+ */
146
+ $this->get_api_access_details();
147
+ return false;
148
+ break;
149
+
150
+ case '405':
151
+ /*
152
+ * Method not allowed
153
+ */
154
+ $this->response_message = __('Method not allowed.', 'pdfextended');
155
+ return false;
156
+ break;
157
+
158
+ case '500':
159
+ /*
160
+ * Internal Server Error
161
+ */
162
+ $this->response_message = __('Internal API Error.', 'pdfextended');
163
+ return false;
164
+ break;
165
+
166
+ case '503':
167
+ /*
168
+ * Service Unavailable
169
+ */
170
+ $this->response_message = __('API Unavailable.', 'pdfextended');
171
+ return false;
172
+ break;
173
+ }
174
+ }
175
+
176
+ /*
177
+ * Create our hash function which will ensure the request hasn't been tampered en-route
178
+ * We'll make calls over HTTPS as well, but this is an added security measure.
179
+ */
180
+ private function create_hash($request, $secret_key = '')
181
+ {
182
+ /*
183
+ * Sign our hash with our secret key if we have one
184
+ */
185
+ if(PDF_DEBUG == true)
186
+ {
187
+ file_put_contents( ABSPATH . 'pdf-api.log', date('d/m/Y h:m:s') . ' Hash' ."\n", FILE_APPEND);
188
+ file_put_contents( ABSPATH . 'pdf-api.log', serialize($request) . $secret_key. "\n", FILE_APPEND);
189
+ }
190
+
191
+ $hashed = hash ('sha256', serialize($request) . $secret_key );
192
+ $request['headers']['hash'] = $hashed;
193
+ return $request;
194
+ }
195
+
196
+ public function support_request($body)
197
+ {
198
+ static $retry = false;
199
+ $url = $this->api_url . 'supportRequest/';
200
+
201
+ $request_args = array(
202
+ 'body' => $body
203
+ );
204
+
205
+ /*
206
+ * Hash our request for the API
207
+ */
208
+ $request_args = $this->add_headers($request_args);
209
+
210
+ $response = wp_remote_post($url, $request_args);
211
+
212
+ /*
213
+ * Check if there is an error
214
+ */
215
+ if ( is_wp_error($response) )
216
+ {
217
+ print json_encode(array('error' => array('msg' =>$response->get_error_message())));
218
+ exit;
219
+ }
220
+
221
+ /*
222
+ * Check the response codes for errors
223
+ */
224
+ if($this->check_response_code($response) === true)
225
+ {
226
+ $response_array = json_decode($response['body']);
227
+ print json_encode(array('msg' => __($response_array->msg, 'pdfextended')));
228
+ }
229
+ else
230
+ {
231
+ if($this->response_message == __('Unauthorized Access.', 'pdfextended') && $retry == false)
232
+ {
233
+ /*
234
+ * Access keys failed. They were regenerated so let's try again
235
+ */
236
+ $retry = true;
237
+ $this->support_request($body);
238
+ return;
239
+ }
240
+ else
241
+ {
242
+ return false;
243
+ }
244
+
245
+ }
246
+ }
247
+
248
+ public static function http_response_timeout($timeout)
249
+ {
250
+ return 15;
251
+ }
252
+
253
+ public function __destruct() {
254
+ remove_filter('http_response_timeout', array('gfpdfe_API', 'http_response_timeout') );
255
+ }
256
+ }
helper/data.php CHANGED
@@ -1,13 +1,5 @@
1
  <?php
2
 
3
- /**
4
- * Plugin: Gravity PDF
5
- * File: data.php
6
- *
7
- * This is a data overloading class which holds important variables shared throughout the plugin
8
- * In some circumstances it will also provide functions to get data from itself
9
- */
10
-
11
  class GFPDFE_DATA
12
  {
13
  /** Location for overloaded data. */
@@ -44,27 +36,4 @@ class GFPDFE_DATA
44
  {
45
  unset($this->data[$name]);
46
  }
47
-
48
- /**
49
- * Used to set up our PDF template folder,
50
- * save folder and font folder
51
- */
52
- public function set_directory_structure()
53
- {
54
- $upload_dir = PDF_Common::get_upload_dir();
55
- $site_name = PDF_Common::get_site_name();
56
-
57
- $this->template_location = $upload_dir['basedir'] . '/' . PDF_SAVE_FOLDER . '/';
58
- $this->template_site_location = $upload_dir['basedir'] . '/' . PDF_SAVE_FOLDER . '/' . $site_name . '/';
59
- $this->template_save_location = $upload_dir['basedir'] . '/' . PDF_SAVE_FOLDER . '/' . $site_name . '/output/';
60
- $this->template_font_location = $upload_dir['basedir'] . '/' . PDF_SAVE_FOLDER . '/' . $site_name . '/fonts/';
61
-
62
- $this->template_location_url = $upload_dir['baseurl'] . '/' . PDF_SAVE_FOLDER . '/';
63
- $this->template_site_location_url = $upload_dir['baseurl'] . '/' . PDF_SAVE_FOLDER . '/' . $site_name . '/';
64
- $this->template_save_location_url = $upload_dir['baseurl'] . '/' . PDF_SAVE_FOLDER . '/' . $site_name . '/output/';
65
- $this->template_font_location_url = $upload_dir['baseurl'] . '/' . PDF_SAVE_FOLDER . '/' . $site_name . '/fonts/';
66
-
67
- $this->old_template_location = get_stylesheet_directory().'/'.PDF_SAVE_FOLDER.'/';
68
- $this->upload_dir = $upload_dir['basedir'];
69
- }
70
  }
1
  <?php
2
 
 
 
 
 
 
 
 
 
3
  class GFPDFE_DATA
4
  {
5
  /** Location for overloaded data. */
36
  {
37
  unset($this->data[$name]);
38
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39
  }
helper/installation-update-manager.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
 
3
  /**
4
- * Plugin: Gravity PDF
5
  * File: install-update-manager.php
6
  *
7
  * This file handles the installation and update code that ensures the plugin will be supported.
@@ -13,168 +13,18 @@
13
 
14
  class GFPDF_InstallUpdater
15
  {
16
-
17
- public static function check_filesystem_api()
18
- {
19
- global $gfpdfe_data;
20
- $access_type = get_filesystem_method();
21
-
22
- $gfpdfe_data->automated = false;
23
- if($access_type === 'direct')
24
- {
25
- $gfpdfe_data->automated = true;
26
- }
27
- }
28
 
29
- /*
30
- * Check if we can automatically deploy the software
31
- * We use WP Filesystem API to initialise.
32
- * Check if we have direct write control to the filesystem. If so, automatically deploy
33
- * without asking the user. This will make upgrades much simplier.
34
- */
35
- public static function maybe_deploy()
36
- {
37
- global $gfpdfe_data;
38
- /*
39
- * Check if we have a 'direct' method, that the software isn't fully installed and we aren't trying to manually initialise
40
- */
41
-
42
- if($gfpdfe_data->automated === true && $gfpdfe_data->is_initialised === false && !rgpost('upgrade') && get_option('gfpdfe_automated_install') != 'installing')
43
- {
44
- /*
45
- * Initialise all multisites if a super admin is logged in
46
- */
47
- if(is_multisite() && is_super_admin())
48
- {
49
- $results = GFPDF_InstallUpdater::run_multisite_deployment(array('GFPDF_InstallUpdater', 'do_deploy'));
50
-
51
- if($results === true)
52
- {
53
- add_action($gfpdfe_data->notice_type, array('GFPDF_Notices', 'gf_pdf_network_deploy_success'));
54
- }
55
- elseif($results === false)
56
- {
57
- add_action($gfpdfe_data->notice_type, array('GFPDF_Notices', 'gf_pdf_auto_deploy_network_failure'));
58
- }
59
- return $results;
60
- }
61
- else
62
- {
63
- if(self::do_deploy())
64
- {
65
- /*
66
- * Output successfull automated installation message
67
- */
68
- add_action($gfpdfe_data->notice_type, array('GFPDF_Notices', 'gf_pdf_auto_deploy_success'));
69
- }
70
- }
71
- }
72
- }
73
-
74
- /*
75
- * Initialise all multsites in one fowl swoop
76
- */
77
- public static function run_multisite_deployment($action)
78
- {
79
- global $gfpdfe_data;
80
-
81
- /* add additional check incase someone doesn't call this correctly */
82
- if(!is_multisite() || !is_super_admin())
83
- return false;
84
-
85
- /*
86
- * Get multisites which aren't deleted
87
- */
88
- $sites = wp_get_sites(array('deleted' => 0));
89
-
90
- if(sizeof($sites) > 0)
91
- {
92
-
93
- $problem = array();
94
- foreach($sites as $site)
95
- {
96
- switch_to_blog( (int) $site['blog_id'] );
97
-
98
- /*
99
- * Reset the directory structure
100
- */
101
- $gfpdfe_data->set_directory_structure();
102
-
103
- /*
104
- * Test if the blog has gravity forms and PDF Extended active
105
- * If so, we can initialise
106
- */
107
- $gravityforms = 'gravityforms/gravityforms.php'; /* have to hardcode the folder name as they don't set it in a constant or variable */
108
- $pdfextended = GF_PDF_EXTENDED_PLUGIN_BASENAME; /* no need to hardcode the basename here */
109
-
110
- if( (is_plugin_active_for_network($gravityforms) && is_plugin_active_for_network($pdfextended)) ||
111
- (is_plugin_active($gravityforms) && is_plugin_active($pdfextended))
112
- )
113
- {
114
- /* run our deployment and output any problems */
115
- $deploy = call_user_func($action);
116
- if($deploy === false)
117
- {
118
- $problem[] = $site;
119
- }
120
- else if ($deploy === 'false')
121
- {
122
- /*
123
- * Asking for the access details so we can write to the server
124
- * Exit early
125
- */
126
- return $deploy;
127
- }
128
- }
129
- restore_current_blog();
130
-
131
- /*
132
- * Reset the directory structure
133
- */
134
- $gfpdfe_data->set_directory_structure();
135
- }
136
-
137
- if(sizeof($problem) > 0)
138
- {
139
- $gfpdfe_data->network_error = $problem;
140
- return false;
141
- }
142
- return true;
143
- }
144
- }
145
-
146
- /*
147
- * Used to automatically deploy the software
148
- * Regular initialisation (via the settings page) will call pdf_extended_activate() directly.
149
- */
150
- public static function do_deploy()
151
- {
152
- update_option('gfpdfe_automated_install', 'installing');
153
- return self::pdf_extended_activate();
154
- }
155
-
156
- /*
157
- * Different filesystems (FTP/SSH) might have a different ABSPATH than the 'direct' method
158
- * due to being rooted to a specific folder.
159
- * The $wp_filesystem->abspath() corrects this behaviour.
160
- */
161
- private static function get_basedir($path)
162
- {
163
- global $wp_filesystem;
164
- return str_replace(ABSPATH, $wp_filesystem->abspath(), $path);
165
- }
166
-
167
  /**
168
  * Install everything required
169
  */
170
- public static function pdf_extended_activate()
171
  {
172
  /*
173
  * Initialise the Wordpress Filesystem API
174
  */
175
- if(PDF_Common::initialise_WP_filesystem_API(array('gfpdf_deploy', 'overwrite'), 'pdf-extended-filesystem') === false)
176
  {
177
- return 'false';
178
  }
179
 
180
  /*
@@ -183,230 +33,140 @@ class GFPDF_InstallUpdater
183
  global $wp_filesystem, $gfpdfe_data;
184
 
185
  /*
186
- * Set the correct paths
187
- * FTP and SSH could be rooted to the wordpress base directory
188
- * use $wp_filesystem->abspath(); function to fix any issues
189
  */
190
- $directory = self::get_basedir(PDF_PLUGIN_DIR);
191
- $base_template_directory = self::get_basedir( $gfpdfe_data->template_location );
192
- $template_directory = self::get_basedir( $gfpdfe_data->template_site_location );
193
- $template_save_directory = self::get_basedir( $gfpdfe_data->template_save_location );
194
- $template_font_directory = self::get_basedir( $gfpdfe_data->template_font_location );
195
-
196
-
197
- /**
198
- * If template directory already exists then we will remove the old template files so we can redeploy the new ones
 
199
  */
200
- self::reinitialise_templates($template_directory);
201
-
202
- /* create new directory in uploads folder*/
203
- if(self::create_base_template_dir($base_template_directory) === false)
204
  {
205
- return false;
206
- }
207
-
208
- /* create site directory in base template directory */
209
- if(self::create_site_template_dir($template_directory) === false)
210
- {
211
- return false;
212
- }
213
-
214
- /* create 'save' output folder */
215
- if(self::create_save_dir($template_save_directory) === false)
216
- {
217
- return false;
218
- }
219
-
220
- /* create 'font' folder */
221
- if(self::create_font_dir($template_font_directory) === false)
222
- {
223
- return false;
224
- }
225
-
226
- /* copy entire template folder over to the template directory */
227
- self::pdf_extended_copy_directory( $directory . 'initialisation/templates', $template_directory, false );
228
 
229
- /* copy configuration file over to new directory */
230
- if(self::create_configuration_file($directory, $template_directory) === false)
231
- {
232
- return false;
233
- }
234
-
235
- /* create .htaccess file */
236
- if(self::create_htaccess_file($template_save_directory) === false)
237
- {
238
- return false;
239
  }
240
 
241
- /* initialise font directory */
242
- if(self::install_fonts($directory, $template_directory, $template_font_directory) !== true)
243
- {
244
- return false;
245
- }
246
-
247
- /* update db to ensure everything is installed correctly. */
248
- self::db_init();
249
-
250
- return true;
251
- }
252
-
253
- public static function reinitialise_templates($template_directory)
254
- {
255
- global $wp_filesystem, $gfpdfe_data;
256
 
257
- if($wp_filesystem->exists($template_directory) && isset($_POST['overwrite']))
258
- {
259
- /*
260
- * Create a backup folder and move all the files there
261
- */
262
- $backup_folder = 'INIT_BACKUP_' . date('Y-m-d_G-i') . '/';
263
- $do_backup = false;
264
- if($wp_filesystem->mkdir($template_directory . $backup_folder ))
265
- {
266
- $do_backup = true;
267
- }
268
-
269
-
270
  /* read all file names into array and unlink from active theme template folder */
271
- foreach(glob( PDF_PLUGIN_DIR . 'initialisation/templates/*') as $file) {
272
- $path_parts = pathinfo($file);
273
- if($wp_filesystem->exists($template_directory.$path_parts['basename']))
274
- {
275
- if(!$do_backup)
276
- {
277
- $wp_filesystem->delete($template_directory.$path_parts['basename']);
278
- continue;
279
- }
280
- $wp_filesystem->move($template_directory.$path_parts['basename'], $template_directory . $backup_folder . $path_parts['basename']);
281
- }
282
  }
283
- }
284
- }
285
 
286
- public static function create_base_template_dir($base_template_directory)
287
- {
288
- global $wp_filesystem, $gfpdfe_data;
289
-
290
- /* create new directory in uploads folder*/
291
- if(!$wp_filesystem->is_dir($base_template_directory))
292
  {
293
- if($wp_filesystem->mkdir($base_template_directory) === false)
294
- {
295
- /*
296
- * TODO: add correct notices
297
- */
298
- add_action($gfpdfe_data->notice_type, array('GFPDF_Notices', 'gf_pdf_template_dir_err'));
299
- return false;
 
 
300
  }
301
- }
302
-
303
- return true;
304
- }
305
 
306
- public static function create_site_template_dir($template_directory)
307
- {
308
- global $wp_filesystem, $gfpdfe_data;
 
 
309
 
 
310
  if(!$wp_filesystem->is_dir($template_directory))
311
  {
312
  if($wp_filesystem->mkdir($template_directory) === false)
313
  {
314
- add_action($gfpdfe_data->notice_type, array('GFPDF_Notices', 'gf_pdf_template_site_dir_err'));
315
- return false;
316
- }
317
- }
318
-
319
- return true;
320
- }
321
-
322
- public static function create_save_dir($template_save_directory)
323
- {
324
- global $wp_filesystem, $gfpdfe_data;
325
-
326
  if(!$wp_filesystem->is_dir($template_save_directory))
327
  {
328
  /* create new directory in active themes folder*/
329
  if($wp_filesystem->mkdir($template_save_directory) === false)
330
  {
331
- add_action($gfpdfe_data->notice_type, array('GFPDF_Notices', 'gf_pdf_template_dir_err'));
332
- return false;
333
  }
334
- }
335
 
336
- return true;
337
- }
338
-
339
- public static function create_font_dir($template_font_directory)
340
- {
341
- global $wp_filesystem, $gfpdfe_data;
342
-
343
  if(!$wp_filesystem->is_dir($template_font_directory))
344
  {
345
  /* create new directory in active themes folder*/
346
  if($wp_filesystem->mkdir($template_font_directory) === false)
347
  {
348
- add_action($gfpdfe_data->notice_type, array('GFPDF_Notices', 'gf_pdf_template_dir_err'));
349
- return false;
350
  }
351
- }
352
-
353
- return true;
354
- }
355
-
356
- /**
357
- * Copy configuration file to template folder
358
- * @param String $directory The $wp_filesystem path to the plugin folder
359
- * @param String $template_directory The $wp_filesystem path to the template folder
360
- * @return Boolean Success on true (or not run at all). false on fail
361
- */
362
- public static function create_configuration_file($directory, $template_directory)
363
- {
364
- global $wp_filesystem, $gfpdfe_data;
365
 
366
  if(!$wp_filesystem->exists($template_directory .'configuration.php'))
367
  {
368
  /* copy template files to new directory */
369
- if(!$wp_filesystem->copy($directory . 'initialisation/configuration.php.example', $template_directory . 'configuration.php'))
370
  {
371
- add_action($gfpdfe_data->notice_type, array('GFPDF_Notices', 'gf_pdf_template_dir_err'));
372
- return false;
373
  }
374
- }
375
-
376
- return true;
377
- }
378
-
379
- /**
380
- * Create htaccess file to prevent direct access to PDFs
381
- * @param String $template_save_directory The $wp_filesystem path to the save directory
382
- * @return Boolean success on true (or not run at all). false on fail
383
- */
384
- public static function create_htaccess_file($template_save_directory)
385
- {
386
- global $wp_filesystem, $gfpdfe_data;
387
-
388
- if(!$wp_filesystem->exists($template_save_directory . '.htaccess'))
389
  {
390
- if(!$wp_filesystem->put_contents($template_save_directory . '.htaccess', 'deny from all'))
391
  {
392
- add_action($gfpdfe_data->notice_type, array('GFPDF_Notices', 'gf_pdf_template_dir_err'));
393
- return false;
394
  }
395
  }
396
 
397
- return true;
398
- }
399
-
400
- /*
401
- * Normalize the database options related to initialisation
402
- */
403
- public static function db_init()
404
- {
405
- global $gfpdfe_data;
406
 
407
  update_option('gf_pdf_extended_installed', 'installed');
408
- delete_option('gfpdfe_automated_install');
409
- GFPDF_Settings::$model->check_compatibility();
 
 
 
410
  }
411
 
412
  public static function initialise_fonts()
@@ -414,7 +174,7 @@ class GFPDF_InstallUpdater
414
  /*
415
  * Initialise the Wordpress Filesystem API
416
  */
417
- if(PDF_Common::initialise_WP_filesystem_API(array('gfpdf_deploy', 'font-initialise', 'gfpdf_deploy_nonce'), 'pdf-extended-fonts') === false)
418
  {
419
  return false;
420
  }
@@ -422,19 +182,33 @@ class GFPDF_InstallUpdater
422
  /*
423
  * If we got here we should have $wp_filesystem available
424
  */
425
- global $wp_filesystem, $gfpdfe_data;
426
 
427
  /*
428
  * We need to set up some filesystem compatibility checkes to work with the different server file management types
429
  * Most notably is the FTP options, but SSH may be effected too
430
  */
431
- $directory = self::get_basedir(PDF_PLUGIN_DIR);
432
- $template_directory = self::get_basedir( $gfpdfe_data->template_site_location );
433
- $template_font_directory = self::get_basedir( $gfpdfe_data->template_font_location );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
434
 
435
  if(self::install_fonts($directory, $template_directory, $template_font_directory) === true)
436
  {
437
- add_action($gfpdfe_data->notice_type, array('GFPDF_Notices', 'gf_pdf_font_install_success'));
438
  }
439
  return true;
440
  }
@@ -442,7 +216,7 @@ class GFPDF_InstallUpdater
442
  private static function install_fonts($directory, $template_directory, $fonts_location)
443
  {
444
 
445
- global $wp_filesystem, $gfpdfe_data;
446
  $write_to_file = '<?php
447
 
448
  if(!defined("PDF_EXTENDED_VERSION"))
@@ -458,15 +232,30 @@ class GFPDF_InstallUpdater
458
  */
459
 
460
  /* read all file names into array and unlink from active theme template folder */
461
- foreach(glob( $gfpdfe_data->template_font_location . '/*.[tT][tT][fF]') as $file) {
462
 
463
- $path_parts = pathinfo($file);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
464
 
465
  /*
466
  * Generate configuration information in preparation to write to file
467
  */
468
  $write_to_file .= '
469
- $this->fontdata[\''.mb_strtolower(str_replace(' ', '', $path_parts['filename']), 'UTF-8').'\'] = array(
470
  \'R\' => \''.$path_parts['basename'].'\'
471
  );';
472
 
@@ -478,140 +267,274 @@ class GFPDF_InstallUpdater
478
  $wp_filesystem->delete($template_directory.'fonts/config.php');
479
  if($wp_filesystem->put_contents($template_directory.'fonts/config.php', $write_to_file) === false)
480
  {
481
- add_action($gfpdfe_data->notice_type, array('GFPDF_Notices', 'gf_pdf_font_config_err'));
482
  return false;
483
  }
484
 
485
  return true;
486
  }
487
-
488
- public static function maybe_automigrate()
489
  {
490
- global $gfpdfe_data;
491
- self::check_filesystem_api();
 
 
492
 
493
- if($gfpdfe_data->automated === true)
494
- {
495
- update_option('gfpdfe_automated_install', 'installing');
496
- self::run_template_migration();
497
- return true;
498
- }
499
- return false;
500
- }
501
 
502
- /*
503
- * Check if the new PDF_TEMPLATE_LOCATION (v.3.6 mod) has been made switched
504
- * If it has then prompt the user to move the files
 
 
 
 
 
 
 
505
  */
506
- public static function check_template_migration()
507
  {
508
- global $gfpdfe_data;
509
-
510
- if(is_dir($gfpdfe_data->old_template_location))
 
 
 
 
 
 
 
 
511
  {
512
- if(!self::maybe_automigrate())
513
  {
514
- /*
515
- * Add admin notification hook to move the files
516
- */
517
- add_action($gfpdfe_data->notice_type, array('GFPDF_Notices', 'do_template_switch_notice'));
518
- return true;
 
 
 
 
 
519
  }
520
  }
521
- return false;
522
- }
523
-
524
- public static function run_template_migration()
525
- {
526
- global $gfpdfe_data;
527
-
528
- if(is_multisite() && is_super_admin())
529
- {
530
- $return = self::run_multisite_deployment(array('GFPDF_InstallUpdater','do_template_migration'));
531
- GFPDF_Settings::$model->check_compatibility();
532
-
533
- /* multisite mode */
534
- if($return === true)
535
  {
536
- add_action($gfpdfe_data->notice_type, array('GFPDF_Notices', 'gf_pdf_migration_success'));
 
 
 
537
  }
538
- elseif($return === false)
539
  {
540
- add_action($gfpdfe_data->notice_type, array('GFPDF_Notices', 'gf_pdf_merge_network_failure'));
 
 
541
  }
542
- return $return;
543
  }
544
- else
545
- {
546
- $return = self::do_template_migration();
547
- GFPDF_Settings::$model->check_compatibility();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
548
 
549
- /* single site mode */
550
- if($return === true)
551
- {
552
- add_action($gfpdfe_data->notice_type, array('GFPDF_Notices', 'gf_pdf_migration_success'));
553
- return $return;
554
- }
555
- return $return;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
556
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
557
  }
558
 
559
  /*
560
  * The after_switch_theme hook is too early in the initialisation to use request_filesystem_credentials()
561
  * so we have to call this function at a later inteval
562
  */
563
- public static function do_template_migration()
564
  {
 
 
 
 
 
 
 
565
  /*
566
  * Initialise the Wordpress Filesystem API
567
  */
568
- if(PDF_Common::initialise_WP_filesystem_API(array(), 'gfpdfe_migrate') === false)
569
  {
570
- return 'false';
571
  }
572
 
573
  /*
574
  * If we got here we should have $wp_filesystem available
575
  */
576
- global $wp_filesystem, $gfpdfe_data;
577
-
578
  /*
579
- * Convert paths for SSH/FTP users who are rooted to a directory along the server absolute path
580
- */
581
- $base_template_directory = self::get_basedir($gfpdfe_data->template_location );
582
- $previous_pdf_path = self::get_basedir($gfpdfe_data->old_template_location);
583
- $current_pdf_path = self::get_basedir($gfpdfe_data->template_site_location);
584
-
585
- /* create the base template directory */
586
- if(self::create_base_template_dir($base_template_directory) === false)
587
- {
588
- return false;
589
- }
590
-
591
- /* create the site template directory */
592
- if(self::create_site_template_dir($current_pdf_path) === false)
593
- {
594
- return false;
595
- }
596
-
597
- if($wp_filesystem->is_dir($previous_pdf_path))
598
  {
599
- self::pdf_extended_copy_directory( $previous_pdf_path, $current_pdf_path, true, true, true ); /* swap back to TRUE to delete the theme folder */
600
-
601
- /*
602
- * Clean up the DB
603
- */
604
- delete_option('gfpdfe_automated_install');
605
 
606
- return true;
607
- }
608
- return false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
609
  }
610
 
611
  /*
612
  * Allows you to copy entire folder structures to new location
613
  */
614
- public static function pdf_extended_copy_directory( $source, $destination, $copy_base = true, $delete_destination = false, $delete_source = false )
 
615
  {
616
  global $wp_filesystem;
617
 
@@ -649,10 +572,87 @@ class GFPDF_InstallUpdater
649
  {
650
  $wp_filesystem->copy( $source, $destination );
651
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
652
 
653
- if($delete_source)
654
- {
655
- $wp_filesystem->delete($source, true);
656
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
657
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
658
  }
1
  <?php
2
 
3
  /**
4
+ * Plugin: Gravity Forms PDF Extended
5
  * File: install-update-manager.php
6
  *
7
  * This file handles the installation and update code that ensures the plugin will be supported.
13
 
14
  class GFPDF_InstallUpdater
15
  {
 
 
 
 
 
 
 
 
 
 
 
 
16
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  /**
18
  * Install everything required
19
  */
20
+ public function pdf_extended_activate()
21
  {
22
  /*
23
  * Initialise the Wordpress Filesystem API
24
  */
25
+ if(PDF_Common::initialise_WP_filesystem_API(array('gfpdf_deploy'), 'pdf-extended-filesystem') === false)
26
  {
27
+ return false;
28
  }
29
 
30
  /*
33
  global $wp_filesystem, $gfpdfe_data;
34
 
35
  /*
36
+ * We need to set up some filesystem compatibility checkes to work with the different server file management types
37
+ * Most notably is the FTP options, but SSH may be effected too
 
38
  */
39
+ $directory = PDF_PLUGIN_DIR;
40
+ $template_directory = PDF_TEMPLATE_LOCATION;
41
+ $template_save_directory = PDF_SAVE_LOCATION;
42
+ $template_font_directory = PDF_FONT_LOCATION;
43
+
44
+
45
+ /*
46
+ * If using FTP we need to make modifications to the file paths
47
+ * Unlike the direct method, the root of the FTP directory isn't the ABSPATH
48
+ * Usually FTP is restricted to the public_html directory, or just above it.
49
  */
50
+ if($wp_filesystem->method === 'ftpext' || $wp_filesystem->method === 'ftpsockets')
 
 
 
51
  {
52
+ /*
53
+ * Get the base directory
54
+ */
55
+ $base_directory = self::get_base_directory();
56
+
57
+ $directory = str_replace(ABSPATH, $base_directory, $directory);
58
+ $template_directory = str_replace(ABSPATH, $base_directory, $template_directory);
59
+ $template_save_directory = str_replace(ABSPATH, $base_directory, $template_save_directory);
60
+ $template_font_directory = str_replace(ABSPATH, $base_directory, $template_font_directory);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
 
 
 
 
 
 
 
 
 
 
 
62
  }
63
 
64
+ /**
65
+ * If PDF_TEMPLATE_LOCATION already exists then we will remove the old template files so we can redeploy the new ones
66
+ */
 
 
 
 
 
 
 
 
 
 
 
 
67
 
68
+ if(PDF_DEPLOY === true && $wp_filesystem->exists($template_directory))
69
+ {
 
 
 
 
 
 
 
 
 
 
 
70
  /* read all file names into array and unlink from active theme template folder */
71
+ foreach(glob($directory.'initialisation/templates/*.php') as $file) {
72
+ $path_parts = pathinfo($file);
73
+ if($wp_filesystem->exists($template_directory.$path_parts['basename']))
74
+ {
75
+ $wp_filesystem->delete($template_directory.$path_parts['basename']);
76
+ }
 
 
 
 
 
77
  }
78
+ }
79
+
80
 
81
+ /* unzip the mPDF file */
82
+ if($wp_filesystem->exists($directory . 'mPDF.zip'))
 
 
 
 
83
  {
84
+ /*
85
+ * The only function that requires the input to be the full path and the export to be the directory used in $wp_filesystem
86
+ */
87
+ $results = unzip_file( PDF_PLUGIN_DIR . 'mPDF.zip', $directory );
88
+
89
+ if($results !== true)
90
+ {
91
+ add_action('gfpdfe_notices', array('GFPDF_InstallUpdater', 'gf_pdf_unzip_mpdf_err'));
92
+ return 'fail';
93
  }
 
 
 
 
94
 
95
+ /*
96
+ * Remove the original archive
97
+ */
98
+ $wp_filesystem->delete($directory . 'mPDF.zip');
99
+ }
100
 
101
+ /* create new directory in active themes folder*/
102
  if(!$wp_filesystem->is_dir($template_directory))
103
  {
104
  if($wp_filesystem->mkdir($template_directory) === false)
105
  {
106
+ add_action('gfpdfe_notices', array('GFPDF_InstallUpdater', 'gf_pdf_template_dir_err'));
107
+ return 'fail';
108
+ }
109
+ }
110
+
 
 
 
 
 
 
 
111
  if(!$wp_filesystem->is_dir($template_save_directory))
112
  {
113
  /* create new directory in active themes folder*/
114
  if($wp_filesystem->mkdir($template_save_directory) === false)
115
  {
116
+ add_action('gfpdfe_notices', array('GFPDF_InstallUpdater', 'gf_pdf_template_dir_err'));
117
+ return 'fail';
118
  }
119
+ }
120
 
 
 
 
 
 
 
 
121
  if(!$wp_filesystem->is_dir($template_font_directory))
122
  {
123
  /* create new directory in active themes folder*/
124
  if($wp_filesystem->mkdir($template_font_directory) === false)
125
  {
126
+ add_action('gfpdfe_notices', array('GFPDF_InstallUpdater', 'gf_pdf_template_dir_err'));
127
+ return 'fail';
128
  }
129
+ }
130
+
131
+ /*
132
+ * Copy entire template folder over to PDF_TEMPLATE_LOCATION
133
+ */
134
+ self::pdf_extended_copy_directory( $directory . 'initialisation/templates', $template_directory, false );
 
 
 
 
 
 
 
 
135
 
136
  if(!$wp_filesystem->exists($template_directory .'configuration.php'))
137
  {
138
  /* copy template files to new directory */
139
+ if(!$wp_filesystem->copy($directory .'initialisation/configuration.php.example', $template_directory.'configuration.php'))
140
  {
141
+ add_action('gfpdfe_notices', array('GFPDF_InstallUpdater', 'gf_pdf_template_dir_err'));
142
+ return 'fail';
143
  }
144
+ }
145
+
146
+ if(!$wp_filesystem->exists($template_save_directory.'.htaccess'))
 
 
 
 
 
 
 
 
 
 
 
 
147
  {
148
+ if(!$wp_filesystem->put_contents($template_save_directory.'.htaccess', 'deny from all'))
149
  {
150
+ add_action('gfpdfe_notices', array('GFPDF_InstallUpdater', 'gf_pdf_template_dir_err'));
151
+ return 'fail';
152
  }
153
  }
154
 
155
+ if(self::install_fonts($directory, $template_directory, $template_font_directory) !== true)
156
+ {
157
+ return 'fail';
158
+ }
159
+
160
+ /*
161
+ * Update system to ensure everything is installed correctly.
162
+ */
 
163
 
164
  update_option('gf_pdf_extended_installed', 'installed');
165
+ update_option('gf_pdf_extended_deploy', 'yes');
166
+ update_option('gf_pdf_extended_version', PDF_EXTENDED_VERSION);
167
+ delete_option('gfpdfe_switch_theme');
168
+
169
+ return true;
170
  }
171
 
172
  public static function initialise_fonts()
174
  /*
175
  * Initialise the Wordpress Filesystem API
176
  */
177
+ if(PDF_Common::initialise_WP_filesystem_API(array('gfpdf_deploy'), 'pdf-extended-fonts') === false)
178
  {
179
  return false;
180
  }
182
  /*
183
  * If we got here we should have $wp_filesystem available
184
  */
185
+ global $wp_filesystem;
186
 
187
  /*
188
  * We need to set up some filesystem compatibility checkes to work with the different server file management types
189
  * Most notably is the FTP options, but SSH may be effected too
190
  */
191
+ $directory = PDF_PLUGIN_DIR;
192
+ $template_directory = PDF_TEMPLATE_LOCATION;
193
+ $template_font_directory = PDF_FONT_LOCATION;
194
+
195
+
196
+ if($wp_filesystem->method === 'ftpext' || $wp_filesystem->method === 'ftpsockets')
197
+ {
198
+ /*
199
+ * Assume FTP is rooted to the Wordpress install
200
+ */
201
+ $base_directory = self::get_base_directory();
202
+
203
+ $directory = str_replace(ABSPATH, $base_directory, $directory);
204
+ $template_directory = str_replace(ABSPATH, $base_directory, $template_directory);
205
+ $template_font_directory = str_replace(ABSPATH, $base_directory, $template_font_directory);
206
+
207
+ }
208
 
209
  if(self::install_fonts($directory, $template_directory, $template_font_directory) === true)
210
  {
211
+ add_action('gfpdfe_notices', array('GFPDF_InstallUpdater', 'gf_pdf_font_install_success'));
212
  }
213
  return true;
214
  }
216
  private static function install_fonts($directory, $template_directory, $fonts_location)
217
  {
218
 
219
+ global $wp_filesystem;
220
  $write_to_file = '<?php
221
 
222
  if(!defined("PDF_EXTENDED_VERSION"))
232
  */
233
 
234
  /* read all file names into array and unlink from active theme template folder */
235
+ foreach(glob($fonts_location.'/*.[tT][tT][fF]') as $file) {
236
 
237
+ $path_parts = pathinfo($file);
238
+
239
+ /*
240
+ * Check if the files already exist in the mPDF font folder
241
+ */
242
+ if(!$wp_filesystem->exists($directory . 'mPDF/ttfonts/' . $path_parts['basename']))
243
+ {
244
+ /*
245
+ * copy ttf file to the mPDF font folder
246
+ */
247
+ if($wp_filesystem->copy($file, $directory . 'mPDF/ttfonts/' . $path_parts['basename']) === false)
248
+ {
249
+ add_action('gfpdfe_notices', array('GFPDF_InstallUpdater', 'gf_pdf_font_err'));
250
+ return false;
251
+ }
252
+ }
253
 
254
  /*
255
  * Generate configuration information in preparation to write to file
256
  */
257
  $write_to_file .= '
258
+ $this->fontdata[\''.strtolower($path_parts['filename']).'\'] = array(
259
  \'R\' => \''.$path_parts['basename'].'\'
260
  );';
261
 
267
  $wp_filesystem->delete($template_directory.'fonts/config.php');
268
  if($wp_filesystem->put_contents($template_directory.'fonts/config.php', $write_to_file) === false)
269
  {
270
+ add_action('gfpdfe_notices', array('GFPDF_InstallUpdater', 'gf_pdf_font_config_err'));
271
  return false;
272
  }
273
 
274
  return true;
275
  }
276
+
277
+ public function gf_pdf_font_install_success()
278
  {
279
+ echo '<div id="message" class="updated"><p>';
280
+ echo __('The font files have been successfully installed. A font can be used by adding it\'s file name (without .ttf and in lower case) in a CSS font-family declaration.', 'pdfextended');
281
+ echo '</p></div>';
282
+ }
283
 
284
+ public function gf_pdf_font_err()
285
+ {
286
+ echo '<div id="message" class="error"><p>';
287
+ echo __('There was a problem installing the font files. Manually copy your fonts to the mPDF/ttfonts/ folder.', 'pdfextended');
288
+ echo '</p></div>';
289
+ }
 
 
290
 
291
+ public function gf_pdf_font_config_err()
292
+ {
293
+ echo '<div id="message" class="error"><p>';
294
+ echo __('Could not create font configuration file. Try initialise again.', 'pdfextended');
295
+ echo '</p></div>';
296
+ }
297
+
298
+ /**
299
+ * Gravity Forms hasn't been installed so throw error.
300
+ * We make sure the user hasn't already dismissed the error
301
  */
302
+ public function gf_pdf_not_installed()
303
  {
304
+ echo '<div id="message" class="error"><p>';
305
+ echo sprintf(__('You need to install/update %sGravity Forms%s to use the Gravity Forms PDF Extended Plugin.', 'pdfextended'), '<a href="https://www.e-junkie.com/ecom/gb.php?cl=54585&c=ib&aff=235154" target="ejejcsingle">', '</a>');
306
+ echo '</p></div>';
307
+ }
308
+
309
+ /**
310
+ * PDF Extended has been updated but the new template files haven't been deployed yet
311
+ */
312
+ public function gf_pdf_not_deployed()
313
+ {
314
+ if( (PDF_DEPLOY === true) && !rgpost('update') )
315
  {
316
+ if(rgget("page") == 'gf_settings' && rgget('addon') == 'PDF')
317
  {
318
+ echo '<div id="message" class="error"><p>';
319
+ echo __('You\'ve updated Gravity Forms PDF Extended but are yet to re-initialise the plugin. After initialising, please review the latest updates to ensure your custom templates remain compatible with the latest version.', 'pdfextended');
320
+ echo '</p></div>';
321
+
322
+ }
323
+ else
324
+ {
325
+ echo '<div id="message" class="error"><p>';
326
+ echo sprintf(__('You\'ve updated Gravity Forms PDF Extended but are yet to re-initialise the plugin. Please go to the %splugin\'s settings page%s to initialise.', 'pdfextended'), '<a href="'.PDF_SETTINGS_URL.'">', '</a>');
327
+ echo '</p></div>';
328
  }
329
  }
330
+ }
331
+
332
+ /**
333
+ * PDF Extended has been freshly installed
334
+ */
335
+ public function gf_pdf_not_deployed_fresh()
336
+ {
337
+ if( (PDF_DEPLOY === true) && !rgpost('update') )
338
+ {
339
+ if(rgget("page") == 'gf_settings' && rgget('addon') == 'PDF')
 
 
 
 
340
  {
341
+ echo '<div id="message" class="updated"><p>';
342
+ echo __('Welcome to Gravity Forms PDF Extended. Before you can use the plugin correctly you need to initilise it.', 'pdfextended');
343
+ echo '</p></div>';
344
+
345
  }
346
+ else
347
  {
348
+ echo '<div id="message" class="updated"><p>';
349
+ echo sprintf(__('Welcome to Gravity Forms PDF Extended. Before you can use the plugin correctly you need to initilise it. Please go to the %splugin\'s settings page%s to initialise.', 'pdfextended'), '<a href="'.PDF_SETTINGS_URL.'">', '</a>');
350
+ echo '</p></div>';
351
  }
 
352
  }
353
+ }
354
+
355
+ /**
356
+ * The Gravity Forms version isn't compatible. Prompt user to upgrade
357
+ */
358
+ public function gf_pdf_not_supported()
359
+ {
360
+ echo '<div id="message" class="error"><p>';
361
+ echo sprintf(__('Gravity Forms PDF Extended only works with Gravity Forms version '.GF_PDF_EXTENDED_SUPPORTED_VERSION.' and higher. Please %supgrade your copy of Gravity Forms%s to use this plugin.', 'pdfextended'), '<a href="https://www.e-junkie.com/ecom/gb.php?cl=54585&c=ib&aff=235154" target="ejejcsingle">', '</a>');
362
+ echo '</p></div>';
363
+ }
364
+
365
+
366
+ /**
367
+ * Cannot create new template folder in active theme directory
368
+ */
369
+ public function gf_pdf_template_dir_err()
370
+ {
371
+ echo '<div id="message" class="error"><p>';
372
+ echo __('We could not create a template folder in your active theme\'s directory. Please created a folder called <strong>\''. PDF_SAVE_FOLDER .'\'</strong> in '.get_stylesheet_directory().'/. Then copy the contents of '.PDF_PLUGIN_DIR.'templates/ to your newly-created PDF_EXTENDED_TEMPLATES folder, as well as styles/template.css. You should also make this directory writable.', 'pdfextended');
373
+ echo '</p></div>';
374
+
375
+ }
376
+
377
+ public static function gf_pdf_unzip_mpdf_err()
378
+ {
379
+ echo '<div id="message" class="error"><p>';
380
+ echo __('Could not unzip mPDF.zip (located in the plugin folder). Unzip the file manually, place the extracted mPDF folder in the plugin folder and run the initialisation again.', 'pdfextended');
381
+ echo '</p></div>';
382
+ }
383
+
384
+ /**
385
+ * Cannot remove old default template files
386
+ */
387
+ public function gf_pdf_deployment_unlink_error()
388
+ {
389
+ echo '<div id="message" class="error"><p>';
390
+ echo __('We could not remove the default template files from the Gravity Forms PDF Extended folder in your active theme\'s directory. Please manually remove all files starting with \'default-\' and the template.css file.', 'pdfextended');
391
+ echo '</p></div>';
392
+
393
+ }
394
+
395
+ /**
396
+ * Cannot create new template folder in active theme directory
397
+ */
398
+ public function gf_pdf_template_move_err()
399
+ {
400
+ echo '<div id="message" class="error"><p>';
401
+ echo __('We could not copy the contents of '.PDF_PLUGIN_DIR.'templates/ to your newly-created PDF_EXTENDED_TEMPLATES folder. Please manually copy the files to the aforementioned directory.', 'pdfextended');
402
+ echo '</p></div>';
403
+
404
+ }
405
+
406
+ /*
407
+ * When switching themes copy over current active theme's PDF_EXTENDED_TEMPLATES (if it exists) to new theme folder
408
+ */
409
+ public function gf_pdf_on_switch_theme($old_theme_name, $old_theme_object) {
410
+
411
+ /*
412
+ * We will store the old pdf dir and new pdf directory and prompt the user to copy the PDF_EXTENDED_TEMPLATES folder
413
+ */
414
+ $previous_theme_directory = $old_theme_object->get_stylesheet_directory();
415
+
416
+ $current_theme_array = wp_get_theme();
417
+ $current_theme_directory = $current_theme_array->get_stylesheet_directory();
418
 
419
+ /*
420
+ * Add the save folder name to the end of the paths
421
+ */
422
+ $old_pdf_path = $previous_theme_directory . '/' . PDF_SAVE_FOLDER;
423
+ $new_pdf_path = $current_theme_directory . '/' . PDF_SAVE_FOLDER;
424
+
425
+ update_option('gfpdfe_switch_theme', array('old' => $old_pdf_path, 'new' => $new_pdf_path));
426
+ }
427
+
428
+ /*
429
+ * Check if a theme switch has been made recently
430
+ * If it has then prompt the user to move the files
431
+ */
432
+ public static function check_theme_switch()
433
+ {
434
+ $theme_switch = get_option('gfpdfe_switch_theme');
435
+
436
+ if(isset($theme_switch['old']) && isset($theme_switch['new']))
437
+ {
438
+ /*
439
+ * Add admin notification hook to move the files
440
+ */
441
+ add_action('admin_notices', array("GFPDF_InstallUpdater", "do_theme_switch_notice"));
442
+ return true;
443
  }
444
+ return false;
445
+ }
446
+
447
+ /*
448
+ * Prompt user to keep the plugin working
449
+ */
450
+ public static function do_theme_switch_notice()
451
+ {
452
+ /*
453
+ * Check we aren't in the middle of doing the sync
454
+ */
455
+ if(isset($_GET['_wpnonce']) && wp_verify_nonce($_GET['_wpnonce'], 'gfpdfe_sync_now'))
456
+ {
457
+ return;
458
+ }
459
+
460
+ echo '<div id="message" class="error"><p>';
461
+ echo sprintf(__('Gravity Forms PDF Extended needs to keep your configuration and template folder in sync with your current active theme. %sSync Now%s', 'pdfextended'), '<a href="'. wp_nonce_url(PDF_SETTINGS_URL, 'gfpdfe_sync_now') . '" class="button">', '</a>');
462
+ echo '</p></div>';
463
+
464
+ }
465
+
466
+ public static function gf_pdf_theme_sync_success()
467
+ {
468
+ echo '<div id="message" class="updated"><p>';
469
+ echo __('Your configuration and template folder was successfully synced.', 'pdfextended');
470
+ echo '</p></div>';
471
  }
472
 
473
  /*
474
  * The after_switch_theme hook is too early in the initialisation to use request_filesystem_credentials()
475
  * so we have to call this function at a later inteval
476
  */
477
+ public function do_theme_switch($previous_pdf_path, $current_pdf_path)
478
  {
479
+ /*
480
+ * Prepare for calling the WP Filesystem
481
+ * It only allows post data to be added so we have to manually assign them
482
+ */
483
+ $_POST['previous_pdf_path'] = $previous_pdf_path;
484
+ $_POST['current_pdf_path'] = $current_pdf_path;
485
+
486
  /*
487
  * Initialise the Wordpress Filesystem API
488
  */
489
+ if(PDF_Common::initialise_WP_filesystem_API(array('previous_pdf_path', 'current_pdf_path'), 'gfpdfe_sync_now') === false)
490
  {
491
+ return false;
492
  }
493
 
494
  /*
495
  * If we got here we should have $wp_filesystem available
496
  */
497
+ global $wp_filesystem;
498
+
499
  /*
500
+ * We need to set up some filesystem compatibility checkes to work with the different server file management types
501
+ * Most notably is the FTP options, but SSH may be effected too
502
+ */
503
+
504
+ if($wp_filesystem->method === 'ftpext' || $wp_filesystem->method === 'ftpsockets')
 
 
 
 
 
 
 
 
 
 
 
 
 
 
505
  {
506
+ /*
507
+ * Assume FTP is rooted to the Wordpress install
508
+ */
509
+ $base_directory = self::get_base_directory();
 
 
510
 
511
+ $previous_pdf_path = str_replace(ABSPATH, $base_directory, $previous_pdf_path);
512
+ $current_pdf_path = str_replace(ABSPATH, $base_directory, $current_pdf_path);
513
+
514
+ }
515
+
516
+ if($wp_filesystem->is_dir($previous_pdf_path))
517
+ {
518
+ self::pdf_extended_copy_directory( $previous_pdf_path, $current_pdf_path, true, true );
519
+ }
520
+
521
+ /*
522
+ * Remove the options key that triggers the switch theme function
523
+ */
524
+ delete_option('gfpdfe_switch_theme');
525
+ add_action('gfpdfe_notices', array('GFPDF_InstallUpdater', 'gf_pdf_theme_sync_success'));
526
+
527
+ /*
528
+ * Show success message to user
529
+ */
530
+ return true;
531
  }
532
 
533
  /*
534
  * Allows you to copy entire folder structures to new location
535
  */
536
+
537
+ public function pdf_extended_copy_directory( $source, $destination, $copy_base = true, $delete_destination = false )
538
  {
539
  global $wp_filesystem;
540
 
572
  {
573
  $wp_filesystem->copy( $source, $destination );
574
  }
575
+ }
576
+
577
+ private static function check_access_path($directory, $file_path, $directory_list)
578
+ {
579
+ global $wp_filesystem;
580
+
581
+ //$directory = false;
582
+ foreach($directory_list as $name => $data)
583
+ {
584
+ /*
585
+ * Check if one of the file/folder names matches what is in $file_path, make sure it is a directory and
586
+ * the name has a value
587
+ */
588
+ $match = array_search($name, $file_path);
589
+ if((strlen($name) > 0) && ($match !== false) && ((int) $data['isdir'] === 1) )
590
+ {
591
+
592
+ /*
593
+ * We have a match but it could be fake
594
+ * Look inside the target folder and see if the next folder in $file_path can be found
595
+ * If it can we will assume it is the correct path
596
+ */
597
+ if(isset($file_path[$match+1]))
598
+ {
599
 
600
+ $next_match = $file_path[$match+1];
601
+ $directory_list2 = $wp_filesystem->dirlist('/'.$name.'/');
602
+
603
+ if(isset($directory_list2[$next_match]) && (int) $directory_list2[$next_match]['isdir'] === 1)
604
+ {
605
+ return self::merge_path($file_path, $match);
606
+ }
607
+
608
+ }
609
+ else
610
+ {
611
+ return self::merge_path($file_path, $match);
612
+ }
613
+ }
614
+ }
615
+ return $directory;
616
+ }
617
+
618
+ /*
619
+ * Merge the path array back together from the matched key
620
+ */
621
+ private static function merge_path($file_path, $key)
622
+ {
623
+ return '/' . implode('/', array_slice($file_path, $key)) . '/';
624
  }
625
+
626
+ /*
627
+ * Get the base directory for the current filemanagement type
628
+ * In this case it is FTP but may be SSH
629
+ */
630
+ private static function get_base_directory()
631
+ {
632
+ global $wp_filesystem;
633
+
634
+ /*
635
+ * Assume FTP is rooted to the Wordpress install
636
+ */
637
+ $directory = '/';
638
+
639
+ /*
640
+ * Test if the FTP is below the Wordpress base by sniffing the base directory
641
+ */
642
+ $directory_list = $wp_filesystem->dirlist('/');
643
+
644
+ /*
645
+ * Use the ABSPATH to compare the directory structure
646
+ */
647
+ $file_path = array_filter(explode('/', ABSPATH ));
648
+
649
+ /*
650
+ * Rekey the array
651
+ */
652
+ $file_path = array_values($file_path);
653
+
654
+ return self::check_access_path($directory, $file_path, $directory_list);
655
+
656
+ }
657
+
658
  }
helper/notices.php DELETED
@@ -1,376 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Plugin: Gravity PDF
5
- * File: notices.php
6
- *
7
- * This file handles the output of all notices to the admin area
8
- */
9
-
10
- class GFPDF_Notices
11
- {
12
- /*
13
- * Admin notice template
14
- */
15
- private static function message($text, $type = 'updated')
16
- {
17
- ?>
18
- <div id="message" class="<?php echo $type; ?>">
19
- <p>
20
- <?php echo $text; ?>
21
- </p>
22
- </div>
23
- <?php
24
- }
25
-
26
- /*
27
- * Output the update notice
28
- */
29
- private static function notice($text)
30
- {
31
- self::message($text);
32
- }
33
-
34
- /*
35
- * Output the error notice
36
- */
37
- private static function error($text)
38
- {
39
- self::message($text, 'error');
40
- }
41
-
42
- private static function display_plugin_message($message, $is_error = false){
43
-
44
- $style = $is_error ? 'style="background-color: #ffebe8;"' : "";
45
-
46
- echo '</tr><tr class="plugin-update-tr"><td colspan="5" class="plugin-update"><div class="update-message" ' . $style . '>' . $message . '</div></td>';
47
- }
48
-
49
- private static function autoprefix()
50
- {
51
- global $gfpdfe_data;
52
- if($gfpdfe_data->automated === true && !rgpost('upgrade') && !rgpost('font-initialise'))
53
- {
54
- return sprintf(__('%sGravity PDF Automated Installer%s: ', 'pdfextended'), '<strong>', '</strong>');
55
- }
56
- return '';
57
- }
58
-
59
- private static function autosuffix()
60
- {
61
- global $gfpdfe_data;
62
- if($gfpdfe_data->automated === true && !rgpost('upgrade') && !rgpost('font-initialise'))
63
- {
64
- return sprintf(__(' %sGo to installer%s.', 'pdfextended'), '<a href="'. PDF_SETTINGS_URL .'">', '</a>');
65
- }
66
- return '';
67
- }
68
-
69
- public static function gf_pdf_font_install_success()
70
- {
71
- $prefix = self::autoprefix();
72
- $suffix = self::autosuffix();
73
-
74
- $msg = $prefix . __('The font files have been successfully installed. A font can be used by adding its file name (without .ttf) in a CSS font-family declaration.', 'pdfextended') . $suffix;
75
-
76
- self::notice($msg);
77
-
78
- }
79
-
80
- public static function gf_pdf_font_config_err()
81
- {
82
- $prefix = self::autoprefix();
83
- $suffix = self::autosuffix();
84
-
85
- $msg = $prefix . __('Could not create font configuration file. Try initialise again.', 'pdfextended') . $suffix;
86
-
87
- self::error($msg);
88
-
89
- }
90
-
91
- /**
92
- * The software has detected a problem (no configuration.php file or no PDF_EXTENDED_TEMPLATE folder
93
- * The user will need to reinitialise
94
- */
95
- public static function gf_pdf_problem_detected()
96
- {
97
- if( !rgpost('update') )
98
- {
99
- if(rgget("page") == 'gf_settings' && rgget('subview') == 'PDF')
100
- {
101
- $msg = __('Gravity PDF detected a configuration problem. Please reinitialise the plugin.', 'pdfextended');
102
- }
103
- else
104
- {
105
- $msg = sprintf(__('Gravity PDF detected a configuration problem. Please go to the %splugin\'s settings page%s to reinitialise.', 'pdfextended'), '<a href="'.PDF_SETTINGS_URL.'">', '</a>');
106
- }
107
-
108
- self::error($msg);
109
- }
110
- }
111
-
112
- /*
113
- * The $gfpdfe_data->allow_initilisation function is false
114
- * meaning there is a server configuration problem detected
115
- */
116
- public static function gf_pdf_server_problem_detected()
117
- {
118
- if( !rgpost('update') )
119
- {
120
- if(rgget("page") == 'gf_settings' && rgget('subview') == 'PDF')
121
- {
122
- $msg = __('Gravity PDF detected a server compatibility problem which prevented the software from running. See the System Status section below for details.', 'pdfextended');
123
- }
124
- else
125
- {
126
- $msg = sprintf(__('Gravity PDF detected a server compatibility problem which prevented the software from running. Please go to the %splugin\'s settings page%s to view the issue.', 'pdfextended'), '<a href="'.PDF_SETTINGS_URL.'">', '</a>');
127
- }
128
-
129
- self::error($msg);
130
- }
131
- }
132
-
133
- /**
134
- * PDF Extended has been freshly installed
135
- */
136
- public static function gf_pdf_not_deployed_fresh()
137
- {
138
- if( !rgpost('update') )
139
- {
140
- if(rgget("page") == 'gf_settings' && rgget('subview') == 'PDF')
141
- {
142
- $msg = __('Welcome to Gravity PDF. Before you can use the plugin correctly you need to initilise it.', 'pdfextended');
143
- }
144
- else
145
- {
146
- $msg = sprintf(__('Welcome to Gravity PDF. Before you can use the plugin correctly you need to initilise it. Please go to the %splugin\'s settings page%s to initialise.', 'pdfextended'), '<a href="'.PDF_SETTINGS_URL.'">', '</a>');
147
- }
148
-
149
- self::notice($msg);
150
- }
151
- }
152
-
153
- /**
154
- * The Gravity Forms version isn't compatible. Prompt user to upgrade
155
- */
156
- public static function gf_pdf_not_supported()
157
- {
158
- $msg = sprintf(__('Gravity PDF only works with Gravity Forms version %s and higher. Please %supgrade your copy of Gravity Forms%s to use this plugin.', 'pdfextended'), GF_PDF_EXTENDED_SUPPORTED_VERSION, '<a href="https://www.e-junkie.com/ecom/gb.php?cl=54585&c=ib&aff=235154" target="ejejcsingle">', '</a>');
159
-
160
- self::error($msg);
161
- }
162
-
163
-
164
- /**
165
- * Cannot create new template folder in active theme directory
166
- */
167
- public static function gf_pdf_template_dir_err()
168
- {
169
- global $gfpdfe_data;
170
-
171
- $prefix = self::autoprefix();
172
- $suffix = self::autosuffix();
173
-
174
- $msg = $prefix . sprintf(__('We could not create a template folder in your uploads directory. Please ensure %s is writable by your web server and try again.', 'pdfextended'), str_replace(ABSPATH, '', $gfpdfe_data->upload_dir)) . $suffix;
175
-
176
- self::error($msg);
177
- }
178
-
179
- /**
180
- * Cannot create site directory in template folder
181
- */
182
- public static function gf_pdf_template_site_dir_err()
183
- {
184
- global $gfpdfe_data;
185
-
186
- $prefix = self::autoprefix();
187
- $suffix = self::autosuffix();
188
-
189
- $msg = $prefix . sprintf(__('We could not create a site folder in your uploads/%s directory. Please ensure %s is writable by your web server and try again.'), PDF_SAVE_FOLDER, str_replace(ABSPATH, '', $gfpdfe_data->template_location), 'pdfextended') . $suffix;
190
-
191
- self::error($msg);
192
- }
193
-
194
- /**
195
- * Cannot remove old default template files
196
- */
197
- public static function gf_pdf_deployment_unlink_error()
198
- {
199
- $prefix = self::autoprefix();
200
- $suffix = self::autosuffix();
201
-
202
- $msg = $prefix . sprintf(__('We could not remove the default template files from %s in your uploads directory. Please ensure %s is wriable by your web server and try again.', 'pdfextended'), PDF_SAVE_FOLDER, str_replace(ABSPATH, '', $gfpdfe_data->template_site_location)) . $suffix;
203
-
204
- self::error($msg);
205
- }
206
-
207
- /**
208
- * Cannot create new template folder
209
- */
210
- public static function gf_pdf_template_move_err()
211
- {
212
- $prefix = self::autoprefix();
213
- $suffix = self::autosuffix();
214
-
215
- $msg = $prefix . sprintf(__('We could not move the template files to the %s folder. Please ensure %s is wriable by your web server and try again.', 'pdfextended'), PDF_SAVE_FOLDER, str_replace(ABSPATH, '', $gfpdfe_data->template_site_location) ) . $suffix;
216
-
217
- self::error($msg);
218
- }
219
-
220
- /*
221
- * Prompt user to keep the plugin working
222
- */
223
- public static function do_template_switch_notice()
224
- {
225
- /*
226
- * Check we aren't in the middle of doing the sync
227
- */
228
- if(isset($_GET['_wpnonce']) && wp_verify_nonce($_GET['_wpnonce'], 'gfpdfe_migrate'))
229
- {
230
- return;
231
- }
232
-
233
- $msg = sprintf(__('Gravity PDF directory structure has been changed. %sMigrate Now%s %sUnsure what this means?%s', 'pdfextended'), '<a href="'. wp_nonce_url(PDF_SETTINGS_URL, 'gfpdfe_migrate') . '" class="button">', '</a>', '<a href="https://developer.gravitypdf.com/news/migrating-template-directory-means/">', '</a>' );
234
-
235
- self::notice($msg);
236
-
237
- }
238
-
239
- public static function gf_pdf_migration_success()
240
- {
241
- global $gfpdfe_data;
242
- $prefix = ($gfpdfe_data->automated === true && !rgpost('upgrade')) ? sprintf(__('%sGravity PDF Automated Template Migration:%s', 'pdfextended'), '<strong>', '</strong><br>') : '';
243
-
244
- $msg = $prefix . sprintf( __('Your PDF template folder structure was successfully migrated to %s. %sUnsure what this means?%s', 'pdfextended'), str_replace(ABSPATH, '', $gfpdfe_data->upload_dir), '<br><a href="https://developer.gravitypdf.com/news/migrating-template-directory-means/">', '</a>');
245
-
246
- self::notice($msg);
247
-
248
- }
249
-
250
- public static function gf_pdf_network_deploy_success()
251
- {
252
- global $gfpdfe_data;
253
-
254
- if($gfpdfe_data->automated === true && !rgpost('upgrade') && !rgpost('font-initialise'))
255
- {
256
- $msg = __('Gravity PDF Auto Initialisation Complete across the entire network.', 'pdfextended');
257
- }
258
- else
259
- {
260
- $msg = __('Gravity PDF Initialisation Complete across the entire network.', 'pdfextended');
261
- }
262
-
263
- if($gfpdfe_data->fresh_install === true)
264
- {
265
- $msg .= ' ' . sprintf( __('%sLearn how to configuring the plugin%s.', 'pdfextended'), '<a href="'. PDF_SETTINGS_URL .'">', '</a>');
266
- }
267
- self::notice($msg);
268
- }
269
-
270
- public static function gf_pdf_auto_deploy_success()
271
- {
272
- global $gfpdfe_data;
273
- $msg = __('Gravity PDF Auto Initialisation Complete.', 'pdfextended');
274
-
275
- if($gfpdfe_data->fresh_install === true)
276
- {
277
- $msg .= ' ' . sprintf( __('%sLearn how to configuring the plugin%s.', 'pdfextended'), '<a href="'. PDF_SETTINGS_URL .'">', '</a>');
278
- }
279
- self::notice($msg);
280
- }
281
-
282
- public static function gf_pdf_merge_network_failure()
283
- {
284
- global $gfpdfe_data;
285
-
286
- $prefix = self::autoprefix();
287
- $errors = (array) $gfpdfe_data->network_error;
288
-
289
- if(sizeof($errors) > 0)
290
- {
291
- $msg = $prefix . __('There was a problem merging the PDF templates folder on the following sites;', 'pdfextended');
292
- $msg .= '<ul>';
293
-
294
- $base_site_url = site_url();
295
- foreach($errors as $site)
296
- {
297
- switch_to_blog( (int) $site['blog_id'] );
298
- $url = str_replace($base_site_url, site_url(), PDF_SETTINGS_URL );
299
- $msg .= "<li><a href='$url'>{$site['domain']}{$site['path']}</a></li>";
300
- restore_current_blog();
301
- }
302
- $msg .= '</ul>';
303
-
304
- $msg .= __('Follow the site links above and try run the PDF template merging function again, or reinitialise the software.', 'pdfextended');
305
- }
306
- else
307
- {
308
- $msg = $prefix . __('An unknown error occured while merging the PDF template folders. Please try again.', 'pdfextended');
309
- }
310
-
311
- self::error($msg);
312
- }
313
-
314
- public static function gf_pdf_auto_deploy_network_failure()
315
- {
316
- global $gfpdfe_data;
317
-
318
- $prefix = self::autoprefix();
319
- $errors = (array) $gfpdfe_data->network_error;
320
-
321
- if(sizeof($errors) > 0)
322
- {
323
- $msg = $prefix . __('There was a network initialisation issue on the following sites;', 'pdfextended');
324
- $msg .= '<ul>';
325
-
326
- $base_site_url = site_url();
327
- foreach($errors as $site)
328
- {
329
- switch_to_blog( (int) $site['blog_id'] );
330
- $url = str_replace($base_site_url, site_url(), PDF_SETTINGS_URL );
331
- $msg .= "<li><a href='$url'>{$site['domain']}{$site['path']}</a></li>";
332
- restore_current_blog();
333
- }
334
- $msg .= '</ul>';
335
-
336
- $msg .= __('Please try manually initialise the software', 'pdfextended');
337
- }
338
- else
339
- {
340
- $msg = $prefix . __('An unknown network initialisation error occured. Please try initialise again.', 'pdfextended');
341
- }
342
-
343
- self::error($msg);
344
- }
345
-
346
- public static function gf_pdf_deploy_success() {
347
- $msg = __('You\'ve successfully initialised Gravity PDF.', 'pdfextended');
348
-
349
- self::notice($msg);
350
- }
351
-
352
- public static function display_compatibility_error()
353
- {
354
- $message = sprintf(__("Gravity Forms " . GF_PDF_EXTENDED_SUPPORTED_VERSION . " is required to use this plugin. Activate it now or %spurchase it today!%s", 'pdfextended'), "<a href='https://www.e-junkie.com/ecom/gb.php?cl=54585&c=ib&aff=235154'>", "</a>");
355
- self::display_plugin_message($message, true);
356
- }
357
-
358
- public static function display_wp_compatibility_error()
359
- {
360
- $message = __("Wordpress " . GF_PDF_EXTENDED_WP_SUPPORTED_VERSION . " or higher is required to use this plugin.", 'pdfextended');
361
- self::display_plugin_message($message, true);
362
- }
363
-
364
- public static function display_pdf_compatibility_error()
365
- {
366
- $message = __("PHP " . GF_PDF_EXTENDED_PHP_SUPPORTED_VERSION . " or higher is required to use this plugin.", 'pdfextended');
367
- self::display_plugin_message($message, true);
368
- }
369
-
370
- public static function add_tooltips($tooltips)
371
- {
372
- $tooltips['pdf_overwrite'] = sprintf(__('If you reinitialise and enable this option %syou will overwrite%s the default and example template files in your active theme directory.', 'pdfextended'), '<strong>', '</strong>');
373
-
374
- return $tooltips;
375
- }
376
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
helper/pdf-common.php CHANGED
@@ -1,25 +1,8 @@
1
  <?php
2
 
3
- /**
4
- * Plugin: Gravity PDF
5
- * File: pdf-common.php
6
- *
7
- * This file holds a number of common functions used throughout the plugin
8
- */
9
-
10
  class PDF_Common
11
  {
12
-
13
- /**
14
- * Depreciated function
15
- */
16
- public static function setup_ids() { }
17
-
18
- /**
19
- * Takes over for setup_ids() but is now called much earlier in the process
20
- * @return Boolean whether settings the ids was successful or not
21
- */
22
- public static function get_ids()
23
  {
24
  global $form_id, $lead_id, $lead_ids;
25
 
@@ -31,10 +14,31 @@ class PDF_Common
31
  */
32
  if(empty($form_id) || empty($lead_ids))
33
  {
34
- return false;
35
  }
36
- return true;
37
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
 
39
  /*
40
  * We will use the output buffer to get the HTML template
@@ -58,6 +62,30 @@ class PDF_Common
58
  public static function get_pdf_filename($form_id, $lead_id)
59
  {
60
  return "form-$form_id-entry-$lead_id.pdf";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
  }
62
 
63
  /*
@@ -75,11 +103,11 @@ class PDF_Common
75
  }
76
 
77
  /*
78
- * Limit the size of the filename to 120 characters
79
  */
80
- if(strlen($pdf_name) > 120)
81
  {
82
- $pdf_name = substr($pdf_name, 0, 120);
83
  }
84
 
85
  /*
@@ -94,30 +122,21 @@ class PDF_Common
94
  /*
95
  * Remove any invalid (mostly Windows) characters from filename
96
  */
97
- $pdf_name = self::remove_invalid_characters($pdf_name);
 
 
 
 
 
 
 
 
 
 
98
  $pdf_name = $pdf_name . '.pdf';
99
 
100
  return $pdf_name;
101
  }
102
-
103
- public static function remove_invalid_characters($name)
104
- {
105
- /*
106
- * Remove any invalid (mostly Windows) characters from filename
107
- */
108
- $name = str_replace('/', '-', $name);
109
- $name = str_replace('\\', '-', $name);
110
- $name = str_replace('"', '-', $name);
111
- $name = str_replace('*', '-', $name);
112
- $name = str_replace('?', '-', $name);
113
- $name = str_replace('|', '-', $name);
114
- $name = str_replace(':', '-', $name);
115
- $name = str_replace('<', '-', $name);
116
- $name = str_replace('>', '-', $name);
117
- $name = str_replace('.', '_', $name);
118
-
119
- return $name;
120
- }
121
 
122
  /*
123
  * Replace all the merge tag fields in the string
@@ -125,21 +144,12 @@ class PDF_Common
125
  */
126
  public static function do_mergetags($string, $form_id, $lead_id)
127
  {
128
- /*
129
- * Unconvert { and } symbols from HTML entities
130
- */
131
- $string = str_replace('&#123;', '{', $string);
132
- $string = str_replace('&#125;', '}', $string);
133
-
134
  /* strip {all_fields} merge tag from $string */
135
  $string = str_replace('{all_fields}', '', $string);
136
-
137
- /*
138
- * Get form and lead data
139
- */
140
- $form = RGFormsModel::get_form_meta($form_id);
141
- $lead = RGFormsModel::get_lead($lead_id);
142
-
143
  return trim(GFCommon::replace_variables($string, $form, $lead, false, false, false));
144
  }
145
 
@@ -157,6 +167,37 @@ class PDF_Common
157
  }
158
  }
159
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
160
  /*
161
  * New to 3.0.2 we will use WP_Filesystem API to manipulate files instead of using in-built PHP functions
162
  * $post Array the post data to include in the request_filesystem_credntials API
@@ -178,96 +219,53 @@ class PDF_Common
178
  * Check if the credentials are no good and display an error
179
  */
180
  if ( ! WP_Filesystem($creds) ) {
181
- request_filesystem_credentials($url, '', true, false, $post);
182
  return false;
183
  }
184
 
185
  return true;
186
 
187
  }
188
-
189
- /*
190
- * Check if we are on the PDF settings page
191
- */
192
- public static function is_settings()
193
- {
194
- if(isset($_GET['page']) && isset($_GET['subview']) && $_GET['page'] === 'gf_settings' && strtolower($_GET['subview']) === 'pdf')
195
- {
196
- return true;
197
- }
198
- return false;
199
- }
200
-
201
- public static function post($name)
202
- {
203
- if(isset($_POST[$name]))
204
- return $_POST[$name];
205
-
206
- return '';
207
- }
208
 
 
209
 
210
- public static function get($name)
211
- {
212
- if(isset($_GET[$name]))
213
- return $_GET[$name];
 
 
 
 
 
 
214
 
215
- return '';
216
- }
217
 
218
- /**
219
- * Gets the site name for use as a directory name
220
- * @return String Returns the current 'safe' directory site name
221
- */
222
- public static function get_site_name()
223
- {
224
- $name = (is_ssl()) ? str_replace('https://', '', site_url()) : str_replace('http://', '', site_url());
225
- return self::remove_invalid_characters($name);
226
- }
 
 
 
227
 
228
- /**
229
- * Modified version of get_upload_dir() which just focuses on the base directory
230
- * no matter if single or multisite installation
231
- * We also only needed the basedir and baseurl so stripped out all the extras
232
- * @return Array Base dir and url for the upload directory
233
- */
234
- public static function get_upload_dir()
235
- {
236
- $siteurl = get_option( 'siteurl' );
237
- $upload_path = trim( get_option( 'upload_path' ) );
238
-
239
- if ( empty( $upload_path ) || 'wp-content/uploads' == $upload_path ) {
240
- $dir = WP_CONTENT_DIR . '/uploads';
241
- } elseif ( 0 !== strpos( $upload_path, ABSPATH ) ) {
242
- // $dir is absolute, $upload_path is (maybe) relative to ABSPATH
243
- $dir = path_join( ABSPATH, $upload_path );
244
- } else {
245
- $dir = $upload_path;
246
- }
247
-
248
- if ( !$url = get_option( 'upload_url_path' ) ) {
249
- if ( empty($upload_path) || ( 'wp-content/uploads' == $upload_path ) || ( $upload_path == $dir ) )
250
- $url = WP_CONTENT_URL . '/uploads';
251
- else
252
- $url = trailingslashit( $siteurl ) . $upload_path;
253
  }
254
-
255
- /*
256
- * Honor the value of UPLOADS. This happens as long as ms-files rewriting is disabled.
257
- * We also sometimes obey UPLOADS when rewriting is enabled -- see the next block.
258
- */
259
- if ( defined( 'UPLOADS' ) && ! ( is_multisite() && get_site_option( 'ms_files_rewriting' ) ) ) {
260
- $dir = ABSPATH . UPLOADS;
261
- $url = trailingslashit( $siteurl ) . UPLOADS;
262
- }
263
-
264
- $basedir = $dir;
265
- $baseurl = $url;
266
-
267
- return array(
268
- 'basedir' => $basedir,
269
- 'baseurl' => $baseurl,
270
- );
271
- }
272
- }
273
 
 
 
 
 
1
  <?php
2
 
 
 
 
 
 
 
 
3
  class PDF_Common
4
  {
5
+ public static function setup_ids()
 
 
 
 
 
 
 
 
 
 
6
  {
7
  global $form_id, $lead_id, $lead_ids;
8
 
14
  */
15
  if(empty($form_id) || empty($lead_ids))
16
  {
17
+ return;
18
  }
19
+ }
20
+
21
+ /*
22
+ * Sniff the $_SERVER array for the real user IP address
23
+ * Sometimes users are behind proxies, or different servers will set different keys
24
+ * so we will look at the most common keys
25
+ */
26
+ public static function getRealIpAddr()
27
+ {
28
+ if (!empty($_SERVER['HTTP_CLIENT_IP'])) //check ip from share internet
29
+ {
30
+ $ip = $_SERVER['HTTP_CLIENT_IP'];
31
+ }
32
+ else if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) //to check ip is pass from proxy
33
+ {
34
+ $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
35
+ }
36
+ else
37
+ {
38
+ $ip = $_SERVER['REMOTE_ADDR'];
39
+ }
40
+ return $ip;
41
+ }
42
 
43
  /*
44
  * We will use the output buffer to get the HTML template
62
  public static function get_pdf_filename($form_id, $lead_id)
63
  {
64
  return "form-$form_id-entry-$lead_id.pdf";
65
+ }
66
+
67
+ /*
68
+ * Check if mPDF folder exists.
69
+ * If so, unzip and delete
70
+ * Helps reduce the package file size
71
+ */
72
+ public static function unpack_mPDF()
73
+ {
74
+ $file = PDF_PLUGIN_DIR .'mPDF.zip';
75
+ $path = pathinfo(realpath($file), PATHINFO_DIRNAME);
76
+
77
+ if(file_exists($file))
78
+ {
79
+ /* unzip folder and delete */
80
+ $zip = new ZipArchive;
81
+ $res = $zip->open($file);
82
+
83
+ if ($res === TRUE) {
84
+ $zip->extractTo($path);
85
+ $zip->close();
86
+ unlink($file);
87
+ }
88
+ }
89
  }
90
 
91
  /*
103
  }
104
 
105
  /*
106
+ * Limit the size of the filename to 100 characters
107
  */
108
+ if(strlen($pdf_name) > 150)
109
  {
110
+ $pdf_name = substr($pdf_name, 0, 150);
111
  }
112
 
113
  /*
122
  /*
123
  * Remove any invalid (mostly Windows) characters from filename
124
  */
125
+ $pdf_name = str_replace('/', '-', $pdf_name);
126
+ $pdf_name = str_replace('\\', '-', $pdf_name);
127
+ $pdf_name = str_replace('"', '-', $pdf_name);
128
+ $pdf_name = str_replace('*', '-', $pdf_name);
129
+ $pdf_name = str_replace('?', '-', $pdf_name);
130
+ $pdf_name = str_replace('|', '-', $pdf_name);
131
+ $pdf_name = str_replace(':', '-', $pdf_name);
132
+ $pdf_name = str_replace('<', '-', $pdf_name);
133
+ $pdf_name = str_replace('>', '-', $pdf_name);
134
+ $pdf_name = str_replace('.', '_', $pdf_name);
135
+
136
  $pdf_name = $pdf_name . '.pdf';
137
 
138
  return $pdf_name;
139
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
140
 
141
  /*
142
  * Replace all the merge tag fields in the string
144
  */
145
  public static function do_mergetags($string, $form_id, $lead_id)
146
  {
147
+ $form = RGFormsModel::get_form_meta($form_id);
148
+ $lead = RGFormsModel::get_lead($lead_id);
149
+
 
 
 
150
  /* strip {all_fields} merge tag from $string */
151
  $string = str_replace('{all_fields}', '', $string);
152
+
 
 
 
 
 
 
153
  return trim(GFCommon::replace_variables($string, $form, $lead, false, false, false));
154
  }
155
 
167
  }
168
  }
169
 
170
+ public static function display_compatibility_error()
171
+ {
172
+ $message = sprintf(__("Gravity Forms " . GF_PDF_EXTENDED_SUPPORTED_VERSION . " is required to use this plugin. Activate it now or %spurchase it today!%s", 'pdfextended'), "<a href='https://www.e-junkie.com/ecom/gb.php?cl=54585&c=ib&aff=235154'>", "</a>");
173
+ PDF_Common::display_plugin_message($message, true);
174
+ }
175
+
176
+ public static function display_wp_compatibility_error()
177
+ {
178
+ $message = __("Wordpress " . GF_PDF_EXTENDED_WP_SUPPORTED_VERSION . " or higher is required to use this plugin.", 'pdfextended');
179
+ PDF_Common::display_plugin_message($message, true);
180
+ }
181
+
182
+ public static function display_documentation_details()
183
+ {
184
+ $message = sprintf(__("Please review the %sGravity Forms PDF Extended documentation%s for comprehensive installation instructions. %sUpgraded from v2.x.x? Review our migration guide%s.%s", 'pdfextended'), "<a href='http://gravityformspdfextended.com/documentation-v3-x-x/installation-and-configuration/'>", "</a>", '<a style="color: red;" href="http://gravityformspdfextended.com/documentation-v3-x-x/v3-0-0-migration-guide/">', '</a>', '</span>');
185
+ PDF_Common::display_plugin_message($message);
186
+ }
187
+
188
+ public static function display_pdf_compatibility_error()
189
+ {
190
+ $message = __("PHP " . GF_PDF_EXTENDED_PHP_SUPPORTED_VERSION . " or higher is required to use this plugin.", 'pdfextended');
191
+ PDF_Common::display_plugin_message($message, true);
192
+ }
193
+
194
+ public static function display_plugin_message($message, $is_error = false){
195
+
196
+ $style = $is_error ? 'style="background-color: #ffebe8;"' : "";
197
+
198
+ echo '</tr><tr class="plugin-update-tr"><td colspan="5" class="plugin-update"><div class="update-message" ' . $style . '>' . $message . '</div></td>';
199
+ }
200
+
201
  /*
202
  * New to 3.0.2 we will use WP_Filesystem API to manipulate files instead of using in-built PHP functions
203
  * $post Array the post data to include in the request_filesystem_credntials API
219
  * Check if the credentials are no good and display an error
220
  */
221
  if ( ! WP_Filesystem($creds) ) {
222
+ request_filesystem_credentials($url, '', true, false, $post_credentials);
223
  return false;
224
  }
225
 
226
  return true;
227
 
228
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
229
 
230
+ }
231
 
232
+ /*
233
+ * Pre-PHP5.3 didn't have this function
234
+ * TODO: check it actually works.
235
+ */
236
+ if (!function_exists('array_replace_recursive'))
237
+ {
238
+ function array_replace_recursive()
239
+ {
240
+ // Get array arguments
241
+ $arrays = func_get_args();
242
 
243
+ // Define the original array
244
+ $original = array_shift($arrays);
245
 
246
+ // Loop through arrays
247
+ foreach ($arrays as $array)
248
+ {
249
+ // Loop through array key/value pairs
250
+ foreach ($array as $key => $value)
251
+ {
252
+ // Value is an array
253
+ if (is_array($value))
254
+ {
255
+ // Traverse the array; replace or add result to original array
256
+ $original[$key] = array_join($original[$key], $array[$key]);
257
+ }
258
 
259
+ // Value is not an array
260
+ else
261
+ {
262
+ // Replace or add current value to original array
263
+ $original[$key] = $value;
264
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
265
  }
266
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
267
 
268
+ // Return the joined array
269
+ return $original;
270
+ }
271
+ }
helper/pdf-configuration-indexer.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  /**
4
  * Class: PDFGenerator
5
- * Plugin: Gravity PDF
6
  * Usage: assign options from user configuration file, automatically attach PDFs to specified Gravity Forms, and view PDF from admin area.
7
  */
8
 
@@ -39,8 +39,7 @@
39
 
40
  public function __construct()
41
  {
42
- global $gfpdfe_data;
43
-
44
  /*
45
  * Do configuration pre-processing
46
  */
@@ -48,8 +47,8 @@
48
  /*
49
  * Check if user configuration file exists
50
  * If not disable $configuration and $index.
51
- */
52
- if(!file_exists( $gfpdfe_data->template_site_location . 'configuration.php') )
53
  {
54
  $this->disabled = true;
55
  return;
@@ -59,43 +58,15 @@
59
  /*
60
  * Include the configuration file and set up the configuration variable.
61
  */
62
- require_once( $gfpdfe_data->template_site_location . 'configuration.php' );
63
  /*
64
  * $gf_pdf_config included from configuration.php file
65
  */
66
  $this->configuration = (isset($gf_pdf_config)) ? $gf_pdf_config : array();
67
-
68
- /*
69
- * Merge down the default configuration options
70
- */
71
- foreach($this->configuration as &$node)
72
- {
73
- $node = $this->merge_defaults($node);
74
- }
75
- }
76
 
77
  $this->pdf_config();
78
  }
79
-
80
- /**
81
- * Merge the configuration node with the default options, ensuring the config node takes precendent
82
- * @param array $config the configuration node from $gfpdf->configuration()
83
- * @return array Merged default/node configuration options
84
- */
85
- private function merge_defaults($config)
86
- {
87
- global $gf_pdf_default_configuration;
88
-
89
- /*
90
- * If the default settings are set we'll merge them into the configuration index
91
- */
92
- if(is_array($gf_pdf_default_configuration) && sizeof($gf_pdf_default_configuration) > 0)
93
- {
94
- $config = array_replace_recursive($gf_pdf_default_configuration, $config);
95
- }
96
-
97
- return $config;
98
- }
99
 
100
  /*
101
  * Run through user configuration and set PDF options
@@ -157,68 +128,12 @@
157
  {
158
  return (isset($this->index[$id])) ? $this->index[$id] : false;
159
  }
160
-
161
- /**
162
- * Pull all config nodes for a single form
163
- * @param Integer $form_id The form ID a user is looking for
164
- * @return Array The configuration nodes for a particular form
165
- */
166
- public function get_form_configuration($form_id)
167
- {
168
- if(!isset($this->index[$form_id]))
169
- {
170
- return false;
171
- }
172
-
173
- $indexes = $this->index[$form_id];
174
-
175
- $config_nodes = array();
176
-
177
- foreach($indexes as $index)
178
- {
179
- $config_nodes[$index] = $this->configuration[$index];
180
- }
181
-
182
- return $config_nodes;
183
- }
184
-
185
- /**
186
- * Depreciated
187
- * See get_default_config_data()
188
- */
189
- public function get_config_data($form_id)
190
- {
191
- return $this->get_default_config_data($form_id);
192
- }
193
-
194
- /**
195
- * Replaced get_config_data in default tempaltes to only return the default-only configuration options
196
- * @param integer $form_id form ID
197
- * @return array Default template configuration options
198
- */
199
- public function get_default_config_data($form_id)
200
- {
201
- $config = $this->pull_config_data($form_id);
202
-
203
- /* get the default template values and return in array */
204
- $show_html_fields = (isset($config['default-show-html']) && $config['default-show-html'] == 1) ? true : false;
205
- $show_empty_fields = (isset($config['default-show-empty']) && $config['default-show-empty'] == 1) ? true : false;
206
- $show_page_names = (isset($config['default-show-page-names']) && $config['default-show-page-names'] == 1) ? true : false;
207
-
208
- return array(
209
- 'html_field' => $show_html_fields,
210
- 'empty_field' => $show_empty_fields,
211
- 'page_names' => $show_page_names,
212
- );
213
- }
214
-
215
- /**
216
- * Get the configuration information based on the form ID
217
- * If multiple nodes assigned to form look for $_GET['aid']
218
- * @param integer $form_id ID of the form
219
- * @return array configuration node
220
- */
221
- public function pull_config_data($form_id)
222
  {
223
  if(!isset($this->index[$form_id]))
224
  {
@@ -241,106 +156,36 @@
241
  /*
242
  * No valid configuration file found so pull the default
243
  */
244
- return $this->configuration[$index[0]];
245
- }
246
-
247
- /**
248
- * Gets the aid (a temporary ID assigned to config node clusters on a single form ) from the $config ID
249
- * @param Integer $config_id The $this->configuration ID of the node
250
- * @param Integer $form_id The Gravity Form ID
251
- * @return Integer The configuration nodes aid (a temporary ID assigned to config node clusters on a single form )
252
- */
253
- public function get_aid($config_id, $form_id)
254
- {
255
- $index = self::index_lookup($config_id, $form_id);
256
-
257
- if($index !== false)
258
- {
259
- return $index + 1;
260
- }
261
- }
262
-
263
- /**
264
- * Does a reverse look up on the $this->index using the $this->configuration ID
265
- * @param Integer $config_id The $this->configuration ID of the node
266
- * @return Integer The index ID
267
- * @return Array If $form_id isn't passed an array of index IDs will always be returns
268
- */
269
- public function index_lookup($config_id, $form_id = false)
270
- {
271
- $config = $this->configuration[$config_id];
272
-
273
- /*
274
- * Check the configuration node actually exists
275
- */
276
- if(!is_array($config))
277
- {
278
- return false;
279
- }
280
-
281
- /* get the form ID */
282
- $config_form_id = (!is_array($config['form_id'])) ? array($config['form_id']) : $config['form_id'];
283
-
284
-
285
- /*
286
- * If $form_id is set and inside the config node array we will do a search on it
287
- */
288
- if($form_id && in_array($form_id, $config_form_id) && isset($this->index[$form_id]))
289
- {
290
- /* return the array key, or false */
291
- return array_search($config_id, $this->index[$form_id]);
292
- }
293
-
294
- /*
295
- * Loop through the form IDs and return all indexes associated with it
296
- */
297
- $index_keys = array();
298
- foreach($config_form_id as $f_id)
299
- {
300
- if(isset($this->index[$f_id]))
301
- {
302
- /*
303
- * Search for the config ID in each form's index
304
- */
305
- $index_search = array_search($config_id, $this->index[$f_id]);
306
- if($index_search !== false)
307
- {
308
- $index_keys[] = $index_search;
309
- }
310
- }
311
- }
312
-
313
- /*
314
- * We have results so return them
315
- */
316
- if(sizeof($index_keys) > 0)
317
- {
318
- return $index_keys;
319
- }
320
-
321
- return false;
322
- }
323
 
324
  /*
325
  * Search for the template from a given form id
326
  * Return: the first template found for the form
327
  */
328
- public function get_template($form_id)
329
  {
330
- global $gf_pdf_default_configuration;
331
-
332
  $template = '';
333
-
334
- /* Set the default template based on if the default is set */
335
- $default_template = self::$default['template'];
336
-
337
- if(is_array($gf_pdf_default_configuration) && sizeof($gf_pdf_default_configuration) > 0 && isset($gf_pdf_default_configuration['template']) )
338
- {
339
- $default_template = $gf_pdf_default_configuration['template'];
340
- }
341
 
342
  if(isset($this->index[$form_id]))
343
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
344
  /*
345
  * Check if PDF template is avaliable
346
  */
@@ -362,17 +207,31 @@
362
 
363
  if(strlen($template) == 0)
364
  {
365
- $template = $default_template;
366
  }
367
  return $template;
368
  }
369
 
370
  if( (strlen($template) == 0) && (GFPDF_SET_DEFAULT_TEMPLATE === true))
371
- {
 
 
 
 
 
 
372
  /*
373
  * Check if a default configuration is defined
374
  */
375
- return $default_template;
 
 
 
 
 
 
 
 
376
  }
377
  else
378
  {
@@ -381,11 +240,11 @@
381
 
382
  }
383
 
384
- public function get_pdf_name($id, $form_id = false, $lead_id = false)
385
- {
386
- if(isset($this->configuration[$id]['filename']))
387
  {
388
- return PDF_Common::validate_pdf_name($this->configuration[$id]['filename'], $form_id, $lead_id);
389
  }
390
  else
391
  {
2
 
3
  /**
4
  * Class: PDFGenerator
5
+ * Plugin: Gravity Forms PDF Extended
6
  * Usage: assign options from user configuration file, automatically attach PDFs to specified Gravity Forms, and view PDF from admin area.
7
  */
8
 
39
 
40
  public function __construct()
41
  {
42
+
 
43
  /*
44
  * Do configuration pre-processing
45
  */
47
  /*
48
  * Check if user configuration file exists
49
  * If not disable $configuration and $index.
50
+ */
51
+ if(!file_exists(PDF_TEMPLATE_LOCATION.'configuration.php'))
52
  {
53
  $this->disabled = true;
54
  return;
58
  /*
59
  * Include the configuration file and set up the configuration variable.
60
  */
61
+ require(PDF_TEMPLATE_LOCATION.'configuration.php');
62
  /*
63
  * $gf_pdf_config included from configuration.php file
64
  */
65
  $this->configuration = (isset($gf_pdf_config)) ? $gf_pdf_config : array();
66
+ }
 
 
 
 
 
 
 
 
67
 
68
  $this->pdf_config();
69
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
70
 
71
  /*
72
  * Run through user configuration and set PDF options
128
  {
129
  return (isset($this->index[$id])) ? $this->index[$id] : false;
130
  }
131
+
132
+ /*
133
+ * Searches the index for the configuration key and once found return the real configuration
134
+ * Return: form PDF configuration
135
+ */
136
+ public function get_config_data($form_id, $return_all = false)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
137
  {
138
  if(!isset($this->index[$form_id]))
139
  {
156
  /*
157
  * No valid configuration file found so pull the default
158
  */
159
+ return $this->configuration[$index[0]];
160
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
161
 
162
  /*
163
  * Search for the template from a given form id
164
  * Return: the first template found for the form
165
  */
166
+ public function get_template($form_id, $return_all = false)
167
  {
 
 
168
  $template = '';
 
 
 
 
 
 
 
 
169
 
170
  if(isset($this->index[$form_id]))
171
  {
172
+ /*
173
+ * Show all PDF nodes
174
+ */
175
+ if($return_all === true && sizeof($this->index[$form_id]) > 1)
176
+ {
177
+
178
+ $templates = array();
179
+ foreach($this->index[$form_id] as $id)
180
+ {
181
+ $templates[$id] = array(
182
+ 'template' => (isset($this->configuration[$id]['template'])) ? $this->configuration[$id]['template'] : self::$default['template'],
183
+ 'filename' => (isset($this->configuration[$id]['filename'])) ? $this->configuration[$id]['filename'] : PDF_Common::get_pdf_filename($form_id, '{entry_id}')
184
+ );
185
+ }
186
+ return $templates;
187
+ }
188
+
189
  /*
190
  * Check if PDF template is avaliable
191
  */
207
 
208
  if(strlen($template) == 0)
209
  {
210
+ $template = PDFGenerator::$default['template'];
211
  }
212
  return $template;
213
  }
214
 
215
  if( (strlen($template) == 0) && (GFPDF_SET_DEFAULT_TEMPLATE === true))
216
+ {
217
+ /*
218
+ * If no PDF template exists then we will use $gf_pdf_default_configuration if it exists.
219
+ * If not, we will set the default
220
+ */
221
+ global $gf_pdf_default_configuration;
222
+
223
  /*
224
  * Check if a default configuration is defined
225
  */
226
+
227
+ if(is_array($gf_pdf_default_configuration) && sizeof($gf_pdf_default_configuration) > 0 && isset($gf_pdf_default_configuration['template']))
228
+ {
229
+ return $gf_pdf_default_configuration['template'];
230
+ }
231
+ else
232
+ {
233
+ return PDFGenerator::$default['template'];
234
+ }
235
  }
236
  else
237
  {
240
 
241
  }
242
 
243
+ public function get_pdf_name($index, $form_id = false, $lead_id = false)
244
+ {
245
+ if(isset($this->configuration[$index]['filename']))
246
  {
247
+ return PDF_Common::validate_pdf_name($this->configuration[$index]['filename'], $form_id, $lead_id);
248
  }
249
  else
250
  {
helper/pdf-entry-detail.php CHANGED
@@ -1,164 +1,134 @@
1
  <?php
2
  if(!class_exists('GFPDFEntryDetail'))
3
  {
4
-
5
- /*
6
- * Include Gravity Forms Currency class (it not already included)
7
- */
8
- if ( false === class_exists( 'RGCurrency' ) ) {
9
- require_once( GFCommon::get_base_path() . '/currency.php' );
10
- }
11
-
12
- add_filter('gfpdf_field_content', array('GFPDFEntryDetail', 'encode_tags'), 10, 2); /* encode shortcodes in user's response so they aren't converted later by do_shortcode */
13
  class GFPDFEntryDetail {
14
-
15
- /* holds the form fields, stored by field ID */
16
- static $fields;
17
-
18
  /* NEED THIS FUNCTION - BLD */
19
- public static function lead_detail_grid($form, $lead, $allow_display_empty_fields=false, $show_html=false, $show_page_name=false, $return=false, $show_section_breaks=false) {
20
- $form_id = $form['id'];
21
  $results = array();
22
-
23
  if($return === true)
24
  {
25
- $results['title'] = '<h2 id="details" class="default">'. $form['title'] .'</h2>';
26
  }
27
  else
28
  {
29
  ?>
30
- <div id='container'>
31
- <h2 id='details' class='default'><?php echo $form['title']?></h2>
32
  <?php
33
  }
34
-
35
-
36
  $count = 0;
37
- $field_count = sizeof($form['fields']);
38
-
39
  $has_product_fields = false;
40
 
41
  $page_number = 0;
42
- foreach($form['fields'] as $field) {
43
-
44
-
45
  /*
46
  * Check if this field has been excluded from the list
47
  */
48
  if(isset($field['cssClass']) && strpos($field['cssClass'], 'exclude') !== false)
49
  {
50
  /* skip this field */
51
- continue;
52
  }
53
-
54
- /*
55
- * Skip over hidden fields
56
- */
57
- if(GFFormsModel::is_field_hidden( $form, $field, array(), $lead ))
58
- {
59
- continue;
60
- }
61
-
62
  /*
63
  * Check if we are to show the page names
64
  */
65
  if($show_page_name === true)
66
  {
67
  if((int) $field['pageNumber'] !== $page_number)
68
- {
69
  /*
70
  * Display the page number
71
  */
72
  if($return === true)
73
  {
74
- $results['field'][] = '<h2 id="field-'. $field['id'].'" class="default entry-view-page-break">'. $form['pagination']['pages'][$page_number] .'</h2>';
75
  }
76
  else
77
  {
78
  ?>
79
- <h2 id='field-<?php echo $field['id']; ?>' class='default entry-view-page-break'><?php echo $form['pagination']['pages'][$page_number]; ?></h2>
80
  <?php
81
  }
82
  /*
83
  * Increment the page number
84
  */
85
- $page_number++;
86
  }
87
  }
88
-
89
  $even = $odd = '';
90
-
91
  switch(RGFormsModel::get_input_type($field)){
92
- case 'section' :
93
-
94
  if(!GFCommon::is_section_empty($field, $form, $lead) || $allow_display_empty_fields){
95
  $count++;
96
-
97
  if($return === true)
98
  {
99
- $results['field'][] = '<h2 id="field-'.$field['id'].'" class="default entry-view-section-break">'. esc_html(GFCommon::get_label($field)) .'</h2>';
100
  }
101
  else
102
  {
103
  ?>
104
- <h2 id="field-<?php echo $field['id']; ?>" class="default entry-view-section-break"><?php echo esc_html(GFCommon::get_label($field))?></h2>
105
  <?php
106
  }
107
  }
108
  break;
109
-
110
- case 'captcha':
111
- case 'password':
112
- case 'page':
113
  //ignore captcha, html, password, page field
114
  break;
115
- case 'html':
116
  if($show_html == true)
117
  {
118
-
119
- $count++;
120
  $is_last = $count >= $field_count && !$has_product_fields ? true : false;
121
- $last_row = $is_last ? ' lastrow' : '';
122
- $even = ($count%2) ? ' odd' : ' even';
123
-
124
- $display_value = $field['content'];
125
- $value = '';
126
-
127
- $content = '<div id="field-'. $field['id'] .'" class="entry-view-html-value' . $last_row . $even . '"><div class="value">' . $display_value . '</div></div>';
128
- $content = apply_filters('gfpdf_field_content', $content, $field, $value, $lead['id'], $form['id']);
129
-
130
  if($return === true)
131
  {
132
- $results['field'][] = $content;
133
  }
134
  else
135
  {
136
- echo $content;
137
  }
138
  }
139
  break;
140
- case 'signature':
141
- $value = RGFormsModel::get_lead_field_value($lead, $field);
142
  $public_folder = RGFormsModel::get_upload_url_root() . 'signatures/';
143
- $server_folder = RGFormsModel::get_upload_root() . 'signatures/';
144
-
145
- $image_size = getimagesize($server_folder.$value);
146
- $width = $image_size[0] / 4;
147
- $height = $image_size[1] / 4;
148
-
149
- $display_value = '<img src="'. $server_folder.$value .'" alt="Signature" width=" '. $width .'" height="'. $height .'" />';
150
-
151
-
152
- $is_last = $count >= $field_count ? true : false;
153
- $last_row = $is_last ? ' lastrow' : '';
154
-
155
  if(strlen($value) > 0 && (file_exists($server_folder.$value)) && (is_dir($server_folder.$value) !== true) )
156
- {
157
- $content = '<div id="field-'. $field['id'] .'" class="entry-view-field-value' . $last_row . $even . '"><div class="strong">' . esc_html(GFCommon::get_label($field)) . '</div> <div class="value">' . $display_value . '</div></div> ';
158
-
159
  if($return === true)
160
  {
161
- $results['field'][] = $content;
162
  }
163
  else
164
  {
@@ -169,1116 +139,475 @@ if(!class_exists('GFPDFEntryDetail'))
169
  {
170
  if($return === true)
171
  {
172
- $results['field'][] = '<div id="field-'. $field['id'] .'" class="entry-view-field-value' . $last_row . $even . '"><div class="strong">' . esc_html(GFCommon::get_label($field)) . '</div></div>';
173
  }
174
  else
175
  {
176
- print '<div id="field-'. $field['id'] .'" class="entry-view-field-value' . $last_row . $even . '"><div class="strong">' . esc_html(GFCommon::get_label($field)) . '</div></div>';
177
- }
178
-
179
  }
180
  break;
181
-
182
  default:
183
-
184
  //ignore product fields as they will be grouped together at the end of the grid
185
- if(GFCommon::is_product_field($field['type'])){
186
  $has_product_fields = true;
187
  continue;
188
  }
189
-
190
  $value = RGFormsModel::get_lead_field_value($lead, $field);
191
- $display_value = self::pdf_get_lead_field_display($field, $value, $lead['currency']);
192
-
193
-
194
- $display_value = apply_filters('gform_entry_field_value', $display_value, $field, $lead, $form);
195
-
196
- if( !empty($display_value) || $display_value === '0' || $allow_display_empty_fields){
197
- $count++;
198
  $is_last = $count >= $field_count && !$has_product_fields ? true : false;
199
- $last_row = $is_last ? ' lastrow' : '';
200
  $even = ($count%2) ? ' odd' : ' even';
201
-
202
- $display_value = empty($display_value) && $display_value !== '0' ? '&nbsp;' : $display_value;
203
-
204
- $content = '<div id="field-'. $field['id'] .'" class="entry-view-field-value' . $last_row . $even . '"><div class="strong">' . esc_html(GFCommon::get_label($field)) . '</div> <div class="value">' . $display_value . '</div></div>';
205
-
206
- $content = apply_filters('gfpdf_field_content', $content, $field, $value, $lead['id'], $form['id']);
207
-
208
  if($return === true)
209
- {
210
  $results['field'][] = $content;
211
  }
212
  else
213
  {
214
  echo $content;
215
  }
216
-
217
  }
218
  break;
219
  }
220
-
221
  }
222
  $products = array();
223
  if($has_product_fields){
224
  if($return === true)
225
  {
226
  ob_start();
227
- self::product_table($form, $lead);
228
- $results['field'][] = ob_get_contents();
229
- ob_end_clean();
230
  }
231
  else
232
  {
233
  self::product_table($form, $lead);
234
  }
235
-
236
  }
237
-
238
  if($return === true)
239
  {
240
- return $results;
241
  }
242
  ?>
243
  </div>
244
  <?php
245
  }
246
-
247
  public static function product_table($form, $lead)
248
  {
249
  $products = GFCommon::get_product_fields($form, $lead, true);
250
 
251
  $form_id = $form['id'];
252
- if(!empty($products['products'])){
253
  ?>
254
-
255
- <h2 class='default entry-view-field-name'><?php echo apply_filters("gform_order_label_{$form['id']}", apply_filters('gform_order_label', __('Order', 'gravityforms'), $form['id']), $form['id']) ?></h2>
256
-
257
- <table class='entry-products' autosize='1' cellspacing='0' width='97%'>
258
  <colgroup>
259
- <col class='entry-products-col1' />
260
- <col class='entry-products-col2' />
261
- <col class='entry-products-col3' />
262
- <col class='entry-products-col4' />
263
  </colgroup>
264
  <thead>
265
  <tr>
266
- <th scope='col'><?php echo apply_filters('gform_product_{$form_id}', apply_filters('gform_product', __('Product', 'gravityforms'), $form_id), $form_id) ?></th>
267
- <th scope='col' class='textcenter'><?php echo apply_filters('gform_product_qty_{$form_id}', apply_filters('gform_product_qty', __('Qty', 'gravityforms'), $form_id), $form_id) ?></th>
268
- <th scope='col'><?php echo apply_filters('gform_product_unitprice_{$form_id}', apply_filters('gform_product_unitprice', __('Unit Price', 'gravityforms'), $form_id), $form_id) ?></th>
269
- <th scope='col'><?php echo apply_filters('gform_product_price_{$form_id}', apply_filters('gform_product_price', __('Price', 'gravityforms'), $form_id), $form_id) ?></th>
270
  </tr>
271
  </thead>
272
  <tbody>
273
  <?php
274
-
275
  $total = 0;
276
- foreach($products['products'] as $product){
277
  ?>
278
  <tr>
279
  <td>
280
- <div class='product_name'><?php echo esc_html($product['name'])?></div>
281
-
282
  <?php
283
- $price = GFCommon::to_number($product['price']);
284
- if(is_array(rgar($product,'options'))){
285
  echo '<ul class="product_options">';
286
- $count = sizeof($product['options']);
287
  $index = 1;
288
- foreach($product['options'] as $option){
289
- $price += GFCommon::to_number($option['price']);
290
- $class = $index == $count ? ' class="lastitem"' : '';
291
  $index++;
292
  ?>
293
- <li<?php echo $class?>><?php echo $option['option_label']?></li>
294
  <?php
295
  }
296
  echo '</ul>';
297
  }
298
- $subtotal = floatval($product['quantity']) * $price;
299
  $total += $subtotal;
300
  ?>
301
-
302
  </td>
303
- <td class='textcenter'><?php echo $product['quantity'] ?></td>
304
- <td><?php echo GFCommon::to_money($price, $lead['currency']) ?></td>
305
- <td><?php echo GFCommon::to_money($subtotal, $lead['currency']) ?></td>
306
  </tr>
307
  <?php
308
  }
309
- $total += floatval($products['shipping']['price']);
310
  ?>
311
-
312
-
313
  <?php
314
- if(!empty($products['shipping']['name'])){
315
  ?>
316
  <tr>
317
- <td colspan='2' rowspan='2' class='emptycell'>&nbsp;</td>
318
- <td class='textright shipping'><?php echo $products['shipping']['name'] ?></td>
319
- <td class='shipping_amount'><?php echo GFCommon::to_money($products['shipping']['price'], $lead['currency'])?>&nbsp;</td>
320
  </tr>
321
  <?php
322
  }
323
  ?>
324
  <tr>
325
  <?php
326
- if(empty($products['shipping']['name'])){
327
  ?>
328
- <td colspan='2' class='emptycell'>&nbsp;</td>
329
  <?php
330
  }
331
- ?>
332
- <td class='textright grandtotal'><?php _e('Total', 'gravityforms') ?></td>
333
- <td class='grandtotal_amount'><?php echo GFCommon::to_money($total, $lead['currency'])?></td>
334
- </tr>
335
- </tbody>
336
-
337
- </table>
338
-
339
- <?php
340
- }
341
- }
342
-
343
- /*
344
- * Public method for outputting likert (survey addon field)
345
- */
346
- public static function get_likert($form, $lead, $field_id)
347
- {
348
- $fields = self::$fields;
349
- $field = $fields[$field_id];
350
- $value = RGFormsModel::get_lead_field_value($lead, $field);
351
-
352
- $display_value = apply_filters('gform_entry_field_value', self::pdf_get_lead_field_display($field, $value, ''), $field, $lead, $form);
353
- $content = $display_value;
354
-
355
- $results = apply_filters('gfpdf_field_content', $content, $field, $value, $lead['id'], $form['id']);
356
-
357
- return $results;
358
- }
359
-
360
- public static function format_date($date, $usa = false)
361
- {
362
- $timestamp = strtotime($date);
363
- $new_date = (!$usa) ? date('j/n/Y', $timestamp) : date('n/j/Y', $timestamp);
364
- return $new_date;
365
- }
366
-
367
-
368
- /* returns the form values as an array instead of pre-formated html */
369
- public static function lead_detail_grid_array($form, $lead, $allow_display_empty_fields=false){
370
-
371
- $form_id = $form['id'];
372
- $form_array = self::set_form_array_common($form, $lead, $form_id);
373
-
374
- $has_product_fields = false;
375
-
376
- foreach($form['fields'] as $field) {
377
-
378
-
379
- /*
380
- * Add field descriptions to the $form_data array
381
- */
382
- if(isset($field['description']))
383
- {
384
- $form_array['field_descriptions'][$field['id']] = $field['description'];
385
- }
386
-
387
- switch(RGFormsModel::get_input_type($field)) {
388
- case 'section' :
389
- case 'html':
390
- $form_array = self::get_html($field, $form_array);
391
- break;
392
-
393
- case 'captcha':
394
- case 'password':
395
- case 'page':
396
- //ignore captcha, password and page
397
- break;
398
- case 'signature':
399
- $form_array = self::get_signature($form, $lead, $field, $form_array);
400
-
401
- break;
402
- case 'fileupload':
403
- $form_array = self::get_fileupload($form, $lead, $field, $form_array);
404
- break;
405
- case 'list':
406
- /*
407
- * We want list to run both this and the deafult so don't call break.
408
- * Get the list array and store it outside of [field] in a new key called ['list']
409
- */
410
- $form_array = self::get_default_list($lead, $field, $form_array);
411
-
412
- case 'select':
413
- case 'multiselect':
414
- case 'radio':
415
-
416
- if($field['type'] == 'quiz')
417
- {
418
- $form_array = self::get_quiz_radios($form, $lead, $field, $form_array);
419
- }
420
- elseif($field['type'] == 'poll' || $field['type'] == 'survey')
421
- {
422
- $form_array = self::get_poll_radios($form, $lead, $field, $form_array);
423
- }
424
- else
425
- {
426
- /* store values in regular [field] array */
427
- $form_array = self::get_the_list($lead, $field, $form_array);
428
- }
429
- break;
430
-
431
- case 'likert':
432
- $form_array['survey']['likert'][$field['id']] = self::get_the_likert($form, $lead, $field, $form_array);
433
- break;
434
-
435
- case 'rank':
436
- $form_array['survey']['rank'][$field['id']] = self::get_the_rank($form, $lead, $field, $form_array);
437
- break;
438
-
439
- case 'rating':
440
- $form_array['survey']['rating'][$field['id']] = self::get_the_rank($form, $lead, $field, $form_array);
441
- break;
442
-
443
- default:
444
-
445
-
446
- //ignore product fields as they will be grouped together at the end of the grid
447
- if(GFCommon::is_product_field($field['type'])){
448
- $has_product_fields = true;
449
- continue;
450
- }
451
-
452
- $form_array = self::get_defaults($lead, $field, $form_array);
453
-
454
- break;
455
- }
456
-
457
- }
458
-
459
- $form_array = self::get_product_array($form, $lead, $has_product_fields, $form_array);
460
-
461
- return $form_array;
462
- }
463
-
464
- private static function get_quiz_radios($form, $lead, $field, $form_array)
465
- {
466
- $id = $field['id'];
467
- $results = $lead[$id];
468
- $return = array();
469
-
470
- foreach($field['choices'] as $choice)
471
- {
472
- if(trim($choice['value']) == trim($results))
473
- {
474
- $return = array('text' => $choice['text'], 'isCorrect' => $choice['gquizIsCorrect']);
475
- break;
476
- }
477
- }
478
-
479
- /* add data to field tag correctly */
480
- $form_array['field'][$field['id'].'.'.$field['label'].'_name'] = $return;
481
-
482
- /* add ID incase want to use template on multiple duplicate forms with different field names */
483
- $form_array['field'][$field['id']] = $return;
484
-
485
- return $form_array;
486
-
487
- }
488
-
489
- private static function get_poll_radios($form, $lead, $field, $form_array)
490
- {
491
-
492
- $id = $field['id'];
493
- $results = $lead[$id];
494
- $return = array();
495
-
496
- $return = self::get_poll_data($results, $field['choices']);
497
-
498
- /* add data to field tag correctly */
499
- $form_array['field'][$field['id'].'.'.$field['label'].'_name'] = $return;
500
-
501
- /* add ID incase want to use template on multiple duplicate forms with different field names */
502
- $form_array['field'][$field['id']] = $return;
503
-
504
- return $form_array;
505
-
506
- }
507
-
508
- private static function get_poll_checkbox($field, $values)
509
- {
510
- foreach($values as $id => $item)
511
- {
512
- $values[$id] = self::get_poll_data($item, $field['choices']);
513
- }
514
- return $values;
515
- }
516
-
517
- private static function get_poll_data($lookup, $options)
518
- {
519
- $return = '';
520
-
521
- foreach($options as $choice)
522
- {
523
- if(trim($choice['value']) == trim($lookup))
524
- {
525
- $return = $choice['text'];
526
- break;
527
- }
528
- }
529
-
530
- return $return;
531
- }
532
-
533
- private static function get_the_rank($form, $lead, $field, $form_array)
534
- {
535
- $id = $field['id'];
536
- $results = explode(',', $lead[$id]);
537
- $return = array();
538
-
539
- foreach($results as $rank)
540
- {
541
- foreach($field['choices'] as $choice)
542
- {
543
- if(trim($choice['value']) == trim($rank))
544
- {
545
- $return[] = $choice['text'];
546
- break;
547
- }
548
- }
549
- }
550
-
551
- return $return;
552
- }
553
-
554
- private static function get_the_likert($form, $lead, $field, $form_array)
555
- {
556
- $id = $field['id'];
557
- $multiple_rows = rgar($field, "gsurveyLikertEnableMultipleRows");
558
-
559
- if(!$multiple_rows)
560
- {
561
- $results = $lead[$id];
562
- }
563
-
564
- $likert = array();
565
-
566
- /* store the column names */
567
- foreach($field['choices'] as $col)
568
- {
569
- $likert['col'][$col['value']] = $col['text'];
570
- }
571
-
572
- if(is_array($field['inputs']) && sizeof($field['inputs']) > 0)
573
- {
574
- /* do our multi-row likert */
575
- foreach($field['inputs'] as $row)
576
- {
577
- /* pad the array with the number of columns */
578
-
579
- foreach($likert['col'] as $col_id => $text)
580
- {
581
- /*
582
- * Results for multi row is stored with ID.ROW# (eg $lead['1.2'])
583
- * The number is stored in $row['id']
584
- */
585
- $results = $lead[$row['id']];
586
-
587
- /* user data in the $lead comes in as ROW ID:COL ID */
588
- $comparison = $row['name'] . ':' . $col_id;
589
-
590
- /* do our comparison and update the output */
591
- $output = ($comparison == $results) ? 'selected' : '';
592
-
593
- /* assign our results to the array */
594
- $likert['rows'][$row['label']][$text] = $output;
595
-
596
- }
597
- }
598
- }
599
- else
600
- {
601
- /* do our single row likert */
602
- foreach($likert['col'] as $col_id => $text)
603
- {
604
- /* single row data comes in with col value */
605
- /* do our comparison and update the output */
606
- $output = ($col_id == $results) ? 'selected' : '';
607
-
608
- $likert['row'][$text] = $output;
609
-
610
- }
611
- }
612
-
613
- /*
614
- * Check if scoring is enabled and calculate
615
- */
616
- if($field['gsurveyLikertEnableScoring'] && class_exists('GFSurvey'))
617
- {
618
- $survey = GFSurvey::get_instance();
619
- $likert['score'] = $survey->get_field_score($field, $lead);
620
- }
621
-
622
- return $likert;
623
-
624
- }
625
-
626
- private static function get_form_fields($form)
627
- {
628
- $fields = array();
629
- foreach($form['fields'] as $field)
630
- {
631
- $fields[$field['id']] = $field;
632
- }
633
-
634
- self::$fields = $fields;
635
- }
636
-
637
- private static function set_form_array_common($form, $lead, $form_id)
638
- {
639
- /*
640
- * Reorder the $form array as we can access the info by Field ID
641
- */
642
- self::get_form_fields($form);
643
-
644
- $form_array = array();
645
-
646
- /*
647
- * Add form_id and lead_id
648
- */
649
- $form_array['form_id'] = $form_id;
650
- $form_array['entry_id'] = $lead['id'];
651
-
652
- /*
653
- * Set title and dates (both US and international)
654
- */
655
- $form_array['form_title'] = $form['title'];
656
- $form_array['form_description'] = $form['description'];
657
- $form_array['date_created'] = self::format_date($lead['date_created']);
658
- $form_array['date_created_usa'] = self::format_date($lead['date_created'], true);
659
-
660
- /*
661
- * Include page names
662
- */
663
- $form_array['pages'] = $form['pagination']['pages'];
664
-
665
- /*
666
- * Add misc fields
667
- */
668
- $form_array['misc']['date_time'] = $lead['date_created'];
669
- $form_array['misc']['time_24hr'] = date('H:i', strtotime($lead['date_created']));
670
- $form_array['misc']['time_12hr'] = date('g:ia', strtotime($lead['date_created']));
671
- $form_array['misc']['is_starred'] = $lead['is_starred'];
672
- $form_array['misc']['is_read'] = $lead['is_read'];
673
- $form_array['misc']['ip'] = $lead['ip'];
674
- $form_array['misc']['source_url'] = $lead['source_url'];
675
- $form_array['misc']['post_id'] = $lead['post_id'];
676
- $form_array['misc']['currency'] = $lead['currency'];
677
- $form_array['misc']['payment_status'] = $lead['payment_status'];
678
- $form_array['misc']['payment_date'] = $lead['payment_date'];
679
- $form_array['misc']['transaction_id'] = $lead['transaction_id'];
680
- $form_array['misc']['payment_amount'] = $lead['payment_amount'];
681
- $form_array['misc']['is_fulfilled'] = $lead['is_fulfilled'];
682
- $form_array['misc']['created_by'] = $lead['created_by'];
683
- $form_array['misc']['transaction_type'] = $lead['transaction_type'];
684
- $form_array['misc']['user_agent'] = $lead['user_agent'];
685
- $form_array['misc']['status'] = $lead['status'];
686
-
687
-
688
-
689
- /*
690
- * Add quiz results
691
- */
692
- $form_array = self::get_quiz_results($form_array, $form, $lead);
693
- $form_array = self::get_survey_results($form_array, $form, $lead);
694
- $form_array = self::get_poll_results($form_array, $form, $lead);
695
-
696
- return $form_array;
697
- }
698
-
699
- /**
700
- * Sniff the form fields and determine if there are any of the $type avaluable
701
- * @param string $type the field type we are looking for
702
- * @param array $form the form array
703
- * @return boolean Whether there is a match or not
704
- */
705
- private static function check_for_fields($type, $form)
706
- {
707
- foreach($form['fields'] as $field)
708
- {
709
- if($field['type'] == $type)
710
- {
711
- return true;
712
- }
713
- }
714
- return false;
715
- }
716
-
717
- private static function get_poll_results($form_array, $form, $lead)
718
- {
719
- if(self::check_for_fields('poll', $form) === false)
720
- {
721
- return $form_array;
722
- }
723
-
724
- $poll_results = self::get_addon_global_data($form, array());
725
-
726
- $form_fields = self::$fields;
727
-
728
- /*
729
- * Convert the array keys into their text counterparts
730
- * Loop through the global poll data
731
- */
732
- foreach($poll_results['field_data'] as $id => &$choices)
733
- {
734
- /* get the $field */
735
- $field = $form_fields[$id];
736
-
737
- /* add the field name to the ['misc'] key */
738
- $choices['misc']['label'] = $field['label'];
739
-
740
- /* loop through the field choices */
741
- foreach($field['choices'] as $choice)
742
- {
743
- $choices = self::replace_key($choices, $choice['value'], $choice['text']);
744
- }
745
- }
746
-
747
- $form_array['poll']['global'] = $poll_results;
748
-
749
- return $form_array;
750
- }
751
-
752
- private static function get_survey_results($form_array, $form, $lead)
753
- {
754
- if(self::check_for_fields('survey', $form) === false)
755
- {
756
- return $form_array;
757
- }
758
-
759
- /*
760
- * If there are any survey results
761
- * add them to the 'survey' key
762
- */
763
- $fields = GFCommon::get_fields_by_type($form, array('survey'));
764
- $count_survey_fields = count($fields);
765
-
766
- if ($count_survey_fields > 0 && isset($lead['gsurvey_score']))
767
- {
768
- $form_array['survey']['score'] = $lead['gsurvey_score'];
769
- }
770
-
771
- $form_array['survey']['global'] = self::get_addon_global_data($form, array());
772
- $form_fields = self::$fields;
773
-
774
- /*
775
- * Convert the array keys into their text counterparts
776
- * Loop through the global survey data
777
- */
778
- foreach($form_array['survey']['global']['field_data'] as $id => &$choices)
779
- {
780
- /* get the $field */
781
- $field = $form_fields[$id];
782
-
783
- /*
784
- * Check if we have a multifield likert and replace the row key
785
- */
786
- if(isset($field['gsurveyLikertEnableMultipleRows']) && $field['gsurveyLikertEnableMultipleRows'] == 1)
787
- {
788
- foreach($field['gsurveyLikertRows'] as $row)
789
- {
790
- $choices = self::replace_key($choices, $row['value'], $row['text']);
791
- }
792
-
793
- foreach($choices as $multi_id => &$multi_choices)
794
- {
795
- foreach($field['choices'] as $choice)
796
- {
797
- $multi_choices = self::replace_key($multi_choices, $choice['value'], $choice['text']);
798
- }
799
- }
800
- }
801
-
802
- /* replace the standard row data */
803
- foreach($field['choices'] as $choice)
804
- {
805
- $choices = self::replace_key($choices, $choice['value'], $choice['text']);
806
- }
807
- }
808
-
809
- return $form_array;
810
-
811
- }
812
-
813
- private static function replace_key($array, $key, $text)
814
- {
815
- if($key != $text && isset($array[$key]))
816
- {
817
- /* replace the array key with the actual field name */
818
- $array[$text] = $array[$key];
819
- unset($array[$key]);
820
- }
821
- return $array;
822
- }
823
-
824
- private static function get_quiz_results($form_array, $form, $lead)
825
- {
826
-
827
- if(self::check_for_fields('quiz', $form) === false)
828
- {
829
- return $form_array;
830
- }
831
-
832
- /*
833
- * If there are any quiz results
834
- * add them to the 'quiz' key
835
- */
836
- $fields = GFCommon::get_fields_by_type($form, array('quiz'));
837
- $count_quiz_fields = count($fields);
838
-
839
- if ($count_quiz_fields > 0)
840
- {
841
- $form_array['quiz']['config']['grading'] = (isset($form['gravityformsquiz']['grading'])) ? $form['gravityformsquiz']['grading'] : '';
842
- $form_array['quiz']['config']['passPercent'] = (isset($form['gravityformsquiz']['passPercent'])) ? $form['gravityformsquiz']['passPercent'] : '';
843
- $form_array['quiz']['config']['grades'] = (isset($form['gravityformsquiz']['grades'])) ? $form['gravityformsquiz']['grades'] : '';
844
-
845
- $form_array['quiz']['results']['score'] = rgar($lead, 'gquiz_score');
846
- $form_array['quiz']['results']['percent'] = rgar($lead, 'gquiz_percent');
847
- $form_array['quiz']['results']['is_pass'] = rgar($lead, 'gquiz_is_pass');
848
- $form_array['quiz']['results']['grade'] = rgar($lead, 'gquiz_grade');
849
-
850
- /*
851
- * Get the overall results
852
- */
853
- $quiz_global = self::get_quiz_overalls($form);
854
-
855
- $form_fields = self::$fields;
856
- /*
857
- * Convert the array keys into their text counterparts
858
- * Loop through the global quiz data
859
- */
860
- foreach($quiz_global['field_data'] as $id => &$choices)
861
- {
862
- /* get the $field */
863
- $field = $form_fields[$id];
864
-
865
- /* replace ['totals'] key with ['misc'] key */
866
- $choices = self::replace_key($choices, 'totals', 'misc');
867
-
868
- /* add the field name to the ['misc'] key */
869
- $choices['misc']['label'] = $field['label'];
870
-
871
- /* loop through the field choices */
872
- foreach($field['choices'] as $choice)
873
- {
874
- $choices = self::replace_key($choices, $choice['value'], $choice['text']);
875
-
876
- /* check if this is the correct field */
877
- if($choice['gquizIsCorrect'] == 1)
878
- {
879
- $choices['misc']['correct_option_name'] = $choice['text'];
880
- }
881
-
882
- }
883
- }
884
-
885
- $form_array['quiz']['global'] = $quiz_global;
886
- //$form_array['quiz']['global'] = self::get_quiz_overalls($form);
887
-
888
- }
889
-
890
- return $form_array;
891
- }
892
-
893
- private static function get_addon_global_data($form, $options)
894
- {
895
- /* if the results class isn't loaded, load it */
896
- if (!class_exists("GFResults"))
897
- {
898
- require_once(GFCommon::get_base_path() . "/includes/addon/class-gf-results.php");
899
- }
900
-
901
- $fields = $form["fields"];
902
-
903
- /* initiat the results class */
904
- $gf_results = new GFResults('', $options);
905
-
906
- /* ensure that only active leads are queried */
907
- $search = array(
908
- 'field_filters' => array('mode' => ''),
909
- 'status' => 'active'
910
- );
911
-
912
- /* get the results */
913
- $data = $gf_results->get_results_data($form, $fields, $search);
914
-
915
- /* unset some array keys we don't need */
916
- unset($data['status']);
917
- unset($data['timestamp']);
918
-
919
- return $data;
920
-
921
- }
922
-
923
- private static function get_quiz_overalls($form)
924
- {
925
- /* we need to tap into functions GF Quiz has so only run if it is active */
926
- if(class_exists('GFQuiz'))
927
- {
928
- /* GFQuiz is a singleton. Get the instance */
929
- $quiz = GFQuiz::get_instance();
930
-
931
- /* create our callback to add additional data to the array specific to the quiz plugin */
932
- $options['callbacks']['calculation'] = array(
933
- $quiz,
934
- 'results_calculation'
935
- );
936
-
937
- return self::get_addon_global_data($form, $options);
938
- }
939
-
940
- return array(__('Activate Gravity Forms Quiz Add On to see global quiz statistics for this form', 'pdfextended'));
941
- }
942
-
943
- private static function get_html($field, $form_array)
944
- {
945
- if(isset($field['content']))
946
- {
947
- $form_array['html'][] = wpautop($field['content']);
948
- }
949
-
950
- return $form_array;
951
- }
952
-
953
- private static function get_signature($form, $lead, $field, $form_array)
954
- {
955
- $value = RGFormsModel::get_lead_field_value($lead, $field);
956
-
957
- $http_folder = RGFormsModel::get_upload_url_root(). 'signatures/';
958
- $server_folder = RGFormsModel::get_upload_root() . 'signatures/';
959
-
960
-
961
- if(file_exists($server_folder.$value) !== false && is_dir($server_folder.$value) !== true)
962
- {
963
- $image_size = getimagesize($server_folder.$value);
964
- $width = $image_size[0] / 4;
965
- $height = $image_size[1] / 4;
966
-
967
- $sig_html = '<img src="'. $server_folder.$value .'" alt="Signature" width=" '. $width .'" height="'. $height .'" />';
968
-
969
- $form_array['signature'][] = $sig_html;
970
- $form_array['signature_details'][] = array(
971
- 'img' => $sig_html,
972
- 'path' => $server_folder.$value,
973
- 'url' => $http_folder.$value,
974
- 'width' => $width,
975
- 'height' => $height,
976
- );
977
-
978
- $form_array['signature_details_id'][$field['id']] = array(
979
- 'img' => $sig_html,
980
- 'path' => $server_folder.$value,
981
- 'url' => $http_folder.$value,
982
- 'width' => $width,
983
- 'height' => $height,
984
- );
985
- }
986
-
987
- return $form_array;
988
- }
989
-
990
- private static function get_fileupload($form, $lead, $field, $form_array)
991
- {
992
- $value = RGFormsModel::get_lead_field_value($lead, $field);
993
- $display = self::get_lead_field_display($field, $value, $lead['currency']);
994
-
995
- /*
996
- * Get the absolute path to the upload
997
- */
998
- $path = str_replace(home_url().'/', ABSPATH, $display);
999
-
1000
- /* add path */
1001
- $form_array['field'][$field['id'].'_path'] = $path;
1002
- $form_array['field'][$field['id'].'.'.$field['label'].'_path'] = $path;
1003
-
1004
- return self::assign_form($field, $display, $form_array);
1005
- }
1006
-
1007
- private static function get_default_list($lead, $field, $form_array)
1008
- {
1009
- $value = self::remove_empty_list_rows(unserialize(RGFormsModel::get_lead_field_value($lead, $field)));
1010
- $form_array['list'][$field['id']] = $value;
1011
-
1012
- return $form_array;
1013
- }
1014
-
1015
- private static function remove_empty_list_rows($list)
1016
- {
1017
- /*
1018
- * Check if there are any values in the list
1019
- */
1020
- if(!is_array($list) || sizeof($list) == 0)
1021
- {
1022
- return $list;
1023
- }
1024
-
1025
- /*
1026
- * Check if it's a multi column list
1027
- */
1028
- if(!is_array($list[0]))
1029
- {
1030
- $list = array_filter($list);
1031
- }
1032
- else
1033
- {
1034
- $list = self::remove_empty_multi_col_list($list);
1035
- }
1036
-
1037
- return $list;
1038
- }
1039
-
1040
- private static function remove_empty_multi_col_list($list)
1041
- {
1042
- foreach($list as $id => $row)
1043
- {
1044
-
1045
- $empty = true;
1046
- foreach($row as &$col)
1047
- {
1048
- /* check if there is data and if so break the loop */
1049
- if(trim(strlen($col) > 0))
1050
- {
1051
- $empty = false;
1052
- break;
1053
- }
1054
- }
1055
-
1056
- /* remove row from list */
1057
- if($empty)
1058
- {
1059
- unset($list[$id]);
1060
- }
1061
- }
1062
-
1063
- return $list;
1064
- }
1065
-
1066
- private static function get_the_list($lead, $field, $form_array)
1067
- {
1068
- $value = RGFormsModel::get_lead_field_value($lead, $field);
1069
- $display = self::get_lead_field_display($field, $value, $lead['currency']);
1070
-
1071
- $form_array = self::assign_form($field, $display, $form_array);
1072
-
1073
- /*
1074
- * Include these items correct names
1075
- */
1076
- $display = self::get_lead_field_display($field, $value, $lead['currency'], true);
1077
- /* add data to field tag correctly */
1078
- $form_array['field'][$field['id'].'.'.$field['label'].'_name'] = $display;
1079
-
1080
- /* add ID incase want to use template on multiple duplicate forms with different field names */
1081
- $form_array['field'][$field['id'].'_name'] = $display;
1082
-
1083
- /* keep backwards compatibility */
1084
- $form_array['field'][$field['label'].'_name'] = $display;
1085
-
1086
- return $form_array;
1087
- }
1088
-
1089
- private static function get_defaults($lead, $field, $form_array)
1090
- {
1091
- $value = RGFormsModel::get_lead_field_value($lead, $field);
1092
- $display = self::get_lead_field_display($field, $value, $lead['currency']);
1093
-
1094
- return self::assign_form($field, $display, $form_array);
1095
- }
1096
-
1097
- private static function assign_form($field, $display, $form_array)
1098
- {
1099
- /* add data to field tag correctly */
1100
- $form_array['field'][$field['id'].'.'.$field['label']] = $display;
1101
-
1102
- /* add ID incase want to use template on multiple duplicate forms with different field names */
1103
- $form_array['field'][$field['id']] = $display;
1104
-
1105
- /* keep backwards compatibility */
1106
- $form_array['field'][$field['label']] = $display;
1107
-
1108
- return $form_array;
1109
- }
1110
-
1111
- private static function get_product_array($form, $lead, $has_product_fields, $form_array)
1112
- {
1113
- $currency_format = GFCommon::is_currency_decimal_dot() ? 'decimal_dot' : 'decimal_comma';
1114
-
1115
- if($has_product_fields) {
1116
- $products = GFCommon::get_product_fields($form, $lead, true);
1117
-
1118
- /* check that there are actual product fields */
1119
- if(sizeof($products['products']) > 0 )
1120
- {
1121
-
1122
- /*
1123
- * Set up our variables
1124
- */
1125
- $total = 0;
1126
- $subtotal = 0;
1127
-
1128
-
1129
- foreach($products['products'] as $id => $product) {
1130
-
1131
- $price = GFCommon::to_number($product['price']);
1132
-
1133
- /* add all options to total price */
1134
- if(is_array(rgar($product,'options')))
1135
- {
1136
- foreach($product['options'] as $option){
1137
- $price += GFCommon::to_number($option['price']);
1138
- }
1139
- }
1140
-
1141
- /* calculate subtotal */
1142
- $subtotal = floatval($product['quantity']) * $price;
1143
- $total += $subtotal;
1144
-
1145
- /*
1146
- * Check if we should include options
1147
- */
1148
- $options = isset($product['options']) ? $product['options'] : array();
1149
-
1150
- /*
1151
- * Add formated price for each product option
1152
- */
1153
- foreach($options as &$o)
1154
- {
1155
- if(is_numeric($o['price']))
1156
- {
1157
- $o['price_formatted'] = GFCommon::format_number($o['price'], 'currency');
1158
- }
1159
  }
1160
-
1161
- /*
1162
- * Store product in $form_array array
1163
- */
1164
- $form_array['products'][$id] = array(
1165
- 'name' => esc_html($product['name']),
1166
- 'price' => esc_html($product['price']),
1167
- 'price_unformatted' => GFCommon::clean_number($product['price'], $currency_format),
1168
- 'options' => $options,
1169
- 'quantity' => $product['quantity'],
1170
- 'subtotal' => $subtotal,
1171
- 'subtotal_formatted' => GFCommon::format_number($subtotal, 'currency'));
1172
  }
1173
-
1174
- /* Increment total */
1175
- $total += floatval($products['shipping']['price']);
1176
- $subtotal = $total - floatval($products['shipping']['price']);
1177
-
1178
- /* add totals to form data */
1179
- $form_array['products_totals'] = array(
1180
- 'subtotal' => $subtotal,
1181
- 'shipping' => $products['shipping']['price'],
1182
- 'total' => $total,
1183
- 'shipping_formatted' => GFCommon::format_number($products['shipping']['price'], 'currency'),
1184
- 'subtotal_formatted' => GFCommon::format_number($subtotal, 'currency'),
1185
- 'total_formatted' => GFCommon::format_number($total, 'currency'),
1186
- );
1187
- }
1188
- }
1189
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1190
  return $form_array;
1191
  }
1192
-
1193
- public static function get_lead_field_display($field, $value, $currency='', $use_text=false, $format='html', $media='screen'){
1194
-
 
 
1195
  if($field['type'] == 'post_category')
1196
- $value = GFCommon::prepare_post_category_value($value, $field);
1197
-
1198
  switch(RGFormsModel::get_input_type($field)){
1199
- case 'name' :
1200
  if(is_array($value)){
1201
- $prefix = trim(rgget($field['id'] . '.2', $value));
1202
- $first = trim(rgget($field['id'] . '.3', $value));
1203
- $middle = trim(rgget($field['id'] . '.4', $value));
1204
- $last = trim(rgget($field['id'] . '.6', $value));
1205
- $suffix = trim(rgget($field['id'] . '.8', $value));
1206
-
1207
- return array('prefix' => $prefix, 'first' => $first, 'middle' => $middle, 'last' => $last, 'suffix' => $suffix);
1208
  }
1209
  else{
1210
  return $value;
1211
  }
1212
-
1213
  break;
1214
- case 'creditcard' :
1215
  if(is_array($value)){
1216
- $card_number = trim(rgget($field['id'] . '.1', $value));
1217
- $card_type = trim(rgget($field['id'] . '.4', $value));
1218
- $separator = $format == 'html' ? '<br/>' : '\n';
1219
- return empty($card_number) ? '' : $card_type . $separator . $card_number;
1220
  }
1221
  else{
1222
- return '';
1223
  }
1224
  break;
1225
-
1226
- case 'address' :
1227
  if(is_array($value)){
1228
- $street_value = trim(rgget($field['id'] . '.1', $value));
1229
- $street2_value = trim(rgget($field['id'] . '.2', $value));
1230
- $city_value = trim(rgget($field['id'] . '.3', $value));
1231
- $state_value = trim(rgget($field['id'] . '.4', $value));
1232
- $zip_value = trim(rgget($field['id'] . '.5', $value));
1233
- $country_value = trim(rgget($field['id'] . '.6', $value));
1234
-
1235
- $line_break = $format == 'html' ? '<br />' : '\n';
1236
-
1237
- $address_display_format = apply_filters('gform_address_display_format', 'default');
1238
-
1239
- $address['street'] = $street_value;
1240
- $address['street2'] = $street2_value;
1241
- $address['city'] = $city_value;
1242
- $address['state'] = $state_value;
1243
- $address['zip'] = $zip_value;
1244
- $address['country'] = $country_value;
1245
-
1246
  return $address;
1247
  }
1248
  else{
1249
- return '';
1250
  }
1251
  break;
1252
-
1253
- case 'email' :
1254
- return GFCommon::is_valid_email($value) && $format == 'html' ? $value : $value;
1255
  break;
1256
-
1257
- case 'website' :
1258
- return GFCommon::is_valid_url($value) && $format == 'html' ? $value : $value;
1259
  break;
1260
-
1261
- case 'checkbox' :
1262
  if(is_array($value)){
1263
-
1264
  $items = array();
1265
-
1266
  foreach($value as $key => $item){
1267
- if(!empty($item)) {
1268
- if($field['type'] == 'poll' || $field['type'] == 'survey')
1269
- {
1270
- /*
1271
- * Convert our poll type
1272
- */
1273
- $items[] = self::get_poll_checkbox($field, $value);
1274
- return $items;
1275
- }
1276
-
1277
  switch($format){
1278
- case 'text' :
1279
  $items[] = GFCommon::selection_display($item, $field, $currency, $use_text);
1280
  break;
1281
-
1282
  default:
1283
  $items[] = GFCommon::selection_display($item, $field, $currency, $use_text);
1284
  break;
@@ -1286,9 +615,9 @@ if(!class_exists('GFPDFEntryDetail'))
1286
  }
1287
  }
1288
  if(empty($items)){
1289
- return '';
1290
  }
1291
- else if($format == 'text'){
1292
  /*return substr($items, 0, strlen($items)-2); //removing last comma*/
1293
  }
1294
  else{
@@ -1299,114 +628,113 @@ if(!class_exists('GFPDFEntryDetail'))
1299
  return $value;
1300
  }
1301
  break;
1302
-
1303
- case 'post_image' :
1304
- $ary = explode('|:|', $value);
1305
- $url = count($ary) > 0 ? $ary[0] : '';
1306
- $title = count($ary) > 1 ? $ary[1] : '';
1307
- $caption = count($ary) > 2 ? $ary[2] : '';
1308
- $description = count($ary) > 3 ? $ary[3] : '';
1309
-
1310
  if(!empty($url)){
1311
- $url = str_replace(' ', '%20', $url);
1312
-
1313
- $value = array('url' => $url,
1314
  'path' => str_replace(site_url().'/', ABSPATH, $url),
1315
  'title' => $title,
1316
  'caption' => $caption,
1317
  'description' => $description);
1318
  }
1319
  return $value;
1320
-
1321
- case 'fileupload' :
1322
  $output_arr = array();
1323
- if(!empty($value)){
1324
- $file_paths = rgar($field,'multipleFiles') ? json_decode($value) : array($value);
1325
  foreach($file_paths as $file_path){
1326
- $info = pathinfo($file_path);
1327
- $file_path = esc_attr(str_replace(' ', '%20', $file_path));
1328
  $output_arr[] = $file_path;
1329
  }
1330
  $output = join(PHP_EOL, $output_arr);
1331
  }
1332
- return $output_arr;
1333
  break;
1334
-
1335
- case 'date' :
1336
- return GFCommon::date_display($value, rgar($field, 'dateFormat'));
1337
  break;
1338
-
1339
- case 'radio' :
1340
- case 'select' :
1341
  return GFCommon::selection_display($value, $field, $currency, $use_text);
1342
  break;
1343
-
1344
- case 'multiselect' :
1345
- if(empty($value) || $format == 'text')
1346
  return $value;
1347
-
1348
- $value = explode(',', $value);
1349
-
1350
  $items = '';
1351
  foreach($value as $item){
1352
  $items[] = GFCommon::selection_display($item, $field, $currency, $use_text);
1353
  }
1354
-
1355
  if(sizeof($items) == 1)
1356
  {
1357
- return $items[0];
1358
  }
1359
  return $items;
1360
-
1361
-
1362
  break;
1363
-
1364
- case 'calculation' :
1365
- case 'singleproduct' :
1366
  if(is_array($value)){
1367
- $product_name = trim($value[$field['id'] . '.1']);
1368
- $price = trim($value[$field['id'] . '.2']);
1369
- $quantity = trim($value[$field['id'] . '.3']);
1370
-
1371
- $product = $product_name . ', ' . __('Qty: ', 'gravityforms') . $quantity . ', ' . __('Price: ', 'gravityforms') . $price;
1372
-
1373
  return $product;
1374
  }
1375
  else{
1376
- return '';
1377
  }
1378
  break;
1379
-
1380
- case 'number' :
1381
- return GFCommon::format_number($value, rgar($field, 'numberFormat'));
1382
  break;
1383
-
1384
- case 'singleshipping' :
1385
- case 'donation' :
1386
- case 'total' :
1387
- case 'price' :
1388
  return GFCommon::to_money($value, $currency);
1389
-
1390
- case 'list' :
1391
  if(empty($value))
1392
- return '';
1393
  $value = unserialize($value);
1394
-
1395
  $has_columns = is_array($value[0]);
1396
-
1397
- if(!$has_columns){
1398
  $items = array();
1399
  foreach($value as $key => $item){
1400
  if(!empty($item)){
1401
  switch($format){
1402
- case 'text' :
1403
  $items[] = $item;
1404
  break;
1405
- case 'url' :
1406
  $items[] = $item;
1407
  break;
1408
  default :
1409
- if($media == 'email'){
1410
  $items[] = $item;
1411
  }
1412
  else{
@@ -1416,111 +744,103 @@ if(!class_exists('GFPDFEntryDetail'))
1416
  }
1417
  }
1418
  }
1419
-
1420
  if(empty($items)){
1421
- return '';
1422
  }
1423
- else if($format == 'text'){
1424
  /* return substr($items, 0, strlen($items)-2); //removing last comma*/
1425
- return $items;
1426
  }
1427
- else if($format == 'url'){
1428
  /*return substr($items, 0, strlen($items)-1); //removing last comma*/
1429
- return $items;
1430
  }
1431
- else if($media == 'email'){
1432
  return $items;
1433
  }
1434
- else {
1435
- $list = '<table autosize="1" class="gfield_list" style="border-top: 1px solid #DFDFDF; border-left: 1px solid #DFDFDF; border-spacing: 0; padding: 0; margin: 2px 0 6px; width: 100%">';
1436
- foreach($items as $i)
1437
- {
1438
- $list .= '<tr><td>' . $i .'</td></tr>';
1439
- }
1440
- $list .= '</table>';
1441
-
1442
- return $list;
1443
  }
1444
  }
1445
  else if(is_array($value)){
1446
  $columns = array_keys($value[0]);
1447
-
1448
- $list = '';
1449
-
1450
  switch($format){
1451
- case 'text' :
1452
  $is_first_row = true;
1453
  foreach($value as $item){
1454
  if(!$is_first_row)
1455
- $list .= '\n\n' . $field['label'] . ': ';
1456
- $list .= implode(',', array_values($item));
1457
-
1458
  $is_first_row = false;
1459
  }
1460
  break;
1461
-
1462
- case 'url' :
1463
  foreach($value as $item){
1464
- $list .= implode('|', array_values($item)) . ',';
1465
  }
1466
  if(!empty($list))
1467
  $list = substr($list, 0, strlen($list)-1);
1468
  break;
1469
-
1470
  default :
1471
-
1472
- if($media == 'email'){
1473
- $list = '<table autosize="1" class="gfield_list" style="border-top: 1px solid #DFDFDF; border-left: 1px solid #DFDFDF; border-spacing: 0; padding: 0; margin: 2px 0 6px; width: 100%"><thead><tr>';
1474
-
1475
  //reading columns from entry data
1476
  foreach($columns as $column){
1477
- $list .= '<th style="background-image: none; border-right: 1px solid #DFDFDF; border-bottom: 1px solid #DFDFDF; padding: 6px 10px; font-family: sans-serif; font-size: 12px; font-weight: bold; background-color: #F1F1F1; color:#333; text-align:left">" . esc_html($column) . "</th>';
1478
  }
1479
- $list .= '</tr></thead>';
1480
-
1481
- $list .= '<tbody style="background-color: #F9F9F9">';
1482
  foreach($value as $item){
1483
- $list .= '<tr>';
1484
  foreach($columns as $column){
1485
  $val = rgar($item, $column);
1486
- $list .= '<td style="padding: 6px 10px; border-right: 1px solid #DFDFDF; border-bottom: 1px solid #DFDFDF; border-top: 1px solid #FFF; font-family: sans-serif; font-size:12px;">{$val}</td>';
1487
  }
1488
-
1489
- $list .='</tr>';
1490
  }
1491
-
1492
- $list .='</tbody></table>';
1493
  }
1494
  else{
1495
- $list = '<table class="gfield_list" autosize="1"><thead><tr>';
1496
-
1497
  //reading columns from entry data
1498
  foreach($columns as $column){
1499
- $list .= '<th>' . esc_html($column) . '</th>';
1500
  }
1501
- $list .= '</tr></thead>';
1502
-
1503
- $list .= '<tbody>';
1504
  foreach($value as $item){
1505
- $list .= '<tr>';
1506
  foreach($columns as $column){
1507
  $val = rgar($item, $column);
1508
- $list .= '<td>'.htmlspecialchars($val).'</td>';
1509
  }
1510
-
1511
- $list .='</tr>';
1512
  }
1513
-
1514
- $list .='</tbody></table>';
1515
  }
1516
  break;
1517
  }
1518
-
1519
  return $list;
1520
  }
1521
- return '';
1522
  break;
1523
-
1524
  default :
1525
  if (!is_array($value))
1526
  {
@@ -1528,60 +848,58 @@ if(!class_exists('GFPDFEntryDetail'))
1528
  }
1529
  break;
1530
  }
1531
- }
1532
-
1533
- public static function pdf_get_lead_field_display($field, $value, $currency='', $use_text=false, $format='html', $media='screen'){
1534
-
1535
  if($field['type'] == 'post_category')
1536
- $value = GFCommon::prepare_post_category_value($value, $field);
1537
-
1538
  switch(RGFormsModel::get_input_type($field)){
1539
- case 'name' :
1540
  if(is_array($value)){
1541
- $prefix = trim(rgget($field['id'] . '.2', $value));
1542
- $first = trim(rgget($field['id'] . '.3', $value));
1543
- $middle = trim(rgget($field['id'] . '.4', $value));
1544
- $last = trim(rgget($field['id'] . '.6', $value));
1545
- $suffix = trim(rgget($field['id'] . '.8', $value));
1546
-
1547
- $name = $prefix;
1548
- $name .= !empty($name) && !empty($first) ? " $first" : $first;
1549
- $name .= !empty($name) && !empty($middle) ? " $middle" : $middle;
1550
- $name .= !empty($name) && !empty($last) ? " $last" : $last;
1551
- $name .= !empty($name) && !empty($suffix) ? " $suffix" : $suffix;
1552
-
1553
  return $name;
1554
  }
1555
  else{
1556
  return $value;
1557
  }
1558
-
1559
  break;
1560
- case 'creditcard' :
1561
  if(is_array($value)){
1562
- $card_number = trim(rgget($field['id'] . '.1', $value));
1563
- $card_type = trim(rgget($field['id'] . '.4', $value));
1564
- $separator = $format == 'html' ? '<br/>' : '\n';
1565
- return empty($card_number) ? '' : $card_type . $separator . $card_number;
1566
  }
1567
  else{
1568
- return '';
1569
  }
1570
  break;
1571
-
1572
- case 'address' :
1573
  if(is_array($value)){
1574
- $street_value = trim(rgget($field['id'] . '.1', $value));
1575
- $street2_value = trim(rgget($field['id'] . '.2', $value));
1576
- $city_value = trim(rgget($field['id'] . '.3', $value));
1577
- $state_value = trim(rgget($field['id'] . '.4', $value));
1578
- $zip_value = trim(rgget($field['id'] . '.5', $value));
1579
- $country_value = trim(rgget($field['id'] . '.6', $value));
1580
-
1581
- $line_break = $format == 'html' ? '<br />' : '\n';
1582
-
1583
- $address_display_format = apply_filters('gform_address_display_format', 'default');
1584
- if($address_display_format == 'zip_before_city'){
1585
  /*
1586
  Sample:
1587
  3333 Some Street
@@ -1589,24 +907,24 @@ if(!class_exists('GFPDFEntryDetail'))
1589
  2344 City, State
1590
  Country
1591
  */
1592
-
1593
  $addr_ary = array();
1594
  $addr_ary[] = $street_value;
1595
-
1596
  if(!empty($street2_value))
1597
  $addr_ary[] = $street2_value;
1598
-
1599
- $zip_line = trim($zip_value . ' ' . $city_value);
1600
  $zip_line .= !empty($zip_line) && !empty($state_value) ? ", {$state_value}" : $state_value;
1601
  $zip_line = trim($zip_line);
1602
  if(!empty($zip_line))
1603
  $addr_ary[] = $zip_line;
1604
-
1605
  if(!empty($country_value))
1606
  $addr_ary[] = $country_value;
1607
-
1608
- $address = implode('<br />', $addr_ary);
1609
-
1610
  }
1611
  else{
1612
  $address = $street_value;
@@ -1616,272 +934,275 @@ if(!class_exists('GFPDFEntryDetail'))
1616
  $address .= !empty($address) && !empty($zip_value) ? " $zip_value" : $zip_value;
1617
  $address .= !empty($address) && !empty($country_value) ? $line_break . $country_value : $country_value;
1618
  }
1619
-
1620
  return $address;
1621
  }
1622
  else{
1623
- return '';
1624
  }
1625
  break;
1626
-
1627
- case 'email' :
1628
- return GFCommon::is_valid_email($value) && $format == 'html' ? '<a href="mailto:'. $value .'">'. $value .'</a>' : $value;
1629
  break;
1630
-
1631
- case 'website' :
1632
- return GFCommon::is_valid_url($value) && $format == 'html' ? '<a href="'. $value .'" target="_blank">'. $value .'</a>' : $value;
1633
  break;
1634
-
1635
- case 'checkbox' :
1636
  if(is_array($value)){
1637
-
1638
  $items = '';
1639
-
1640
  foreach($value as $key => $item){
1641
  if(!empty($item)){
1642
  switch($format){
1643
- case 'text' :
1644
- $items .= GFCommon::selection_display($item, $field, $currency, true) . ', ';
1645
  break;
1646
-
1647
  default:
1648
- $items .= '<li>' . GFCommon::selection_display($item, $field, $currency, true) . '</li>';
1649
  break;
1650
  }
1651
  }
1652
  }
1653
  if(empty($items)){
1654
- return '';
1655
  }
1656
- else if($format == 'text'){
1657
  return substr($items, 0, strlen($items)-2); //removing last comma
1658
  }
1659
  else{
1660
- return '<ul class="bulleted">' . $items . '</ul>';
1661
  }
1662
  }
1663
  else{
1664
  return $value;
1665
  }
1666
  break;
1667
-
1668
- case 'post_image' :
1669
- $ary = explode('|:|', $value);
1670
- $url = count($ary) > 0 ? $ary[0] : '';
1671
- $title = count($ary) > 1 ? $ary[1] : '';
1672
- $caption = count($ary) > 2 ? $ary[2] : '';
1673
- $description = count($ary) > 3 ? $ary[3] : '';
1674
-
1675
  if(!empty($url)){
1676
- $url = str_replace(' ', '%20', $url);
1677
  switch($format){
1678
- case 'text' :
1679
  $value = $url;
1680
- $value .= !empty($title) ? '\n\n' . $field['label'] . ' (' . __('Title', 'gravityforms') . '): ' . $title : '';
1681
- $value .= !empty($caption) ? '\n\n' . $field['label'] . ' (' . __('Caption', 'gravityforms') . '): ' . $caption : '';
1682
- $value .= !empty($description) ? '\n\n' . $field['label'] . ' (' . __('Description', 'gravityforms') . '): ' . $description : '';
1683
  break;
1684
-
1685
  default :
1686
- $path = str_replace(site_url().'/', ABSPATH, $url);
1687
  $value = "<a href='$url' target='_blank' title='" . __("Click to view", "gravityforms") . "'><img src='$path' width='100' /></a>";
1688
  $value .= !empty($title) ? "<div>Title: $title</div>" : "";
1689
  $value .= !empty($caption) ? "<div>Caption: $caption</div>" : "";
1690
  $value .= !empty($description) ? "<div>Description: $description</div>": "";
1691
-
1692
  break;
1693
  }
1694
  }
1695
  return $value;
1696
-
1697
- case 'fileupload' :
1698
  $output = '';
1699
- $output_arr = array();
1700
- if(!empty($value)){
1701
- $output .= '<ul>';
1702
- $file_paths = rgar($field,'multipleFiles') ? json_decode($value) : array($value);
1703
  foreach($file_paths as $file_path){
1704
  $info = pathinfo($file_path);
1705
- $file_path = esc_attr(str_replace(' ', '%20', $file_path));
1706
- $output_arr[] = '<li><a href="'. $file_path .'" target="_blank" title="' . __('Click to view', 'gravityforms') . '">' . $info['basename'] . '</a></li>';
1707
  }
1708
  $output .= join(PHP_EOL, $output_arr);
1709
- $output .= '</ul>';
1710
  }
1711
-
1712
- return $output;
1713
  break;
1714
-
1715
- case 'date' :
1716
- return GFCommon::date_display($value, rgar($field, 'dateFormat'));
1717
  break;
1718
-
1719
- case 'radio' :
1720
- case 'select' :
1721
  return GFCommon::selection_display($value, $field, $currency, true);
1722
  break;
1723
-
1724
- case 'multiselect' :
1725
- if(empty($value) || $format == 'text')
1726
  return $value;
1727
-
1728
- $value = explode(',', $value);
1729
-
1730
  $items = '';
1731
  foreach($value as $item){
1732
- $items .= '<li>' . GFCommon::selection_display($item, $field, $currency, true) . '</li>';
1733
  }
1734
-
1735
- return '<ul class="bulleted">' . $items . '</ul>';
1736
-
1737
  break;
1738
-
1739
- case 'calculation' :
1740
- case 'singleproduct' :
1741
  if(is_array($value)){
1742
- $product_name = trim($value[$field['id'] . '.1']);
1743
- $price = trim($value[$field['id'] . '.2']);
1744
- $quantity = trim($value[$field['id'] . '.3']);
1745
-
1746
- $product = $product_name . ', ' . __('Qty: ', 'gravityforms') . $quantity . ', ' . __('Price: ', 'gravityforms') . $price;
1747
  return $product;
1748
  }
1749
  else{
1750
- return '';
1751
  }
1752
  break;
1753
-
1754
- case 'number' :
1755
- return GFCommon::format_number($value, rgar($field, 'numberFormat'));
1756
  break;
1757
-
1758
- case 'singleshipping' :
1759
- case 'donation' :
1760
- case 'total' :
1761
- case 'price' :
1762
  return GFCommon::to_money($value, $currency);
1763
-
1764
- case 'list' :
1765
  if(empty($value))
1766
- return '';
1767
  $value = unserialize($value);
1768
-
1769
  $has_columns = is_array($value[0]);
1770
-
1771
  if(!$has_columns){
1772
  $items = '';
1773
  foreach($value as $key => $item){
1774
  if(!empty($item)){
1775
  switch($format){
1776
- case 'text' :
1777
- $items .= $item . ', ';
1778
  break;
1779
- case 'url' :
1780
- $items .= $item . ',';
1781
  break;
1782
  default :
1783
- if($media == 'email'){
1784
- $items .= '<li>'.htmlspecialchars($item).'</li>';
1785
  }
1786
  else{
1787
- $items .= '<li>'.htmlspecialchars($item).'</li>';
1788
  }
1789
  break;
1790
  }
1791
  }
1792
  }
1793
-
1794
  if(empty($items)){
1795
- return '';
1796
  }
1797
- else if($format == 'text'){
1798
  return substr($items, 0, strlen($items)-2); //removing last comma
1799
  }
1800
- else if($format == 'url'){
1801
  return substr($items, 0, strlen($items)-1); //removing last comma
1802
  }
 
 
 
1803
  else{
1804
- return '<ul class="bulleted">' . $items . '</ul>';
1805
  }
1806
  }
1807
  else if(is_array($value)){
1808
  $columns = array_keys($value[0]);
1809
-
1810
- $list = '';
1811
-
1812
  switch($format){
1813
- case 'text' :
1814
  $is_first_row = true;
1815
  foreach($value as $item){
1816
  if(!$is_first_row)
1817
- $list .= '\n\n' . $field['label'] . ': ';
1818
- $list .= implode(',', array_values($item));
1819
-
1820
  $is_first_row = false;
1821
  }
1822
  break;
1823
-
1824
- case 'url' :
1825
  foreach($value as $item){
1826
- $list .= implode('|', array_values($item)) . ',';
1827
  }
1828
  if(!empty($list))
1829
  $list = substr($list, 0, strlen($list)-1);
1830
  break;
1831
-
1832
  default :
1833
- if($media == 'email'){
1834
- $list = '<table autosize="1" class="gfield_list" style="border-top: 1px solid #DFDFDF; border-left: 1px solid #DFDFDF; border-spacing: 0; padding: 0; margin: 2px 0 6px; width: 100%"><thead><tr>';
1835
-
1836
  //reading columns from entry data
1837
  foreach($columns as $column){
1838
- $list .= '<th style="background-image: none; border-right: 1px solid #DFDFDF; border-bottom: 1px solid #DFDFDF; padding: 6px 10px; font-family: sans-serif; font-size: 12px; font-weight: bold; background-color: #F1F1F1; color:#333; text-align:left">' . esc_html($column) . '</th>';
1839
  }
1840
- $list .= '</tr></thead>';
1841
-
1842
- $list .= '<tbody style="background-color: #F9F9F9">';
1843
  foreach($value as $item){
1844
- $list .= '<tr>';
1845
  foreach($columns as $column){
1846
  $val = rgar($item, $column);
1847
- $list .= '<td style="padding: 6px 10px; border-right: 1px solid #DFDFDF; border-bottom: 1px solid #DFDFDF; border-top: 1px solid #FFF; font-family: sans-serif; font-size:12px;">{$val}</td>';
1848
  }
1849
-
1850
- $list .='</tr>';
1851
  }
1852
-
1853
- $list .='</tbody></table>';
1854
  }
1855
  else{
1856
- $list = '<table autosize="1" class="gfield_list"><thead><tr>';
1857
-
1858
  //reading columns from entry data
1859
  foreach($columns as $column){
1860
- $list .= '<th>' . esc_html($column) . '</th>';
1861
  }
1862
- $list .= '</tr></thead>';
1863
-
1864
- $list .= '<tbody>';
1865
  foreach($value as $item){
1866
- $list .= '<tr>';
1867
  foreach($columns as $column){
1868
  $val = rgar($item, $column);
1869
- $list .= '<td>'.htmlspecialchars($val).'</td>';
1870
  }
1871
-
1872
- $list .='</tr>';
1873
  }
1874
-
1875
- $list .='</tbody></table>';
1876
  }
1877
  break;
1878
  }
1879
-
1880
  return $list;
1881
  }
1882
- return '';
1883
  break;
1884
-
1885
  default :
1886
  if (!is_array($value))
1887
  {
@@ -1890,19 +1211,5 @@ if(!class_exists('GFPDFEntryDetail'))
1890
  break;
1891
  }
1892
  }
1893
-
1894
-
1895
- public static function encode_tags($content, $field)
1896
- {
1897
- if(RGFormsModel::get_input_type($field) != 'html' || RGFormsModel::get_input_type($field) != 'signature')
1898
- {
1899
- $content = str_replace('[', '&#91;', $content);
1900
- $content = str_replace(']', '&#93;', $content);
1901
- $content = str_replace('{', '&#123;', $content);
1902
- $content = str_replace('}', '&#125;', $content);
1903
- }
1904
-
1905
- return $content;
1906
- }
1907
  }
1908
  }
1
  <?php
2
  if(!class_exists('GFPDFEntryDetail'))
3
  {
 
 
 
 
 
 
 
 
 
4
  class GFPDFEntryDetail {
5
+
 
 
 
6
  /* NEED THIS FUNCTION - BLD */
7
+ public static function lead_detail_grid($form, $lead, $allow_display_empty_fields=false, $show_html=false, $show_page_name=false, $return=false, $show_section_breaks=false){
8
+ $form_id = $form["id"];
9
  $results = array();
10
+
11
  if($return === true)
12
  {
13
+ $results['title'] = '<h2 id="details" class="default">'. $form["title"] .'</h2>';
14
  }
15
  else
16
  {
17
  ?>
18
+ <div id="container">
19
+ <h2 id="details" class="default"><?php echo $form["title"]?></h2>
20
  <?php
21
  }
22
+
23
+
24
  $count = 0;
25
+ $field_count = sizeof($form["fields"]);
26
+
27
  $has_product_fields = false;
28
 
29
  $page_number = 0;
30
+ foreach($form["fields"] as $field) {
31
+
 
32
  /*
33
  * Check if this field has been excluded from the list
34
  */
35
  if(isset($field['cssClass']) && strpos($field['cssClass'], 'exclude') !== false)
36
  {
37
  /* skip this field */
38
+ continue;
39
  }
40
+
 
 
 
 
 
 
 
 
41
  /*
42
  * Check if we are to show the page names
43
  */
44
  if($show_page_name === true)
45
  {
46
  if((int) $field['pageNumber'] !== $page_number)
47
+ {
48
  /*
49
  * Display the page number
50
  */
51
  if($return === true)
52
  {
53
+ $results['field'][] = '<h2 id="field-'. $count.'" class="default entry-view-page-break">'. $form['pagination']['pages'][$page_number] .'</h2>';
54
  }
55
  else
56
  {
57
  ?>
58
+ <h2 id="field-<?php echo $count; ?>" class="default entry-view-page-break"><?php echo $form['pagination']['pages'][$page_number]; ?></h2>
59
  <?php
60
  }
61
  /*
62
  * Increment the page number
63
  */
64
+ $page_number++;
65
  }
66
  }
67
+
68
  $even = $odd = '';
 
69
  switch(RGFormsModel::get_input_type($field)){
70
+ case "section" :
71
+
72
  if(!GFCommon::is_section_empty($field, $form, $lead) || $allow_display_empty_fields){
73
  $count++;
74
+
75
  if($return === true)
76
  {
77
+ $results['field'][] = '<h2 id="field-'.$count.'" class="default entry-view-section-break">'. esc_html(GFCommon::get_label($field)) .'</h2>';
78
  }
79
  else
80
  {
81
  ?>
82
+ <h2 id="field-<?php echo $count; ?>" class="default entry-view-section-break"><?php echo esc_html(GFCommon::get_label($field))?></h2>
83
  <?php
84
  }
85
  }
86
  break;
87
+
88
+ case "captcha":
89
+ case "password":
90
+ case "page":
91
  //ignore captcha, html, password, page field
92
  break;
93
+ case "html":
94
  if($show_html == true)
95
  {
96
+
97
+ $count++;
98
  $is_last = $count >= $field_count && !$has_product_fields ? true : false;
99
+ $last_row = $is_last ? " lastrow" : "";
100
+ $even = ($count%2) ? ' odd' : ' even';
101
+
102
+ $display_value = wpautop($field['content']);
103
+
104
+ $content = '<div id="field-'.$count.'" class="entry-view-html-value' . $last_row . $even . '"><div class="value">' . $display_value . '</div></div>';
105
+ $content = apply_filters("gform_field_content", $content, $field, $value, $lead["id"], $form["id"]);
106
+
 
107
  if($return === true)
108
  {
109
+ $results['field'][] = $content;
110
  }
111
  else
112
  {
113
+ echo $content;
114
  }
115
  }
116
  break;
117
+ case "signature":
118
+ $value = RGFormsModel::get_lead_field_value($lead, $field);
119
  $public_folder = RGFormsModel::get_upload_url_root() . 'signatures/';
120
+ $server_folder = RGFormsModel::get_upload_root() . 'signatures/';
121
+ $display_value = '<img src="'. $server_folder.$value .'" alt="Signature" width="100" height="60" />';
122
+ $is_last = $count >= $field_count ? true : false;
123
+ $last_row = $is_last ? " lastrow" : "";
124
+
 
 
 
 
 
 
 
125
  if(strlen($value) > 0 && (file_exists($server_folder.$value)) && (is_dir($server_folder.$value) !== true) )
126
+ {
127
+ $content = '<div id="field-'.$count.'" class="entry-view-field-value' . $last_row . $even . '"><div class="strong">' . esc_html(GFCommon::get_label($field)) . '</div> <div class="value">' . $display_value . '</div></div> ';
128
+
129
  if($return === true)
130
  {
131
+ $results['field'][] = $content;
132
  }
133
  else
134
  {
139
  {
140
  if($return === true)
141
  {
142
+ $results['field'][] = '<div id="field-'.$count.'" class="entry-view-field-value' . $last_row . $even . '"><div class="strong">' . esc_html(GFCommon::get_label($field)) . '</div></div>';
143
  }
144
  else
145
  {
146
+ print '<div id="field-'.$count.'" class="entry-view-field-value' . $last_row . $even . '"><div class="strong">' . esc_html(GFCommon::get_label($field)) . '</div></div>';
147
+ }
148
+
149
  }
150
  break;
151
+
152
  default:
153
+
154
  //ignore product fields as they will be grouped together at the end of the grid
155
+ if(GFCommon::is_product_field($field["type"])){
156
  $has_product_fields = true;
157
  continue;
158
  }
159
+
160
  $value = RGFormsModel::get_lead_field_value($lead, $field);
161
+ $display_value = self::pdf_get_lead_field_display($field, $value, $lead["currency"]);
162
+
163
+ $display_value = apply_filters("gform_entry_field_value", $display_value, $field, $lead, $form);
164
+
165
+ if( !empty($display_value) || $display_value === "0" || $allow_display_empty_fields){
166
+ $count++;
 
167
  $is_last = $count >= $field_count && !$has_product_fields ? true : false;
168
+ $last_row = $is_last ? " lastrow" : "";
169
  $even = ($count%2) ? ' odd' : ' even';
170
+
171
+ $display_value = empty($display_value) && $display_value !== "0" ? "&nbsp;" : $display_value;
172
+
173
+ $content = '<div id="field-'.$count.'" class="entry-view-field-value' . $last_row . $even . '"><div class="strong">' . esc_html(GFCommon::get_label($field)) . '</div> <div class="value">' . $display_value . '</div></div>';
174
+
175
+ $content = apply_filters("gform_field_content", $content, $field, $value, $lead["id"], $form["id"]);
176
+
177
  if($return === true)
178
+ {
179
  $results['field'][] = $content;
180
  }
181
  else
182
  {
183
  echo $content;
184
  }
185
+
186
  }
187
  break;
188
  }
189
+
190
  }
191
  $products = array();
192
  if($has_product_fields){
193
  if($return === true)
194
  {
195
  ob_start();
196
+ self::product_table($form, $lead);
197
+ $results['field'][] = ob_get_contents();
198
+ ob_end_clean();
199
  }
200
  else
201
  {
202
  self::product_table($form, $lead);
203
  }
204
+
205
  }
206
+
207
  if($return === true)
208
  {
209
+ return $results;
210
  }
211
  ?>
212
  </div>
213
  <?php
214
  }
215
+
216
  public static function product_table($form, $lead)
217
  {
218
  $products = GFCommon::get_product_fields($form, $lead, true);
219
 
220
  $form_id = $form['id'];
221
+ if(!empty($products["products"])){
222
  ?>
223
+
224
+ <h2 class="default entry-view-field-name"><?php echo apply_filters("gform_order_label_{$form["id"]}", apply_filters("gform_order_label", __("Order", "gravityforms"), $form["id"]), $form["id"]) ?></h2>
225
+
226
+ <table class="entry-products" autosize="1" cellspacing="0" width="97%">
227
  <colgroup>
228
+ <col class="entry-products-col1" />
229
+ <col class="entry-products-col2" />
230
+ <col class="entry-products-col3" />
231
+ <col class="entry-products-col4" />
232
  </colgroup>
233
  <thead>
234
  <tr>
235
+ <th scope="col"><?php echo apply_filters("gform_product_{$form_id}", apply_filters("gform_product", __("Product", "gravityforms"), $form_id), $form_id) ?></th>
236
+ <th scope="col" class="textcenter"><?php echo apply_filters("gform_product_qty_{$form_id}", apply_filters("gform_product_qty", __("Qty", "gravityforms"), $form_id), $form_id) ?></th>
237
+ <th scope="col"><?php echo apply_filters("gform_product_unitprice_{$form_id}", apply_filters("gform_product_unitprice", __("Unit Price", "gravityforms"), $form_id), $form_id) ?></th>
238
+ <th scope="col"><?php echo apply_filters("gform_product_price_{$form_id}", apply_filters("gform_product_price", __("Price", "gravityforms"), $form_id), $form_id) ?></th>
239
  </tr>
240
  </thead>
241
  <tbody>
242
  <?php
243
+
244
  $total = 0;
245
+ foreach($products["products"] as $product){
246
  ?>
247
  <tr>
248
  <td>
249
+ <div class="product_name"><?php echo esc_html($product["name"])?></div>
250
+
251
  <?php
252
+ $price = GFCommon::to_number($product["price"]);
253
+ if(is_array(rgar($product,"options"))){
254
  echo '<ul class="product_options">';
255
+ $count = sizeof($product["options"]);
256
  $index = 1;
257
+ foreach($product["options"] as $option){
258
+ $price += GFCommon::to_number($option["price"]);
259
+ $class = $index == $count ? " class='lastitem'" : "";
260
  $index++;
261
  ?>
262
+ <li<?php echo $class?>><?php echo $option["option_label"]?></li>
263
  <?php
264
  }
265
  echo '</ul>';
266
  }
267
+ $subtotal = floatval($product["quantity"]) * $price;
268
  $total += $subtotal;
269
  ?>
270
+
271
  </td>
272
+ <td class="textcenter"><?php echo $product["quantity"] ?></td>
273
+ <td><?php echo GFCommon::to_money($price, $lead["currency"]) ?></td>
274
+ <td><?php echo GFCommon::to_money($subtotal, $lead["currency"]) ?></td>
275
  </tr>
276
  <?php
277
  }
278
+ $total += floatval($products["shipping"]["price"]);
279
  ?>
280
+
281
+
282
  <?php
283
+ if(!empty($products["shipping"]["name"])){
284
  ?>
285
  <tr>
286
+ <td colspan="2" rowspan="2" class="emptycell">&nbsp;</td>
287
+ <td class="textright shipping"><?php echo $products["shipping"]["name"] ?></td>
288
+ <td class="shipping_amount"><?php echo GFCommon::to_money($products["shipping"]["price"], $lead["currency"])?>&nbsp;</td>
289
  </tr>
290
  <?php
291
  }
292
  ?>
293
  <tr>
294
  <?php
295
+ if(empty($products["shipping"]["name"])){
296
  ?>
297
+ <td colspan="2" class="emptycell">&nbsp;</td>
298
  <?php
299
  }
300
+ ?>
301
+ <td class="textright grandtotal"><?php _e("Total", "gravityforms") ?></td>
302
+ <td class="grandtotal_amount"><?php echo GFCommon::to_money($total, $lead["currency"])?></td>
303
+ </tr>
304
+ </tbody>
305
+
306
+ </table>
307
+
308
+ <?php
309
+ }
310
+ }
311
+
312
+ public static function format_date($date, $usa = false)
313
+ {
314
+ $timestamp = strtotime($date);
315
+ $new_date = (!$usa) ? date('j/n/Y', $timestamp) : date('n/j/Y', $timestamp);
316
+ return $new_date;
317
+ }
318
+
319
+ /* returns the form values as an array instead of pre-formated html */
320
+ public static function lead_detail_grid_array($form, $lead, $allow_display_empty_fields=false){
321
+
322
+ $form_id = $form["id"];
323
+ $display_empty_fields = false;
324
+ if($allow_display_empty_fields){
325
+ $display_empty_fields = rgget("gf_display_empty_fields", $_COOKIE);
326
+ }
327
+
328
+ /*
329
+ * Add form_id and lead_id
330
+ */
331
+ $form_array['form_id'] = $form_id;
332
+ $form_array['entry_id'] = $lead['id'];
333
+
334
+ $form_array['form_title'] = $form['title'];
335
+ $form_array['date_created'] = self::format_date($lead['date_created']);
336
+ $form_array['date_created_usa'] = self::format_date($lead['date_created'], true);
337
+
338
+ $form_array['pages'] = $form['pagination']['pages'];
339
+
340
+ /*
341
+ * Add misc fields
342
+ */
343
+ $form_array['misc']['date_time'] = $lead['date_created'];
344
+ $form_array['misc']['time_24hr'] = date('H:i', strtotime($lead['date_created']));
345
+ $form_array['misc']['time_12hr'] = date('g:ia', strtotime($lead['date_created']));
346
+ $form_array['misc']['is_starred'] = $lead['is_starred'];
347
+ $form_array['misc']['is_read'] = $lead['is_read'];
348
+ $form_array['misc']['ip'] = $lead['ip'];
349
+ $form_array['misc']['source_url'] = $lead['source_url'];
350
+ $form_array['misc']['post_id'] = $lead['post_id'];
351
+ $form_array['misc']['currency'] = $lead['currency'];
352
+ $form_array['misc']['payment_status'] = $lead['payment_status'];
353
+ $form_array['misc']['payment_date'] = $lead['payment_date'];
354
+ $form_array['misc']['transaction_id'] = $lead['transaction_id'];
355
+ $form_array['misc']['payment_amount'] = $lead['payment_amount'];
356
+ $form_array['misc']['is_fulfilled'] = $lead['is_fulfilled'];
357
+ $form_array['misc']['created_by'] = $lead['created_by'];
358
+ $form_array['misc']['transaction_type'] = $lead['transaction_type'];
359
+ $form_array['misc']['user_agent'] = $lead['user_agent'];
360
+ $form_array['misc']['status'] = $lead['status'];
361
+
362
+ $count = 0;
363
+ $field_count = sizeof($form["fields"]);
364
+ $has_product_fields = false;
365
+
366
+ foreach($form["fields"] as $field){
367
+ $display = '';
368
+ switch(RGFormsModel::get_input_type($field)){
369
+ case "section" :
370
+ break;
371
+
372
+ case "captcha":
373
+ case "html":
374
+ if(isset($field['content']))
375
+ {
376
+ $form_array['html'][] = wpautop($field['content']);
377
+ }
378
+ case "password":
379
+ case "page":
380
+ //ignore captcha, html, password, page field
381
+ break;
382
+ case "signature":
383
+ $value = RGFormsModel::get_lead_field_value($lead, $field);
384
+ $http_folder = RGFormsModel::get_upload_url_root(). 'signatures/';;
385
+ $folder = RGFormsModel::get_upload_root() . 'signatures/';
386
+
387
+ if(file_exists($folder.$value) !== false && is_dir($folder.$value) !== true)
388
+ {
389
+ $form_array['signature'][] = '<img src="'. $folder.$value .'" alt="Signature" width="100" height="60" />';
390
+ $form_array['signature_details'][] = array('img' => '<img src="'. $folder.$value .'" alt="Signature" width="100" height="60" />',
391
+ 'path' => $folder.$value,
392
+ 'url' => $http_folder.$value);
393
+ $form_array['signature_details_id'][$field['id']] = array('img' => '<img src="'. $folder.$value .'" alt="Signature" width="100" height="60" />',
394
+ 'path' => $folder.$value,
395
+ 'url' => $http_folder.$value);
396
+ }
397
+
398
+ /*$count++;*/
399
+ $is_last = $count >= $field_count && !$has_product_fields ? true : false;
400
+ $last_row = $is_last ? " lastrow" : "";
401
+ break;
402
+ case "fileupload":
403
+
404
+ $value = RGFormsModel::get_lead_field_value($lead, $field);
405
+ $display = self::get_lead_field_display($field, $value, $lead["currency"]);
406
+
407
+ /*
408
+ * Get the absolute path to the upload
409
+ */
410
+ $path = str_replace(home_url().'/', ABSPATH, $display);
411
+
412
+ /* add path */
413
+ $form_array['field'][$field['id'].'_path'] = $path;
414
+ $form_array['field'][$field['id'].'.'.$field['label'].'_path'] = $path;
415
+
416
+ /* add data to field tag correctly */
417
+ $form_array['field'][$field['id'].'.'.$field['label']] = $display;
418
+
419
+ /* add ID incase want to use template on multiple duplicate forms with different field names */
420
+ $form_array['field'][$field['id']] = $display;
421
+
422
+ /* keep backwards compatibility */
423
+ $form_array['field'][$field['label']] = $display;
424
+
425
+
426
+ break;
427
+ case "list":
428
+ /*
429
+ * We want list to run both this and the deafult so don't call break.
430
+ * Get the list array and store it outside of [field]
431
+ */
432
+ $value = unserialize(RGFormsModel::get_lead_field_value($lead, $field));
433
+ $form_array['list'][$field['id']] = $value;
434
+
435
+ case "select":
436
+ case "multiselect":
437
+ case "radio":
438
+ $value = RGFormsModel::get_lead_field_value($lead, $field);
439
+
440
+ $display = self::get_lead_field_display($field, $value, $lead["currency"]);
441
+ /* add data to field tag correctly */
442
+ $form_array['field'][$field['id'].'.'.$field['label']] = $display;
443
+
444
+ /* add ID incase want to use template on multiple duplicate forms with different field names */
445
+ $form_array['field'][$field['id']] = $display;
446
+
447
+ /* keep backwards compatibility */
448
+ $form_array['field'][$field['label']] = $display;
449
+
450
+ /*
451
+ * Include the items correct names
452
+ */
453
+ $display = self::get_lead_field_display($field, $value, $lead["currency"], true);
454
+ /* add data to field tag correctly */
455
+ $form_array['field'][$field['id'].'.'.$field['label'].'_name'] = $display;
456
+
457
+ /* add ID incase want to use template on multiple duplicate forms with different field names */
458
+ $form_array['field'][$field['id'].'_name'] = $display;
459
+
460
+ /* keep backwards compatibility */
461
+ $form_array['field'][$field['label'].'_name'] = $display;
462
+ break;
463
+
464
+ default:
465
+ //ignore product fields as they will be grouped together at the end of the grid
466
+ if(GFCommon::is_product_field($field["type"])){
467
+ $has_product_fields = true;
468
+ continue;
469
+ }
470
+
471
+ $value = RGFormsModel::get_lead_field_value($lead, $field);
472
+
473
+ $display = self::get_lead_field_display($field, $value, $lead["currency"]);
474
+ /* add data to field tag correctly */
475
+ $form_array['field'][$field['id'].'.'.$field['label']] = $display;
476
+
477
+ /* add ID incase want to use template on multiple duplicate forms with different field names */
478
+ $form_array['field'][$field['id']] = $display;
479
+
480
+ /* keep backwards compatibility */
481
+ $form_array['field'][$field['label']] = $display;
482
+
483
+ break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
484
  }
485
+
 
 
 
 
 
 
 
 
 
 
 
486
  }
487
+
488
+ $products = array();
489
+ if($has_product_fields){
490
+ $products = GFCommon::get_product_fields($form, $lead, true);
491
+ if(!empty($products["products"])){
492
+ $total = 0;
493
+ $subtotal = 0;
494
+ foreach($products["products"] as $product) {
495
+ $price = GFCommon::to_number($product["price"]);
496
+
497
+ if(is_array(rgar($product,"options"))){
498
+ $count = sizeof($product["options"]);
499
+ $index = 1;
500
+ foreach($product["options"] as $option){
501
+ $price += GFCommon::to_number($option["price"]);
502
+ $index++;
503
+ }
504
+ }
505
+ /* calculate subtotal */
506
+ $subtotal = floatval($product["quantity"]) * $price;
507
+ $total += $subtotal;
508
+
509
+ $options = isset($product['options']) ? $product['options'] : '';
510
+
511
+ $form_array['products'][] = array(
512
+ 'name' => esc_html($product['name']),
513
+ 'price' => esc_html($product['price']),
514
+ 'options' => $options,
515
+ 'quantity' => $product["quantity"],
516
+ 'subtotal' => $subtotal);
517
+ }
518
+ $total += floatval($products["shipping"]["price"]);
519
+
520
+ /* add to form data */
521
+ $form_array['products_totals'] = array(
522
+ 'shipping' => $products["shipping"]["price"],
523
+ 'total' => $total
524
+ );
525
+ }
526
+ }
527
  return $form_array;
528
  }
529
+
530
+
531
+
532
+ public static function get_lead_field_display($field, $value, $currency="", $use_text=false, $format="html", $media="screen"){
533
+
534
  if($field['type'] == 'post_category')
535
+ $value = self::prepare_post_category_value($value, $field);
536
+
537
  switch(RGFormsModel::get_input_type($field)){
538
+ case "name" :
539
  if(is_array($value)){
540
+ $prefix = trim(rgget($field["id"] . ".2", $value));
541
+ $first = trim(rgget($field["id"] . ".3", $value));
542
+ $last = trim(rgget($field["id"] . ".6", $value));
543
+ $suffix = trim(rgget($field["id"] . ".8", $value));
544
+
545
+ return array('prefix' => $prefix, 'first' => $first, 'last' => $last, 'suffix' => $suffix);
 
546
  }
547
  else{
548
  return $value;
549
  }
550
+
551
  break;
552
+ case "creditcard" :
553
  if(is_array($value)){
554
+ $card_number = trim(rgget($field["id"] . ".1", $value));
555
+ $card_type = trim(rgget($field["id"] . ".4", $value));
556
+ $separator = $format == "html" ? "<br/>" : "\n";
557
+ return empty($card_number) ? "" : $card_type . $separator . $card_number;
558
  }
559
  else{
560
+ return "";
561
  }
562
  break;
563
+
564
+ case "address" :
565
  if(is_array($value)){
566
+ $street_value = trim(rgget($field["id"] . ".1", $value));
567
+ $street2_value = trim(rgget($field["id"] . ".2", $value));
568
+ $city_value = trim(rgget($field["id"] . ".3", $value));
569
+ $state_value = trim(rgget($field["id"] . ".4", $value));
570
+ $zip_value = trim(rgget($field["id"] . ".5", $value));
571
+ $country_value = trim(rgget($field["id"] . ".6", $value));
572
+
573
+ $line_break = $format == "html" ? "<br />" : "\n";
574
+
575
+ $address_display_format = apply_filters("gform_address_display_format", "default");
576
+
577
+ $address['street'] = $street_value;
578
+ $address['street2'] = $street2_value;
579
+ $address['city'] = $city_value;
580
+ $address['state'] = $state_value;
581
+ $address['zip'] = $zip_value;
582
+ $address['country'] = $country_value;
583
+
584
  return $address;
585
  }
586
  else{
587
+ return "";
588
  }
589
  break;
590
+
591
+ case "email" :
592
+ return GFCommon::is_valid_email($value) && $format == "html" ? $value : $value;
593
  break;
594
+
595
+ case "website" :
596
+ return GFCommon::is_valid_url($value) && $format == "html" ? $value : $value;
597
  break;
598
+
599
+ case "checkbox" :
600
  if(is_array($value)){
601
+
602
  $items = array();
603
+
604
  foreach($value as $key => $item){
605
+ if(!empty($item)){
 
 
 
 
 
 
 
 
 
606
  switch($format){
607
+ case "text" :
608
  $items[] = GFCommon::selection_display($item, $field, $currency, $use_text);
609
  break;
610
+
611
  default:
612
  $items[] = GFCommon::selection_display($item, $field, $currency, $use_text);
613
  break;
615
  }
616
  }
617
  if(empty($items)){
618
+ return "";
619
  }
620
+ else if($format == "text"){
621
  /*return substr($items, 0, strlen($items)-2); //removing last comma*/
622
  }
623
  else{
628
  return $value;
629
  }
630
  break;
631
+
632
+ case "post_image" :
633
+ $ary = explode("|:|", $value);
634
+ $url = count($ary) > 0 ? $ary[0] : "";
635
+ $title = count($ary) > 1 ? $ary[1] : "";
636
+ $caption = count($ary) > 2 ? $ary[2] : "";
637
+ $description = count($ary) > 3 ? $ary[3] : "";
638
+
639
  if(!empty($url)){
640
+ $url = str_replace(" ", "%20", $url);
641
+
642
+ $value = array('url' => $url,
643
  'path' => str_replace(site_url().'/', ABSPATH, $url),
644
  'title' => $title,
645
  'caption' => $caption,
646
  'description' => $description);
647
  }
648
  return $value;
649
+
650
+ case "fileupload" :
651
  $output_arr = array();
652
+ if(!empty($value)){
653
+ $file_paths = rgar($field,"multipleFiles") ? json_decode($value) : array($value);
654
  foreach($file_paths as $file_path){
655
+ $info = pathinfo($file_path);
656
+ $file_path = esc_attr(str_replace(" ", "%20", $file_path));
657
  $output_arr[] = $file_path;
658
  }
659
  $output = join(PHP_EOL, $output_arr);
660
  }
661
+ return $output_arr;
662
  break;
663
+
664
+ case "date" :
665
+ return GFCommon::date_display($value, rgar($field, "dateFormat"));
666
  break;
667
+
668
+ case "radio" :
669
+ case "select" :
670
  return GFCommon::selection_display($value, $field, $currency, $use_text);
671
  break;
672
+
673
+ case "multiselect" :
674
+ if(empty($value) || $format == "text")
675
  return $value;
676
+
677
+ $value = explode(",", $value);
678
+
679
  $items = '';
680
  foreach($value as $item){
681
  $items[] = GFCommon::selection_display($item, $field, $currency, $use_text);
682
  }
683
+
684
  if(sizeof($items) == 1)
685
  {
686
+ return $items[0];
687
  }
688
  return $items;
689
+
690
+
691
  break;
692
+
693
+ case "calculation" :
694
+ case "singleproduct" :
695
  if(is_array($value)){
696
+ $product_name = trim($value[$field["id"] . ".1"]);
697
+ $price = trim($value[$field["id"] . ".2"]);
698
+ $quantity = trim($value[$field["id"] . ".3"]);
699
+
700
+ $product = $product_name . ", " . __("Qty: ", "gravityforms") . $quantity . ", " . __("Price: ", "gravityforms") . $price;
 
701
  return $product;
702
  }
703
  else{
704
+ return "";
705
  }
706
  break;
707
+
708
+ case "number" :
709
+ return GFCommon::format_number($value, rgar($field, "numberFormat"));
710
  break;
711
+
712
+ case "singleshipping" :
713
+ case "donation" :
714
+ case "total" :
715
+ case "price" :
716
  return GFCommon::to_money($value, $currency);
717
+
718
+ case "list" :
719
  if(empty($value))
720
+ return "";
721
  $value = unserialize($value);
722
+
723
  $has_columns = is_array($value[0]);
724
+
725
+ if(!$has_columns){
726
  $items = array();
727
  foreach($value as $key => $item){
728
  if(!empty($item)){
729
  switch($format){
730
+ case "text" :
731
  $items[] = $item;
732
  break;
733
+ case "url" :
734
  $items[] = $item;
735
  break;
736
  default :
737
+ if($media == "email"){
738
  $items[] = $item;
739
  }
740
  else{
744
  }
745
  }
746
  }
747
+
748
  if(empty($items)){
749
+ return "";
750
  }
751
+ else if($format == "text"){
752
  /* return substr($items, 0, strlen($items)-2); //removing last comma*/
753
+ return $items;
754
  }
755
+ else if($format == "url"){
756
  /*return substr($items, 0, strlen($items)-1); //removing last comma*/
757
+ return $items;
758
  }
759
+ else if($media == "email"){
760
  return $items;
761
  }
762
+ else{
763
+ return $items;
 
 
 
 
 
 
 
764
  }
765
  }
766
  else if(is_array($value)){
767
  $columns = array_keys($value[0]);
768
+
769
+ $list = "";
770
+
771
  switch($format){
772
+ case "text" :
773
  $is_first_row = true;
774
  foreach($value as $item){
775
  if(!$is_first_row)
776
+ $list .= "\n\n" . $field["label"] . ": ";
777
+ $list .= implode(",", array_values($item));
778
+
779
  $is_first_row = false;
780
  }
781
  break;
782
+
783
+ case "url" :
784
  foreach($value as $item){
785
+ $list .= implode("|", array_values($item)) . ",";
786
  }
787
  if(!empty($list))
788
  $list = substr($list, 0, strlen($list)-1);
789
  break;
790
+
791
  default :
792
+ if($media == "email"){
793
+ $list = "<table autosize='1' class='gfield_list' style='border-top: 1px solid #DFDFDF; border-left: 1px solid #DFDFDF; border-spacing: 0; padding: 0; margin: 2px 0 6px; width: 100%'><thead><tr>";
794
+
 
795
  //reading columns from entry data
796
  foreach($columns as $column){
797
+ $list .= "<th style='background-image: none; border-right: 1px solid #DFDFDF; border-bottom: 1px solid #DFDFDF; padding: 6px 10px; font-family: sans-serif; font-size: 12px; font-weight: bold; background-color: #F1F1F1; color:#333; text-align:left'>" . esc_html($column) . "</th>";
798
  }
799
+ $list .= "</tr></thead>";
800
+
801
+ $list .= "<tbody style='background-color: #F9F9F9'>";
802
  foreach($value as $item){
803
+ $list .= "<tr>";
804
  foreach($columns as $column){
805
  $val = rgar($item, $column);
806
+ $list .= "<td style='padding: 6px 10px; border-right: 1px solid #DFDFDF; border-bottom: 1px solid #DFDFDF; border-top: 1px solid #FFF; font-family: sans-serif; font-size:12px;'>{$val}</td>";
807
  }
808
+
809
+ $list .="</tr>";
810
  }
811
+
812
+ $list .="</tbody></table>";
813
  }
814
  else{
815
+ $list = "<table class='gfield_list' autosize='1'><thead><tr>";
816
+
817
  //reading columns from entry data
818
  foreach($columns as $column){
819
+ $list .= "<th>" . esc_html($column) . "</th>";
820
  }
821
+ $list .= "</tr></thead>";
822
+
823
+ $list .= "<tbody>";
824
  foreach($value as $item){
825
+ $list .= "<tr>";
826
  foreach($columns as $column){
827
  $val = rgar($item, $column);
828
+ $list .= "<td>".htmlspecialchars($val)."</td>";
829
  }
830
+
831
+ $list .="</tr>";
832
  }
833
+
834
+ $list .="</tbody></table>";
835
  }
836
  break;
837
  }
838
+
839
  return $list;
840
  }
841
+ return "";
842
  break;
843
+
844
  default :
845
  if (!is_array($value))
846
  {
848
  }
849
  break;
850
  }
851
+ }
852
+
853
+ function pdf_get_lead_field_display($field, $value, $currency="", $use_text=false, $format="html", $media="screen"){
854
+
855
  if($field['type'] == 'post_category')
856
+ $value = self::prepare_post_category_value($value, $field);
857
+
858
  switch(RGFormsModel::get_input_type($field)){
859
+ case "name" :
860
  if(is_array($value)){
861
+ $prefix = trim(rgget($field["id"] . ".2", $value));
862
+ $first = trim(rgget($field["id"] . ".3", $value));
863
+ $last = trim(rgget($field["id"] . ".6", $value));
864
+ $suffix = trim(rgget($field["id"] . ".8", $value));
865
+
866
+ $name = $prefix;
867
+ $name .= !empty($name) && !empty($first) ? " $first" : $first;
868
+ $name .= !empty($name) && !empty($last) ? " $last" : $last;
869
+ $name .= !empty($name) && !empty($suffix) ? " $suffix" : $suffix;
870
+
 
 
871
  return $name;
872
  }
873
  else{
874
  return $value;
875
  }
876
+
877
  break;
878
+ case "creditcard" :
879
  if(is_array($value)){
880
+ $card_number = trim(rgget($field["id"] . ".1", $value));
881
+ $card_type = trim(rgget($field["id"] . ".4", $value));
882
+ $separator = $format == "html" ? "<br/>" : "\n";
883
+ return empty($card_number) ? "" : $card_type . $separator . $card_number;
884
  }
885
  else{
886
+ return "";
887
  }
888
  break;
889
+
890
+ case "address" :
891
  if(is_array($value)){
892
+ $street_value = trim(rgget($field["id"] . ".1", $value));
893
+ $street2_value = trim(rgget($field["id"] . ".2", $value));
894
+ $city_value = trim(rgget($field["id"] . ".3", $value));
895
+ $state_value = trim(rgget($field["id"] . ".4", $value));
896
+ $zip_value = trim(rgget($field["id"] . ".5", $value));
897
+ $country_value = trim(rgget($field["id"] . ".6", $value));
898
+
899
+ $line_break = $format == "html" ? "<br />" : "\n";
900
+
901
+ $address_display_format = apply_filters("gform_address_display_format", "default");
902
+ if($address_display_format == "zip_before_city"){
903
  /*
904
  Sample:
905
  3333 Some Street
907
  2344 City, State
908
  Country
909
  */
910
+
911
  $addr_ary = array();
912
  $addr_ary[] = $street_value;
913
+
914
  if(!empty($street2_value))
915
  $addr_ary[] = $street2_value;
916
+
917
+ $zip_line = trim($zip_value . " " . $city_value);
918
  $zip_line .= !empty($zip_line) && !empty($state_value) ? ", {$state_value}" : $state_value;
919
  $zip_line = trim($zip_line);
920
  if(!empty($zip_line))
921
  $addr_ary[] = $zip_line;
922
+
923
  if(!empty($country_value))
924
  $addr_ary[] = $country_value;
925
+
926
+ $address = implode("<br />", $addr_ary);
927
+
928
  }
929
  else{
930
  $address = $street_value;
934
  $address .= !empty($address) && !empty($zip_value) ? " $zip_value" : $zip_value;
935
  $address .= !empty($address) && !empty($country_value) ? $line_break . $country_value : $country_value;
936
  }
937
+
938
  return $address;
939
  }
940
  else{
941
+ return "";
942
  }
943
  break;
944
+
945
+ case "email" :
946
+ return GFCommon::is_valid_email($value) && $format == "html" ? "<a href='mailto:$value'>$value</a>" : $value;
947
  break;
948
+
949
+ case "website" :
950
+ return GFCommon::is_valid_url($value) && $format == "html" ? "<a href='$value' target='_blank'>$value</a>" : $value;
951
  break;
952
+
953
+ case "checkbox" :
954
  if(is_array($value)){
955
+
956
  $items = '';
957
+
958
  foreach($value as $key => $item){
959
  if(!empty($item)){
960
  switch($format){
961
+ case "text" :
962
+ $items .= GFCommon::selection_display($item, $field, $currency, true) . ", ";
963
  break;
964
+
965
  default:
966
+ $items .= "<li>" . GFCommon::selection_display($item, $field, $currency, true) . "</li>";
967
  break;
968
  }
969
  }
970
  }
971
  if(empty($items)){
972
+ return "";
973
  }
974
+ else if($format == "text"){
975
  return substr($items, 0, strlen($items)-2); //removing last comma
976
  }
977
  else{
978
+ return "<ul class='bulleted'>$items</ul>";
979
  }
980
  }
981
  else{
982
  return $value;
983
  }
984
  break;
985
+
986
+ case "post_image" :
987
+ $ary = explode("|:|", $value);
988
+ $url = count($ary) > 0 ? $ary[0] : "";
989
+ $title = count($ary) > 1 ? $ary[1] : "";
990
+ $caption = count($ary) > 2 ? $ary[2] : "";
991
+ $description = count($ary) > 3 ? $ary[3] : "";
992
+
993
  if(!empty($url)){
994
+ $url = str_replace(" ", "%20", $url);
995
  switch($format){
996
+ case "text" :
997
  $value = $url;
998
+ $value .= !empty($title) ? "\n\n" . $field["label"] . " (" . __("Title", "gravityforms") . "): " . $title : "";
999
+ $value .= !empty($caption) ? "\n\n" . $field["label"] . " (" . __("Caption", "gravityforms") . "): " . $caption : "";
1000
+ $value .= !empty($description) ? "\n\n" . $field["label"] . " (" . __("Description", "gravityforms") . "): " . $description : "";
1001
  break;
1002
+
1003
  default :
1004
+ $path = str_replace(site_url().'/', ABSPATH, $url);
1005
  $value = "<a href='$url' target='_blank' title='" . __("Click to view", "gravityforms") . "'><img src='$path' width='100' /></a>";
1006
  $value .= !empty($title) ? "<div>Title: $title</div>" : "";
1007
  $value .= !empty($caption) ? "<div>Caption: $caption</div>" : "";
1008
  $value .= !empty($description) ? "<div>Description: $description</div>": "";
1009
+
1010
  break;
1011
  }
1012
  }
1013
  return $value;
1014
+
1015
+ case "fileupload" :
1016
  $output = '';
1017
+ $output_arr = array();
1018
+ if(!empty($value)){
1019
+ $output .= "<ul>";
1020
+ $file_paths = rgar($field,"multipleFiles") ? json_decode($value) : array($value);
1021
  foreach($file_paths as $file_path){
1022
  $info = pathinfo($file_path);
1023
+ $file_path = esc_attr(str_replace(" ", "%20", $file_path));
1024
+ $output_arr[] = "<li><a href='$file_path' target='_blank' title='" . __("Click to view", "gravityforms") . "'>" . $info["basename"] . "</a></li>";
1025
  }
1026
  $output .= join(PHP_EOL, $output_arr);
1027
+ $output .= "</ul>";
1028
  }
1029
+
1030
+ return $output;
1031
  break;
1032
+
1033
+ case "date" :
1034
+ return GFCommon::date_display($value, rgar($field, "dateFormat"));
1035
  break;
1036
+
1037
+ case "radio" :
1038
+ case "select" :
1039
  return GFCommon::selection_display($value, $field, $currency, true);
1040
  break;
1041
+
1042
+ case "multiselect" :
1043
+ if(empty($value) || $format == "text")
1044
  return $value;
1045
+
1046
+ $value = explode(",", $value);
1047
+
1048
  $items = '';
1049
  foreach($value as $item){
1050
+ $items .= "<li>" . GFCommon::selection_display($item, $field, $currency, true) . "</li>";
1051
  }
1052
+
1053
+ return "<ul class='bulleted'>{$items}</ul>";
1054
+
1055
  break;
1056
+
1057
+ case "calculation" :
1058
+ case "singleproduct" :
1059
  if(is_array($value)){
1060
+ $product_name = trim($value[$field["id"] . ".1"]);
1061
+ $price = trim($value[$field["id"] . ".2"]);
1062
+ $quantity = trim($value[$field["id"] . ".3"]);
1063
+
1064
+ $product = $product_name . ", " . __("Qty: ", "gravityforms") . $quantity . ", " . __("Price: ", "gravityforms") . $price;
1065
  return $product;
1066
  }
1067
  else{
1068
+ return "";
1069
  }
1070
  break;
1071
+
1072
+ case "number" :
1073
+ return GFCommon::format_number($value, rgar($field, "numberFormat"));
1074
  break;
1075
+
1076
+ case "singleshipping" :
1077
+ case "donation" :
1078
+ case "total" :
1079
+ case "price" :
1080
  return GFCommon::to_money($value, $currency);
1081
+
1082
+ case "list" :
1083
  if(empty($value))
1084
+ return "";
1085
  $value = unserialize($value);
1086
+
1087
  $has_columns = is_array($value[0]);
1088
+
1089
  if(!$has_columns){
1090
  $items = '';
1091
  foreach($value as $key => $item){
1092
  if(!empty($item)){
1093
  switch($format){
1094
+ case "text" :
1095
+ $items .= $item . ", ";
1096
  break;
1097
+ case "url" :
1098
+ $items .= $item . ",";
1099
  break;
1100
  default :
1101
+ if($media == "email"){
1102
+ $items .= "<li>".htmlspecialchars($item)."</li>";
1103
  }
1104
  else{
1105
+ $items .= "<li>".htmlspecialchars($item)."</li>";
1106
  }
1107
  break;
1108
  }
1109
  }
1110
  }
1111
+
1112
  if(empty($items)){
1113
+ return "";
1114
  }
1115
+ else if($format == "text"){
1116
  return substr($items, 0, strlen($items)-2); //removing last comma
1117
  }
1118
+ else if($format == "url"){
1119
  return substr($items, 0, strlen($items)-1); //removing last comma
1120
  }
1121
+ else if($media == "email"){
1122
+ return "<ul class='bulleted'>{$items}</ul>";
1123
+ }
1124
  else{
1125
+ return "<ul class='bulleted'>{$items}</ul>";
1126
  }
1127
  }
1128
  else if(is_array($value)){
1129
  $columns = array_keys($value[0]);
1130
+
1131
+ $list = "";
1132
+
1133
  switch($format){
1134
+ case "text" :
1135
  $is_first_row = true;
1136
  foreach($value as $item){
1137
  if(!$is_first_row)
1138
+ $list .= "\n\n" . $field["label"] . ": ";
1139
+ $list .= implode(",", array_values($item));
1140
+
1141
  $is_first_row = false;
1142
  }
1143
  break;
1144
+
1145
+ case "url" :
1146
  foreach($value as $item){
1147
+ $list .= implode("|", array_values($item)) . ",";
1148
  }
1149
  if(!empty($list))
1150
  $list = substr($list, 0, strlen($list)-1);
1151
  break;
1152
+
1153
  default :
1154
+ if($media == "email"){
1155
+ $list = "<table autosize='1' class='gfield_list' style='border-top: 1px solid #DFDFDF; border-left: 1px solid #DFDFDF; border-spacing: 0; padding: 0; margin: 2px 0 6px; width: 100%'><thead><tr>";
1156
+
1157
  //reading columns from entry data
1158
  foreach($columns as $column){
1159
+ $list .= "<th style='background-image: none; border-right: 1px solid #DFDFDF; border-bottom: 1px solid #DFDFDF; padding: 6px 10px; font-family: sans-serif; font-size: 12px; font-weight: bold; background-color: #F1F1F1; color:#333; text-align:left'>" . esc_html($column) . "</th>";
1160
  }
1161
+ $list .= "</tr></thead>";
1162
+
1163
+ $list .= "<tbody style='background-color: #F9F9F9'>";
1164
  foreach($value as $item){
1165
+ $list .= "<tr>";
1166
  foreach($columns as $column){
1167
  $val = rgar($item, $column);
1168
+ $list .= "<td style='padding: 6px 10px; border-right: 1px solid #DFDFDF; border-bottom: 1px solid #DFDFDF; border-top: 1px solid #FFF; font-family: sans-serif; font-size:12px;'>{$val}</td>";
1169
  }
1170
+
1171
+ $list .="</tr>";
1172
  }
1173
+
1174
+ $list .="</tbody></table>";
1175
  }
1176
  else{
1177
+ $list = "<table autosize='1' class='gfield_list'><thead><tr>";
1178
+
1179
  //reading columns from entry data
1180
  foreach($columns as $column){
1181
+ $list .= "<th>" . esc_html($column) . "</th>";
1182
  }
1183
+ $list .= "</tr></thead>";
1184
+
1185
+ $list .= "<tbody>";
1186
  foreach($value as $item){
1187
+ $list .= "<tr>";
1188
  foreach($columns as $column){
1189
  $val = rgar($item, $column);
1190
+ $list .= "<td>".htmlspecialchars($val)."</td>";
1191
  }
1192
+
1193
+ $list .="</tr>";
1194
  }
1195
+
1196
+ $list .="</tbody></table>";
1197
  }
1198
  break;
1199
  }
1200
+
1201
  return $list;
1202
  }
1203
+ return "";
1204
  break;
1205
+
1206
  default :
1207
  if (!is_array($value))
1208
  {
1211
  break;
1212
  }
1213
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1214
  }
1215
  }
helper/pdf-render.php CHANGED
@@ -8,9 +8,9 @@ class PDFRender
8
  * var $form_id integer: The form id
9
  * var $lead_id integer: The entry id
10
  * var $output string: either view, save or download
11
- * save will save a copy of the PDF to the server using the $gfpdfe_data->template_save_location variable
12
  * var $return boolean: if set to true
13
- * it will return the path of the saved PDF
14
  * var $template string: if you want to use multiple PDF templates - name of the template file
15
  * var $pdfname string: allows you to pass a custom PDF name to the generator e.g. 'Application Form.pdf' (ensure .pdf is appended to the filename)
16
  * var $fpdf boolean: custom hook to allow the FPDF engine to generate PDFs instead of DOMPDF. Premium Paid Feature.
@@ -42,12 +42,12 @@ class PDFRender
42
  /*
43
  * Check if the PDF exists and if this function has already run this season
44
  */
45
- if(in_array($lead_id, $pdf_creator) && file_exists($gfpdfe_data->template_save_location . $id . '/' . $filename))
46
- {
47
  /*
48
  * Don't generate a new PDF, use the existing one
49
  */
50
- return $gfpdfe_data->template_save_location . $id . '/' . $filename;
51
  }
52
 
53
  /*
@@ -60,16 +60,14 @@ class PDFRender
60
  * Used in premium plugins
61
  * return true to cancel, otherwise run.
62
  */
63
- $return = apply_filters("gfpdfe_pre_load_template", $form_id, $lead_id, $template, $id, $output, $filename, $arguments);
64
 
65
  if($return !== true)
66
  {
67
  /*
68
- * Get the template HTML file
69
- * v3.4.0 allows mergetags to be used in PDF templates
70
  */
71
- $raw_entry = $this->load_entry_data($template);
72
- $entry = apply_filters("gfpdfe_pdf_template_{$form_id}", apply_filters('gfpdfe_pdf_template', $raw_entry, $form_id, $lead_id, $arguments), $lead_id, $arguments);
73
 
74
  /*
75
  * Output HTML version and return if user requested a HTML version
@@ -85,7 +83,7 @@ class PDFRender
85
  */
86
  if(strlen($entry) > 0)
87
  {
88
- return $this->PDF_processing($entry, $filename, $id, $output, $arguments, $form_id, $lead_id);
89
  }
90
 
91
  return false;
@@ -99,30 +97,28 @@ class PDFRender
99
  /**
100
  * Loads the Gravity Form output script (actually the print preview)
101
  */
102
- private function load_entry_data($template)
103
  {
104
- global $gfpdfe_data;
105
-
106
  /* set up contstants for gravity forms to use so we can override the security on the printed version */
107
- if(file_exists( $gfpdfe_data->template_site_location . $template))
108
- {
109
- return PDF_Common::get_html_template($gfpdfe_data->template_site_location . $template);
110
  }
111
  else
112
  {
113
  /*
114
  * Check if template file exists in the plugin's core template folder
115
  */
116
- if(file_exists( PDF_PLUGIN_DIR . 'templates/' . $template))
117
  {
118
- return PDF_Common::get_html_template( PDF_PLUGIN_DIR . 'initialisation/templates/' . $template);
119
  }
120
  /*
121
  * If template not found then we will resort to the default template.
122
  */
123
  else
124
- {
125
- return PDF_Common::get_html_template(PDF_PLUGIN_DIR . 'initialisation/templates/' . PDFGenerator::$default['template']);
126
  }
127
  }
128
  }
@@ -131,7 +127,7 @@ class PDFRender
131
  /**
132
  * Creates the PDF and does a specific output (see PDF_Generator function above for $output variable types)
133
  */
134
- public function PDF_processing($html, $filename, $id, $output = 'view', $arguments, $form_id, $lead_id)
135
  {
136
  /*
137
  * DOMPDF replaced with mPDF in v3.0.0
@@ -140,11 +136,11 @@ class PDFRender
140
  */
141
  if(!class_exists('mPDF'))
142
  {
143
- if(defined('PDF_ENABLE_MPDF_TINY') && PDF_ENABLE_MPDF_TINY === true)
144
  {
145
  include PDF_PLUGIN_DIR .'/mPDF/mpdf-extra-lite.php';
146
  }
147
- elseif(defined('PDF_ENABLE_MPDF_LITE') && PDF_ENABLE_MPDF_LITE === true)
148
  {
149
  include PDF_PLUGIN_DIR .'/mPDF/mpdf-lite.php';
150
  }
@@ -169,13 +165,7 @@ class PDFRender
169
  $orientation = ($arguments['orientation'] == 'landscape') ? 'L' : 'P';
170
  }
171
 
172
- $mpdf = new mPDF('', $paper_size, 0, '', 15, 15, 16, 16, 9, 9, $orientation);
173
-
174
- /*
175
- * Add filter to allow the $mpdf object to be modified right after the class is created.
176
- * Because $mpdf is a class it is automatically passed by reference and doesn't need to be assigned
177
- */
178
- apply_filters('gfpdfe_mpdf_class', $mpdf, $form_id, $lead_id, $arguments, $output, $filename);
179
 
180
  /*
181
  * Display PDF is full-page mode which allows the entire PDF page to be viewed
@@ -187,22 +177,13 @@ class PDFRender
187
  * Automatically detect fonts and substitue as needed
188
  */
189
  $mpdf->SetAutoFont(AUTOFONT_ALL);
190
- (defined('PDF_DISABLE_FONT_SUBSTITUTION') && PDF_DISABLE_FONT_SUBSTITUTION === false) ? $mpdf->useSubstitutions = true : $mpdf->useSubstitutions = false;
191
 
192
  /*
193
  * Set Creator Meta Data
194
- */
195
- $mpdf->SetCreator('Gravity PDF v' . PDF_EXTENDED_VERSION . '. https://gravitypdf.com');
196
-
197
- /*
198
- * Set PDF DPI if added to configuration node
199
  */
200
- if($arguments['dpi'] !== false)
201
- {
202
- /* TEXT DPI dramatically decreases the text size. As text is a vector element of the document we will only be concerned with the image DPI for the moment */
203
- /*$mpdf->dpi = $arguments['dpi'];*/
204
- $mpdf->img_dpi = $arguments['dpi'];
205
- }
206
 
207
  /*
208
  * Set RTL languages at user request
@@ -215,50 +196,18 @@ class PDFRender
215
  /*
216
  * Set up security if user requested
217
  */
218
- if($arguments['security'] === true && $arguments['pdfa1b'] === false && $arguments['pdfx1a'] === false )
219
  {
220
- $password = (strlen($arguments['pdf_password']) > 0) ? $arguments['pdf_password'] : '';
221
- $master_password = (strlen($arguments['pdf_master_password']) > 0) ? $arguments['pdf_master_password'] : null;
222
- $pdf_privileges = (is_array($arguments['pdf_privileges'])) ? $arguments['pdf_privileges'] : array();
223
 
224
  $mpdf->SetProtection($pdf_privileges, $password, $master_password, 128);
225
  }
226
-
227
- /* PDF/A1-b support added in v3.4.0 */
228
- if($arguments['pdfa1b'] === true)
229
- {
230
- $mpdf->PDFA = true;
231
- $mpdf->PDFAauto = true;
232
- }
233
- else if($arguments['pdfx1a'] === true) /* PDF/X-1a support added in v3.4.0 */
234
- {
235
- $mpdf->PDFX = true;
236
- $mpdf->PDFXauto = true;
237
- }
238
-
239
- /*
240
- * Check if we should auto prompt to print the document on open
241
- */
242
- if(isset($_GET['print']))
243
- {
244
- $mpdf->SetJS('this.print();');
245
- }
246
 
247
 
248
  /* load HTML block */
249
- $mpdf->WriteHTML($html);
250
-
251
- /*
252
- * Allow the $mpdf object to be modified now all the settings have been applied
253
- */
254
- apply_filters('gfpdfe_mpdf_class_pre_render', $mpdf, $form_id, $lead_id, $arguments, $output, $filename);
255
- apply_filters('gfpdfe_pre_render_pdf', $mpdf, $form_id, $lead_id, $arguments, $output, $filename); /* left in for backwards compatiblity */
256
-
257
- /*
258
- * Add pre-render/save filter so PDF can be manipulated further
259
- */
260
- $output = apply_filters('gfpdfe_pdf_output_type', $output);
261
- $filename = apply_filters('gfpdfe_pdf_filename', $filename);
262
 
263
  switch($output)
264
  {
@@ -277,12 +226,8 @@ class PDFRender
277
  * PDF wasn't writing to file with the F method - http://mpdf1.com/manual/index.php?tid=125
278
  * Return as a string and write to file manually
279
  */
280
- $pdf = $mpdf->Output('', 'S');
281
- $filename = $this->savePDF($pdf, $filename, $id);
282
-
283
- do_action('gfpdf_post_pdf_save', $form_id, $lead_id, $arguments, $filename);
284
-
285
- return $filename;
286
  break;
287
  }
288
  }
@@ -294,26 +239,23 @@ class PDFRender
294
  */
295
  public function savePDF($pdf, $filename, $id)
296
  {
297
- global $gfpdfe_data;
298
-
299
  /* create unique folder for PDFs */
300
- if(!is_dir( $gfpdfe_data->template_save_location . $id))
301
  {
302
- if(!mkdir( $gfpdfe_data->template_save_location . $id))
303
  {
304
- trigger_error('Could not create PDF folder in '. $gfpdfe_data->template_save_location . $id, E_USER_WARNING);
305
  return;
306
  }
307
  }
308
 
309
- $pdf_save = $gfpdfe_data->template_save_location . $id . '/' . $filename;
310
 
311
  if(!file_put_contents($pdf_save, $pdf))
312
  {
313
  trigger_error('Could not save PDF to '. $pdf_save, E_USER_WARNING);
314
  return;
315
- }
316
-
317
  return $pdf_save;
318
  }
319
  }
8
  * var $form_id integer: The form id
9
  * var $lead_id integer: The entry id
10
  * var $output string: either view, save or download
11
+ * save will save a copy of the PDF to the server using the PDF_SAVE_LOCATION constant
12
  * var $return boolean: if set to true
13
+ it will return the path of the saved PDF
14
  * var $template string: if you want to use multiple PDF templates - name of the template file
15
  * var $pdfname string: allows you to pass a custom PDF name to the generator e.g. 'Application Form.pdf' (ensure .pdf is appended to the filename)
16
  * var $fpdf boolean: custom hook to allow the FPDF engine to generate PDFs instead of DOMPDF. Premium Paid Feature.
42
  /*
43
  * Check if the PDF exists and if this function has already run this season
44
  */
45
+ if(in_array($lead_id, $pdf_creator) && file_exists(PDF_SAVE_LOCATION.$id.'/'. $filename))
46
+ {
47
  /*
48
  * Don't generate a new PDF, use the existing one
49
  */
50
+ return PDF_SAVE_LOCATION.$id.'/'. $filename;
51
  }
52
 
53
  /*
60
  * Used in premium plugins
61
  * return true to cancel, otherwise run.
62
  */
63
+ $return = apply_filters('gfpdfe_pre_load_template', $form_id, $lead_id, $template, $id, $output, $filename, $arguments);
64
 
65
  if($return !== true)
66
  {
67
  /*
68
+ * Get the tempalte HTML file
 
69
  */
70
+ $entry = $this->load_entry_data($form_id, $lead_id, $template);
 
71
 
72
  /*
73
  * Output HTML version and return if user requested a HTML version
83
  */
84
  if(strlen($entry) > 0)
85
  {
86
+ return $this->PDF_processing($entry, $filename, $id, $output, $arguments);
87
  }
88
 
89
  return false;
97
  /**
98
  * Loads the Gravity Form output script (actually the print preview)
99
  */
100
+ private function load_entry_data($form_id, $lead_id, $template)
101
  {
 
 
102
  /* set up contstants for gravity forms to use so we can override the security on the printed version */
103
+ if(file_exists(PDF_TEMPLATE_LOCATION.$template))
104
+ {
105
+ return PDF_Common::get_html_template(PDF_TEMPLATE_LOCATION.$template);
106
  }
107
  else
108
  {
109
  /*
110
  * Check if template file exists in the plugin's core template folder
111
  */
112
+ if(file_exists(PDF_PLUGIN_DIR."templates/" . $template))
113
  {
114
+ return PDF_Common::get_html_template(PDF_PLUGIN_DIR."templates/" . $template);
115
  }
116
  /*
117
  * If template not found then we will resort to the default template.
118
  */
119
  else
120
+ {
121
+ return PDF_Common::get_html_template(PDF_PLUGIN_DIR."templates/" . PDFGenerator::$default['template']);
122
  }
123
  }
124
  }
127
  /**
128
  * Creates the PDF and does a specific output (see PDF_Generator function above for $output variable types)
129
  */
130
+ public function PDF_processing($html, $filename, $id, $output = 'view', $arguments)
131
  {
132
  /*
133
  * DOMPDF replaced with mPDF in v3.0.0
136
  */
137
  if(!class_exists('mPDF'))
138
  {
139
+ if(PDF_ENABLE_MPDF_TINY === true)
140
  {
141
  include PDF_PLUGIN_DIR .'/mPDF/mpdf-extra-lite.php';
142
  }
143
+ elseif(PDF_ENABLE_MPDF_LITE === true)
144
  {
145
  include PDF_PLUGIN_DIR .'/mPDF/mpdf-lite.php';
146
  }
165
  $orientation = ($arguments['orientation'] == 'landscape') ? 'L' : 'P';
166
  }
167
 
168
+ $mpdf = new mPDF('', $paper_size, 0, '', 15, 15, 16, 16, 9, 9, $orientation);
 
 
 
 
 
 
169
 
170
  /*
171
  * Display PDF is full-page mode which allows the entire PDF page to be viewed
177
  * Automatically detect fonts and substitue as needed
178
  */
179
  $mpdf->SetAutoFont(AUTOFONT_ALL);
180
+ $mpdf->useSubstitutions = true;
181
 
182
  /*
183
  * Set Creator Meta Data
 
 
 
 
 
184
  */
185
+
186
+ $mpdf->SetCreator('Gravity Forms PDF Extended v'. PDF_EXTENDED_VERSION.'. http://gravityformspdfextended.com');
 
 
 
 
187
 
188
  /*
189
  * Set RTL languages at user request
196
  /*
197
  * Set up security if user requested
198
  */
199
+ if($arguments['security'] === true)
200
  {
201
+ $password = (strlen($arguments['pdf_password']) > 0) ? $arguments['pdf_password'] : '';
202
+ $master_password = (strlen($arguments['pdf_password']) > 0) ? $arguments['pdf_password'] : null;
203
+ $pdf_privileges = (is_array($arguments['pdf_privileges'])) ? $arguments['pdf_privileges'] : array();
204
 
205
  $mpdf->SetProtection($pdf_privileges, $password, $master_password, 128);
206
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
207
 
208
 
209
  /* load HTML block */
210
+ $mpdf->WriteHTML($html);
 
 
 
 
 
 
 
 
 
 
 
 
211
 
212
  switch($output)
213
  {
226
  * PDF wasn't writing to file with the F method - http://mpdf1.com/manual/index.php?tid=125
227
  * Return as a string and write to file manually
228
  */
229
+ $pdf = $mpdf->Output('', 'S');
230
+ return $this->savePDF($pdf, $filename, $id);
 
 
 
 
231
  break;
232
  }
233
  }
239
  */
240
  public function savePDF($pdf, $filename, $id)
241
  {
 
 
242
  /* create unique folder for PDFs */
243
+ if(!is_dir(PDF_SAVE_LOCATION.$id))
244
  {
245
+ if(!mkdir(PDF_SAVE_LOCATION.$id))
246
  {
247
+ trigger_error('Could not create PDF folder in '. PDF_SAVE_LOCATION.$id, E_USER_WARNING);
248
  return;
249
  }
250
  }
251
 
252
+ $pdf_save = PDF_SAVE_LOCATION.$id.'/'. $filename;
253
 
254
  if(!file_put_contents($pdf_save, $pdf))
255
  {
256
  trigger_error('Could not save PDF to '. $pdf_save, E_USER_WARNING);
257
  return;
258
+ }
 
259
  return $pdf_save;
260
  }
261
  }
initialisation/configuration.php.example CHANGED
@@ -1,9 +1,9 @@
1
  <?php
2
 
3
  /*
4
- * Gravity PDF Configuration
5
  * New from v3.0.0. No longer is theme functions.php code required.
6
- * Important documentation on the configuration found at https://developer.gravitypdf.com/documentation/getting-started-with-gravity-pdf-configuration/
7
  */
8
 
9
  /*
@@ -31,7 +31,7 @@
31
  */
32
  /*$gf_pdf_config[] = array(
33
  'form_id' => 1,
34
- 'notifications' => true,
35
  );*/
36
 
37
  /*
@@ -50,28 +50,28 @@
50
 
51
  /*$gf_pdf_config[] = array(
52
  'form_id' => 1,
53
- 'template' => 'default-template.php',
54
- 'default-show-html' => true,
55
  );*/
56
 
57
  /*$gf_pdf_config[] = array(
58
  'form_id' => 1,
59
- 'template' => 'default-template.php',
60
- 'default-show-empty' => true,
61
  );*/
62
 
63
  /*$gf_pdf_config[] = array(
64
  'form_id' => 1,
65
- 'template' => 'default-template.php',
66
- 'default-show-page-names' => true,
67
  );*/
68
 
69
  /*$gf_pdf_config[] = array(
70
  'form_id' => 1,
71
- 'template' => 'default-template.php',
72
- 'default-show-html' => true,
73
- 'default-show-empty' => true,
74
- 'default-show-page-names' => true,
75
  );*/
76
 
77
  /*
@@ -82,12 +82,12 @@
82
  */
83
  /*$gf_pdf_config[] = array(
84
  'form_id' => 1,
85
- 'notifications' => 'Admin Notification',
86
  );*/
87
 
88
  /*$gf_pdf_config[] = array(
89
  'form_id' => '1',
90
- 'notifications' => array('Admin Notification', 'User Notification'),
91
  );*/
92
 
93
  /*
@@ -95,19 +95,34 @@
95
  * Custom Template
96
  * Don't want to use a custom template? Just pass the custom template name to the configuration.
97
  * template String. Default default-template.php. The name of your custom template that's placed in your active theme's PDF_EXTENDED_TEMPLATES folder.
98
- * For more information about creating custom templates please see https://developer.gravitypdf.com/documentation/custom-templates-introduction/
99
  */
100
  /*$gf_pdf_config[] = array(
101
  'form_id' => 1,
102
- 'notifications' => 'User Notification',
103
- 'template' => 'example-float-and-positioning05.php',
 
104
  );*/
105
 
106
  /*$gf_pdf_config[] = array(
107
  'form_id' => 2,
108
- 'notifications' => 'User Notification',
109
- 'template' => 'example-basic-html01.php',
 
110
  );*/
 
 
 
 
 
 
 
 
 
 
 
 
 
111
 
112
  /*
113
  * ------------------------------------------------------------
@@ -117,15 +132,15 @@
117
  * filename String. Default form-{form_id}-entry-{entry_id}.pdf
118
  */
119
  /*$gf_pdf_config[] = array(
120
- 'form_id' => 1,
121
- 'notifications' => true,
122
- 'filename' => 'New PDF Name.pdf',
123
  );*/
124
 
125
  /*$gf_pdf_config[] = array(
126
- 'form_id' => '1',
127
- 'notifications' => true,
128
- 'filename' => 'User {Name:1}.pdf',
129
  );*/
130
 
131
  /*
@@ -146,27 +161,27 @@
146
 
147
  /* Letter-sized Document */
148
  /*$gf_pdf_config[] = array(
149
- 'form_id' => 1,
150
- 'notifications' => true,
151
-
152
- 'pdf_size' => 'letter',
153
  );*/
154
 
155
  /* Custom PDF Size */
156
  /* $gf_pdf_config[] = array(
157
- 'form_id' => 1,
158
- 'notifications' => true,
159
-
160
- 'pdf_size' => array(50, 200),
161
- );*/
162
-
163
- /* Change orientation */
164
- /* $gf_pdf_config[] = array(
165
- 'form_id' => 1,
166
- 'notifications' => true,
167
-
168
- 'pdf_size' => 'letter',
169
- 'orientation' => 'landscape',
170
  );*/
171
 
172
  /*
@@ -190,13 +205,13 @@
190
  * Setting security settings with all values
191
  */
192
  /*$gf_pdf_config[] = array(
193
- 'form_id' => 1,
194
- 'notifications' => true,
195
-
196
- 'security' => true,
197
- 'pdf_password' => 'myPDFpass',
198
- 'pdf_privileges' => array('copy', 'print', 'modify', 'annot-forms', 'fill-forms', 'extract', 'assemble', 'print-highres'),
199
- 'pdf_master_password' => 'admin password',
200
  );*/
201
 
202
  /*
@@ -205,11 +220,11 @@
205
  * Random master password will be generated
206
  */
207
  /*$gf_pdf_config[] = array(
208
- 'form_id' => 1,
209
- 'notifications' => true,
210
-
211
- 'security' => true,
212
- 'pdf_password' => 'myPDFpass',
213
  );*/
214
 
215
  /*
@@ -218,11 +233,11 @@
218
  * Master password set
219
  */
220
  /*$gf_pdf_config[] = array(
221
- 'form_id' => 1,
222
- 'notifications' => true,
223
-
224
- 'security' => true,
225
- 'pdf_master_password' => 'admin password',
226
  );*/
227
 
228
  /*
@@ -236,7 +251,7 @@
236
  'notifications' => true,
237
 
238
  'security' => true,
239
- 'pdf_privileges' => array('copy', 'print', 'modify', 'print-highres'),
240
  );*/
241
 
242
  /*
@@ -249,22 +264,8 @@
249
  'form_id' => 1,
250
  'notifications' => true,
251
 
252
- 'rtl' => true,
253
  );*/
254
-
255
-
256
- /*
257
- * ------------------------------------------------------------
258
- * Multiple Forms
259
- * If you have multiple forms that use the same PDF template then you can pass the form_id through as an array.
260
- * WARNING: If using a custom template with this option your secondary forms should be a duplicate of the original and you shouldn't delete the fields
261
- * otherwise the custom template won't show correctly.
262
- * WARNING: The previous warning also applies to custom PDF names with MERGETAGS
263
- */
264
- /*$gf_pdf_config[] = array(
265
- 'form_id' => array(1,5,6),
266
- 'notifications' => true,
267
- );*/
268
 
269
  /*
270
  * ------------------------------------------------------------
@@ -274,101 +275,12 @@
274
  */
275
  /*$gf_pdf_config[] = array(
276
  'form_id' => 1,
277
- 'template' => 'example-template.php',
278
- );*/
279
-
280
- /*
281
- * ------------------------------------------------------------
282
- * Save PDF to disk
283
- * Added in v3.4.0
284
- *
285
- * If you don't want the PDF sent via email but want it saved on the server
286
- * use the 'save' option. The default save location is /wp-content/themes/ActiveTheme/PDF_EXTENDED_TEMPLATE/output/
287
- * Note: you can use 'save' in conjunction with 'notification' without any ill effects
288
- */
289
- /*$gf_pdf_config[] = array(
290
- 'form_id' => 1,
291
- 'template' => 'example-template.php',
292
- 'save' => true,
293
- );*/
294
-
295
- /*
296
- * ------------------------------------------------------------
297
- * Set the PDF DPI
298
- * Added in v3.4.0
299
- *
300
- * For when you need to change the document's DPI. Usually set to 300 when used in professional printing.
301
- * The default DPI used in the PDFs are 96.
302
- * Use the 'dpi' option
303
- */
304
-
305
- /*$gf_pdf_config[] = array(
306
- 'form_id' => 1,
307
- 'template' => 'example-template.php',
308
- 'dpi' => 300,
309
- );*/
310
-
311
- /*
312
- * ------------------------------------------------------------
313
- * Set PDF to PDF/A-1b format
314
- * Added in v3.4.0
315
- *
316
- * PDF/A1-b is a file format for the long-term archiving of electronic documents.
317
- * A key element to this reproducibility is the requirement for PDF/A documents to be 100% self-contained.
318
- *
319
- * Important: The software is not guaranteed to produce fully PDF/A1-b compliant files in all circumstances. It is the users responsibility to check compliance if this is essential.
320
- *
321
- * Usage:
322
- * We've added the configuration options 'pdfa1b'.
323
- *
324
- * The software will automatically make appropriate changes to your document to ensure it generates a valid PDF/A-1b document however the following items cannot be automatically fixed and are disallowed:
325
- *
326
- * 1. Watermarks - text or image - are not permitted (transparency is disallowed so will make text unreadable)
327
- * 2. PNG images with alpha channel transparency ('masks' not allowed)
328
- * 3. Encryption is enabled (the system will automatically remove any security settings)
329
- *
330
- * For more details about generating a PDF/X-1a document see http://mpdf1.com/manual/index.php?tid=420
331
- */
332
-
333
- /*$gf_pdf_config[] = array(
334
- 'form_id' => 1,
335
- 'template' => 'example-template.php',
336
- 'pdfa1b' => true,
337
- );*/
338
-
339
- /*
340
- * ------------------------------------------------------------
341
- * Set PDF to PDF/X-1a format
342
- * Added in v3.4.0
343
- *
344
- * PDF/X-1a is a file format to facilitate printing of electronic documents.
345
- * Two key elements to this function are the requirement for PDF/X documents to be 100% self-contained, and all images need to be CMYK or spot colors.
346
- *
347
- * Important: The software is not guaranteed to produce fully PDF/A1-b compliant files in all circumstances. It is the users responsibility to check compliance if this is essential.
348
- *
349
- * Usage:
350
- * We've added a new configuration options: 'pdfx1a' to turn documents into PDF/X-1a format.
351
- *
352
- * The software will automatically make appropriate changes to your document to ensure it generates a valid PDF/X-1a document however the following items cannot be automatically fixed and are disallowed:
353
- *
354
- * 1. Watermarks - text or image - are not permitted (transparency is disallowed so will make text unreadable)
355
- * 2. PNG images with alpha channel transparency ('masks' not allowed)
356
- * 3. Encryption is enabled (the system will automatically remove any security settings)
357
- *
358
- * For more details about generating a PDF/X-1a document see http://mpdf1.com/manual/index.php?tid=481
359
- *
360
- */
361
-
362
- /*$gf_pdf_config[] = array(
363
- 'form_id' => 1,
364
- 'template' => 'example-template.php',
365
- 'pdfx1a' => true,
366
  );*/
367
 
368
-
369
  /* ---------------------------------------------------------------
370
  * CUSTOM PDF SETUP BELOW.
371
- * See https://developer.gravitypdf.com/documentation/configuration-options-examples/#constants for more details
372
  */
373
 
374
  /*
@@ -382,9 +294,7 @@
382
  * MEMORY ISSUES?
383
  * Try setting the options below to true to help reduce the memory footprint of the package.
384
  */
385
- define('PDF_ENABLE_MPDF_LITE', false); /* strip out advanced features like advanced table borders, terms and conditions, index, bookmarks and barcodes. */
386
  define('PDF_ENABLE_MPDF_TINY', false); /* if your tried the lite version and are still having trouble the tiny version includes the bare minimum features. There's no positioning, float, watermark or form support */
387
  define('PDF_DISABLE_FONT_SUBSTITUTION', false); /* reduced memory by stopping font substitution */
388
- define('PDF_ENABLE_SIMPLE_TABLES', false); /* disable the advanced table feature and forces all cells to have the same border, background etc. */
389
-
390
- define('PDF_REPACK_FONT', false); /* If enabled, when embedding full TTF font files it will be remade with only core font tables which may improve function with some PostScript printers (GhostScript/GSView) */
1
  <?php
2
 
3
  /*
4
+ * Gravity Forms PDF Extended Configuration
5
  * New from v3.0.0. No longer is theme functions.php code required.
6
+ * Important documentation on the configuration found at http://gravityformspdfextended.com/documentation-v3-x-x/installation-and-configuration/
7
  */
8
 
9
  /*
31
  */
32
  /*$gf_pdf_config[] = array(
33
  'form_id' => 1,
34
+ 'notifications' => true
35
  );*/
36
 
37
  /*
50
 
51
  /*$gf_pdf_config[] = array(
52
  'form_id' => 1,
53
+ 'template' => 'default-template.php',
54
+ 'default-show-html' => true
55
  );*/
56
 
57
  /*$gf_pdf_config[] = array(
58
  'form_id' => 1,
59
+ 'template' => 'default-template.php',
60
+ 'default-show-empty' => true
61
  );*/
62
 
63
  /*$gf_pdf_config[] = array(
64
  'form_id' => 1,
65
+ 'template' => 'default-template.php',
66
+ 'default-show-page-names' => true
67
  );*/
68
 
69
  /*$gf_pdf_config[] = array(
70
  'form_id' => 1,
71
+ 'template' => 'default-template.php',
72
+ 'default-show-html' => true,
73
+ 'default-show-empty' => true,
74
+ 'default-show-page-names' => true
75
  );*/
76
 
77
  /*
82
  */
83
  /*$gf_pdf_config[] = array(
84
  'form_id' => 1,
85
+ 'notifications' => 'Admin Notification'
86
  );*/
87
 
88
  /*$gf_pdf_config[] = array(
89
  'form_id' => '1',
90
+ 'notifications' => array('Admin Notification', 'User Notification')
91
  );*/
92
 
93
  /*
95
  * Custom Template
96
  * Don't want to use a custom template? Just pass the custom template name to the configuration.
97
  * template String. Default default-template.php. The name of your custom template that's placed in your active theme's PDF_EXTENDED_TEMPLATES folder.
98
+ * For more information about creating custom templates please see http://gravityformspdfextended.com/documentation-v3-x-x/templates/
99
  */
100
  /*$gf_pdf_config[] = array(
101
  'form_id' => 1,
102
+ 'notifications' => 'User Notification',
103
+
104
+ 'template' => 'example-float-and-positioning05.php'
105
  );*/
106
 
107
  /*$gf_pdf_config[] = array(
108
  'form_id' => 2,
109
+ 'notifications' => 'User Notification',
110
+
111
+ 'template' => 'example-basic-html01.php'
112
  );*/
113
+
114
+ /*
115
+ * ------------------------------------------------------------
116
+ * Multiple Forms
117
+ * If you have multiple forms that use the same PDF template then you can pass the form_id through as an array.
118
+ * WARNING: If using a custom template with this option your secondary forms should be a duplicate of the original and you shouldn't delete the fields
119
+ * otherwise the custom template won't show correctly.
120
+ * WARNING: The previous warning also applies to custom PDF names with MERGETAGS
121
+ */
122
+ /*$gf_pdf_config[] = array(
123
+ 'form_id' => array(1,5,6),
124
+ 'notifications' => true
125
+ );*/
126
 
127
  /*
128
  * ------------------------------------------------------------
132
  * filename String. Default form-{form_id}-entry-{entry_id}.pdf
133
  */
134
  /*$gf_pdf_config[] = array(
135
+ 'form_id' => 1,
136
+ 'notifications' => true,
137
+ 'filename' => 'New PDF Name.pdf'
138
  );*/
139
 
140
  /*$gf_pdf_config[] = array(
141
+ 'form_id' => '1',
142
+ 'notifications' => true,
143
+ 'filename' => 'User {Name:1}.pdf'
144
  );*/
145
 
146
  /*
161
 
162
  /* Letter-sized Document */
163
  /*$gf_pdf_config[] = array(
164
+ 'form_id' => 1,
165
+ 'notifications' => true,
166
+
167
+ 'pdf_size' => 'letter'
168
  );*/
169
 
170
  /* Custom PDF Size */
171
  /* $gf_pdf_config[] = array(
172
+ 'form_id' => 1,
173
+ 'notifications' => true,
174
+
175
+ 'pdf_size' => array(50, 200)
176
+ );*/
177
+
178
+ /* Change orientation */
179
+ /* $gf_pdf_config[] = array(
180
+ 'form_id' => 1,
181
+ 'notifications' => true,
182
+
183
+ 'pdf_size' => 'letter',
184
+ 'orientation' => 'landscape'
185
  );*/
186
 
187
  /*
205
  * Setting security settings with all values
206
  */
207
  /*$gf_pdf_config[] = array(
208
+ 'form_id' => 1,
209
+ 'notifications' => true,
210
+
211
+ 'security' => true,
212
+ 'pdf_password' => 'myPDFpass',
213
+ 'pdf_privileges' => array('copy', 'print', 'modify', 'annot-forms', 'fill-forms', 'extract', 'assemble', 'print-highres'),
214
+ 'pdf_master_password' => 'admin password'
215
  );*/
216
 
217
  /*
220
  * Random master password will be generated
221
  */
222
  /*$gf_pdf_config[] = array(
223
+ 'form_id' => 1,
224
+ 'notifications' => true,
225
+
226
+ 'security' => true,
227
+ 'pdf_password' => 'myPDFpass'
228
  );*/
229
 
230
  /*
233
  * Master password set
234
  */
235
  /*$gf_pdf_config[] = array(
236
+ 'form_id' => 1,
237
+ 'notifications' => true,
238
+
239
+ 'security' => true,
240
+ 'pdf_master_password' => 'admin password'
241
  );*/
242
 
243
  /*
251
  'notifications' => true,
252
 
253
  'security' => true,
254
+ 'pdf_privileges' => array('copy', 'print', 'modify', 'print-highres')
255
  );*/
256
 
257
  /*
264
  'form_id' => 1,
265
  'notifications' => true,
266
 
267
+ 'rtl' => true
268
  );*/
 
 
 
 
 
 
 
 
 
 
 
 
 
 
269
 
270
  /*
271
  * ------------------------------------------------------------
275
  */
276
  /*$gf_pdf_config[] = array(
277
  'form_id' => 1,
278
+ 'template' => 'example-template.php'
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
279
  );*/
280
 
 
281
  /* ---------------------------------------------------------------
282
  * CUSTOM PDF SETUP BELOW.
283
+ * See http://gravityformspdfextended.com/documentation-v3-x-x/installation-and-configuration/#constants for more details
284
  */
285
 
286
  /*
294
  * MEMORY ISSUES?
295
  * Try setting the options below to true to help reduce the memory footprint of the package.
296
  */
297
+ define('PDF_ENABLE_MPDF_LITE', false); /* strip out advanced features like advanced table borders, terms and conditions, columns, index, bookmarks and barcodes. */
298
  define('PDF_ENABLE_MPDF_TINY', false); /* if your tried the lite version and are still having trouble the tiny version includes the bare minimum features. There's no positioning, float, watermark or form support */
299
  define('PDF_DISABLE_FONT_SUBSTITUTION', false); /* reduced memory by stopping font substitution */
300
+ define('PDF_ENABLE_SIMPLE_TABLES', false); /* disable the advanced table feature and forces all cells to have the same border, background etc. */
 
 
initialisation/template.css DELETED
@@ -1,132 +0,0 @@
1
- /* *
2
- * DO NOT MODIFY THIS FILE. IT'S OVERRIDDEN WHEN INITIALISING
3
- * Instead create another stylesheet and load it in your custom template
4
- *
5
- * The following snippet of CSS styles the default templates and the example template */
6
- body {
7
- font-family: DejaVu Sans, Helvetica, sans-serif;
8
- letter-spacing: -0.2px;
9
- }
10
- #container {
11
- border-radius: 4px 4px 4px 4px;
12
- border-spacing: 0;
13
- clear: both;
14
- width: 100%;
15
- background-color: #fff;
16
- border-color: #dfdfdf;
17
- border-style: solid;
18
- border-width: 1px;
19
- margin: 0 0 16px;
20
- }
21
- h2.default {
22
- background-color: #e3e3e3;
23
- font-size: 14px;
24
- text-align: left;
25
- text-shadow: 0 1px 0 #fff;
26
- margin: 0;
27
- padding: 7px;
28
- }
29
- .entry-view-field-value, .entry-view-html-value {
30
- border-bottom: 1px solid #dfdfdf;
31
- line-height: 150%;
32
- padding: 6px 6px 6px 7px;
33
- }
34
- .lastrow {
35
- border-bottom: none;
36
- }
37
- .entry-view-field-value ul {
38
- margin-left: 25px;
39
- }
40
- .entry-view-field-value div.strong {
41
- font-weight: bold;
42
- }
43
- .no-style .entry-view-field-value, .no-style #container, .no-style h2, .no-style .entry-view-html-value {
44
- background: none;
45
- border: none;
46
- }
47
- .two_row .entry-view-field-value {
48
- border: 0;
49
- line-height: normal;
50
- padding: 0;
51
- }
52
- .two_row .entry-view-field-value div.strong {
53
- font-weight: bold;
54
- width: 100%;
55
- border-bottom: 1px solid #dfdfdf;
56
- line-height: 150%;
57
- background-color: #eaf2fa;
58
- padding: 6px 6px 6px 7px;
59
- }
60
- .two_row .entry-view-field-value div.value {
61
- display: block;
62
- width: 100%;
63
- border-bottom: 1px solid #fff;
64
- line-height: 150%;
65
- padding: 6px 6px 6px 7px;
66
- }
67
- .two_row .entry-view-field-value span {
68
- font-weight: normal;
69
- }
70
- td.entry-view-field-value {
71
- padding-left: 9px;
72
- }
73
- .even {
74
- background: #eaf2fa;
75
- }
76
- .body_copy {
77
- padding-top: 50px;
78
- }
79
- .pdf_logo_area {
80
- text-align: center;
81
- margin: 0 auto;
82
- }
83
- table.entry-products th {
84
- background-color: #F4F4F4;
85
- border-bottom: 1px solid #DFDFDF;
86
- border-right: 1px solid #DFDFDF !important;
87
- }
88
- table.entry-products td.textcenter, table.entry-products th.textcenter {
89
- text-align: center;
90
- }
91
- table.entry-products col.entry-products-col2 {
92
- width: 50px;
93
- }
94
- table.entry-products col.entry-products-col3 {
95
- width: 155px;
96
- }
97
- table.entry-products col.entry-products-col4 {
98
- width: 155px;
99
- }
100
- table.entry-products {
101
- border: 1px solid #DFDFDF;
102
- margin: 10px 0;
103
- }
104
- table.entry-products td {
105
- border-bottom: 1px solid #DFDFDF;
106
- border-right: 1px solid #DFDFDF !important;
107
- padding: 7px 7px 8px;
108
- vertical-align: top;
109
- }
110
- table.entry-products td.emptycell {
111
- background-color: #F4F4F4;
112
- }
113
- table.entry-products td.grandtotal, table.entry-products td.grandtotal_amount, table.entry-products td.shipping, table.entry-products td.shipping_amount {
114
- font-size: 13px;
115
- font-weight: bold;
116
- padding-bottom: 8px;
117
- padding-top: 7px;
118
- }
119
- table.entry-products td.textright, table.entry-products th.textright {
120
- text-align: right;
121
- }
122
- .two_row .odd, .two_row .even {
123
- background: none;
124
- }
125
- .gsurvey-likert-choice-label {
126
- padding: 4px;
127
- }
128
- .gsurvey-likert-choice {
129
- text-align: center;
130
- }
131
-
132
- /* FINISHED REQUIRED CSS */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
initialisation/templates/default-template-no-style.php CHANGED
@@ -1,47 +1,53 @@
1
  <?php
2
 
3
  /**
4
- * Don't give direct access to the template
 
5
  */
6
  if(!class_exists("RGForms")){
7
  return;
8
  }
 
 
 
 
 
 
9
 
10
  global $gfpdf;
11
-
12
- $config_data = $gfpdf->get_default_config_data($form_id);
 
 
 
13
 
14
  /**
15
- * Load the form data to pass to our PDF generating function
16
  */
17
  $form = RGFormsModel::get_form_meta($form_id);
 
18
 
19
  ?>
20
 
21
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
22
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
23
- <html>
24
  <head>
25
- <link rel="stylesheet" href="<?php echo GFCommon::get_base_url(); ?>/css/print.css" type="text/css" />
26
- <link rel='stylesheet' href='<?php echo PDF_PLUGIN_URL .'initialisation/template.css'; ?>' type='text/css' />
27
- <title>Gravity PDF</title>
28
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
29
  </head>
30
- <body>
31
- <div class="no-style">
32
- <?php
33
- /*
34
- * Loop through the entries
35
- * There is usually only one but you can pass more IDs through the lid URL parameter
36
- */
37
- foreach($lead_ids as $lead_id) {
38
- /* load the lead information */
39
- $lead = RGFormsModel::get_lead($lead_id);
40
-
41
- /* generate the entry HTML */
42
- GFPDFEntryDetail::lead_detail_grid($form, $lead, $config_data['empty_field'], $config_data['html_field'], $config_data['page_names']);
43
- }
44
  ?>
45
  </div>
46
- </body>
47
  </html>
1
  <?php
2
 
3
  /**
4
+ * If the template is being loaded directy we'll call the Wordpress Core
5
+ * Used when attempting to debug the template
6
  */
7
  if(!class_exists("RGForms")){
8
  return;
9
  }
10
+
11
+ /**
12
+ * Set up the form ID and lead ID, as well as we want page breaks displayed.
13
+ * Form ID and Lead ID can be set by passing it to the URL - ?fid=1&lid=10
14
+ */
15
+ PDF_Common::setup_ids();
16
 
17
  global $gfpdf;
18
+ $configuration_data = $gfpdf->get_config_data($form_id);
19
+
20
+ $show_html_fields = (isset($configuration_data['default-show-html']) && $configuration_data['default-show-html'] == 1) ? true : false;
21
+ $show_empty_fields = (isset($configuration_data['default-show-empty']) && $configuration_data['default-show-empty'] == 1) ? true : false;
22
+ $show_page_names = (isset($configuration_data['default-show-page-names']) && $configuration_data['default-show-page-names'] == 1) ? true : false;
23
 
24
  /**
25
+ * Load the form data, including the custom style sheet which looks in the plugin's theme folder before defaulting back to the plugin's file.
26
  */
27
  $form = RGFormsModel::get_form_meta($form_id);
28
+ $stylesheet_location = (file_exists(PDF_TEMPLATE_LOCATION.'template.css')) ? PDF_TEMPLATE_URL_LOCATION.'template.css' : PDF_PLUGIN_URL .'styles/template.css' ;
29
 
30
  ?>
31
 
32
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
33
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
34
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
35
  <head>
36
+ <link rel='stylesheet' href='<?php echo GFCommon::get_base_url(); ?>/css/print.css' type='text/css' />
37
+ <link rel='stylesheet' href='<?php echo $stylesheet_location; ?>' type='text/css' />
38
+ <title>Gravity Forms PDF Extended</title>
39
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
40
  </head>
41
+ <body>
42
+ <div class="no-style">
43
+ <?php
44
+
45
+ foreach($lead_ids as $lead_id) {
46
+ $lead = RGFormsModel::get_lead($lead_id);
47
+ GFPDFEntryDetail::lead_detail_grid($form, $lead, $show_empty_fields, $show_html_fields, $show_page_names);
48
+ }
49
+
 
 
 
 
 
50
  ?>
51
  </div>
52
+ </body>
53
  </html>
initialisation/templates/default-template-two-rows.php CHANGED
@@ -1,47 +1,54 @@
1
  <?php
2
 
3
  /**
4
- * Don't give direct access to the template
 
5
  */
6
  if(!class_exists("RGForms")){
7
  return;
8
  }
9
 
 
 
 
 
 
 
10
  global $gfpdf;
11
-
12
- $config_data = $gfpdf->get_default_config_data($form_id);
 
 
 
13
 
14
  /**
15
- * Load the form data to pass to our PDF generating function
16
  */
17
  $form = RGFormsModel::get_form_meta($form_id);
 
18
 
19
  ?>
20
 
21
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
22
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
23
- <html>
24
  <head>
25
- <link rel="stylesheet" href="<?php echo GFCommon::get_base_url(); ?>/css/print.css" type="text/css" />
26
- <link rel='stylesheet' href='<?php echo PDF_PLUGIN_URL .'initialisation/template.css'; ?>' type='text/css' />
27
- <title>Gravity PDF</title>
28
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
29
- </head>
30
- <body>
31
- <div class="two_row">
32
- <?php
33
- /*
34
- * Loop through the entries
35
- * There is usually only one but you can pass more IDs through the lid URL parameter
36
- */
37
- foreach($lead_ids as $lead_id) {
38
- /* load the lead information */
39
- $lead = RGFormsModel::get_lead($lead_id);
40
 
41
- /* generate the entry HTML */
42
- GFPDFEntryDetail::lead_detail_grid($form, $lead, $config_data['empty_field'], $config_data['html_field'], $config_data['page_names']);
43
- }
 
 
 
 
 
 
 
44
  ?>
45
  </div>
46
- </body>
47
  </html>
1
  <?php
2
 
3
  /**
4
+ * If the template is being loaded directy we'll call the Wordpress Core
5
+ * Used when attempting to debug the template
6
  */
7
  if(!class_exists("RGForms")){
8
  return;
9
  }
10
 
11
+ /**
12
+ * Set up the form ID and lead ID, as well as we want page breaks displayed.
13
+ * Form ID and Lead ID can be set by passing it to the URL - ?fid=1&lid=10
14
+ */
15
+ PDF_Common::setup_ids();
16
+
17
  global $gfpdf;
18
+ $configuration_data = $gfpdf->get_config_data($form_id);
19
+
20
+ $show_html_fields = (isset($configuration_data['default-show-html']) && $configuration_data['default-show-html'] == 1) ? true : false;
21
+ $show_empty_fields = (isset($configuration_data['default-show-empty']) && $configuration_data['default-show-empty'] == 1) ? true : false;
22
+ $show_page_names = (isset($configuration_data['default-show-page-names']) && $configuration_data['default-show-page-names'] == 1) ? true : false;
23
 
24
  /**
25
+ * Load the form data, including the custom style sheet which looks in the plugin's theme folder before defaulting back to the plugin's file.
26
  */
27
  $form = RGFormsModel::get_form_meta($form_id);
28
+ $stylesheet_location = (file_exists(PDF_TEMPLATE_LOCATION.'template.css')) ? PDF_TEMPLATE_URL_LOCATION.'template.css' : PDF_PLUGIN_URL .'styles/template.css' ;
29
 
30
  ?>
31
 
32
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
33
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
34
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
35
  <head>
36
+ <link rel='stylesheet' href='<?php echo GFCommon::get_base_url(); ?>/css/print.css' type='text/css' />
37
+ <link rel='stylesheet' href='<?php echo $stylesheet_location; ?>' type='text/css' />
38
+ <title>Gravity Forms PDF Extended</title>
39
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 
 
 
 
 
 
 
 
 
 
 
40
 
41
+ </head>
42
+ <body>
43
+ <div class="two_row">
44
+ <?php
45
+
46
+ foreach($lead_ids as $lead_id) {
47
+ $lead = RGFormsModel::get_lead($lead_id);
48
+ GFPDFEntryDetail::lead_detail_grid($form, $lead, $show_empty_fields, $show_html_fields, $show_page_names);
49
+ }
50
+
51
  ?>
52
  </div>
53
+ </body>
54
  </html>
initialisation/templates/default-template.php CHANGED
@@ -1,45 +1,51 @@
1
  <?php
2
 
3
  /**
4
- * Don't give direct access to the template
 
5
  */
6
  if(!class_exists("RGForms")){
7
  return;
8
  }
 
 
 
 
 
 
9
 
10
  global $gfpdf;
11
-
12
- $config_data = $gfpdf->get_default_config_data($form_id);
 
 
 
13
 
14
  /**
15
- * Load the form data to pass to our PDF generating function
16
  */
17
  $form = RGFormsModel::get_form_meta($form_id);
 
18
 
19
  ?>
20
 
21
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
22
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
23
- <html>
24
  <head>
25
- <link rel="stylesheet" href="<?php echo GFCommon::get_base_url(); ?>/css/print.css" type="text/css" />
26
- <link rel='stylesheet' href='<?php echo PDF_PLUGIN_URL .'initialisation/template.css'; ?>' type='text/css' />
27
- <title>Gravity PDF</title>
28
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
29
  </head>
30
  <body>
31
  <?php
32
- /*
33
- * Loop through the entries
34
- * There is usually only one but you can pass more IDs through the lid URL parameter
35
- */
36
- foreach($lead_ids as $lead_id) {
37
- /* load the lead information */
38
- $lead = RGFormsModel::get_lead($lead_id);
39
 
40
- /* generate the entry HTML */
41
- GFPDFEntryDetail::lead_detail_grid($form, $lead, $config_data['empty_field'], $config_data['html_field'], $config_data['page_names']);
42
- }
 
 
43
  ?>
44
  </body>
45
  </html>
1
  <?php
2
 
3
  /**
4
+ * If the template is being loaded directy we'll call the Wordpress Core
5
+ * Used when attempting to debug the template
6
  */
7
  if(!class_exists("RGForms")){
8
  return;
9
  }
10
+
11
+ /**
12
+ * Set up the form ID and lead ID, as well as we want page breaks displayed.
13
+ * Form ID and Lead ID can be set by passing it to the URL - ?fid=1&lid=10
14
+ */
15
+ PDF_Common::setup_ids();
16
 
17
  global $gfpdf;
18
+ $configuration_data = $gfpdf->get_config_data($form_id);
19
+
20
+ $show_html_fields = (isset($configuration_data['default-show-html']) && $configuration_data['default-show-html'] == 1) ? true : false;
21
+ $show_empty_fields = (isset($configuration_data['default-show-empty']) && $configuration_data['default-show-empty'] == 1) ? true : false;
22
+ $show_page_names = (isset($configuration_data['default-show-page-names']) && $configuration_data['default-show-page-names'] == 1) ? true : false;
23
 
24
  /**
25
+ * Load the form data, including the custom style sheet which looks in the plugin's theme folder before defaulting back to the plugin's file.
26
  */
27
  $form = RGFormsModel::get_form_meta($form_id);
28
+ $stylesheet_location = (file_exists(PDF_TEMPLATE_LOCATION.'template.css')) ? PDF_TEMPLATE_URL_LOCATION.'template.css' : PDF_PLUGIN_URL .'styles/template.css' ;
29
 
30
  ?>
31
 
32
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
33
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
34
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
35
  <head>
36
+ <link rel='stylesheet' href='<?php echo GFCommon::get_base_url(); ?>/css/print.css' type='text/css' />
37
+ <link rel='stylesheet' href='<?php echo $stylesheet_location; ?>' type='text/css' />
38
+ <title>Gravity Forms PDF Extended</title>
39
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
40
  </head>
41
  <body>
42
  <?php
 
 
 
 
 
 
 
43
 
44
+ foreach($lead_ids as $lead_id) {
45
+ $lead = RGFormsModel::get_lead($lead_id);
46
+ GFPDFEntryDetail::lead_detail_grid($form, $lead, $show_empty_fields, $show_html_fields, $show_page_names);
47
+ }
48
+
49
  ?>
50
  </body>
51
  </html>
initialisation/templates/example-advanced-headers_07.php CHANGED
@@ -1,110 +1,114 @@
1
  <?php
2
 
3
  /**
4
- * Don't give direct access to the template
 
5
  */
6
  if(!class_exists("RGForms")){
7
- return;
8
  }
9
 
 
 
 
 
 
 
10
  /**
11
- * Load the form data to pass to our PDF generating function
12
  */
13
  $form = RGFormsModel::get_form_meta($form_id);
 
14
 
15
  ?>
16
 
17
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
18
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
19
- <html>
20
- <head>
21
- <link rel='stylesheet' href='<?php echo PDF_PLUGIN_URL .'initialisation/template.css'; ?>' type='text/css' />
22
- <?php
23
- /*
24
- * Create your own stylesheet or use the <style></style> tags to add or modify styles
25
- * The plugin stylesheet is overridden every update
26
- */
27
- ?>
28
- <title>Gravity PDF</title>
29
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
30
  </head>
31
- <body>
32
- <?php
33
 
34
  foreach($lead_ids as $lead_id) {
35
 
36
  $lead = RGFormsModel::get_lead($lead_id);
 
37
  $form_data = GFPDFEntryDetail::lead_detail_grid_array($form, $lead);
38
-
39
- /*
40
- * Add &data=1 when viewing the PDF via the admin area to view the $form_data array
41
- */
42
- PDF_Common::view_data($form_data);
43
-
44
- /*
45
- * Store your form fields from the $form_data array into variables here
46
- * To see your entire $form_data array, view your PDF via the admin area and add &data=1 to the url
47
- *
48
- * For an example of accessing $form_data fields see https://developer.gravitypdf.com/documentation/custom-templates-introduction/
49
- *
50
- * Alternatively, as of v3.4.0 you can use merge tags (except {allfields}) in your templates.
51
- * Just add merge tags to your HTML and they'll be parsed before generating the PDF.
52
- *
53
- */
54
-
55
- ?>
56
 
57
- <!-- defines the headers/footers - this must occur before the headers/footers are set -->
58
-
59
- <htmlpageheader name="myHTMLHeader1">
60
- <table width="100%" style="border-bottom: 1px solid #000000; vertical-align: bottom; font-family: serif; font-size: 9pt; color: #000088;"><tr>
61
- <td width="50%">First header p <span style="font-size:14pt;">{PAGENO}</span></td>
62
- <td width="50%" style="text-align: right;"><span style="font-weight: bold;">myHTMLHeader1</span></td>
63
- </tr></table>
64
- </htmlpageheader>
65
-
66
- <htmlpageheader name="myHTMLHeader2">
67
- <table width="100%" style="border-bottom: 1px solid #000000; vertical-align: bottom; font-family: serif; font-size: 9pt; color: #000088;"><tr>
68
- <td width="50%">Second header p <span style="font-size:14pt;">{PAGENO}</span></td>
69
- <td width="50%" style="text-align: right;"><span style="font-weight: bold;">myHTMLHeader2</span></td>
70
- </tr></table>
71
- </htmlpageheader>
72
-
73
-
74
-
75
- <!-- set the headers/footers - they will occur from here on in the document -->
76
-
77
- <sethtmlpageheader name="myHTMLHeader1" value="on" show-this-page="1" />
78
 
79
-
80
- <div>
81
- <img src="<?php echo PDF_PLUGIN_DIR; ?>/resources/images/gravityformspdfextended.jpg" width="311" height="110" />
82
- <h2>Advanced Headers</h2>
83
-
84
- <p>Nulla felis erat, imperdiet eu, ullamcorper non, nonummy quis, elit. Suspendisse potenti. Ut a eros at ligula vehicula pretium. Maecenas feugiat pede vel risus. Nulla et lectus. Fusce eleifend neque sit amet erat. Integer consectetuer nulla non orci. Morbi feugiat pulvinar dolor. Cras odio. Donec mattis, nisi id euismod auctor, neque metus pellentesque risus, at eleifend lacus sapien et risus. Phasellus metus. Phasellus feugiat, lectus ac aliquam molestie, leo lacus tincidunt turpis, vel aliquam quam odio et sapien. Mauris ante pede, auctor ac, suscipit quis, malesuada sed, nulla. Integer sit amet odio sit amet lectus luctus euismod. Donec et nulla. Sed quis orci. </p>
85
- <pagebreak />
86
-
87
- <h2>Advanced Headers</h2>
88
- <p>Nulla felis erat, imperdiet eu, ullamcorper non, nonummy quis, elit. Suspendisse potenti. Ut a eros at ligula vehicula pretium. Maecenas feugiat pede vel risus. Nulla et lectus. Fusce eleifend neque sit amet erat. Integer consectetuer nulla non orci. Morbi feugiat pulvinar dolor. Cras odio. Donec mattis, nisi id euismod auctor, neque metus pellentesque risus, at eleifend lacus sapien et risus. Phasellus metus. Phasellus feugiat, lectus ac aliquam molestie, leo lacus tincidunt turpis, vel aliquam quam odio et sapien. Mauris ante pede, auctor ac, suscipit quis, malesuada sed, nulla. Integer sit amet odio sit amet lectus luctus euismod. Donec et nulla. Sed quis orci. </p>
89
-
90
- <!-- Note the html_ prefix when referencing an HTML header using one of the pagebreaks -->
91
- <pagebreak />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
92
 
93
- <sethtmlpageheader name="myHTMLHeader2" value="on" show-this-page="1" />
94
-
95
- <h2>Advanced Headers</h2>
96
- <p>Nulla felis erat, imperdiet eu, ullamcorper non, nonummy quis, elit. Suspendisse potenti. Ut a eros at ligula vehicula pretium. Maecenas feugiat pede vel risus. Nulla et lectus. Fusce eleifend neque sit amet erat. Integer consectetuer nulla non orci. Morbi feugiat pulvinar dolor. Cras odio. Donec mattis, nisi id euismod auctor, neque metus pellentesque risus, at eleifend lacus sapien et risus. Phasellus metus. Phasellus feugiat, lectus ac aliquam molestie, leo lacus tincidunt turpis, vel aliquam quam odio et sapien. Mauris ante pede, auctor ac, suscipit quis, malesuada sed, nulla. Integer sit amet odio sit amet lectus luctus euismod. Donec et nulla. Sed quis orci. </p>
97
- </div>
98
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
99
  <?php
100
- /*
101
- * For more detail see mPDF documentation
102
- * <sethtmlpageheader> : http://mpdf1.com/manual/index.php?tid=179
103
- * <sethtmlpagefooter> : http://mpdf1.com/manual/index.php?tid=180
104
- * <pagebreak> : http://mpdf1.com/manual/index.php?tid=110
105
- */
106
- ?>
107
 
108
- <?php } ?>
109
- </body>
110
  </html>
1
  <?php
2
 
3
  /**
4
+ * If the template is being loaded directy we'll call the Wordpress Core
5
+ * Used when attempting to debug the template
6
  */
7
  if(!class_exists("RGForms")){
8
+ return;
9
  }
10
 
11
+ /**
12
+ * Set up the form ID and lead ID, as well as we want page breaks displayed.
13
+ * Form ID and Lead ID can be set by passing it to the URL - ?fid=1&lid=10
14
+ */
15
+ PDF_Common::setup_ids();
16
+
17
  /**
18
+ * Load the form data, including the custom style sheet which looks in the plugin's theme folder before defaulting back to the plugin's file.
19
  */
20
  $form = RGFormsModel::get_form_meta($form_id);
21
+ $stylesheet_location = (file_exists(PDF_TEMPLATE_LOCATION.'template.css')) ? PDF_TEMPLATE_URL_LOCATION.'template.css' : PDF_PLUGIN_URL .'styles/template.css' ;
22
 
23
  ?>
24
 
25
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
26
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
27
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
28
+ <head>
29
+
30
+ <title>Gravity Forms PDF Extended</title>
 
 
 
 
 
 
31
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
32
  </head>
33
+ <body>
34
+ <?php
35
 
36
  foreach($lead_ids as $lead_id) {
37
 
38
  $lead = RGFormsModel::get_lead($lead_id);
39
+ do_action("gform_print_entry_header", $form, $lead);
40
  $form_data = GFPDFEntryDetail::lead_detail_grid_array($form, $lead);
41
+ /*
42
+ * Add &data=1 when viewing the PDF via the admin area to view the $form_data array
43
+ */
44
+ PDF_Common::view_data($form_data);
45
+
46
+ /* get all the form values */
47
+ /*$date_created = $form_data['date_created'];
48
+
49
+ $first_name = $form_data['1.Name']['first'];
50
+ $last_name = $form_data['1.Name']['last'];*/
51
+
52
+ /* format the template */
53
+ ?>
 
 
 
 
 
54
 
55
+ <!-- defines the headers/footers - this must occur before the headers/footers are set -->
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
56
 
57
+ <htmlpageheader name="myHTMLHeader1">
58
+ <table width="100%" style="border-bottom: 1px solid #000000; vertical-align: bottom; font-family: serif; font-size: 9pt; color: #000088;"><tr>
59
+ <td width="50%">Left header p <span style="font-size:14pt;">{PAGENO}</span></td>
60
+ <td width="50%" style="text-align: right;"><span style="font-weight: bold;">myHTMLHeader1</span></td>
61
+ </tr></table>
62
+ </htmlpageheader>
63
+
64
+ <htmlpageheader name="myHTMLHeader1Even">
65
+ <table width="100%" style="border-bottom: 1px solid #000000; vertical-align: bottom; font-family: serif; font-size: 9pt; color: #000088;"><tr>
66
+ <td width="50%"><span style="font-weight: bold;">myHTMLHeader1Even</span></td>
67
+ <td width="50%" style="text-align: right;">Inner header p <span style="font-size:14pt;">{PAGENO}</span></td>
68
+ </tr></table>
69
+ </htmlpageheader>
70
+
71
+ <htmlpageheader name="myHTMLHeader2">
72
+ <table width="100%" style="border-bottom: 1px solid #880000; vertical-align: bottom; font-family: sans; font-size: 9pt; color: #880000;"><tr>
73
+ <td width="50%">myHTMLHeader2 p.<span style="font-size:14pt;">{PAGENO}</span></td>
74
+ <td width="50%" style="text-align: right;"><span style="font-weight: bold;">myHTMLHeader2</span></td>
75
+ </tr></table>
76
+ </htmlpageheader>
77
+
78
+ <htmlpageheader name="myHTMLHeader2Even">
79
+ <table width="100%" style="border-bottom: 1px solid #880000; vertical-align: bottom; font-family: sans; font-size: 9pt; color: #880000;"><tr>
80
+ <td width="50%"><span style="font-weight: bold;">myHTMLHeader2Even</span></td>
81
+ <td width="50%" style="text-align: right;">Inner header p <span style="font-size:14pt;">{PAGENO}</span></td>
82
+ </tr></table>
83
+ </htmlpageheader>
84
+
85
+
86
+ <!-- set the headers/footers - they will occur from here on in the document -->
87
+
88
+ <sethtmlpageheader name="myHTMLHeader1" page="O" value="on" show-this-page="1" />
89
+ <sethtmlpageheader name="myHTMLHeader1Even" page="E" value="on" />
90
 
 
 
 
 
 
91
 
92
+
93
+ <div>
94
+ <img src="<?php echo PDF_PLUGIN_DIR; ?>/resources/images/gravityformspdfextended.jpg" width="311" height="110" />
95
+ <h2>Advanced Headers</h2>
96
+
97
+ <p>Nulla felis erat, imperdiet eu, ullamcorper non, nonummy quis, elit. Suspendisse potenti. Ut a eros at ligula vehicula pretium. Maecenas feugiat pede vel risus. Nulla et lectus. Fusce eleifend neque sit amet erat. Integer consectetuer nulla non orci. Morbi feugiat pulvinar dolor. Cras odio. Donec mattis, nisi id euismod auctor, neque metus pellentesque risus, at eleifend lacus sapien et risus. Phasellus metus. Phasellus feugiat, lectus ac aliquam molestie, leo lacus tincidunt turpis, vel aliquam quam odio et sapien. Mauris ante pede, auctor ac, suscipit quis, malesuada sed, nulla. Integer sit amet odio sit amet lectus luctus euismod. Donec et nulla. Sed quis orci. </p>
98
+ <pagebreak />
99
+
100
+ <h2>Advanced Headers</h2>
101
+ <p>Nulla felis erat, imperdiet eu, ullamcorper non, nonummy quis, elit. Suspendisse potenti. Ut a eros at ligula vehicula pretium. Maecenas feugiat pede vel risus. Nulla et lectus. Fusce eleifend neque sit amet erat. Integer consectetuer nulla non orci. Morbi feugiat pulvinar dolor. Cras odio. Donec mattis, nisi id euismod auctor, neque metus pellentesque risus, at eleifend lacus sapien et risus. Phasellus metus. Phasellus feugiat, lectus ac aliquam molestie, leo lacus tincidunt turpis, vel aliquam quam odio et sapien. Mauris ante pede, auctor ac, suscipit quis, malesuada sed, nulla. Integer sit amet odio sit amet lectus luctus euismod. Donec et nulla. Sed quis orci. </p>
102
+
103
+ <!-- Note the html_ prefix when referencing an HTML header using one of the pagebreaks -->
104
+ <pagebreak odd-header-name="html_myHTMLHeader2" odd-header-value="1" even-header-name="html_myHTMLHeader2Even" even-header-value="1" />
105
+
106
+ <h2>Advanced Headers</h2>
107
+ <p>Nulla felis erat, imperdiet eu, ullamcorper non, nonummy quis, elit. Suspendisse potenti. Ut a eros at ligula vehicula pretium. Maecenas feugiat pede vel risus. Nulla et lectus. Fusce eleifend neque sit amet erat. Integer consectetuer nulla non orci. Morbi feugiat pulvinar dolor. Cras odio. Donec mattis, nisi id euismod auctor, neque metus pellentesque risus, at eleifend lacus sapien et risus. Phasellus metus. Phasellus feugiat, lectus ac aliquam molestie, leo lacus tincidunt turpis, vel aliquam quam odio et sapien. Mauris ante pede, auctor ac, suscipit quis, malesuada sed, nulla. Integer sit amet odio sit amet lectus luctus euismod. Donec et nulla. Sed quis orci. </p>
108
+ </div>
109
  <?php
110
+ }
 
 
 
 
 
 
111
 
112
+ ?>
113
+ </body>
114
  </html>
initialisation/templates/example-backgrounds-and-borders02.php CHANGED
@@ -1,33 +1,35 @@
1
  <?php
2
 
3
  /**
4
- * Don't give direct access to the template
 
5
  */
6
  if(!class_exists("RGForms")){
7
  return;
8
  }
9
 
 
 
 
 
 
 
10
  /**
11
- * Load the form data to pass to our PDF generating function
12
  */
13
  $form = RGFormsModel::get_form_meta($form_id);
 
14
 
15
  ?>
16
 
17
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
18
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
19
- <html>
20
- <head>
21
- <link rel='stylesheet' href='<?php echo PDF_PLUGIN_URL .'initialisation/template.css'; ?>' type='text/css' />
22
- <?php
23
- /*
24
- * Create your own stylesheet or use the <style></style> tags to add or modify styles
25
- * The plugin stylesheet is overridden every update
26
- */
27
- ?>
28
- <title>Gravity PDF</title>
29
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
30
-
31
  <style>
32
 
33
  body {
@@ -68,97 +70,111 @@ $form = RGFormsModel::get_form_meta($form_id);
68
  pre { text-align:left }
69
  pre.code { font-family: monospace }
70
 
71
- </style>
 
72
  </head>
73
  <body>
74
-
75
  <?php
76
 
77
  foreach($lead_ids as $lead_id) {
78
 
79
  $lead = RGFormsModel::get_lead($lead_id);
 
80
  $form_data = GFPDFEntryDetail::lead_detail_grid_array($form, $lead);
81
-
82
  /*
83
  * Add &data=1 when viewing the PDF via the admin area to view the $form_data array
84
  */
85
  PDF_Common::view_data($form_data);
86
 
87
- /*
88
- * Store your form fields from the $form_data array into variables here
89
- * To see your entire $form_data array, view your PDF via the admin area and add &data=1 to the url
90
- *
91
- * For an example of accessing $form_data fields see https://developer.gravitypdf.com/documentation/custom-templates-introduction/
92
- *
93
- * Alternatively, as of v3.4.0 you can use merge tags (except {allfields}) in your templates.
94
- * Just add merge tags to your HTML and they'll be parsed before generating the PDF.
95
- *
96
- */
97
-
98
- ?>
99
 
100
  <img src="<?php echo PDF_PLUGIN_DIR; ?>/resources/images/gravityformspdfextended.jpg" width="311" height="110" />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
101
 
102
- <h1>Backgrounds & Borders</h1>
103
- <div style="border:0.1mm solid #220044; padding:1em 2em; background-color:#ffffcc; ">
104
- <h4>Page background</h4>
105
- <div class="gradient">
106
- The background colour can be set by CSS styles on the &lt;body&gt; tag. This will set the background for the whole page. In this document, the background has been set as a gradient (see below).
107
- </div>
108
- <h4>Background Gradients</h4>
109
- <div class="gradient">
110
- Background can be set as a linear or radial gradient between two colours. The background has been set on this &lt;div&gt; element to a linear gradient. CSS style used here is:<br />
111
- <span style="font-family: mono; font-size: 9pt;">background-gradient: linear #c7cdde #f0f2ff 0 1 0 0.5;</span><br />
112
- The four numbers are coordinates in the form (x1, y1, x2, y2) which defines the gradient vector. x and y are values from 0 to 1, where 1 represents the height or width of the box as it is printed.
113
- <br />
114
- <br />
115
- Background gradients can be set on all block elements e.g. P, DIV, H1-H6, as well as on BODY.
116
- </div>
117
- <div class="radialgradient">
118
- The background has been set on this &lt;div&gt; element to a radial gradient. CSS style used here is:<br />
119
- <span style="font-family: mono; font-size: 9pt;">background-gradient: radial #00FFFF #FFFF00 0.5 0.5 0.5 0.5 0.65;</span><br />
120
- The five numbers are coordinates in the form (x1, y1, x2, y2, r) where (x1, y1) is the starting point of the gradient with color1,
121
- (x2, y2) is the center of the circle with color2, and r is the radius of the circle.
122
- (x1, y1) should be inside the circle, otherwise some areas will not be defined.
123
- <br />
124
- <br />
125
- Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec mattis lacus ac purus feugiat semper. Donec aliquet nunc odio, vitae pellentesque diam. Pellentesque sed velit lacus. Duis quis dui quis sem consectetur sollicitudin. Cras dolor quam, dapibus et pretium sit amet, elementum vel arcu. Duis rhoncus facilisis erat nec mattis. In hac habitasse platea dictumst. Vivamus hendrerit sem in justo aliquet a pellentesque lorem scelerisque. Suspendisse a augue sed urna rhoncus elementum. Aliquam erat volutpat.
126
- </div>
127
- <h4>Background Images</h4>
128
- <div style="border:0.1mm solid #880000; background: transparent url(<?php echo PDF_PLUGIN_DIR; ?>resources/images/bg.jpg) repeat fixed right top; background-color:#ccffff; ">
129
- The CSS properties background-image, background-position, and background-repeat are supported as defined in CSS2, as well as the shorthand form "background".
130
- <br />
131
- The background has been set on this &lt;div&gt; element to:<br />
132
- <span style="font-family: mono; font-size: 9pt;">background: transparent url(\'bg.jpg\') repeat fixed right top;</span><br />
133
- Background gradients can be set on all block elements e.g. P, DIV, H1-H6, as well as on BODY.
134
- </div>
135
- <h4>Rounded Borders</h4>
136
- <div class="rounded">
137
- Rounded corners to borders can be added using border-radius as defined in the draft spec. of <a href="http://www.w3.org/TR/2008/WD-css3-background-20080910/#layering">CSS3</a>. <br />
138
- The two length values of the border-*-radius properties define the radii of a quarter ellipse that defines the shape of the corner of the outer border edge.
139
- The first value is the horizontal radius. <br />
140
- <span style="font-family: mono; font-size: 9pt;">border-top-left-radius: 55pt 25pt;</span> 55pt is radius of curve from top end of left border starting to go round to the top.<br />
141
- If the second length is omitted it is equal to the first (and the corner is thus a quarter circle). If either length is zero, the corner is square, not rounded.<br />
142
- The border-radius shorthand sets all four border-*-radius properties. If values are given before and after a slash, then the values before the slash set the horizontal radius and the values after the slash set the vertical radius. If there is no slash, then the values set both radii equally. The four values for each radii are given in the order top-left, top-right, bottom-right, bottom-left. If bottom-left is omitted it is the same as top-right. If bottom-right is omitted it is the same as top-left. If top-right is omitted it is the same as top-left.
143
- </div>
144
- <div class="rounded">
145
- <span style="font-family: mono; font-size: 9pt;">border-radius: 4em;</span><br />
146
- would be equivalent to<br />
147
- <span style="font-family: mono; font-size: 9pt;">border-top-left-radius: 4em;<br />
148
- border-top-right-radius: 4em;<br />
149
- border-bottom-right-radius: 4em;<br />
150
- border-bottom-left-radius: 4em;</span><br />
151
- <br />
152
- and<br />
153
- <span style="font-family: mono; font-size: 9pt;">border-radius: 2em 1em 4em / 0.5em 3em;</span><br />
154
- would be equivalent to<br />
155
- <span style="font-family: mono; font-size: 9pt;">border-top-left-radius: 2em 0.5em;<br />
156
- border-top-right-radius: 1em 3em;<br />
157
- border-bottom-right-radius: 4em 0.5em;<br />
158
- border-bottom-left-radius: 1em 3em;</span>
159
- </div>
160
- </div>
161
-
162
- <?php } ?>
163
  </body>
164
  </html>
1
  <?php
2
 
3
  /**
4
+ * If the template is being loaded directy we'll call the Wordpress Core
5
+ * Used when attempting to debug the template
6
  */
7
  if(!class_exists("RGForms")){
8
  return;
9
  }
10
 
11
+ /**
12
+ * Set up the form ID and lead ID, as well as we want page breaks displayed.
13
+ * Form ID and Lead ID can be set by passing it to the URL - ?fid=1&lid=10
14
+ */
15
+ PDF_Common::setup_ids();
16
+
17
  /**
18
+ * Load the form data, including the custom style sheet which looks in the plugin's theme folder before defaulting back to the plugin's file.
19
  */
20
  $form = RGFormsModel::get_form_meta($form_id);
21
+ $stylesheet_location = (file_exists(PDF_TEMPLATE_LOCATION.'template.css')) ? PDF_TEMPLATE_URL_LOCATION.'template.css' : PDF_PLUGIN_URL .'styles/template.css' ;
22
 
23
  ?>
24
 
25
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
26
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
27
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
28
+ <head>
29
+
30
+ <link rel='stylesheet' href='<?php echo $stylesheet_location; ?>' type='text/css' />
31
+ <title>Gravity Forms PDF Extended</title>
 
 
 
 
 
32
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 
33
  <style>
34
 
35
  body {
70
  pre { text-align:left }
71
  pre.code { font-family: monospace }
72
 
73
+ </style>
74
+
75
  </head>
76
  <body>
 
77
  <?php
78
 
79
  foreach($lead_ids as $lead_id) {
80
 
81
  $lead = RGFormsModel::get_lead($lead_id);
82
+ do_action("gform_print_entry_header", $form, $lead);
83
  $form_data = GFPDFEntryDetail::lead_detail_grid_array($form, $lead);
 
84
  /*
85
  * Add &data=1 when viewing the PDF via the admin area to view the $form_data array
86
  */
87
  PDF_Common::view_data($form_data);
88
 
89
+ /* get all the form values */
90
+ /*$date_created = $form_data['date_created'];
91
+
92
+ $first_name = $form_data['1.Name']['first'];
93
+ $last_name = $form_data['1.Name']['last'];*/
94
+
95
+ /* format the template */
96
+ ?>
 
 
 
 
97
 
98
  <img src="<?php echo PDF_PLUGIN_DIR; ?>/resources/images/gravityformspdfextended.jpg" width="311" height="110" />
99
+
100
+
101
+
102
+
103
+
104
+ <h1>Backgrounds & Borders</h1>
105
+
106
+ <div style="border:0.1mm solid #220044; padding:1em 2em; background-color:#ffffcc; ">
107
+ <h4>Page background</h4>
108
+ <div class="gradient">
109
+ The background colour can be set by CSS styles on the &lt;body&gt; tag. This will set the background for the whole page. In this document, the background has been set as a gradient (see below).
110
+ </div>
111
+
112
+ <h4>Background Gradients</h4>
113
+ <div class="gradient">
114
+ Background can be set as a linear or radial gradient between two colours. The background has been set on this &lt;div&gt; element to a linear gradient. CSS style used here is:<br />
115
+ <span style="font-family: mono; font-size: 9pt;">background-gradient: linear #c7cdde #f0f2ff 0 1 0 0.5;</span><br />
116
+ The four numbers are coordinates in the form (x1, y1, x2, y2) which defines the gradient vector. x and y are values from 0 to 1, where 1 represents the height or width of the box as it is printed.
117
+ <br />
118
+ <br />
119
+ Background gradients can be set on all block elements e.g. P, DIV, H1-H6, as well as on BODY.
120
+ </div>
121
+ <div class="radialgradient">
122
+ The background has been set on this &lt;div&gt; element to a radial gradient. CSS style used here is:<br />
123
+ <span style="font-family: mono; font-size: 9pt;">background-gradient: radial #00FFFF #FFFF00 0.5 0.5 0.5 0.5 0.65;</span><br />
124
+ The five numbers are coordinates in the form (x1, y1, x2, y2, r) where (x1, y1) is the starting point of the gradient with color1,
125
+ (x2, y2) is the center of the circle with color2, and r is the radius of the circle.
126
+ (x1, y1) should be inside the circle, otherwise some areas will not be defined.
127
+ <br />
128
+ <br />
129
+ Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec mattis lacus ac purus feugiat semper. Donec aliquet nunc odio, vitae pellentesque diam. Pellentesque sed velit lacus. Duis quis dui quis sem consectetur sollicitudin. Cras dolor quam, dapibus et pretium sit amet, elementum vel arcu. Duis rhoncus facilisis erat nec mattis. In hac habitasse platea dictumst. Vivamus hendrerit sem in justo aliquet a pellentesque lorem scelerisque. Suspendisse a augue sed urna rhoncus elementum. Aliquam erat volutpat.
130
+ </div>
131
+
132
+ <h4>Background Images</h4>
133
+ <div style="border:0.1mm solid #880000; background: transparent url(<?php echo PDF_PLUGIN_DIR; ?>resources/images/bg.jpg) repeat fixed right top; background-color:#ccffff; ">
134
+ The CSS properties background-image, background-position, and background-repeat are supported as defined in CSS2, as well as the shorthand form "background".
135
+ <br />
136
+ The background has been set on this &lt;div&gt; element to:<br />
137
+ <span style="font-family: mono; font-size: 9pt;">background: transparent url(\'bg.jpg\') repeat fixed right top;</span><br />
138
+ Background gradients can be set on all block elements e.g. P, DIV, H1-H6, as well as on BODY.
139
+ </div>
140
+
141
+ <h4>Rounded Borders</h4>
142
+ <div class="rounded">
143
+ Rounded corners to borders can be added using border-radius as defined in the draft spec. of <a href="http://www.w3.org/TR/2008/WD-css3-background-20080910/#layering">CSS3</a>. <br />
144
+
145
+ The two length values of the border-*-radius properties define the radii of a quarter ellipse that defines the shape of the corner of the outer border edge.
146
+ The first value is the horizontal radius. <br />
147
+ <span style="font-family: mono; font-size: 9pt;">border-top-left-radius: 55pt 25pt;</span> 55pt is radius of curve from top end of left border starting to go round to the top.<br />
148
+
149
+ If the second length is omitted it is equal to the first (and the corner is thus a quarter circle). If either length is zero, the corner is square, not rounded.<br />
150
+
151
+ The border-radius shorthand sets all four border-*-radius properties. If values are given before and after a slash, then the values before the slash set the horizontal radius and the values after the slash set the vertical radius. If there is no slash, then the values set both radii equally. The four values for each radii are given in the order top-left, top-right, bottom-right, bottom-left. If bottom-left is omitted it is the same as top-right. If bottom-right is omitted it is the same as top-left. If top-right is omitted it is the same as top-left.
152
+ </div>
153
+ <div class="rounded">
154
+ <span style="font-family: mono; font-size: 9pt;">border-radius: 4em;</span><br />
155
+
156
+ would be equivalent to<br />
157
+
158
+ <span style="font-family: mono; font-size: 9pt;">border-top-left-radius: 4em;<br />
159
+ border-top-right-radius: 4em;<br />
160
+ border-bottom-right-radius: 4em;<br />
161
+ border-bottom-left-radius: 4em;</span><br />
162
+ <br />
163
+ and<br />
164
+ <span style="font-family: mono; font-size: 9pt;">border-radius: 2em 1em 4em / 0.5em 3em;</span><br />
165
+ would be equivalent to<br />
166
+ <span style="font-family: mono; font-size: 9pt;">border-top-left-radius: 2em 0.5em;<br />
167
+ border-top-right-radius: 1em 3em;<br />
168
+ border-bottom-right-radius: 4em 0.5em;<br />
169
+ border-bottom-left-radius: 1em 3em;</span>
170
+ </div>
171
+
172
+ </div>
173
+
174
+
175
+ <?php
176
+ }
177
 
178
+ ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
179
  </body>
180
  </html>
initialisation/templates/example-basic-html01.php CHANGED
@@ -1,154 +1,177 @@
1
  <?php
2
 
3
  /**
4
- * Don't give direct access to the template
 
5
  */
6
  if(!class_exists("RGForms")){
7
  return;
8
  }
9
 
 
 
 
 
 
 
10
  /**
11
- * Load the form data to pass to our PDF generating function
12
  */
13
  $form = RGFormsModel::get_form_meta($form_id);
 
14
 
15
  ?>
16
 
17
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
18
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
19
- <html>
20
- <head>
21
- <link rel='stylesheet' href='<?php echo PDF_PLUGIN_URL .'initialisation/template.css'; ?>' type='text/css' />
22
- <?php
23
- /*
24
- * Create your own stylesheet or use the <style></style> tags to add or modify styles
25
- * The plugin stylesheet is overridden every update
26
- */
27
- ?>
28
- <title>Gravity PDF</title>
29
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
30
  </head>
31
  <body>
32
-
33
  <?php
34
 
35
  foreach($lead_ids as $lead_id) {
36
 
37
  $lead = RGFormsModel::get_lead($lead_id);
 
38
  $form_data = GFPDFEntryDetail::lead_detail_grid_array($form, $lead);
39
-
40
  /*
41
  * Add &data=1 when viewing the PDF via the admin area to view the $form_data array
42
  */
43
  PDF_Common::view_data($form_data);
44
 
45
- /*
46
- * Store your form fields from the $form_data array into variables here
47
- * To see your entire $form_data array, view your PDF via the admin area and add &data=1 to the url
48
- *
49
- * For an example of accessing $form_data fields see https://developer.gravitypdf.com/documentation/custom-templates-introduction/
50
- *
51
- * Alternatively, as of v3.4.0 you can use merge tags (except {allfields}) in your templates.
52
- * Just add merge tags to your HTML and they'll be parsed before generating the PDF.
53
- *
54
- */
55
-
56
  ?>
57
 
58
- <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/gravityformspdfextended.jpg" width="311" height="110" />
59
- <h2>Basic HTML Example</h2>
60
- This file demonstrates most of the HTML elements.
61
- <h3>Heading 3</h3>
62
- <h4>Heading 4</h4>
63
- <h5>Heading 5</h5>
64
- <h6>Heading 6</h6>
65
- <p>P: Nulla felis erat, imperdiet eu, ullamcorper non, nonummy quis, elit. Suspendisse potenti. Ut a eros at ligula vehicula pretium. Maecenas feugiat pede vel risus. Nulla et lectus. Fusce eleifend neque sit amet erat. Integer consectetuer nulla non orci. Morbi feugiat pulvinar dolor. Cras odio. Donec mattis, nisi id euismod auctor, neque metus pellentesque risus, at eleifend lacus sapien et risus. Phasellus metus. Phasellus feugiat, lectus ac aliquam molestie, leo lacus tincidunt turpis, vel aliquam quam odio et sapien. Mauris ante pede, auctor ac, suscipit quis, malesuada sed, nulla. Integer sit amet odio sit amet lectus luctus euismod. Donec et nulla. Sed quis orci. </p>
66
- <hr />
67
- <div><img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.wmf" style="float:right;">DIV: Proin aliquet lorem id felis. Curabitur vel libero at mauris nonummy tincidunt. Donec imperdiet. Vestibulum sem sem, lacinia vel, molestie et, laoreet eget, urna. Curabitur viverra faucibus pede. Morbi lobortis. Donec dapibus. Donec tempus. Ut arcu enim, rhoncus ac, venenatis eu, porttitor mollis, dui. Sed vitae risus. In elementum sem placerat dui. Nam tristique eros in nisl. Nulla cursus sapien non quam porta porttitor. Quisque dictum ipsum ornare tortor. Fusce ornare tempus enim. </div>
68
- <div><img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/klematis.jpg" style="opacity: 0.5; float: left;" />DIV: Proin aliquet lorem id felis. Curabitur vel libero at mauris nonummy tincidunt. Donec imperdiet. Vestibulum sem sem, lacinia vel, molestie et, laoreet eget, urna. Curabitur viverra faucibus pede. Morbi lobortis. Donec dapibus. Donec tempus. Ut arcu enim, rhoncus ac, venenatis eu, porttitor mollis, dui. Sed vitae risus. In elementum sem placerat dui. Nam tristique eros in nisl. Nulla cursus sapien non quam porta porttitor. Quisque dictum ipsum ornare tortor. Fusce ornare tempus enim. </div>
69
- <blockquote>Blockquote: Maecenas arcu justo, malesuada eu, dapibus ac, adipiscing vitae, turpis. Fusce mollis. Aliquam egestas. In purus dolor, facilisis at, fermentum nec, molestie et, metus. Maecenas arcu justo, malesuada eu, dapibus ac, adipiscing vitae, turpis. Fusce mollis. Aliquam egestas. In purus dolor, facilisis at, fermentum nec, molestie et, metus.</blockquote>
70
- <address>Address: Vestibulum feugiat, orci at imperdiet tincidunt, mauris erat facilisis urna, sagittis ultricies dui nisl et lectus. Sed lacinia, lectus vitae dictum sodales, elit ipsum ultrices orci, non euismod arcu diam non metus.</address>
71
- <pre>PRE: Cum sociis natoque penatibus et magnis dis parturient montes,
72
- nascetur ridiculus mus. In suscipit turpis vitae odio. Integer convallis
73
- dui at metus. Fusce magna. Sed sed lectus vitae enim tempor cursus. Cras
74
- sed, posuere et, urna. Quisque ut leo. Aliquam interdum hendrerit tortor.
75
- Vestibulum elit. Vestibulum et arcu at diam mattis commodo. Nam ipsum sem,
76
- ultricies at, rutrum sit amet, posuere nec, velit. Sed molestie mollis dui.</pre>
77
- <div><a href="#top">Hyperlink (&lt;a&gt;)</a></div>
78
- <div><a href="https://gravitypdf.com">Hyperlink (&lt;a&gt;)</a></div>
79
- <div>Styles - <tt>tt(teletype)</tt> <i>italic</i> <b>bold</b> <big>big</big> <small>small</small> <em>emphasis</em> <strong>strong</strong> <br />new lines<br>
80
- <code>code</code> <samp>sample</samp> <kbd>keyboard</kbd> <var>variable</var> <cite>citation</cite> <abbr>abbr.</abbr> <acronym>ACRONYM</acronym> <sup>sup</sup> <sub>sub</sub> <strike>strike</strike> <s>strike-s</s> <u>underline</u> <del>delete</del> <ins>insert</ins> <q>To be or not to be</q> <font face="sans-serif" color="#880000" size="5">font changing face, size and color</font>
81
- </div>
82
- <p style="font-size:15pt; color:#440066">Paragraph using the in-line style to determine the font-size (15pt) and colour</p>
83
- <h3>Testing BIG, SMALL, UNDERLINE, STRIKETHROUGH, FONT color, ACRONYM, SUPERSCRIPT and SUBSCRIPT</h3>
84
- <p>This is <s>strikethrough</s> in <b><s>block</s></b> and <small>small <s>strikethrough</s> in <i>small span</i></small> and <big>big <s>strikethrough</s> in big span</big> and then <u>underline and <s>strikethrough and <sup>sup</sup></s></u> but out of span again but <font color="#000088">blue</font> font and <acronym>ACRONYM</acronym> text</p>
85
- <p>This is a <font color="#008800">green reference<sup>32-47</sup></font> and <u>underlined reference<sup>32-47</sup></u> then reference<sub>32-47</sub> and <u>underlined reference<sub>32-47</sub></u> then <s>Strikethrough reference<sup>32-47</sup></s> and <s>strikethrough reference<sub>32-47</sub></s></p>
86
- <p><big>Repeated in <u>BIG</u>: This is reference<sup>32-47</sup> and <u>underlined reference<sup>32-47</sup></u> then reference<sub>32-47</sub> and <u>underlined reference<sub>32-47</sub></u> but out of span again but <font color="#000088">blue</font> font and <acronym>ACRONYM</acronym> text</big></p>
87
- <p><small>Repeated in small: This is reference<sup>32-47</sup> and <u>underlined reference<sup>32-47</sup></u> then reference<sub>32-47</sub> and <u>underlined reference<sub>32-47</sub></u> but out of span again but <font color="#000088">blue</font> font and <acronym>ACRONYM</acronym> text</small></p>
88
- <p>The above repeated, but starting with a paragraph with font-size specified (7pt)</p>
89
- <p style="font-size:7pt;">This is <s>strikethrough</s> in block and <small>small <s>strikethrough</s> in small span</small> and then <u>underline</u> but out of span again but <font color="#000088">blue</font> font and <acronym>ACRONYM</acronym> text</p>
90
- <p style="font-size:7pt;">This is <s>strikethrough</s> in block and <big>big <s>strikethrough</s> in big span</big> and then <u>underline</u> but out of span again but <font color="#000088">blue</font> font and <acronym>ACRONYM</acronym> text</p>
91
- <p style="font-size:7pt;">This is reference<sup>32-47</sup> and <u>underlined reference<sup>32-47</sup></u> then reference<sub>32-47</sub> and <u>underlined reference<sub>32-47</sub></u> then <s>Strikethrough reference<sup>32-47</sup></s> and <s>strikethrough reference<sub>32-47</sub></s></p>
92
- <p><small>This tests <u>underline</u> and <s>strikethrough</s> when they are <s><u>used together</u></s> as they both use text-decoration</small></p>
93
- <p><small>Repeated in small: This is reference<sup>32-47</sup> and <u>underlined reference<sup>32-47</sup></u> then reference<sub>32-47</sub> and <u>underlined reference<sub>32-47</sub></u> but out of span again but <font color="#000088">blue</font> font and <acronym>ACRONYM</acronym> text</small></p>
94
- <p style="font-size:7pt;"><big>Repeated in BIG but with font-size set to 7pt by in-line css: This is reference<sup>32-47</sup> and <u>underlined reference<sup>32-47</sup></u> then reference<sub>32-47</sub> and <u>underlined reference<sub>32-47</sub></u> but out of span again but <font color="#000088">blue</font> font and <acronym>ACRONYM</acronym> text</big></p>
95
- <ol>
96
- <li>Item <b><u>1</u></b></li>
97
- <li>Item 2<sup>32</sup></li>
98
- <li><small>Item</small> 3</li>
99
- <li>
100
- Praesent pharetra nulla in turpis. Sed ipsum nulla, sodales nec, vulputate in, scelerisque vitae, magna. Sed egestas justo nec ipsum. Nulla facilisi. Praesent sit amet pede quis metus aliquet vulputate. Donec luctus. Cras euismod tellus vel leo.
101
- <ul>
102
- <li>Praesent pharetra nulla in turpis. Sed ipsum nulla, sodales nec, vulputate in, scelerisque vitae, magna. Sed egestas justo nec ipsum. Nulla facilisi. Praesent sit amet pede quis metus aliquet vulputate. Donec luctus. Cras euismod tellus vel leo. </li>
103
- <li>
104
- Subitem 2
105
- <ul>
106
- <li>
107
- Level 3 subitem
108
- </li>
109
- </ul>
110
- </li>
111
- </ul>
112
- </li>
113
- <li>Item 5</li>
114
- </ol>
115
- <dl>
116
- <dt>Definition list</dt>
117
- <dd>List defined by DL, DD and DT tags</dd>
118
- </dl>
119
- <p>Sed bibendum. Nunc eleifend ornare velit. Sed consectetuer urna in erat. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. Mauris sodales semper metus. Maecenas justo libero, pretium at, malesuada eu, mollis et, arcu. Ut suscipit pede in nulla. Praesent elementum, dolor ac fringilla posuere, elit libero rutrum massa, vel tincidunt dui tellus a ante. Sed aliquet euismod dolor. Vestibulum sed dui. Duis lobortis hendrerit quam. Donec tempus orci ut libero. Pellentesque suscipit malesuada nisi. </p>
120
- <table border="1">
121
- <thead>
122
- <tr>
123
- <th>Data</th>
124
- <td>Data</td>
125
- <td>Data</td>
126
- <td>Data<br />2nd line</td>
127
- </tr>
128
- </thead>
129
- <tbody>
130
- <tr>
131
- <th>More Data</th>
132
- <td>More Data</td>
133
- <td>More Data</td>
134
- <td>Data<br />2nd line</td>
135
- </tr>
136
- <tr>
137
- <th>Data</th>
138
- <td>Data</td>
139
- <td>Data</td>
140
- <td>Data<br />2nd line</td>
141
- </tr>
142
- <tr>
143
- <th>Data</th>
144
- <td>Data</td>
145
- <td>Data</td>
146
- <td>Data<br />2nd line</td>
147
- </tr>
148
- </tbody>
149
- </table>
150
- <p>Praesent pharetra nulla in turpis. Sed ipsum nulla, sodales nec, vulputate in, scelerisque vitae, magna. Sed egestas justo nec ipsum. Nulla facilisi. Praesent sit amet pede quis metus aliquet vulputate. Donec luctus. Cras euismod tellus vel leo. Cras tellus. Fusce aliquet. Curabitur tincidunt viverra ligula. Fusce eget erat. Donec pede. Vestibulum id felis. Phasellus tincidunt ligula non pede. Morbi turpis. In vitae dui non erat placerat malesuada. Mauris adipiscing congue ante. Proin at erat. Aliquam mattis. </p>
151
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
152
  <?php
153
  }
154
 
1
  <?php
2
 
3
  /**
4
+ * If the template is being loaded directy we'll call the Wordpress Core
5
+ * Used when attempting to debug the template
6
  */
7
  if(!class_exists("RGForms")){
8
  return;
9
  }
10
 
11
+ /**
12
+ * Set up the form ID and lead ID, as well as we want page breaks displayed.
13
+ * Form ID and Lead ID can be set by passing it to the URL - ?fid=1&lid=10
14
+ */
15
+ PDF_Common::setup_ids();
16
+
17
  /**
18
+ * Load the form data, including the custom style sheet which looks in the plugin's theme folder before defaulting back to the plugin's file.
19
  */
20
  $form = RGFormsModel::get_form_meta($form_id);
21
+ $stylesheet_location = (file_exists(PDF_TEMPLATE_LOCATION.'template.css')) ? PDF_TEMPLATE_URL_LOCATION.'template.css' : PDF_PLUGIN_URL .'styles/template.css' ;
22
 
23
  ?>
24
 
25
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
26
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
27
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
28
+ <head>
29
+ <link rel='stylesheet' href='<?php echo $stylesheet_location; ?>' type='text/css' />
30
+ <title>Gravity Forms PDF Extended</title>
 
 
 
 
 
 
31
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
32
  </head>
33
  <body>
 
34
  <?php
35
 
36
  foreach($lead_ids as $lead_id) {
37
 
38
  $lead = RGFormsModel::get_lead($lead_id);
39
+ do_action("gform_print_entry_header", $form, $lead);
40
  $form_data = GFPDFEntryDetail::lead_detail_grid_array($form, $lead);
 
41
  /*
42
  * Add &data=1 when viewing the PDF via the admin area to view the $form_data array
43
  */
44
  PDF_Common::view_data($form_data);
45
 
46
+ /* get all the form values */
47
+ /*$date_created = $form_data['date_created'];
48
+
49
+ $first_name = $form_data['1.Name']['first'];
50
+ $last_name = $form_data['1.Name']['last'];*/
51
+
52
+ /* format the template */
 
 
 
 
53
  ?>
54
 
55
+ <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/gravityformspdfextended.jpg" width="311" height="110" />
56
+
57
+
58
+ <h2>Basic HTML Example</h2>
59
+ This file demonstrates most of the HTML elements.
60
+ <h3>Heading 3</h3>
61
+ <h4>Heading 4</h4>
62
+ <h5>Heading 5</h5>
63
+ <h6>Heading 6</h6>
64
+ <p>P: Nulla felis erat, imperdiet eu, ullamcorper non, nonummy quis, elit. Suspendisse potenti. Ut a eros at ligula vehicula pretium. Maecenas feugiat pede vel risus. Nulla et lectus. Fusce eleifend neque sit amet erat. Integer consectetuer nulla non orci. Morbi feugiat pulvinar dolor. Cras odio. Donec mattis, nisi id euismod auctor, neque metus pellentesque risus, at eleifend lacus sapien et risus. Phasellus metus. Phasellus feugiat, lectus ac aliquam molestie, leo lacus tincidunt turpis, vel aliquam quam odio et sapien. Mauris ante pede, auctor ac, suscipit quis, malesuada sed, nulla. Integer sit amet odio sit amet lectus luctus euismod. Donec et nulla. Sed quis orci. </p>
65
+
66
+ <hr />
67
+
68
+ <div><img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.wmf" style="float:right;">DIV: Proin aliquet lorem id felis. Curabitur vel libero at mauris nonummy tincidunt. Donec imperdiet. Vestibulum sem sem, lacinia vel, molestie et, laoreet eget, urna. Curabitur viverra faucibus pede. Morbi lobortis. Donec dapibus. Donec tempus. Ut arcu enim, rhoncus ac, venenatis eu, porttitor mollis, dui. Sed vitae risus. In elementum sem placerat dui. Nam tristique eros in nisl. Nulla cursus sapien non quam porta porttitor. Quisque dictum ipsum ornare tortor. Fusce ornare tempus enim. </div>
69
+ <div><img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/klematis.jpg" style="opacity: 0.5; float: left;" />DIV: Proin aliquet lorem id felis. Curabitur vel libero at mauris nonummy tincidunt. Donec imperdiet. Vestibulum sem sem, lacinia vel, molestie et, laoreet eget, urna. Curabitur viverra faucibus pede. Morbi lobortis. Donec dapibus. Donec tempus. Ut arcu enim, rhoncus ac, venenatis eu, porttitor mollis, dui. Sed vitae risus. In elementum sem placerat dui. Nam tristique eros in nisl. Nulla cursus sapien non quam porta porttitor. Quisque dictum ipsum ornare tortor. Fusce ornare tempus enim. </div>
70
+
71
+ <blockquote>Blockquote: Maecenas arcu justo, malesuada eu, dapibus ac, adipiscing vitae, turpis. Fusce mollis. Aliquam egestas. In purus dolor, facilisis at, fermentum nec, molestie et, metus. Maecenas arcu justo, malesuada eu, dapibus ac, adipiscing vitae, turpis. Fusce mollis. Aliquam egestas. In purus dolor, facilisis at, fermentum nec, molestie et, metus.</blockquote>
72
+
73
+ <address>Address: Vestibulum feugiat, orci at imperdiet tincidunt, mauris erat facilisis urna, sagittis ultricies dui nisl et lectus. Sed lacinia, lectus vitae dictum sodales, elit ipsum ultrices orci, non euismod arcu diam non metus.</address>
74
+
75
+ <pre>PRE: Cum sociis natoque penatibus et magnis dis parturient montes,
76
+ nascetur ridiculus mus. In suscipit turpis vitae odio. Integer convallis
77
+ dui at metus. Fusce magna. Sed sed lectus vitae enim tempor cursus. Cras
78
+ sed, posuere et, urna. Quisque ut leo. Aliquam interdum hendrerit tortor.
79
+ Vestibulum elit. Vestibulum et arcu at diam mattis commodo. Nam ipsum sem,
80
+ ultricies at, rutrum sit amet, posuere nec, velit. Sed molestie mollis dui.</pre>
81
+
82
+ <div><a href="#top">Hyperlink (&lt;a&gt;)</a></div>
83
+ <div><a href="http://www.gravityformspdfextended.com">Hyperlink (&lt;a&gt;)</a></div>
84
+
85
+ <div>Styles - <tt>tt(teletype)</tt> <i>italic</i> <b>bold</b> <big>big</big> <small>small</small> <em>emphasis</em> <strong>strong</strong> <br />new lines<br>
86
+ <code>code</code> <samp>sample</samp> <kbd>keyboard</kbd> <var>variable</var> <cite>citation</cite> <abbr>abbr.</abbr> <acronym>ACRONYM</acronym> <sup>sup</sup> <sub>sub</sub> <strike>strike</strike> <s>strike-s</s> <u>underline</u> <del>delete</del> <ins>insert</ins> <q>To be or not to be</q> <font face="sans-serif" color="#880000" size="5">font changing face, size and color</font>
87
+ </div>
88
+
89
+ <p style="font-size:15pt; color:#440066">Paragraph using the in-line style to determine the font-size (15pt) and colour</p>
90
+
91
+
92
+ <h3>Testing BIG, SMALL, UNDERLINE, STRIKETHROUGH, FONT color, ACRONYM, SUPERSCRIPT and SUBSCRIPT</h3>
93
+ <p>This is <s>strikethrough</s> in <b><s>block</s></b> and <small>small <s>strikethrough</s> in <i>small span</i></small> and <big>big <s>strikethrough</s> in big span</big> and then <u>underline and <s>strikethrough and <sup>sup</sup></s></u> but out of span again but <font color="#000088">blue</font> font and <acronym>ACRONYM</acronym> text</p>
94
+
95
+ <p>This is a <font color="#008800">green reference<sup>32-47</sup></font> and <u>underlined reference<sup>32-47</sup></u> then reference<sub>32-47</sub> and <u>underlined reference<sub>32-47</sub></u> then <s>Strikethrough reference<sup>32-47</sup></s> and <s>strikethrough reference<sub>32-47</sub></s></p>
96
+
97
+ <p><big>Repeated in <u>BIG</u>: This is reference<sup>32-47</sup> and <u>underlined reference<sup>32-47</sup></u> then reference<sub>32-47</sub> and <u>underlined reference<sub>32-47</sub></u> but out of span again but <font color="#000088">blue</font> font and <acronym>ACRONYM</acronym> text</big></p>
98
+
99
+ <p><small>Repeated in small: This is reference<sup>32-47</sup> and <u>underlined reference<sup>32-47</sup></u> then reference<sub>32-47</sub> and <u>underlined reference<sub>32-47</sub></u> but out of span again but <font color="#000088">blue</font> font and <acronym>ACRONYM</acronym> text</small></p>
100
+
101
+ <p>The above repeated, but starting with a paragraph with font-size specified (7pt)</p>
102
+
103
+ <p style="font-size:7pt;">This is <s>strikethrough</s> in block and <small>small <s>strikethrough</s> in small span</small> and then <u>underline</u> but out of span again but <font color="#000088">blue</font> font and <acronym>ACRONYM</acronym> text</p>
104
+
105
+ <p style="font-size:7pt;">This is <s>strikethrough</s> in block and <big>big <s>strikethrough</s> in big span</big> and then <u>underline</u> but out of span again but <font color="#000088">blue</font> font and <acronym>ACRONYM</acronym> text</p>
106
+
107
+ <p style="font-size:7pt;">This is reference<sup>32-47</sup> and <u>underlined reference<sup>32-47</sup></u> then reference<sub>32-47</sub> and <u>underlined reference<sub>32-47</sub></u> then <s>Strikethrough reference<sup>32-47</sup></s> and <s>strikethrough reference<sub>32-47</sub></s></p>
108
+
109
+ <p><small>This tests <u>underline</u> and <s>strikethrough</s> when they are <s><u>used together</u></s> as they both use text-decoration</small></p>
110
+
111
+
112
+ <p><small>Repeated in small: This is reference<sup>32-47</sup> and <u>underlined reference<sup>32-47</sup></u> then reference<sub>32-47</sub> and <u>underlined reference<sub>32-47</sub></u> but out of span again but <font color="#000088">blue</font> font and <acronym>ACRONYM</acronym> text</small></p>
113
+
114
+ <p style="font-size:7pt;"><big>Repeated in BIG but with font-size set to 7pt by in-line css: This is reference<sup>32-47</sup> and <u>underlined reference<sup>32-47</sup></u> then reference<sub>32-47</sub> and <u>underlined reference<sub>32-47</sub></u> but out of span again but <font color="#000088">blue</font> font and <acronym>ACRONYM</acronym> text</big></p>
115
+
116
+ <ol>
117
+ <li>Item <b><u>1</u></b></li>
118
+ <li>Item 2<sup>32</sup></li>
119
+ <li><small>Item</small> 3</li>
120
+ <li>Praesent pharetra nulla in turpis. Sed ipsum nulla, sodales nec, vulputate in, scelerisque vitae, magna. Sed egestas justo nec ipsum. Nulla facilisi. Praesent sit amet pede quis metus aliquet vulputate. Donec luctus. Cras euismod tellus vel leo.
121
+ <ul>
122
+ <li>Praesent pharetra nulla in turpis. Sed ipsum nulla, sodales nec, vulputate in, scelerisque vitae, magna. Sed egestas justo nec ipsum. Nulla facilisi. Praesent sit amet pede quis metus aliquet vulputate. Donec luctus. Cras euismod tellus vel leo. </li>
123
+ <li>Subitem 2
124
+ <ul>
125
+ <li>
126
+ Level 3 subitem
127
+ </li>
128
+ </ul>
129
+ </li>
130
+ </ul>
131
+ </li>
132
+ <li>Item 5</li>
133
+ </ol>
134
+
135
+ <dl>
136
+ <dt>Definition list</dt>
137
+ <dd>List defined by DL, DD and DT tags</dd>
138
+ </dl>
139
+
140
+ <p>Sed bibendum. Nunc eleifend ornare velit. Sed consectetuer urna in erat. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. Mauris sodales semper metus. Maecenas justo libero, pretium at, malesuada eu, mollis et, arcu. Ut suscipit pede in nulla. Praesent elementum, dolor ac fringilla posuere, elit libero rutrum massa, vel tincidunt dui tellus a ante. Sed aliquet euismod dolor. Vestibulum sed dui. Duis lobortis hendrerit quam. Donec tempus orci ut libero. Pellentesque suscipit malesuada nisi. </p>
141
+
142
+ <table border="1">
143
+ <thead>
144
+ <tr>
145
+ <th>Data</th>
146
+ <td>Data</td>
147
+ <td>Data</td>
148
+ <td>Data<br />2nd line</td>
149
+ </tr>
150
+ </thead>
151
+ <tbody>
152
+ <tr>
153
+ <th>More Data</th>
154
+ <td>More Data</td>
155
+ <td>More Data</td>
156
+ <td>Data<br />2nd line</td>
157
+ </tr>
158
+ <tr>
159
+ <th>Data</th>
160
+ <td>Data</td>
161
+ <td>Data</td>
162
+ <td>Data<br />2nd line</td>
163
+ </tr>
164
+ <tr>
165
+ <th>Data</th>
166
+ <td>Data</td>
167
+ <td>Data</td>
168
+ <td>Data<br />2nd line</td>
169
+ </tr>
170
+ </tbody>
171
+ </table>
172
+
173
+ <p>Praesent pharetra nulla in turpis. Sed ipsum nulla, sodales nec, vulputate in, scelerisque vitae, magna. Sed egestas justo nec ipsum. Nulla facilisi. Praesent sit amet pede quis metus aliquet vulputate. Donec luctus. Cras euismod tellus vel leo. Cras tellus. Fusce aliquet. Curabitur tincidunt viverra ligula. Fusce eget erat. Donec pede. Vestibulum id felis. Phasellus tincidunt ligula non pede. Morbi turpis. In vitae dui non erat placerat malesuada. Mauris adipiscing congue ante. Proin at erat. Aliquam mattis. </p>
174
+
175
  <?php
176
  }
177
 
initialisation/templates/example-different-page-size_08.php CHANGED
@@ -1,82 +1,71 @@
1
  <?php
2
 
3
  /**
4
- * Don't give direct access to the template
 
5
  */
6
  if(!class_exists("RGForms")){
7
- return;
8
  }
9
 
 
 
 
 
 
 
10
  /**
11
- * Load the form data to pass to our PDF generating function
12
  */
13
  $form = RGFormsModel::get_form_meta($form_id);
 
14
 
15
  ?>
16
 
17
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
18
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
19
- <html>
20
- <head>
21
- <link rel='stylesheet' href='<?php echo PDF_PLUGIN_URL .'initialisation/template.css'; ?>' type='text/css' />
22
- <?php
23
- /*
24
- * Create your own stylesheet or use the <style></style> tags to add or modify styles
25
- * The plugin stylesheet is overridden every update
26
- */
27
- ?>
28
- <title>Gravity PDF</title>
29
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
30
  </head>
31
- <body>
32
- <?php
33
 
34
  foreach($lead_ids as $lead_id) {
35
 
36
  $lead = RGFormsModel::get_lead($lead_id);
 
37
  $form_data = GFPDFEntryDetail::lead_detail_grid_array($form, $lead);
38
-
39
- /*
40
- * Add &data=1 when viewing the PDF via the admin area to view the $form_data array
41
- */
42
- PDF_Common::view_data($form_data);
43
-
44
- /*
45
- * Store your form fields from the $form_data array into variables here
46
- * To see your entire $form_data array, view your PDF via the admin area and add &data=1 to the url
47
- *
48
- * For an example of accessing $form_data fields see https://developer.gravitypdf.com/documentation/custom-templates-introduction/
49
- *
50
- * Alternatively, as of v3.4.0 you can use merge tags (except {allfields}) in your templates.
51
- * Just add merge tags to your HTML and they'll be parsed before generating the PDF.
52
- *
53
- */
54
-
55
- ?>
56
-
57
- <?php
58
- /*
59
- * The initial page size is set using the 'page_size' configuration option
60
- * The default is A4 Portrait
61
- * See Configuration page for more details on page_size : https://developer.gravitypdf.com/documentation/configuration-options-examples/
62
- */
63
- ?>
64
-
65
- <p>This should print on an A4 (portrait) sheet</p>
66
-
67
- <!-- using pagebreak we can set the next page's size. In this case, it's A4 landscape -->
68
- <pagebreak sheet-size="A4-L" />
69
- <p>This page appears after the A4 portrait sheet and should print on an A4 (landscape) sheet</p>
70
- <h1>mPDF Page Sizes</h1>
71
- <h3>Changing page (sheet) sizes within the document</h3>
72
 
73
- <!-- change next page to A5 landscape -->
74
- <pagebreak sheet-size="A5-L" />
75
-
76
- <p>This should print on an A5 (landscape) sheet</p>
77
- <h1>mPDF Page Sizes</h1>
78
- <h3>Changing page (sheet) sizes within the document</h3>
79
 
80
- <?php } ?>
81
  </body>
82
  </html>
1
  <?php
2
 
3
  /**
4
+ * If the template is being loaded directy we'll call the Wordpress Core
5
+ * Used when attempting to debug the template
6
  */
7
  if(!class_exists("RGForms")){
8
+ return;
9
  }
10
 
11
+ /**
12
+ * Set up the form ID and lead ID, as well as we want page breaks displayed.
13
+ * Form ID and Lead ID can be set by passing it to the URL - ?fid=1&lid=10
14
+ */
15
+ PDF_Common::setup_ids();
16
+
17
  /**
18
+ * Load the form data, including the custom style sheet which looks in the plugin's theme folder before defaulting back to the plugin's file.
19
  */
20
  $form = RGFormsModel::get_form_meta($form_id);
21
+ $stylesheet_location = (file_exists(PDF_TEMPLATE_LOCATION.'template.css')) ? PDF_TEMPLATE_URL_LOCATION.'template.css' : PDF_PLUGIN_URL .'styles/template.css' ;
22
 
23
  ?>
24
 
25
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
26
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
27
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
28
+ <head>
29
+
30
+ <title>Gravity Forms PDF Extended</title>
 
 
 
 
 
 
31
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
32
  </head>
33
+ <body>
34
+ <?php
35
 
36
  foreach($lead_ids as $lead_id) {
37
 
38
  $lead = RGFormsModel::get_lead($lead_id);
39
+ do_action("gform_print_entry_header", $form, $lead);
40
  $form_data = GFPDFEntryDetail::lead_detail_grid_array($form, $lead);
41
+ /*
42
+ * Add &data=1 when viewing the PDF via the admin area to view the $form_data array
43
+ */
44
+ PDF_Common::view_data($form_data);
45
+
46
+ /* get all the form values */
47
+ /*$date_created = $form_data['date_created'];
48
+
49
+ $first_name = $form_data['1.Name']['first'];
50
+ $last_name = $form_data['1.Name']['last'];*/
51
+
52
+ /* format the template */
53
+ ?>
54
+ <p>This should print on an A4 (portrait) sheet</p>
55
+
56
+ <pagebreak sheet-size="A4-L" />
57
+ <p>This page appears after the A4 portrait sheet and should print on an A4 (landscape) sheet</p>
58
+ <h1>mPDF Page Sizes</h1>
59
+ <h3>Changing page (sheet) sizes within the document</h3>
60
+ <pagebreak sheet-size="A5-L" />
61
+
62
+ <p>This should print on an A5 (landscape) sheet</p>
63
+ <h1>mPDF Page Sizes</h1>
64
+ <h3>Changing page (sheet) sizes within the document</h3>
 
 
 
 
 
 
 
 
 
 
65
 
66
+ <?php
67
+ }
 
 
 
 
68
 
69
+ ?>
70
  </body>
71
  </html>
initialisation/templates/example-float-and-positioning05.php CHANGED
@@ -1,157 +1,172 @@
1
  <?php
2
 
3
  /**
4
- * Don't give direct access to the template
 
5
  */
6
  if(!class_exists("RGForms")){
7
- return;
8
  }
9
 
 
 
 
 
 
 
10
  /**
11
- * Load the form data to pass to our PDF generating function
12
  */
13
  $form = RGFormsModel::get_form_meta($form_id);
 
14
 
15
  ?>
16
 
17
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
18
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
19
- <html>
20
- <head>
21
- <link rel='stylesheet' href='<?php echo PDF_PLUGIN_URL .'initialisation/template.css'; ?>' type='text/css' />
22
- <?php
23
- /*
24
- * Create your own stylesheet or use the <style></style> tags to add or modify styles
25
- * The plugin stylesheet is overridden every update
26
- */
27
- ?>
28
- <title>Gravity PDF</title>
29
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
30
- <style>
31
- .gradient {
32
- border:0.1mm solid #220044;
33
- background-color: #f0f2ff;
34
- background-gradient: linear #c7cdde #f0f2ff 0 1 0 0.5;
35
- }
36
- h4 {
37
- font-family: sans;
38
- font-weight: bold;
39
- margin-top: 1em;
40
- margin-bottom: 0.5em;
41
- }
42
- div {
43
- padding:1em;
44
- margin-bottom: 1em;
45
- text-align:justify;
46
- }
47
- .myfixed1 {
48
- position: absolute;
49
- overflow: visible;
50
- left: 0;
51
- bottom: 0;
52
- border: 1px solid #880000;
53
- background-color: #FFEEDD;
54
- background-gradient: linear #dec7cd #fff0f2 0 1 0 0.5;
55
- padding: 1.5em;
56
- font-family:sans;
57
- margin: 0;
58
- }
59
- .myfixed2 {
60
- position: fixed;
61
- overflow: auto;
62
- right: 0;
63
- bottom: 0mm;
64
- width: 65mm;
65
- border: 1px solid #880000;
66
- background-color: #FFEEDD;
67
- background-gradient: linear #dec7cd #fff0f2 0 1 0 0.5;
68
- padding: 0.5em;
69
- font-family:sans;
70
- margin: 0;
71
- rotate: 90;
72
- }
73
- </style>
74
-
75
 
 
 
76
  </head>
77
- <body>
78
- <?php
79
 
80
  foreach($lead_ids as $lead_id) {
81
 
82
  $lead = RGFormsModel::get_lead($lead_id);
 
83
  $form_data = GFPDFEntryDetail::lead_detail_grid_array($form, $lead);
84
-
85
- /*
86
- * Add &data=1 when viewing the PDF via the admin area to view the $form_data array
87
- */
88
- PDF_Common::view_data($form_data);
89
-
90
- /*
91
- * Store your form fields from the $form_data array into variables here
92
- * To see your entire $form_data array, view your PDF via the admin area and add &data=1 to the url
93
- *
94
- * For an example of accessing $form_data fields see https://developer.gravitypdf.com/documentation/custom-templates-introduction/
95
- *
96
- * Alternatively, as of v3.4.0 you can use merge tags (except {allfields}) in your templates.
97
- * Just add merge tags to your HTML and they'll be parsed before generating the PDF.
98
- *
99
- */
100
-
101
- ?>
102
 
103
  <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/gravityformspdfextended.jpg" width="311" height="110" />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
104
 
105
- <h2>Floating &amp; Fixed Position elements</h2>
106
- <h4>CSS "Float"</h4>
107
- <div class="gradient">
108
- Block elements can be positioned alongside each other using the CSS property float: left or right. The clear property can also be used, set as left|right|both. Float is only supported on block elements (i.e. not SPAN etc.) and is not fully compliant with the CSS specification.
109
- Float only works properly if a width is set for the float, otherwise the width is set to the maximum available (full width, or less if floats already set).
110
- <br />
111
- Margin-right can still be set for a float:right and vice-versa.
112
- <br />
113
- A block element next to a float has the padding adjusted so that content fits in the remaining width. Text next to a float should wrap correctly, but backgrounds and borders will overlap and/or lie under the floats in a mess.
114
- <br />
115
- NB The width that is set defines the width of the content-box. So if you have two floats with width=50% and either of them has padding, margin or border, they will not fit together on the page.
116
- </div>
117
- <div class="gradient" style="float: right; width: 28%; margin-bottom: 0pt; ">
118
- <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.wmf" style="float:right" width="70" />This is text in a &lt;div&gt; element that is set to float:right and width:28%. It also has an image with float:right inside. With this exception, you cannot nest elements with the float property set inside one another.
119
- </div>
120
- <div class="gradient" style="float: left; width: 54%; margin-bottom: 0pt; ">
121
- This is text in a &lt;div&gt; element that is set to float:left and width:54%.
122
- </div>
123
- <div style="clear: both; margin: 0pt; padding: 0pt; "></div>
124
- This is text that follows a &lt;div&gt; element that is set to clear:both.
125
- <h4>CSS "Position"</h4>
126
- At the bottom of the page are two DIV elements with position:fixed and position:absolute set
127
- <div class="myfixed1">1 Praesent pharetra nulla in turpis. Sed ipsum nulla, sodales nec, vulputate in, scelerisque vitae, magna. Praesent pharetra nulla in turpis. Sed ipsum nulla, sodales nec, vulputate in, scelerisque vitae, magna. Sed egestas justo nec ipsum. Nulla facilisi. Praesent sit amet pede quis metus aliquet vulputate. Donec luctus. Cras euismod tellus vel leo. Sed egestas justo nec ipsum. Nulla facilisi. Praesent sit amet pede quis metus aliquet vulputate. Donec luctus. Cras euismod tellus vel leo.</div>
128
- <div class="myfixed2">2 Praesent pharetra nulla in turpis. Sed ipsum nulla, sodales nec, vulputate in, scelerisque vitae, magna. Sed egestas justo nec ipsum. Nulla facilisi. Praesent sit amet pede quis metus aliquet vulputate. Donec luctus. Cras euismod tellus vel leo.</div>
129
- <pagebreak />
130
- <div style="float: left; width: 29%; background: green">
131
- These are all floated left. 1 Praesent pharetra nulla in turpis. Sed ipsum nulla, sodales nec, vulputate in, scelerisque vitae, magna. Praesent pharetra nulla in turpis. Sed ipsum nulla, sodales nec, vulputate in, scelerisque vitae, magna. Sed egestas justo nec ipsum. Nulla facilisi. Praesent sit amet pede quis metus aliquet vulputate. Donec luctus. Cras euismod tellus vel leo. Sed egestas justo nec ipsum. Nulla facilisi. Praesent sit amet pede quis metus aliquet vulputate. Donec luctus. Cras euismod tellus vel leo.
132
- </div>
133
- <div style="float: left; width: 29%; background: grey">
134
- 2 Praesent pharetra nulla in turpis. Sed ipsum nulla, sodales nec, vulputate in, scelerisque vitae, magna. Praesent pharetra nulla in turpis. Sed ipsum nulla, sodales nec, vulputate in, scelerisque vitae, magna. Sed egestas justo nec ipsum. Nulla facilisi. Praesent sit amet pede quis metus aliquet vulputate. Donec luctus. Cras euismod tellus vel leo. Sed egestas justo nec ipsum. Nulla facilisi. Praesent sit amet pede quis metus aliquet vulputate. Donec luctus. Cras euismod tellus vel leo.
135
- </div>
136
- <div style="float: left; width: 29%; background: black; color: white;">
137
- 3 Praesent pharetra nulla in turpis. Sed ipsum nulla, sodales nec, vulputate in, scelerisque vitae, magna. Praesent pharetra nulla in turpis. Sed ipsum nulla, sodales nec, vulputate in, scelerisque vitae, magna. Sed egestas justo nec ipsum. Nulla facilisi. Praesent sit amet pede quis metus aliquet vulputate. Donec luctus. Cras euismod tellus vel leo. Sed egestas justo nec ipsum. Nulla facilisi. Praesent sit amet pede quis metus aliquet vulputate. Donec luctus. Cras euismod tellus vel leo.
138
- </div>
139
- <div style="clear: both">
140
- <div style="float: left; width: 20%; background: #EEE;">
141
- Floated left with a width of 20%. Praesent pharetra nulla in turpis. Sed ipsum nulla, sodales nec, vulputate in, scelerisque vitae, magna. Praesent pharetra nulla in turpis. Sed ipsum nulla, sodales nec, vulputate in, scelerisque vitae, magna. Sed egestas justo nec ipsum. Nulla facilisi. Praesent sit amet pede quis metus aliquet vulputate. Donec luctus. Cras euismod tellus vel leo. Sed egestas justo nec ipsum. Nulla facilisi. Praesent sit amet pede quis metus aliquet vulputate. Donec luctus. Cras euismod tellus vel leo.
142
- </div>
143
- <div style="float: right; width: 30%; background: #222222; color: #FFF">
144
- Floated right with a width of 30%. Praesent pharetra nulla in turpis. Sed ipsum nulla, sodales nec, vulputate in, scelerisque vitae, magna. Praesent pharetra nulla in turpis. Sed ipsum nulla, sodales nec, vulputate in, scelerisque vitae, magna. Sed egestas justo nec ipsum. Nulla facilisi. Praesent sit amet pede quis metus aliquet vulputate. Donec luctus. Cras euismod tellus vel leo. Sed egestas justo nec ipsum. Nulla facilisi. Praesent sit amet pede quis metus aliquet vulputate. Donec luctus. Cras euismod tellus vel leo.
145
- </div>
146
- </div>
147
- <pagebreak />
148
- <div style="float: left; width: 20%; background: #EEE;">
149
- Floated left with a width of 20%. Praesent pharetra nulla in turpis. Sed ipsum nulla, sodales nec, vulputate in, scelerisque vitae, magna. Praesent pharetra nulla in turpis. Sed ipsum nulla, sodales nec, vulputate in, scelerisque vitae, magna. Sed egestas justo nec ipsum. Nulla facilisi. Praesent sit amet pede quis metus aliquet vulputate. Donec luctus. Cras euismod tellus vel leo. Sed egestas justo nec ipsum. Nulla facilisi. Praesent sit amet pede quis metus aliquet vulputate. Donec luctus. Cras euismod tellus vel leo.
150
- </div>
151
- <div style="margin-left: 25%">
152
- By default this element will be positioned inline with the float. The start of the element should be inline with the top of the float. Praesent pharetra nulla in turpis. Sed ipsum nulla, sodales nec, vulputate in, scelerisque vitae, magna. Praesent pharetra nulla in turpis. Sed ipsum nulla, sodales nec, vulputate in, scelerisque vitae, magna. Sed egestas justo nec ipsum. Nulla facilisi. Praesent sit amet pede quis metus aliquet vulputate. Donec luctus. Cras euismod tellus vel leo. Sed egestas justo nec ipsum. Nulla facilisi. Praesent sit amet pede quis metus aliquet vulputate. Donec luctus. Cras euismod tellus vel leo.
153
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
154
 
155
- <?php } ?>
 
 
 
156
  </body>
157
  </html>
1
  <?php
2
 
3
  /**
4
+ * If the template is being loaded directy we'll call the Wordpress Core
5
+ * Used when attempting to debug the template
6
  */
7
  if(!class_exists("RGForms")){
8
+ return;
9
  }
10
 
11
+ /**
12
+ * Set up the form ID and lead ID, as well as we want page breaks displayed.
13
+ * Form ID and Lead ID can be set by passing it to the URL - ?fid=1&lid=10
14
+ */
15
+ PDF_Common::setup_ids();
16
+
17
  /**
18
+ * Load the form data, including the custom style sheet which looks in the plugin's theme folder before defaulting back to the plugin's file.
19
  */
20
  $form = RGFormsModel::get_form_meta($form_id);
21
+ $stylesheet_location = (file_exists(PDF_TEMPLATE_LOCATION.'template.css')) ? PDF_TEMPLATE_URL_LOCATION.'template.css' : PDF_PLUGIN_URL .'styles/template.css' ;
22
 
23
  ?>
24
 
25
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
26
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
27
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
28
+ <head>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
 
30
+ <title>Gravity Forms PDF Extended</title>
31
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
32
  </head>
33
+ <body>
34
+ <?php
35
 
36
  foreach($lead_ids as $lead_id) {
37
 
38
  $lead = RGFormsModel::get_lead($lead_id);
39
+ do_action("gform_print_entry_header", $form, $lead);
40
  $form_data = GFPDFEntryDetail::lead_detail_grid_array($form, $lead);
41
+ /*
42
+ * Add &data=1 when viewing the PDF via the admin area to view the $form_data array
43
+ */
44
+ PDF_Common::view_data($form_data);
45
+
46
+ /* get all the form values */
47
+ /*$date_created = $form_data['date_created'];
48
+
49
+ $first_name = $form_data['1.Name']['first'];
50
+ $last_name = $form_data['1.Name']['last'];*/
51
+
52
+ /* format the template */
53
+ ?>
 
 
 
 
 
54
 
55
  <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/gravityformspdfextended.jpg" width="311" height="110" />
56
+
57
+
58
+ <style>
59
+ .gradient {
60
+ border:0.1mm solid #220044;
61
+ background-color: #f0f2ff;
62
+ background-gradient: linear #c7cdde #f0f2ff 0 1 0 0.5;
63
+ }
64
+ h4 {
65
+ font-family: sans;
66
+ font-weight: bold;
67
+ margin-top: 1em;
68
+ margin-bottom: 0.5em;
69
+ }
70
+ div {
71
+ padding:1em;
72
+ margin-bottom: 1em;
73
+ text-align:justify;
74
+ }
75
+ .myfixed1 { position: absolute;
76
+ overflow: visible;
77
+ left: 0;
78
+ bottom: 0;
79
+ border: 1px solid #880000;
80
+ background-color: #FFEEDD;
81
+ background-gradient: linear #dec7cd #fff0f2 0 1 0 0.5;
82
+ padding: 1.5em;
83
+ font-family:sans;
84
+ margin: 0;
85
+ }
86
+ .myfixed2 { position: fixed;
87
+ overflow: auto;
88
+ right: 0;
89
+ bottom: 0mm;
90
+ width: 65mm;
91
+ border: 1px solid #880000;
92
+ background-color: #FFEEDD;
93
+ background-gradient: linear #dec7cd #fff0f2 0 1 0 0.5;
94
+ padding: 0.5em;
95
+ font-family:sans;
96
+ margin: 0;
97
+ rotate: 90;
98
+ }
99
+ </style>
100
+
101
+ <h2>Floating & Fixed Position elements</h2>
102
 
103
+ <h4>CSS "Float"</h4>
104
+ <div class="gradient">
105
+ Block elements can be positioned alongside each other using the CSS property float: left or right. The clear property can also be used, set as left|right|both. Float is only supported on block elements (i.e. not SPAN etc.) and is not fully compliant with the CSS specification.
106
+ Float only works properly if a width is set for the float, otherwise the width is set to the maximum available (full width, or less if floats already set).
107
+ <br />
108
+ Margin-right can still be set for a float:right and vice-versa.
109
+ <br />
110
+ A block element next to a float has the padding adjusted so that content fits in the remaining width. Text next to a float should wrap correctly, but backgrounds and borders will overlap and/or lie under the floats in a mess.
111
+ <br />
112
+ NB The width that is set defines the width of the content-box. So if you have two floats with width=50% and either of them has padding, margin or border, they will not fit together on the page.
113
+ </div>
114
+
115
+ <div class="gradient" style="float: right; width: 28%; margin-bottom: 0pt; ">
116
+ <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.wmf" style="float:right" width="70" />This is text in a &lt;div&gt; element that is set to float:right and width:28%. It also has an image with float:right inside. With this exception, you cannot nest elements with the float property set inside one another.
117
+ </div>
118
+ <div class="gradient" style="float: left; width: 54%; margin-bottom: 0pt; ">
119
+ This is text in a &lt;div&gt; element that is set to float:left and width:54%.
120
+ </div>
121
+
122
+ <div style="clear: both; margin: 0pt; padding: 0pt; "></div>
123
+ This is text that follows a &lt;div&gt; element that is set to clear:both.
124
+
125
+ <h4>CSS "Position"</h4>
126
+ At the bottom of the page are two DIV elements with position:fixed and position:absolute set
127
+
128
+ <div class="myfixed1">1 Praesent pharetra nulla in turpis. Sed ipsum nulla, sodales nec, vulputate in, scelerisque vitae, magna. Praesent pharetra nulla in turpis. Sed ipsum nulla, sodales nec, vulputate in, scelerisque vitae, magna. Sed egestas justo nec ipsum. Nulla facilisi. Praesent sit amet pede quis metus aliquet vulputate. Donec luctus. Cras euismod tellus vel leo. Sed egestas justo nec ipsum. Nulla facilisi. Praesent sit amet pede quis metus aliquet vulputate. Donec luctus. Cras euismod tellus vel leo.</div>
129
+
130
+ <div class="myfixed2">2 Praesent pharetra nulla in turpis. Sed ipsum nulla, sodales nec, vulputate in, scelerisque vitae, magna. Sed egestas justo nec ipsum. Nulla facilisi. Praesent sit amet pede quis metus aliquet vulputate. Donec luctus. Cras euismod tellus vel leo.</div>
131
+ <pagebreak />
132
+
133
+
134
+ <div style="float: left; width: 29%; background: green">
135
+ These are all floated left. 1 Praesent pharetra nulla in turpis. Sed ipsum nulla, sodales nec, vulputate in, scelerisque vitae, magna. Praesent pharetra nulla in turpis. Sed ipsum nulla, sodales nec, vulputate in, scelerisque vitae, magna. Sed egestas justo nec ipsum. Nulla facilisi. Praesent sit amet pede quis metus aliquet vulputate. Donec luctus. Cras euismod tellus vel leo. Sed egestas justo nec ipsum. Nulla facilisi. Praesent sit amet pede quis metus aliquet vulputate. Donec luctus. Cras euismod tellus vel leo.
136
+ </div>
137
+ <div style="float: left; width: 29%; background: grey">
138
+ 2 Praesent pharetra nulla in turpis. Sed ipsum nulla, sodales nec, vulputate in, scelerisque vitae, magna. Praesent pharetra nulla in turpis. Sed ipsum nulla, sodales nec, vulputate in, scelerisque vitae, magna. Sed egestas justo nec ipsum. Nulla facilisi. Praesent sit amet pede quis metus aliquet vulputate. Donec luctus. Cras euismod tellus vel leo. Sed egestas justo nec ipsum. Nulla facilisi. Praesent sit amet pede quis metus aliquet vulputate. Donec luctus. Cras euismod tellus vel leo.
139
+ </div>
140
+ <div style="float: left; width: 29%; background: black; color: white;">
141
+ 3 Praesent pharetra nulla in turpis. Sed ipsum nulla, sodales nec, vulputate in, scelerisque vitae, magna. Praesent pharetra nulla in turpis. Sed ipsum nulla, sodales nec, vulputate in, scelerisque vitae, magna. Sed egestas justo nec ipsum. Nulla facilisi. Praesent sit amet pede quis metus aliquet vulputate. Donec luctus. Cras euismod tellus vel leo. Sed egestas justo nec ipsum. Nulla facilisi. Praesent sit amet pede quis metus aliquet vulputate. Donec luctus. Cras euismod tellus vel leo.
142
+ </div>
143
+
144
+
145
+ <div style="clear: both">
146
+ <div style="float: left; width: 20%; background: #EEE;">
147
+ Floated left with a width of 20%. Praesent pharetra nulla in turpis. Sed ipsum nulla, sodales nec, vulputate in, scelerisque vitae, magna. Praesent pharetra nulla in turpis. Sed ipsum nulla, sodales nec, vulputate in, scelerisque vitae, magna. Sed egestas justo nec ipsum. Nulla facilisi. Praesent sit amet pede quis metus aliquet vulputate. Donec luctus. Cras euismod tellus vel leo. Sed egestas justo nec ipsum. Nulla facilisi. Praesent sit amet pede quis metus aliquet vulputate. Donec luctus. Cras euismod tellus vel leo.
148
+ </div>
149
+
150
+ <div style="float: right; width: 30%; background: #222222; color: #FFF">
151
+ Floated right with a width of 30%. Praesent pharetra nulla in turpis. Sed ipsum nulla, sodales nec, vulputate in, scelerisque vitae, magna. Praesent pharetra nulla in turpis. Sed ipsum nulla, sodales nec, vulputate in, scelerisque vitae, magna. Sed egestas justo nec ipsum. Nulla facilisi. Praesent sit amet pede quis metus aliquet vulputate. Donec luctus. Cras euismod tellus vel leo. Sed egestas justo nec ipsum. Nulla facilisi. Praesent sit amet pede quis metus aliquet vulputate. Donec luctus. Cras euismod tellus vel leo.
152
+ </div>
153
+ </div>
154
+
155
+ <pagebreak />
156
+
157
+ <div style="float: left; width: 20%; background: #EEE;">
158
+ Floated left with a width of 20%. Praesent pharetra nulla in turpis. Sed ipsum nulla, sodales nec, vulputate in, scelerisque vitae, magna. Praesent pharetra nulla in turpis. Sed ipsum nulla, sodales nec, vulputate in, scelerisque vitae, magna. Sed egestas justo nec ipsum. Nulla facilisi. Praesent sit amet pede quis metus aliquet vulputate. Donec luctus. Cras euismod tellus vel leo. Sed egestas justo nec ipsum. Nulla facilisi. Praesent sit amet pede quis metus aliquet vulputate. Donec luctus. Cras euismod tellus vel leo.
159
+ </div>
160
+
161
+ <div style="margin-left: 25%">
162
+ By default this element will be positioned inline with the float. The start of the element should be inline with the top of the float. Praesent pharetra nulla in turpis. Sed ipsum nulla, sodales nec, vulputate in, scelerisque vitae, magna. Praesent pharetra nulla in turpis. Sed ipsum nulla, sodales nec, vulputate in, scelerisque vitae, magna. Sed egestas justo nec ipsum. Nulla facilisi. Praesent sit amet pede quis metus aliquet vulputate. Donec luctus. Cras euismod tellus vel leo. Sed egestas justo nec ipsum. Nulla facilisi. Praesent sit amet pede quis metus aliquet vulputate. Donec luctus. Cras euismod tellus vel leo.
163
+ </div>
164
+
165
+
166
 
167
+ <?php
168
+ }
169
+
170
+ ?>
171
  </body>
172
  </html>
initialisation/templates/example-header-and-footer_06.php CHANGED
@@ -1,109 +1,101 @@
1
  <?php
2
 
3
  /**
4
- * Don't give direct access to the template
 
5
  */
6
  if(!class_exists("RGForms")){
7
- return;
8
  }
9
 
 
 
 
 
 
 
10
  /**
11
- * Load the form data to pass to our PDF generating function
12
  */
13
  $form = RGFormsModel::get_form_meta($form_id);
 
14
 
15
  ?>
16
 
17
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
18
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
19
- <html>
20
- <head>
21
- <link rel='stylesheet' href='<?php echo PDF_PLUGIN_URL .'initialisation/template.css'; ?>' type='text/css' />
22
- <?php
23
- /*
24
- * Create your own stylesheet or use the <style></style> tags to add or modify styles
25
- * The plugin stylesheet is overridden every update
26
- */
27
- ?>
28
- <title>Gravity PDF</title>
29
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
30
-
31
- <?php
32
- /*
33
- * Using the @page method we can set the headers and footers
34
- * This method is more reliable that the <sethtmlpageheaders> method
35
- * See mPDF documentation for more details
36
- * http://mpdf1.com/manual/index.php?tid=307&searchstring=@page
37
- */
38
- ?>
39
  <style>
40
- @page {
41
- header: html_myHTMLHeader1;
42
- footer: html_myFooter1;
43
- }
44
- </style>
45
  </head>
46
- <body>
47
- <?php
48
 
49
  foreach($lead_ids as $lead_id) {
50
 
51
  $lead = RGFormsModel::get_lead($lead_id);
 
52
  $form_data = GFPDFEntryDetail::lead_detail_grid_array($form, $lead);
53
-
54
- /*
55
- * Add &data=1 when viewing the PDF via the admin area to view the $form_data array
56
- */
57
- PDF_Common::view_data($form_data);
58
-
59
- /*
60
- * Store your form fields from the $form_data array into variables here
61
- * To see your entire $form_data array, view your PDF via the admin area and add &data=1 to the url
62
- *
63
- * For an example of accessing $form_data fields see https://developer.gravitypdf.com/documentation/custom-templates-introduction/
64
- *
65
- * Alternatively, as of v3.4.0 you can use merge tags (except {allfields}) in your templates.
66
- * Just add merge tags to your HTML and they'll be parsed before generating the PDF.
67
- *
68
- */
69
-
70
- ?>
71
 
72
- <!-- Defines the headers/footers -->
73
- <!-- Headers and footers set with CSS @page method above -->
74
 
75
- <htmlpageheader name="myHTMLHeader1">
76
- <table width="100%" style="border-bottom: 1px solid #000000; vertical-align: bottom; font-family: serif; font-size: 9pt; color: #000088;"><tr>
77
- <td width="50%">Main Header p <span style="font-size:14pt;">{PAGENO}</span></td>
78
- <td width="50%" style="text-align: right;"><span style="font-weight: bold;">myHTMLHeader1</span></td>
79
- </tr></table>
80
- </htmlpageheader>
81
-
82
- <htmlpagefooter name="myFooter1">
83
- <table width="100%" style="vertical-align: bottom; font-family: serif; font-size: 8pt;
84
- color: #000000; font-weight: bold; font-style: italic;"><tr>
85
- <td width="33%"><span style="font-weight: bold; font-style: italic;">{DATE j-m-Y}</span></td>
86
- <td width="33%" align="center" style="font-weight: bold; font-style: italic;">{PAGENO}/{nbpg}</td>
87
- <td width="33%" style="text-align: right; ">My document</td>
88
- </tr></table>
89
- </htmlpagefooter>
90
-
91
- <div>
92
- <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/gravityformspdfextended.jpg" width="311" height="110" />
93
- <h2>Basic Headers</h2>
94
-
95
- <p>Nulla felis erat, imperdiet eu, ullamcorper non, nonummy quis, elit. Suspendisse potenti. Ut a eros at ligula vehicula pretium. Maecenas feugiat pede vel risus. Nulla et lectus. Fusce eleifend neque sit amet erat. Integer consectetuer nulla non orci. Morbi feugiat pulvinar dolor. Cras odio. Donec mattis, nisi id euismod auctor, neque metus pellentesque risus, at eleifend lacus sapien et risus. Phasellus metus. Phasellus feugiat, lectus ac aliquam molestie, leo lacus tincidunt turpis, vel aliquam quam odio et sapien. Mauris ante pede, auctor ac, suscipit quis, malesuada sed, nulla. Integer sit amet odio sit amet lectus luctus euismod. Donec et nulla. Sed quis orci. </p>
96
- <pagebreak />
97
-
98
- <h2>Basic Headers</h2>
99
- <p>Nulla felis erat, imperdiet eu, ullamcorper non, nonummy quis, elit. Suspendisse potenti. Ut a eros at ligula vehicula pretium. Maecenas feugiat pede vel risus. Nulla et lectus. Fusce eleifend neque sit amet erat. Integer consectetuer nulla non orci. Morbi feugiat pulvinar dolor. Cras odio. Donec mattis, nisi id euismod auctor, neque metus pellentesque risus, at eleifend lacus sapien et risus. Phasellus metus. Phasellus feugiat, lectus ac aliquam molestie, leo lacus tincidunt turpis, vel aliquam quam odio et sapien. Mauris ante pede, auctor ac, suscipit quis, malesuada sed, nulla. Integer sit amet odio sit amet lectus luctus euismod. Donec et nulla. Sed quis orci. </p>
100
-
101
- <pagebreak />
102
-
103
- <h2>Basic Headers</h2>
104
- <p>Nulla felis erat, imperdiet eu, ullamcorper non, nonummy quis, elit. Suspendisse potenti. Ut a eros at ligula vehicula pretium. Maecenas feugiat pede vel risus. Nulla et lectus. Fusce eleifend neque sit amet erat. Integer consectetuer nulla non orci. Morbi feugiat pulvinar dolor. Cras odio. Donec mattis, nisi id euismod auctor, neque metus pellentesque risus, at eleifend lacus sapien et risus. Phasellus metus. Phasellus feugiat, lectus ac aliquam molestie, leo lacus tincidunt turpis, vel aliquam quam odio et sapien. Mauris ante pede, auctor ac, suscipit quis, malesuada sed, nulla. Integer sit amet odio sit amet lectus luctus euismod. Donec et nulla. Sed quis orci. </p>
105
- </div>
 
 
 
106
 
107
- <?php } ?>
108
- </body>
109
  </html>
1
  <?php
2
 
3
  /**
4
+ * If the template is being loaded directy we'll call the Wordpress Core
5
+ * Used when attempting to debug the template
6
  */
7
  if(!class_exists("RGForms")){
8
+ return;
9
  }
10
 
11
+ /**
12
+ * Set up the form ID and lead ID, as well as we want page breaks displayed.
13
+ * Form ID and Lead ID can be set by passing it to the URL - ?fid=1&lid=10
14
+ */
15
+ PDF_Common::setup_ids();
16
+
17
  /**
18
+ * Load the form data, including the custom style sheet which looks in the plugin's theme folder before defaulting back to the plugin's file.
19
  */
20
  $form = RGFormsModel::get_form_meta($form_id);
21
+ $stylesheet_location = (file_exists(PDF_TEMPLATE_LOCATION.'template.css')) ? PDF_TEMPLATE_URL_LOCATION.'template.css' : PDF_PLUGIN_URL .'styles/template.css' ;
22
 
23
  ?>
24
 
25
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
26
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
27
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
28
+ <head>
29
+
30
+ <title>Gravity Forms PDF Extended</title>
 
 
 
 
 
 
31
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
32
+
 
 
 
 
 
 
 
 
33
  <style>
34
+ @page {
35
+ header: html_myHTMLHeader1;
36
+ footer: html_myFooter1;
37
+ }
38
+ </style>
39
  </head>
40
+ <body>
41
+ <?php
42
 
43
  foreach($lead_ids as $lead_id) {
44
 
45
  $lead = RGFormsModel::get_lead($lead_id);
46
+ do_action("gform_print_entry_header", $form, $lead);
47
  $form_data = GFPDFEntryDetail::lead_detail_grid_array($form, $lead);
48
+ /*
49
+ * Add &data=1 when viewing the PDF via the admin area to view the $form_data array
50
+ */
51
+ PDF_Common::view_data($form_data);
52
+
53
+ /* get all the form values */
54
+ /*$date_created = $form_data['date_created'];
55
+
56
+ $first_name = $form_data['1.Name']['first'];
57
+ $last_name = $form_data['1.Name']['last'];*/
58
+
59
+ /* format the template */
60
+ ?>
 
 
 
 
 
61
 
62
+ <!-- defines the headers/footers - this must occur before the headers/footers are set -->
 
63
 
64
+ <htmlpageheader name="myHTMLHeader1">
65
+ <table width="100%" style="border-bottom: 1px solid #000000; vertical-align: bottom; font-family: serif; font-size: 9pt; color: #000088;"><tr>
66
+ <td width="50%">Left header p <span style="font-size:14pt;">{PAGENO}</span></td>
67
+ <td width="50%" style="text-align: right;"><span style="font-weight: bold;">myHTMLHeader1</span></td>
68
+ </tr></table>
69
+ </htmlpageheader>
70
+
71
+ <htmlpagefooter name="myFooter1">
72
+ <table width="100%" style="vertical-align: bottom; font-family: serif; font-size: 8pt;
73
+ color: #000000; font-weight: bold; font-style: italic;"><tr>
74
+ <td width="33%"><span style="font-weight: bold; font-style: italic;">{DATE j-m-Y}</span></td>
75
+ <td width="33%" align="center" style="font-weight: bold; font-style: italic;">{PAGENO}/{nbpg}</td>
76
+ <td width="33%" style="text-align: right; ">My document</td>
77
+ </tr></table>
78
+ </htmlpagefooter>
79
+
80
+ <div>
81
+ <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/gravityformspdfextended.jpg" width="311" height="110" />
82
+ <h2>Basic Headers</h2>
83
+
84
+ <p>Nulla felis erat, imperdiet eu, ullamcorper non, nonummy quis, elit. Suspendisse potenti. Ut a eros at ligula vehicula pretium. Maecenas feugiat pede vel risus. Nulla et lectus. Fusce eleifend neque sit amet erat. Integer consectetuer nulla non orci. Morbi feugiat pulvinar dolor. Cras odio. Donec mattis, nisi id euismod auctor, neque metus pellentesque risus, at eleifend lacus sapien et risus. Phasellus metus. Phasellus feugiat, lectus ac aliquam molestie, leo lacus tincidunt turpis, vel aliquam quam odio et sapien. Mauris ante pede, auctor ac, suscipit quis, malesuada sed, nulla. Integer sit amet odio sit amet lectus luctus euismod. Donec et nulla. Sed quis orci. </p>
85
+ <pagebreak />
86
+
87
+ <h2>Basic Headers</h2>
88
+ <p>Nulla felis erat, imperdiet eu, ullamcorper non, nonummy quis, elit. Suspendisse potenti. Ut a eros at ligula vehicula pretium. Maecenas feugiat pede vel risus. Nulla et lectus. Fusce eleifend neque sit amet erat. Integer consectetuer nulla non orci. Morbi feugiat pulvinar dolor. Cras odio. Donec mattis, nisi id euismod auctor, neque metus pellentesque risus, at eleifend lacus sapien et risus. Phasellus metus. Phasellus feugiat, lectus ac aliquam molestie, leo lacus tincidunt turpis, vel aliquam quam odio et sapien. Mauris ante pede, auctor ac, suscipit quis, malesuada sed, nulla. Integer sit amet odio sit amet lectus luctus euismod. Donec et nulla. Sed quis orci. </p>
89
+
90
+ <!-- Note the html_ prefix when referencing an HTML header using one of the pagebreaks -->
91
+ <pagebreak />
92
+
93
+ <h2>Basic Headers</h2>
94
+ <p>Nulla felis erat, imperdiet eu, ullamcorper non, nonummy quis, elit. Suspendisse potenti. Ut a eros at ligula vehicula pretium. Maecenas feugiat pede vel risus. Nulla et lectus. Fusce eleifend neque sit amet erat. Integer consectetuer nulla non orci. Morbi feugiat pulvinar dolor. Cras odio. Donec mattis, nisi id euismod auctor, neque metus pellentesque risus, at eleifend lacus sapien et risus. Phasellus metus. Phasellus feugiat, lectus ac aliquam molestie, leo lacus tincidunt turpis, vel aliquam quam odio et sapien. Mauris ante pede, auctor ac, suscipit quis, malesuada sed, nulla. Integer sit amet odio sit amet lectus luctus euismod. Donec et nulla. Sed quis orci. </p>
95
+ </div>
96
+ <?php
97
+ }
98
 
99
+ ?>
100
+ </body>
101
  </html>
initialisation/templates/example-images03.php CHANGED
@@ -1,240 +1,247 @@
1
  <?php
2
 
3
  /**
4
- * Don't give direct access to the template
 
5
  */
6
  if(!class_exists("RGForms")){
7
- return;
8
  }
9
 
 
 
 
 
 
 
10
  /**
11
- * Load the form data to pass to our PDF generating function
12
  */
13
  $form = RGFormsModel::get_form_meta($form_id);
 
14
 
15
  ?>
16
 
17
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
18
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
19
- <html>
20
- <head>
21
- <link rel='stylesheet' href='<?php echo PDF_PLUGIN_URL .'initialisation/template.css'; ?>' type='text/css' />
22
- <?php
23
- /*
24
- * Create your own stylesheet or use the <style></style> tags to add or modify styles
25
- * The plugin stylesheet is overridden every update
26
- */
27
- ?>
28
- <title>Gravity PDF</title>
29
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
30
-
31
- <style>
32
- table { border-collapse: collapse; margin-top: 0; text-align: center; }
33
- td { padding: 0.5em; }
34
- h1 { margin-bottom: 0; }
35
- </style>
36
  </head>
37
- <body>
38
- <?php
39
 
40
  foreach($lead_ids as $lead_id) {
41
 
42
  $lead = RGFormsModel::get_lead($lead_id);
 
43
  $form_data = GFPDFEntryDetail::lead_detail_grid_array($form, $lead);
44
-
45
- /*
46
- * Add &data=1 when viewing the PDF via the admin area to view the $form_data array
47
- */
48
- PDF_Common::view_data($form_data);
49
-
50
- /*
51
- * Store your form fields from the $form_data array into variables here
52
- * To see your entire $form_data array, view your PDF via the admin area and add &data=1 to the url
53
- *
54
- * For an example of accessing $form_data fields see https://developer.gravitypdf.com/documentation/custom-templates-introduction/
55
- *
56
- * Alternatively, as of v3.4.0 you can use merge tags (except {allfields}) in your templates.
57
- * Just add merge tags to your HTML and they'll be parsed before generating the PDF.
58
- *
59
- */
60
-
61
- ?>
62
 
63
- <img src="<?php echo PDF_PLUGIN_DIR; ?>/resources/images/gravityformspdfextended.jpg" width="311" height="110" />
64
-
65
- <h1>mPDF Images</h1>
66
- <table>
67
- <tr>
68
- <td>GIF</td>
69
- <td>JPG</td>
70
- <td>JPG (CMYK)</td>
71
- <td>PNG</td>
72
- <td>BMP</td>
73
- <td>WMF</td>
74
- <td>SVG</td>
75
- </tr>
76
- <tr>
77
- <td><img style="vertical-align: top" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.gif" width="80" /></td>
78
- <td><img style="vertical-align: top" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.jpg" width="80" /></td>
79
- <td><img style="vertical-align: top" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tigercmyk.jpg" width="80" /></td>
80
- <td><img style="vertical-align: top" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.png" width="80" /></td>
81
- <td><img style="vertical-align: top" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.bmp" width="80" /></td>
82
- <td><img style="vertical-align: top" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger2.wmf" width="80" /></td>
83
- <td><img style="vertical-align: top" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.svg" width="80" /></td>
84
- </tr>
85
- </tr>
86
- <tr>
87
- <td colspan="7" style="text-align: left" >
88
- <h4>Opacity 50%</h4>
89
- </td>
90
- </tr>
91
- <tr>
92
- <tr>
93
- <td><img style="vertical-align: top; opacity: 0.5" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.gif" width="80" /></td>
94
- <td><img style="vertical-align: top; opacity: 0.5" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.jpg" width="80" /></td>
95
- <td><img style="vertical-align: top; opacity: 0.5" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tigercmyk.jpg" width="80" /></td>
96
- <td><img style="vertical-align: top; opacity: 0.5" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.png" width="80" /></td>
97
- <td><img style="vertical-align: top; opacity: 0.5" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.bmp" width="80" /></td>
98
- <td><img style="vertical-align: top; opacity: 0.5" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger2.wmf" width="80" /></td>
99
- <td><img style="vertical-align: top; opacity: 0.5" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.svg" width="80" /></td>
100
- </tr>
101
- </table>
102
- <h4>Alpha channel</h4>
103
- <table>
104
- <tr>
105
- <td>PNG</td>
106
- <td><img style="vertical-align: top" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/alpha.png" width="85" /></td>
107
- <td style="background-color:#FFCCFF; "><img style="vertical-align: top" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/alpha.png" width="85" /></td>
108
- <td style="background-color:#FFFFCC;"><img style="vertical-align: top" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/alpha.png" width="85" /></td>
109
- <td style="background-color:#CCFFFF;"><img style="vertical-align: top" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/alpha.png" width="85" /></td>
110
- <td style="background-color:#CCFFFF; background: transparent url('<?php echo PDF_PLUGIN_DIR; ?>resources/images/bg.jpg') repeat scroll right top;"><img style="vertical-align: top" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/alpha.png" width="85" /></td>
111
- </tr>
112
- </table>
113
- <h4>Transparency</h4>
114
- <table>
115
- <tr>
116
- <td>PNG</td>
117
- <td style="background-color:#FFCCFF; "><img style="vertical-align: top" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger24trns.png" width="85" /></td>
118
- <td style="background-color:#FFFFCC;"><img style="vertical-align: top" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger24trns.png" width="85" /></td>
119
- <td style="background-color:#CCFFFF;"><img style="vertical-align: top" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger24trns.png" width="85" /></td>
120
- <td style="background-color:#CCFFFF; background: transparent url('<?php echo PDF_PLUGIN_DIR; ?>resources/images/bg.jpg') repeat scroll right top;"><img style="vertical-align: top" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger24trns.png" width="85" /></td>
121
- </tr>
122
- <tr>
123
- <td>GIF</td>
124
- <td style="background-color:#FFCCFF;"><img style="vertical-align: top" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger8trns.gif" width="85" /></td>
125
- <td style="background-color:#FFFFCC;"><img style="vertical-align: top" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger8trns.gif" width="85" /></td>
126
- <td style="background-color:#CCFFFF;"><img style="vertical-align: top" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger8trns.gif" width="85" /></td>
127
- <td style="background-color:#CCFFFF; background: transparent url('<?php echo PDF_PLUGIN_DIR; ?>resources/images/bg.jpg') repeat scroll right top;"><img style="vertical-align: top" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger8trns.gif" width="85" /></td>
128
- </tr>
129
- <tr>
130
- <td>WMF</td>
131
- <td style="background-color:#FFCCFF;"><img style="vertical-align: top" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger2.wmf" width="85" /></td>
132
- <td style="background-color:#FFFFCC;"><img style="vertical-align: top" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger2.wmf" width="85" /></td>
133
- <td style="background-color:#CCFFFF;"><img style="vertical-align: top" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger2.wmf" width="85" /></td>
134
- <td style="background-color:#CCFFFF; background: transparent url('<?php echo PDF_PLUGIN_DIR; ?>resources/images/bg.jpg') repeat scroll right top;"><img style="vertical-align: top" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger2.wmf" width="85" /></td>
135
- </tr>
136
- <tr>
137
- <td>SVG</td>
138
- <td style="background-color:#FFCCFF;"><img style="vertical-align: top" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.svg" width="85" /></td>
139
- <td style="background-color:#FFFFCC;"><img style="vertical-align: top" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.svg" width="85" /></td>
140
- <td style="background-color:#CCFFFF;"><img style="vertical-align: top" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.svg" width="85" /></td>
141
- <td style="background-color:#CCFFFF; background: transparent url('<?php echo PDF_PLUGIN_DIR; ?>resources/images/bg.jpg') repeat scroll right top;"><img style="vertical-align: top" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.svg" width="85" /></td>
142
- </tr>
143
- </table>
144
- Images returned from tiger.php
145
- <div>
146
- GIF <img style="vertical-align: top" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.gif" width="85" />
147
- JPG <img style="vertical-align: top" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.jpg" width="85" />
148
- PNG <img style="vertical-align: top" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.png" width="85" />
149
- WMF <img style="vertical-align: top" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.wmf" width="85" />
150
- SVG <img style="vertical-align: top" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.svg" width="85" />
151
- </div>
152
- <pagebreak />
153
- <h3>Image Alignment</h3>
154
- <div>From mPDF version 4.2 onwards, in-line images can be individually aligned (vertically). Most of the values for "vertical-align" are supported: top, bottom, middle, baseline, text-top, and text-bottom. The default value for vertical alignment has been changed to baseline, and the default padding to 0, consistent with most browsers.
155
- </div>
156
- <br />
157
- <div style="background-color:#CCFFFF;">
158
- These images <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/img1.png" style="vertical-align: top;" />
159
- are <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/img2.png" style="vertical-align: top;" />
160
- <b>top</b> <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/img3.png" style="vertical-align: top;" />
161
- aligned <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/img4.png" style="vertical-align: middle;" />
162
- </div>
163
- <br />
164
- <div style="background-color:#CCFFFF;">
165
- These images <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/img1.png" style="vertical-align: text-top;" />
166
- are <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/img2.png" style="vertical-align: text-top;" />
167
- <b>text-top</b> <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/img3.png" style="vertical-align: text-top;" />
168
- aligned <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/img4.png" style="vertical-align: middle;" />
169
- </div>
170
- <br />
171
- <div style="background-color:#CCFFFF;">
172
- These images <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/img1.png" style="vertical-align: bottom;" />
173
- are <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/img2.png" style="vertical-align: bottom;" />
174
- <b>bottom</b> <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/img3.png" style="vertical-align: bottom;" />
175
- aligned <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/img4.png" style="vertical-align: middle;" />
176
- </div>
177
- <br />
178
- <div style="background-color:#CCFFFF;">
179
- These images <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/img1.png" style="vertical-align: text-bottom;" />
180
- are <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/img2.png" style="vertical-align: text-bottom;" />
181
- <b>text-bottom</b> <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/img3.png" style="vertical-align: text-bottom;" />
182
- aligned <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/img4.png" style="vertical-align: middle;" />
183
- </div>
184
- <br />
185
- <div style="background-color:#CCFFFF;">
186
- These images <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/img1.png" style="vertical-align: baseline;" />
187
- are <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/img2.png" style="vertical-align: baseline;" />
188
- <b>baseline</b> <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/img3.png" style="vertical-align: baseline;" />
189
- aligned <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/img4.png" style="vertical-align: middle;" />
190
- </div>
191
- <br />
192
- <div style="background-color:#CCFFFF;">
193
- These images <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/img1.png" style="vertical-align: middle;" />
194
- are <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/img2.png" style="vertical-align: middle;" />
195
- <b>middle</b> <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/img3.png" style="vertical-align: middle;" />
196
- aligned <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/img5.png" style="vertical-align: bottom;" />
197
- </div>
198
- <br />
199
- <h4>Mixed alignment</h4>
200
- <div style="background-color:#CCFFFF;">
201
- baseline: <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/sunset.jpg" width="50" style="vertical-align: baseline;" />
202
- text-bottom: <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/sunset.jpg" width="30" style="vertical-align: text-bottom;" />
203
- middle: <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/sunset.jpg" width="30" style="vertical-align: middle;" />
204
- bottom: <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/sunset.jpg" width="80" style="vertical-align: bottom;" />
205
- text-top: <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/sunset.jpg" width="50" style="vertical-align: text-top;" />
206
- top: <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/sunset.jpg" width="100" style="vertical-align: top;" />
207
- </div>
208
- <h3>Image Border and padding</h3>
209
- From mPDF v4.2, Image padding is supported as well as border and margin.
210
- <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/sunset.jpg" width="100" style="border:3px solid #44FF44; padding: 1em;" />
211
-
212
- <h3>Rotated Images</h3>
213
- <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.png" width="100" />
214
- <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.png" rotate="90" width="100" />
215
- <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.png" rotate="180" width="100" />
216
- <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.png" rotate="-90" width="100" />
217
- <br />
218
-
219
- <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.jpg" width="100" />
220
- <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.jpg" rotate="90" width="100" />
221
- <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.jpg" rotate="180" width="100" />
222
- <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.jpg" rotate="-90" width="100" />
223
- <br />
224
-
225
- <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger2.wmf" width="80" /> &nbsp; &nbsp; &nbsp;
226
- <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger2.wmf" rotate="90" width="80" /> &nbsp; &nbsp; &nbsp;
227
- <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger2.wmf" rotate="180" width="80" /> &nbsp; &nbsp; &nbsp;
228
- <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger2.wmf" rotate="-90" width="80" />
229
- <br />
230
-
231
- <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.svg" width="100" />&nbsp;
232
- <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.svg" rotate="90" width="85" />&nbsp;
233
- <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.svg" rotate="180" width="100" />&nbsp;
234
- <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.svg" rotate="-90" width="85" />
235
-
 
 
 
 
 
 
 
 
 
 
236
 
237
 
238
- <?php } ?>
 
 
 
239
  </body>
240
  </html>
1
  <?php
2
 
3
  /**
4
+ * If the template is being loaded directy we'll call the Wordpress Core
5
+ * Used when attempting to debug the template
6
  */
7
  if(!class_exists("RGForms")){
8
+ return;
9
  }
10
 
11
+ /**
12
+ * Set up the form ID and lead ID, as well as we want page breaks displayed.
13
+ * Form ID and Lead ID can be set by passing it to the URL - ?fid=1&lid=10
14
+ */
15
+ PDF_Common::setup_ids();
16
+
17
  /**
18
+ * Load the form data, including the custom style sheet which looks in the plugin's theme folder before defaulting back to the plugin's file.
19
  */
20
  $form = RGFormsModel::get_form_meta($form_id);
21
+ $stylesheet_location = (file_exists(PDF_TEMPLATE_LOCATION.'template.css')) ? PDF_TEMPLATE_URL_LOCATION.'template.css' : PDF_PLUGIN_URL .'styles/template.css' ;
22
 
23
  ?>
24
 
25
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
26
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
27
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
28
+ <head>
29
+
30
+ <link rel='stylesheet' href='<?php echo $stylesheet_location; ?>' type='text/css' />
31
+ <title>Gravity Forms PDF Extended</title>
32
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
33
+
 
 
 
 
 
 
 
 
 
 
34
  </head>
35
+ <body>
36
+ <?php
37
 
38
  foreach($lead_ids as $lead_id) {
39
 
40
  $lead = RGFormsModel::get_lead($lead_id);
41
+ do_action("gform_print_entry_header", $form, $lead);
42
  $form_data = GFPDFEntryDetail::lead_detail_grid_array($form, $lead);
43
+ /*
44
+ * Add &data=1 when viewing the PDF via the admin area to view the $form_data array
45
+ */
46
+ PDF_Common::view_data($form_data);
47
+
48
+ /* get all the form values */
49
+ /*$date_created = $form_data['date_created'];
50
+
51
+ $first_name = $form_data['1.Name']['first'];
52
+ $last_name = $form_data['1.Name']['last'];*/
53
+
54
+ /* format the template */
55
+ ?>
 
 
 
 
 
56
 
57
+ <img src="<?php echo PDF_PLUGIN_DIR; ?>/resources/images/gravityformspdfextended.jpg" width="311" height="110" />
58
+
59
+ <style>
60
+ table { border-collapse: collapse; margin-top: 0; text-align: center; }
61
+ td { padding: 0.5em; }
62
+ h1 { margin-bottom: 0; }
63
+ </style>
64
+ <h1>mPDF Images</h1>
65
+
66
+ <table>
67
+ <tr>
68
+ <td>GIF</td>
69
+ <td>JPG</td>
70
+ <td>JPG (CMYK)</td>
71
+ <td>PNG</td>
72
+ <td>BMP</td>
73
+ <td>WMF</td>
74
+ <td>SVG</td>
75
+ </tr>
76
+ <tr>
77
+ <td><img style="vertical-align: top" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.gif" width="80" /></td>
78
+ <td><img style="vertical-align: top" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.jpg" width="80" /></td>
79
+ <td><img style="vertical-align: top" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tigercmyk.jpg" width="80" /></td>
80
+ <td><img style="vertical-align: top" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.png" width="80" /></td>
81
+ <td><img style="vertical-align: top" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.bmp" width="80" /></td>
82
+ <td><img style="vertical-align: top" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger2.wmf" width="80" /></td>
83
+ <td><img style="vertical-align: top" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.svg" width="80" /></td>
84
+ </tr>
85
+ </tr>
86
+ <tr>
87
+ <td colspan="7" style="text-align: left" ><h4>Opacity 50%</h4></td>
88
+ </tr>
89
+ <tr>
90
+ <tr>
91
+ <td><img style="vertical-align: top; opacity: 0.5" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.gif" width="80" /></td>
92
+ <td><img style="vertical-align: top; opacity: 0.5" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.jpg" width="80" /></td>
93
+ <td><img style="vertical-align: top; opacity: 0.5" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tigercmyk.jpg" width="80" /></td>
94
+ <td><img style="vertical-align: top; opacity: 0.5" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.png" width="80" /></td>
95
+ <td><img style="vertical-align: top; opacity: 0.5" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.bmp" width="80" /></td>
96
+ <td><img style="vertical-align: top; opacity: 0.5" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger2.wmf" width="80" /></td>
97
+ <td><img style="vertical-align: top; opacity: 0.5" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.svg" width="80" /></td>
98
+ </tr>
99
+ </table>
100
+
101
+ <h4>Alpha channel</h4>
102
+ <table>
103
+ <tr>
104
+ <td>PNG</td>
105
+ <td><img style="vertical-align: top" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/alpha.png" width="85" /></td>
106
+ <td style="background-color:#FFCCFF; "><img style="vertical-align: top" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/alpha.png" width="85" /></td>
107
+ <td style="background-color:#FFFFCC;"><img style="vertical-align: top" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/alpha.png" width="85" /></td>
108
+ <td style="background-color:#CCFFFF;"><img style="vertical-align: top" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/alpha.png" width="85" /></td>
109
+ <td style="background-color:#CCFFFF; background: transparent url('<?php echo PDF_PLUGIN_DIR; ?>resources/images/bg.jpg') repeat scroll right top;"><img style="vertical-align: top" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/alpha.png" width="85" /></td>
110
+ </tr>
111
+ </table>
112
+ <h4>Transparency</h4>
113
+ <table><tr>
114
+ <td>PNG</td>
115
+ <td style="background-color:#FFCCFF; "><img style="vertical-align: top" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger24trns.png" width="85" /></td>
116
+ <td style="background-color:#FFFFCC;"><img style="vertical-align: top" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger24trns.png" width="85" /></td>
117
+ <td style="background-color:#CCFFFF;"><img style="vertical-align: top" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger24trns.png" width="85" /></td>
118
+ <td style="background-color:#CCFFFF; background: transparent url('<?php echo PDF_PLUGIN_DIR; ?>resources/images/bg.jpg') repeat scroll right top;"><img style="vertical-align: top" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger24trns.png" width="85" /></td>
119
+ </tr><tr>
120
+ <td>GIF</td>
121
+ <td style="background-color:#FFCCFF;"><img style="vertical-align: top" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger8trns.gif" width="85" /></td>
122
+ <td style="background-color:#FFFFCC;"><img style="vertical-align: top" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger8trns.gif" width="85" /></td>
123
+ <td style="background-color:#CCFFFF;"><img style="vertical-align: top" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger8trns.gif" width="85" /></td>
124
+ <td style="background-color:#CCFFFF; background: transparent url('<?php echo PDF_PLUGIN_DIR; ?>resources/images/bg.jpg') repeat scroll right top;"><img style="vertical-align: top" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger8trns.gif" width="85" /></td>
125
+ </tr><tr>
126
+ <td>WMF</td>
127
+ <td style="background-color:#FFCCFF;"><img style="vertical-align: top" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger2.wmf" width="85" /></td>
128
+ <td style="background-color:#FFFFCC;"><img style="vertical-align: top" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger2.wmf" width="85" /></td>
129
+ <td style="background-color:#CCFFFF;"><img style="vertical-align: top" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger2.wmf" width="85" /></td>
130
+ <td style="background-color:#CCFFFF; background: transparent url('<?php echo PDF_PLUGIN_DIR; ?>resources/images/bg.jpg') repeat scroll right top;"><img style="vertical-align: top" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger2.wmf" width="85" /></td>
131
+ </tr><tr>
132
+ <td>SVG</td>
133
+ <td style="background-color:#FFCCFF;"><img style="vertical-align: top" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.svg" width="85" /></td>
134
+ <td style="background-color:#FFFFCC;"><img style="vertical-align: top" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.svg" width="85" /></td>
135
+ <td style="background-color:#CCFFFF;"><img style="vertical-align: top" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.svg" width="85" /></td>
136
+ <td style="background-color:#CCFFFF; background: transparent url('<?php echo PDF_PLUGIN_DIR; ?>resources/images/bg.jpg') repeat scroll right top;"><img style="vertical-align: top" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.svg" width="85" /></td>
137
+ </tr></table>
138
+
139
+
140
+ Images returned from tiger.php
141
+ <div>
142
+ GIF <img style="vertical-align: top" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.gif" width="85" />
143
+ JPG <img style="vertical-align: top" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.jpg" width="85" />
144
+ PNG <img style="vertical-align: top" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.png" width="85" />
145
+ WMF <img style="vertical-align: top" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.wmf" width="85" />
146
+ SVG <img style="vertical-align: top" src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.svg" width="85" />
147
+ </div>
148
+
149
+ <pagebreak />
150
+
151
+
152
+ <h3>Image Alignment</h3>
153
+ <div>From mPDF version 4.2 onwards, in-line images can be individually aligned (vertically). Most of the values for "vertical-align" are supported: top, bottom, middle, baseline, text-top, and text-bottom. The default value for vertical alignment has been changed to baseline, and the default padding to 0, consistent with most browsers.
154
+ </div>
155
+ <br />
156
+
157
+ <div style="background-color:#CCFFFF;">
158
+ These images <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/img1.png" style="vertical-align: top;" />
159
+ are <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/img2.png" style="vertical-align: top;" />
160
+ <b>top</b> <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/img3.png" style="vertical-align: top;" />
161
+ aligned <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/img4.png" style="vertical-align: middle;" />
162
+ </div>
163
+ <br />
164
+
165
+ <div style="background-color:#CCFFFF;">
166
+ These images <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/img1.png" style="vertical-align: text-top;" />
167
+ are <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/img2.png" style="vertical-align: text-top;" />
168
+ <b>text-top</b> <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/img3.png" style="vertical-align: text-top;" />
169
+ aligned <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/img4.png" style="vertical-align: middle;" />
170
+ </div>
171
+ <br />
172
+
173
+ <div style="background-color:#CCFFFF;">
174
+ These images <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/img1.png" style="vertical-align: bottom;" />
175
+ are <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/img2.png" style="vertical-align: bottom;" />
176
+ <b>bottom</b> <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/img3.png" style="vertical-align: bottom;" />
177
+ aligned <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/img4.png" style="vertical-align: middle;" />
178
+ </div>
179
+ <br />
180
+
181
+ <div style="background-color:#CCFFFF;">
182
+ These images <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/img1.png" style="vertical-align: text-bottom;" />
183
+ are <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/img2.png" style="vertical-align: text-bottom;" />
184
+ <b>text-bottom</b> <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/img3.png" style="vertical-align: text-bottom;" />
185
+ aligned <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/img4.png" style="vertical-align: middle;" />
186
+ </div>
187
+ <br />
188
+
189
+ <div style="background-color:#CCFFFF;">
190
+ These images <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/img1.png" style="vertical-align: baseline;" />
191
+ are <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/img2.png" style="vertical-align: baseline;" />
192
+ <b>baseline</b> <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/img3.png" style="vertical-align: baseline;" />
193
+ aligned <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/img4.png" style="vertical-align: middle;" />
194
+ </div>
195
+ <br />
196
+
197
+ <div style="background-color:#CCFFFF;">
198
+ These images <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/img1.png" style="vertical-align: middle;" />
199
+ are <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/img2.png" style="vertical-align: middle;" />
200
+ <b>middle</b> <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/img3.png" style="vertical-align: middle;" />
201
+ aligned <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/img5.png" style="vertical-align: bottom;" />
202
+ </div>
203
+ <br />
204
+
205
+ <h4>Mixed alignment</h4>
206
+ <div style="background-color:#CCFFFF;">
207
+ baseline: <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/sunset.jpg" width="50" style="vertical-align: baseline;" />
208
+ text-bottom: <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/sunset.jpg" width="30" style="vertical-align: text-bottom;" />
209
+ middle: <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/sunset.jpg" width="30" style="vertical-align: middle;" />
210
+ bottom: <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/sunset.jpg" width="80" style="vertical-align: bottom;" />
211
+ text-top: <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/sunset.jpg" width="50" style="vertical-align: text-top;" />
212
+ top: <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/sunset.jpg" width="100" style="vertical-align: top;" />
213
+ </div>
214
+
215
+ <h3>Image Border and padding</h3>
216
+ From mPDF v4.2, Image padding is supported as well as border and margin.
217
+ <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/sunset.jpg" width="100" style="border:3px solid #44FF44; padding: 1em;" />
218
+
219
+ <h3>Rotated Images</h3>
220
+ <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.png" width="100" />
221
+ <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.png" rotate="90" width="100" />
222
+ <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.png" rotate="180" width="100" />
223
+ <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.png" rotate="-90" width="100" />
224
+ <br />
225
+ <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.jpg" width="100" />
226
+ <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.jpg" rotate="90" width="100" />
227
+ <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.jpg" rotate="180" width="100" />
228
+ <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.jpg" rotate="-90" width="100" />
229
+ <br />
230
+ <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger2.wmf" width="80" /> &nbsp; &nbsp; &nbsp;
231
+ <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger2.wmf" rotate="90" width="80" /> &nbsp; &nbsp; &nbsp;
232
+ <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger2.wmf" rotate="180" width="80" /> &nbsp; &nbsp; &nbsp;
233
+ <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger2.wmf" rotate="-90" width="80" />
234
+ <br />
235
+ <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.svg" width="100" />&nbsp;
236
+ <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.svg" rotate="90" width="85" />&nbsp;
237
+ <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.svg" rotate="180" width="100" />&nbsp;
238
+ <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.svg" rotate="-90" width="85" />
239
+ <br />
240
 
241
 
242
+ <?php
243
+ }
244
+
245
+ ?>
246
  </body>
247
  </html>
initialisation/templates/example-tables04.php CHANGED
@@ -1,1732 +1,1174 @@
1
  <?php
2
 
3
  /**
4
- * Don't give direct access to the template
 
5
  */
6
  if(!class_exists("RGForms")){
7
- return;
8
  }
9
 
 
 
 
 
 
 
10
  /**
11
- * Load the form data to pass to our PDF generating function
12
  */
13
  $form = RGFormsModel::get_form_meta($form_id);
 
14
 
15
  ?>
16
 
17
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
18
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
19
- <html>
20
- <head>
21
- <link rel='stylesheet' href='<?php echo PDF_PLUGIN_URL .'initialisation/template.css'; ?>' type='text/css' />
22
- <?php
23
- /*
24
- * Create your own stylesheet or use the <style></style> tags to add or modify styles
25
- * The plugin stylesheet is overridden every update
26
- */
27
- ?>
28
- <title>Gravity PDF</title>
29
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
30
-
31
- <style>
32
-
33
- body {
34
- font-family: DejaVuSansCondensed;
35
- font-size: 11pt;
36
- }
37
-
38
- p {
39
- margin-bottom: 4pt;
40
- margin-top: 0pt;
41
- }
42
-
43
- table {
44
- font-family: DejaVuSansCondensed;
45
- font-size: 9pt;
46
- line-height: 1.2;
47
- margin-top: 2pt;
48
- margin-bottom: 5pt;
49
- border-collapse: collapse;
50
- }
51
-
52
- thead {
53
- font-weight: bold;
54
- vertical-align: bottom;
55
- }
56
-
57
- tfoot {
58
- font-weight: bold;
59
- vertical-align: top;
60
- }
61
-
62
- thead td {
63
- font-weight: bold;
64
- }
65
-
66
- tfoot td {
67
- font-weight: bold;
68
- }
69
-
70
- thead td, thead th, tfoot td, tfoot th {
71
- font-variant: small-caps;
72
- }
73
-
74
- .headerrow td, .headerrow th {
75
- background-gradient: linear #b7cebd #f5f8f5 0 1 0 0.2;
76
- }
77
-
78
- .footerrow td, .footerrow th {
79
- background-gradient: linear #b7cebd #f5f8f5 0 1 0 0.2;
80
- }
81
-
82
- th {
83
- font-weight: bold;
84
- vertical-align: top;
85
- text-align: left;
86
- padding-left: 2mm;
87
- padding-right: 2mm;
88
- padding-top: 0.5mm;
89
- padding-bottom: 0.5mm;
90
- }
91
-
92
- td {
93
- padding-left: 2mm;
94
- vertical-align: top;
95
- text-align: left;
96
- padding-right: 2mm;
97
- padding-top: 0.5mm;
98
- padding-bottom: 0.5mm;
99
- }
100
-
101
- th p {
102
- text-align: left;
103
- margin: 0pt;
104
- }
105
-
106
- td p {
107
- text-align: left;
108
- margin: 0pt;
109
- }
110
 
111
  table.widecells td {
112
- padding-left: 5mm;
113
- padding-right: 5mm;
114
  }
115
-
116
  table.tallcells td {
117
- padding-top: 3mm;
118
- padding-bottom: 3mm;
119
- }
120
-
121
- hr {
122
- width: 70%;
123
- height: 1px;
124
- text-align: center;
125
- color: #999999;
126
- margin-top: 8pt;
127
- margin-bottom: 8pt;
128
- }
129
-
130
- a {
131
- color: #000066;
132
- font-style: normal;
133
- text-decoration: underline;
134
- font-weight: normal;
135
- }
136
-
137
- ul {
138
- text-indent: 5mm;
139
- margin-bottom: 9pt;
140
- }
141
-
142
- ol {
143
- text-indent: 5mm;
144
- margin-bottom: 9pt;
145
- }
146
-
147
- pre {
148
- font-family: DejaVuSansMono;
149
- font-size: 9pt;
150
- margin-top: 5pt;
151
- margin-bottom: 5pt;
152
- }
153
-
154
- h1 {
155
- font-weight: normal;
156
- font-size: 26pt;
157
- color: #000066;
158
- font-family: DejaVuSansCondensed;
159
- margin-top: 18pt;
160
- margin-bottom: 6pt;
161
- border-top: 0.075cm solid #000000;
162
- border-bottom: 0.075cm solid #000000;
163
- text-align: ; page-break-after:avoid;
164
- }
165
-
166
- h2 {
167
- font-weight: bold;
168
- font-size: 12pt;
169
- color: #000066;
170
- font-family: DejaVuSansCondensed;
171
- margin-top: 6pt;
172
- margin-bottom: 6pt;
173
- border-top: 0.07cm solid #000000;
174
- border-bottom: 0.07cm solid #000000;
175
- text-align: ; text-transform:uppercase;
176
- page-break-after: avoid;
177
  }
178
 
179
- h3 {
180
- font-weight: normal;
181
- font-size: 26pt;
182
- color: #000000;
183
- font-family: DejaVuSansCondensed;
184
- margin-top: 0pt;
185
- margin-bottom: 6pt;
186
- border-top: 0;
187
- border-bottom: 0;
188
- text-align: ; page-break-after:avoid;
189
- }
190
-
191
- h4 {
192
- font-weight: ; font-size: 13pt;
193
- color: #9f2b1e;
194
- font-family: DejaVuSansCondensed;
195
- margin-top: 10pt;
196
- margin-bottom: 7pt;
197
- font-variant: small-caps;
198
- text-align: ; margin-collapse:collapse;
199
- page-break-after: avoid;
200
- }
201
-
202
- h5 {
203
- font-weight: bold;
204
- font-style: italic;
205
- ; font-size: 11pt;
206
- color: #000044;
207
- font-family: DejaVuSansCondensed;
208
- margin-top: 8pt;
209
- margin-bottom: 4pt;
210
- text-align: ; page-break-after:avoid;
211
- }
212
-
213
- h6 {
214
- font-weight: bold;
215
- font-size: 9.5pt;
216
- color: #333333;
217
- font-family: DejaVuSansCondensed;
218
- margin-top: 6pt;
219
- margin-bottom: ;
220
- text-align:;
221
- page-break-after: avoid;
222
- }
223
 
224
  .breadcrumb {
225
- text-align: right;
226
- font-size: 8pt;
227
- font-family: DejaVuSerifCondensed;
228
- color: #666666;
229
- font-weight: bold;
230
- font-style: normal;
231
- margin-bottom: 6pt;
232
- }
233
-
234
- .evenrow td, .evenrow th {
235
- background-color: #f5f8f5;
236
- }
237
-
238
- .oddrow td, .oddrow th {
239
- background-color: #e3ece4;
240
- }
241
-
242
- .bpmTopic {
243
- background-color: #e3ece4;
244
- }
245
-
246
- .bpmTopicC {
247
- background-color: #e3ece4;
248
- }
249
-
250
- .bpmNoLines {
251
- background-color: #e3ece4;
252
- }
253
-
254
- .bpmNoLinesC {
255
- background-color: #e3ece4;
256
- }
257
-
258
- .bpmClear {
259
- }
260
-
261
- .bpmClearC {
262
- text-align: center;
263
- }
264
-
265
- .bpmTopnTail {
266
- background-color: #e3ece4;
267
- topntail: 0.02cm solid #495b4a;
268
- }
269
-
270
- .bpmTopnTailC {
271
- background-color: #e3ece4;
272
- topntail: 0.02cm solid #495b4a;
273
- }
274
-
275
- .bpmTopnTailClear {
276
- topntail: 0.02cm solid #495b4a;
277
- }
278
-
279
- .bpmTopnTailClearC {
280
- topntail: 0.02cm solid #495b4a;
281
- }
282
-
283
- .bpmTopicC td, .bpmTopicC td p {
284
- text-align: center;
285
- }
286
-
287
- .bpmNoLinesC td, .bpmNoLinesC td p {
288
- text-align: center;
289
- }
290
-
291
- .bpmClearC td, .bpmClearC td p {
292
- text-align: center;
293
- }
294
-
295
- .bpmTopnTailC td, .bpmTopnTailC td p {
296
- text-align: center;
297
- }
298
-
299
- .bpmTopnTailClearC td, .bpmTopnTailClearC td p {
300
- text-align: center;
301
- }
302
-
303
- .pmhMiddleCenter {
304
- text-align: center;
305
- vertical-align: middle;
306
- }
307
-
308
- .pmhMiddleRight {
309
- text-align: right;
310
- vertical-align: middle;
311
- }
312
-
313
- .pmhBottomCenter {
314
- text-align: center;
315
- vertical-align: bottom;
316
- }
317
-
318
- .pmhBottomRight {
319
- text-align: right;
320
- vertical-align: bottom;
321
- }
322
-
323
- .pmhTopCenter {
324
- text-align: center;
325
- vertical-align: top;
326
- }
327
-
328
- .pmhTopRight {
329
- text-align: right;
330
- vertical-align: top;
331
- }
332
-
333
- .pmhTopLeft {
334
- text-align: left;
335
- vertical-align: top;
336
- }
337
-
338
- .pmhBottomLeft {
339
- text-align: left;
340
- vertical-align: bottom;
341
- }
342
-
343
- .pmhMiddleLeft {
344
- text-align: left;
345
- vertical-align: middle;
346
- }
347
-
348
- .infobox {
349
- margin-top: 10pt;
350
- background-color: #DDDDBB;
351
- text-align: center;
352
- border: 1px solid #880000;
353
- }
354
-
355
- .bpmTopic td, .bpmTopic th {
356
- border-top: 1px solid #FFFFFF;
357
- }
358
-
359
- .bpmTopicC td, .bpmTopicC th {
360
- border-top: 1px solid #FFFFFF;
361
- }
362
-
363
- .bpmTopnTail td, .bpmTopnTail th {
364
- border-top: 1px solid #FFFFFF;
365
- }
366
-
367
- .bpmTopnTailC td, .bpmTopnTailC th {
368
- border-top: 1px solid #FFFFFF;
369
- }
370
- </style>
371
  </head>
372
- <body>
373
- <?php
374
 
375
  foreach($lead_ids as $lead_id) {
376
 
377
  $lead = RGFormsModel::get_lead($lead_id);
 
378
  $form_data = GFPDFEntryDetail::lead_detail_grid_array($form, $lead);
379
-
380
- /*
381
- * Add &data=1 when viewing the PDF via the admin area to view the $form_data array
382
- */
383
- PDF_Common::view_data($form_data);
384
-
385
- /*
386
- * Store your form fields from the $form_data array into variables here
387
- * To see your entire $form_data array, view your PDF via the admin area and add &data=1 to the url
388
- *
389
- * For an example of accessing $form_data fields see https://developer.gravitypdf.com/documentation/custom-templates-introduction/
390
- *
391
- * Alternatively, as of v3.4.0 you can use merge tags (except {allfields}) in your templates.
392
- * Just add merge tags to your HTML and they'll be parsed before generating the PDF.
393
- *
394
- */
395
-
396
- ?>
397
-
398
 
399
- <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/gravityformspdfextended.jpg" width="311" height="110" />
400
 
401
- <h1>mPDF</h1>
402
- <h2>Tables</h2>
403
- <h3>CSS Styles</h3>
404
- <p>The CSS properties for tables and cells is increased over that in html2fpdf. It includes recognition of THEAD, TFOOT and TH.<br />See below for other facilities such as autosizing, and rotation.</p>
405
- <table border="1">
406
- <tbody>
407
- <tr>
408
- <td>Row 1</td>
409
- <td>This is data</td>
410
- <td>This is data</td>
411
- </tr>
412
- <tr>
413
- <td>Row 2</td>
414
- <td style="background-gradient: linear #c7cdde #f0f2ff 0 1 0 0.5;">
415
- <p>This is data p</p>
416
- This is data out of p
417
- <p style="font-weight:bold; font-size:20pt; background-color:#FFBBFF;">This is bold data p</p>
418
- <b>This is bold data out of p</b><br />
419
- This is normal data after br
420
- <h3>H3 in a table</h3>
421
- <div>This is data div</div>
422
- This is data out of div
423
- <div style="font-weight:bold;">This is data div (bold)</div>
424
- This is data out of div
425
- </td>
426
- <td>
427
- <p>More data</p>
428
- <p style="font-size:12pt;">This is large text</p>
429
- </td>
430
- </tr>
431
- <tr>
432
- <td>
433
- <p>Row 3</p>
434
- </td>
435
- <td>
436
- <p>This is long data</p>
437
- </td>
438
- <td>This is data</td>
439
- </tr>
440
- <tr>
441
- <td>
442
- <p>Row 4 &lt;td&gt; cell</p>
443
- </td>
444
- <td>This is data</td>
445
- <td>
446
- <p>This is data</p>
447
- </td>
448
- </tr>
449
- <tr>
450
- <td>Row 5</td>
451
- <td>Also data</td>
452
- <td>Also data</td>
453
- </tr>
454
- <tr>
455
- <td>Row 6</td>
456
- <td>Also data</td>
457
- <td>Also data</td>
458
- </tr>
459
- <tr>
460
- <td>Row 7</td>
461
- <td>Also data</td>
462
- <td>Also data</td>
463
- </tr>
464
- <tr>
465
- <td>Row 8</td>
466
- <td>Also data</td>
467
- <td>Also data</td>
468
- </tr>
469
- </tbody>
470
- </table>
471
- <p>This table has padding-left and -right set to 5mm i.e. padding within the cells. Also border colour and style, font family and size are set by <acronym>CSS</acronym>.</p>
472
- <table align="right" style="border: 1px solid #880000; font-family: Mono; font-size: 7pt; " class="widecells">
473
- <tbody>
474
- <tr>
475
- <td>Row 1</td>
476
- <td>This is data</td>
477
- <td>This is data</td>
478
- </tr>
479
- <tr>
480
- <td>Row 2</td>
481
- <td>
482
- <p>This is data p</p>
483
- </td>
484
- <td>
485
- <p>More data</p>
486
- </td>
487
- </tr>
488
- <tr>
489
- <td>
490
- <p>Row 3</p>
491
- </td>
492
- <td>
493
- <p>This is long data</p>
494
- </td>
495
- <td>This is data</td>
496
- </tr>
497
- <tr>
498
- <td>
499
- <p>Row 4 &lt;td&gt; cell</p>
500
- </td>
501
- <td>This is data</td>
502
- <td>
503
- <p>This is data</p>
504
- </td>
505
- </tr>
506
- <tr>
507
- <td>Row 5</td>
508
- <td>Also data</td>
509
- <td>Also data</td>
510
- </tr>
511
- <tr>
512
- <td>Row 6</td>
513
- <td>Also data</td>
514
- <td>Also data</td>
515
- </tr>
516
- <tr>
517
- <td>Row 7</td>
518
- <td>Also data</td>
519
- <td>Also data</td>
520
- </tr>
521
- <tr>
522
- <td>Row 8</td>
523
- <td>Also data</td>
524
- <td>Also data</td>
525
- </tr>
526
- </tbody>
527
- </table>
528
- <p>This table has padding-top and -bottom set to 3mm i.e. padding within the cells. Also background-, border colour and style, font family and size are set by in-line <acronym>CSS</acronym>.</p>
529
- <table style="border: 1px solid #880000; background-color: #BBCCDD; font-family: Mono; font-size: 7pt; " class="tallcells">
530
- <tbody>
531
- <tr>
532
- <td>Row 1</td>
533
- <td>This is data</td>
534
- <td>This is data</td>
535
- </tr>
536
- <tr>
537
- <td>Row 2</td>
538
- <td>
539
- <p>This is data p</p>
540
- </td>
541
- <td>
542
- <p>More data</p>
543
- </td>
544
- </tr>
545
- <tr>
546
- <td>
547
- <p>Row 3</p>
548
- </td>
549
- <td>
550
- <p>This is long data</p>
551
- </td>
552
- <td>This is data</td>
553
- </tr>
554
- </tbody>
555
- </table>
556
- <h3 style="margin-top: 20pt; margin-collapse:collapse;">Table Styles</h3>
557
- <p>The style sheet used for these examples shows some of the table styles I use on my website. The property 'topntail' defined by a border-type definition e.g. "1px solid #880000" puts a border at the top and bottom of the table, and also below a header row (thead) if defined. Note also that &lt;thead&gt; will automatically turn on the header-repeat i.e. reproduce the header row at the top of each page.</p>
558
- <p>bpmTopic Class</p>
559
- <table class="bpmTopic">
560
- <thead></thead>
561
- <tbody>
562
- <tr>
563
- <td>Row 1</td>
564
- <td>This is data</td>
565
- <td>This is data</td>
566
- </tr>
567
- <tr>
568
- <td>Row 2</td>
569
- <td>
570
- <p>This is data p</p>
571
- </td>
572
- <td>
573
- <p>More data</p>
574
- </td>
575
- </tr>
576
- <tr>
577
- <td>
578
- <p>Row 3</p>
579
- </td>
580
- <td>
581
- <p>This is long data</p>
582
- </td>
583
- <td>This is data</td>
584
- </tr>
585
- <tr>
586
- <td>
587
- <p>Row 4 &lt;td&gt; cell</p>
588
- </td>
589
- <td>This is data</td>
590
- <td>
591
- <p>This is data</p>
592
- </td>
593
- </tr>
594
- <tr>
595
- <td>Row 5</td>
596
- <td>Also data</td>
597
- <td>Also data</td>
598
- </tr>
599
- <tr>
600
- <td>Row 6</td>
601
- <td>Also data</td>
602
- <td>Also data</td>
603
- </tr>
604
- <tr>
605
- <td>Row 7</td>
606
- <td>Also data</td>
607
- <td>Also data</td>
608
- </tr>
609
- <tr>
610
- <td>Row 8</td>
611
- <td>Also data</td>
612
- <td>Also data</td>
613
- </tr>
614
- </tbody>
615
- </table>
616
- <p>&nbsp;</p>
617
- <p>bpmTopic<b>C</b> Class (centered) Odd and Even rows</p>
618
- <table class="bpmTopicC">
619
- <thead>
620
- <tr class="headerrow">
621
- <th>Col/Row Header</th>
622
- <td>
623
- <p>Second column header p</p>
624
- </td>
625
- <td>Third column header</td>
626
- </tr>
627
- </thead>
628
- <tbody>
629
- <tr class="oddrow">
630
- <th>Row header 1</th>
631
- <td>This is data</td>
632
- <td>This is data</td>
633
- </tr>
634
- <tr class="evenrow">
635
- <th>Row header 2</th>
636
- <td>
637
- <p>This is data p</p>
638
- </td>
639
- <td>
640
- <p>This is data</p>
641
- </td>
642
- </tr>
643
- <tr class="oddrow">
644
- <th>
645
- <p>Row header 3</p>
646
- </th>
647
- <td>
648
- <p>This is long data</p>
649
- </td>
650
- <td>This is data</td>
651
- </tr>
652
- <tr class="evenrow">
653
- <th>
654
- <p>Row header 4</p>
655
- <p>&lt;th&gt; cell acting as header</p>
656
- </th>
657
- <td>This is data</td>
658
- <td>
659
- <p>This is data</p>
660
- </td>
661
- </tr>
662
- <tr class="oddrow">
663
- <th>Row header 5</th>
664
- <td>Also data</td>
665
- <td>Also data</td>
666
- </tr>
667
- <tr class="evenrow">
668
- <th>Row header 6</th>
669
- <td>Also data</td>
670
- <td>Also data</td>
671
- </tr>
672
- <tr class="oddrow">
673
- <th>Row header 7</th>
674
- <td>Also data</td>
675
- <td>Also data</td>
676
- </tr>
677
- <tr class="evenrow">
678
- <th>Row header 8</th>
679
- <td>Also data</td>
680
- <td>Also data</td>
681
- </tr>
682
- </tbody>
683
- </table>
684
- <p>&nbsp;</p>
685
- <p>bpmTopnTail Class </p>
686
- <table class="bpmTopnTail">
687
- <thead></thead>
688
- <tbody>
689
- <tr>
690
- <td>Row 1</td>
691
- <td>This is data</td>
692
- <td>This is data</td>
693
- </tr>
694
- <tr>
695
- <td>Row 2</td>
696
- <td>
697
- <p>This is data p</p>
698
- </td>
699
- <td>
700
- <p>This is data</p>
701
- </td>
702
- </tr>
703
- <tr>
704
- <td>
705
- <p>Row 3</p>
706
- </td>
707
- <td>
708
- <p>This is long data</p>
709
- </td>
710
- <td>This is data</td>
711
- </tr>
712
- <tr>
713
- <td>
714
- <p>Row 4 &lt;td&gt; cell</p>
715
- </td>
716
- <td>This is data</td>
717
- <td>
718
- <p>This is data</p>
719
- </td>
720
- </tr>
721
- <tr>
722
- <td>Row 5</td>
723
- <td>Also data</td>
724
- <td>Also data</td>
725
- </tr>
726
- <tr>
727
- <td>Row 6</td>
728
- <td>Also data</td>
729
- <td>Also data</td>
730
- </tr>
731
- <tr>
732
- <td>Row 7</td>
733
- <td>Also data</td>
734
- <td>Also data</td>
735
- </tr>
736
- <tr>
737
- <td>Row 8</td>
738
- <td>Also data</td>
739
- <td>Also data</td>
740
- </tr>
741
- </tbody>
742
- </table>
743
- <p>&nbsp;</p>
744
- <p>bpmTopnTail<b>C</b> Class (centered) Odd and Even rows</p>
745
- <table class="bpmTopnTailC">
746
- <thead>
747
- <tr class="headerrow">
748
- <th>Col/Row Header</th>
749
- <td>
750
- <p>Second column header p</p>
751
- </td>
752
- <td>Third column header</td>
753
- </tr>
754
- </thead>
755
- <tbody>
756
- <tr class="oddrow">
757
- <th>Row header 1</th>
758
- <td>This is data</td>
759
- <td>This is data</td>
760
- </tr>
761
- <tr class="evenrow">
762
- <th>Row header 2</th>
763
- <td>
764
- <p>This is data p</p>
765
- </td>
766
- <td>
767
- <p>This is data</p>
768
- </td>
769
- </tr>
770
- <tr class="oddrow">
771
- <th>
772
- <p>Row header 3</p>
773
- </th>
774
- <td>
775
- <p>This is long data</p>
776
- </td>
777
- <td>This is data</td>
778
- </tr>
779
- <tr class="evenrow">
780
- <th>
781
- <p>Row header 4</p>
782
- <p>&lt;th&gt; cell acting as header</p>
783
- </th>
784
- <td>This is data</td>
785
- <td>
786
- <p>This is data</p>
787
- </td>
788
- </tr>
789
- <tr class="oddrow">
790
- <th>Row header 5</th>
791
- <td>Also data</td>
792
- <td>Also data</td>
793
- </tr>
794
- <tr class="evenrow">
795
- <th>Row header 6</th>
796
- <td>Also data</td>
797
- <td>Also data</td>
798
- </tr>
799
- <tr class="oddrow">
800
- <th>Row header 7</th>
801
- <td>Also data</td>
802
- <td>Also data</td>
803
- </tr>
804
- <tr class="evenrow">
805
- <th>Row header 8</th>
806
- <td>Also data</td>
807
- <td>Also data</td>
808
- </tr>
809
- </tbody>
810
- </table>
811
- <p>&nbsp;</p>
812
- <p>TopnTail Class</p>
813
- <table class="bpmTopnTail">
814
- <thead>
815
- <tr class="headerrow">
816
- <th>Col and Row Header</th>
817
- <td>
818
- <p>Second</p>
819
- <p>column</p>
820
- </td>
821
- <td class="pmhTopRight">Top right align</td>
822
- </tr>
823
- </thead>
824
- <tbody>
825
- <tr class="oddrow">
826
- <th>
827
- <p>Row header 1 p</p>
828
- </th>
829
- <td>This is data</td>
830
- <td>This is data</td>
831
- </tr>
832
- <tr class="evenrow">
833
- <th>Row header 2</th>
834
- <td class="pmhBottomRight"><b><i>Bottom right align</i></b></td>
835
- <td>
836
- <p>This is data. Can use</p>
837
- <p><b>bold</b> <i>italic </i><sub>sub</sub> or <sup>sup</sup> text</p>
838
- </td>
839
- </tr>
840
- <tr class="oddrow">
841
- <th class="pmhBottomRight">
842
- <p>Bottom right align</p>
843
- </th>
844
- <td class="pmhMiddleCenter" style="border: #000000 1px solid">
845
- <p>This is data. This cell</p>
846
- <p>uses Cell Styles to set</p>
847
- <p>the borders.</p>
848
- <p>All borders are collapsible</p>
849
- <p>in mPDF.</p>
850
- </td>
851
- <td>This is data</td>
852
- </tr>
853
- <tr class="evenrow">
854
- <th>Row header 4</th>
855
- <td>
856
- <p>This is data p</p>
857
- </td>
858
- <td>More data</td>
859
- </tr>
860
- <tr class="oddrow">
861
- <th>Row header 5</th>
862
- <td colspan="2" class="pmhTopCenter">Also data merged and centered</td>
863
- </tr>
864
- </tbody>
865
- </table>
866
- <p>&nbsp;</p>
867
- <h4>Lists in a Table</h4>
868
- <table class="bpmTopnTail">
869
- <thead>
870
- <tr class="headerrow">
871
- <th>Col and Row Header</th>
872
- <td>
873
- <p>Second</p>
874
- <p>column</p>
875
- </td>
876
- <td class="pmhTopRight">Top right align</td>
877
- </tr>
878
- </thead>
879
- <tbody>
880
- <tr class="oddrow">
881
- <th>
882
- <p>Row header 1 p</p>
883
- </th>
884
- <td>This is data</td>
885
- <td>This is data</td>
886
- </tr>
887
- <tr class="evenrow">
888
- <th>Row header 2</th>
889
- <td>
890
- <ol>
891
- <li>Item 1</li>
892
- <li>
893
- Item 2
894
- <ol type="a">
895
- <li>Subitem of ordered list</li>
896
- <li>
897
- Subitem 2
898
- <ol type="i">
899
- <li>Level 3 subitem</li>
900
- <li>Level 3 subitem</li>
901
- </ol>
902
- </li>
903
- </ol>
904
- </li>
905
- <li>Item 3</li>
906
- <li>Another Item</li>
907
- <li>
908
- Subitem
909
- <ol>
910
- <li>Level 3 subitem</li>
911
- </ol>
912
- </li>
913
- <li>Another Item</li>
914
- </ol>
915
- </td>
916
- <td>
917
- Unordered list:
918
- <ul>
919
- <li>Item 1</li>
920
- <li>
921
- Item 2
922
- <ul>
923
- <li>Subitem of unordered list</li>
924
- <li>
925
- Subitem 2
926
- <ul>
927
- <li>Level 3 subitem</li>
928
- <li>Level 3 subitem</li>
929
- <li>Level 3 subitem</li>
930
- </ul>
931
- </li>
932
- </ul>
933
- </li>
934
- <li>Item 3</li>
935
- </ul>
936
- </td>
937
- </tr>
938
- </tbody>
939
- </table>
940
- <p>&nbsp;</p>
941
- <h4>Automatic Column Width</h4>
942
- <table class="bpmTopnTail">
943
- <tbody>
944
- <tr>
945
- <td>Causes</td>
946
- <td>Nulla felis erat, imperdiet eu, ullamcorper non, nonummy quis, elit. <br />
947
- Ut a eros at ligula vehicula pretium; maecenas feugiat pede vel risus.<br />
948
- Suspendisse potenti
949
- </td>
950
- </tr>
951
- <tr>
952
- <td>Mechanisms</td>
953
- <td>Ut magna ipsum, tempus in, condimentum at, rutrum et, nisl. Vestibulum interdum luctus sapien. Quisque viverra. Etiam id libero at magna pellentesque aliquet. Nulla sit amet ipsum id enim tempus dictum. Maecenas consectetuer eros quis massa. Mauris semper velit vehicula purus. Duis lacus. Aenean pretium consectetuer mauris. Ut purus sem, consequat ut, fermentum sit amet, ornare sit amet, ipsum. Donec non nunc. Maecenas fringilla. Curabitur libero. In dui massa, malesuada sit amet, hendrerit vitae, viverra nec, tortor. Donec varius. Ut ut dolor et tellus adipiscing adipiscing.</td>
954
- </tr>
955
- </tbody>
956
- </table>
957
- <h4>ColSpan & Rowspan</h4>
958
- <table class="bpmTopnTail">
959
- <tbody>
960
- <tr>
961
- <td rowspan="2">Causes</td>
962
- <td colspan="2">Nulla felis erat, imperdiet eu, ullamcorper non, nonummy quis, elit. <br />
963
- Ut a eros at ligula vehicula pretium; maecenas feugiat pede vel risus.<br />
964
- Suspendisse potenti
965
- </td>
966
- </tr>
967
- <tr>
968
- <td>Fusce eleifend neque sit amet erat.<br />
969
- Donec mattis, nisi id euismod auctor, neque metus pellentesque risus, at eleifend lacus sapien et risus.
970
- </td>
971
- <td>Mauris ante pede, auctor ac, suscipit quis, malesuada sed, nulla.<br />
972
- Phasellus feugiat, lectus ac aliquam molestie, leo lacus tincidunt turpis, vel aliquam quam odio et sapien.
973
- </td>
974
- </tr>
975
- </tbody>
976
- </table>
977
- <h4>Table Header & Footer Rows</h4>
978
- <p>A table using a header row should repeat the header row across pages:</p>
979
- <p>bpmTopic<b>C</b> Class</p>
980
- <table class="bpmTopicC">
981
- <thead>
982
- <tr class="headerrow">
983
- <th>Col and Row Header</th>
984
- <td>
985
- <p>Second column header</p>
986
- </td>
987
- <td>Third column header</td>
988
- </tr>
989
- </thead>
990
- <tfoot>
991
- <tr class="footerrow">
992
- <th>Col and Row Footer</th>
993
- <td>
994
- <p>Second column footer</p>
995
- </td>
996
- <td>Third column footer</td>
997
- </tr>
998
- </tfoot>
999
- <tbody>
1000
- <tr>
1001
- <th>Row header 1</th>
1002
- <td>This is data</td>
1003
- <td>This is data</td>
1004
- </tr>
1005
- <tr>
1006
- <th>Row header 2</th>
1007
- <td>This is data</td>
1008
- <td>
1009
- <p>This is data</p>
1010
- </td>
1011
- </tr>
1012
- <tr>
1013
- <th>
1014
- <p>Row header 3</p>
1015
- </th>
1016
- <td>
1017
- <p>This is data</p>
1018
- </td>
1019
- <td>This is data</td>
1020
- </tr>
1021
- <tr>
1022
- <th>Row header 4</th>
1023
- <td>This is data</td>
1024
- <td>
1025
- <p>This is data</p>
1026
- </td>
1027
- </tr>
1028
- <tr>
1029
- <th>Row header 5</th>
1030
- <td>Also data</td>
1031
- <td>Also data</td>
1032
- </tr>
1033
- <tr>
1034
- <th>Row header 6</th>
1035
- <td>Also data</td>
1036
- <td>Also data</td>
1037
- </tr>
1038
- <tr>
1039
- <th>Row header 7</th>
1040
- <td>Also data</td>
1041
- <td>Also data</td>
1042
- </tr>
1043
- <tr>
1044
- <th>Row header 8</th>
1045
- <td>Also data</td>
1046
- <td>Also data</td>
1047
- </tr>
1048
- <tr>
1049
- <th>Row header 9</th>
1050
- <td>Also data</td>
1051
- <td>Also data</td>
1052
- </tr>
1053
- <tr>
1054
- <th>Another Row header</th>
1055
- <td>Also data</td>
1056
- <td>Also data</td>
1057
- </tr>
1058
- <tr>
1059
- <th>Another Row header</th>
1060
- <td>Also data</td>
1061
- <td>Also data</td>
1062
- </tr>
1063
- <tr>
1064
- <th>Another Row header</th>
1065
- <td>Also data</td>
1066
- <td>Also data</td>
1067
- </tr>
1068
- <tr>
1069
- <th>Another Row header</th>
1070
- <td>Also data</td>
1071
- <td>Also data</td>
1072
- </tr>
1073
- <tr>
1074
- <th>Another Row header</th>
1075
- <td>Also data</td>
1076
- <td>Also data</td>
1077
- </tr>
1078
- <tr>
1079
- <th>Another Row header</th>
1080
- <td>Also data</td>
1081
- <td>Also data</td>
1082
- </tr>
1083
- <tr>
1084
- <th>Another Row header</th>
1085
- <td>Also data</td>
1086
- <td>Also data</td>
1087
- </tr>
1088
- <tr>
1089
- <th>Another Row header</th>
1090
- <td>Also data</td>
1091
- <td>Also data</td>
1092
- </tr>
1093
- <tr>
1094
- <th>Another Row header</th>
1095
- <td>Also data</td>
1096
- <td>Also data</td>
1097
- </tr>
1098
- <tr>
1099
- <th>Another Row header</th>
1100
- <td>Also data</td>
1101
- <td>Also data</td>
1102
- </tr>
1103
- <tr>
1104
- <th>Another Row header</th>
1105
- <td>Also data</td>
1106
- <td>Also data</td>
1107
- </tr>
1108
- <tr>
1109
- <th>Another Row header</th>
1110
- <td>Also data</td>
1111
- <td>Also data</td>
1112
- </tr>
1113
- <tr>
1114
- <th>Another Row header</th>
1115
- <td>Also data</td>
1116
- <td>Also data</td>
1117
- </tr>
1118
- <tr>
1119
- <th>Another Row header</th>
1120
- <td>Also data</td>
1121
- <td>Also data</td>
1122
- </tr>
1123
- <tr>
1124
- <th>Another Row header</th>
1125
- <td>Also data</td>
1126
- <td>Also data</td>
1127
- </tr>
1128
- <tr>
1129
- <th>Another Row header</th>
1130
- <td>Also data</td>
1131
- <td>Also data</td>
1132
- </tr>
1133
- <tr>
1134
- <th>Another Row header</th>
1135
- <td>Also data</td>
1136
- <td>Also data</td>
1137
- </tr>
1138
- <tr>
1139
- <th>Another Row header</th>
1140
- <td>Also data</td>
1141
- <td>Also data</td>
1142
- </tr>
1143
- <tr>
1144
- <th>Another Row header</th>
1145
- <td>Also data</td>
1146
- <td>Also data</td>
1147
- </tr>
1148
- <tr>
1149
- <th>Another Row header</th>
1150
- <td>Also data</td>
1151
- <td>Also data</td>
1152
- </tr>
1153
- <tr>
1154
- <th>Another Row header</th>
1155
- <td>Also data</td>
1156
- <td>Also data</td>
1157
- </tr>
1158
- <tr>
1159
- <th>Another Row header</th>
1160
- <td>Also data</td>
1161
- <td>Also data</td>
1162
- </tr>
1163
- <tr>
1164
- <th>Another Row header</th>
1165
- <td>Also data</td>
1166
- <td>Also data</td>
1167
- </tr>
1168
- <tr>
1169
- <th>Another Row header</th>
1170
- <td>Also data</td>
1171
- <td>Also data</td>
1172
- </tr>
1173
- <tr>
1174
- <th>Another Row header</th>
1175
- <td>Also data</td>
1176
- <td>Also data</td>
1177
- </tr>
1178
- <tr>
1179
- <th>Another Row header</th>
1180
- <td>Also data</td>
1181
- <td>Also data</td>
1182
- </tr>
1183
- <tr>
1184
- <th>Another Row header</th>
1185
- <td>Also data</td>
1186
- <td>Also data</td>
1187
- </tr>
1188
- <tr>
1189
- <th>Another Row header</th>
1190
- <td>Also data</td>
1191
- <td>Also data</td>
1192
- </tr>
1193
- <tr>
1194
- <th>Another Row header</th>
1195
- <td>Also data</td>
1196
- <td>Also data</td>
1197
- </tr>
1198
- <tr>
1199
- <th>Another Row header</th>
1200
- <td>Also data</td>
1201
- <td>Also data</td>
1202
- </tr>
1203
- <tr>
1204
- <th>Another Row header</th>
1205
- <td>Also data</td>
1206
- <td>Also data</td>
1207
- </tr>
1208
- <tr>
1209
- <th>Another Row header</th>
1210
- <td>Also data</td>
1211
- <td>Also data</td>
1212
- </tr>
1213
- <tr>
1214
- <th>Another Row header</th>
1215
- <td>Also data</td>
1216
- <td>Also data</td>
1217
- </tr>
1218
- <tr>
1219
- <th>Another Row header</th>
1220
- <td>Also data</td>
1221
- <td>Also data</td>
1222
- </tr>
1223
- <tr>
1224
- <th>Another Row header</th>
1225
- <td>Also data</td>
1226
- <td>Also data</td>
1227
- </tr>
1228
- </tbody>
1229
- </table>
1230
- <p>&nbsp;</p>
1231
- <h3>Autosizing Tables</h3>
1232
- <p>Periodic Table of elements. Tables are set by default to reduce font size if complete words will not fit inside each cell, to a maximum of 1/1.4 * the set font-size. This value can be changed by setting $mpdf->shrink_tables_to_fit=1.8 or using html attribute &lt;table autosize="1.8"&gt;.</p>
1233
- <h5>Periodic Table</h5>
1234
- <table style="border:1px solid #000000;" cellPadding="9">
1235
- <thead>
1236
- <tr>
1237
- <th>1A</th>
1238
- <th>2A</th>
1239
- <th>3B</th>
1240
- <th>4B</th>
1241
- <th>5B</th>
1242
- <th>6B</th>
1243
- <th>7B</th>
1244
- <th>8B</th>
1245
- <th>8B</th>
1246
- <th>8B</th>
1247
- <th>1B</th>
1248
- <th>2B</th>
1249
- <th>3A</th>
1250
- <th>4A</th>
1251
- <th>5A</th>
1252
- <th>6A</th>
1253
- <th>7A</th>
1254
- <th>8A</th>
1255
- </tr>
1256
- </thead>
1257
- <tbody>
1258
- <tr>
1259
- <td colspan="18"></td>
1260
- </tr>
1261
- <tr>
1262
- <td>H </td>
1263
- <td colspan="16"></td>
1264
- <td>He </td>
1265
- </tr>
1266
- <tr>
1267
- <td>Li </td>
1268
- <td>Be </td>
1269
- <td colspan="10"></td>
1270
- <td>B </td>
1271
- <td>C </td>
1272
- <td>N </td>
1273
- <td>O </td>
1274
- <td>F </td>
1275
- <td>Ne </td>
1276
- </tr>
1277
- <tr>
1278
- <td>Na </td>
1279
- <td>Mg </td>
1280
- <td colspan="10"></td>
1281
- <td>Al </td>
1282
- <td>Si </td>
1283
- <td>P </td>
1284
- <td>S </td>
1285
- <td>Cl </td>
1286
- <td>Ar </td>
1287
- </tr>
1288
- <tr>
1289
- <td>K </td>
1290
- <td>Ca </td>
1291
- <td>Sc </td>
1292
- <td>Ti </td>
1293
- <td>V </td>
1294
- <td>Cr </td>
1295
- <td>Mn </td>
1296
- <td>Fe </td>
1297
- <td>Co </td>
1298
- <td>Ni </td>
1299
- <td>Cu </td>
1300
- <td>Zn </td>
1301
- <td>Ga </td>
1302
- <td>Ge </td>
1303
- <td>As </td>
1304
- <td>Se </td>
1305
- <td>Br </td>
1306
- <td>Kr </td>
1307
- </tr>
1308
- <tr>
1309
- <td>Rb </td>
1310
- <td>Sr </td>
1311
- <td>Y </td>
1312
- <td>Zr </td>
1313
- <td>Nb </td>
1314
- <td>Mo </td>
1315
- <td>Tc </td>
1316
- <td>Ru </td>
1317
- <td>Rh </td>
1318
- <td>Pd </td>
1319
- <td>Ag </td>
1320
- <td>Cd </td>
1321
- <td>In </td>
1322
- <td>Sn </td>
1323
- <td>Sb </td>
1324
- <td>Te </td>
1325
- <td>I </td>
1326
- <td>Xe </td>
1327
- </tr>
1328
- <tr>
1329
- <td>Cs </td>
1330
- <td>Ba </td>
1331
- <td>La </td>
1332
- <td>Hf </td>
1333
- <td>Ta </td>
1334
- <td>W </td>
1335
- <td>Re </td>
1336
- <td>Os </td>
1337
- <td>Ir </td>
1338
- <td>Pt </td>
1339
- <td>Au </td>
1340
- <td>Hg </td>
1341
- <td>Tl </td>
1342
- <td>Pb </td>
1343
- <td>Bi </td>
1344
- <td>Po </td>
1345
- <td>At </td>
1346
- <td>Rn </td>
1347
- </tr>
1348
- <tr>
1349
- <td>Fr </td>
1350
- <td>Ra </td>
1351
- <td>Ac </td>
1352
- <td colspan="15"></td>
1353
- </tr>
1354
- <tr>
1355
- <td colspan="18"></td>
1356
- </tr>
1357
- <tr>
1358
- <td colspan="3"></td>
1359
- <td>Ce </td>
1360
- <td>Pr </td>
1361
- <td>Nd </td>
1362
- <td>Pm </td>
1363
- <td>Sm </td>
1364
- <td>Eu </td>
1365
- <td>Gd </td>
1366
- <td>Tb </td>
1367
- <td>Dy </td>
1368
- <td>Ho </td>
1369
- <td>Er </td>
1370
- <td>Tm </td>
1371
- <td>Yb </td>
1372
- <td>Lu </td>
1373
- <td></td>
1374
- </tr>
1375
- <tr>
1376
- <td colspan="3"></td>
1377
- <td>Th </td>
1378
- <td>Pa </td>
1379
- <td>U </td>
1380
- <td>Np </td>
1381
- <td>Pu </td>
1382
- <td>Am </td>
1383
- <td>Cm </td>
1384
- <td>Bk </td>
1385
- <td>Cf </td>
1386
- <td>Es </td>
1387
- <td>Fm </td>
1388
- <td>Md </td>
1389
- <td>No </td>
1390
- <td>Lr </td>
1391
- <td></td>
1392
- </tr>
1393
- </tbody>
1394
- </table>
1395
- <pagebreak />
1396
- <h3>Rotating Tables</h3>
1397
- <p>This is set to rotate -90 degrees (counterclockwise).</p>
1398
- <h5>Periodic Table</h5>
1399
- <p>
1400
- <table rotate="-90" class="bpmClearC">
1401
- <thead>
1402
- <tr>
1403
- <th>1A</th>
1404
- <th>2A</th>
1405
- <th>3B</th>
1406
- <th>4B</th>
1407
- <th>5B</th>
1408
- <th>6B</th>
1409
- <th>7B</th>
1410
- <th>8B</th>
1411
- <th>8B</th>
1412
- <th>8B</th>
1413
- <th>1B</th>
1414
- <th>2B</th>
1415
- <th>3A</th>
1416
- <th>4A</th>
1417
- <th>5A</th>
1418
- <th>6A</th>
1419
- <th>7A</th>
1420
- <th>8A</th>
1421
- </tr>
1422
- </thead>
1423
- <tbody>
1424
- <tr>
1425
- <td></td>
1426
- <td colspan="18"></td>
1427
- </tr>
1428
- <tr>
1429
- <td>H </td>
1430
- <td colspan="15"></td>
1431
- <td></td>
1432
- <td>He </td>
1433
- </tr>
1434
- <tr>
1435
- <td>Li </td>
1436
- <td>Be </td>
1437
- <td colspan="10"></td>
1438
- <td>B </td>
1439
- <td>C </td>
1440
- <td>N </td>
1441
- <td>O </td>
1442
- <td>F </td>
1443
- <td>Ne </td>
1444
- </tr>
1445
- <tr>
1446
- <td>Na </td>
1447
- <td>Mg </td>
1448
- <td colspan="10"></td>
1449
- <td>Al </td>
1450
- <td>Si </td>
1451
- <td>P </td>
1452
- <td>S </td>
1453
- <td>Cl </td>
1454
- <td>Ar </td>
1455
- </tr>
1456
- <tr>
1457
- <td>K </td>
1458
- <td>Ca </td>
1459
- <td>Sc </td>
1460
- <td>Ti </td>
1461
- <td>V </td>
1462
- <td>Cr </td>
1463
- <td>Mn </td>
1464
- <td>Fe </td>
1465
- <td>Co </td>
1466
- <td>Ni </td>
1467
- <td>Cu </td>
1468
- <td>Zn </td>
1469
- <td>Ga </td>
1470
- <td>Ge </td>
1471
- <td>As </td>
1472
- <td>Se </td>
1473
- <td>Br </td>
1474
- <td>Kr </td>
1475
- </tr>
1476
- <tr>
1477
- <td>Rb </td>
1478
- <td>Sr </td>
1479
- <td>Y </td>
1480
- <td>Zr </td>
1481
- <td>Nb </td>
1482
- <td>Mo </td>
1483
- <td>Tc </td>
1484
- <td>Ru </td>
1485
- <td>Rh </td>
1486
- <td>Pd </td>
1487
- <td>Ag </td>
1488
- <td>Cd </td>
1489
- <td>In </td>
1490
- <td>Sn </td>
1491
- <td>Sb </td>
1492
- <td>Te </td>
1493
- <td>I </td>
1494
- <td>Xe </td>
1495
- </tr>
1496
- <tr>
1497
- <td>Cs </td>
1498
- <td>Ba </td>
1499
- <td>La </td>
1500
- <td>Hf </td>
1501
- <td>Ta </td>
1502
- <td>W </td>
1503
- <td>Re </td>
1504
- <td>Os </td>
1505
- <td>Ir </td>
1506
- <td>Pt </td>
1507
- <td>Au </td>
1508
- <td>Hg </td>
1509
- <td>Tl </td>
1510
- <td>Pb </td>
1511
- <td>Bi </td>
1512
- <td>Po </td>
1513
- <td>At </td>
1514
- <td>Rn </td>
1515
- </tr>
1516
- <tr>
1517
- <td>Fr </td>
1518
- <td>Ra </td>
1519
- <td>Ac </td>
1520
- </tr>
1521
- <tr>
1522
- <td></td>
1523
- <td colspan="18"></td>
1524
- </tr>
1525
- <tr>
1526
- <td colspan="3"></td>
1527
- <td>Ce </td>
1528
- <td>Pr </td>
1529
- <td>Nd </td>
1530
- <td>Pm </td>
1531
- <td>Sm </td>
1532
- <td>Eu </td>
1533
- <td>Gd </td>
1534
- <td>Tb </td>
1535
- <td>Dy </td>
1536
- <td>Ho </td>
1537
- <td>Er </td>
1538
- <td>Tm </td>
1539
- <td>Yb </td>
1540
- <td>Lu </td>
1541
- <td></td>
1542
- </tr>
1543
- <tr>
1544
- <td colspan="3"></td>
1545
- <td>Th </td>
1546
- <td>Pa </td>
1547
- <td>U </td>
1548
- <td>Np </td>
1549
- <td>Pu </td>
1550
- <td>Am </td>
1551
- <td>Cm </td>
1552
- <td>Bk </td>
1553
- <td>Cf </td>
1554
- <td>Es </td>
1555
- <td>Fm </td>
1556
- <td>Md </td>
1557
- <td>No </td>
1558
- <td>Lr </td>
1559
- <td></td>
1560
- </tr>
1561
- </tbody>
1562
- </table>
1563
- <p>&nbsp;</p>
1564
- <pagebreak />
1565
- <h3>Rotated text in Table Cells</h3>
1566
- <h5>Periodic Table</h5>
1567
- <table>
1568
- <thead>
1569
- <tr text-rotate="45">
1570
- <th>
1571
- <p>Element type 1A</p>
1572
- <p>Second line</p>
1573
- <th>
1574
- <p>Element type longer 2A</p>
1575
- </th>
1576
- <th>Element type 3B</th>
1577
- <th>Element type 4B</th>
1578
- <th>Element type 5B</th>
1579
- <th>Element type 6B</th>
1580
- <th>7B</th>
1581
- <th>8B</th>
1582
- <th>Element type 8B R</th>
1583
- <th>8B</th>
1584
- <th>Element <span>type</span> 1B</th>
1585
- <th>2B</th>
1586
- <th>Element type 3A</th>
1587
- <th>Element type 4A</th>
1588
- <th>Element type 5A</th>
1589
- <th>Element type 6A</th>
1590
- <th>7A</th>
1591
- <th>Element type 8A</th>
1592
- </tr>
1593
- </thead>
1594
- <tbody>
1595
- <tr>
1596
- <td>H</td>
1597
- <td colspan="15"></td>
1598
- <td></td>
1599
- <td>He </td>
1600
- </tr>
1601
- <tr>
1602
- <td>Li </td>
1603
- <td>Be </td>
1604
- <td colspan="10"></td>
1605
- <td>B </td>
1606
- <td>C </td>
1607
- <td>N </td>
1608
- <td>O </td>
1609
- <td>F </td>
1610
- <td>Ne </td>
1611
- </tr>
1612
- <tr>
1613
- <td>Na </td>
1614
- <td>Mg </td>
1615
- <td colspan="10"></td>
1616
- <td>Al </td>
1617
- <td>Si </td>
1618
- <td>P </td>
1619
- <td>S </td>
1620
- <td>Cl </td>
1621
- <td>Ar </td>
1622
- </tr>
1623
- <tr style="text-rotate: 45">
1624
- <td>K </td>
1625
- <td>Ca </td>
1626
- <td>Sc </td>
1627
- <td>Ti</td>
1628
- <td>Va</td>
1629
- <td>Cr</td>
1630
- <td>Mn</td>
1631
- <td>Fe</td>
1632
- <td>Co</td>
1633
- <td>Ni </td>
1634
- <td>Cu </td>
1635
- <td>Zn </td>
1636
- <td>Ga </td>
1637
- <td>Ge </td>
1638
- <td>As </td>
1639
- <td>Se </td>
1640
- <td>Br </td>
1641
- <td>Kr </td>
1642
- </tr>
1643
- <tr>
1644
- <td>Rb </td>
1645
- <td>Sr </td>
1646
- <td>Y </td>
1647
- <td>Zr </td>
1648
- <td>Nb </td>
1649
- <td>Mo </td>
1650
- <td>Tc </td>
1651
- <td>Ru </td>
1652
- <td style="text-align:right; ">Rh</td>
1653
- <td>Pd </td>
1654
- <td>Ag </td>
1655
- <td>Cd </td>
1656
- <td>In </td>
1657
- <td>Sn </td>
1658
- <td>Sb </td>
1659
- <td>Te </td>
1660
- <td>I </td>
1661
- <td>Xe </td>
1662
- </tr>
1663
- <tr>
1664
- <td>Cs </td>
1665
- <td>Ba </td>
1666
- <td>La </td>
1667
- <td>Hf </td>
1668
- <td>Ta </td>
1669
- <td>W </td>
1670
- <td>Re </td>
1671
- <td>Os </td>
1672
- <td>Ir </td>
1673
- <td>Pt </td>
1674
- <td>Au </td>
1675
- <td>Hg </td>
1676
- <td>Tl </td>
1677
- <td>Pb </td>
1678
- <td>Bi </td>
1679
- <td>Po </td>
1680
- <td>At </td>
1681
- <td>Rn </td>
1682
- </tr>
1683
- <tr>
1684
- <td>Fr </td>
1685
- <td>Ra </td>
1686
- <td colspan="16">Ac </td>
1687
- </tr>
1688
- <tr>
1689
- <td colspan="3"></td>
1690
- <td>Ce </td>
1691
- <td>Pr </td>
1692
- <td>Nd </td>
1693
- <td>Pm </td>
1694
- <td>Sm </td>
1695
- <td>Eu </td>
1696
- <td>Gd </td>
1697
- <td>Tb </td>
1698
- <td>Dy </td>
1699
- <td>Ho </td>
1700
- <td>Er </td>
1701
- <td>Tm </td>
1702
- <td>Yb </td>
1703
- <td>Lu </td>
1704
- <td></td>
1705
- </tr>
1706
- <tr>
1707
- <td colspan="3"></td>
1708
- <td>Th </td>
1709
- <td>Pa </td>
1710
- <td>U </td>
1711
- <td>Np </td>
1712
- <td>Pu </td>
1713
- <td>Am </td>
1714
- <td>Cm </td>
1715
- <td>Bk </td>
1716
- <td>Cf </td>
1717
- <td>Es </td>
1718
- <td>Fm </td>
1719
- <td>Md </td>
1720
- <td>No </td>
1721
- <td>Lr </td>
1722
- <td></td>
1723
- </tr>
1724
- </tbody>
1725
- </table>
1726
- <p>&nbsp;</p>
1727
-
1728
 
1729
 
1730
- <?php } ?>
 
 
 
1731
  </body>
1732
  </html>
1
  <?php
2
 
3
  /**
4
+ * If the template is being loaded directy we'll call the Wordpress Core
5
+ * Used when attempting to debug the template
6
  */
7
  if(!class_exists("RGForms")){
8
+ return;
9
  }
10
 
11
+ /**
12
+ * Set up the form ID and lead ID, as well as we want page breaks displayed.
13
+ * Form ID and Lead ID can be set by passing it to the URL - ?fid=1&lid=10
14
+ */
15
+ PDF_Common::setup_ids();
16
+
17
  /**
18
+ * Load the form data, including the custom style sheet which looks in the plugin's theme folder before defaulting back to the plugin's file.
19
  */
20
  $form = RGFormsModel::get_form_meta($form_id);
21
+ $stylesheet_location = (file_exists(PDF_TEMPLATE_LOCATION.'template.css')) ? PDF_TEMPLATE_URL_LOCATION.'template.css' : PDF_PLUGIN_URL .'styles/template.css' ;
22
 
23
  ?>
24
 
25
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
26
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
27
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
28
+ <head>
29
+ <style>
30
+
31
+ body { font-family: DejaVuSansCondensed; font-size: 11pt; }
32
+ p { text-align: justify; margin-bottom: 4pt; margin-top:0pt; }
33
+
34
+ table {font-family: DejaVuSansCondensed; font-size: 9pt; line-height: 1.2;
35
+ margin-top: 2pt; margin-bottom: 5pt;
36
+ border-collapse: collapse; }
37
+
38
+ thead { font-weight: bold; vertical-align: bottom; }
39
+ tfoot { font-weight: bold; vertical-align: top; }
40
+ thead td { font-weight: bold; }
41
+ tfoot td { font-weight: bold; }
42
+
43
+ thead td, thead th, tfoot td, tfoot th { font-variant: small-caps; }
44
+
45
+ .headerrow td, .headerrow th { background-gradient: linear #b7cebd #f5f8f5 0 1 0 0.2; }
46
+ .footerrow td, .footerrow th { background-gradient: linear #b7cebd #f5f8f5 0 1 0 0.2; }
47
+
48
+ th { font-weight: bold;
49
+ vertical-align: top;
50
+ text-align:left;
51
+ padding-left: 2mm;
52
+ padding-right: 2mm;
53
+ padding-top: 0.5mm;
54
+ padding-bottom: 0.5mm;
55
+ }
56
+
57
+ td { padding-left: 2mm;
58
+ vertical-align: top;
59
+ text-align:left;
60
+ padding-right: 2mm;
61
+ padding-top: 0.5mm;
62
+ padding-bottom: 0.5mm;
63
+ }
64
+
65
+ th p { text-align: left; margin:0pt; }
66
+ td p { text-align: left; margin:0pt; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
67
 
68
  table.widecells td {
69
+ padding-left: 5mm;
70
+ padding-right: 5mm;
71
  }
 
72
  table.tallcells td {
73
+ padding-top: 3mm;
74
+ padding-bottom: 3mm;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
75
  }
76
 
77
+ hr { width: 70%; height: 1px;
78
+ text-align: center; color: #999999;
79
+ margin-top: 8pt; margin-bottom: 8pt; }
80
+
81
+ a { color: #000066; font-style: normal; text-decoration: underline;
82
+ font-weight: normal; }
83
+
84
+ ul { text-indent: 5mm; margin-bottom: 9pt; }
85
+ ol { text-indent: 5mm; margin-bottom: 9pt; }
86
+
87
+ pre { font-family: DejaVuSansMono; font-size: 9pt; margin-top: 5pt; margin-bottom: 5pt; }
88
+
89
+ h1 { font-weight: normal; font-size: 26pt; color: #000066;
90
+ font-family: DejaVuSansCondensed; margin-top: 18pt; margin-bottom: 6pt;
91
+ border-top: 0.075cm solid #000000; border-bottom: 0.075cm solid #000000;
92
+ text-align: ; page-break-after:avoid; }
93
+ h2 { font-weight: bold; font-size: 12pt; color: #000066;
94
+ font-family: DejaVuSansCondensed; margin-top: 6pt; margin-bottom: 6pt;
95
+ border-top: 0.07cm solid #000000; border-bottom: 0.07cm solid #000000;
96
+ text-align: ; text-transform:uppercase; page-break-after:avoid; }
97
+ h3 { font-weight: normal; font-size: 26pt; color: #000000;
98
+ font-family: DejaVuSansCondensed; margin-top: 0pt; margin-bottom: 6pt;
99
+ border-top: 0; border-bottom: 0;
100
+ text-align: ; page-break-after:avoid; }
101
+ h4 { font-weight: ; font-size: 13pt; color: #9f2b1e;
102
+ font-family: DejaVuSansCondensed; margin-top: 10pt; margin-bottom: 7pt;
103
+ font-variant: small-caps;
104
+ text-align: ; margin-collapse:collapse; page-break-after:avoid; }
105
+ h5 { font-weight: bold; font-style:italic; ; font-size: 11pt; color: #000044;
106
+ font-family: DejaVuSansCondensed; margin-top: 8pt; margin-bottom: 4pt;
107
+ text-align: ; page-break-after:avoid; }
108
+ h6 { font-weight: bold; font-size: 9.5pt; color: #333333;
109
+ font-family: DejaVuSansCondensed; margin-top: 6pt; margin-bottom: ;
110
+ text-align: ; page-break-after:avoid; }
 
 
 
 
 
 
 
 
 
 
111
 
112
  .breadcrumb {
113
+ text-align: right; font-size: 8pt; font-family: DejaVuSerifCondensed; color: #666666;
114
+ font-weight: bold; font-style: normal; margin-bottom: 6pt; }
115
+
116
+ .evenrow td, .evenrow th { background-color: #f5f8f5; }
117
+ .oddrow td, .oddrow th { background-color: #e3ece4; }
118
+
119
+ .bpmTopic { background-color: #e3ece4; }
120
+ .bpmTopicC { background-color: #e3ece4; }
121
+ .bpmNoLines { background-color: #e3ece4; }
122
+ .bpmNoLinesC { background-color: #e3ece4; }
123
+ .bpmClear { }
124
+ .bpmClearC { text-align: center; }
125
+ .bpmTopnTail { background-color: #e3ece4; topntail: 0.02cm solid #495b4a;}
126
+ .bpmTopnTailC { background-color: #e3ece4; topntail: 0.02cm solid #495b4a;}
127
+ .bpmTopnTailClear { topntail: 0.02cm solid #495b4a; }
128
+ .bpmTopnTailClearC { topntail: 0.02cm solid #495b4a; }
129
+
130
+ .bpmTopicC td, .bpmTopicC td p { text-align: center; }
131
+ .bpmNoLinesC td, .bpmNoLinesC td p { text-align: center; }
132
+ .bpmClearC td, .bpmClearC td p { text-align: center; }
133
+ .bpmTopnTailC td, .bpmTopnTailC td p { text-align: center; }
134
+ .bpmTopnTailClearC td, .bpmTopnTailClearC td p { text-align: center; }
135
+
136
+ .pmhMiddleCenter { text-align:center; vertical-align:middle; }
137
+ .pmhMiddleRight { text-align:right; vertical-align:middle; }
138
+ .pmhBottomCenter { text-align:center; vertical-align:bottom; }
139
+ .pmhBottomRight { text-align:right; vertical-align:bottom; }
140
+ .pmhTopCenter { text-align:center; vertical-align:top; }
141
+ .pmhTopRight { text-align:right; vertical-align:top; }
142
+ .pmhTopLeft { text-align:left; vertical-align:top; }
143
+ .pmhBottomLeft { text-align:left; vertical-align:bottom; }
144
+ .pmhMiddleLeft { text-align:left; vertical-align:middle; }
145
+
146
+ .infobox { margin-top:10pt; background-color:#DDDDBB; text-align:center; border:1px solid #880000; }
147
+
148
+ .bpmTopic td, .bpmTopic th { border-top: 1px solid #FFFFFF; }
149
+ .bpmTopicC td, .bpmTopicC th { border-top: 1px solid #FFFFFF; }
150
+ .bpmTopnTail td, .bpmTopnTail th { border-top: 1px solid #FFFFFF; }
151
+ .bpmTopnTailC td, .bpmTopnTailC th { border-top: 1px solid #FFFFFF; }
152
+
153
+
154
+ </style>
155
+ <title>Gravity Forms PDF Extended</title>
156
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
157
  </head>
158
+ <body>
159
+ <?php
160
 
161
  foreach($lead_ids as $lead_id) {
162
 
163
  $lead = RGFormsModel::get_lead($lead_id);
164
+ do_action("gform_print_entry_header", $form, $lead);
165
  $form_data = GFPDFEntryDetail::lead_detail_grid_array($form, $lead);
166
+ /*
167
+ * Add &data=1 when viewing the PDF via the admin area to view the $form_data array
168
+ */
169
+ PDF_Common::view_data($form_data);
170
+
171
+ /* get all the form values */
172
+ /*$date_created = $form_data['date_created'];
173
+
174
+ $first_name = $form_data['1.Name']['first'];
175
+ $last_name = $form_data['1.Name']['last'];*/
176
+
177
+ /* format the template */
178
+ ?>
 
 
 
 
 
 
179
 
180
+ <img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/gravityformspdfextended.jpg" width="311" height="110" />
181
 
182
+
183
+ <h1>mPDF</h1>
184
+ <h2>Tables</h2>
185
+ <h3>CSS Styles</h3>
186
+ <p>The CSS properties for tables and cells is increased over that in html2fpdf. It includes recognition of THEAD, TFOOT and TH.<br />See below for other facilities such as autosizing, and rotation.</p>
187
+ <table border="1">
188
+ <tbody><tr><td>Row 1</td><td>This is data</td><td>This is data</td></tr>
189
+
190
+ <tr><td>Row 2</td>
191
+
192
+ <td style="background-gradient: linear #c7cdde #f0f2ff 0 1 0 0.5;">
193
+ <p>This is data p</p>
194
+ This is data out of p
195
+ <p style="font-weight:bold; font-size:20pt; background-color:#FFBBFF;">This is bold data p</p>
196
+ <b>This is bold data out of p</b><br />
197
+ This is normal data after br
198
+ <h3>H3 in a table</h3>
199
+ <div>This is data div</div>
200
+ This is data out of div
201
+ <div style="font-weight:bold;">This is data div (bold)</div>
202
+ This is data out of div
203
+ </td>
204
+
205
+
206
+ <td><p>More data</p><p style="font-size:12pt;">This is large text</p></td></tr>
207
+ <tr><td><p>Row 3</p></td><td><p>This is long data</p></td><td>This is data</td></tr>
208
+ <tr><td><p>Row 4 &lt;td&gt; cell</p></td><td>This is data</td><td><p>This is data</p></td></tr>
209
+ <tr><td>Row 5</td><td>Also data</td><td>Also data</td></tr>
210
+ <tr><td>Row 6</td><td>Also data</td><td>Also data</td></tr>
211
+ <tr><td>Row 7</td><td>Also data</td><td>Also data</td></tr>
212
+ <tr><td>Row 8</td><td>Also data</td><td>Also data</td></tr>
213
+ </tbody></table>
214
+
215
+ <p>This table has padding-left and -right set to 5mm i.e. padding within the cells. Also border colour and style, font family and size are set by <acronym>CSS</acronym>.</p>
216
+ <table align="right" style="border: 1px solid #880000; font-family: Mono; font-size: 7pt; " class="widecells">
217
+ <tbody><tr><td>Row 1</td><td>This is data</td><td>This is data</td></tr>
218
+ <tr><td>Row 2</td><td><p>This is data p</p></td><td><p>More data</p></td></tr>
219
+ <tr><td><p>Row 3</p></td><td><p>This is long data</p></td><td>This is data</td></tr>
220
+ <tr><td><p>Row 4 &lt;td&gt; cell</p></td><td>This is data</td><td><p>This is data</p></td></tr>
221
+ <tr><td>Row 5</td><td>Also data</td><td>Also data</td></tr>
222
+ <tr><td>Row 6</td><td>Also data</td><td>Also data</td></tr>
223
+ <tr><td>Row 7</td><td>Also data</td><td>Also data</td></tr>
224
+ <tr><td>Row 8</td><td>Also data</td><td>Also data</td></tr>
225
+ </tbody></table>
226
+
227
+ <p>This table has padding-top and -bottom set to 3mm i.e. padding within the cells. Also background-, border colour and style, font family and size are set by in-line <acronym>CSS</acronym>.</p>
228
+ <table style="border: 1px solid #880000; background-color: #BBCCDD; font-family: Mono; font-size: 7pt; " class="tallcells">
229
+ <tbody><tr><td>Row 1</td><td>This is data</td><td>This is data</td></tr>
230
+ <tr><td>Row 2</td><td><p>This is data p</p></td><td><p>More data</p></td></tr>
231
+ <tr><td><p>Row 3</p></td><td><p>This is long data</p></td><td>This is data</td></tr>
232
+ </tbody></table>
233
+
234
+
235
+ <h3 style="margin-top: 20pt; margin-collapse:collapse;">Table Styles</h3>
236
+ <p>The style sheet used for these examples shows some of the table styles I use on my website. The property 'topntail' defined by a border-type definition e.g. "1px solid #880000" puts a border at the top and bottom of the table, and also below a header row (thead) if defined. Note also that &lt;thead&gt; will automatically turn on the header-repeat i.e. reproduce the header row at the top of each page.</p>
237
+ <p>bpmTopic Class</p>
238
+ <table class="bpmTopic"><thead></thead><tbody>
239
+ <tr>
240
+ <td>Row 1</td>
241
+ <td>This is data</td>
242
+ <td>This is data</td>
243
+ </tr>
244
+ <tr>
245
+ <td>Row 2</td>
246
+ <td>
247
+ <p>This is data p</p>
248
+ </td>
249
+ <td>
250
+ <p>More data</p>
251
+ </td>
252
+ </tr>
253
+ <tr>
254
+ <td>
255
+ <p>Row 3</p>
256
+ </td>
257
+ <td>
258
+ <p>This is long data</p>
259
+ </td>
260
+ <td>This is data</td>
261
+ </tr>
262
+ <tr>
263
+ <td>
264
+ <p>Row 4 &lt;td&gt; cell</p>
265
+ </td>
266
+ <td>This is data</td>
267
+ <td>
268
+ <p>This is data</p>
269
+ </td>
270
+ </tr>
271
+ <tr>
272
+ <td>Row 5</td>
273
+ <td>Also data</td>
274
+ <td>Also data</td>
275
+ </tr>
276
+ <tr>
277
+ <td>Row 6</td>
278
+ <td>Also data</td>
279
+ <td>Also data</td>
280
+ </tr>
281
+ <tr>
282
+ <td>Row 7</td>
283
+ <td>Also data</td>
284
+ <td>Also data</td>
285
+ </tr>
286
+ <tr>
287
+ <td>Row 8</td>
288
+ <td>Also data</td>
289
+ <td>Also data</td>
290
+ </tr>
291
+ </tbody></table>
292
+
293
+ <p>&nbsp;</p>
294
+
295
+ <p>bpmTopic<b>C</b> Class (centered) Odd and Even rows</p>
296
+ <table class="bpmTopicC"><thead>
297
+ <tr class="headerrow"><th>Col/Row Header</th>
298
+ <td>
299
+ <p>Second column header p</p>
300
+ </td>
301
+ <td>Third column header</td>
302
+ </tr>
303
+ </thead><tbody>
304
+ <tr class="oddrow"><th>Row header 1</th>
305
+ <td>This is data</td>
306
+ <td>This is data</td>
307
+ </tr>
308
+ <tr class="evenrow"><th>Row header 2</th>
309
+ <td>
310
+ <p>This is data p</p>
311
+ </td>
312
+ <td>
313
+ <p>This is data</p>
314
+ </td>
315
+ </tr>
316
+ <tr class="oddrow"><th>
317
+ <p>Row header 3</p>
318
+ </th>
319
+ <td>
320
+ <p>This is long data</p>
321
+ </td>
322
+ <td>This is data</td>
323
+ </tr>
324
+ <tr class="evenrow"><th>
325
+ <p>Row header 4</p>
326
+ <p>&lt;th&gt; cell acting as header</p>
327
+ </th>
328
+ <td>This is data</td>
329
+ <td>
330
+ <p>This is data</p>
331
+ </td>
332
+ </tr>
333
+ <tr class="oddrow"><th>Row header 5</th>
334
+ <td>Also data</td>
335
+ <td>Also data</td>
336
+ </tr>
337
+ <tr class="evenrow"><th>Row header 6</th>
338
+ <td>Also data</td>
339
+ <td>Also data</td>
340
+ </tr>
341
+ <tr class="oddrow"><th>Row header 7</th>
342
+ <td>Also data</td>
343
+ <td>Also data</td>
344
+ </tr>
345
+ <tr class="evenrow"><th>Row header 8</th>
346
+ <td>Also data</td>
347
+ <td>Also data</td>
348
+ </tr>
349
+ </tbody></table>
350
+
351
+ <p>&nbsp;</p>
352
+
353
+ <p>bpmTopnTail Class </p>
354
+ <table class="bpmTopnTail"><thead></thead><tbody>
355
+ <tr>
356
+ <td>Row 1</td>
357
+ <td>This is data</td>
358
+ <td>This is data</td>
359
+ </tr>
360
+ <tr>
361
+ <td>Row 2</td>
362
+ <td>
363
+ <p>This is data p</p>
364
+ </td>
365
+ <td>
366
+ <p>This is data</p>
367
+ </td>
368
+ </tr>
369
+ <tr>
370
+ <td>
371
+ <p>Row 3</p>
372
+ </td>
373
+ <td>
374
+ <p>This is long data</p>
375
+ </td>
376
+ <td>This is data</td>
377
+ </tr>
378
+ <tr>
379
+ <td>
380
+ <p>Row 4 &lt;td&gt; cell</p>
381
+ </td>
382
+ <td>This is data</td>
383
+ <td>
384
+ <p>This is data</p>
385
+ </td>
386
+ </tr>
387
+ <tr>
388
+ <td>Row 5</td>
389
+ <td>Also data</td>
390
+ <td>Also data</td>
391
+ </tr>
392
+ <tr>
393
+ <td>Row 6</td>
394
+ <td>Also data</td>
395
+ <td>Also data</td>
396
+ </tr>
397
+ <tr>
398
+ <td>Row 7</td>
399
+ <td>Also data</td>
400
+ <td>Also data</td>
401
+ </tr>
402
+ <tr>
403
+ <td>Row 8</td>
404
+ <td>Also data</td>
405
+ <td>Also data</td>
406
+ </tr>
407
+ </tbody></table>
408
+ <p>&nbsp;</p>
409
+ <p>bpmTopnTail<b>C</b> Class (centered) Odd and Even rows</p>
410
+ <table class="bpmTopnTailC"><thead>
411
+ <tr class="headerrow"><th>Col/Row Header</th>
412
+ <td>
413
+ <p>Second column header p</p>
414
+ </td>
415
+ <td>Third column header</td>
416
+ </tr>
417
+ </thead><tbody>
418
+ <tr class="oddrow"><th>Row header 1</th>
419
+ <td>This is data</td>
420
+ <td>This is data</td>
421
+ </tr>
422
+ <tr class="evenrow"><th>Row header 2</th>
423
+ <td>
424
+ <p>This is data p</p>
425
+ </td>
426
+ <td>
427
+ <p>This is data</p>
428
+ </td>
429
+ </tr>
430
+ <tr class="oddrow"><th>
431
+ <p>Row header 3</p>
432
+ </th>
433
+ <td>
434
+ <p>This is long data</p>
435
+ </td>
436
+ <td>This is data</td>
437
+ </tr>
438
+ <tr class="evenrow"><th>
439
+ <p>Row header 4</p>
440
+ <p>&lt;th&gt; cell acting as header</p>
441
+ </th>
442
+ <td>This is data</td>
443
+ <td>
444
+ <p>This is data</p>
445
+ </td>
446
+ </tr>
447
+ <tr class="oddrow"><th>Row header 5</th>
448
+ <td>Also data</td>
449
+ <td>Also data</td>
450
+ </tr>
451
+ <tr class="evenrow"><th>Row header 6</th>
452
+ <td>Also data</td>
453
+ <td>Also data</td>
454
+ </tr>
455
+ <tr class="oddrow"><th>Row header 7</th>
456
+ <td>Also data</td>
457
+ <td>Also data</td>
458
+ </tr>
459
+ <tr class="evenrow"><th>Row header 8</th>
460
+ <td>Also data</td>
461
+ <td>Also data</td>
462
+ </tr>
463
+ </tbody></table>
464
+
465
+ <p>&nbsp;</p>
466
+
467
+ <p>TopnTail Class</p>
468
+ <table class="bpmTopnTail"><thead>
469
+ <tr class="headerrow"><th>Col and Row Header</th>
470
+ <td>
471
+ <p>Second</p>
472
+ <p>column</p>
473
+ </td>
474
+ <td class="pmhTopRight">Top right align</td>
475
+ </tr>
476
+ </thead><tbody>
477
+ <tr class="oddrow"><th>
478
+ <p>Row header 1 p</p>
479
+ </th>
480
+ <td>This is data</td>
481
+ <td>This is data</td>
482
+ </tr>
483
+ <tr class="evenrow"><th>Row header 2</th>
484
+ <td class="pmhBottomRight"><b><i>Bottom right align</i></b></td>
485
+ <td>
486
+ <p>This is data. Can use</p>
487
+ <p><b>bold</b> <i>italic </i><sub>sub</sub> or <sup>sup</sup> text</p>
488
+ </td>
489
+ </tr>
490
+ <tr class="oddrow"><th class="pmhBottomRight">
491
+ <p>Bottom right align</p>
492
+ </th>
493
+ <td class="pmhMiddleCenter" style="border: #000000 1px solid">
494
+ <p>This is data. This cell</p>
495
+ <p>uses Cell Styles to set</p>
496
+ <p>the borders.</p>
497
+ <p>All borders are collapsible</p>
498
+ <p>in mPDF.</p>
499
+ </td>
500
+ <td>This is data</td>
501
+ </tr>
502
+ <tr class="evenrow"><th>Row header 4</th>
503
+ <td>
504
+ <p>This is data p</p>
505
+ </td>
506
+ <td>More data</td>
507
+ </tr>
508
+ <tr class="oddrow"><th>Row header 5</th>
509
+ <td colspan="2" class="pmhTopCenter">Also data merged and centered</td>
510
+ </tr>
511
+ </tbody></table>
512
+
513
+ <p>&nbsp;</p>
514
+
515
+ <h4>Lists in a Table</h4>
516
+ <table class="bpmTopnTail"><thead>
517
+ <tr class="headerrow"><th>Col and Row Header</th>
518
+ <td>
519
+ <p>Second</p>
520
+ <p>column</p>
521
+ </td>
522
+ <td class="pmhTopRight">Top right align</td>
523
+ </tr>
524
+ </thead><tbody>
525
+ <tr class="oddrow"><th>
526
+ <p>Row header 1 p</p>
527
+ </th>
528
+ <td>This is data</td>
529
+ <td>This is data</td>
530
+ </tr>
531
+ <tr class="evenrow"><th>Row header 2</th>
532
+ <td>
533
+ <ol>
534
+ <li>Item 1</li>
535
+ <li>Item 2
536
+ <ol type="a">
537
+ <li>Subitem of ordered list</li>
538
+ <li>Subitem 2
539
+ <ol type="i">
540
+ <li>Level 3 subitem</li>
541
+ <li>Level 3 subitem</li>
542
+ </ol>
543
+ </li>
544
+ </ol>
545
+ </li>
546
+ <li>Item 3</li>
547
+ <li>Another Item</li>
548
+ <li>Subitem
549
+ <ol>
550
+ <li>Level 3 subitem</li>
551
+ </ol>
552
+ </li>
553
+ <li>Another Item</li>
554
+ </ol>
555
+ </td>
556
+ <td>
557
+ Unordered list:
558
+ <ul>
559
+ <li>Item 1</li>
560
+ <li>Item 2
561
+ <ul>
562
+ <li>Subitem of unordered list</li>
563
+ <li>Subitem 2
564
+ <ul>
565
+ <li>Level 3 subitem</li>
566
+ <li>Level 3 subitem</li>
567
+ <li>Level 3 subitem</li>
568
+ </ul>
569
+ </li>
570
+ </ul>
571
+ </li>
572
+ <li>Item 3</li>
573
+ </ul>
574
+ </td>
575
+ </tr>
576
+ </tbody></table>
577
+ <p>&nbsp;</p>
578
+
579
+
580
+ <h4>Automatic Column Width</h4>
581
+ <table class="bpmTopnTail"><tbody>
582
+ <tr>
583
+ <td>Causes</td>
584
+ <td>Nulla felis erat, imperdiet eu, ullamcorper non, nonummy quis, elit. <br />
585
+ Ut a eros at ligula vehicula pretium; maecenas feugiat pede vel risus.<br />
586
+ Suspendisse potenti</td>
587
+ </tr>
588
+ <tr>
589
+ <td>Mechanisms</td>
590
+ <td>Ut magna ipsum, tempus in, condimentum at, rutrum et, nisl. Vestibulum interdum luctus sapien. Quisque viverra. Etiam id libero at magna pellentesque aliquet. Nulla sit amet ipsum id enim tempus dictum. Maecenas consectetuer eros quis massa. Mauris semper velit vehicula purus. Duis lacus. Aenean pretium consectetuer mauris. Ut purus sem, consequat ut, fermentum sit amet, ornare sit amet, ipsum. Donec non nunc. Maecenas fringilla. Curabitur libero. In dui massa, malesuada sit amet, hendrerit vitae, viverra nec, tortor. Donec varius. Ut ut dolor et tellus adipiscing adipiscing.</td>
591
+ </tr>
592
+ </tbody></table>
593
+
594
+
595
+ <h4>ColSpan & Rowspan</h4>
596
+ <table class="bpmTopnTail"><tbody>
597
+ <tr>
598
+ <td rowspan="2">Causes</td>
599
+ <td colspan="2">Nulla felis erat, imperdiet eu, ullamcorper non, nonummy quis, elit. <br />
600
+ Ut a eros at ligula vehicula pretium; maecenas feugiat pede vel risus.<br />
601
+ Suspendisse potenti</td>
602
+ </tr>
603
+ <tr>
604
+ <td>Fusce eleifend neque sit amet erat.<br />
605
+ Donec mattis, nisi id euismod auctor, neque metus pellentesque risus, at eleifend lacus sapien et risus.</td>
606
+ <td>Mauris ante pede, auctor ac, suscipit quis, malesuada sed, nulla.<br />
607
+ Phasellus feugiat, lectus ac aliquam molestie, leo lacus tincidunt turpis, vel aliquam quam odio et sapien.</td>
608
+ </tr>
609
+ </tbody></table>
610
+
611
+
612
+
613
+ <h4>Table Header & Footer Rows</h4>
614
+ <p>A table using a header row should repeat the header row across pages:</p>
615
+ <p>bpmTopic<b>C</b> Class</p>
616
+ <table class="bpmTopicC">
617
+ <thead>
618
+ <tr class="headerrow"><th>Col and Row Header</th>
619
+ <td>
620
+ <p>Second column header</p>
621
+ </td>
622
+ <td>Third column header</td>
623
+ </tr>
624
+ </thead>
625
+ <tfoot>
626
+ <tr class="footerrow"><th>Col and Row Footer</th>
627
+ <td>
628
+ <p>Second column footer</p>
629
+ </td>
630
+ <td>Third column footer</td>
631
+ </tr>
632
+ </tfoot>
633
+ <tbody>
634
+ <tr><th>Row header 1</th>
635
+ <td>This is data</td>
636
+ <td>This is data</td>
637
+ </tr>
638
+ <tr><th>Row header 2</th>
639
+ <td>This is data</td>
640
+ <td>
641
+ <p>This is data</p>
642
+ </td>
643
+ </tr>
644
+ <tr><th>
645
+ <p>Row header 3</p>
646
+ </th>
647
+ <td>
648
+ <p>This is data</p>
649
+ </td>
650
+ <td>This is data</td>
651
+ </tr>
652
+ <tr><th>Row header 4</th>
653
+ <td>This is data</td>
654
+ <td>
655
+ <p>This is data</p>
656
+ </td>
657
+ </tr>
658
+ <tr><th>Row header 5</th>
659
+ <td>Also data</td>
660
+ <td>Also data</td>
661
+ </tr>
662
+ <tr><th>Row header 6</th>
663
+ <td>Also data</td>
664
+ <td>Also data</td>
665
+ </tr>
666
+ <tr><th>Row header 7</th>
667
+ <td>Also data</td>
668
+ <td>Also data</td>
669
+ </tr>
670
+ <tr><th>Row header 8</th>
671
+ <td>Also data</td>
672
+ <td>Also data</td>
673
+ </tr>
674
+ <tr><th>Row header 9</th>
675
+ <td>Also data</td>
676
+ <td>Also data</td>
677
+ </tr>
678
+ <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
679
+ <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
680
+ <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
681
+ <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
682
+ <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
683
+ <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
684
+ <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
685
+ <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
686
+ <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
687
+ <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
688
+ <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
689
+ <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
690
+ <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
691
+ <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
692
+ <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
693
+ <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
694
+ <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
695
+ <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
696
+ <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
697
+ <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
698
+ <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
699
+ <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
700
+ <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
701
+ <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
702
+ <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
703
+ <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
704
+ <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
705
+ <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
706
+ <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
707
+ <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
708
+ <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
709
+ <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
710
+ <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
711
+ <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
712
+ <tr><th>Another Row header</th><td>Also data</td><td>Also data</td></tr>
713
+ </tbody></table>
714
+ <p>&nbsp;</p>
715
+
716
+ <h3>Autosizing Tables</h3>
717
+ <p>Periodic Table of elements. Tables are set by default to reduce font size if complete words will not fit inside each cell, to a maximum of 1/1.4 * the set font-size. This value can be changed by setting $mpdf->shrink_tables_to_fit=1.8 or using html attribute &lt;table autosize="1.8"&gt;.</p>
718
+
719
+ <h5>Periodic Table</h5>
720
+
721
+ <table style="border:1px solid #000000;" cellPadding="9"><thead>
722
+ <tr><th>1A</th><th>2A</th><th>3B</th><th>4B</th><th>5B</th><th>6B</th><th>7B</th><th>8B</th><th>8B</th><th>8B</th><th>1B</th><th>2B</th><th>3A</th><th>4A</th><th>5A</th><th>6A</th><th>7A</th><th>8A</th></tr></thead><tbody>
723
+ <tr>
724
+ <td colspan="18"></td>
725
+ </tr>
726
+ <tr>
727
+ <td>H </td>
728
+ <td colspan="16"></td>
729
+ <td>He </td>
730
+ </tr>
731
+ <tr>
732
+ <td>Li </td>
733
+ <td>Be </td>
734
+ <td colspan="10"></td>
735
+ <td>B </td>
736
+ <td>C </td>
737
+ <td>N </td>
738
+ <td>O </td>
739
+ <td>F </td>
740
+ <td>Ne </td>
741
+ </tr>
742
+ <tr>
743
+ <td>Na </td>
744
+ <td>Mg </td>
745
+ <td colspan="10"></td>
746
+ <td>Al </td>
747
+ <td>Si </td>
748
+ <td>P </td>
749
+ <td>S </td>
750
+ <td>Cl </td>
751
+ <td>Ar </td>
752
+ </tr>
753
+ <tr>
754
+ <td>K </td>
755
+ <td>Ca </td>
756
+ <td>Sc </td>
757
+ <td>Ti </td>
758
+ <td>V </td>
759
+ <td>Cr </td>
760
+ <td>Mn </td>
761
+ <td>Fe </td>
762
+ <td>Co </td>
763
+ <td>Ni </td>
764
+ <td>Cu </td>
765
+ <td>Zn </td>
766
+ <td>Ga </td>
767
+ <td>Ge </td>
768
+ <td>As </td>
769
+ <td>Se </td>
770
+ <td>Br </td>
771
+ <td>Kr </td>
772
+ </tr>
773
+ <tr>
774
+ <td>Rb </td>
775
+ <td>Sr </td>
776
+ <td>Y </td>
777
+ <td>Zr </td>
778
+ <td>Nb </td>
779
+ <td>Mo </td>
780
+ <td>Tc </td>
781
+ <td>Ru </td>
782
+ <td>Rh </td>
783
+ <td>Pd </td>
784
+ <td>Ag </td>
785
+ <td>Cd </td>
786
+ <td>In </td>
787
+ <td>Sn </td>
788
+ <td>Sb </td>
789
+ <td>Te </td>
790
+ <td>I </td>
791
+ <td>Xe </td>
792
+ </tr>
793
+ <tr>
794
+ <td>Cs </td>
795
+ <td>Ba </td>
796
+ <td>La </td>
797
+ <td>Hf </td>
798
+ <td>Ta </td>
799
+ <td>W </td>
800
+ <td>Re </td>
801
+ <td>Os </td>
802
+ <td>Ir </td>
803
+ <td>Pt </td>
804
+ <td>Au </td>
805
+ <td>Hg </td>
806
+ <td>Tl </td>
807
+ <td>Pb </td>
808
+ <td>Bi </td>
809
+ <td>Po </td>
810
+ <td>At </td>
811
+ <td>Rn </td>
812
+ </tr>
813
+ <tr>
814
+ <td>Fr </td>
815
+ <td>Ra </td>
816
+ <td>Ac </td>
817
+ <td colspan="15"></td>
818
+ </tr>
819
+ <tr>
820
+ <td colspan="18"></td>
821
+ </tr>
822
+ <tr>
823
+ <td colspan="3"></td>
824
+ <td>Ce </td>
825
+ <td>Pr </td>
826
+ <td>Nd </td>
827
+ <td>Pm </td>
828
+ <td>Sm </td>
829
+ <td>Eu </td>
830
+ <td>Gd </td>
831
+ <td>Tb </td>
832
+ <td>Dy </td>
833
+ <td>Ho </td>
834
+ <td>Er </td>
835
+ <td>Tm </td>
836
+ <td>Yb </td>
837
+ <td>Lu </td>
838
+ <td></td>
839
+ </tr>
840
+ <tr>
841
+ <td colspan="3"></td>
842
+ <td>Th </td>
843
+ <td>Pa </td>
844
+ <td>U </td>
845
+ <td>Np </td>
846
+ <td>Pu </td>
847
+ <td>Am </td>
848
+ <td>Cm </td>
849
+ <td>Bk </td>
850
+ <td>Cf </td>
851
+ <td>Es </td>
852
+ <td>Fm </td>
853
+ <td>Md </td>
854
+ <td>No </td>
855
+ <td>Lr </td>
856
+ <td></td>
857
+ </tr>
858
+ </tbody></table>
859
+
860
+ <pagebreak />
861
+
862
+ <h3>Rotating Tables</h3>
863
+ <p>This is set to rotate -90 degrees (counterclockwise).</p>
864
+
865
+ <h5>Periodic Table</h5>
866
+ <p>
867
+ <table rotate="-90" class="bpmClearC"><thead>
868
+ <tr><th>1A</th><th>2A</th><th>3B</th><th>4B</th><th>5B</th><th>6B</th><th>7B</th><th>8B</th><th>8B</th><th>8B</th><th>1B</th><th>2B</th><th>3A</th><th>4A</th><th>5A</th><th>6A</th><th>7A</th><th>8A</th></tr></thead><tbody>
869
+ <tr>
870
+ <td></td>
871
+ <td colspan="18"></td>
872
+ </tr>
873
+ <tr>
874
+ <td>H </td>
875
+ <td colspan="15"></td>
876
+ <td></td>
877
+ <td>He </td>
878
+ </tr>
879
+ <tr>
880
+ <td>Li </td>
881
+ <td>Be </td>
882
+ <td colspan="10"></td>
883
+ <td>B </td>
884
+ <td>C </td>
885
+ <td>N </td>
886
+ <td>O </td>
887
+ <td>F </td>
888
+ <td>Ne </td>
889
+ </tr>
890
+ <tr>
891
+ <td>Na </td>
892
+ <td>Mg </td>
893
+ <td colspan="10"></td>
894
+ <td>Al </td>
895
+ <td>Si </td>
896
+ <td>P </td>
897
+ <td>S </td>
898
+ <td>Cl </td>
899
+ <td>Ar </td>
900
+ </tr>
901
+ <tr>
902
+ <td>K </td>
903
+ <td>Ca </td>
904
+ <td>Sc </td>
905
+ <td>Ti </td>
906
+ <td>V </td>
907
+ <td>Cr </td>
908
+ <td>Mn </td>
909
+ <td>Fe </td>
910
+ <td>Co </td>
911
+ <td>Ni </td>
912
+ <td>Cu </td>
913
+ <td>Zn </td>
914
+ <td>Ga </td>
915
+ <td>Ge </td>
916
+ <td>As </td>
917
+ <td>Se </td>
918
+ <td>Br </td>
919
+ <td>Kr </td>
920
+ </tr>
921
+ <tr>
922
+ <td>Rb </td>
923
+ <td>Sr </td>
924
+ <td>Y </td>
925
+ <td>Zr </td>
926
+ <td>Nb </td>
927
+ <td>Mo </td>
928
+ <td>Tc </td>
929
+ <td>Ru </td>
930
+ <td>Rh </td>
931
+ <td>Pd </td>
932
+ <td>Ag </td>
933
+ <td>Cd </td>
934
+ <td>In </td>
935
+ <td>Sn </td>
936
+ <td>Sb </td>
937
+ <td>Te </td>
938
+ <td>I </td>
939
+ <td>Xe </td>
940
+ </tr>
941
+ <tr>
942
+ <td>Cs </td>
943
+ <td>Ba </td>
944
+ <td>La </td>
945
+ <td>Hf </td>
946
+ <td>Ta </td>
947
+ <td>W </td>
948
+ <td>Re </td>
949
+ <td>Os </td>
950
+ <td>Ir </td>
951
+ <td>Pt </td>
952
+ <td>Au </td>
953
+ <td>Hg </td>
954
+ <td>Tl </td>
955
+ <td>Pb </td>
956
+ <td>Bi </td>
957
+ <td>Po </td>
958
+ <td>At </td>
959
+ <td>Rn </td>
960
+ </tr>
961
+ <tr>
962
+ <td>Fr </td>
963
+ <td>Ra </td>
964
+ <td>Ac </td>
965
+ </tr>
966
+ <tr>
967
+ <td></td>
968
+ <td colspan="18"></td>
969
+ </tr>
970
+ <tr>
971
+ <td colspan="3"></td>
972
+ <td>Ce </td>
973
+ <td>Pr </td>
974
+ <td>Nd </td>
975
+ <td>Pm </td>
976
+ <td>Sm </td>
977
+ <td>Eu </td>
978
+ <td>Gd </td>
979
+ <td>Tb </td>
980
+ <td>Dy </td>
981
+ <td>Ho </td>
982
+ <td>Er </td>
983
+ <td>Tm </td>
984
+ <td>Yb </td>
985
+ <td>Lu </td>
986
+ <td></td>
987
+ </tr>
988
+ <tr>
989
+ <td colspan="3"></td>
990
+ <td>Th </td>
991
+ <td>Pa </td>
992
+ <td>U </td>
993
+ <td>Np </td>
994
+ <td>Pu </td>
995
+ <td>Am </td>
996
+ <td>Cm </td>
997
+ <td>Bk </td>
998
+ <td>Cf </td>
999
+ <td>Es </td>
1000
+ <td>Fm </td>
1001
+ <td>Md </td>
1002
+ <td>No </td>
1003
+ <td>Lr </td>
1004
+ <td></td>
1005
+ </tr>
1006
+ </tbody></table>
1007
+ <p>&nbsp;</p>
1008
+
1009
+ <pagebreak />
1010
+ <h3>Rotated text in Table Cells</h3>
1011
+
1012
+ <h5>Periodic Table</h5>
1013
+ <table>
1014
+ <thead>
1015
+ <tr text-rotate="45">
1016
+ <th><p>Element type 1A</p><p>Second line</p><th><p>Element type longer 2A</p></th>
1017
+ <th>Element type 3B</th>
1018
+ <th>Element type 4B</th>
1019
+ <th>Element type 5B</th>
1020
+ <th>Element type 6B</th>
1021
+ <th>7B</th><th>8B</th>
1022
+ <th>Element type 8B R</th>
1023
+ <th>8B</th>
1024
+ <th>Element <span>type</span> 1B</th>
1025
+ <th>2B</th>
1026
+ <th>Element type 3A</th>
1027
+ <th>Element type 4A</th>
1028
+ <th>Element type 5A</th>
1029
+ <th>Element type 6A</th>
1030
+ <th>7A</th>
1031
+ <th>Element type 8A</th>
1032
+ </tr>
1033
+ </thead>
1034
+
1035
+ <tbody>
1036
+ <tr>
1037
+ <td>H</td>
1038
+ <td colspan="15"></td>
1039
+ <td></td>
1040
+ <td>He </td>
1041
+ </tr>
1042
+ <tr>
1043
+ <td>Li </td>
1044
+ <td>Be </td>
1045
+ <td colspan="10"></td>
1046
+ <td>B </td>
1047
+ <td>C </td>
1048
+ <td>N </td>
1049
+ <td>O </td>
1050
+ <td>F </td>
1051
+ <td>Ne </td>
1052
+ </tr>
1053
+ <tr>
1054
+ <td>Na </td>
1055
+ <td>Mg </td>
1056
+ <td colspan="10"></td>
1057
+ <td>Al </td>
1058
+ <td>Si </td>
1059
+ <td>P </td>
1060
+ <td>S </td>
1061
+ <td>Cl </td>
1062
+ <td>Ar </td>
1063
+ </tr>
1064
+ <tr style="text-rotate: 45">
1065
+ <td>K </td>
1066
+ <td>Ca </td>
1067
+ <td>Sc </td>
1068
+ <td>Ti</td>
1069
+ <td>Va</td>
1070
+ <td>Cr</td>
1071
+ <td>Mn</td>
1072
+ <td>Fe</td>
1073
+ <td>Co</td>
1074
+ <td>Ni </td>
1075
+ <td>Cu </td>
1076
+ <td>Zn </td>
1077
+ <td>Ga </td>
1078
+ <td>Ge </td>
1079
+ <td>As </td>
1080
+ <td>Se </td>
1081
+ <td>Br </td>
1082
+ <td>Kr </td>
1083
+ </tr>
1084
+ <tr>
1085
+ <td>Rb </td>
1086
+ <td>Sr </td>
1087
+ <td>Y </td>
1088
+ <td>Zr </td>
1089
+ <td>Nb </td>
1090
+ <td>Mo </td>
1091
+ <td>Tc </td>
1092
+ <td>Ru </td>
1093
+ <td style="text-align:right; ">Rh</td>
1094
+ <td>Pd </td>
1095
+ <td>Ag </td>
1096
+ <td>Cd </td>
1097
+ <td>In </td>
1098
+ <td>Sn </td>
1099
+ <td>Sb </td>
1100
+ <td>Te </td>
1101
+ <td>I </td>
1102
+ <td>Xe </td>
1103
+ </tr>
1104
+ <tr>
1105
+ <td>Cs </td>
1106
+ <td>Ba </td>
1107
+ <td>La </td>
1108
+ <td>Hf </td>
1109
+ <td>Ta </td>
1110
+ <td>W </td>
1111
+ <td>Re </td>
1112
+ <td>Os </td>
1113
+ <td>Ir </td>
1114
+ <td>Pt </td>
1115
+ <td>Au </td>
1116
+ <td>Hg </td>
1117
+ <td>Tl </td>
1118
+ <td>Pb </td>
1119
+ <td>Bi </td>
1120
+ <td>Po </td>
1121
+ <td>At </td>
1122
+ <td>Rn </td>
1123
+ </tr>
1124
+ <tr>
1125
+ <td>Fr </td>
1126
+ <td>Ra </td>
1127
+ <td colspan="16">Ac </td>
1128
+ </tr>
1129
+ <tr>
1130
+ <td colspan="3"></td>
1131
+ <td>Ce </td>
1132
+ <td>Pr </td>
1133
+ <td>Nd </td>
1134
+ <td>Pm </td>
1135
+ <td>Sm </td>
1136
+ <td>Eu </td>
1137
+ <td>Gd </td>
1138
+ <td>Tb </td>
1139
+ <td>Dy </td>
1140
+ <td>Ho </td>
1141
+ <td>Er </td>
1142
+ <td>Tm </td>
1143
+ <td>Yb </td>
1144
+ <td>Lu </td>
1145
+ <td></td>
1146
+ </tr>
1147
+ <tr>
1148
+ <td colspan="3"></td>
1149
+ <td>Th </td>
1150
+ <td>Pa </td>
1151
+ <td>U </td>
1152
+ <td>Np </td>
1153
+ <td>Pu </td>
1154
+ <td>Am </td>
1155
+ <td>Cm </td>
1156
+ <td>Bk </td>
1157
+ <td>Cf </td>
1158
+ <td>Es </td>
1159
+ <td>Fm </td>
1160
+ <td>Md </td>
1161
+ <td>No </td>
1162
+ <td>Lr </td>
1163
+ <td></td>
1164
+ </tr>
1165
+ </tbody></table>
1166
+ <p>&nbsp;</p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1167
 
1168
 
1169
+ <?php
1170
+ }
1171
+
1172
+ ?>
1173
  </body>
1174
  </html>
initialisation/templates/example-template.php CHANGED
@@ -1,31 +1,34 @@
1
  <?php
2
 
3
  /**
4
- * Don't give direct access to the template
 
5
  */
6
  if(!class_exists("RGForms")){
7
  return;
8
  }
9
 
 
 
 
 
 
 
10
  /**
11
- * Load the form data to pass to our PDF generating function
12
  */
13
  $form = RGFormsModel::get_form_meta($form_id);
 
14
 
15
  ?>
16
 
17
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
18
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
19
- <html>
20
- <head>
21
- <link rel='stylesheet' href='<?php echo PDF_PLUGIN_URL .'initialisation/template.css'; ?>' type='text/css' />
22
- <?php
23
- /*
24
- * Create your own stylesheet or use the <style></style> tags to add or modify styles
25
- * The plugin stylesheet is overridden every update
26
- */
27
- ?>
28
- <title>Gravity PDF</title>
29
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
30
  </head>
31
  <body>
@@ -34,62 +37,76 @@ $form = RGFormsModel::get_form_meta($form_id);
34
  foreach($lead_ids as $lead_id) {
35
 
36
  $lead = RGFormsModel::get_lead($lead_id);
 
37
  $form_data = GFPDFEntryDetail::lead_detail_grid_array($form, $lead);
38
-
39
  /*
40
  * Add &data=1 when viewing the PDF via the admin area to view the $form_data array
41
  */
42
  PDF_Common::view_data($form_data);
43
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
  /*
45
- * Store your form fields from the $form_data array into variables here
46
- * To see your entire $form_data array, view your PDF via the admin area and add &data=1 to the url
47
- *
48
- * For an example of accessing $form_data fields see https://developer.gravitypdf.com/documentation/custom-templates-introduction/
49
  *
50
- * Alternatively, as of v3.4.0 you can use merge tags (except {allfields}) in your templates.
51
- * Just add merge tags to your HTML and they'll be parsed before generating the PDF.
52
- *
53
- */
54
-
55
- ?>
56
-
57
- <!-- New to v3.4.0, watermarking is now enabled. See example-watermark09.php for more details -->
58
- <watermarktext content="DRAFT" alpha="0.1" />
59
-
60
- <!-- There's much better server compatibility if you use the absolute path to the image as oppose to a URL. -->
61
- <img src="<?php echo PDF_PLUGIN_DIR ?>resources/images/gravityformspdfextended.jpg" width="311" height="110" />
 
 
 
 
 
62
 
63
 
64
- <!-- let's build our body content -->
65
  <div class="body_copy">
66
 
67
- <p class="whom_concern_intro">Dear User,</p>
68
 
69
- <p class="body_text">Gravity PDF allows you to directly access Gravity Form field data so you can create custom PDFs like this one.
70
- If you haven't reviewed our five part installation and configuration guide yet, we recommend <a target="_blank" href="https://developer.gravitypdf.com/documentation/getting-started-with-gravity-pdf-configuration/">taking a look</a>.
71
- There's also a <a target="_blank" href="https://developer.gravitypdf.com/documentation/configuration-options-examples/">large number of configuration options</a> that can be applied to any PDF.</p>
72
- </p>
73
-
74
- <p class="body_text">Now you've got an understanding on configuring the software, let's take a look at custom templates.
75
- To start with, you'll want to copy and rename one of the <em>example-</em> template files in your active theme's PDF_EXTENDED_TEMPLATES directory. </p>
 
 
 
 
 
 
 
 
76
 
77
- <p class="body_text">Once copied, go to your Wordpress Dashboard and navigate to Forms -> Entries and click the View PDF button on one of your entries. If you haven't assigned a custom template to the form, the default-template.php should open.
78
- If you change <em>default-template.php</em> in the URL to the new template you just made it will generate a PDF based off that file.</p>
79
- <p class="body_text">Once you have your new template file open in your browser window you can access the $form_data array (which contains all the Gravity Form entry data) by appending the URL with &amp;data=1. <strong>Note: this only works if you copied a template file with example- in the name.</strong></p>
80
- <p><strong>Example:</strong> http://www.yourdomain.com/?gf_pdf=1&amp;fid=2&amp;lid=6&amp;template=new-example-template.php&amp;data=1 </p>
81
-
82
- <p>For more information about custom templates <a target="_blank" href="https://developer.gravitypdf.com/documentation/custom-templates-introduction/">review the plugin's documentation</a><br /><br />
83
- </p>
84
- <p class="signature">
85
- Jake Jackson<br />
86
- <img src="<?php echo PDF_PLUGIN_DIR ?>resources/images/signature.png" alt="Signature" width="100" height="60" /><br />
87
- Developer, Gravity PDF<br />
88
- <a target="_blank" href="http://gravitypdf.com">gravitypdf.com</a>
89
- </p>
90
 
91
- </div>
 
92
 
93
- <?php } ?>
 
 
 
94
  </body>
95
  </html>
1
  <?php
2
 
3
  /**
4
+ * If the template is being loaded directy we'll call the Wordpress Core
5
+ * Used when attempting to debug the template
6
  */
7
  if(!class_exists("RGForms")){
8
  return;
9
  }
10
 
11
+ /**
12
+ * Set up the form ID and lead ID, as well as we want page breaks displayed.
13
+ * Form ID and Lead ID can be set by passing it to the URL - ?fid=1&lid=10
14
+ */
15
+ PDF_Common::setup_ids();
16
+
17
  /**
18
+ * Load the form data, including the custom style sheet which looks in the plugin's theme folder before defaulting back to the plugin's file.
19
  */
20
  $form = RGFormsModel::get_form_meta($form_id);
21
+ $stylesheet_location = (file_exists(PDF_TEMPLATE_LOCATION.'template.css')) ? PDF_TEMPLATE_URL_LOCATION.'template.css' : PDF_PLUGIN_URL .'styles/template.css' ;
22
 
23
  ?>
24
 
25
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
26
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
27
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
28
+ <head>
29
+
30
+ <link rel='stylesheet' href='<?php echo $stylesheet_location; ?>' type='text/css' />
31
+ <title>Gravity Forms PDF Extended</title>
 
 
 
 
 
32
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
33
  </head>
34
  <body>
37
  foreach($lead_ids as $lead_id) {
38
 
39
  $lead = RGFormsModel::get_lead($lead_id);
40
+ do_action("gform_print_entry_header", $form, $lead);
41
  $form_data = GFPDFEntryDetail::lead_detail_grid_array($form, $lead);
 
42
  /*
43
  * Add &data=1 when viewing the PDF via the admin area to view the $form_data array
44
  */
45
  PDF_Common::view_data($form_data);
46
 
47
+ /* get all the form values */
48
+ /*$date_created = $form_data['date_created'];
49
+
50
+ $first_name = $form_data['1.Name']['first'];
51
+ $last_name = $form_data['1.Name']['last'];
52
+
53
+ $address_street = $form_data['2.Address']['street'];
54
+ $address_city = $form_data['2.Address']['city'];
55
+ $address_state = $form_data['2.Address']['state'];
56
+ $address_zip = $form_data['2.Address']['zip'];
57
+ $address_country = $form_data['2.Address']['country'];
58
+
59
+ $phone = $form_data['3.Phone'];*/
60
+ /* format the template */
61
  /*
62
+ * If this form had the above field items we could access them using the code below
 
 
 
63
  *
64
+ <p class="date"><?php echo $date_created; ?></p>
65
+
66
+ <p class="client_address">
67
+ <?php if(strlen($first_name) > 0) { ?>
68
+ <?php echo $first_name .' '. $last_name; ?><br />
69
+ <?php } ?>
70
+ <?php if(strlen($address_street) > 0) { ?>
71
+ <?php echo $address_street; ?><br />
72
+ <?php echo $address_city .', '. $address_state .' '. $address_zip; ?><br />
73
+ <?php echo $address_country; ?>
74
+ <?php } ?>
75
+ </p>
76
+ */
77
+
78
+ ?>
79
+
80
+ <img src="<?php echo PDF_PLUGIN_DIR ?>resources/images/gravityformspdfextended.jpg" width="311" height="110" />
81
 
82
 
 
83
  <div class="body_copy">
84
 
85
+ <p class="whom_concern_intro">Dear User,</p>
86
 
87
+ <p class="body_text"> Gravity Forms PDF Extended allows you to directly access Gravity Form field data so you can create custom PDFs like this one. You'll need to copy and rename the <em>example-template.php</em> file in your active theme's PDF_EXTENDED_TEMPLATES/ folder. Go to your admin area and click the View PDF button on a form entry. The default-template.php should open by default but changing the URL to your new template file will call your new template file. </p>
88
+ <p class="body_text">Once you have your new template file open in your browser window you can access the $form_data array (which contains all the Gravity Form entry data) by appending the URL with &amp;data=1. <strong>Note: this only works if you copied a template file with example- in the name.</strong></p>
89
+ <p><strong>Example:</strong> http://www.yourdomain.com/?gf_pdf=1&amp;fid=2&amp;lid=6&amp;template=new-example-template.php&amp;data=1 </p>
90
+ <p>For more information about custom templates <a href="http://gravityformspdfextended.com/documentation-v3-x-x/templates/getting-started/">review the plugin's documentation</a><br /><br />
91
+ </p>
92
+ <p class="signature">
93
+ Jake Jackson<br />
94
+ <img src="<?php echo PDF_PLUGIN_DIR ?>resources/images/signature.png" alt="Signature" width="100" height="60" /><br />
95
+ Developer, Gravity Forms PDF Extended<br />
96
+ <a href="http://www.gravityformspdfextended.com">www.gravityformspdfextended.com</a>
97
+ </p>
98
+
99
+ </div>
100
+
101
+ <?php
102
 
 
 
 
 
 
 
 
 
 
 
 
 
 
103
 
104
+ ?>
105
+
106
 
107
+ <?php
108
+ }
109
+
110
+ ?>
111
  </body>
112
  </html>
initialisation/templates/example-watermark09.php DELETED
@@ -1,136 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Don't give direct access to the template
5
- */
6
- if(!class_exists("RGForms")){
7
- return;
8
- }
9
-
10
- /**
11
- * Load the form data to pass to our PDF generating function
12
- */
13
- $form = RGFormsModel::get_form_meta($form_id);
14
-
15
- ?>
16
-
17
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
18
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
19
- <html>
20
- <head>
21
- <link rel='stylesheet' href='<?php echo PDF_PLUGIN_URL .'initialisation/template.css'; ?>' type='text/css' />
22
- <?php
23
- /*
24
- * Create your own stylesheet or use the <style></style> tags to add or modify styles
25
- * The plugin stylesheet is overridden every update
26
- */
27
- ?>
28
- <title>Gravity PDF</title>
29
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
30
- </head>
31
- <body>
32
- <?php
33
-
34
- foreach($lead_ids as $lead_id) {
35
-
36
- $lead = RGFormsModel::get_lead($lead_id);
37
- $form_data = GFPDFEntryDetail::lead_detail_grid_array($form, $lead);
38
-
39
- /*
40
- * Add &data=1 when viewing the PDF via the admin area to view the $form_data array
41
- */
42
- PDF_Common::view_data($form_data);
43
-
44
- /*
45
- * Store your form fields from the $form_data array into variables here
46
- * To see your entire $form_data array, view your PDF via the admin area and add &data=1 to the url
47
- *
48
- * For an example of accessing $form_data fields see https://developer.gravitypdf.com/documentation/custom-templates-introduction/
49
- *
50
- * Alternatively, as of v3.4.0 you can use merge tags (except {allfields}) in your templates.
51
- * Just add merge tags to your HTML and they'll be parsed before generating the PDF.
52
- *
53
- */
54
-
55
- ?>
56
-
57
- <!--
58
- Watermark content must have characters properly encoded: < = &lt; > = &gt; & = &amp; ' = &#39; or " = &quot;
59
- Best to use htmlspecialchars('Content', ENT_QUOTES)
60
- Setting content to blank will clear the watermark
61
- -->
62
-
63
- <watermarktext content="<?php echo htmlspecialchars("DRAFT'S", ENT_QUOTES); ?>" alpha="0.1" />
64
-
65
- <img src="<?php echo PDF_PLUGIN_DIR ?>resources/images/gravityformspdfextended.jpg" width="311" height="110" />
66
-
67
- <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam sollicitudin, magna et interdum hendrerit, est libero convallis odio, quis dapibus augue risus condimentum nisl. Quisque in orci dui. Pellentesque volutpat, nibh non eleifend fringilla, massa risus blandit neque, vestibulum adipiscing elit purus in tortor. Ut mauris libero, commodo eu suscipit vel, sagittis nec erat. Maecenas at eros facilisis, vestibulum felis sit amet, pellentesque nunc. Mauris accumsan leo a gravida tincidunt. Aliquam congue, leo vitae consequat tempor, arcu arcu dapibus ipsum, sit amet faucibus sem nulla nec lorem.</p>
68
- <p>Vivamus eu neque ac tortor fringilla malesuada. Nullam sed orci non erat vehicula volutpat eu sed velit. Donec gravida lacus ut tortor facilisis vestibulum. Vivamus venenatis hendrerit neque et porttitor. Aenean ultricies quis nibh nec euismod. Aliquam aliquam erat eget erat blandit sollicitudin. Curabitur non quam eget neque dignissim posuere.</p>
69
- <p>Nullam euismod venenatis eleifend. Donec et iaculis velit. Sed in magna sit amet felis egestas sagittis id ut velit. Morbi eleifend dictum interdum. Vestibulum convallis rutrum erat id lacinia. Pellentesque vulputate porta vehicula. Curabitur sagittis vel diam at placerat. Aliquam auctor diam sit amet risus convallis dignissim. Donec fermentum quam porttitor porta sagittis. Maecenas tristique turpis enim, eget convallis neque bibendum vitae. Ut iaculis lacus at rutrum ultrices. Suspendisse ut urna vitae purus eleifend laoreet non sit amet sem. </p>
70
-
71
- <pagebreak />
72
-
73
- <watermarktext content="<?php echo htmlspecialchars("PRIVATE", ENT_QUOTES); ?>" alpha="0.5" />
74
-
75
- <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam sollicitudin, magna et interdum hendrerit, est libero convallis odio, quis dapibus augue risus condimentum nisl. Quisque in orci dui. Pellentesque volutpat, nibh non eleifend fringilla, massa risus blandit neque, vestibulum adipiscing elit purus in tortor. Ut mauris libero, commodo eu suscipit vel, sagittis nec erat. Maecenas at eros facilisis, vestibulum felis sit amet, pellentesque nunc. Mauris accumsan leo a gravida tincidunt. Aliquam congue, leo vitae consequat tempor, arcu arcu dapibus ipsum, sit amet faucibus sem nulla nec lorem.</p>
76
- <p>Vivamus eu neque ac tortor fringilla malesuada. Nullam sed orci non erat vehicula volutpat eu sed velit. Donec gravida lacus ut tortor facilisis vestibulum. Vivamus venenatis hendrerit neque et porttitor. Aenean ultricies quis nibh nec euismod. Aliquam aliquam erat eget erat blandit sollicitudin. Curabitur non quam eget neque dignissim posuere.</p>
77
- <p>Nullam euismod venenatis eleifend. Donec et iaculis velit. Sed in magna sit amet felis egestas sagittis id ut velit. Morbi eleifend dictum interdum. Vestibulum convallis rutrum erat id lacinia. Pellentesque vulputate porta vehicula. Curabitur sagittis vel diam at placerat. Aliquam auctor diam sit amet risus convallis dignissim. Donec fermentum quam porttitor porta sagittis. Maecenas tristique turpis enim, eget convallis neque bibendum vitae. Ut iaculis lacus at rutrum ultrices. Suspendisse ut urna vitae purus eleifend laoreet non sit amet sem. </p>
78
-
79
-
80
- <pagebreak />
81
-
82
- <watermarktext content="" />
83
-
84
- <p>Water mark turned off</p>
85
-
86
- <pagebreak />
87
- <!--
88
- Let's look at the image watermark now.
89
- It accepts two additional arguments to <watermarktext>: size and position
90
- And 'content' is substituted for 'src' : the link to the image
91
-
92
- Size Options:
93
- D: default i.e. original size of image - may depend on img_dpi
94
- P: Resize to fit the full page size, keeping aspect ratio
95
- F: Resize to fit the print-area (frame) respecting current page margins, keeping aspect ratio
96
- INT: Resize to full page size minus a margin set by this integer in millimeters, keeping aspect ratio
97
- 2 comma-separated numbers ($width, $height): Specify a size; units in millimeters
98
- DEFAULT: "D"
99
-
100
- Position options:
101
- P: Centred on the whole page area
102
- F: Centred on the page print-area (frame) respecting page margins
103
- 2 comma-separated numbers ($x, $y): Specify a position; units in millimeters
104
- DEFAULT: "P"
105
-
106
- -->
107
-
108
- <watermarkimage src="<?php echo PDF_PLUGIN_DIR ?>resources/images/gravityformspdfextended.jpg" alpha="0.1" size="D" position="P" />
109
- <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam sollicitudin, magna et interdum hendrerit, est libero convallis odio, quis dapibus augue risus condimentum nisl. Quisque in orci dui. Pellentesque volutpat, nibh non eleifend fringilla, massa risus blandit neque, vestibulum adipiscing elit purus in tortor. Ut mauris libero, commodo eu suscipit vel, sagittis nec erat. Maecenas at eros facilisis, vestibulum felis sit amet, pellentesque nunc. Mauris accumsan leo a gravida tincidunt. Aliquam congue, leo vitae consequat tempor, arcu arcu dapibus ipsum, sit amet faucibus sem nulla nec lorem.</p>
110
- <p>Vivamus eu neque ac tortor fringilla malesuada. Nullam sed orci non erat vehicula volutpat eu sed velit. Donec gravida lacus ut tortor facilisis vestibulum. Vivamus venenatis hendrerit neque et porttitor. Aenean ultricies quis nibh nec euismod. Aliquam aliquam erat eget erat blandit sollicitudin. Curabitur non quam eget neque dignissim posuere.</p>
111
- <p>Nullam euismod venenatis eleifend. Donec et iaculis velit. Sed in magna sit amet felis egestas sagittis id ut velit. Morbi eleifend dictum interdum. Vestibulum convallis rutrum erat id lacinia. Pellentesque vulputate porta vehicula. Curabitur sagittis vel diam at placerat. Aliquam auctor diam sit amet risus convallis dignissim. Donec fermentum quam porttitor porta sagittis. Maecenas tristique turpis enim, eget convallis neque bibendum vitae. Ut iaculis lacus at rutrum ultrices. Suspendisse ut urna vitae purus eleifend laoreet non sit amet sem. </p>
112
-
113
- <pagebreak />
114
-
115
- <watermarkimage src="<?php echo PDF_PLUGIN_DIR ?>resources/images/gravityformspdfextended.jpg" alpha="0.5" size="P" position="F" />
116
- <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam sollicitudin, magna et interdum hendrerit, est libero convallis odio, quis dapibus augue risus condimentum nisl. Quisque in orci dui. Pellentesque volutpat, nibh non eleifend fringilla, massa risus blandit neque, vestibulum adipiscing elit purus in tortor. Ut mauris libero, commodo eu suscipit vel, sagittis nec erat. Maecenas at eros facilisis, vestibulum felis sit amet, pellentesque nunc. Mauris accumsan leo a gravida tincidunt. Aliquam congue, leo vitae consequat tempor, arcu arcu dapibus ipsum, sit amet faucibus sem nulla nec lorem.</p>
117
- <p>Vivamus eu neque ac tortor fringilla malesuada. Nullam sed orci non erat vehicula volutpat eu sed velit. Donec gravida lacus ut tortor facilisis vestibulum. Vivamus venenatis hendrerit neque et porttitor. Aenean ultricies quis nibh nec euismod. Aliquam aliquam erat eget erat blandit sollicitudin. Curabitur non quam eget neque dignissim posuere.</p>
118
- <p>Nullam euismod venenatis eleifend. Donec et iaculis velit. Sed in magna sit amet felis egestas sagittis id ut velit. Morbi eleifend dictum interdum. Vestibulum convallis rutrum erat id lacinia. Pellentesque vulputate porta vehicula. Curabitur sagittis vel diam at placerat. Aliquam auctor diam sit amet risus convallis dignissim. Donec fermentum quam porttitor porta sagittis. Maecenas tristique turpis enim, eget convallis neque bibendum vitae. Ut iaculis lacus at rutrum ultrices. Suspendisse ut urna vitae purus eleifend laoreet non sit amet sem. </p>
119
-
120
- <pagebreak />
121
-
122
- <watermarkimage src="<?php echo PDF_PLUGIN_DIR ?>resources/images/gravityformspdfextended.jpg" alpha="0.1" size="D" position="1,1" />
123
- <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam sollicitudin, magna et interdum hendrerit, est libero convallis odio, quis dapibus augue risus condimentum nisl. Quisque in orci dui. Pellentesque volutpat, nibh non eleifend fringilla, massa risus blandit neque, vestibulum adipiscing elit purus in tortor. Ut mauris libero, commodo eu suscipit vel, sagittis nec erat. Maecenas at eros facilisis, vestibulum felis sit amet, pellentesque nunc. Mauris accumsan leo a gravida tincidunt. Aliquam congue, leo vitae consequat tempor, arcu arcu dapibus ipsum, sit amet faucibus sem nulla nec lorem.</p>
124
- <p>Vivamus eu neque ac tortor fringilla malesuada. Nullam sed orci non erat vehicula volutpat eu sed velit. Donec gravida lacus ut tortor facilisis vestibulum. Vivamus venenatis hendrerit neque et porttitor. Aenean ultricies quis nibh nec euismod. Aliquam aliquam erat eget erat blandit sollicitudin. Curabitur non quam eget neque dignissim posuere.</p>
125
- <p>Nullam euismod venenatis eleifend. Donec et iaculis velit. Sed in magna sit amet felis egestas sagittis id ut velit. Morbi eleifend dictum interdum. Vestibulum convallis rutrum erat id lacinia. Pellentesque vulputate porta vehicula. Curabitur sagittis vel diam at placerat. Aliquam auctor diam sit amet risus convallis dignissim. Donec fermentum quam porttitor porta sagittis. Maecenas tristique turpis enim, eget convallis neque bibendum vitae. Ut iaculis lacus at rutrum ultrices. Suspendisse ut urna vitae purus eleifend laoreet non sit amet sem. </p>
126
-
127
- <pagebreak />
128
-
129
- <watermarkimage src="<?php echo PDF_PLUGIN_DIR ?>resources/images/gravityformspdfextended.jpg" alpha="0.5" size="50, 50" position="P" />
130
- <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam sollicitudin, magna et interdum hendrerit, est libero convallis odio, quis dapibus augue risus condimentum nisl. Quisque in orci dui. Pellentesque volutpat, nibh non eleifend fringilla, massa risus blandit neque, vestibulum adipiscing elit purus in tortor. Ut mauris libero, commodo eu suscipit vel, sagittis nec erat. Maecenas at eros facilisis, vestibulum felis sit amet, pellentesque nunc. Mauris accumsan leo a gravida tincidunt. Aliquam congue, leo vitae consequat tempor, arcu arcu dapibus ipsum, sit amet faucibus sem nulla nec lorem.</p>
131
- <p>Vivamus eu neque ac tortor fringilla malesuada. Nullam sed orci non erat vehicula volutpat eu sed velit. Donec gravida lacus ut tortor facilisis vestibulum. Vivamus venenatis hendrerit neque et porttitor. Aenean ultricies quis nibh nec euismod. Aliquam aliquam erat eget erat blandit sollicitudin. Curabitur non quam eget neque dignissim posuere.</p>
132
- <p>Nullam euismod venenatis eleifend. Donec et iaculis velit. Sed in magna sit amet felis egestas sagittis id ut velit. Morbi eleifend dictum interdum. Vestibulum convallis rutrum erat id lacinia. Pellentesque vulputate porta vehicula. Curabitur sagittis vel diam at placerat. Aliquam auctor diam sit amet risus convallis dignissim. Donec fermentum quam porttitor porta sagittis. Maecenas tristique turpis enim, eget convallis neque bibendum vitae. Ut iaculis lacus at rutrum ultrices. Suspendisse ut urna vitae purus eleifend laoreet non sit amet sem. </p>
133
-
134
- <?php } ?>
135
- </body>
136
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
languages/pdfextended-en_GB.po DELETED
@@ -1,856 +0,0 @@
1
- msgid ""
2
- msgstr ""
3
- "Project-Id-Version: Gravity PDF\n"
4
- "POT-Creation-Date: 2014-12-04 13:00+1000\n"
5
- "PO-Revision-Date: 2014-12-04 13:00+1000\n"
6
- "Last-Translator: Blue Liquid Designs <enquire@blueliquiddesigns.com.au>\n"
7
- "Language-Team: <enquire@blueliquiddesigns.com.au>\n"
8
- "Language: en\n"
9
- "MIME-Version: 1.0\n"
10
- "Content-Type: text/plain; charset=UTF-8\n"
11
- "Content-Transfer-Encoding: 8bit\n"
12
- "X-Generator: Poedit 1.6.5\n"
13
- "X-Poedit-KeywordsList: __;_e\n"
14
- "X-Poedit-Basepath: /\n"
15
- "X-Poedit-SourceCharset: UTF-8\n"
16
- "X-Poedit-SearchPath-0: G:\\Blue Liquid Designs\\4) BLUE LIQUID DESIGNS\\19) "
17
- "Gravity PDF\\1) github\n"
18
-
19
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
20
- #: EXTENDED\1) github/helper/api.php:142
21
- msgid "Bad Request."
22
- msgstr ""
23
-
24
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
25
- #: EXTENDED\1) github/helper/api.php:150 github/helper/api.php:261
26
- msgid "Unauthorized Access."
27
- msgstr ""
28
-
29
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
30
- #: EXTENDED\1) github/helper/api.php:172
31
- msgid "Method not allowed."
32
- msgstr ""
33
-
34
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
35
- #: EXTENDED\1) github/helper/api.php:180
36
- msgid "Internal API Error."
37
- msgstr ""
38
-
39
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
40
- #: EXTENDED\1) github/helper/api.php:188
41
- msgid "API Unavailable."
42
- msgstr ""
43
-
44
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
45
- #: EXTENDED\1) github/helper/notices.php:54
46
- #, php-format
47
- msgid "%sGravity PDF Automated Installer%s: "
48
- msgstr ""
49
-
50
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
51
- #: EXTENDED\1) github/helper/notices.php:64
52
- #, php-format
53
- msgid " %sGo to installer%s."
54
- msgstr ""
55
-
56
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
57
- #: EXTENDED\1) github/helper/notices.php:74
58
- msgid ""
59
- "The font files have been successfully installed. A font can be used by "
60
- "adding its file name (without .ttf) in a CSS font-family declaration."
61
- msgstr ""
62
-
63
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
64
- #: EXTENDED\1) github/helper/notices.php:85
65
- msgid "Could not create font configuration file. Try initialise again."
66
- msgstr ""
67
-
68
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
69
- #: EXTENDED\1) github/helper/notices.php:101
70
- msgid ""
71
- "Gravity PDF detected a configuration problem. Please "
72
- "reinitialise the plugin."
73
- msgstr ""
74
-
75
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
76
- #: EXTENDED\1) github/helper/notices.php:105
77
- #, php-format
78
- msgid ""
79
- "Gravity PDF detected a configuration problem. Please go to "
80
- "the %splugin's settings page%s to reinitialise."
81
- msgstr ""
82
-
83
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
84
- #: EXTENDED\1) github/helper/notices.php:122
85
- msgid ""
86
- "Gravity PDF detected a server compatibility problem which "
87
- "prevented the software from running. See the System Status section below for "
88
- "details."
89
- msgstr ""
90
-
91
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
92
- #: EXTENDED\1) github/helper/notices.php:126
93
- #, php-format
94
- msgid ""
95
- "Gravity PDF detected a server compatibility problem which "
96
- "prevented the software from running. Please go to the %splugin's settings "
97
- "page%s to view the issue."
98
- msgstr ""
99
-
100
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
101
- #: EXTENDED\1) github/helper/notices.php:142
102
- msgid ""
103
- "Welcome to Gravity PDF. Before you can use the plugin "
104
- "correctly you need to initilise it."
105
- msgstr ""
106
-
107
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
108
- #: EXTENDED\1) github/helper/notices.php:146
109
- #, php-format
110
- msgid ""
111
- "Welcome to Gravity PDF. Before you can use the plugin "
112
- "correctly you need to initilise it. Please go to the %splugin's settings page"
113
- "%s to initialise."
114
- msgstr ""
115
-
116
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
117
- #: EXTENDED\1) github/helper/notices.php:158
118
- #, php-format
119
- msgid ""
120
- "Gravity PDF only works with Gravity Forms version %s and "
121
- "higher. Please %supgrade your copy of Gravity Forms%s to use this plugin."
122
- msgstr ""
123
-
124
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
125
- #: EXTENDED\1) github/helper/notices.php:174
126
- #, php-format
127
- msgid ""
128
- "We could not create a template folder in your uploads directory. Please "
129
- "ensure %s is writable by your web server and try again."
130
- msgstr ""
131
-
132
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
133
- #: EXTENDED\1) github/helper/notices.php:189
134
- #, php-format
135
- msgid ""
136
- "We could not create a site folder in your uploads/%s directory. Please "
137
- "ensure %s is writable by your web server and try again."
138
- msgstr ""
139
-
140
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
141
- #: EXTENDED\1) github/helper/notices.php:202
142
- #, php-format
143
- msgid ""
144
- "We could not remove the default template files from %s in your uploads "
145
- "directory. Please ensure %s is wriable by your web server and try again."
146
- msgstr ""
147
-
148
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
149
- #: EXTENDED\1) github/helper/notices.php:215
150
- #, php-format
151
- msgid ""
152
- "We could not move the template files to the %s folder. Please ensure %s is "
153
- "wriable by your web server and try again."
154
- msgstr ""
155
-
156
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
157
- #: EXTENDED\1) github/helper/notices.php:233
158
- #, php-format
159
- msgid ""
160
- "Gravity PDF directory structure has been changed. %sMigrate "
161
- "Now%s %sUnsure what this means?%s"
162
- msgstr ""
163
-
164
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
165
- #: EXTENDED\1) github/helper/notices.php:242
166
- #, php-format
167
- msgid "%sGravity PDF Automated Template Migration:%s"
168
- msgstr ""
169
-
170
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
171
- #: EXTENDED\1) github/helper/notices.php:244
172
- #, php-format
173
- msgid ""
174
- "Your PDF template folder structure was successfully migrated to %s. %sUnsure "
175
- "what this means?%s"
176
- msgstr ""
177
-
178
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
179
- #: EXTENDED\1) github/helper/notices.php:256
180
- msgid ""
181
- "Gravity PDF Auto Initialisation Complete across the entire "
182
- "network."
183
- msgstr ""
184
-
185
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
186
- #: EXTENDED\1) github/helper/notices.php:260
187
- msgid ""
188
- "Gravity PDF Initialisation Complete across the entire network."
189
- msgstr ""
190
-
191
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
192
- #: EXTENDED\1) github/helper/notices.php:265 github/helper/notices.php:277
193
- #, php-format
194
- msgid "%sLearn how to configuring the plugin%s."
195
- msgstr ""
196
-
197
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
198
- #: EXTENDED\1) github/helper/notices.php:273
199
- msgid "Gravity PDF Auto Initialisation Complete."
200
- msgstr ""
201
-
202
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
203
- #: EXTENDED\1) github/helper/notices.php:291
204
- msgid ""
205
- "There was a problem merging the PDF templates folder on the following sites;"
206
- msgstr ""
207
-
208
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
209
- #: EXTENDED\1) github/helper/notices.php:304
210
- msgid ""
211
- "Follow the site links above and try run the PDF template merging function "
212
- "again, or reinitialise the software."
213
- msgstr ""
214
-
215
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
216
- #: EXTENDED\1) github/helper/notices.php:308
217
- msgid ""
218
- "An unknown error occured while merging the PDF template folders. Please try "
219
- "again."
220
- msgstr ""
221
-
222
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
223
- #: EXTENDED\1) github/helper/notices.php:323
224
- msgid "There was a network initialisation issue on the following sites;"
225
- msgstr ""
226
-
227
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
228
- #: EXTENDED\1) github/helper/notices.php:336
229
- msgid "Please try manually initialise the software"
230
- msgstr ""
231
-
232
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
233
- #: EXTENDED\1) github/helper/notices.php:340
234
- msgid ""
235
- "An unknown network initialisation error occured. Please try initialise again."
236
- msgstr ""
237
-
238
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
239
- #: EXTENDED\1) github/helper/notices.php:347
240
- msgid "You've successfully initialised Gravity PDF."
241
- msgstr ""
242
-
243
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
244
- #: EXTENDED\1) github/helper/notices.php:354
245
- #: github/view/templates/settings/system-status.php:34
246
- #: github/view/templates/settings/system-status.php:41
247
- msgid "Gravity Forms "
248
- msgstr ""
249
-
250
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
251
- #: EXTENDED\1) github/helper/notices.php:360
252
- msgid "Wordpress "
253
- msgstr ""
254
-
255
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
256
- #: EXTENDED\1) github/helper/notices.php:366
257
- msgid "PHP "
258
- msgstr ""
259
-
260
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
261
- #: EXTENDED\1) github/helper/notices.php:372
262
- #, php-format
263
- msgid ""
264
- "If you reinitialise and enable this option %syou will overwrite%s the "
265
- "default and example template files in your active theme directory."
266
- msgstr ""
267
-
268
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
269
- #: EXTENDED\1) github/helper/pdf-entry-detail.php:255
270
- msgid "Order"
271
- msgstr ""
272
-
273
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
274
- #: EXTENDED\1) github/helper/pdf-entry-detail.php:266
275
- msgid "Product"
276
- msgstr ""
277
-
278
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
279
- #: EXTENDED\1) github/helper/pdf-entry-detail.php:267
280
- msgid "Qty"
281
- msgstr ""
282
-
283
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
284
- #: EXTENDED\1) github/helper/pdf-entry-detail.php:268
285
- msgid "Unit Price"
286
- msgstr ""
287
-
288
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
289
- #: EXTENDED\1) github/helper/pdf-entry-detail.php:269
290
- msgid "Price"
291
- msgstr ""
292
-
293
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
294
- #: EXTENDED\1) github/helper/pdf-entry-detail.php:332
295
- msgid "Total"
296
- msgstr ""
297
-
298
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
299
- #: EXTENDED\1) github/helper/pdf-entry-detail.php:940
300
- msgid ""
301
- "Activate Gravity Forms Quiz Add On to see global quiz statistics for this "
302
- "form"
303
- msgstr ""
304
-
305
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
306
- #: EXTENDED\1) github/helper/pdf-entry-detail.php:1371
307
- #: github/helper/pdf-entry-detail.php:1746
308
- msgid "Qty: "
309
- msgstr ""
310
-
311
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
312
- #: EXTENDED\1) github/helper/pdf-entry-detail.php:1371
313
- #: github/helper/pdf-entry-detail.php:1746
314
- msgid "Price: "
315
- msgstr ""
316
-
317
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
318
- #: EXTENDED\1) github/helper/pdf-entry-detail.php:1680
319
- msgid "Title"
320
- msgstr ""
321
-
322
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
323
- #: EXTENDED\1) github/helper/pdf-entry-detail.php:1681
324
- msgid "Caption"
325
- msgstr ""
326
-
327
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
328
- #: EXTENDED\1) github/helper/pdf-entry-detail.php:1682
329
- msgid "Description"
330
- msgstr ""
331
-
332
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
333
- #: EXTENDED\1) github/helper/pdf-entry-detail.php:1687
334
- #: github/helper/pdf-entry-detail.php:1706
335
- msgid "Click to view"
336
- msgstr ""
337
-
338
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
339
- #: EXTENDED\1) github/model/pdf.php:142
340
- msgid "View"
341
- msgstr ""
342
-
343
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
344
- #: EXTENDED\1) github/model/pdf.php:143
345
- msgid "Download"
346
- msgstr ""
347
-
348
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
349
- #: EXTENDED\1) github/model/pdf.php:199
350
- msgid "View PDFs"
351
- msgstr ""
352
-
353
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
354
- #: EXTENDED\1) github/model/pdf.php:234
355
- msgid "View PDF"
356
- msgstr ""
357
-
358
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
359
- #: EXTENDED\1) github/model/pdf.php:321
360
- msgid "Access Denied"
361
- msgstr ""
362
-
363
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
364
- #: EXTENDED\1) github/model/settings.php:359
365
- msgid "Plugin not yet initialised"
366
- msgstr ""
367
-
368
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
369
- #: EXTENDED\1) github/model/settings.php:414
370
- msgid ""
371
- "There was a problem with your submission. Please reload the page and try "
372
- "again"
373
- msgstr ""
374
-
375
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
376
- #: EXTENDED\1) github/model/settings.php:431
377
- msgid "Please enter a valid email address"
378
- msgstr ""
379
-
380
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
381
- #: EXTENDED\1) github/model/settings.php:434
382
- msgid "Problem"
383
- msgstr ""
384
-
385
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
386
- #: EXTENDED\1) github/model/settings.php:434
387
- msgid "Question"
388
- msgstr ""
389
-
390
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
391
- #: EXTENDED\1) github/model/settings.php:434
392
- msgid "Suggestion"
393
- msgstr ""
394
-
395
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
396
- #: EXTENDED\1) github/model/settings.php:438
397
- msgid "Please select a valid support type."
398
- msgstr ""
399
-
400
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
401
- #: EXTENDED\1) github/model/settings.php:443
402
- msgid ""
403
- "Please enter information about your support query so we can aid you more "
404
- "easily."
405
- msgstr ""
406
-
407
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
408
- #: EXTENDED\1) github/model/settings.php:448
409
- msgid ""
410
- "There is a problem with your support request. Please correct the marked "
411
- "issues above."
412
- msgstr ""
413
-
414
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
415
- #: EXTENDED\1) github/model/settings.php:458
416
- msgid ""
417
- "Thank you for your support request. We'll respond to your request in the "
418
- "next 24-48 hours."
419
- msgstr ""
420
-
421
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
422
- #: EXTENDED\1) github/model/settings.php:516
423
- msgid "Support request received. We will responed in 24 to 48 hours."
424
- msgstr ""
425
-
426
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
427
- #: EXTENDED\1) github/view/templates/settings/changelog.php:19
428
- msgid "Changelog"
429
- msgstr ""
430
-
431
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
432
- #: EXTENDED\1) github/view/templates/settings/initialisation-tab.php:41
433
- msgid "Gravity PDF"
434
- msgstr ""
435
-
436
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
437
- #: EXTENDED\1) github/view/templates/settings/initialisation-tab.php:42
438
- msgid ""
439
- "Your web server isn't compatible with Gravity PDF. Please see "
440
- "the problem areas below."
441
- msgstr ""
442
-
443
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
444
- #: EXTENDED\1) github/view/templates/settings/initialisation-tab.php:52
445
- msgid "Can't Resolve the Issue?"
446
- msgstr ""
447
-
448
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
449
- #: EXTENDED\1) github/view/templates/settings/initialisation-tab.php:53
450
- #, php-format
451
- msgid ""
452
- "Does Gravity PDF detect a problem that your web host won't "
453
- "fix? %sWe recommend you move to a quality web hosting service like WP Engine"
454
- "%s which runs our software straight out of the box."
455
- msgstr ""
456
-
457
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
458
- #: EXTENDED\1) github/view/templates/settings/initialisation.php:19
459
- msgid "Welcome to Gravity PDF"
460
- msgstr ""
461
-
462
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
463
- #: EXTENDED\1) github/view/templates/settings/initialisation.php:19
464
- #: github/view/templates/settings/initialisation.php:66
465
- msgid "Initialise Plugin"
466
- msgstr ""
467
-
468
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
469
- #: EXTENDED\1) github/view/templates/settings/initialisation.php:23
470
- msgid ""
471
- "The plugin has successfully installed and is ready to start automating your "
472
- "documents."
473
- msgstr ""
474
-
475
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
476
- #: EXTENDED\1) github/view/templates/settings/initialisation.php:25
477
- msgid "What's next?"
478
- msgstr ""
479
-
480
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
481
- #: EXTENDED\1) github/view/templates/settings/initialisation.php:26
482
- msgid ""
483
- "The next step is to correctly configured the plugin so that you can generate "
484
- "PDF documents."
485
- msgstr ""
486
-
487
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
488
- #: EXTENDED\1) github/view/templates/settings/initialisation.php:27
489
- msgid ""
490
- "To help you get started, we've put together a five-part video series with "
491
- "the most common plugin configurations."
492
- msgstr ""
493
-
494
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
495
- #: EXTENDED\1) github/view/templates/settings/initialisation.php:29
496
- msgid "The Basics: Only Download PDF through the Admin Area"
497
- msgstr ""
498
-
499
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
500
- #: EXTENDED\1) github/view/templates/settings/initialisation.php:30
501
- msgid "The Email: Send Completed PDF via Email"
502
- msgstr ""
503
-
504
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
505
- #: EXTENDED\1) github/view/templates/settings/initialisation.php:31
506
- msgid ""
507
- "The Download: User Downloads PDF after Submitting Form (using a link or auto "
508
- "redirecting)"
509
- msgstr ""
510
-
511
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
512
- #: EXTENDED\1) github/view/templates/settings/initialisation.php:32
513
- msgid "The Email Advanced: Manually Review User Submission before Emailing PDF"
514
- msgstr ""
515
-
516
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
517
- #: EXTENDED\1) github/view/templates/settings/initialisation.php:33
518
- msgid "The Payment: Send PDF after Capturing Payment using Paypal Standard"
519
- msgstr ""
520
-
521
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
522
- #: EXTENDED\1) github/view/templates/settings/initialisation.php:36
523
- #, php-format
524
- msgid ""
525
- "If you know little about PHP we recommend starting with %sPart 1:The Basics"
526
- "%s and then watching the tutorial you’re interested in. It will give you the "
527
- "foundational skills you need to configure the software."
528
- msgstr ""
529
-
530
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
531
- #: EXTENDED\1) github/view/templates/settings/initialisation.php:38
532
- msgid "Custom Templates"
533
- msgstr ""
534
-
535
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
536
- #: EXTENDED\1) github/view/templates/settings/initialisation.php:39
537
- #, php-format
538
- msgid ""
539
- "Creating a custom template gives you ultimate control of the look and feel "
540
- "of your documents using only HTML and CSS. %sWe recommend you review our "
541
- "online documentation%s to create and customise your template files."
542
- msgstr ""
543
-
544
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
545
- #: EXTENDED\1) github/view/templates/settings/initialisation.php:45
546
- msgid ""
547
- "To complete the installation, Gravity PDF needs to be "
548
- "initialised."
549
- msgstr ""
550
-
551
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
552
- #: EXTENDED\1) github/view/templates/settings/initialisation.php:47
553
- msgid "What does initialisation do?"
554
- msgstr ""
555
-
556
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
557
- #: EXTENDED\1) github/view/templates/settings/initialisation.php:50
558
- msgid "Install the template files"
559
- msgstr ""
560
-
561
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
562
- #: EXTENDED\1) github/view/templates/settings/initialisation.php:50
563
- msgid ""
564
- "We create a folder called PDF_EXTENDED_TEMPLATE in your active theme "
565
- "directory and move over all the templates and configuration files. This "
566
- "folder is where you'll look to configure the software and create your PDF "
567
- "templates."
568
- msgstr ""
569
-
570
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
571
- #: EXTENDED\1) github/view/templates/settings/initialisation.php:62
572
- msgid "Have a problem with the software?"
573
- msgstr ""
574
-
575
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
576
- #: EXTENDED\1) github/view/templates/settings/initialisation.php:63
577
- msgid ""
578
- "Did you switch themes and something went wrong syncing the template folder? "
579
- "Try reinitialise the software."
580
- msgstr ""
581
-
582
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
583
- #: EXTENDED\1) github/view/templates/settings/initialisation.php:66
584
- msgid "Reinitialise Plugin"
585
- msgstr ""
586
-
587
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
588
- #: EXTENDED\1) github/view/templates/settings/initialisation.php:68
589
- msgid "Reinstall Default and Example Templates"
590
- msgstr ""
591
-
592
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
593
- #: EXTENDED\1) github/view/templates/settings/initialisation.php:74
594
- msgid "Install a new font?"
595
- msgstr ""
596
-
597
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
598
- #: EXTENDED\1) github/view/templates/settings/initialisation.php:75
599
- #, php-format
600
- msgid ""
601
- "Do you want to use a custom font in your template? %sSee our documentation "
602
- "on how to correctly install and use a custom font%s before initialising "
603
- "below."
604
- msgstr ""
605
-
606
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
607
- #: EXTENDED\1) github/view/templates/settings/initialisation.php:76
608
- msgid "Initialise Fonts"
609
- msgstr ""
610
-
611
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
612
- #: EXTENDED\1) github/view/templates/settings/support-form.php:26
613
- msgid ""
614
- "Gravity PDF's support hours are from 9:00am-5:00pm Monday to "
615
- "Friday, Sydney Australia time."
616
- msgstr ""
617
-
618
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
619
- #: EXTENDED\1) github/view/templates/settings/support-form.php:29
620
- #, php-format
621
- msgid "The current time in Sydney Australia is %s."
622
- msgstr ""
623
-
624
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
625
- #: EXTENDED\1) github/view/templates/settings/support-form.php:55
626
- msgid "Enter the email address you want us to contact you on."
627
- msgstr ""
628
-
629
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
630
- #: EXTENDED\1) github/view/templates/settings/support-form.php:56
631
- msgid ""
632
- "Note: To ensure the best support possible, please use the above email to "
633
- "respond to all support communications."
634
- msgstr ""
635
-
636
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
637
- #: EXTENDED\1) github/view/templates/settings/support-form.php:92
638
- msgid "Enter as much detail about the problem as you can."
639
- msgstr ""
640
-
641
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
642
- #: EXTENDED\1) github/view/templates/settings/support-form.php:93
643
- msgid "Please enter as much detail about the problem as you can."
644
- msgstr ""
645
-
646
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
647
- #: EXTENDED\1) github/view/templates/settings/support-form.php:94
648
- msgid "Note: Our support representatives can only communicate in English."
649
- msgstr ""
650
-
651
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
652
- #: EXTENDED\1) github/view/templates/settings/support-form.php:97
653
- msgid "Request Support"
654
- msgstr ""
655
-
656
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
657
- #: EXTENDED\1) github/view/templates/settings/support-sidebar.php:20
658
- msgid "Frequently Asked Questions"
659
- msgstr ""
660
-
661
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
662
- #: EXTENDED\1) github/view/templates/settings/support-sidebar.php:22
663
- msgid "Can I exclude a field from showing up in the PDF?"
664
- msgstr ""
665
-
666
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
667
- #: EXTENDED\1) github/view/templates/settings/support-sidebar.php:23
668
- msgid ""
669
- "I want to have multiple PDF template files generated on one form. How do I "
670
- "do it?"
671
- msgstr ""
672
-
673
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
674
- #: EXTENDED\1) github/view/templates/settings/support-sidebar.php:24
675
- msgid "I want users to be able to download the PDF from the server."
676
- msgstr ""
677
-
678
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
679
- #: EXTENDED\1) github/view/templates/settings/support-sidebar.php:25
680
- msgid "How do I change the PDF size or create a landscape PDF?"
681
- msgstr ""
682
-
683
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
684
- #: EXTENDED\1) github/view/templates/settings/support-sidebar.php:26
685
- msgid ""
686
- "I am created a custom template. How do I know the names of my fields in the "
687
- "$form_data array?"
688
- msgstr ""
689
-
690
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
691
- #: EXTENDED\1) github/view/templates/settings/support-sidebar.php:27
692
- msgid "How large a PDF are you able to create/process?"
693
- msgstr ""
694
-
695
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
696
- #: EXTENDED\1) github/view/templates/settings/support-sidebar.php:30
697
- #, php-format
698
- msgid ""
699
- "Got a question that isn't answered above? %sHead to our support forum%s and "
700
- "let us know."
701
- msgstr ""
702
-
703
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
704
- #: EXTENDED\1) github/view/templates/settings/support.php:20
705
- msgid "Support"
706
- msgstr ""
707
-
708
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
709
- #: EXTENDED\1) github/view/templates/settings/system-status.php:19
710
- msgid "System Status"
711
- msgstr ""
712
-
713
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
714
- #: EXTENDED\1) github/view/templates/settings/system-status.php:22
715
- msgid "Wordpress Version"
716
- msgstr ""
717
-
718
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
719
- #: EXTENDED\1) github/view/templates/settings/system-status.php:25
720
- msgid "Wordpress Version "
721
- msgstr ""
722
-
723
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
724
- #: EXTENDED\1) github/view/templates/settings/system-status.php:30
725
- msgid "Gravity Forms"
726
- msgstr ""
727
-
728
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
729
- #: EXTENDED\1) github/view/templates/settings/system-status.php:32
730
- msgid "Not Installed"
731
- msgstr ""
732
-
733
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
734
- #: EXTENDED\1) github/view/templates/settings/system-status.php:47
735
- msgid "PHP Version"
736
- msgstr ""
737
-
738
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
739
- #: EXTENDED\1) github/view/templates/settings/system-status.php:50
740
- msgid "PHP Version "
741
- msgstr ""
742
-
743
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
744
- #: EXTENDED\1) github/view/templates/settings/system-status.php:54
745
- msgid "MB String"
746
- msgstr ""
747
-
748
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
749
- #: EXTENDED\1) github/view/templates/settings/system-status.php:54
750
- #: github/view/templates/settings/system-status.php:62
751
- #: github/view/templates/settings/system-status.php:94
752
- #: github/view/templates/settings/system-status.php:103
753
- #: github/view/templates/settings/system-status.php:110
754
- #: github/view/templates/settings/system-status.php:117
755
- msgid "Yes"
756
- msgstr ""
757
-
758
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
759
- #: EXTENDED\1) github/view/templates/settings/system-status.php:54
760
- #: github/view/templates/settings/system-status.php:62
761
- #: github/view/templates/settings/system-status.php:94
762
- #: github/view/templates/settings/system-status.php:103
763
- #: github/view/templates/settings/system-status.php:110
764
- #: github/view/templates/settings/system-status.php:117
765
- msgid "No"
766
- msgstr ""
767
-
768
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
769
- #: EXTENDED\1) github/view/templates/settings/system-status.php:58
770
- msgid ""
771
- "The PHP extension MB String and MB String Regex functions are required to "
772
- "use this plugin. Contact your web host to have it enabled."
773
- msgstr ""
774
-
775
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
776
- #: EXTENDED\1) github/view/templates/settings/system-status.php:62
777
- msgid "GD Library"
778
- msgstr ""
779
-
780
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
781
- #: EXTENDED\1) github/view/templates/settings/system-status.php:66
782
- msgid ""
783
- "The PHP extension GD Library is required to use this plugin. Contact your "
784
- "web host to have it enabled."
785
- msgstr ""
786
-
787
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
788
- #: EXTENDED\1) github/view/templates/settings/system-status.php:84
789
- msgid "Available RAM"
790
- msgstr ""
791
-
792
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
793
- #: EXTENDED\1) github/view/templates/settings/system-status.php:87
794
- #, php-format
795
- msgid ""
796
- "We recommend you have 128MB of available RAM to run this plugin. The minimum "
797
- "system requirement is 64MB. %sNot sure what this means? Contact your web "
798
- "host and ask them to fix the issue. %sNote: If you run less than 128MB, you "
799
- "risk PHP suffering a fatal error which will stop your website from running "
800
- "on Gravity Form pages."
801
- msgstr ""
802
-
803
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
804
- #: EXTENDED\1) github/view/templates/settings/system-status.php:94
805
- msgid "Uploads Directory Writable?"
806
- msgstr ""
807
-
808
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
809
- #: EXTENDED\1) github/view/templates/settings/system-status.php:97
810
- #, php-format
811
- msgid ""
812
- "Your upload folder is not writable by your web server. Check that \"%s\" is "
813
- "writable by your web server otherwise we will attempt to use the FTP "
814
- "installer to initialise."
815
- msgstr ""
816
-
817
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
818
- #: EXTENDED\1) github/view/templates/settings/system-status.php:103
819
- msgid "PDF Output Directory Writable?"
820
- msgstr ""
821
-
822
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
823
- #: EXTENDED\1) github/view/templates/settings/system-status.php:106
824
- #, php-format
825
- msgid ""
826
- "The plugin's output folder is not writable by your web server. PDFs will not "
827
- "be attached to notifications until this problem is fixed. Check that \"%s\" "
828
- "is writable by your web server."
829
- msgstr ""
830
-
831
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
832
- #: EXTENDED\1) github/view/templates/settings/system-status.php:110
833
- msgid "PDF Font Directory Writable?"
834
- msgstr ""
835
-
836
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
837
- #: EXTENDED\1) github/view/templates/settings/system-status.php:113
838
- #, php-format
839
- msgid ""
840
- "The plugin's font folder is not writable by your web server. Check that \"%s"
841
- "\" is writable by your web server otherwise we will attempt to use the FTP "
842
- "installer to initialise."
843
- msgstr ""
844
-
845
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
846
- #: EXTENDED\1) github/view/templates/settings/system-status.php:117
847
- msgid "mPDF Temporary Directory Writable?"
848
- msgstr ""
849
-
850
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
851
- #: EXTENDED\1) github/view/templates/settings/system-status.php:120
852
- #, php-format
853
- msgid ""
854
- "mPDF temporary directory not writable (%s). Memory and image processing time "
855
- "will increase."
856
- msgstr ""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
languages/pdfextended-fr_FR.mo DELETED
Binary file
languages/pdfextended-fr_FR.po DELETED
@@ -1,1024 +0,0 @@
1
- msgid ""
2
- msgstr ""
3
- "Project-Id-Version: Gravity PDF\n"
4
- "POT-Creation-Date: 2014-11-17 16:14+1000\n"
5
- "PO-Revision-Date: 2014-11-17 16:14+1000\n"
6
- "Last-Translator: Blue Liquid Designs <enquire@blueliquiddesigns.com.au>\n"
7
- "Language-Team: Lumiere de Lune <contact@lumieredelune.com>\n"
8
- "Language: fr\n"
9
- "MIME-Version: 1.0\n"
10
- "Content-Type: text/plain; charset=UTF-8\n"
11
- "Content-Transfer-Encoding: 8bit\n"
12
- "X-Generator: Poedit 1.6.5\n"
13
- "X-Poedit-KeywordsList: __;_e\n"
14
- "X-Poedit-Basepath: /\n"
15
- "X-Poedit-SourceCharset: UTF-8\n"
16
- "Plural-Forms: nplurals=2; plural=(n > 1);\n"
17
- "X-Poedit-SearchPath-0: G:\\Blue Liquid Designs\\4) BLUE LIQUID DESIGNS\\19) "
18
- "Gravity PDF\\1) github\n"
19
-
20
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
21
- #: EXTENDED\1) github/helper/api.php:142
22
- msgid "Bad Request."
23
- msgstr "Mauvais requête."
24
-
25
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
26
- #: EXTENDED\1) github/helper/api.php:150 github/helper/api.php:261
27
- msgid "Unauthorized Access."
28
- msgstr "Accès non authorisé."
29
-
30
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
31
- #: EXTENDED\1) github/helper/api.php:172
32
- msgid "Method not allowed."
33
- msgstr "Méthode non autorisée."
34
-
35
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
36
- #: EXTENDED\1) github/helper/api.php:180
37
- msgid "Internal API Error."
38
- msgstr "Erreur interne de l'API."
39
-
40
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
41
- #: EXTENDED\1) github/helper/api.php:188
42
- msgid "API Unavailable."
43
- msgstr "API non disponible."
44
-
45
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
46
- #: EXTENDED\1) github/helper/notices.php:54
47
- #, php-format
48
- msgid "%sGravity PDF Automated Installer%s: "
49
- msgstr "%sInstallateur automatique de Gravity PDF%s : "
50
-
51
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
52
- #: EXTENDED\1) github/helper/notices.php:64
53
- #, php-format
54
- msgid " %sGo to installer%s."
55
- msgstr " %sAller à l'installateur%s."
56
-
57
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
58
- #: EXTENDED\1) github/helper/notices.php:74
59
- msgid ""
60
- "The font files have been successfully installed. A font can be used by "
61
- "adding its file name (without .ttf and in lower case) in a CSS font-family "
62
- "declaration."
63
- msgstr ""
64
- "Les fichiers ont été installés avec succès. Une police de caractère peut "
65
- "être utilisée en ajoutant le nom de son fichier (sans l'extension .ttf et en "
66
- "minuscule) dans une déclaration CSS font-family."
67
-
68
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
69
- #: EXTENDED\1) github/helper/notices.php:85
70
- msgid "Could not create font configuration file. Try initialise again."
71
- msgstr ""
72
- "Impossible de créer le fichier de configuration. Essayez à nouveau de faire "
73
- "l'initialisation."
74
-
75
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
76
- #: EXTENDED\1) github/helper/notices.php:101
77
- msgid ""
78
- "Gravity PDF detected a configuration problem. Please "
79
- "reinitialise the plugin."
80
- msgstr ""
81
- "Gravity PDF a détecté un problème de configuration. Merci de "
82
- "réinitialiser l'extension."
83
-
84
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
85
- #: EXTENDED\1) github/helper/notices.php:105
86
- #, php-format
87
- msgid ""
88
- "Gravity PDF detected a configuration problem. Please go to "
89
- "the %splugin's settings page%s to reinitialise."
90
- msgstr ""
91
- "Gravity PDF a détecté un problème de configuration. Merci "
92
- "d'aller sur la page des %sréglages de l'extension%s pour la réinitialiser."
93
-
94
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
95
- #: EXTENDED\1) github/helper/notices.php:122
96
- msgid ""
97
- "Gravity PDF detected a server compatibility problem which "
98
- "prevented the software from running. See the System Status section below for "
99
- "details."
100
- msgstr ""
101
- "Gravity PDF a détecté un problème de compatibilité avec le "
102
- "serveur qui empêche l'extension de fonctionner. Regardez la section \"Etat "
103
- "du Système\" ci-dessous pour plus de détails."
104
-
105
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
106
- #: EXTENDED\1) github/helper/notices.php:126
107
- #, php-format
108
- msgid ""
109
- "Gravity PDF detected a server compatibility problem which "
110
- "prevented the software from running. Please go to the %splugin's settings "
111
- "page%s to view the issue."
112
- msgstr ""
113
- "Gravity PDF a détecté un problème de compatibilité avec le "
114
- "serveur qui empêche l'extension de fonctionner. Merci d'aller sur la page "
115
- "des %sréglages de l'extension%s pour voir les détails."
116
-
117
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
118
- #: EXTENDED\1) github/helper/notices.php:142
119
- msgid ""
120
- "Welcome to Gravity PDF. Before you can use the plugin "
121
- "correctly you need to initilise it."
122
- msgstr ""
123
- "Bienvenue chez Gravity PDF. Avant d'utiliser l'extension, "
124
- "vous devez l'initialiser."
125
-
126
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
127
- #: EXTENDED\1) github/helper/notices.php:146
128
- #, php-format
129
- msgid ""
130
- "Welcome to Gravity PDF. Before you can use the plugin "
131
- "correctly you need to initilise it. Please go to the %splugin's settings page"
132
- "%s to initialise."
133
- msgstr ""
134
- "Bienvenue chez Gravity PDF. Avant d'utiliser l'extension, "
135
- "vous devez l'initialiser. Merci d'aller sur la page des %sréglages de "
136
- "l'extension%s pour l'initialisation."
137
-
138
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
139
- #: EXTENDED\1) github/helper/notices.php:158
140
- #, php-format
141
- msgid ""
142
- "Gravity PDF only works with Gravity Forms version %s and "
143
- "higher. Please %supgrade your copy of Gravity Forms%s to use this plugin."
144
- msgstr ""
145
- "Gravity PDF a besoin de Gravity Forms (version %s et "
146
- "supérieures). Merci de %smettre votre version de Gravity Forms à jour%s pour "
147
- "utiliser l'extension. "
148
-
149
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
150
- #: EXTENDED\1) github/helper/notices.php:174
151
- #, fuzzy, php-format
152
- msgid ""
153
- "We could not create a template folder in your uploads directory. Please "
154
- "ensure %s is writable by your web server and try again."
155
- msgstr ""
156
- "Nous n'avons pas pu créer un dossier de modèles dans le répertoire de votre "
157
- "thème actif. Merci de vérifier qu'il est accessible en écriture par le "
158
- "serveur web et de réessayer."
159
-
160
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
161
- #: EXTENDED\1) github/helper/notices.php:189
162
- #, fuzzy, php-format
163
- msgid ""
164
- "We could not create a site folder in your uploads/%s directory. Please "
165
- "ensure %s is writable by your web server and try again."
166
- msgstr ""
167
- "Nous n'avons pas pu créer un dossier de modèles dans le répertoire de votre "
168
- "thème actif. Merci de vérifier qu'il est accessible en écriture par le "
169
- "serveur web et de réessayer."
170
-
171
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
172
- #: EXTENDED\1) github/helper/notices.php:202
173
- #, fuzzy, php-format
174
- msgid ""
175
- "We could not remove the default template files from %s in your uploads "
176
- "directory. Please ensure %s is wriable by your web server and try again."
177
- msgstr ""
178
- "Nous n'avons pas pu supprimer les modèles par défaut du répertoire Gravity "
179
- "PDF dans le répertoire de votre thème actif. Merci de "
180
- "vérifier qu'%s est accessible en écriture pour le serveur et de réessayer."
181
-
182
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
183
- #: EXTENDED\1) github/helper/notices.php:215
184
- #, fuzzy, php-format
185
- msgid ""
186
- "We could not move the template files to the %s folder. Please ensure %s is "
187
- "wriable by your web server and try again."
188
- msgstr ""
189
- "Nous n'avons pas pu déplacer les modèles vers le répertoire "
190
- "PDF_EXTENDED_TEMPLATES. Merci de vérifier que %s est accessible en écriture "
191
- "pour le serveur et de vérifier."
192
-
193
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
194
- #: EXTENDED\1) github/helper/notices.php:233
195
- #, php-format
196
- msgid ""
197
- "Gravity PDF directory structure has been changed. %sMigrate "
198
- "Now%s %sUnsure what this means?%s"
199
- msgstr ""
200
-
201
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
202
- #: EXTENDED\1) github/helper/notices.php:242
203
- #, fuzzy, php-format
204
- msgid "%sGravity PDF Automated Template Migration:%s"
205
- msgstr "%sInstallateur automatique de Gravity PDF%s : "
206
-
207
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
208
- #: EXTENDED\1) github/helper/notices.php:244
209
- #, fuzzy, php-format
210
- msgid ""
211
- "Your PDF template folder structure was successfully migrated to %s. %sUnsure "
212
- "what this means?%s"
213
- msgstr ""
214
- "Votre configuration PDF et votre dossier de modèle a été transféré avec "
215
- "succès vers votre nouveau thème."
216
-
217
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
218
- #: EXTENDED\1) github/helper/notices.php:256
219
- msgid ""
220
- "Gravity PDF Auto Initialisation Complete across the entire "
221
- "network."
222
- msgstr ""
223
- "Initialisation automatique de Gravity Forms Extended terminée sur la "
224
- "totalité du réseau."
225
-
226
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
227
- #: EXTENDED\1) github/helper/notices.php:260
228
- msgid ""
229
- "Gravity PDF Initialisation Complete across the entire network."
230
- msgstr ""
231
- "Initialisation de Gravity Forms Extended terminée sur la totalité du réseau."
232
-
233
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
234
- #: EXTENDED\1) github/helper/notices.php:265 github/helper/notices.php:277
235
- #, php-format
236
- msgid "%sLearn how to configuring the plugin%s."
237
- msgstr "%sDécouvrez comment configurer cette extension%s."
238
-
239
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
240
- #: EXTENDED\1) github/helper/notices.php:273
241
- msgid "Gravity PDF Auto Initialisation Complete."
242
- msgstr "Initialisation automatique de Gravity Forms Extended terminée."
243
-
244
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
245
- #: EXTENDED\1) github/helper/notices.php:291
246
- #, fuzzy
247
- msgid ""
248
- "There was a problem merging the PDF templates folder on the following sites;"
249
- msgstr "Il y a eu un problème d'initialisation avec les sites suivants :"
250
-
251
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
252
- #: EXTENDED\1) github/helper/notices.php:304
253
- msgid ""
254
- "Follow the site links above and try run the PDF template merging function "
255
- "again, or reinitialise the software."
256
- msgstr ""
257
-
258
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
259
- #: EXTENDED\1) github/helper/notices.php:308
260
- msgid ""
261
- "An unknown error occured while merging the PDF template folders. Please try "
262
- "again."
263
- msgstr ""
264
-
265
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
266
- #: EXTENDED\1) github/helper/notices.php:323
267
- msgid "There was a network initialisation issue on the following sites;"
268
- msgstr "Il y a eu un problème d'initialisation avec les sites suivants :"
269
-
270
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
271
- #: EXTENDED\1) github/helper/notices.php:336
272
- msgid "Please try manually initialise the software"
273
- msgstr "Essayez d'initialiser l'extension manuellement"
274
-
275
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
276
- #: EXTENDED\1) github/helper/notices.php:340
277
- msgid ""
278
- "An unknown network initialisation error occured. Please try initialise again."
279
- msgstr ""
280
- "Une erreur inconnue est survenue lors de l'initialisation. Merci de "
281
- "réessayer."
282
-
283
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
284
- #: EXTENDED\1) github/helper/notices.php:347
285
- msgid "You've successfully initialised Gravity PDF."
286
- msgstr "Vous avez bien réussi à initialiser Gravity PDF."
287
-
288
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
289
- #: EXTENDED\1) github/helper/notices.php:354
290
- #: github/view/templates/settings/system-status.php:34
291
- #: github/view/templates/settings/system-status.php:41
292
- msgid "Gravity Forms "
293
- msgstr "Gravity Forms "
294
-
295
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
296
- #: EXTENDED\1) github/helper/notices.php:360
297
- msgid "Wordpress "
298
- msgstr "Wordpress "
299
-
300
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
301
- #: EXTENDED\1) github/helper/notices.php:366
302
- msgid "PHP "
303
- msgstr "PHP "
304
-
305
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
306
- #: EXTENDED\1) github/helper/notices.php:372
307
- #, php-format
308
- msgid ""
309
- "If you reinitialise and enable this option %syou will overwrite%s the "
310
- "default and example template files in your active theme directory."
311
- msgstr ""
312
- "Si vous réinitialisez et activer cette option, %svous allez remplacer%s les "
313
- "fichier de modèles par défaut et exemple dans le répertoire de votre thème "
314
- "actif."
315
-
316
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
317
- #: EXTENDED\1) github/helper/pdf-entry-detail.php:255
318
- msgid "Order"
319
- msgstr "Commander"
320
-
321
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
322
- #: EXTENDED\1) github/helper/pdf-entry-detail.php:266
323
- msgid "Product"
324
- msgstr "Produit"
325
-
326
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
327
- #: EXTENDED\1) github/helper/pdf-entry-detail.php:267
328
- msgid "Qty"
329
- msgstr "Qté"
330
-
331
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
332
- #: EXTENDED\1) github/helper/pdf-entry-detail.php:268
333
- msgid "Unit Price"
334
- msgstr "Prix unitaire"
335
-
336
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
337
- #: EXTENDED\1) github/helper/pdf-entry-detail.php:269
338
- msgid "Price"
339
- msgstr "PRix"
340
-
341
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
342
- #: EXTENDED\1) github/helper/pdf-entry-detail.php:332
343
- msgid "Total"
344
- msgstr "Total"
345
-
346
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
347
- #: EXTENDED\1) github/helper/pdf-entry-detail.php:940
348
- msgid ""
349
- "Activate Gravity Forms Quiz Add On to see global quiz statistics for this "
350
- "form"
351
- msgstr ""
352
- "Activez Gravity Forms Quiz Add On pour voir les statistiqies globales du "
353
- "quiz pour ce formulaire"
354
-
355
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
356
- #: EXTENDED\1) github/helper/pdf-entry-detail.php:1371
357
- #: github/helper/pdf-entry-detail.php:1746
358
- msgid "Qty: "
359
- msgstr "Qté : "
360
-
361
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
362
- #: EXTENDED\1) github/helper/pdf-entry-detail.php:1371
363
- #: github/helper/pdf-entry-detail.php:1746
364
- msgid "Price: "
365
- msgstr "Prix : "
366
-
367
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
368
- #: EXTENDED\1) github/helper/pdf-entry-detail.php:1680
369
- msgid "Title"
370
- msgstr "Titre"
371
-
372
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
373
- #: EXTENDED\1) github/helper/pdf-entry-detail.php:1681
374
- msgid "Caption"
375
- msgstr "Légende"
376
-
377
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
378
- #: EXTENDED\1) github/helper/pdf-entry-detail.php:1682
379
- msgid "Description"
380
- msgstr "Description"
381
-
382
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
383
- #: EXTENDED\1) github/helper/pdf-entry-detail.php:1687
384
- #: github/helper/pdf-entry-detail.php:1706
385
- msgid "Click to view"
386
- msgstr "Cliquer pour voir"
387
-
388
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
389
- #: EXTENDED\1) github/model/pdf.php:142
390
- msgid "View"
391
- msgstr "Voir"
392
-
393
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
394
- #: EXTENDED\1) github/model/pdf.php:143
395
- msgid "Download"
396
- msgstr "Télécharger"
397
-
398
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
399
- #: EXTENDED\1) github/model/pdf.php:199
400
- msgid "View PDFs"
401
- msgstr "Voir les PDFs"
402
-
403
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
404
- #: EXTENDED\1) github/model/pdf.php:234
405
- msgid "View PDF"
406
- msgstr "Voir le PDF"
407
-
408
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
409
- #: EXTENDED\1) github/model/pdf.php:321
410
- #, fuzzy
411
- msgid "Access Denied"
412
- msgstr "Accès non authorisé."
413
-
414
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
415
- #: EXTENDED\1) github/model/settings.php:359
416
- msgid "Plugin not yet initialised"
417
- msgstr "L'extension n'est pas encore initialisée"
418
-
419
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
420
- #: EXTENDED\1) github/model/settings.php:414
421
- msgid ""
422
- "There was a problem with your submission. Please reload the page and try "
423
- "again"
424
- msgstr ""
425
- "Il y a eu un problème avec votre soumission. Merci de recharger la page et "
426
- "de réessayer"
427
-
428
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
429
- #: EXTENDED\1) github/model/settings.php:431
430
- msgid "Please enter a valid email address"
431
- msgstr "Merci de saisir une adresse email valide"
432
-
433
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
434
- #: EXTENDED\1) github/model/settings.php:434
435
- msgid "Problem"
436
- msgstr "Problème"
437
-
438
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
439
- #: EXTENDED\1) github/model/settings.php:434
440
- msgid "Question"
441
- msgstr "Question"
442
-
443
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
444
- #: EXTENDED\1) github/model/settings.php:434
445
- msgid "Suggestion"
446
- msgstr "Suggestion"
447
-
448
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
449
- #: EXTENDED\1) github/model/settings.php:438
450
- msgid "Please select a valid support type."
451
- msgstr "Merci de choisir un type de support valide."
452
-
453
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
454
- #: EXTENDED\1) github/model/settings.php:443
455
- msgid ""
456
- "Please enter information about your support query so we can aid you more "
457
- "easily."
458
- msgstr ""
459
- "Merci d'entrer l'information nécessaire à votre requête pour que nous "
460
- "puissions vous aider plus facilement."
461
-
462
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
463
- #: EXTENDED\1) github/model/settings.php:448
464
- msgid ""
465
- "There is a problem with your support request. Please correct the marked "
466
- "issues above."
467
- msgstr ""
468
- "Il y a un problème avec votre demande de support. Merci de corriger les "
469
- "problèmes indiqués ci-dessus."
470
-
471
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
472
- #: EXTENDED\1) github/model/settings.php:458
473
- msgid ""
474
- "Thank you for your support request. We'll respond to your request in the "
475
- "next 24-48 hours."
476
- msgstr ""
477
- "Merci pour votre demande de support. Nous répondrons à votre demande dans "
478
- "les prochaines 24 à 48 heures."
479
-
480
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
481
- #: EXTENDED\1) github/model/settings.php:516
482
- msgid "Support request received. We will responed in 24 to 48 hours."
483
- msgstr ""
484
- "Demande de support reçue. Nous répondrons dans les prochaines 24 à 48 heures."
485
-
486
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
487
- #: EXTENDED\1) github/view/templates/settings/changelog.php:19
488
- msgid "Changelog"
489
- msgstr "Changelog"
490
-
491
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
492
- #: EXTENDED\1) github/view/templates/settings/initialisation-tab.php:41
493
- msgid "Gravity PDF"
494
- msgstr "Gravity PDF"
495
-
496
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
497
- #: EXTENDED\1) github/view/templates/settings/initialisation-tab.php:42
498
- msgid ""
499
- "Your web server isn't compatible with Gravity PDF. Please see "
500
- "the problem areas below."
501
- msgstr ""
502
- "Votre serveur web n'est pas compatible avec Gravity PDF.. "
503
- "Merci de résoudre les problèmes ci-dessous."
504
-
505
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
506
- #: EXTENDED\1) github/view/templates/settings/initialisation-tab.php:52
507
- msgid "Can't Resolve the Issue?"
508
- msgstr "Impossible de résoudre le problème ?"
509
-
510
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
511
- #: EXTENDED\1) github/view/templates/settings/initialisation-tab.php:53
512
- #, php-format
513
- msgid ""
514
- "Does Gravity PDF detect a problem that your web host won't "
515
- "fix? %sWe recommend you move to a quality web hosting service like WP Engine"
516
- "%s which runs our software straight out of the box."
517
- msgstr ""
518
- "Est-ce que Gravity PDF détecte un problème que votre "
519
- "hébergeur ne peut pas résoudre ? %sNous vous recommandons de changer pour un "
520
- "service d'hébergement de qualité comme WP Engine%s qui peut faire tourner "
521
- "notre extension sans aucun problème."
522
-
523
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
524
- #: EXTENDED\1) github/view/templates/settings/initialisation.php:19
525
- msgid "Welcome to Gravity PDF"
526
- msgstr "Bienvenue dans Gravity PDF"
527
-
528
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
529
- #: EXTENDED\1) github/view/templates/settings/initialisation.php:19
530
- #: github/view/templates/settings/initialisation.php:66
531
- msgid "Initialise Plugin"
532
- msgstr "Initiailiser l'extension"
533
-
534
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
535
- #: EXTENDED\1) github/view/templates/settings/initialisation.php:23
536
- msgid ""
537
- "The plugin has successfully installed and is ready to start automating your "
538
- "documents."
539
- msgstr ""
540
- "L'extension a été installée avec succès, elle est prête à commencer à "
541
- "automatiser vos documents."
542
-
543
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
544
- #: EXTENDED\1) github/view/templates/settings/initialisation.php:25
545
- msgid "What's next?"
546
- msgstr "Et maintenant ?"
547
-
548
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
549
- #: EXTENDED\1) github/view/templates/settings/initialisation.php:26
550
- msgid ""
551
- "The next step is to correctly configured the plugin so that you can generate "
552
- "PDF documents."
553
- msgstr ""
554
- "La prochaine étape est la configuration correcte de l'extension, afin de "
555
- "pouvoir générer des documents PDF."
556
-
557
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
558
- #: EXTENDED\1) github/view/templates/settings/initialisation.php:27
559
- msgid ""
560
- "To help you get started, we've put together a five-part video series with "
561
- "the most common plugin configurations."
562
- msgstr ""
563
- "Pour vous aider à démarrer, nous avons mis en ligne un tutoriel en cinq "
564
- "vidéos (en anglais) avec les configurations les plus courantes de "
565
- "l'extension."
566
-
567
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
568
- #: EXTENDED\1) github/view/templates/settings/initialisation.php:29
569
- msgid "The Basics: Only Download PDF through the Admin Area"
570
- msgstr ""
571
- "La base : le téléchargement des PDF se fait seulement à partir de "
572
- "l'administration"
573
-
574
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
575
- #: EXTENDED\1) github/view/templates/settings/initialisation.php:30
576
- msgid "The Email: Send Completed PDF via Email"
577
- msgstr "L'email : l'envoi du PDF terminé par mail"
578
-
579
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
580
- #: EXTENDED\1) github/view/templates/settings/initialisation.php:31
581
- msgid ""
582
- "The Download: User Downloads PDF after Submitting Form (using a link or auto "
583
- "redirecting)"
584
- msgstr ""
585
- "Le téléchargement : l'utilisateur peut télécharger le PDF après avoir soumis "
586
- "un formulaire (en utilisant un lien ou via la redirection)"
587
-
588
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
589
- #: EXTENDED\1) github/view/templates/settings/initialisation.php:32
590
- msgid "The Email Advanced: Manually Review User Submission before Emailing PDF"
591
- msgstr ""
592
- "Les fonctionnalités avancées de l'email : vérification manuelle des données "
593
- "soumises par l'utilisateur avant d'envoyer le PDF par mail"
594
-
595
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
596
- #: EXTENDED\1) github/view/templates/settings/initialisation.php:33
597
- msgid "The Payment: Send PDF after Capturing Payment using Paypal Standard"
598
- msgstr ""
599
- "Le paiement : l'envoir du PDF après la réception du paiement via Paypal "
600
- "Standard"
601
-
602
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
603
- #: EXTENDED\1) github/view/templates/settings/initialisation.php:36
604
- #, php-format
605
- msgid ""
606
- "If you know little about PHP we recommend starting with %sPart 1:The Basics"
607
- "%s and then watching the tutorial you’re interested in. It will give you the "
608
- "foundational skills you need to configure the software."
609
- msgstr ""
610
- "Si vous n'avez pas beaucoup de connaissances en PHP, nous vous recommandons "
611
- "de commencer par la %svidéo n°1 : La base%s et ensuite de choisir le "
612
- "tutoriel qui vous intéresse. Elle vous donnera les connaissances de base "
613
- "dont vous avez besoin pour configurer l'extension. "
614
-
615
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
616
- #: EXTENDED\1) github/view/templates/settings/initialisation.php:38
617
- msgid "Custom Templates"
618
- msgstr "Modèles personnalisés"
619
-
620
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
621
- #: EXTENDED\1) github/view/templates/settings/initialisation.php:39
622
- #, php-format
623
- msgid ""
624
- "Creating a custom template gives you ultimate control of the look and feel "
625
- "of your documents using only HTML and CSS. %sWe recommend you review our "
626
- "online documentation%s to create and customise your template files."
627
- msgstr ""
628
- "La création d'un template personnalisé vous donne un contrôle complet de "
629
- "l'apparence de votre document en utilisant seulement HTML et le CSS. %sNous "
630
- "vous recommandons de regarder la documentation en ligne (en anglais)%s pour "
631
- "savoir comment créer et personnaliser vos fichiers de modèles."
632
-
633
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
634
- #: EXTENDED\1) github/view/templates/settings/initialisation.php:45
635
- msgid ""
636
- "To complete the installation, Gravity PDF needs to be "
637
- "initialised."
638
- msgstr ""
639
- "Pour terminer l'installation, Gravity PDF doit être "
640
- "initialisé."
641
-
642
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
643
- #: EXTENDED\1) github/view/templates/settings/initialisation.php:47
644
- msgid "What does initialisation do?"
645
- msgstr "Qu'est-ce que l'initialisation ne?"
646
-
647
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
648
- #: EXTENDED\1) github/view/templates/settings/initialisation.php:50
649
- msgid "Install the template files"
650
- msgstr "Installation des fichiers de modèles"
651
-
652
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
653
- #: EXTENDED\1) github/view/templates/settings/initialisation.php:50
654
- msgid ""
655
- "We create a folder called PDF_EXTENDED_TEMPLATE in your active theme "
656
- "directory and move over all the templates and configuration files. This "
657
- "folder is where you'll look to configure the software and create your PDF "
658
- "templates."
659
- msgstr ""
660
- "Nous créons un dossier appelé PDF_EXTENDED_TEMPLATE dans le répertoire de "
661
- "votre thème et déplaçons tous les templates et les fichiers de "
662
- "configuration. Ce dossier est là où vous trouverez les éléments pour "
663
- "configurer l'extension et créer vos modèles PDF. "
664
-
665
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
666
- #: EXTENDED\1) github/view/templates/settings/initialisation.php:62
667
- msgid "Have a problem with the software?"
668
- msgstr "Avez-vous un problème avec l'extension ?"
669
-
670
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
671
- #: EXTENDED\1) github/view/templates/settings/initialisation.php:63
672
- msgid ""
673
- "Did you switch themes and something went wrong syncing the template folder? "
674
- "Try reinitialise the software."
675
- msgstr ""
676
- "Avez-vous changé de thèmes et que quelque chose s'est mal passé pendant la "
677
- "synchronisation du dossier de modèles ? Essayez de réinitialiser l'extension."
678
-
679
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
680
- #: EXTENDED\1) github/view/templates/settings/initialisation.php:66
681
- msgid "Reinitialise Plugin"
682
- msgstr "Réinitialisation de l'extension"
683
-
684
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
685
- #: EXTENDED\1) github/view/templates/settings/initialisation.php:68
686
- msgid "Reinstall Default and Example Templates"
687
- msgstr "Réinstallation des modèles par défaut et des exemples"
688
-
689
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
690
- #: EXTENDED\1) github/view/templates/settings/initialisation.php:74
691
- msgid "Install a new font?"
692
- msgstr "Installer une nouvelle police ?"
693
-
694
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
695
- #: EXTENDED\1) github/view/templates/settings/initialisation.php:75
696
- #, php-format
697
- msgid ""
698
- "Do you want to use a custom font in your template? %sSee our documentation "
699
- "on how to correctly install and use a custom font%s before initialising "
700
- "below."
701
- msgstr ""
702
- "Voulez-vous utiliser une police personnalisée dans votre modèle ? %sRegardez "
703
- "dans notre documentation (en) comment installer correctement et utiliser une "
704
- "police personnalisée%s avant de faire l'installation ci-dessous."
705
-
706
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
707
- #: EXTENDED\1) github/view/templates/settings/initialisation.php:76
708
- msgid "Initialise Fonts"
709
- msgstr "Installer les polices de caractères"
710
-
711
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
712
- #: EXTENDED\1) github/view/templates/settings/support-form.php:26
713
- msgid ""
714
- "Gravity PDF's support hours are from 9:00am-5:00pm Monday to "
715
- "Friday, Sydney Australia time."
716
- msgstr ""
717
- "Les heures de disponibilité du service de Gravity PDF sont de "
718
- "9:00 à 17:00 du Lundi au Vendredi, heure de Sydney (Australie)."
719
-
720
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
721
- #: EXTENDED\1) github/view/templates/settings/support-form.php:29
722
- #, php-format
723
- msgid "The current time in Sydney Australia is %s."
724
- msgstr "En ce moment, à Sydney en Australie, il est %s."
725
-
726
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
727
- #: EXTENDED\1) github/view/templates/settings/support-form.php:55
728
- msgid "Enter the email address you want us to contact you on."
729
- msgstr ""
730
- "Saisir l'adresse email à laquelle vous voulez que nous vous contactions."
731
-
732
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
733
- #: EXTENDED\1) github/view/templates/settings/support-form.php:56
734
- msgid ""
735
- "Note: To ensure the best support possible, please use the above email to "
736
- "respond to all support communications."
737
- msgstr ""
738
- "NB : pour assurer le meilleur support possible, merci d'utiliser l'email ci-"
739
- "dessus pour toutes les réponses au support."
740
-
741
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
742
- #: EXTENDED\1) github/view/templates/settings/support-form.php:92
743
- msgid "Enter as much detail about the problem as you can."
744
- msgstr "Donnez autant de détails que possible sur le problème."
745
-
746
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
747
- #: EXTENDED\1) github/view/templates/settings/support-form.php:93
748
- msgid "Please enter as much detail about the problem as you can."
749
- msgstr "Merci de donner autant de détails que possible sur le problème."
750
-
751
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
752
- #: EXTENDED\1) github/view/templates/settings/support-form.php:94
753
- msgid "Note: Our support representatives can only communicate in English."
754
- msgstr "NB : notre support communique uniquement en anglais."
755
-
756
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
757
- #: EXTENDED\1) github/view/templates/settings/support-form.php:97
758
- msgid "Request Support"
759
- msgstr "Envoyer au support"
760
-
761
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
762
- #: EXTENDED\1) github/view/templates/settings/support-sidebar.php:20
763
- msgid "Frequently Asked Questions"
764
- msgstr "F.A.Q."
765
-
766
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
767
- #: EXTENDED\1) github/view/templates/settings/support-sidebar.php:22
768
- msgid "Can I exclude a field from showing up in the PDF?"
769
- msgstr "Puis-je empêcher un champ d'apparaitre dans le PDF ?"
770
-
771
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
772
- #: EXTENDED\1) github/view/templates/settings/support-sidebar.php:23
773
- msgid ""
774
- "I want to have multiple PDF template files generated on one form. How do I "
775
- "do it?"
776
- msgstr ""
777
- "Je veux avoir plusieurs modèles PDF pour un formulaire. Comment faire ?"
778
-
779
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
780
- #: EXTENDED\1) github/view/templates/settings/support-sidebar.php:24
781
- msgid "I want users to be able to download the PDF from the server."
782
- msgstr ""
783
- "Je veux que les utilisateurs puissent télécharger le PDF à partir du serveur."
784
-
785
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
786
- #: EXTENDED\1) github/view/templates/settings/support-sidebar.php:25
787
- msgid "How do I change the PDF size or create a landscape PDF?"
788
- msgstr "Comment changer la taille du PDF ou créer un PDF en mode paysage ?"
789
-
790
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
791
- #: EXTENDED\1) github/view/templates/settings/support-sidebar.php:26
792
- msgid ""
793
- "I am created a custom template. How do I know the names of my fields in the "
794
- "$form_data array?"
795
- msgstr ""
796
- "Je crée un modèle personnalisé. Comment savoir quels sont les noms de mes "
797
- "champs dans $form_data array ?"
798
-
799
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
800
- #: EXTENDED\1) github/view/templates/settings/support-sidebar.php:27
801
- msgid "How large a PDF are you able to create/process?"
802
- msgstr "Quelle est la taille maximum de PDF que vous pouvez créer / traiter ?"
803
-
804
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
805
- #: EXTENDED\1) github/view/templates/settings/support-sidebar.php:30
806
- #, php-format
807
- msgid ""
808
- "Got a question that isn't answered above? %sHead to our support forum%s and "
809
- "let us know."
810
- msgstr ""
811
- "Une question pour laquelle il n'y a pas de réponse ? %sAllez la poser sur "
812
- "notre forum de support (en)%s."
813
-
814
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
815
- #: EXTENDED\1) github/view/templates/settings/support.php:20
816
- msgid "Support"
817
- msgstr "Support"
818
-
819
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
820
- #: EXTENDED\1) github/view/templates/settings/system-status.php:19
821
- msgid "System Status"
822
- msgstr "Statut du système"
823
-
824
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
825
- #: EXTENDED\1) github/view/templates/settings/system-status.php:22
826
- msgid "Wordpress Version"
827
- msgstr "Version de WordPress"
828
-
829
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
830
- #: EXTENDED\1) github/view/templates/settings/system-status.php:25
831
- msgid "Wordpress Version "
832
- msgstr "Version de Wordpress "
833
-
834
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
835
- #: EXTENDED\1) github/view/templates/settings/system-status.php:30
836
- msgid "Gravity Forms"
837
- msgstr "Gravity Forms"
838
-
839
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
840
- #: EXTENDED\1) github/view/templates/settings/system-status.php:32
841
- msgid "Not Installed"
842
- msgstr "Pas installé"
843
-
844
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
845
- #: EXTENDED\1) github/view/templates/settings/system-status.php:47
846
- msgid "PHP Version"
847
- msgstr " Version de PHP"
848
-
849
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
850
- #: EXTENDED\1) github/view/templates/settings/system-status.php:50
851
- msgid "PHP Version "
852
- msgstr "Version de PHP "
853
-
854
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
855
- #: EXTENDED\1) github/view/templates/settings/system-status.php:54
856
- msgid "MB String"
857
- msgstr "MB String"
858
-
859
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
860
- #: EXTENDED\1) github/view/templates/settings/system-status.php:54
861
- #: github/view/templates/settings/system-status.php:62
862
- #: github/view/templates/settings/system-status.php:94
863
- #: github/view/templates/settings/system-status.php:103
864
- #: github/view/templates/settings/system-status.php:110
865
- #: github/view/templates/settings/system-status.php:117
866
- msgid "Yes"
867
- msgstr "Oui"
868
-
869
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
870
- #: EXTENDED\1) github/view/templates/settings/system-status.php:54
871
- #: github/view/templates/settings/system-status.php:62
872
- #: github/view/templates/settings/system-status.php:94
873
- #: github/view/templates/settings/system-status.php:103
874
- #: github/view/templates/settings/system-status.php:110
875
- #: github/view/templates/settings/system-status.php:117
876
- msgid "No"
877
- msgstr "Non"
878
-
879
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
880
- #: EXTENDED\1) github/view/templates/settings/system-status.php:58
881
- msgid ""
882
- "The PHP extension MB String and MB String Regex functions are required to "
883
- "use this plugin. Contact your web host to have it enabled."
884
- msgstr ""
885
- "L'extension PHP MB String et les fonctions MB String Regex sont nécessaires "
886
- "pour utiliser cette extension. Contactez votre hébergeur pour les faire "
887
- "activer."
888
-
889
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
890
- #: EXTENDED\1) github/view/templates/settings/system-status.php:62
891
- msgid "GD Library"
892
- msgstr "GD Library"
893
-
894
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
895
- #: EXTENDED\1) github/view/templates/settings/system-status.php:66
896
- msgid ""
897
- "The PHP extension GD Library is required to use this plugin. Contact your "
898
- "web host to have it enabled."
899
- msgstr ""
900
- "L'extension PHP GD Librairy est nécessaire pour utiliser cette extension. "
901
- "Contactez votre hébergeur pour la faire activer."
902
-
903
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
904
- #: EXTENDED\1) github/view/templates/settings/system-status.php:84
905
- msgid "Available RAM"
906
- msgstr "RAM disponible"
907
-
908
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
909
- #: EXTENDED\1) github/view/templates/settings/system-status.php:87
910
- #, php-format
911
- msgid ""
912
- "We recommend you have 128MB of available RAM to run this plugin. The minimum "
913
- "system requirement is 64MB. %sNot sure what this means? Contact your web "
914
- "host and ask them to fix the issue. %sNote: If you run less than 128MB, you "
915
- "risk PHP suffering a fatal error which will stop your website from running "
916
- "on Gravity Form pages."
917
- msgstr ""
918
- "Nous vous recommandons une mémoire RAM disponible de 128MB pour faire "
919
- "tourner cette extension. Le niveau minimum est de 64MB. %sVous n'êtes pas "
920
- "sûr de ce que cela signifie ? Contactez votre hébergeur et demandez leur de "
921
- "résoudre cela. %sNB : si vous avez moins de 128MB, vous risquez des erreurs "
922
- "fatales de PHP qui empêcheront votre site de fonctionner sur les pages avec "
923
- "des formulaires Gravity Forms."
924
-
925
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
926
- #: EXTENDED\1) github/view/templates/settings/system-status.php:94
927
- #, fuzzy
928
- msgid "Uploads Directory Writable?"
929
- msgstr "Répertoire des extensions accessible en écriture ?"
930
-
931
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
932
- #: EXTENDED\1) github/view/templates/settings/system-status.php:97
933
- #, fuzzy, php-format
934
- msgid ""
935
- "Your upload folder is not writable by your web server. Check that \"%s\" is "
936
- "writable by your web server otherwise we will attempt to use the FTP "
937
- "installer to initialise."
938
- msgstr ""
939
- "Le répertoire des polices de l'extension n'est pas accessible en écriture "
940
- "par le serveur. Vérifiez que le répertoire \"%s\" est accessible en "
941
- "écriture, ou bien nous essayerons d'utiliser l'installateur FTP pour "
942
- "l'initialisation. "
943
-
944
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
945
- #: EXTENDED\1) github/view/templates/settings/system-status.php:103
946
- msgid "PDF Output Directory Writable?"
947
- msgstr "Répertoire de sortie des PDF accessible en écriture ?"
948
-
949
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
950
- #: EXTENDED\1) github/view/templates/settings/system-status.php:106
951
- #, php-format
952
- msgid ""
953
- "The plugin's output folder is not writable by your web server. PDFs will not "
954
- "be attached to notifications until this problem is fixed. Check that \"%s\" "
955
- "is writable by your web server."
956
- msgstr ""
957
- "Le répertoire de stockage de l'extension n'est pas accessible en écriture "
958
- "par le serveur. Les PDF ne pourront pas être joints aux notifications tant "
959
- "que ce problème n'est pas réglé. Vérifiez que le répertoire \"%s\" est "
960
- "accessible en écriture. "
961
-
962
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
963
- #: EXTENDED\1) github/view/templates/settings/system-status.php:110
964
- msgid "PDF Font Directory Writable?"
965
- msgstr "Répertoire des polices de caractère PDF accessible en écriture ?"
966
-
967
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
968
- #: EXTENDED\1) github/view/templates/settings/system-status.php:113
969
- #, php-format
970
- msgid ""
971
- "The plugin's font folder is not writable by your web server. Check that \"%s"
972
- "\" is writable by your web server otherwise we will attempt to use the FTP "
973
- "installer to initialise."
974
- msgstr ""
975
- "Le répertoire des polices de l'extension n'est pas accessible en écriture "
976
- "par le serveur. Vérifiez que le répertoire \"%s\" est accessible en "
977
- "écriture, ou bien nous essayerons d'utiliser l'installateur FTP pour "
978
- "l'initialisation. "
979
-
980
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
981
- #: EXTENDED\1) github/view/templates/settings/system-status.php:117
982
- msgid "mPDF Temporary Directory Writable?"
983
- msgstr "Répertoire temporaire de mPDF accessible en écriture ?"
984
-
985
- #: G:\Blue Liquid Designs\4) BLUE LIQUID DESIGNS\19) GRAVITY FORMS PDF
986
- #: EXTENDED\1) github/view/templates/settings/system-status.php:120
987
- #, fuzzy, php-format
988
- msgid ""
989
- "mPDF temporary directory not writable (%s). Memory and image processing time "
990
- "will increase."
991
- msgstr ""
992
- "Le répertoire temporaire de mPDF (mPDF/tmp/) n'est pas accessible en "
993
- "écriture. La mémoire utilisée et le temps de traitement des images vont "
994
- "augmenter."
995
-
996
- #~ msgid ""
997
- #~ "There was a problem installing the font files. Check the file permissions "
998
- #~ "in the plugin folder and try again."
999
- #~ msgstr ""
1000
- #~ "Il y a eu un problème lors de l'installation des polices de caractères. "
1001
- #~ "Vérifiez les permissions dans le dossier du plugin et réessayer."
1002
-
1003
- #~ msgid ""
1004
- #~ "Gravity PDF needs to keep your configuration and templates "
1005
- #~ "folder in sync with your current active theme. %sSync Now%s"
1006
- #~ msgstr ""
1007
- #~ "Gravity PDF a besoin de synchroniser votre configuration "
1008
- #~ "et votre répertoire de modèles avec votre thème actif. %sSynchroniser "
1009
- #~ "maintenant%s"
1010
-
1011
- #~ msgid "PDF"
1012
- #~ msgstr "PDF"
1013
-
1014
- #~ msgid ""
1015
- #~ "The plugin folder is not writable by your web server. Check the directory "
1016
- #~ "\"%s\" is writable by your web server otherwise we will attempt to use "
1017
- #~ "the FTP installer to initialise."
1018
- #~ msgstr ""
1019
- #~ "Le dossier de l'extension n'est pas accessible en écriture par le "
1020
- #~ "serveur. Vérifiez que le répertoire \"%s\" est accessible en écriture, ou "
1021
- #~ "bien nous essayerons d'utiliser l'installateur FTP pour l'initialisation. "
1022
-
1023
- #~ msgid "Theme Directory Writable?"
1024
- #~ msgstr "Répertoire des thèmes accessible en écriture ?"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
mPDF.zip ADDED
Binary file
mPDF/CHANGELOG.txt CHANGED
@@ -1,25 +1,2769 @@
1
- ================
2
- mPDF 5.7.1
3
- 1/09/2013
4
- ================
5
- 1) FILES: mpdf.php
6
- Bug fix; Dollar sign enclosed by <pre> tag causing error.
7
- Test e.g.: <pre>Test $1.00 Test</pre> <pre>Test $2.00 Test</pre> <pre>Test $3.00 Test</pre> <pre>Test $4.00 Test</pre>
8
- -----------------------------
9
- 2) FILES: includes/functions.php AND mpdf.php
10
- Changes to preg_replace with /e modifier to use preg_replace_callback
11
- (/e depracated from PHP 5.5)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  -----------------------------
13
- 3) FILES: classes/barcode.php
14
- Small change to function barcode_c128() which allows ASCII 0 - 31 to be used in C128A e.g. chr(13) in:
15
- <barcode code="5432&#013;1068" type="C128A" />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  -----------------------------
17
- 4) FILES: mpdf.php
18
- Using $use_kwt ("keep-[heading]-with-table") if <h4></h4> before table is on 2 lines and pagebreak occurs after first line
19
- the first line is displayed at the bottom of the 2nd page.
20
- Edited so that $use_kwt only works if the HEADING is only one line. Else ignores (but prints correctly)
21
- -----------------------------
22
- 5) FILES: mpdf.php
23
- Clearing old temporary files from _MPDF_TEMP_PATH will now ignore "hidden" files e.g. starting with a "." .htaccess, .gitignore etc.
24
- and also leave dummy.txt alone
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  -----------------------------
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ===========================
2
+ mPDF 5.6
3
+ 20/01/2013
4
+ ===========================
5
+
6
+ Files changed
7
+ -------------
8
+ mpdf.php
9
+ config.php
10
+ includes/functions.php
11
+ classes/meter.php
12
+ classes/directw.php
13
+
14
+
15
+ config.php changes
16
+ ------------------
17
+ $this->allowedCSStags - added HTML5 tags + textcircle AND
18
+ $this->outerblocktags - added HTML5 tags
19
+ $this->defaultCSS - added default CSS properties
20
+
21
+
22
+ New features / Improvements
23
+ ---------------------------
24
+ CSS support added for for min-height, min-width, max-height and max-width in <img>
25
+
26
+ Images embedded in CSS
27
+ <img src="data:image/gif;base64,...."> improved to make it more robust, and
28
+ background: url(data:image... now added to work
29
+
30
+ HTML5 tags supported
31
+ - as generic block elements: <article><aside><details><figure><figcaption><footer><header><hgroup><nav><section><summary>
32
+ - as in-line elements: <mark><time><meter><progress>
33
+ - <mark> has a default CSS set in config.php to yellow highlight
34
+ - <meter> and <progress> support attributes as for HTML5
35
+ - custom appearances for <meter> and <progress> can be made by editing classes/meter.php file
36
+ - <meter> and <progress> suppress text inside the tags
37
+
38
+ Textcircle/Circular
39
+ font: "auto" added: automatically sizes text to fill semicircle (if both set) or full circle (if only one set)
40
+ NB for this AND ALL CSS on <textcircle>: does not inherit CSS styles
41
+ attribute: divider="[characters including HTML entities]" added
42
+ <textcircle r="30mm" top-text="Text Circular Text Circular" bottom-text="Text Circular Text Circular"
43
+ divider="&nbsp;&bull;&nbsp;" style="font-size: auto" />
44
+
45
+ &raquo; &rsquo; &sbquo; &bdquo; are now included in "orphan"-management at the end of lines
46
+
47
+ Improved CJK line wrapping (if CJK character at end of line, breaks there rather than previous wordspace)
48
+
49
+ NB mPDF 5.5 added support for <fieldset> and <legend> (omitted from ChangeLog)
50
+
51
+ Bug fixes
52
+ ---------
53
+ - embedded fonts: Panose string incorrectly output as decimals - changed to hexadecimal
54
+ Only a problem in limited circumstances.
55
+ *****Need to delete all ttfontdata/ files in order for fix to have effect.
56
+ - <textCircle> background white even when set to none/transparent
57
+ - border="0" causing mPDF to add border to table CELLS as well as table
58
+ - iteration counter in THEAD crashed in some circumstances
59
+ - CSS color now supports spaces in the rgb() format e.g. border: 1px solid rgb(170, 170, 170);
60
+ - CJK not working in table following changes made in v5.4
61
+ - images fixed to work with Google Chart API (now mPDF does not urldecode the query part of the src)
62
+ - CSS <style> within HTML page crashed if CSS is too large (? > 32Kb)
63
+ - SVG image nested int eht HTML failed to show if code too large (? > 32Kb)
64
+ - cyrillic character p &#1088; at end of table cell caused cell height to be incorrectly calculated
65
+
66
+
67
+ ===========================
68
+ mPDF 5.5
69
+ 02/03/2012
70
+ ===========================
71
+
72
+ Files changed
73
+ -------------
74
+ mpdf.php
75
+ classes/ttfontsuni.php
76
+ classes/svg.php
77
+ classes/tocontents.php
78
+ config.php
79
+ config_fonts.php
80
+ utils/font_collections.php
81
+ utils/font_coverage.php
82
+ utils/font_dump.php
83
+
84
+ Files added
85
+ -----------
86
+ classes/ttfontsuni_analysis.php
87
+
88
+ config.php changes
89
+ ------------------
90
+ To avoid just the border/background-color of the (empty) end of a block being moved on to next page (</div></div>)
91
+ $this->margBuffer = 0; // Allow an (empty) end of block to extend beyond the bottom margin by this amount (mm)
92
+
93
+ config_fonts.php changes
94
+ ------------------------
95
+ Added to (arabic) fonts to allow "use non-mapped Arabic Glyphs" e.g. for Pashto
96
+ 'unAGlyphs' => true,
97
+
98
+ Arabic text
99
+ -----------
100
+ Arabic text (RTL) rewritten with improved support for Pashto/Sindhi/Urdu/Kurdish
101
+ Presentation forms added:
102
+ U+0649, U+0681, U+0682, U+0685, U+069A-U+069E, U+06A0, U+06A2, U+06A3, U+06A5, U+06AB-U+06AE,
103
+ U+06B0-U+06B4, U+06B5-U+06B9, U+06BB, U+06BC, U+06BE, U+06BF, U+06C0, U+06CD, U+06CE, U+06D1, U+06D3, U+0678
104
+ Joining improved:
105
+ U+0672, U+0675, U+0676, U+0677, U+0679-U+067D, U+067F, U+0680, U+0683, U+0684, U+0687, U+0687, U+0688-U+0692,
106
+ U+0694, U+0695, U+0697, U+0699, U+068F, U+06A1, U+06A4, U+06A6, U+06A7, U+06A8, U+06AA, U+06BA, U+06C2-U+06CB, U+06CF
107
+
108
+ Note -
109
+ Some characters in Pashto/Sindhi/Urdu/Kurdish do not have Unicode values for the final/initial/medial forms of the characters.
110
+ However, some fonts include these characters "un-mapped" to Unicode (including XB Zar and XB Riyaz, which are bundled with mPDF).
111
+ 'unAGlyphs' => true,
112
+ added to the config_fonts.php file for appropriate fonts will
113
+
114
+ This requires the font file to include a Format 2.0 POST table which references the glyphs as e.g. uni067C.med or uni067C.medi:
115
+ e.g. XB Riyaz, XB Zar, Arabic Typesetting (MS), Arial (MS)
116
+ NB If you want to know if a font file is suitable, you can open a .ttf file in a text editor and search for "uni067C.med"
117
+ - if it exists, it may work!
118
+ Using "unAGlyphs" forces subsetting of fonts, and will not work with SIP/SMP fonts (using characters beyond the Unicode BMP Plane).
119
+
120
+ mPDF maps these characters to part of the Private Use Area allocated by Unicode U+F500-F7FF. This could interfere with correct use
121
+ if the font already utilises these codes (unlikely).
122
+
123
+ mPDF now deletes U+200C,U+200D,U+200E,U+200F zero-widthjoiner/non-joiner, LTR and RTL marks so they will not appear
124
+ even though some fonts contain glyphs for these characters.
125
+
126
+
127
+ Other New features / Improvements
128
+ ---------------------------------
129
+ Avoid just the border/background-color of the (empty) end of a block being moved on to next page (</div></div>)
130
+ using configurable variable: $this->margBuffer;
131
+
132
+
133
+ The TTFontsUni class contained a long function (extractcoreinfo) which is not used routinely in mPDF
134
+ This has been moved to a new file: classes/ttfontsuni_analysis.php
135
+ The 3 utility scripts have been updated to use the new extended class:
136
+ - utils/font_collections.php
137
+ - utils/font_coverage.php
138
+ - utils/font_dump.php
139
+
140
+
141
+ Bug fixes
142
+ ---------
143
+ - Border & background when closing 2 blocks (e.g. </div></div>) incorrectly being moved to next page because incorrectly
144
+ calculating how much space required
145
+ - Fixed/Absolute-positioned elements not inheriting letter-spacing style
146
+ - Rotated cell - error if text-rotate set on a table cell, but no text content in cell
147
+ - SVG images, text-anchor not working
148
+ - Nested table - not resetting cell style (font, color etc) after nested table, if text follows immediately
149
+ - Nested table - font-size 70% set in extenal style sheet; if repeated nested tables, sets 70% of 70% etc etc
150
+ - SVG setting font-size as percent on successive <text> elements gives progressively smaller text
151
+ - mPDF will check if magic_quotes_runtime set ON even >= PHP 5.3 (will now cause an error message)
152
+ - not resetting after 2 nested tags of same type e.g. <b><b>bold</b></b> still bold
153
+ - When using charset_in other than utf-8, HTML Footers using tags e.g. <htmlpageheader> do not decode correctly
154
+ - ToC if nested > 3 levels, line spacing reduces and starts to overlap
155
+
156
+
157
+
158
+
159
+ ===========================
160
+ mPDF 5.4
161
+ 14/02/2012
162
+ ===========================
163
+ Files changed
164
+ -------------
165
+ mpdf.php
166
+ config.php
167
+ compress.php
168
+ classes/ttfontsuni.php
169
+ classes/barcode.php
170
+ classes/indic.php
171
+ classes/svg.php
172
+ examples/show_code.php ----- SECURITY RISK**
173
+ examples/example49_changelog.php
174
+ examples/example57_new_mPDF_v5-3_active_forms_b (replace example57_new_mPDF_v5-3_active_forms)
175
+ includes/out.php
176
+ mpdfi/fpdi_pdf_parser.php
177
+
178
+ Files added
179
+ -----------
180
+ classes/bmp.php
181
+ classes/directw.php
182
+ classes/form.php
183
+ classes/grad.php
184
+ classes/tocontents.php
185
+ classes/wmf.php
186
+ examples/example58_new_mPDF_v5-4_features
187
+
188
+ config.php changes
189
+ ------------------
190
+ Edited: $this->allowedCSStags, $this->innerblocktags, $this->defaultCSS; (CAPTION added in each case)
191
+ Moved: Numerous $form_.. variables are now in /classes/form.php
192
+
193
+ New config variables
194
+ --------------------
195
+ $this->bookmarkStyles = array();
196
+ $this->cacheTables = true;
197
+
198
+ New methods
199
+ -----------
200
+ function CircularText()
201
+ function SetVisibility()
202
+
203
+ New/Extended CSS
204
+ ----------------
205
+ box-shadow (block elements - does NOT support "inset")
206
+ text-shadow (all text elements - does NOT support "blur")
207
+ visibility: visible|hidden|printonly|screenonly (block-level elements and images IMG only)
208
+ text-transform: capitalize|uppercase|lowercase (extended to support TD/TH)
209
+ tr|td|th:nth-child(odd|even|2n+1)
210
+ color, strikethrough, underline and background-color (extended to support rotated TD/TH)
211
+ underline and strike-through (extended to support TD/TH)
212
+ underline (line colour) (extended to work correctly in watermark)
213
+ page-break-after: left|right|always (block elements and tables)
214
+ NB respects $mpdf->restoreBlockPagebreaks = true; i.e. will make pagebreak act like formfeed
215
+ background[-color]: extended to support rgba|cmyka|cmyk|hsla|hsl|spot
216
+ border(extended to support inline elements)
217
+
218
+
219
+ New HTML
220
+ --------
221
+ <caption>
222
+ <textcircle />
223
+
224
+
225
+ New features / Improvements
226
+ ---------------------------
227
+ Tables - Zebra Stripes
228
+ Tables: overlapping rowspans (partially) supported
229
+ Tables - Disk caching
230
+ Using progress bars (or $showStats) now reports 'real' memory usage i.e. get_memory_usage(true)
231
+ Support for query string in the URLs for external stylesheets e.g. @import url("style.css?ltcyy7");
232
+ Table caption partially supported
233
+ CircularText
234
+ BookMark styling
235
+ Spread tables i.e. can split table (columns) across several pages width.
236
+ Can use chelvetica, ctimes and ccourier to specify core fonts in a non-core font document
237
+ Spread tables i.e. can split table (columns) across several pages width.
238
+ {colsum} in <tfoot> cell will insert a column total per page.
239
+ SVG embedded as island in HTML supported
240
+ Active Forms
241
+ textarea and input (text types) now accept javascript as:
242
+ onKeystroke, onValidate, onCalculate and onFormat
243
+ onChange is depracated but works as onCalculate (for textarea and input)
244
+ (PS Select still accepts onChange cf. 5.3.37)
245
+ Ledger and Tabloid added as page formats recognised. NB Ledger is same as tabloid but landscape. In mPDF, both give the same size (portrait)
246
+ so need to add -L e.g. Ledger-L for landscape.
247
+
248
+
249
+ Internal script changes
250
+ -----------------------
251
+ Changed this->k to _MPDFK throughout all scripts
252
+ Changes to color (packed binary data in string rather than array) to reduce memory usage esp in tables
253
+ Internal variables Removed
254
+ $usetableheader;
255
+ $tableheadernrows;
256
+ $tablefooternrows;
257
+ vars $ChangePage, $p_bottom_border, $img_margin_top(+) $issetcolor + other similar removed
258
+
259
+ Removed a whole load of // comments
260
+ Updates to remove some more Warning Notices (not all marked in text)
261
+ Border set on TR - changed so set on each cell, rather than retrospectively at end of TR
262
+ All references to table['text'] removed as not needed - uses ['textbuffer'] instead
263
+ OpenTag(TD) changes to reduce memory usage with tables
264
+ Includes different method to set a default timezone
265
+ fn _smallCaps does not need (undefined) $space
266
+ this->chrs and this->ords replaced by chr() and ord()
267
+ Headers in out.php updated to match those used in Output()
268
+ Change to SetFont() to improve performance time
269
+ Change to GetStringWidth() to improve performance time
270
+ Corrected copying of Glyphs 0,1,2, to all subset fonts (non-SMP/SIP), and only setting 32->127 in subset
271
+ Subset fonts (non-SMP/SIP) have additionally Unicode CMap tables (0,0,4 and 0,3,4) as well as Microsoft (3,1,4)
272
+ Subset fonts (SMP/SIP) have CMap tables (1,0,6 and 3,0,4) - rather than 1,0,6 and 3,0,6
273
+ Subset fonts (SMP/SIP) have 'name' table changed to give 1,0 and 3,0. As it is a symbol font (not Unicode encoded) :
274
+ needs to have a name entry in 3,0 (e.g. symbol) - original font will have 3,1 (i.e. Unicode)
275
+ Automatically checks for HTML code length > 100000 characters and gives error warning if
276
+ PHP < 5.2.0 (as not configurable) or increases pcre.backtrack_limit if PHP < 5.3.7
277
+
278
+ Removed/Depracated
279
+ ------------------
280
+ function UseTableHeader($opt=true) fn removed / depracated
281
+ function UsePRE($opt=true) removed
282
+ $attr['REPEAT_HEADER'] == true CSS removed / depracated
283
+ $this->usepre=true; removed / depracated as never needed - always respects PRE whitespace
284
+
285
+ ToC: NB Values can no longer be set directly e.g. as in example
286
+ $mpdf->TOCheader = array(); // array as for setting header/footer
287
+ $mpdf->TOCfooter = array(); // array as for setting header/footer
288
+ $mpdf->TOCpreHTML = '<h2>Contents - Portrait</h2>'; // HTML text to appear before table of contents
289
+ $mpdf->TOCpostHTML = ''; // HTML text to appear after table of contents
290
+ $mpdf->TOCbookmarkText = 'Content list'; // Text as it will appear in the Bookmarks (leave blank for none)
291
+ Need to use TOCpagebreak either direct (or array version) or as HTML
292
+ OR if absolutley necessary, could use:
293
+ $mpdf->tocontents->TOCheader = array(); // array as for setting header/footer
294
+ $mpdf->tocontents->TOCfooter = array(); // array as for setting header/footer
295
+ $mpdf->tocontents->TOCpreHTML = '<h2>Contents - Portrait</h2>'; // HTML text to appear before table of contents
296
+ $mpdf->tocontents->TOCpostHTML = ''; // HTML text to appear after table of contents
297
+ $mpdf->tocontents->TOCbookmarkText = 'Content list'; // Text as it will appear in the Bookmarks (leave blank for none)
298
+
299
+
300
+
301
+ Further Details
302
+ ===============
303
+
304
+ CSS border on inline elements
305
  -----------------------------
306
+ Support for CSS border (and variants) on inline elements e.g. <span style="border-bottom: 1px dashed #000000;">
307
+ Border styles solid|dotted|dashed|double only are supported. Border radius not supported.
308
+ Nested inline elements will have repeat left|right borders on the nested content (unlike browsers)
309
+
310
+ Tables - Zebra Stripes
311
+ ----------------------
312
+ TABLE - striped rows cf. http://dev.opera.com/articles/view/zebra-striping-tables-with-css3/
313
+ tr:nth-child(odd) { background-color: #99ff99; }
314
+ thead tr:nth-child(3n+2) { background-color: #FFBBFF; }
315
+ td:nth-child(2n+1) { background-color: #BBBBFF; }
316
+ table.zebraTable td:nth-child(2n+1) { background-color: #BBBBFF; }
317
+ table.zebraTable th:nth-child(2n+1) { background-color: #BBBBFF; }
318
+
319
+ NB mPDF does NOT correctly apply specificity to all CSS
320
+ table.zebra tbody tr:nth-child(2n+1) td { background-color: #FFFFBB; }
321
+ table.zebra tbody td:nth-child(odd) { background-color: #BBBBFF; }
322
+
323
+ should make every odd row yellow, and every odd coloumn blue, but with the row/yellow overriding the column/blue.
324
+ In mPDF the td:nth-child(odd) trumps the plain td, so the column colour wins out. You can force the effect you want by using
325
+ table.zebra tbody tr:nth-child(2n+1) td:nth-child(1n+0) { background-color: #FFFFBB; }
326
+
327
+ (The :nth-child(1n+0) selector just selects every td cell.)
328
+
329
+
330
+
331
+ Tables - Disk caching
332
+ ---------------------
333
+ TABLES: using disk caching
334
+ // Using disk to cache table data can reduce memory usage dramatically, but at a cost of increased
335
+ // executon time and disk access (read and write)
336
+ $this->cacheTables = true;
337
+ NB $this->packTableData will be overridden to => true; // required for cacheTables
338
+ $this->simpleTables will be overridden to => false; // Cannot co-exist with cacheTables
339
+
340
+
341
+ Table caption
342
+ -------------
343
+ Must come immediately after <table...>
344
+ CSS caption-side and HTML align attribute of top|bottom supported (not attribute left|right)
345
+ Handled as a separate block element brought outside the table, so:
346
+ CSS will not cascade correctly on the table
347
+ width of caption block is that of page or of the block element containing the table
348
+ so alignment will be to the page-width not the table width
349
+ if table page-break-after: always, the caption will follow the pagebreak.
350
+ This does work:
351
+ <style>
352
+ .tablecaption { caption-side: bottom; text-align: left; font-weight: bold; color: green; }
353
+ </style>
354
+ ...
355
+ <table>
356
+ <caption class="tablecaption">Caption title here</caption>
357
+ <tbody>
358
+
359
+ CSS visibility: printonly, screenonly
360
+ -------------------------------------
361
+ Roughly based on CSS
362
+
363
+ Works on Block elements P, DIV etc, or Image
364
+ Cannot nest / layer.
365
+ Inner blocks/image with set visibility are ignored if already set on enclosing block element.
366
+ (Block element) does not work inside table (image does)
367
+ So 'visible' does nothing but is set as default
368
+ (NB Changes output to PDF version 1.5)
369
+ Incompatible with PDFA / PDFX
370
+
371
+ 'visibility'
372
+ Value: visible | hidden | (collapse | inherit)
373
+ Initial: visible
374
+ Applies to: all elements
375
+ Inherited: yes
376
+
377
+ The 'visibility' property specifies whether the boxes generated by an element are rendered.
378
+ Invisible boxes still affect layout (set the 'display' property to 'none' to suppress box generation altogether).
379
+ Values have the following meanings:
380
+
381
+ visible
382
+ The generated box is visible.
383
+ hidden
384
+ The generated box is invisible (fully transparent, nothing is drawn), but still affects layout.
385
+ Furthermore, descendants of the element will be visible if they have 'visibility: visible'.
386
+ collapse | inherit
387
+ NOT supported in mPDF
388
+
389
+ CUSTOM:
390
+ printonly | screenonly
391
+
392
+
393
+ Added VISIBILITY function
394
+ $mpdf->SetVisibility('screenonly'); or 'printonly' 'visible' or 'hidden'
395
+ (NB Changes output to PDF version 1.5)
396
+ Incompatible with PDFA / PDFX
397
+
398
+ CircularText
399
+ ------------
400
+ function CircularText($x, $y, $r, $text, $align='top', $kerning=120, $fontwidth=100) {
401
+ x: abscissa of center
402
+ y: ordinate of center
403
+ r: radius of circle
404
+ text: text to be printed
405
+ align: text alignment: top or bottom. Default value: top
406
+ kerning: spacing between letters in percentage. Default value: 120. Zero is not allowed.
407
+ fontwidth: width of letters in percentage. Default value: 100. Zero is not allowed
408
+
409
+ - now uses Kerning between letters if useKerning == true (set manually see example)
410
+
411
+ BookMark styling
412
+ ----------------
413
+ New configurable variable to control appearance of Bookmarks e.g.
414
+ $this->bookmarkStyles = array(
415
+ 0 => array('color'=> array(0,64,128), 'style'=>'B'),
416
+ 1 => array('color'=> array(128,0,0), 'style'=>''),
417
+ 2 => array('color'=> array(0,128,0), 'style'=>'I'),
418
+ );
419
+
420
+ Column sums
421
+ -----------
422
+ (Also changed some preg_replace to str_replace to improve performance)
423
+ To use: just add {colsum} to any cells of the table footer <tfoot>
424
+ Add a number to specify a fixed number of decimal points e.g. <td>�{colsum2}</td> will give you �123.40
425
+ The width of the column will be calculated using the actual string {colsum} as a placeholder.
426
+ If you need the column to be wider, use underscores "_" to pad it e.g. {colsum2_____}
427
+
428
+
429
+ Spread tables
430
+ -------------
431
+ i.e. can split table (columns) across several pages width.
432
+ CSS <table style="overflow: visible">
433
+ Cannot use with:
434
+ $this->kwt - ignored
435
+ $this->table_rotate - ignored
436
+ $this->table_keep_together - ignored
437
+ $this->ColActive - cancels spread tables
438
+
439
+ Messes up with:
440
+ $mpdf->forcePortraitHeaders = true;
441
+ $mpdf->forcePortraitMargins = true;
442
+ Problems with CJK, and RTL
443
+
444
+ Will do no resizing of fonts at all.
445
+ Maximum width of column = page width i.e. will not split columns across pages - NB will keep colspan>1 on one page
446
+ If table row too high for page will die with error message.
447
+ Will override some specs for width if this creates conflicts
448
+ Recommended to specify absolute value of width on each column.
449
+
450
+
451
+
452
+
453
+ Bug fixes
454
+ =========
455
+ Dottab - if text after dottab is hyperlinked <a></a> then dots are underlined
456
+
457
+ page-break-before now respects $mpdf->restoreBlockPagebreaks = true; i.e. will make pagebreak act like formfeed
458
+ Annotation() function called directly with colorarray(r,g,b)
459
+
460
+ Added urldecode to _getImage to cope with ../name%20of%20image.jpg
461
+ Added urldecode AND htmlspecials_decode to href in <a> link e.g. https://www.google.com/search?hl=en&amp;q=mpdf&amp;filename=name%20of%20file
462
+ [barcode.php] Allow &nbsp; in C39 codes - will be changed to spaces
463
+
464
+ <table> inside a <div position:fixed, left:300px;> not calculating table width correctly
465
+ - leading to either upside down table or error width less than 1 character
466
+
467
+ Depracated magic_quotes_runtime() in compress.php
468
+
469
+ DIRECTW included twice in compress.php
470
+ FORMS mark up for compress.php corrected
471
+
472
+ double backslashes not preserved inside <pre> or <textarea>
473
+
474
+ font-weight and font-style not recognised in <pageheader>
475
+
476
+ Progress bars causing corrupt PDF file (out.php) changed fopen from "r" mode to "rb" (binary)
477
+ Target around image - <a href="#internaltarget"><img ... /></a> - not working
478
+
479
+ SmallCaps in <thead> error
480
+
481
+ Fonts with "name" table in format 1 not recognised correctly
482
+ Rotated table which does not fit on remaining page, forces a new page even if already at top of page
483
+
484
+ Locale causing problems - all instances of sprintf() using %.3f changed to %.3F so not locale aware
485
+
486
+ CSS border radius not implemented on fixed/absolute positioned block element
487
+
488
+ Background color in rotated table extending way beyond bottom of table
489
+
490
+ Nested table containing <thead> or <tfoot> was confused with <thead> or <tfoot> of parent table
491
+
492
+ Correct handling of spaces, < or & in textarea
493
+
494
+ <option> and <input ..> attributes value/title decoded with fn lesser_entity_decode instead of htmlspecialchars_decode to include &apos;
495
+
496
+ line width not restored to correct value after "line-through" text in Cell()
497
+
498
+ Kannada - incorrect positioning of Reph
499
+
500
+ Forms - In <input> or <option> (select) not correctly handling HTML named entities e.g. &lt; in value or title
501
+ Active forms - &nbsp; as Value or Title incorrectly showing as Euro - PDFDocEncoding fixed
502
+
503
+ Unicode data in embedded fonts not encrypted when doc encrypted
504
+
505
+ Nested block elements which are empty including innermost one, top margin of innermost block was ignored
506
+
507
+ font-size: xx% inside a block was setting on block's parent font-size
508
+
509
+ Active forms - radio buttons (removed name from Widget - leave on Radio group)
510
+ causing problems accessing field for radio buttons
511
+
512
+ When using simple tables and border-collapse, if table border set, but cell borders not set, should display table border (fixed)
513
+ position:fixed block - if neither top nor bottom nor height specified, was positioned incorrectly (y)
514
+ Leave - if top, bottom, margin-top, margiin-bottom and height are all left unspecified (or auto), will centre vertically
515
+ on the page (specific to mPDF - not consistent with CSS2.1)
516
+ But if any one of them are specified (including e.g. margin-top=0), follows CSS spec, so top is the current "static" position
517
+
518
+ background-image-opacity=0 not working on BODY or BLOCK
519
+
520
+ Lists - if LI continues after a nested List, would add as a new LI item (should continue as part of earlier LI item)
521
+
522
+ fn WriteCell() converts to 'windows-1252' when required
523
+ if multiple calls to mPDF used, cannot redefine function cmp()
524
+ internal link targets <a name="xx" /> in ToC not moved when using: page-break-inside:avoid
525
+ internal link targets <a name="xx" /> not moved when using: columns, page-break-inside:avoid, keep-with-table or table rotate
526
+
527
+ Active Forms - onChange not working for SELECT (cf. 5.3.25) Example 57 only worked by chance as JS was carried over from Select to Text field
528
+ Bug is fixed, but example file needed updating to onCalculate for the display field.
529
+
530
+ Table cell: if height set as %, currently sets it as % of page-width; instead this now ignores it.
531
+
532
+ Bengali letter Khanda Ta (U+09CE) character not recognised; was added in Unicode v4.1 and prior to this, (U+09A4 U+09CD U+200D)
533
+ so mPDF converts to this string and seems to work.
534
+
535
+ OCR characters wrong size in barcodes if using different ocr font - fixed
536
+
537
+ ===========================
538
+ mPDF v5.3 (21/07/2011)
539
+ ===========================
540
+
541
+ New Features
542
+ ------------
543
+ - Active forms (see on-line manual for details)
544
+ - 128-bit encryption (optional) with additional user-permissions (see on-line manual)
545
+
546
+ PLEASE READ - Change in Font management
547
+ ---------------------------------------
548
+ The font name imported from the font and included by mPDF in the PDF file was stripping any '-' in the name.
549
+ This is the PostScript name which is utilised by some PostScript programmes.
550
+ mPDF has been changed to leave the PostScript font name unchanged. In 99% cases no difference will be noted, but
551
+ you MUST delete all the temporary font data files cached in the /ttfontdata/ folder for this to be effective.
552
+
553
+
554
+ Minor changes
555
+ -------------
556
+ If @page CSS is used to select a first page with settings different from the default, mPDF did create a blank page
557
+ then pagebreak to the new @page settings - this has been changed so it now will start with the new page settings.
558
+
559
+ New function added: DeletePages($start_page, $end_page=-1) e.g. $mpdf->DeletePages(1);
560
+ Can be used just before calling Output()
561
+
562
+ compress.php utility extended to exclude active forms and images-svg
563
+
564
+
565
+ Bug fixes
566
+ ---------
567
+ - list-style-type: (custom version, user-defined bullet) colour change not working if colour is set on the list item line
568
+ - background-image: SVG or WMF images as background-images in tables/tr/cells not working
569
+ - font-weight: bold font not always reset after inline <b>...</b> thus miscalculating width
570
+ - forms (inactive) in 'c' core fonts using unicode characters 127-255 incorrect display in input text and button text
571
+ - form elements (inactive) if in-line with mixed size fonts, error in vertical positioning of text related to box
572
+ - ToC: wrapped lines in ToC not retaining formatting e.g. bold style
573
+ - HTMLHeaders: using setAutoTopMargin="pad"; not correctly setting top margin for first page
574
+ - output headers changed: Content-length not used if server uses output compression
575
+ - embedded font subsets from fonts which contain non-BMP plane 0 characters (incl. e.g. dejavusanscondensed)
576
+ - causing Adobe Reader to create a CJK encoded font subset internally when loading interactive Forms
577
+ - Changed so unsets the flag in the subset font to show no non-BMP characters.
578
+
579
+
580
+ Configurable variables added (see config.php file):
581
+ --------------------------------------------------
582
+ All for Active Forms:
583
+ $this->useActiveForms
584
+ $this->formExportType
585
+ $this->formSubmitNoValueFields
586
+ $this->formSelectDefaultOption
587
+ $this->form_border_color
588
+ $this->form_background_color
589
+ $this->form_border_width
590
+ $this->form_border_style
591
+ $this->form_button_border_color
592
+ $this->form_button_background_color
593
+ $this->form_button_border_width
594
+ $this->form_button_border_style
595
+ $this->form_radio_color
596
+ $this->form_radio_background_color
597
+
598
+ PLUS: see additional values added to $this->allowedCSStags close to bottom of file - required for Active forms
599
+
600
+
601
+ Updated files
602
+ -------------
603
+ mpdf.php
604
+ config.php (NB as well as form stuff at top, 5.2.07 $this->allowedCSStags close to bottom of file)
605
+ compress.php
606
+ classes/ttfontsuni.php
607
+ examples/example57...
608
+ examples/formsubmit.php
609
+
610
+
611
+
612
+ ===========================
613
+ mPDF v5.2 (18/06/2011)
614
+ ===========================
615
+
616
+ New Features
617
+ ------------------
618
+ Improvements in font handling resulting in clearer display of fonts on screen, and improved compatibility with PostScript drivers
619
+ (e.g. use with GSView/GhostScript, see below)
620
+
621
+ CJK line-breaking implemented (roughly) according to rules. Configurable variables allow control of behaviour (except in tables).
622
+
623
+ Viewer preferences: added options for initial 2 page display where you can specify whether
624
+ 1st page is on left or right (cf. SetDisplayMode).
625
+
626
+ Custom list-style-type for a list (ul,ol) or a list-item (li) in which you can determine the character and colour of the bullet:
627
+ list-style-type: U+263Argb(255,0,0); - where U+263A is the Unicode HEX value of the character you want for the bullet
628
+ - character MUST be included in the font used for that list item. rgb() bit is optional
629
+
630
+
631
+ Bug fixes
632
+ ---------
633
+ - Fonts: embedding a BMP TTC font (e.g. Cambria) as a full font caused error
634
+ - Table: If cell width set by CSS as %, and page-break-inside avoid requires a new page, was losing the sizing
635
+ - Table: table borders CSS parsing error; if border-width, border-style, border-color set, not inherited correctly
636
+ - Table: Table background image or gradient not working in HTMLHeader/Footer
637
+ - Table: background color set on table (anywhere) will overwrite image/gradient
638
+ - Table Background image/gradient: If left/right margin is set on table, gradient/image set on table is too wide
639
+ - Table: rotated table - height (after first page does not correctly allow for thead i.e. too much)
640
+ - Table: blank <tr></tr> causes error
641
+ - Table/Letter-spacing: If letter-spacing set inside table, not calculating table width correctly, and if oversized, freezes
642
+ - ToC: ToC at top of page (non-mirrored or already ODD) did not reset page_number if told
643
+ - Character subsititutions: characters missed if first element in a $html code e.g. WriteHTML('Not in a tag &#10003;');
644
+ - Kerning: kerning info: if reading font file for first time (or if not cached in ttfontdata/) did not register kerning info
645
+ - Textarea: multiple new lines run into only one newline
646
+ - QRCode - colors wrong because QRcode class only accepts RGB input (hardcoded now to always give black on white)
647
+ - QRCode always producing "Your message here"
648
+ - Columns: if transforming height of column, not always closing transform Q
649
+ - CakePHP compatibility
650
+ - compress.php - error due to markup comments in mpdf.php script file
651
+
652
+ Backwards compatibility
653
+ -----------------------
654
+ Changes in mPDF 5.2 are backwards compatible with version 5.1
655
+ Your document fonts may appear slightly different in the PDF viewer because of the changes to embedded font subsets (cf.)
656
+ The new Indic fonts may result in a change in spacing (due to the different character width of the space character from the original font)
657
+
658
+ PostScript e.g. GSView/GhostScript
659
+ ----------------------------------
660
+ A number of errors have been reported when opening mPDF-created PDF files with a PostScript programme. Some of the errors were due to mPDF,
661
+ but others were due to peculiarities of GSView/GhostScript.
662
+ - Diacritic Characters were not displayed when embedding a font subset
663
+ - Fonts containing SIP/SMP characters (supplementary Unicode planes) caused errors
664
+ - Error with text justification (word-spacing) when embedding a full font can occur in some fonts*
665
+ The first 2 problems should now be fixed in v5.2
666
+ *The error with text justification can be optionally fixed by setting the configurable variable in config.php:
667
+ $this->repackageTTF = true;
668
+ When mPDF embeds a full font, it simply embeds the whole original TTF file into the PDF document. For some fonts (containing
669
+ a GSUB table) this was causing problems. $this->repackageTTF forces mPDF to repackage the original TTF file excluding some of
670
+ the tables like GSUB.
671
+ (See ADDITIONAL INFO FONTS.txt in downloaded files)
672
+
673
+
674
+ Font appearance in PDF viewer
675
  -----------------------------
676
+ Font subsetting has been improved to include additional information in the embedded file. Overall the effects are of greater clarity
677
+ when viewing the document on a screen (it will not affect print output), but the changes are dependent on:
678
+ - the original TTF font i.e. the options that the font's author has built into the file
679
+ - the PDF viewer i.e. whether the programme chooses to use the available information
680
+ - the resolution (zoom) of the page you are viewing
681
+ (See ADDITIONAL INFO FONTS.txt in downloaded files)
682
+
683
+
684
+ Indic fonts
685
+ -----------
686
+ A new set of Indic fonts (ind_xx_1_001) is distributed with version 5.2 containing the additional font information as described above.
687
+ In addition, some changes have been made to the ASCII characters in the font from the files previously distributed:
688
+ The original files (Raghu font files) do not contain the characters a-z and A-Z. When the first version indic files were created for mPDF,
689
+ ALL of the ASCII characters (32-127) were inserted/overwritten from DejaVuSansCondensed to make the font more usable.
690
+ In the latest version, only the missing characters are taken from DejaVuSansCondensed, leaving punctuation and numerals from the original
691
+ fonts. This also means that the space character has a different width, and this will cause slight changes to the word spacing in documents.
692
+ (See ADDITIONAL INFO FONTS.txt in downloaded files)
693
+
694
+
695
+ CJK line-breaking (text wrapping)
696
+ ---------------------------------
697
+ CJK (chinese-japanese-korean) text often contains no spaces. mPDF previously has wrapped text whenever a character reached the end of
698
+ the line. mPDF version 5.2 attempts to follow the line-breaking rules described for each of the languages. Configurable variables
699
+ allow some control over this behaviour, especially whether to squeeze a character into the space available at the end of a line, or
700
+ whether to allow it to overflow the right margin.
701
+
702
+
703
+ Configurable variables (see config.php file):
704
+ ----------------------
705
+ Control wrapping of CJK text:
706
+ $this->allowCJKorphans = true; // FALSE=always wrap to next line; TRUE=squeeze or overflow
707
+ $this->allowCJKoverflow = false; // FALSE=squeeze; TRUE=overflow (only selected)
708
+ When Embedding full TTF font files, remakes the font file using only core tables
709
+ May improve function with PostScript printers
710
+ $this->repackageTTF = false;
711
+
712
+ Updated files
713
+ -------------
714
+ mpdf.php
715
+ compress.php
716
+ utils/font_dump.php
717
+ classes/ttfontsuni.php
718
+ config.php (3 new variables - see above)
719
+
720
+ All ttfonts/ind_*
721
+ New set of Indic fonts for PostScript compatibilty - and clearer font display
722
+
723
+
724
+
725
+ ===========================
726
+ mPDF v5.1 (27/02/2011)
727
+ ===========================
728
+
729
+ New Features
730
+ ------------
731
+ - CSS background (images, colours or gradients) on <TR> and <TABLE>
732
+ - CSS border on <TR> (only in border-collapsed mode)
733
+ - support for Mozilla and CSS3 gradient syntax:
734
+ -moz-linear-gradient, linear-gradient
735
+ -moz-radial-gradient, radial-gradient
736
+ -moz-repeating-linear-gradient, linear-repeating-gradient
737
+ -moz-repeating-radial-gradient, radial-repeating-gradient
738
+ - expanded support for gradients (including in SVG images):
739
+ - multiple colour 'stops'
740
+ - opacity (transparency)
741
+ - angle and/or position can be specified
742
+ - gradient can be used as an image mask (custom mPDF styles: gradient-mask)
743
+ - image-orientation supported for <IMG> (similar to existing custom mPDF attribute: rotate) [CSS3]
744
+ - image-resolution supported for <IMG> [CSS3]
745
+ - background-image-resolution (custom mPDF CSS-type style) to define resolution of background images
746
+ - improved support for SVG images
747
+ - SVG and WMF images supported in background-image
748
+ - file attachments
749
+ - numeric list-styles added e.g. arabic-indic, bengali, devanagari, persian, thai [CSS3]
750
+ - font kerning supported (inter-character spacing between specific pairs)
751
+ - letter-spacing and word-spacing supported [CSS3]
752
+ - colors supported as rgb(), rgba(), hsl(), hsla(), cmyk(), cmyka(), or spot()
753
+ - spot colors supported e.g PANTONE 310 EC
754
+ - PDF/X compatible files
755
+ - optionally force use of grayscale, RGB or CMYK colorspace
756
+ - automatic colour conversion for most objects between grayscale, RGB and CMYK
757
+
758
+ Backwards compatibility
759
+ -----------------------
760
+ Most changes in mPDF 5.1 are backwards compatible with version 5.0 i.e. your documents should
761
+ look the same running 5.1 However some changes may alter display from previous versions:
762
+ - RTL (right-to-left) languages - see below
763
+ - bleed margins when using @page CSS - see below
764
+ - Default distance for "cross" from inner margin changed 10->5mm [hardcoded in fn. Footer()]
765
+ - If height set on a block element, will force a new page if set-height will not fit on page
766
+ - If table rotated, 5mm margin at bottom is now reduced to 1mm
767
+ - If image is too big for page and automatically sixed to maximum height of page, 10mm margin at bottom reduced to 1mm
768
+
769
+ Colours may appear more vibrant
770
+ -------------------------------
771
+ Unless specifically set, Adobe Reader uses the RGB colorSpace by default when displaying documents. However
772
+ if an image or gradient using transparency (or alpha channel) is included in the document, Adobe Reader
773
+ automatically sets the default colorSpace to CMYK - which makes the colours look less vibrant/bright on screen.
774
+ mPDF 5.1 now specifies by default a colorSpace RGB for each page, and this will maintain the more
775
+ vibrant colours. This is overridden if you use on of the options to restrict the colorSpace (cf.)
776
+
777
+ RTL
778
+ ---
779
+ **** IMPORTANT - PLEASE READ IF USING RTL SCRIPTS ****
780
+ Handling of RTL (right-to-left) languages has been significantly rewritten, and is likely to cause
781
+ changes to the resulting files if you have previously been using mPDF. The changes have made mPDF
782
+ act more like a browser, respecting the HTML/CSS rules.
783
+ Changes include:
784
+ - the document now has a baseline direction; this determines the
785
+ - behaviour of blocks for which text-align has not been specifically set
786
+ - layout of mirrored page-margins, columns, ToC and Indexes, headers and footers
787
+ - base direction can be set by any of:
788
+ - $mpdf->SetDirectionality('rtl');
789
+ - <html dir="rtl" or style="direction: rtl;">
790
+ - <body dir="rtl" or style="direction: rtl;">
791
+ - base direction is an inherited CSS property, so will affect all content, unless...
792
+ - direction can be set for all HTML block elements e.g. <DIV><P><TABLE><UL> etc using
793
+ - CSS property < style="direction: rtl;">
794
+ - direction can only be set on the top-level element of nested lists
795
+ - direction can only be set on <TABLE>, NOT on THEAD, TBODY, TD etc.
796
+ - nested tables CAN have different directions
797
+ - NOTE that block/table margins/paddings are NOT reversed by direction
798
+ NB mPDF <5.1 reversed the margins/paddings for blocks when RTL set.
799
+ - language (either CSS "lang", using Autofont, or through initial set-up e.g. $mpdf = new mPDF('ar') )
800
+ no longer affects direction in any way.
801
+ NB config_cp.php has been changed as a result; any values of "dir" set here are now ineffective
802
+ - default text-align is now as per CSS spec: "a nameless value which is dependent on direction"
803
+ NB default text-align removed in default stylesheet in config.php
804
+ - once text-align is specified, it is respected and inherited
805
+ NB mPDF <5.1 reversed the text-align property for all blocks when RTL set.
806
+ - the configurable value $rtlcss is depracated, as it is no longer required
807
+ - improved algorithm for dtermining text direction
808
+ - english word blocks are handled in text reversal as one block i.e. dir="rtl"
809
+ [arabic text] this will not be reversed [arabic text]
810
+ - arabic numerals 0-9 handled correctly
811
+
812
+ Although the control of direction for block elements is now more configurable, the control of
813
+ text direction (RTL arabic characters) remains fully automatic and unconfigurable.
814
+ <BDO> etc has no effect. Enclosing text in silent tags can sometimes help e.g.
815
+ content<span>[arabic text]</span>content
816
+
817
+ Justified text
818
+ --------------
819
+ Text-align: justify - no longer uses configurable variable $jSpacing= C | W | ''
820
+ The default value is for mixed letter- and word-spacing, set by jSWord and jSmaxChar
821
+ If a line contains a cursive script (RTL or Indic [devanagari, punjabi, bengali]) then it prevents letter-spacing
822
+ for justification on that line - effectively the same as setting letter-spacing:0
823
+ Spacing values have been removed from the config_cp.php configuration file, so the "lang" property
824
+ (in config_cp) no longer determines justification behaviour (this includes the use of Autofont()).
825
+ When using RTL or Indic [devanagari, punjabi, bengali] scripts, you should set CSS letter-spacing:0
826
+ whenever you use text-align:justify.
827
+
828
+
829
+ @page media
830
+ -----------
831
+ When using @page to create a print publication with page-size less than sheet-size
832
+ - bleed margin is now configurable (also crop- and cross-mark margins)
833
+ - backgrounds/gradients/images now use the bleed box as their "container box"
834
+ - odd-header-name: supports the value "_default" - allows current non-HTML header to remain unchanged
835
+ - marks: crop cross; i.e. both together supported
836
+ - background-image-opacity and background-image-resize now work with @page CSS
837
+
838
+
839
+ SVG images - extended support
840
  -----------------------------
841
+ - support for spreadMethod property for gradients (repeat and reflect)
842
+ - support for style="font-family; font-size; font-style; font-weight" i.e. inline CSS
843
+ - when viewPort="" and width="" height="" all specified, uses width to set SVG size of a "pixel"
844
+ - support for opacity and multiple "stops" (and colorspace) in gradients
845
+
846
+
847
+
848
+ Minor Enhancements
849
+ ------------------
850
+ - support for colors as rgb(87%, 56%, 25%) [used especially in SVG]
851
+ - added option of "NoPrintScaling" in SetDisplayPreferences
852
+ - compress.php - now combines BACKGROUND-IMAGES and GRADIENTS as BACKGROUNDS, and added PROGRESS-BAR
853
+ - table with THEAD row will force a new page if no room for the THEAD AND a row from TBODY
854
+ - Small-Caps now works properly together with text-align justify
855
+ - embedded font subsets restructured (minor) for greater compatibility e.g. with Postscript printers
856
+ - PDF/A will convert everything except grayscale to RGB (by default) or CMYK (optionally)
857
+
858
+
859
+
860
+
861
+ Bug fixes
862
+ ---------
863
+ - Display changed to CMYK colour gamut when document contained an object with transparency set.
864
+ Now will retain RGB colorspace (brighter colours)
865
+ - If using dir="rtl", tables containing nested tables were not properly reversed
866
+ - "text-rotate: 0" set in CSS stylesheet did not 'undo' any text-rotate set on the row (TR)
867
+ - Malayalam - character re-ordering
868
+ - If height set on a block element, was not taking account of padding top/bottom
869
+ - embedded font subsets: error in array of Font Widths fixed
870
+ - <style>..</style> containing /* import url() */ the comments were not ignored
871
+ - If call mPDF class more than once, error using multiple barcodes or gif files because classes not reinstantiated
872
+ - Floating blocks were collapsing bottom/top margins - incorrectly
873
+ - Table: if colspan>1 contents are wider than the width of the included columns, did not increase column width(s) to accommodate
874
+ - Resizing table - script hanging and new page forced when not required (still)
875
+ - If a table style="page-break-inside:avoid" not fit on the page, was adding new page before resizing EVEN IF on a blank page
876
+ - End of 2 blocks (e.g. </div></div>) at very bottom of page, forcing unwanted pagebreak
877
+ - Corrected handling of tags inside <pre>
878
+ - RTL left-aligned text - line ending with <br /> not correctly left-aligned
879
+ - <input type=submit|reset etc name="xxx" e.g. Google button showed as I&039;m feeling lucky
880
+ - Annotations all linked to Page 1 (parent object)
881
+ - Error "division by zero" using columns
882
+ - MultiCell() and Write() [direct writing functions] - miscalculating length of line in non-core fonts (+ other bugs)
883
+ - error if CJK space at end or beginning of line with 0x20 spaces in as well
884
+
885
+ Configurable variables (see config.php file):
886
+ ----------------------
887
+ $this->printers_info
888
+ $this->bleedMargin
889
+ $this->crossMarkMargin
890
+ $this->cropMarkMargin
891
+ $this->cropMarkLength
892
+ $this->nonPrintMargin
893
+ $this->restrictColorSpace
894
+ $this->PDFX
895
+ $this->PDFXauto;
896
+ $this->useKerning
897
+ [$this->rtlcss removed]
898
+
899
+ Updated files
900
+ -------------
901
+ mpdf.php
902
+ config.php
903
+ config_cp.php (removed references to dir - but not essential to update - just redundant information)
904
+ compress.php
905
+ includes/out.php
906
+ includes/functions.php
907
+ classes/svg.php
908
+ classes/ttfontsuni.php
909
+ classes/indic.php
910
+ /font/helvetica*.php and /times*.php
911
+
912
+ Added CSS support
913
+ =================
914
+ All Block elements including <BODY> <TABLE> <TR>
915
+ ------------------------------------------------
916
+ background-image-resolution: normal | [ from-image || <dpi> ]
917
+ direction: [ rtl | ltr ] (HTML attribute dir also supported)
918
+ background: [ gradients ]
919
+ background-image: [gradients ]
920
+
921
+ For [ gradients ] syntax see:
922
+ - Mozilla linear - https://developer.mozilla.org/en/CSS/-moz-linear-gradient
923
+ - Mozilla radial - https://developer.mozilla.org/en/CSS/-moz-radial-gradient
924
+ - Mozilla gradients use - https://developer.mozilla.org/en/Using_gradients
925
+ - CSS3 linear gradients - http://dev.w3.org/csswg/css3-images/#linear-gradients
926
+ - CSS3 radial gradients - http://dev.w3.org/csswg/css3-images/#radial-gradients
927
+
928
+
929
+ Almost all elements - block and in-line
930
+ ---------------------------------------
931
+ font-kerning: auto | normal | none // need to set $mpdf->useKerning = true;
932
+ letter-spacing: normal | <length>
933
+ word-spacing: normal | <length>
934
+
935
+ Colours
936
+ -------
937
+ Anywhere that color is specified (e.g. color, background-color, borders)
938
+ - rgb(255,255,255)
939
+ - rgba(255,255,255,1) // last value is transparency (alpha) - between 0-1
940
+ - rgb(100%,100%,100%)
941
+ - hsl(360,100%,100%) // H: 0-360; S/L: 0-100%; a:0-1
942
+ - hsla(360,100%,100%,1)
943
+ - cmyk(100,100,100,100) // or 0-100%
944
+ - spot(COLOR NAME, 100%) // e.g PANTONE 310 EC; use AddSpotColor() to define first
945
+
946
+ <TR>
947
+ border:
948
+
949
+ <TABLE> <TR>
950
+ background:
951
+ background-color:
952
+ background-image:
953
+
954
+ <IMG>
955
+ gradient-mask: [can use any of the gradient syntax]
956
+ image-orientation: <angle> - supports deg, rad or grad
957
+ image-resolution: normal | [ from-image || <dpi> ]
958
+
959
+ <OL|UL>
960
+ list-style: arabic-indic | bengali | devanagari | gujarati | gurmukhi | kannada | malayalam | oriya |
961
+ persian | telugu | thai | urdu | tamil
962
+
963
+
964
+ @page
965
+ marks: [ crop || cross ] - i.e. crop and cross can be used together
966
+ odd-header-name: "_default" - allows current non-HTML header to remain unchanged
967
+ background-image-opacity: [ 0-1 ]
968
+ background-image-resize: [ 1-6 ] - see Manual
969
+
970
+
971
+ ===========================
972
+ mPDF v5.0 (30/09/2010)
973
+ ===========================
974
+
975
+ New Features
976
+ ------------
977
+ - Font handling simplified, reads TrueType font files directly
978
+
979
+
980
+ Minor Enhancements
981
+ ------------------
982
+ - rotation of fixed-position block elements (see example 10 and manual for supported CSS)
983
+ - support for CSS Small-Caps font-variant added
984
+ - utility scripts in /utils/ folder to help font management
985
+ - new simplified functions AddPageByArray() and TOCPageBreakByArray() added
986
+ - progress bar simplified and customisable
987
+ - improved word-wrapping for CJK langauges
988
+ - improved recognition of CJK/Indic/Arabic characters
989
+ - invalid UTF-8 input now outputs a meaningful error by displaying input html with errors marked
990
+ - GIF or PNG images with transparency/interlaced/non-standard compression handled as internal data
991
+ if /tmp/ folder is not present or writeable
992
+ - support for <html dir="rtl">
993
+ - support for "display: none" on inline elements
994
+ - annotations supported in fixed-position block elements
995
+
996
+
997
+ Bug fixes
998
+ ---------
999
+ - <br /> preceded by space does not correctly text-align to right
1000
+ - zero-width character in middle of line caused line-break (e.g. diacritic or U+200C = ZWNJ)
1001
+ - HTML attributes not recognised if spaces e.g. 'src = "..."'
1002
+ - Headers changed for output - problem reported on IE8 64-bit using SSL
1003
+ - using SetAutoPageBreak(false) used caused unexpected behaviour with table rows at page break
1004
+ - (from Beta) incorrect check for temporary font data folder causing errors
1005
+ - artificial Bold/Italic not working in table cell when using rotated text
1006
+ - allow <dottab> to inherit font color correctly
1007
+ - SVG now works with Adobe 7
1008
+ - background in header overwriting text
1009
+ - vertical text in table header not correctly horizontally positioned when repeated
1010
+ - compatibility with PHP >= 4.3 (htmlspecialchars_decode, stripos)
1011
+ - updated depracated script PHP 5.3.0 ($string{1} to $string[1], $var =& new Object(), set_magic_quotes_runtime)
1012
+ - index (CreateIndex) number string incorrect if arabic(rtl) text anywhere in document
1013
+ - MultiCell incorrectly calculate string length/width when using core fonts
1014
+ - page-break-inside:avoid - used with non-HTML footer had space inserted for footer height
1015
+ - page-break-inside:avoid - error if more than 1 page height but not enough to trigger second pagebreak
1016
+ - page-break-inside:avoid - incorrectly layering page backgrounds (headers and content brought forward)
1017
+
1018
+
1019
+ Changes from 5.0 Beta
1020
+ ---------------------
1021
+ If you are upgrading from the Beta version - you MUST delete all files in the /ttfontdata/ temporary directory
1022
+ - config.php file has been changed (extra CJK characters to recognise CJK blocks)
1023
+ - $this->backupSubsFont (in config_fonts.php) optionally now takes an array
1024
+ - no need to define 'cjk'=>true or 'sip|smp'=>true in config_fonts.php (ignored; cf. $this->BMPonly)
1025
+ - Indic language fonts have been altered to add Latin and Latin-1 Supplement characters
1026
+ - progress bars now has an external progbar.css and configurable main heading
1027
+ - added initial parameter new mPDF('+aCJK') or '-aCJK' to override default useAdobeCJK at runtime
1028
+ - QRCode is not included in main download (but as an extra package)
1029
+
1030
+ BACKWARD COMPATIBILITY
1031
+ ----------------------
1032
+ If you have been using earlier versions of mPDF, most scripts should work as before. But note:
1033
+ - Arial, Helvetica, Times and Courier are now treated like any other font
1034
+ - the whole CSS font string is parsed e.g. style="font-family:'Lucida Grande';" will look for a font 'lucidagrande'
1035
+ and not 'lucida'
1036
+
1037
+ Configurable variables (see config.php file):
1038
+ ----------------------
1039
+ - $mpdf->useSubstitutionsMB is now depracated, but will work as an alias for $mpdf->useSubstitutions
1040
+ The initial parameters e.g. new mPDF('utf-8') have all changed. Old ones may be recognised, or will be ignored.
1041
+ - $mpdf->useOnlyCoreFonts is now depracated and is ignored. Use new mPDF('c')
1042
+ - $this->use_CJK_only is now depracated and is ignored. See $this->useAdobeCJK and new mPDF('+aCJK') or '-aCJK'
1043
+ Control SmallCaps appearance
1044
+ - $mpdf->smCapsScale = 0.75; // Factor of 1 to scale capital letters
1045
+ - $mpdf->smCapsStretch = 115; // % to stretch small caps horizontally
1046
+ Customisable Progress bar
1047
+ - $mpdf->progbar_heading = 'mPDF file progress';
1048
+ - $mpdf->progbar_altHTML = '';
1049
+ Control fonts/subsetting
1050
+ - $mpdf->maxTTFFilesize = 2000;
1051
+ - $mpdf->percentSubset = 30;
1052
+ - $mpdf->debugfonts // show font errors and warnings
1053
+ Replaceable alias
1054
+ - $mpdf->iterationCounter = false; // Allow use of {iteration varname} in THEAD
1055
+
1056
+
1057
+ ===========================
1058
+ mPDF v5.0Beta (21/07/2010)
1059
+ ===========================
1060
+
1061
+ New features
1062
+ ------------
1063
+ The main change in mPDF v5 is the handling of TTF and TTC fonts directly.
1064
+ See README.txt and FONT INFO.txt for more information
1065
+
1066
+
1067
+ QR-code (2-dimensional barcode) Added
1068
+ -------------------------------------
1069
+ type="QR"
1070
+ Size=1 is an arbitrary 25mm widthxheight. error="L|M|H|Q"
1071
+ text="" can be numeric, alphanumeric or binary(?)
1072
+ Required whitespace is always included around it
1073
+
1074
+
1075
+ Enhancements
1076
+ ------------
1077
+ - progress-bar is simplified (no javascript class)
1078
+ - dir="rtl" supported in <html> or <body> tag
1079
+
1080
+ Bug fixes
1081
+ ---------
1082
+ - artificial Bold/Italic now working in table cells with rotated text
1083
+ - "-" is now allowed in a font name e.g. sun-exta
1084
+ - <dottab> now inherits font color correctly
1085
+ - SVG class bugs fixed (was crashing in Adobe Reader v 7)
1086
+ - background color/image in header no longer overwrites the header text
1087
+
1088
+ Changed Config variables
1089
+ ------------------------
1090
+ $this->useSubstitutionsMB is depracated
1091
+ Character substitution always occurs when using core fonts.
1092
+ Use $this->useSubstitutions for all cases.
1093
+
1094
+
1095
+ New Configurable variables
1096
+ --------------------------
1097
+ $this->useAdobeCJK = true; // Uses Adobe CJK fonts for CJK languages
1098
+ // default TRUE; only set false if you have defined some available fonts that support CJK
1099
+ // If true this will not stop other CJK fonts if specified by font-family:
1100
+ // and vice versa i.e. only dictates behaviour when specified by lang="" incl. AutoFont()
1101
+
1102
+ // Set maximum size of TTF font file to allow non-subsets - in kB
1103
+ // Used to avoid e.g. Arial Unicode MS (perhaps used for substituteCharsMB) to ever be fully embedded
1104
+ // NB Free serif is 1.5MB, most files are <= 600kB (most 200-400KB)
1105
+ $this->maxTTFFilesize = 2000;
1106
+
1107
+ // If not -s (i.e. forced subset) this value determines whether to subset or not
1108
+ // 0 - 100 = percent characters
1109
+ // i.e. if ==40, mPDF will embed whole font if >40% characters in that font
1110
+ // or embed subset if <40% characters
1111
+ // 0 will force whole file to be embedded
1112
+ // 100 will force always to subset
1113
+ $this->percentSubset = 30;
1114
+
1115
+ $this->debugfonts - show errors and warnings for font parsing
1116
+
1117
+ Config variables removed
1118
+ ------------------------
1119
+ $this->use_CJK_only
1120
+ $this->useOnlyCoreFonts
1121
+
1122
+ ================================================================================
1123
+
1124
+ ====
1125
+ 4.6
1126
+ ====
1127
+
1128
+ mPDF
1129
+
1130
+ files changed:
1131
+ mpdf.php
1132
+ config.php
1133
+ makefonts/makefonts.php
1134
+ class/t1asm.php
1135
+ class/svg.php
1136
+ graph.php
1137
+
1138
+ examples_04 (images)
1139
+
1140
+ config var added:
1141
+ $this->tableMinSizePriority
1142
+
1143
+ 4.5.015
1144
+ Bug fix:
1145
+ Complex page with ToC entries ++ (example_ToC_bug4_5_015.php) caused Apache to crash
1146
+ AdjustHTML() preg_pattern for matching <hx>... </hx> <table for keep-together - altered and fixed ? matching
1147
+ Seemed to crash when content="Graph 12" between the <h> - 2 numbers (12) crash, 1 didn't!!!
1148
+
1149
+
1150
+ 4.5.014
1151
+ Bug fix:
1152
+ Using TrueType fonts, unused font is not embedded in the PDF doc. This was fine except an error message appeared after printing in Adobe Reader,
1153
+ because Font reference /F1 still present in doc pointing to non-existent resource.
1154
+ Edited so that the reference is now removed from the page if font unused.
1155
+
1156
+
1157
+ 4.5.013
1158
+ Enhancement
1159
+ TrueTypeUnicode fonts width array inserted as shortened form array (smaller file size)
1160
+
1161
+ 4.5.012
1162
+ Bug fix: Incorrect handling orphan characters in table
1163
+ (cf. http://mpdf.bpm1.com/forum/comments.php?DiscussionID=193 fixed in 4.2 - but going back to it still problems)
1164
+ If xxxxx. fits but xxxxx.. doesn't: WriteFlowingBlock wraps it to next line, TableWordWrap sqeezed it onto one line
1165
+ TableWordWrap fixed to only allow one orphan char. even if it fits with that one.
1166
+
1167
+
1168
+ 4.5.011
1169
+ Added Windows BMP image support
1170
+
1171
+ 4.5.010
1172
+ SVG class:
1173
+ - improved recognition of lineargradients/radialgradients referenced by xlink:href
1174
+ - does not die if empty text string
1175
+ - support for many text properties as style="" as well as currently as attributes (bold, fill etc)
1176
+ - if using MB font, was respecting "Times" and "Courier" from the SVG file but using as ANSI not utf-8
1177
+
1178
+ 4.5.009
1179
+ graph.php updated to include SVG - need to define in graph.php (as well as set up TTF fonts)
1180
+ (SVG graph does not include CSIM, 3D skew.)
1181
+
1182
+ 4.5.008
1183
+ t1asm.php has an error in the error message if .dat fontfile not found (".char.dat")
1184
+
1185
+ 4.5.007
1186
+ Bug fix: Using page-break-inside:avoid, if nothing would have been printed on page 1 before next page, elements going all over the place!
1187
+ Also problem shifting images - fixed
1188
+ Also wasn't shifting WMF/SVG images - fixed
1189
+
1190
+ 4.5.006
1191
+ New config var
1192
+ $this->tableMinSizePriority = false;
1193
+ If page-break-inside:avoid but cannot fit on full page without
1194
+ exceeding autosize; setting this value to true will force respsect for
1195
+ autosize, and disable the page-break-inside:avoid
1196
+ [NB edit Manual Table>>autolayout algorithm]
1197
+
1198
+
1199
+ 4.5.005
1200
+ Bug fix
1201
+ Table set to avoid page-break-inside: in some circumstances entered loop with recalculating size
1202
+ Fudge factor added of 0.001 in tbsqrt to calculate shrink factor
1203
+
1204
+ 4.5.004
1205
+ Bug fix
1206
+ If table set to avoid page-break-inside and table height (resized) exactly==remaining page - was triggering page break
1207
+ Fudge factor added of 0.001 in tablewrite to query pagebreak
1208
+
1209
+ 4.5.003
1210
+ Bug fix in makefonts/makefonts.php
1211
+ Also changed the links in Step4 & 8 which move the newly created files to the font directory - will now show error message if error -
1212
+ will NOT overwrite existing files. (Put in manual already)
1213
+
1214
+ 4.5.002
1215
+ Bug fix in class/t1asm.php
1216
+ If you have magic_quotes_runtime set On - problems using embedded subset.
1217
+
1218
+ 4.5.001
1219
+ JPG "Exif" file recognised from header, and handled much more quickly and efficiently (not using GD)
1220
+
1221
+
1222
+
1223
+ ===========================
1224
+ mPDF v4.5 (21/04/2010)
1225
+ ===========================
1226
+
1227
+ New Features
1228
+ ------------
1229
+ The main change in 4.5 is the improved class for importing SVG images. (See details below)
1230
+
1231
+ Font files
1232
+ ----------
1233
+ Some bugs in the "makefonts" utility caused some errors in the files produced for embedding font subsets.
1234
+ Surprisingly these are not easily detectable (I have yet to find one!).
1235
+ All the font files used for embedding font subsets (the .dat and .dat.php files in /unifont/ folder)
1236
+ have been re-generated. Download them if you are having problems with any fonts - otherwise, you probably
1237
+ don't need to bother.
1238
+
1239
+ Minor Enhancements
1240
+ ------------------
1241
+ If keepColumns = true (i.e. disable readjustment of column length), mPDF will now reproduce
1242
+ table header/footer rows in each column [4.4.015]
1243
+
1244
+ A number of changes to improve processing time [4.4.012]
1245
+ [Thanks to carlholmberg http://mpdf.bpm1.com/forum/comments.php?DiscussionID=274&page=1#Item_3]
1246
+
1247
+ JPG files with header marked as "progressive DCT-based JPEG" are now supported [4.4.004]
1248
+
1249
+ Configurable variable (config.php) $dpi can be set to vary size interpreted from "px" values in HTML/CSS
1250
+ NB Recommended that $dpi should always be set the same as $img_dpi
1251
+
1252
+ Support added for "ex" as a size value (approximates "ex" as half of font height)
1253
+
1254
+ Configurable variable (config.php) $watermarkImgAlphaBlend will determine how watermark images
1255
+ will blend with underlying objects.
1256
+
1257
+
1258
+ Bug fixes
1259
+ ---------
1260
+ - Make-fonts utility : makefonts/makefonts.php [4.4.016]
1261
+ (All font files have been updated)
1262
+ - Table header of only one column width - not printing right border [4.4.014]
1263
+ - WMF and SVG images not rotating correctly to 90 or -90 degrees [4.4.013]
1264
+ - Using templates, error if imported doc contains templates itself [4.4.001]
1265
+
1266
+
1267
+ Updated Files
1268
+ -------------
1269
+ mpdf.php
1270
+ config.php
1271
+ classes/svg.php
1272
+ makefonts/makefonts.php
1273
+ ALL subset font files (/unifont/ .dat and .dat.php files), and all garuda and norasi files
1274
+
1275
+ New files
1276
+ ---------
1277
+ None
1278
+
1279
+ New config variables
1280
+ --------------------
1281
+ $this->watermarkImgAlphaBlend
1282
+ $this->dpi
1283
+
1284
+ BACKWARD COMPATIBILITY
1285
+ ----------------------
1286
+ All but one changes in mPDF 4.5 are fully backwards compatible.
1287
+ The configurable variable $this->watermarkImgBehind was introduced in v4.4 and was unintentionally set to TRUE
1288
+ In v4.5 this is set to FALSE in the config.php file.
1289
+
1290
+
1291
+ SVG Images
1292
+ ----------
1293
+ [svg.php CHANGED]
1294
+ - Text stroke-width default changed to 1 [4.4.011]
1295
+ - Text stroke - line-join type changed [4.4.010]
1296
+ - Default value for fill changed to "black" [4.4.008]
1297
+ - Bug fixes:
1298
+ * to correct calculation of text-length (and therefore alignment R and C) [4.4.009]
1299
+ * Corrected errors in path implementation esp. quadratic Bezier curves
1300
+ * rounded corners to rectangles - error corrected
1301
+ * Recognition of font-family improved
1302
+ * remove \n (and other non-printable chars) from text
1303
+ * zero length shapes are not output e.g. zero-width rectangle, zero-length line, zero-radius circle
1304
+ - Support added for:
1305
+ * gradient stop offsets and gradientUnits="userSpaceOnUse" [4.4.007]
1306
+ In mpdf.php enabled define inner radius for radial gradients - only used internally by SVG at present
1307
+ * user defined <ENTITY /> cf. 'render-elems-03-t.svg' in SVG Test Suite [4.4.006]
1308
+ * "color" attribute and "currentColor" value for fill and stroke [4.4.005]
1309
+ * fill:url(#...) in a style as well as attribute
1310
+ * xlink:href for gradients
1311
+ * 1.3002e-005 in svg path
1312
+ * text-style changes (e.g. text-anchor) set on <g> element - not just on <text>
1313
+ * fill-rule=evenodd|nozero
1314
+ * dashed lines / stroke-dasharray & stroke-dashoffset
1315
+ * gradientUnits=userSpaceOnUse;
1316
+ * units e.g. 3mm or 14pt in Rectangle, Circle, Ellipse, Line and Text position
1317
+ * transform on <text> element
1318
+ * stroke as well as fill on text
1319
+
1320
+ NB The following are still NOT supported for SVG
1321
+ - filters
1322
+ - <marker>
1323
+ - images
1324
+ - DOM
1325
+ - <pattern>
1326
+ - textlength; lengthadjust; tspan, tref, toap, textPath;
1327
+ - <use ../>
1328
+ - gradient on stroke/text;
1329
+ - <clipPath>
1330
+ - text-underline and strikethrough
1331
+ - text opacity
1332
+ - colors as rgb(87%, 56%, 25%)
1333
+ - rect using units for dimensions
1334
+ - Only uses default spreadMethod = "pad" for gradients
1335
+
1336
+
1337
+
1338
+
1339
+
1340
+ ===========================
1341
+ mPDF v4.4 (24/03/2010)
1342
+ ===========================
1343
+
1344
+ New Features
1345
+ ------------
1346
+ - Support SVG image files (partial)
1347
+ - Rotate images or graphs (by multiples of 90 degrees)
1348
+ - Set opacity (transparency) for background images
1349
+ - Control resizing of background images
1350
+ - Set whether to print watermark images behind or in front of page contents
1351
+ - Reduced memory usage when printing tables (partly configurable)
1352
+ - Option to set path to folder for temporary files
1353
+ - Improved compliance for CSS text-align justify
1354
+ - Increased support for CSS "media"
1355
+ - Improved performance when accessing local image files
1356
+
1357
+
1358
+ Minor Enhancements
1359
+ ------------------
1360
+ - Allows space in output file name e.g. $mpdf->Output('t est.pdf','D'); [4.3.007B]
1361
+ - Header changed in Output to improve compatability with IE6 (affects 'D' and 'I') [4.3.012B]
1362
+ - background-images do not show noimage.jpg if missing [4.3.012D]
1363
+ - simpleTables (which improves performance) now also allows: background-color, -gradient and -image, padding
1364
+ and rotated text to be set for each cell. Only borders are not supported cell-by-cell. [4.3.006]
1365
+
1366
+
1367
+ Bug fixes
1368
+ ---------
1369
+ - Page width not correctly reset when defining default page margins (L/R) by @page [4.3.007C]
1370
+ - Table row <TR> with a background-color, paints the whole row, including the spaces between cells [4.3.005]
1371
+ NB This should have been fixed in [4.2.028] but got left out!
1372
+ - UseSubstitutionsMB causes errors inside <textarea> and <select> so now disabled in these 2 situations [4.3.004]
1373
+ - CSS background: 'none' did not cancel background-image/background-color if it comes later [4.3.002, 4.3.011]
1374
+ - Warning message 'depracated' (as of PHP 5.3) when using Templates [4.3.007]
1375
+ - AutoFont incorrectly altering multibyte characters ending in \xa0 [4.3.012C]
1376
+ - "Initial" default value for border-width changed from 1px to 'medium' e.g. border-top: solid #000000; [4.3.010]
1377
+ - WMF image sometimes inverted [4.3.016]
1378
+
1379
+ Updated Files
1380
+ -------------
1381
+ mpdf.php
1382
+ config.php
1383
+ changelog.txt
1384
+
1385
+
1386
+ New files
1387
+ ---------
1388
+ classes/svg.php
1389
+
1390
+
1391
+ New config variables
1392
+ --------------------
1393
+ $this->justifyB4br=false;
1394
+ $this->CSSselectMedia='print';
1395
+ $this->watermarkImgBehind = false;
1396
+
1397
+ BACKWARD COMPATIBILITY
1398
+ ----------------------
1399
+ All changes are backwards compatible except the handling of some background-images - please see notes below.
1400
+
1401
+
1402
+ Watermark Image z-order
1403
+ -----------------------
1404
+ By default mPDF prints watermarks on top of the page contents to ensure that they are not hidden by backgrounds
1405
+ (especially table cells).
1406
+ You can specify watermark images to be printed behind page contents by setting a configurable variable:
1407
+ $this->watermarkImgBehind = true; // default=false
1408
+ [4.3.018]
1409
+
1410
+
1411
+ Rotating Images and Graphs
1412
+ --------------------------
1413
+ Images or graphs can be rotated (by multiples of 90 degrees) using a custom HTML attribute e.g.
1414
+ <img rotate="90|-90|180" ... />
1415
+ <jpgraph rotate="90" ... />
1416
+ Valid options are: 90|-90|180.
1417
+ Positive values are clockwise.
1418
+ If width is specified e.g. width="3cm" this is applied to the rotated image i.e. will be width 3cm after rotating
1419
+ [4.3.016]
1420
+
1421
+
1422
+ Background Image Opacity
1423
+ ------------------------
1424
+ A custom CSS property "background-image-opacity": is now supported on BODY, DIV+ (block elements) and TD
1425
+ Takes values between 0 and 1.0
1426
+
1427
+
1428
+ Resizing Background Images
1429
+ --------------------------
1430
+ A custom CSS property "background-image-resize": is now supported on BODY, DIV+ (block elements) and TD
1431
+ 0 - No resizing (default)
1432
+ 1 - Shrink-to-fit w (keep aspect ratio)
1433
+ 2 - Shrink-to-fit h (keep aspect ratio)
1434
+ 3 - Shrink-to-fit w and/or h (keep aspect ratio)
1435
+ 4 - Resize-to-fit w (keep aspect ratio)
1436
+ 5 - Resize-to-fit h (keep aspect ratio)
1437
+ 6 - Resize-to-fit w and h
1438
+
1439
+ N.B. Prior to v4.4 background-images were incorrectly constrained to maximum width of the containing block.
1440
+ The default is now to do NO resizing on background-images. Setting "background-image-resize:3" should be used
1441
+ for backwards compatibility.
1442
+ [4.3.015, 4.3.012D]
1443
+
1444
+
1445
+ SVG Image files
1446
+ ---------------
1447
+ SVG image files are now partially supported (but as for WMF - not as background-images).
1448
+ viewBox (preserveAspectRatio is not supported) viewBox="0 0 400 200" width="400" height="200"
1449
+ Takes viewBox in preference to width/height if present on <svg>
1450
+ If neither present, will size to width of page (square) as the containing box.
1451
+ Units are interpreted as pixels if undefined.
1452
+ Doesn't recognise internal CSS <style> elements
1453
+ Gradients only take 2 colours which are taken as stop-offset 0% and 100%
1454
+ [4.3.013 & 4.3.017]
1455
+
1456
+
1457
+ Reduced Memory Usage printing Tables
1458
+ ------------------------------------
1459
+ mPDF uses a lot of memory when processing large tables. Parts of the script have been rewritten to
1460
+ reduce memory consumption when writing tables which use collapsed borders (10-25% saving).
1461
+
1462
+ Memory usage can be reduced further by setting a configurable variable:
1463
+ $this->packTableData = true; // default=false
1464
+ but note that this causes a significant increase in processing time.
1465
+ [4.3.008, 4.3.019, 4.3.014]
1466
+
1467
+
1468
+
1469
+ User-defined path to Temporary folder
1470
+ -------------------------------------
1471
+ mPDF uses a folder to write and store temporary files when processing images. By default this is the
1472
+ [your_path_to_mpdf]/tmp/
1473
+ This is now user-definable by defining the constant _MPDF_TEMP_PATH before including mpdf.php script.
1474
+
1475
+
1476
+ Text Justification
1477
+ ------------------
1478
+ In a justified text block, an inline image, textarea, input, or select causing a new line will now force
1479
+ the previous line to be justified. HR and BR do NOT force justification (as in browsers).
1480
+ For optional compliance of MS Word behaviour, there is a new configurable variable:
1481
+ $this->justifyB4br = false; // Change to true to force justification before a <BR> (as in MS Word)
1482
+ [4.3.003]
1483
+
1484
+
1485
+ CSS support for @media
1486
+ ----------------------
1487
+ Now supports media-dependent CSS styles e.g.
1488
+ @media print {
1489
+ p { color: red; }
1490
+ }
1491
+ as well as
1492
+ <style media="...">...</style> and
1493
+ <link rel="stylesheet" media="print" href="..." />
1494
+ Proper matching of CSS media to select using configurable variable:
1495
+ $this->CSSselectMedia='print'; // default="print" set in config.php : screen, print, or any other CSS @media type (not "all")
1496
+ N.B. $this->disablePrintCSS in now depracated
1497
+ [4.3.001]
1498
+
1499
+
1500
+
1501
+
1502
+ ===========================
1503
+ mPDF v4.3 (28/02/2010)
1504
+ ===========================
1505
+
1506
+ NEW FEATURES
1507
+ ------------
1508
+ - Page (sheet) size can be reset within document (http://mpdf1.com/manual/index.php?tid=436) [4.2.024, 4.2.025]
1509
+ - PDF/A1-b compliant files (http://mpdf1.com/manual/index.php?tid=420)
1510
+ - Improve performance using simpleTables (http://mpdf1.com/manual/index.php?tid=430)
1511
+ - mPDFI incorporated into main mPDF class (http://mpdf1.com/manual/index.php?tid=432)
1512
+ - <dottab> added as custom HTML tag: inserts dots to the following text, which is right-aligned [4.2.031]
1513
+
1514
+ See Example files 38 and 39 for PDFA compliant file and <dottab>
1515
+
1516
+ BACKWARD COMPATIBILITY
1517
+ ----------------------
1518
+ All changes are backwards compatible except the use of mPDFI. You will need to make minor changes to your scripts.
1519
+ See the manual http://mpdf1.com/manual/index.php?tid=432 for details.
1520
+
1521
+ BUG FIXES
1522
+ ---------
1523
+ - When using Table of Contents and not resetting page numbers: HTML headers/footers showed incorrect page number [4.2.020]
1524
+ - Table of Contents: last page not printing page background-color [4.2.023]
1525
+ - Image file with space " " in the file name failing [4.2.016]
1526
+ - Image file path unnecessarily resolved to full URI - changed to use relative path if possible [4.2.029] ***
1527
+ - Table - not calculating height of cell correctly [4.2.015, 4.2.012, 4.2.011, 4.2.009]
1528
+ - Table row breaking after/during cell when image in cell taller than font-height [4.2.008]
1529
+ - When Table row(cell) greater height than the page-height but requiring resizing greater than allowed by autosize - not resizing [4.2.005]
1530
+ - Table cell border not resized correctly [4.2.002]
1531
+ - Table row <TR> with a background-color, paints the whole row, including the spaces between cells [4.2.028] ****
1532
+ - Background-image in HTMLFooter not correctly setting 0,0 origin [4.2.014]
1533
+ - Background-image set as an in-line style not working [4.2.013]
1534
+ - Background-image set in CSS @page or <body> was being constrained to less than page size [4.2.032]
1535
+ - Imported Templates overwriting Headers (with images or gradients) [4.2.004]
1536
+ - When using imports/templates, HTML header with background-image causing page to disappear [4.2.001]
1537
+ - block-style element breaking over more than 2 pages incorrectly adjusting L/R margins [4.2.022]
1538
+ - CSS @page property "size" set on :left :right or :first pseudo-selectors - disabled [4.2.022]
1539
+ - Annotations default colour incorrectly set in PDF as [100 100 0] corrected to [1 1 0] (seemed to work ok?) [4.2.026]
1540
+ - Overwrite() now parses input file more tolerantly recognising more source files [4.2.030]
1541
+
1542
+ **** Bug fix 4.2.028 never got into the release of v4.3 Included in next release [4.3.005]
1543
+ **** Bug fix 4.2.029 never not fully implmented in v4.3 Included in next release [4.3.012]
1544
+
1545
+ Changed files
1546
+ -------------
1547
+ mpdf.php
1548
+ compress.php
1549
+ config.php
1550
+ classes/t1asm.php
1551
+ includes/functions.php
1552
+ mpdfi/fpdi_pdf_parser.php
1553
+ Added files/folder: /mpdfi/filters/*.*
1554
+ Added file/folder: /iccprofiles/sRGB_IEC61966-2-1.icc
1555
+ mpdfi/mpdfi.php (no longer required)
1556
+
1557
+ New Configuration variables
1558
+ ---------------------------
1559
+ [config.php]
1560
+ $this->enableImports
1561
+ $this->simpleTables
1562
+ $this->PDFA
1563
+ $this->ICCProfile
1564
+ $this->PDFAauto
1565
+
1566
+
1567
+ Minor changes
1568
+ -------------
1569
+ Increased PDF file compatibility with spec 1.4
1570
+ - PDF version changed to 1.4
1571
+ - A binary file marker (a comment line with 4 characters > 127 ASCII) is added just after the first line
1572
+ - %%EOF no longer has line break after it [4.2.010]
1573
+ - /ID object is added to trailer object when not encrypted [4.2.010]
1574
+
1575
+ When using progress bars, one of the JS scripts is now referenced as an external file
1576
+ to allow it to be cached by user's browser and improve performance for end-user [4.2.007]
1577
+
1578
+ Importing external PDF files: LZW encoded PDF files are now supported
1579
+
1580
+ When adding an annotation, the popup window can be set be either open or closed when the document is opened [4.2.027]
1581
+ - size and position of the popup can also be specified
1582
+
1583
+
1584
+
1585
+ ===========================
1586
+ mPDF v4.2 (27/01/2010)
1587
+ ===========================
1588
+
1589
+ NEW FEATURES
1590
+ ------------
1591
+ - image handling improved
1592
+ - table layout - additional control over resizing
1593
+ - vertical-alignment of images - better support for all CSS types
1594
+ - top and bottom margins collapse between block elements
1595
+ - improved support for CSS line-height
1596
+ - display progress bar whilst generating file
1597
+ - CSS @page selector can be specified when adding a pagebreak
1598
+ - CSS @page selector allows different margins, backgrounds, headers/footers on :first :left and :right pages
1599
+ - PNG images with alpha channel fully supported
1600
+ - ability to generate italic and bold font variants from base font file
1601
+ - CJK fonts to embed as subsets
1602
+ - "double" border on block elements
1603
+ - character substitution for missing characters in UTF-8 fonts
1604
+ - direct passing of dynamically produced image data
1605
+ - background-gradient and background-image can now co-exist
1606
+
1607
+
1608
+
1609
+ Bug fixes
1610
+ ---------
1611
+ - empty variable (undefined var, false, null, array() etc.) sent to WriteHTML produced error message "Invalid UTF-8"
1612
+ - CJK in tables when not using CJK (utf-8-s) autosized very small as characters did not word-wrap
1613
+ - parsing stylesheets: background image not recognised if containbed uppercase characters in file name
1614
+ - "double" border on table used white between the lines instead of current background colour
1615
+ - $this->shrink_tables_to_fit = 0 or false caused fatal errors
1616
+ - background color or images not printing correctly when breaking across pages
1617
+ - background not printed for List inside a block element
1618
+ - columns starting near end of page with no room for a line triggering column change (resulting in text misplaced) not page break
1619
+ - table cell not calculating cell height correctly when "orphan" characters (;:,.?! etc.) at end of line
1620
+ - table breaking page in column 2 when col 1 is rowspan'ned
1621
+ - margin-collapse at top of page not working if bookmark/annotation/indexentry/toc
1622
+ - column break triggered by HR triggering a second column break
1623
+ - an empty 'position:fixed' element with no/auto width or height caused fatal error
1624
+ - mPDFI: template documents were overwriting HTML headers
1625
+ - mPDFI: function Overwrite (to change text in existing PDF) - fatal error if using with encrypted file
1626
+
1627
+ Bug - not fixed
1628
+ - WriteHTML('',2) with '2' parameter not recognising 'margin-collapse:collapse' for DIVs or 'line-height' set in default CSS 'BODY'
1629
+
1630
+
1631
+
1632
+ New or Updated Files
1633
+ --------------------
1634
+ mpdf.php
1635
+ compress.php
1636
+ config.php
1637
+ config_cp.php
1638
+ config_fonts.php
1639
+ mpdf.css
1640
+ classes/gif.php
1641
+ classes/indic.php
1642
+ includes/subs_core.php
1643
+ mpdfi/mpdfi.php
1644
+ unifont/ar_k_001.uni2gn.php
1645
+ All files in new folder: /progress/*.*
1646
+
1647
+ NEW FOLDER /tmp/ required with read/write permissions - used for temporary image files or progress bars
1648
+
1649
+
1650
+
1651
+
1652
+ ===========================
1653
+ mPDF v4.1.1 (21/12/2009)
1654
+ ===========================
1655
+ Error corrected in /makefont/makefonts.php file (moved completed Unicode files to font folder instead of unifont)
1656
+
1657
+ ===========================
1658
+ mPDF v4.1 (20/12/2009)
1659
+ ===========================
1660
+ MySQL support for embedded font subsets abandoned, and replaced with file-based.
1661
+
1662
+
1663
+ Files no longer required
1664
+ ------------------------
1665
+ config_db.php
1666
+ /unifont/RUNME.php
1667
+ /unifont/*.ufm and /unifont/*.t1a font files
1668
+
1669
+ MySQL Database no longer required
1670
+
1671
+ Files Updated
1672
+ -------------
1673
+ mpdf.php
1674
+ /classes/t1asm.php
1675
+ /makefont/makefonts.php
1676
+
1677
+ New files
1678
+ ---------
1679
+ /unifont/*.dat and /unifont/*.dat.php font files
1680
+
1681
+
1682
+ Bug-fixes
1683
+ ---------
1684
+ - Image - If automatically resizing to fit maximum page size incorrectly subtracted margin-header
1685
+ - Annotation and textarea in same HTML chunk causes mPDF to crash (preg_replace textarea with /u modifier in AdjustHTML)
1686
+ - set_magic_quotes_runtime error ($mgr not $mqr)
1687
+ - Table align did not reverse when using RTL document
1688
+
1689
+ Alteration: Image - if writing Image in fixedpos div position:absolute - to allow Image to be resized to full page size
1690
+
1691
+
1692
+ ===========================
1693
+ mPDF v4.0 (17/12/2009)
1694
+ ===========================
1695
+
1696
+ Major additions
1697
+ ---------------
1698
+ - Ability to embed font subsets (creating much smaller files)
1699
+ - Much improved support for Arabic languages
1700
+ - Support for Indic languages including consonant conjuncts
1701
+ - Support for Fixed position block elements
1702
+ - New utility to help create your own fonts
1703
+ - PNG alpha channel transparency supported
1704
+ - New utility to create smaller mpdf script with reduced functionality (less memory)
1705
+ - Multiple Barcode types supported
1706
+
1707
+ **********************************************************************************************
1708
+ * For more details see the documentation manual: http://mpdf1.com/manual/index.php?tid=410 *
1709
+ **********************************************************************************************
1710
+
1711
+ Bug fixes (parsing CSS)
1712
+ -----------------------
1713
+ - <link href="" ... was not recognised if > 1 space between words
1714
+ - #Content p em { font-style:italic; } was applied to "#Content p"
1715
+ - @import url() embedded in a stylesheet file requires path fixed relative to stylesheet file
1716
+ - background-image url() embedded in a stylesheet file requires path fixed relative to stylesheet file
1717
+ - comment tags inside CSS <style> embedded in the HTML were removed
1718
+ Now fixed so <style><!-- ... --></style> works; <!-- <style>...</style> --> is removed
1719
+
1720
+ Bug fixes (other)
1721
+ -----------------
1722
+ - clear (CSS property for floating elements) caused properties for that element to reset to defaults
1723
+ - width: auto caused collapse of border and padding on L & R of ordinary block elements
1724
+ - text-indent not inherited correctly (including em and % values)
1725
+ - named colour "steelblue" corrected RRGGBB hex code
1726
+ - table cell widths in %: if width of table cells set to >=100%, and not all columns are set
1727
+ This was fixed in 3.2 but led to problem where 2 cols: 1) 80% and 2) not set (see Table sizing test)
1728
+ Now fixed again to work for both(?)
1729
+ - parse PNG error fixed
1730
+ - bachground-image not correctly positioned in HTMLFooter and HTMLHeader (Not fixed properly in 3.2!)
1731
+ - fonts not supported with 0-9 in the name
1732
+ - font list in GetCodepage() in htmltoolkit.php (now config_cp.php) containing space " " not recognised
1733
+ - list number positioning
1734
+ - list font size set in CSS for UL/OL not working for first level list
1735
+ - table width (real value, not %) not working in nested table
1736
+ - GIF file failed if PDF file not compressed
1737
+ - list-style-type incorrectly inherited
1738
+ - line-height inheritance in lists
1739
+ - SetColumns added a new line - not required if at start of document/page
1740
+ - footer_line_spacing did not work
1741
+ - table cellPadding="" overwrote cell padding set on cell CSS
1742
+ - could not turn off Default non-HTML foter LINE
1743
+ - border specified as "em"
1744
+ - default values set in mpdf.css overriden by inherited properties e.g. <div><h1>Here</h1></div> lost font-size for H1
1745
+
1746
+
1747
+
1748
+ ===========================
1749
+ mPDF v3.2 (25/10/2009)
1750
+ ===========================
1751
+ Bug fixes
1752
+ ---------
1753
+ - Table cell widths in %: if width of table cells set to >=100%, and not all columns are set -> froze, because tries to produce a column of no width
1754
+ - Ouput download file changed to allow compatability with IE6 (http://mpdf.bpm1.com/forum/comments.php?DiscussionID=120&page=1#Item_4)
1755
+ - Image error if relative path used on domain root (e.g. img src="image.png" and basepath is http://www.yourdomain.com) [attempted fix in 3.1 not working]
1756
+ - Table: if font changed in cell, font was not retoring properly afterwards causing errors (restoreInlineProperties())
1757
+ - Lists: list items containing <br />, font not restoring after bullet
1758
+ - Graceful support for block elements inside list items e.g. <li><p>... (not supported, but tolerated)
1759
+ - Index: Created dividing letters separately for Uppercase and lowercase
1760
+ - Incorrectly changing input character set when encountering e.g. charset=iso-8859-1 in the text of the document
1761
+ - Changed so only detects it if within <head>...</head>
1762
+ - If Keep-with-table (i.e. H1-6 before table and use_kwt true), if pagebreak forced anyway, borders did not print on previous page
1763
+ - Background-image used in HTML footer not appearing (correctly)
1764
+ - RTL tables: nested tables will not automatically transpose L->R
1765
+ - "Keep heading with table" - changed to allow <h1 style=".."> not just <h1>
1766
+ - "Keep heading with table" - backgrounds (bgcolor, image or gradient) incorrectly handled - now removed
1767
+ - Rotated table spread over more than 1 page caused enclosing block background colours to be be rotated along with table
1768
+ - CSS text-indent % now correctly suported (% of containing block width)
1769
+ - CSS width em on a block element e.g. DIV now correctly suported
1770
+ - calculating _tableheight, if remainingpage==0, get error (div by zero)
1771
+ - Table moved to next page with page-break-inside=avoid, produced an enlarged table (font)
1772
+ - RTL text-align override on BODY text was not working consistently
1773
+ - Arab characters: Character &#x647; (HEH) appearing in Final presentation form instead of Isolated
1774
+ - Vertical position of background-image on whole page incorrect
1775
+ - SetProtection can now be used with no permissions set (was not working unless at least one permission set)
1776
+
1777
+
1778
+ Developers
1779
+ ----------
1780
+ Some more undefined indexes and variables declared (courtesy of DSmart http://mpdf.bpm1.com/forum/comments.php?DiscussionID=117&page=1#Item_0 )
1781
+ Comment lines removed for < v3.0 to tidy up code
1782
+
1783
+
1784
+ Enhancements
1785
+ ------------
1786
+ CSS style height now partially supported on block elements DIV, P, H1 etc. --IF--
1787
+ - block is all on one page
1788
+ - will extend the block but not shorten it
1789
+ - will not force a pagebreak (max. at bottom of page)
1790
+ - % is interpreted as % of printable page height (inside margins)
1791
+ <TFOOT> now supported (placed at start as in HTML spec) displays at end of table, and repeats as a footer
1792
+ Background-image and background-gradient now supported in TD and TH (works in all cases except: background-image is not rotated or
1793
+ positioned correctly if table is rotated)
1794
+ NB Background images and background-gradients do not work if Columns are being used, or if $use_kwt is TRUE (keep-with-table),
1795
+ or if page-break-inside:avoid is active.
1796
+
1797
+
1798
+ Updated files
1799
+ -------------
1800
+ mpdf.php
1801
+ htmltoolkit.php
1802
+
1803
+
1804
+
1805
+
1806
+ ===========================
1807
+ mPDF v3.1 (30/08/2009)
1808
+ ===========================
1809
+
1810
+ Bug fixes
1811
+ ---------
1812
+ - Image error if relative path used on domain root (e.g. img src="image.png" and basepath is http://www.yourdomain.com
1813
+ was giving http://www.yourdomain.com//image.png) [3.1]
1814
+ - Errors in parsing background CSS (background-repeat, background-position etc) [3.1]
1815
+ - Textarea did not corectly convert width or height in units relating to font e.g. em [3.0beta_01]
1816
+ - If page margin-bottom set to zero, SetHTMLfooter() crashes with "Division by zero" error [3.0beta_01]
1817
+ - Table with header row and rowspan in tbody, not calculating maxrowheightcorrectly
1818
+ - Prevent Index breaking column just after a dividing letter
1819
+ - Select or input form field when text around it is justified had text in the form field justified
1820
+ - TocBookMarkText needs to be htmlspecialchar-ed - decoded when entered inside <tocpagebreak>
1821
+ - <img src="" /> caused crash
1822
+ - DisplayPreferences used as a variable name and a function: function renamed to SetDisplayPreferences()
1823
+ - Image with src file not including a "." incorrectly parsed (e.g. http://www.domain.com/imagegenerator?params=23)
1824
+
1825
+ New Features
1826
+ ------------
1827
+ - var $debug (true|false) default false; show or hide error reporting at output stage [3.1]
1828
+ - var $autoPageBreak (true|false) default true; allows overriding of automatic page breaks [3.0beta_02]
1829
+ - <indexinsert /> HTML equivalent of CreateIndex() [was CreateReference()]
1830
+ - 2nd attribute/parameter "xref" in IndexEntry() and <indexentry> - works like IndexEntrySee() as cross-reference entry
1831
+ - function SetWatermarkText allows null parameters to be passed i.e. SetWatermarkText() - will clear the WatermarkText
1832
+ - <watermarktext content="" alpha="" /> - HTML equivalent of SetWatermarkText()
1833
+ - <watermarkimage src="" alpha="" position="" size="" /> - HTML equivalent of SetWatermarkImage()
1834
+
1835
+ Documentation
1836
+ -------------
1837
+ See Manual at http://mpdf.bpm1.com/manual/ for more information - especially:
1838
+ - User's Guide>>What Else Can I Do?>>Backgrounds & Borders
1839
+ - User's Guide>>What Else Can I Do?>>Floating blocks
1840
+
1841
+ Files updated:
1842
+ -------------
1843
+ mpdf.php
1844
+ htmltoolkit.php
1845
+ graph.php
1846
+
1847
+
1848
+ Developers only
1849
+ ---------------
1850
+ mPDF<=3.1 generated a large number of warning "Notices" if run with full eror_reporting on, due to array indexes not being initiated e.g.
1851
+ $arr = array();
1852
+ ...
1853
+ if ($arr['index'] == 5 ) {...}
1854
+
1855
+ To prevent this, lines were added at the start of the mpdf.php script to turn error notices OFF.
1856
+ In a move towards making mPDF able to run with full error_reporting on, a large amount of the script has been altered
1857
+ e.g. the line above would be changed to:
1858
+ if (isset($arr['index'] && $arr['index'] == 5 ) {...}
1859
+
1860
+ Although I have tested this with a number of examples, it is almost certainly not complete. Therefore the error_reporting for Notices is still turned
1861
+ off in mPDF 3.1
1862
+ If you care to test it, please uncomment line 43 (//error_reporting(E_ALL);) and report any warning notices that you get.
1863
+ NB This has added about 40kB to the script size.
1864
+
1865
+
1866
+
1867
+ ===========================
1868
+ mPDF v3.0beta (14/06/2009)
1869
+ ===========================
1870
+
1871
+
1872
+ New Features
1873
+ ------------
1874
+ - CSS "float" partially supported (as well as clear:left|right|both)
1875
+ - CSS "background-image" "background-position" "background-repeat" "background-color" "background" supported for block-level elements
1876
+ - CSS background-color and background-image for <body > element added: this covers the whole page i.e. not just inside the "margins"
1877
+ - CSS background-color and background-image can be defined for CSS @page{}
1878
+ - Background gradients (linear or radial) can be defined using a custom CSS style property
1879
+ - Border radius can be defined to give rounded edges to block elements (uses draft CSS3 spec.)
1880
+ - page number can be reset to any value during the document (in AddPage() <pagebreak> etc.)
1881
+ - PNG images: Interlaced and alpha-channel-set PNG images now supported
1882
+ - internal links supported in Indexes (parameter added to CreateIndex()/CreateReference(): $useLinking=true;)
1883
+ - HTML Headers and footers now support hyperlinks
1884
+ - improved handling of <br>, block elements, and text lines inside table - approximates better to browser handling
1885
+ - borders of block-level elements & table cell borders supported (partially) in columns
1886
+ - optional error reporting for problems with Images ($showImageErrors)
1887
+ - ToC will word-wrap long entries
1888
+ - internal links (Bookmarks, IndexEntry and ToCEntry) rewritten to give more accurate positioning (when used as <tag>)
1889
+ - autofont algorithm improved for CJK languages
1890
+ - define text before and after page numbers ($pagenumPrefix; $pagenumSuffix; $nbpgPrefix; $nbpgSuffix;)
1891
+ - Additional color names supported - full list from SVG1.0
1892
+
1893
+ Bug fixes
1894
+ ---------
1895
+ - Column width not resetting after an automatic pagebreak, or after setting HTMLheader
1896
+ - using AutoFont unnecssarily changed htmlspecialchars to code causing errors
1897
+ - Lists inside a table - incorrectly calculating table cell height
1898
+ - CJK - 4-byte utf-8 chars not displaying properly (includes HKCS characters)
1899
+ - mailto: links incorrectly handled
1900
+ - TOCpagebreak() - usePaging default clarified: true unless specified as '', 0, '0' or false; (null ->true)
1901
+ - <tocpagebreak> (as html tag) with no "name" defined, used at start of page, added a further blank page(s)
1902
+ - Lists - inaccurate calculation of space required for numbers in certain circumstances
1903
+ - Generated images (.php) only working if cURL enabled - (fixed, but rquires allow_url_fopen if remote file)
1904
+ - flag added to turn off error reporting when buffering used ($allow_output_buffering = false;)
1905
+ - RTL text in Bookmark, Title, Author, Creator, Keywords, and Subject was reversed - Adobe Reader 9 now correctly handles RTL text ( which Reader 8 did not)
1906
+ - TOC - if not using ODD/EVEN paging, did not add extra page and messed up
1907
+ - Rotated table which did not fit on remaining page resized to bigger than default
1908
+ - HR of width less than 100% - text continued on line after it
1909
+ - HR alignment not working (fixed so both CSS text-align and margin: 0 0 0 auto etc work)
1910
+ - HR in table did not correctly re-size when necessary
1911
+ - characters in symbols/zapfdingbats which in non-utf-8 mode are represented as chr(173) incorrectly handled as soft-hyphens
1912
+ (bug introduced 2.5 with soft-hyphens - affects symbols &#8593; arrow-up and Zapfdingbats &#9313; encircled 2)
1913
+ - Internal links (anchors) - Annotation/Bookmarks etc. incorrectly positioned when page orientation changed
1914
+ - ToC - when using multiple ToCs, internal links were not correctly adjusted
1915
+ - anchor (a name="") used inside a table was incorrectly positioned at the end of table
1916
+ - Tables: cell height calculated incorrectly when BR used
1917
+ - Table rotated with "page-break-inside:avoid" not kept on one page
1918
+ - Table rotated and split over > 1 page - vertical alignment inaccurate
1919
+ - Headers/Footers (non_html) when no style set caused errors
1920
+ - Table: breaking page when using rowspan error (line 17142)
1921
+ - ToC: If no indent defined in HTML tag <tocpagebreak> or defined as 0 gave error
1922
+
1923
+ Note
1924
+ ----
1925
+ In mPDF 3.0 the following sections of code have been significantly rewritten:
1926
+ - painting of borders and background colours for block-elements
1927
+ - table of contents
1928
+ - Index
1929
+ - vertical justification in columns (uses scaling to stretch vertically)
1930
+
1931
+ NB changed htmltoolkit AdjustHTML - does not now remove <br> before </div>
1932
+ Warning - may display differently in normal text as well as tables
1933
+
1934
+
1935
+ Files updated:
1936
+ -------------
1937
+ mpdf.php
1938
+ htmltoolkit.php
1939
+
1940
+
1941
+ Developers only
1942
+ ---------------
1943
+ - Background-color handling in CSS changed so only inherited/cascaded when Columns active or Keep-block-together
1944
+ - otherwise would overwrite background image with inherited color
1945
+ - all %.2f used in sprintf() changed to %.3f in htmltoolkit.php and mpdf.php to increase accuracy of div border lines in columns etc.
1946
+ - variable $use_embeddedfonts_1252 renamed to $useOnlyCoreFonts as more precise: depracated but still supported.
1947
+ - this version included quite abit of tidying up/future-proofing some code:
1948
+ $var{0} changed to substr($var,0,1) etc. (due to go in PHP6)
1949
+ ereg_ changed to preg_ (depracated in PHP5.3) - (NB mainly in htmltoolkit.php)
1950
+
1951
+
1952
+
1953
+ ===========================
1954
+ mPDF v2.5 (01/05/2009)
1955
+ ===========================
1956
+
1957
+ New Features
1958
+ ------------
1959
+ - Automatic Hyphenation added, and support for soft-hyphens
1960
+ - Encryption works now for CJK language documents
1961
+ - Improved text justification
1962
+ - Support for 'generated' images e.g. "../ontheflyimage.php"
1963
+
1964
+
1965
+ Bug fixes
1966
+ ---------
1967
+ - Tables: cell height did not reduce if font-size used was smaller than table default
1968
+ - Columns: if setcolumns() to the same number already active - did not print out last bit of previous columns
1969
+ - Page-break in the middle of a block caused incorrect margin and padding on next lines until end of block ($cMargin reset to 0 in AddPage)
1970
+ - <HR> in table cell was printing in incorrect position (bug introduced in mPDF 2.4)
1971
+ - Justification
1972
+ - if only one word on line, did not respect maximum character spacing
1973
+ - last character of line incorrectly had character spacing applied
1974
+ - Space at the end of last line of a Right Justify block - e.g. "end. </p>" now correctly ignored
1975
+ - &nbsp; incorrectly treated as a character when justifying text with word/char spacing
1976
+ - CJK punctuation (.,) added as 'orphans' to keep at end of line
1977
+ - PNG files - was still buggy reading larger PNG files (due to fread)
1978
+
1979
+
1980
+ Files updated:
1981
+ -------------
1982
+ mpdf.php
1983
+ htmltoolkit.php
1984
+ CJKdata.php
1985
+ /patterns/.. (new files)
1986
+
1987
+
1988
+ Developers only
1989
+ ---------------
1990
+ Variables renamed as more accurate or appropriate:
1991
+ - var $isunicode renamed as $is_MB
1992
+ - var $usingembeddedfonts renamed as $usingCoreFont
1993
+ CJK changed to act internally as UTF-8 encoded
1994
+ - (NB CJK Half-widths not supported from 2.5+ i.e. big5-hw gb-hw)
1995
+
1996
+
1997
+
1998
+ ===========================
1999
+ mPDF v2.4 (23/04/2009)
2000
+ ===========================
2001
+ Files updated
2002
+ -------------
2003
+ mpdf.php
2004
+ htmltoolkit.php
2005
+ mpdfi/mpdfi.php
2006
+
2007
+ New files
2008
+ ---------
2009
+ graph.php
2010
+ Graphs - Requires new folder: path_to_mpdf/graph_cache/ (must be writeable)
2011
+
2012
+ New features
2013
+ ------------
2014
+ Annotations improved so they appear as a pop-up
2015
+ Re-use Document Templates (cf. RestartDocTemplate() in manual)
2016
+ Limited support for CSS float property on an IMG element allowing text wrapping e.g. <img style="float: right;"> (cf. Images in manual)
2017
+ Utility function PreparePreText() allows output of a text file which may include <pre>
2018
+ Automatic generation of graphs from data in tables (requires integration with JPGraph) (cf. Graphs in manual)
2019
+
2020
+ Other Changes
2021
+ -------------
2022
+ IMPORTANT - User rights removed as not working with newer version of Adobe Reader 9 (affects Active forms and ability for users to modify annotations)
2023
+ Corrects text alignment when using {nb} or {nbpg} in (non-HTML) headers/footers
2024
+ Sets default timezone if not already set (at top of mpdf.php) to prevent E_STRICT ERROR message
2025
+ Suppresses E_NOTICE error reporting (at top of mpdf.php)
2026
+ Error capture in Output() to avoid PDF header being sent when error messages generated
2027
+ A function str_ireplace added to htmltoolkit to allow PHP4 to function
2028
+
2029
+ Bug fixes
2030
+ ---------
2031
+ WMF images incorrectly positioned when in-line
2032
+ PNG images > 8kB failed to load - (fix in 2.3 didn't work - fixed properly this time)
2033
+ Annotations containing a new line (\n) causing an error
2034
+ Evaluation of <pre> text: "<code>[TAB] " evaluated incorrect number of spaces to follow to align tabs, because < was calculated as 4 chars (&lt;)
2035
+
2036
+
2037
+
2038
+ ===========================
2039
+ mPDF v2.3 (22/03/2009)
2040
+ ===========================
2041
+
2042
+ New Features
2043
+ ------------
2044
+ - Optionally detect language and when to use special fonts i.e. RTL (arabic), CJK (chinese), Thai (see SetAutoFont() etc.)
2045
+ - Supports HTML attribute "lang" in all tags and uses special fonts when required (see $useLang)
2046
+ - Joins Arabic and Farsi/Persian text into presentation forms
2047
+ - Import another PDF file and use as templates in your document (see UseTemplate() and mPDFI in the manual.)
2048
+ - Replace specified text strings in an existing PDF file (see OverWrite() etc.)
2049
+ - More than one Table of Contents can be used in a document (see tocpagebreak etc.)
2050
+ - Restore properties of open HTML block elements after a page break (variable $restoreBlockPagebreaks or new tag <formfeed>)
2051
+ - <annotation> <bookmark> <indexentry> <tocentry> can now accept characters <>'"& as htmlentities - htmlspecialchars(..., ENT_QUOTES)
2052
+ - <annotation> can now accept "\n" for new line
2053
+ - support for opacity (CSS3 property) for images
2054
+ - specify the number of spaces to substitute for TAB when parsing <pre> tags
2055
+ - greater control over margins and display when changing page orientation during document (see $forcePortraitMargins and $displayDefaultOrientation)
2056
+
2057
+
2058
+
2059
+ Bug fixes
2060
+ ---------
2061
+ Fonts in CSS - Not parsing font-family: Trebuchet MS; correctly as trebuchet
2062
+ Fonts in CSS - CSS font-family: [unknown]; setting first $available_unifont rather than ignoring
2063
+ Images - not displaying on IIS platform
2064
+ Images - .wmf not displaying if (allow_url_fopen) not set
2065
+ Table borders - in defaultCSS, 'MARGIN-COLLAPSE'=> collapase not quoted therefore not working
2066
+ Line-break inside table - printing a blank background across page rather than just going down a line
2067
+ Form fields inside tables - will now resize if the table is autosized (shrunk)
2068
+ <pre> containing a '<' was changed to '&lt;'
2069
+ Tabs inside <pre> were all changed to 8 spaces, not the remainder following a string
2070
+ Header on first page was inset by 1mm left and right ($cMarginL and $cMarginR not set to zero)
2071
+ Table nested inside a cell with colspan > 1 was incorrectly handled
2072
+ PNG file crashed (?incorrectly defined PNG file) [adapted _parsepng to account for unexpected]
2073
+ Table or Cell - if font-size not recognised, mPDF set font-size to zero
2074
+ Font-sizes - [xx-small|x-small|small|medium|large|x-large|xx-large] were not recognised in tables
2075
+
2076
+
2077
+ ===========================
2078
+ mPDF v2.2.1 (17/02/2009)
2079
+ ===========================
2080
+ Bug fix - (bug introduced in 2.2)
2081
+ Table - header row did not return to top of page when repeating across pages.
2082
+
2083
+
2084
+ ===========================
2085
+ mPDF v2.2 (15/02/2009)
2086
+ ===========================
2087
+ Updated files from mPDF 2.1
2088
+ mpdf.php
2089
+ htmltoolkit.php
2090
+ mpdf.css (new)
2091
+ ===========================
2092
+ New files from mPDF <2.0 (only required for EAN Barcodes)
2093
+ font/ocrb.xx (several)
2094
+ unifont/ocrb.xx (several)
2095
+ IMPORTANT - you need to make sure the ocrb font is added to the config.php file
2096
+ - add 'ocrb' to the end of 3 arrays: $this->available_fonts $this->available_unifonts and $this->mono_fonts
2097
+ ===========================
2098
+
2099
+ Summary of changes
2100
+ - external stylesheet file (mpdf.css) is used to configure default values ($useDefaultCSS2 and $defaultCSS2 are no longer used)
2101
+ - special comment tags to hide mPDF tags from browsers: <!--mpdf ... mpdf-->
2102
+ - AddColumn() function added (equivalent to <columnbreak>)
2103
+ - annotations - pop-up messages the reader can move or delete (if you set permissions)
2104
+ - support for WMF images as well as GIF, JPG, PNG
2105
+ - watermark image can be set instead of, or as well as text
2106
+ - nested tables can include other content
2107
+ - improved control over table layout
2108
+ - margin: auto now supported for table and block elements
2109
+
2110
+ A number of methods and variables have been renamed or reCapitalised for consistency.
2111
+ Changes should be backwards comaptible.
2112
+ All user methods start with a Capital, all user-defined variables start with lowercase.
2113
+ Affected:
2114
+ Reference() -> IndexEntry()
2115
+ CreateReference() -> CreateIndex()
2116
+ $TopicIsUnvalidated -> $showWatermark
2117
+ setUnvalidatedText() -> SetWatermarkText()
2118
+
2119
+ PHP appears at present to be case-insensitive for function/method names
2120
+ All the following functions have been renamed in the script with a capital first letter:
2121
+ setUserRights()
2122
+ setBasePath()
2123
+ setAnchor2Bookmark()
2124
+ setHeader()
2125
+ setFooter()
2126
+ defHeaderByName()
2127
+ defFooterByName()
2128
+ setHeaderByName()
2129
+ setFooterByName()
2130
+ setHTMLHeader()
2131
+ setHTMLFooter()
2132
+ defHTMLHeaderByName()
2133
+ defHTMLFooterByName()
2134
+ setHTMLHeaderByName()
2135
+ setHTMLFooterByName()
2136
+ shaded_box()
2137
+ writeBarcode()
2138
+
2139
+ Variable names changed to lowercase first letter:
2140
+ (Variables are case-sensitive therefore aliases have been set up)
2141
+ Anchor2Bookmark
2142
+ BiDirectional
2143
+ KeepColumns
2144
+ AliasNbPg
2145
+ AliasNbPgGp
2146
+
2147
+ =========
2148
+ Bug fixes
2149
+ =========
2150
+ Columns - $keepColumns=true was incorrectly calculating the place to continue printing after 1 and half columns (of 3)
2151
+ Table cell height - incorrectly setting table cell height when cell contained a line of text of large size which wrapped to more than one line
2152
+ HR in Table cell - if table cell contains only HR (and column otherwise empty), HR was printed outside cell
2153
+ HR in Table cell - if table cell ended with a HR, height was one line too much
2154
+ Table page-break-inside:avoid - caused mPDF into permanent loop in some circumstances
2155
+ Paging - Total Pages/Group {nb} and {nbgp} didn't work in CJK
2156
+ CSS - Border size thin, medium and thick were only recognised in lowercase
2157
+ Table-header - rowspan not correctly output in THEAD
2158
+ Default CSS - table empty-cell:hide changed to show (CSS specification)
2159
+
2160
+ ===========================
2161
+ mPDF v2.1 (24/01/2009)
2162
+ ===========================
2163
+
2164
+ New Features in Version 2.1
2165
+ ---------------------------
2166
+ - CSS support improved generally (especially for cascading CSS, lists)
2167
+ - TableHeader changed to allow multiple rows in THEAD
2168
+
2169
+
2170
+ CSS changes
2171
+ -----------
2172
+ - display: none (block elements only - not lists or tables, nor HR)
2173
+ - width (TD/TH)
2174
+ - list-style-type (will also recognise the list-style-type from list-style) (OL/UL)
2175
+ recognised values: disc|circle|square|decimal|lower-roman|upper-roman|lower-latin|upper-latin|lower-alpha|upper-alpha|none
2176
+ - CSS support for <LI>: font-family, font-size, font-style, font-weight, color, background-color, text-decoration, text-transform, and list-style-type (will also recognise the list-style-type from list-style)
2177
+ - table cell borders - CSS rules have been adapted slightly - if a coloured/black line conflicts with a white line, and is the same width, coloured/black will overwrite even if Bottom or Right
2178
+
2179
+
2180
+ Numbered Lists
2181
+ --------------
2182
+ Variables set at the top of mpdf.php can be set to change:
2183
+ - text alignment of numbers in numbered lists (default Right)
2184
+ var $list_align_style = 'R';
2185
+ - content to follow a numbered list marker e.g. '.' gives 1. or IV. whereas ')' gives 1) or a)
2186
+ var $list_number_suffix = '.';
2187
+ (These can be altered at run time, but are not changeable through stylesheets or in-line style)
2188
+
2189
+
2190
+ Writing broken segments of HTML
2191
+ -------------------------------
2192
+ 2 new parameters have been added to WriteHTML()
2193
+ function WriteHTML($html,$sub=0,$init=true,$close=true) {
2194
+ $close - Leaves buffers/variables etc. in current state, so that it can continue to write the HTML where it leaves off
2195
+ $init - Clears and resets buffers/variables
2196
+ (N.B. You must end with a WriteHTML that calls $close=true)
2197
+ Example:
2198
+ $mpdf->WriteHTML('<p>This is the beginning...', 2, true, false);
2199
+ $mpdf->WriteHTML('...this is the middle...', 2, false, false);
2200
+ $mpdf->WriteHTML('...and this is the end</p>', 2, false, true);
2201
+
2202
+
2203
+ Rotated text in table cells
2204
+ ---------------------------
2205
+ NB This UPDATE will change expected output from previous versions******
2206
+
2207
+ Prior to v2.1 any cell set to rotate text anticlockwise was forced to vertical align = bottom.
2208
+ This has been changed so that it only overrides when the rotate angle is between 45 and 89 degrees: text rotated exactly 90 degrees will respect the set value for vertical-align.
2209
+
2210
+
2211
+ =========
2212
+ Bug fixes
2213
+ =========
2214
+ - List - list starting after "<div>Then some text not in a block element<ol>" incorrectly output
2215
+ - Tables - if cell font-size set smaller than default for the table, does not shrink the cell height
2216
+ - Columns (tables) - columns breaking across rows e.g. in the middle of a table cell
2217
+ - Tables - if table width set to e.g. 100% but cols are less, was not making up to set width
2218
+ - Watermark - was not printing if using HTMLFooter
2219
+ - Lists - not aligning numbering correctly if different font sizes used for bullet & text etc.
2220
+ - Lists - indent of text did not correctly allow for Maximum number in <ol> list
2221
+ - Table does not always move correctly to a new page
2222
+ - Table cell incorrectly calculated height causing text to overflow cell when printed
2223
+ - Table borders in columns not being correctly handled (bug since 2.0 introduced a buffer to save the borders and print at the end of the table - fixed so does not use buffer if in columns - potentially does not deal with conflicting borders as well, but works in columns)
2224
+ - Table cell width if set as a percent was being downsized when autosizing table
2225
+ - Table CSS was buggy - improved
2226
+ - SetBasePath (when fetching remote website) - now handles string with query string on it e.g. http://www.domain.com/index.php?tid=42
2227
+ - Table cells with Rotated text - text not positioned correctly
2228
+ - Page number totals not working in utf-8 mode
2229
+
2230
+
2231
+ ============================
2232
+ Code efficiency improvements
2233
+ ============================
2234
+ - BIG speed improvement (compared with 2.0) with tables (especially large tables)
2235
+ - considerable increase in speed if writing long HTML segments to mPDF
2236
+ - speed improvement for tables (may be very significant if some cells have a lot of text in them causing uneven column widths)
2237
+
2238
+ NB To speed up program more, consider setting $mpdf->useSubstitutions=false; if you do not use any characters outside the codepage selected
2239
+
2240
+
2241
+ ===============
2242
+ Keep-with-table
2243
+ ===============
2244
+ (This was introduced in v2.0 but I forgot to document it)
2245
+ If you set $this->use_kwt = true;
2246
+ All H1-H6 elements will try to keep with a table that follows immediately afterwards - (this is done in htmltoolkit, by adding an attribute KEEP-WITH-TABLE)
2247
+ See Known Issues re: Using kwt inside a div with border/background (doesn't work)
2248
+
2249
+
2250
+
2251
+
2252
+ ===========================
2253
+ mPDF v2.0 (07/12/2008)
2254
+ ===========================
2255
+ Main New Features in Version 2.0
2256
+ - nested tables are supported
2257
+ - supports both models of table border: separate and collapsed
2258
+ - improved parsing of CSS stylesheets, and better handling of styles throughout
2259
+ - additional recognised CSS styles
2260
+ - page orientation, size, and margins can be changed within the document, using PHP script or custom HTML
2261
+ - some limited support for @page CSS to define page-box areas, with crop/cross marks for printing
2262
+ - improved control over headers and footers (including HTML headers/footers)
2263
+ - improved presentation of Form elements including image-type input fields
2264
+ - generates an EAN barcode suitable for a book/printed publication
2265
+ - active forms can be generated - EXPERIMENTAL at present
2266
+ - change document permissions to allow the user to make annotations - EXPERIMENTAL at present
2267
+
2268
+ NB Lines are commented in mPDF script as changes for mPDF 1.4 - this became v2.0
2269
+
2270
+ =========
2271
+ UPGRADING
2272
+ =========
2273
+ IMPORTANT - Before Upgrading: Please note that some of the changes will cause mPDF 2.0 to render the pages differently from earlier versions i.e. it is not totally backwards comaptible. Read the notes on Backward compatibility before deleting your original set-up.
2274
+
2275
+ To upgrade from v<=1.3 to v2.0 you only need to copy and overwrite the following 2 files:
2276
+ mpdf.php
2277
+ htmltoolkit.php
2278
+
2279
+ Plus (optionally) if you want to use the EAN Barcode function, you will also need:
2280
+ font/ocrb.xx (several)
2281
+ unifont/ocrb.xx (several)
2282
+ IMPORTANT - you need to make sure the ocrb font is added to the config.php file
2283
+ - add 'ocrb' to the end of 3 arrays: $this->available_fonts $this->available_unifonts and $this->mono_fonts
2284
+
2285
+
2286
+ ==========
2287
+ Bug Fixes
2288
+ ==========
2289
+ <columns column-count="0"> did not turn off columns - Fixed
2290
+
2291
+ Margins as % - e.g. margin-right: 50% set from CSS incorrectly applied 50% of the fontsize
2292
+ (Fixed - adding parameter to fn. ConvertSize in htmltoolkit.php and in calls to that function)
2293
+
2294
+ DIV Width - e.g. div style="width: 50% was not working
2295
+ (Fixed - fn.SetCSS and OpenTag()'DIV')
2296
+
2297
+ CSS values as Zero - p { margin: 0; } did not work in stylesheet unless 0 had a unit
2298
+
2299
+ Multiple Non-breaking spaces collapsed - e.g. "1&nbsp; &nbsp; &nbsp;2" - was contracted to "1 2"
2300
+ (Fixed - fn.adjustHTML in htmltoolkit.php)
2301
+
2302
+ Table cell too narrow causing incorrect printing - If two characters are too wide to print (only likely within a table cf. example tables - Periodic table) the first character was not printed, just a new line
2303
+ (Fixed in fn.WriteFlowingBlock)
2304
+
2305
+ Font size by inline style for form elements <input> <textarea> gave wrong size when using a relative size 0.9em
2306
+ (Fixed - fn.ConvertSize in htmltoolkit.php)
2307
+
2308
+ Creation Date not correctly showing
2309
+ (Fixed - did not need to convert to UTF16)
2310
+
2311
+ New block element started at end of page - block borders not painted
2312
+ (Fixed - fn.AddPage)
2313
+
2314
+ DL did not close block correctly
2315
+ (Fixed - mistype in fn. CloseTag)
2316
+
2317
+ Transparent not recognised as color/background-color
2318
+ (Attempted a fix by setting to ignore it! - fn. convertcolor in htmltoolkit.php)
2319
+
2320
+ Zero (0) not displaying if only thing in table cell or tags e.g. <td>0</td> <p>0</p>
2321
+ (Fixed - fn.WriteHTML)
2322
+
2323
+ Page Headers/Footers - Simple Headers or Footers defined as e.g. '|{PAGENO}|' were not split into 3 components, but output |6| in the outer margin.
2324
+ (Fixed)
2325
+
2326
+ Could not copy from a completed PDF doc to clipboard when using a TrueTypeUnicode font
2327
+ (Fixed - fn._puttruetypeunicode - added CIDToGIDMap)
2328
+
2329
+ Creating an Index (confusing called CreateReference in mPDF) based on only 1 column (i.e. columns off) caused it to print FAIL
2330
+ (Fixed - fn. CreateReference())
2331
+
2332
+ Table of Contents - If a ToC entry reached other side of page a warning notice was produced
2333
+ Fixed - printing is now suppressed and it is moved down a line (but not when using rtl)
2334
+
2335
+ "Keep Block Together" (i.e. page-break-inside: avoid for a block element)
2336
+ If this property causes some text to be moved to the next page, internal link targets (i.e. <a name="xxx">) were incremented pagenumber by +1 - as this used the calculated document page number, didn't work if using e.g. roman numerals
2337
+ (Fixed)
2338
+ NB This is now ALWAYS disabled when it meets a table - can use page-break-inside:avoid for the table
2339
+
2340
+ @import url(style.css) without quotation marks "" was not picked up, although it is valid HTML
2341
+ (Fixed - fn.ReadCSS())
2342
+
2343
+ Reading CSS from external style sheets included all media
2344
+ Now set by default to ignore media="aural|braille"
2345
+ Allows media="print" but can exclude by: $mpdf->disablePrintCSS = true; (default = false)
2346
+ Works on both <link... and <style media="print">@import...
2347
+ See the web page example - this stops the CSS stylesheets specifically marked for "print" to be ignored
2348
+
2349
+ Table borders (in collapsed model) incorrectly calculated which border had dominance (mPDF <=1.3 determined the overriding border by its color)
2350
+ (Fixed to follow CSS 2.1 specifications: width >> CSS dominance (cell>table) >> T & L > B & R)
2351
+ In the border-collapse=collapse mode, the following rules determine which border style "wins" in case of a conflict:
2352
+ 1. Borders with the 'border-style' of 'hidden' take precedence over all other conflicting borders.
2353
+ 2. narrow borders are discarded in favor of wider ones.
2354
+ 3. styles are preferred in this order: 'double', 'solid', 'dashed', 'dotted', 'ridge', 'outset', 'groove', and the lowest: 'inset'.
2355
+ 4. If border styles differ only in color, then a style set on a cell wins over one on a table.
2356
+ 5. When two elements of the same type conflict, then the one further to the left or top wins out.
2357
+
2358
+ Parsing CSS, a missed level would not be picked up i.e. CSS = div.refstr1 p {...} would not pick up:
2359
+ <div class="refstr1"> <div class="another"> <p>...
2360
+ (Fixed - fn. MergeCSS by carrying everything forwards)
2361
+ Note: I removed - && !$this->blk[$this->blklvl-1]['cascadeCSS']['CLASS>>'.$attr['CLASS']]['depth']
2362
+ Not sure why I put it there in the first place!
2363
+ In a later bit of function - && $this->blk[$this->blklvl-1]['cascadeCSS'][$tag]['depth']>1
2364
+ Haven't removed this, but is it needed???
2365
+
2366
+ CSS inline style set in TD/TH (font-size, color, weight, font-family or italic) didn't turn off at the end of the cell (and also formatted the top left cell)
2367
+ (Fixed)
2368
+
2369
+ CSS properties color, font-weight, and font-style set on a table were not inherited by the table cells
2370
+ (Fixed - var $base_table_properties)
2371
+
2372
+ When rotating a table, the text following was positioned incorrectly
2373
+ (Fixed - fn. printtablebuffer)
2374
+
2375
+ When rotating a table, links were not adjusted in position e.g. <a href="">...
2376
+ (Fixed - fn. printtablebuffer)
2377
+
2378
+ If a larger border-thickness was set for a cell in the middle of a table, cells before that inaccurately calculated the cell wdith needed
2379
+ (Fixed)
2380
+
2381
+ Text in a table cell which was not in a block and followed a list, there was no line break e.g. </ol>Text following</td>
2382
+ (Fixed - var $listjustfinished;)
2383
+
2384
+ Setting the default font-family from the body tag using in-line CSS did not work e.g. <body style="font-family:mono"> (did work in external stylesheets)
2385
+ (Fixed - fn.WriteHTML)
2386
+
2387
+ <link href="..." rel="stylesheet"> was not recognised (because the href comes before the rel)
2388
+ (Fixed)
2389
+
2390
+ Read linked CSS stylesheet OR @import stylesheet - now includes both.
2391
+
2392
+ <tag class="class1 class2"> did not set either class1 or class2. Fixed so that it will now pick out class1 (better than nothing!)
2393
+
2394
+ CSS line-height as % - interpreted 120% as 120 (x the font-size) - Fixed so it now accepts % and numbers
2395
+
2396
+ Setting the basepath (used for relative links/external stylesheets etc) with $mpdf->setBasePath() was generally buggy!
2397
+ Now allows a domain e.g. $mpdf->setBasePath("http://www.domain.com"); (previously needed slash on end)
2398
+ (Fixed - hopefully!)
2399
+
2400
+ If you were repeatedly calling mPDF in a loop to produce more than one PDF file, it would crash with error: "You have restricted the number of available fonts to 0". Fixed by editing line 751 require(_MPDF_PATH.'mpdf_config.php'); to require(...
2401
+
2402
+
2403
+ =============
2404
+ Improvements(?)
2405
+ =============
2406
+ Unsupported image files - mPDF died with an error message if image files didn't meet expected format e.g. an interlaced PNG file
2407
+ Changed so images are now replaced by the NOIMG image.
2408
+
2409
+ Footer margin (HTML and normal footers) now determines the lowest point that is printed (rather than the place to start printing the footer)
2410
+ NB IMPORTANT CHANGE - not backwards comaptible
2411
+
2412
+ Tabs in <pre> or <textarea> are now replaced by 8 spaces rather than 6 (consistent with http://www.w3.org/TR/1998/REC-html40-19980424/struct/text.html#edef-PRE) [fn. AdjustHTML() in htmltoolkit.php]
2413
+
2414
+ To insert the total number of pages in the document anywhere in the doc, just use '{nb}'
2415
+ The line: $mpdf->AliasNbPages();
2416
+ has now been uncommented allowing {nb} to be used
2417
+ NB This will always give the total no. of pages in the whole document regardless of any changes you have made to page numbering.
2418
+ You can change the default placeholder '{nb}' to any string using: $mpdf->AliasNbPages('[**my Chars**]');
2419
+
2420
+ $mpdf->AliasNbPageGroups(); default="{nbpg}"
2421
+ Can be used to set the total number of pages in the current group i.e. between where page numbering is reset
2422
+
2423
+ CSS border correctly fixes "solid 3mm #000000" i.e. (style width color) - (not a bug, but this is often incorrectly specified)
2424
+
2425
+ Can now print div background behind a rotated table.
2426
+
2427
+ You can keep columns as they are i.e. 1st column will finish page then start on second, by setting
2428
+ $mpdf->KeepColumns = true;
2429
+
2430
+ Image constrain
2431
+ ===============
2432
+ Image size is constrained to current margins and page position. Extra parameter added to end of fn. allows you to override this.
2433
+ $mpdf->Image('files/images/frontcover.jpg',0,0,210,297,'jpg','',true, false); // e.g. the last "false" allows a full page picture
2434
+ Useful for e.g. a cover page for your document
2435
+
2436
+ Cumulative CSS
2437
+ ==============
2438
+ In version <=1.3, if you call:
2439
+ $mpdf->WriteHTML($stylesheet,1);
2440
+ $mpdf->WriteHTML($html); // this one cleared the array $this->cascadeCSS; conatining cascaded CSS information from stylesheets
2441
+ You were meant to call:
2442
+ $mpdf->WriteHTML($html,2); // which doesn't re-parse the CSS information
2443
+ v2.0 changed so that
2444
+ $mpdf->WriteHTML($html); no longers clears the array $this->cascadeCSS and so can be used repeatedly;
2445
+
2446
+
2447
+
2448
+ ================================================
2449
+ Additional CSSstyles & HTML attributes supported
2450
+ ================================================
2451
+ <BODY> - font-style, font-weight, color
2452
+
2453
+ <IMG> - html attributes width="" and height=""
2454
+
2455
+ <TABLE|TD|TH> - border: 'thin' 'medium' and 'thick' are now converted to 1px, 3px and 5px
2456
+ <TABLE|TD|TH> - border now respects all types - e.g. 'double', 'solid', 'dashed', 'dotted', 'ridge', 'outset', 'groove', and 'inset'
2457
+ (NB mPDF only supports a full declaration of border e.g. "border: thin double #000000;")
2458
+
2459
+ <TD|TH> - CSS style="white-space: nowrap" and HTML attribute nowrap="nowrap"
2460
+ <TABLE> - page-break-inside: avoid
2461
+ <TABLE> - border-collapse: separate|collapse
2462
+ <TABLE> - border-spacing: 2px 2px; (horizontal/vertical) or just one figure (both) NB same as cellSpacing
2463
+ <TABLE> - empty-cells: hide|show (border-collapse:separate only)
2464
+ <TABLE> - margin-left and margin-right (previously only supported top and bottom)
2465
+ <TABLE> - padding: (this was incorrectly used for TD/TH before) (border-collapse:separate only)
2466
+ <TD|TH> - padding:
2467
+ <TABLE|TD|TH> - inline style "background" works (with a color only) the same as "background-color"
2468
+
2469
+ NB Table page-break-inside, autosize values and rotate are only respected for that set on first level table of nested tables
2470
+
2471
+ <TABLE> - cellSpacing and cellPadding HTML attributes:
2472
+ NB cellSpacing is the same as CSS style "border-spacing"
2473
+ NB cellPadding is a <table> attribute, but sets the cell padding - not table padding
2474
+
2475
+ <TABLE> - align="..." now works with a rotated table - but sets the alignment ignoring the rotation i.e. align=right sets the table to the right side of the page (looking as though it is bottom-aligned)
2476
+
2477
+ <BLOCK ELEMENTS> - page-break-before: always|left|right - NB any surrounding block tags will be closed before the new page is inserted.
2478
+
2479
+ @page - see notes on Paged Media
2480
+
2481
+ ==========================
2482
+ Unsupported HTML attribute
2483
+ ==========================
2484
+ <TD border="1"> - not valid HTML - no longer supported
2485
+
2486
+
2487
+ =========
2488
+ Additions
2489
+ =========
2490
+ "Keep-with-table"
2491
+ $mpdf->use_kwt = true; // default=false
2492
+ If set to true, will force any H1-H6 header immediately preceding a table to be kept together with the table
2493
+ - automatically sets the table to fit on one page (i.e. page-break-inside=avoid) if it is a rotated table
2494
+ - ignored if: Columns on, Keep-block-together active (page-break-inside=avoid for surrounding BLOCK), active Forms
2495
+
2496
+
2497
+ =====
2498
+ Notes
2499
+ =====
2500
+
2501
+ NB Not a change - but note you can use this to allow you to feed html code encoded in other than utf-8:
2502
+ $mpdf->allow_charset_conversion=true;
2503
+ $mpdf->charset_in='windows-1252'; (needs suitable codes for iconv i.e. windows-1252 not win-1252)
2504
+
2505
+ Fixing Optional tags
2506
+ ====================
2507
+ php.net website has illegal nesting of <dt>.. <dd> .. </dd> .. </dt> and <p>.. <div> .. </div> .. </p>
2508
+ The example wich parses the php.net webpage will not show correctly unless you change: $mpdf->allow_html_optional_endtags=false;
2509
+ Trying to fix incorrect (X)HTML with $mpdf->allow_html_optional_endtags==true cancels the P when it meets a DIV etc.
2510
+
2511
+
2512
+
2513
+ EAN barcode
2514
+ ===========
2515
+ An EAN barcode can be generated
2516
+ function writeBarcode($code, $showisbn=1, $x='', $y='', $size=1, $border=0, $paddingL=1, $paddingR=1, $paddingT=2, $paddingB=2) {
2517
+ It accepts 12 or 13 digits with or without - hyphens as $code e.g.
2518
+ $mpdf->writeBarcode('978-1234-567-890', 1, $mpdf->x, $mpdf->y);
2519
+ NB - IMPORTANT***
2520
+ A new font - OCR-B font/unifont is required, and needs to be added to the config.php file
2521
+ cf. http://www.gs1uk.org/downloads/bar_code/Bar coding getting it right.pdf
2522
+ Barcode size must be between 0.8 and 2.0 (80% to 200%)
2523
+
2524
+ CMYK Colors
2525
+ ===========
2526
+ Functions - SetDrawColor, SetTextColor and SetFillColor all now take an optional 4th parameter.
2527
+ If defined this will interpret the input as CMYK color i.e.
2528
+ SetDrawColor(15,82,0,10) // NB all values out of 100 - not 255 as for RGB
2529
+
2530
+ htmltoolkit.php fn.ConvertColor() - now interprets custom color definition: cmyk(15,82,0,10)
2531
+ like rgb(r,g,b) except values out of 100
2532
+ Intended to be used for calling the functions separately - BUT works in a limited way with CSS - does not get reset or inherited correctly
2533
+ <p style="color:cmyk(215,31,15,10)"> does work
2534
+
2535
+
2536
+ DEFAULT CSS
2537
+ ===========
2538
+ $defaultCSS has been updated to reflect better the standard HTML default e.g. using serif, table borders separate, cell vertical-align top
2539
+ To keep mPDF 1.3 (my favourites) I have introduced:
2540
+ $mpdf->useDefaultCSS2 = true;
2541
+
2542
+
2543
+ ===================================
2544
+ Permissions - forms and Annotations - Experimental!
2545
+ ===================================
2546
+ You can set the Permissions for the PDF file to allow the user to make Comments (annotations)
2547
+ $mpdf->setUserRights($enabled=true[default]|false, $annots="/Create/Delete/Modify/Copy/Import/Export",
2548
+ $form="/Add/Delete/FillIn/Import/Export/SubmitStandalone/SpawnTemplate", $signature="/Modify") )
2549
+
2550
+ If you encrypt the file, make sure the permissions match e.g.:
2551
+ $mpdf->setUserRights();
2552
+ $mpdf->SetProtection(array('print','annots'),'yourPassword','myPassword');
2553
+
2554
+ To allow this, changed the PDF-file version to %PDF1.5 (NB Probably needs PDF version > 1.5 but can't test for this...)
2555
+
2556
+ NOTE: If you output the PDF file straight to the browser, it will only allow annotations after you save the document
2557
+
2558
+
2559
+ ===========================
2560
+ Active Forms - Experimental!
2561
+ ===========================
2562
+ At present , using active forms will prevent any internal and external links - that appear before active forms(?) - from working (why?)
2563
+ May need to save form for proper use - see example, when scroll forwards and back, the form disappears??
2564
+ Need to set Userrights (see above), and $mpdf->useActiveForms=true;
2565
+ For Output options, see separate notes.
2566
+
2567
+
2568
+
2569
+ ============================
2570
+ Internal Programming changes
2571
+ ============================
2572
+ NB fn. tablerotate in htmltoolkit no longer used; now uses a 'transform' to shift the whole block of PDF code
2573
+
2574
+ Graphics State
2575
+ ==============
2576
+ ExtGState does not need to be redefined - e.g. if a watermark added on every page, turning on and off alpha/transparency
2577
+ Unnecessary file size.
2578
+ function AddExtGState() edited to check if graphics state already exists before adding new one
2579
+
2580
+ ASCII-proof code
2581
+ ================
2582
+ "���" used as a special identifier in the program changed to "\xbb\xa4\xac" to make the mpdf.php script file immune from someone saving it as a utf-8 encoded file
2583
+
2584
+ Images
2585
+ ======
2586
+ 1) When copying remote images locally - incorrectly used "unset" now changed to "unlink"
2587
+ 2) When parsing image files - was using CURL for any image src="http://... - even if this was on the local server - edited so it only uses CURL if necessary/appropriate.
2588
+ NB Handling images was updated in v1.3 because my ISP changed allow_url_fopen to false
2589
+ Fixed so mPDF tests if the file is available as a local call e.g. getimage('images/test.jpg') even if it is defined as a full URI e.g. http://www.mydomain.com/images/test.jpg as this is quicker(?), and permitted even if allow_url_fopen is false.
2590
+ If not available as a local file (and allow_url_fopen is set) mPDF tries to use fopen/file_get_contents using an http wrapper;
2591
+ Else, if CURL is available and allow_url_fopen is false: then tries using CURL.
2592
+ (Clear as mud???!!)
2593
+
2594
+
2595
+ ===========================
2596
+ mPDF v1.3 (21/09/2008)
2597
+ ===========================
2598
+ --------------
2599
+ Page Numbering
2600
+ --------------
2601
+ Program changes:
2602
+ fn. startPageNums() replaced with blank function
2603
+ fn. stopPageNums() - deleted
2604
+ fn. numPageNo() - deleted (all it did was return this->page anyway).
2605
+ var $_numbering - deleted
2606
+ var $_numberingFooter - deleted
2607
+ var $_numPageNum - deleted
2608
+
2609
+ NEW
2610
+ New: fn. AddPages() (as for AddPage but with type=NEXT-ODD or NEXT-EVEN see below)
2611
+ Edited: fn. AddPage() - new parameters added
2612
+ AddPage(orientation(NO),type="E|O", resetpagenum="1|0", pagenumstyle="I|i|A|a|1", suppress="on|off")
2613
+ New: fn. docPageNum() - returns the document page number (or '') based on...
2614
+ New : PageNumSubstitutions(array)
2615
+ New attributes:
2616
+ <pagebreak resetpagenum="1" // resets document page numbering to 1 from the new page onwards
2617
+ <pagebreak suppress="on" // turns on suppression of page numbering i.e. in headers and footers, {PAGENO} is replaced by blank string
2618
+ // ="0" turns suppression off
2619
+ <pagebreak pagenumstyle="I|i|A|a|1" // (re)sets page number stle/type from the new page onwards - as for lists
2620
+ // 1 - decimal; A/a - alpha (uppercase/lowercase); I/i - Roman (uppercase/lowercase)
2621
+ <pagebreak type="NEXT-ODD" // always adds a page + another if required to make odd
2622
+ <pagebreak type="NEXT-EVEN" // always adds a page + another if required to make even
2623
+
2624
+ Edited: fn. TOC() // sets the marker for a Table of Contents
2625
+ New parameters allow the page-numbering details to be set
2626
+ NB the page-numbering details set are for the page which follows on after the TOC marker is inserted. The page-numbering for the actual ToC is set later, when the ToC is generated and inserted here
2627
+ new parameters as above for pagebreak resetpagenum="1|0", pagenumstyle="I|i|A|a|1", suppress="on|off"
2628
+
2629
+ Can also be set by attribute in the <TOC>
2630
+ <TOC resetpagenum="1" pagenumstyle="I|i|A|a|1", suppress="on|off" />
2631
+
2632
+ --------------------------------------------
2633
+ Changes to allow Rotated Text in table Cells
2634
+ --------------------------------------------
2635
+ Edited:
2636
+ fn. OpenTag()
2637
+ fn. _tableColumnWidth()
2638
+ fn. _tableHeight()
2639
+ fn. _tableWrite()
2640
+ fn. tableHeader()
2641
+
2642
+ New custom style or attribute -- "text-rotate" -- can be set for either <tr> or <th|td>
2643
+ Allowed values: 45 - 90 (written as integers) - rotates text anticlockwise, and -90 (clockwise)
2644
+ Positive values less than 90 force cell to: vertical-align:bottom
2645
+
2646
+ Limitations:
2647
+ Only allows single line of text;
2648
+ Font, font-size, and style are determined by those set fro the cell, and cannot be changed;
2649
+ No changes in font (or any other in-line changes e.g. <sup>) are supported within the text
2650
+
2651
+ Example: <tr style="text-rotate:90">...
2652
+
2653
+ ---------
2654
+ Bug fixes
2655
+ ---------
2656
+ 1) HTML footer containing table was triggering page break.
2657
+ Added $this->InHTMLFooter as flag to prevent page triggering in footers containing table
2658
+ Set in fn.writeHTMLFooters() -> in fn.tableWrite() stops the pageBreak being reset
2659
+
2660
+ 2) Crashing when libcurl not installed.
2661
+ Edited OpenTag() curl_init - added if (function_exists) to exclude crash when libcurl not installed
2662
+
2663
+ 3) Single cell with borders not showing the borders.
2664
+ e.g. <table><tr><td style="border:1px solid #000000?>Hi</td></tr></table>
2665
+ Problem: mPDF overrides cell border properties with table border properties for external borders. $defaultCSS had CSS defined for table as '0px solid #000000'
2666
+ Quick fix - line 273 removed. A more complete fix will require reprogramming to distinguish between "border property not set" and border property set as "none".
2667
+
2668
+ 4) Empty textarea incorrectly handled (the following HTML code being output in the textarea)
2669
+ The html code for an empty textarea was incorrectly handled in htmltoolkit fn. AdjustHTML which has been edited
2670
+
2671
+
2672
+ ===========================
2673
+ mPDF v1.2 (2008-05-01)
2674
+ ===========================
2675
+ // Added v1.2 option to continue if invalid UTF-8 chars - used in function is_utf8()
2676
+ var $ignore_invalid_utf8 = false;
2677
+
2678
+ Reading CSS in fn. ReadCSS() and applying in fn. MergeCSS() -
2679
+ Edited to allow Tags, class and id with the same name to be distinct i.e. h5 {...} .h5 {...} #h5 {...}
2680
+ * mPDF 1.2 This version supports: .class {...} / #id { .... }
2681
+ * ADDED p {...} h1[-h6] {...} a {...} table {...} thead {...} th {...} td {...} hr {...}
2682
+ * body {...} sets default font and fontsize
2683
+ * It supports some cascaded CSS e.g. div.topic table.type1 td
2684
+ * Does not support non-block level e.g. a#hover { ... }
2685
+
2686
+ Table: font-size, weight, style, family and color should all work
2687
+ TD/TH: font-size, weight, style, family and color should all work
2688
+
2689
+ Added to htmltoolkit - fn.array_merge_recursive_unique()
2690
+
2691
+ memory_opt Removed in mPDF v1.2 - not working properly
2692
+
2693
+ fn. _begindoc() - changed to %PDF1.4 (was 1.3) as PDF version
2694
+
2695
+ Write HTML Headers and Footers
2696
+ ------------------------------
2697
+ fn. Close() - calls writeHTMLHeaders/Footers() before finishing doc
2698
+ fn. WriteHTML() - added parameter
2699
+ fn. _out - writes to outputbuffer when writing HTML footers/headers
2700
+
2701
+ New
2702
+ fn. writeHTMLHeaders()
2703
+ fn. writeHTMLFooters()
2704
+
2705
+
2706
+
2707
+
2708
+ =======================
2709
+ mPDF v1.1 (2008-05-01)
2710
+ =======================
2711
+
2712
+ Programming changes to increase efficiency
2713
+ ------------------------------------------
2714
+ fn. WriteHTML() - added lines to combine substituted characters <tta> etc
2715
+
2716
+ Memory Optimization added (script from FPDF site) - edited fn. _putpages() and fn. _endpage()
2717
+
2718
+ fn. SetFont() edited to return val quicker if font already set (increase efficiency)
2719
+
2720
+ new vars chrs and ords are used to store chr() and ord() - quicker than using functions
2721
+
2722
+ fn.setMBencoding() - only call mb_internal_encoding if need to change
2723
+
2724
+ Bugs
2725
+ ----
2726
+ fn. SetDefaultFontSize() - edited to allow to override that set in defaultCSS
2727
+
2728
+ fn. Output() - Added temporary(?) disablement of encryption in CJK as it doesn't work!
2729
+
2730
+ fn. OpenTag() [LI] $this->blockjustfinished=false to prevents newline after first bullet of list within table
2731
+
2732
+ Uses of mb_ereg_replace removed, and mb_split changed - requires regex_encoding (regex_encoding only used as UTF-8)
2733
+
2734
+ fn. WriteHTML: attributes are trimmed with trim() to allow correct handling of e.g. class="bpmBook "
2735
+
2736
+ fn. printbuffer() and fn. openTag() to ensure
2737
+ <div><div><p> outputs top margins/padding for both 1st and 2nd div
2738
+ and </p></div></div> ...
2739
+
2740
+ fn. SetFont() added line - bug fixing in CJK fonts
2741
+
2742
+ CSS functionality
2743
+ -----------------
2744
+ Added special CSS 'thead-underline' (similar to topntail)
2745
+
2746
+ var $thead_font_weight; added (openTag) to enable setting of font-weight for <TH> cells
2747
+
2748
+ Fixed table border inheritance: Table border inherits border="1" to cells, but not table style="border..."
2749
+
2750
+ "page-break-inside: avoid" added (var keep_block_together) to allow a DIV or P to be kept on one page
2751
+ - not compatible with table autosize or table rotate
2752
+ - only works over maximum of 2 pages
2753
+
2754
+ Enhancements
2755
+ ------------
2756
+ Orphans in line justification: R. Bracket ) added to defined list of orphans
2757
+
2758
+ allow_url_open
2759
+ --------------
2760
+ Following a change in the PHP ini config set on my website by my ISP, changes made to allow mPDF to work with allow_url_open=OFF.
2761
+ - file_get_contents() changed to use libcurl (for CSS files)
2762
+ - openTag('IMG') @fopen() and 3 functions _parsegif, _parseJPG, _parsePNG, edited to copy remote image files to local file to include images
2763
+
2764
+ FlowChart
2765
+ ---------
2766
+ Changes to enable mPDF work with a custom script producing Flowcharts:
2767
+ - WriteHTML() second parameter=3 will allow HTML to be parsed but not output
2768
+ - fn. Arrow() added
2769
+ - TableWordWrap() added parameter to force array return
mPDF/README.txt CHANGED
@@ -1,5 +1,148 @@
1
- Upgrading
2
  ============
 
 
 
 
 
 
 
3
 
4
- To upgrade from mPDF 5.7 to 5.7.1, simply upload the 3 files to their corresponding folders, overwriting files as required.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
 
1
+ Installation
2
  ============
3
+ * Download the .zip file and unzip it
4
+ * Create a folder e.g. /mpdf on your server
5
+ * Upload all of the files to the server, maintaining the folders as they are
6
+ * Ensure that you have write permissions set (CHMOD 6xx or 7xx) for the following folders:
7
+ /ttfontdata/ - used to cache font data; improves performance a lot
8
+ /tmp/ - used for some images and ProgressBar
9
+ /graph_cache/ - if you are using JpGraph in conjunction with mPDF
10
 
11
+ To test the installation, point your browser to the basic example file : [path_to_mpdf_folder]/mpdf/examples/example_basic.php
12
+
13
+ If you wish to define a different folder for temporary files rather than /tmp/ see the note on 'Folder for temporary files' in
14
+ the section on Installation & Setup in the manual (http://mpdf1.com/manual/).
15
+
16
+ If you have problems, please read the section on troubleshooting in the manual.
17
+
18
+
19
+ Fonts
20
+ =====
21
+ I will refer to font names in 2 ways:
22
+ "CSS font-family name" - mPDF is designed primarily to read HTML and CSS. This is the name used in CSS e.g.
23
+ <p style="font-family: 'Trebuchet MS';">
24
+
25
+ "mPDF font-family name" - the name used internally to process fonts. This could be anything you like,
26
+ but by default mPDF will convert CSS font-family names by removing any spaces and changing
27
+ to lowercase. Reading the name above, mPDF will look for a "mPDF font-family name" of
28
+ 'trebuchetms'.
29
+
30
+ The configurable values referred to below are set in the config_fonts.php file
31
+
32
+ When parsing HTML/CSS, mPDF will read the CSS font-family name (e.g. 'Trebuchet MS') and convert
33
+ by removing any spaces and changing to lowercase, to look for a mPDF font-family name (trebuchetms).
34
+
35
+ Next it will look for a translation (if set) e.g.:
36
+ $this->fonttrans = array(
37
+ 'trebuchetms' => 'trebuchet'
38
+ )
39
+
40
+ Now the mPDF font-family name to be used is 'trebuchet'
41
+
42
+ If you wish to make this font available, you need to specify the Truetype .ttf font files for each variant.
43
+ These should be defined in the array:
44
+ $this->fontdata = array(
45
+ "trebuchet" => array(
46
+ 'R' => "trebuc.ttf",
47
+ 'B' => "trebucbd.ttf",
48
+ 'I' => "trebucit.ttf",
49
+ 'BI' => "trebucbi.ttf",
50
+ )
51
+ )
52
+
53
+ This is the array which determines whether a font is available to mPDF. Each font-family must have a
54
+ Regular ['R'] file defined - the others (bold, italic, bold-italic) are optional.
55
+
56
+ mPDF will try to load the font-file. If you have defined _MPDF_SYSTEM_TTFONTS at the top of the
57
+ config_fonts.php file, it will first look for the font-file there. This is useful if you are running
58
+ mPDF on a computer which already has a folder with TTF fonts in (e.g. on Windows)
59
+
60
+ If the font-file is not there, or _MPDF_SYSTEM_TTFONTS is not defined, mPDF will look in the folder
61
+ /[your_path_to_mpdf]/ttfonts/
62
+
63
+ Note that the font-file names are case-sensitive and can contain capitals.
64
+
65
+ If the folder /ttfontdata/ is writeable (CHMOD 644 or 755), mPDF will save files there which it can
66
+ re-use next time it accesses a particular font. This will significantly improve processing time
67
+ and is strongly recommended.
68
+
69
+ mPDF should be able to read most TrueType Unicode font files with a .ttf extension
70
+ Truetype fonts with .ttf extension that are OpenType also work OK.
71
+ TrueType collections (.ttc) will also work if they contain TrueType Unicode fonts.
72
+
73
+
74
+ Character substitution
75
+ ----------------------
76
+ Most people will have access to a Pan-Unicode font with most Unicode characters in it such as
77
+ Arial Unicode MS. Set $this->backupSubsFont = array('arialunicodems'); at the top of the config_fonts.php file
78
+ to use this font when substituting any characters not found in the specific font being used.
79
+
80
+ Example:
81
+ You can set $mpdf->useSubstitutions = true; at runtime
82
+ or $this->useSubstitutions = true; in the config.php file
83
+
84
+ <p style="font-family: 'Comic Sans MS'">This text contains a Thai character &#3617; which does not exist
85
+ in the Comic Sans MS font file</p>
86
+
87
+ When useSubstitutions is true, mPDF will try to find substitutions for any missing characters:
88
+ 1) firstly looks if the character is available in the inbuilt Symbols or ZapfDingbats fonts;
89
+ 2) [If defined] looks in each of the the font(s) set by $this->backupSubsFont array
90
+
91
+ NB There is an increase in processing time when using substitutions, and even more so if
92
+ a backupSubsFont is defined.
93
+
94
+ Controlling mPDF mode
95
+ =====================
96
+ The first parameter of new mPDF('') works as follows:
97
+ new mPDF('c') - forces mPDF to only use the built-in [c]ore Adobe fonts (Helvetica, Times etc)
98
+
99
+ new mPDF('') - default - font subsetting behaviour is determined by the configurable variables
100
+ $this->maxTTFFilesize and $this->percentSubset (see below)
101
+ Default values are set so that: 1) very large font files are always subset
102
+ 2) Fonts are embedded as subsets if < 30% of the characters are used
103
+
104
+ new mPDF('..-x') - used together with a language or language/country code, this will cause
105
+ mPDF to use only in-built core fonts (Helvetica, Times) if the language specified is appropiate;
106
+ otherwise it will force subsetting (equivalent to using "")
107
+ e.g. new mPDF('de-x') or new mPDF('pt-BR-x') will use in-built core fonts
108
+ and new mPDF('ru-x') will use subsets of any available TrueType fonts
109
+ The languages that use core fonts are defined in config_cp.php (using the value $coreSuitable).
110
+
111
+ new mPDF('..+aCJK') new mPDF('+aCJK')
112
+ new mPDF('..-aCJK') new mPDF('-aCJK')
113
+ - used optionally together with a language or language/country code, +aCJK will force mPDF
114
+ to use the Adobe non-embedded CJK fonts when a passage is marked with e.g. "lang: ja"
115
+ This can be used at runtime to override the value set for $mpdf->useAdobeCJK in config.php
116
+ Use in conjunction with settings in config_cp.php
117
+
118
+ For backwards compatibility, new mPDF('-s') and new mPDF('s') will force subsetting by
119
+ setting $this->percentSubset=100 (see below)
120
+ new mPDF('utf-8-s') and new mPDF('ar-s') are also recognised
121
+
122
+ Language/Country (ll-cc)
123
+ ------------------------
124
+ You can use a language code ('en') or language/country code ('en-GB') to control which
125
+ mode/fonts are used. The behaviour is set up in config_cp.php file.
126
+ The default settings show some of the things you can do:
127
+ new mPDF('de') - as German is a Western European langauge, it is suitable to use the Adobe core fonts.
128
+ Using 'de' alone will do nothing, but if you use ('de-x'), this will use core fonts.
129
+ new mPDF('th') - many fonts do not contain the characters necessary for Thai script. The value $unifonts
130
+ defines a restricted list of fonts available for mPDF to use.
131
+
132
+ NB <html dir="rtl"> or <body dir="rtl"> are supported.
133
+
134
+
135
+
136
+ Configuration variables changed
137
+ ===============================
138
+ Configuration variables are documented in the on-line manual (http://mpdf1.com/manual/).
139
+
140
+
141
+ Font folders
142
+ ============
143
+ If you wish to define your own font file folders (perhaps to share),
144
+ you can define the 2 constants in your script before including the mpdf.php script e.g.:
145
+
146
+ define('_MPDF_TTFONTPATH','your_path/ttfonts/');
147
+ define('_MPDF_TTFONTDATAPATH','your_path/ttfontdata/'); // should be writeable
148
 
mPDF/classes/barcode.php CHANGED
@@ -871,7 +871,6 @@ class PDFBarcode {
871
  * Very capable code, excellent density, high reliability; in very wide use world-wide
872
  */
873
  protected function barcode_c128($code, $type='B', $ean=false) {
874
- $code = strcode2utf($code); // mPDF 5.7.1 Allows e.g. <barcode code="5432&#013;1068" type="C128A" />
875
  $chr = array(
876
  '212222', /* 00 */
877
  '222122', /* 01 */
871
  * Very capable code, excellent density, high reliability; in very wide use world-wide
872
  */
873
  protected function barcode_c128($code, $type='B', $ean=false) {
 
874
  $chr = array(
875
  '212222', /* 00 */
876
  '222122', /* 01 */
mPDF/classes/cssmgr.php DELETED
@@ -1,1602 +0,0 @@
1
- <?php
2
-
3
- class cssmgr {
4
-
5
- var $mpdf = null;
6
-
7
- var $tablecascadeCSS;
8
- var $listcascadeCSS;
9
- var $cascadeCSS;
10
- var $CSS;
11
- var $tbCSSlvl;
12
- var $listCSSlvl;
13
-
14
-
15
- function cssmgr(&$mpdf) {
16
- $this->mpdf = $mpdf;
17
- $this->tablecascadeCSS = array();
18
- $this->listcascadeCSS = array();
19
- $this->CSS=array();
20
- $this->cascadeCSS = array();
21
- $this->tbCSSlvl = 0;
22
- $this->listCSSlvl = 0;
23
- }
24
-
25
-
26
- function ReadDefaultCSS($CSSstr) {
27
- $CSS = array();
28
- $CSSstr = preg_replace('|/\*.*?\*/|s',' ',$CSSstr);
29
- $CSSstr = preg_replace('/[\s\n\r\t\f]/s',' ',$CSSstr);
30
- $CSSstr = preg_replace('/(<\!\-\-|\-\->)/s',' ',$CSSstr);
31
- if ($CSSstr ) {
32
- preg_match_all('/(.*?)\{(.*?)\}/',$CSSstr,$styles);
33
- for($i=0; $i < count($styles[1]) ; $i++) {
34
- $stylestr= trim($styles[2][$i]);
35
- $stylearr = explode(';',$stylestr);
36
- foreach($stylearr AS $sta) {
37
- if (trim($sta)) {
38
- // Changed to allow style="background: url('http://www.bpm1.com/bg.jpg')"
39
- list($property,$value) = explode(':',$sta,2);
40
- $property = trim($property);
41
- $value = preg_replace('/\s*!important/i','',$value);
42
- $value = trim($value);
43
- if ($property && ($value || $value==='0')) {
44
- $classproperties[strtoupper($property)] = $value;
45
- }
46
- }
47
- }
48
- $classproperties = $this->fixCSS($classproperties);
49
- $tagstr = strtoupper(trim($styles[1][$i]));
50
- $tagarr = explode(',',$tagstr);
51
- foreach($tagarr AS $tg) {
52
- $tags = preg_split('/\s+/',trim($tg));
53
- $level = count($tags);
54
- if ($level == 1) { // e.g. p or .class or #id or p.class or p#id
55
- $t = trim($tags[0]);
56
- if ($t) {
57
- $tag = '';
58
- if (preg_match('/^('.$this->mpdf->allowedCSStags.')$/',$t)) { $tag= $t; }
59
- if ($this->CSS[$tag] && $tag) { $CSS[$tag] = $this->array_merge_recursive_unique($CSS[$tag], $classproperties); }
60
- else if ($tag) { $CSS[$tag] = $classproperties; }
61
- }
62
- }
63
- }
64
- $properties = array();
65
- $values = array();
66
- $classproperties = array();
67
- }
68
-
69
- } // end of if
70
- return $CSS;
71
- }
72
-
73
-
74
-
75
- function ReadCSS($html) {
76
- preg_match_all('/<style[^>]*media=["\']([^"\'>]*)["\'].*?<\/style>/is',$html,$m);
77
- for($i=0; $i<count($m[0]); $i++) {
78
- if ($this->mpdf->CSSselectMedia && !preg_match('/('.trim($this->mpdf->CSSselectMedia).'|all)/i',$m[1][$i])) {
79
- $html = preg_replace('/'.preg_quote($m[0][$i],'/').'/','',$html);
80
- }
81
- }
82
- preg_match_all('/<link[^>]*media=["\']([^"\'>]*)["\'].*?>/is',$html,$m);
83
- for($i=0; $i<count($m[0]); $i++) {
84
- if ($this->mpdf->CSSselectMedia && !preg_match('/('.trim($this->mpdf->CSSselectMedia).'|all)/i',$m[1][$i])) {
85
- $html = preg_replace('/'.preg_quote($m[0][$i],'/').'/','',$html);
86
- }
87
- }
88
-
89
- // mPDF 5.5.02
90
- // Remove Comment tags <!-- ... --> inside CSS as <style> in HTML document
91
- // Remove Comment tags /* ... */ inside CSS as <style> in HTML document
92
- // But first, we replace upper and mixed case closing style tag with lower
93
- // case so we can use str_replace later.
94
- preg_replace('/<\/style>/i', '</style>', $html);
95
- preg_match_all('/<style.*?>(.*?)<\/style>/si',$html,$m);
96
- if (count($m[1])) {
97
- for($i=0;$i<count($m[1]);$i++) {
98
- // Remove comment tags
99
- $sub = preg_replace('/(<\!\-\-|\-\->)/s',' ',$m[1][$i]);
100
- $sub = '>'.preg_replace('|/\*.*?\*/|s',' ',$sub).'</style>';
101
- $html = str_replace('>'.$m[1][$i].'</style>', $sub, $html);
102
- }
103
- }
104
-
105
-
106
- $html = preg_replace('/<!--mpdf/i','',$html);
107
- $html = preg_replace('/mpdf-->/i','',$html);
108
- $html = preg_replace('/<\!\-\-.*?\-\->/s',' ',$html);
109
-
110
- $match = 0; // no match for instance
111
- $regexp = ''; // This helps debugging: showing what is the REAL string being processed
112
- $CSSext = array();
113
-
114
- //CSS inside external files
115
- $regexp = '/<link[^>]*rel=["\']stylesheet["\'][^>]*href=["\']([^>"\']*)["\'].*?>/si';
116
- $x = preg_match_all($regexp,$html,$cxt);
117
- if ($x) {
118
- $match += $x;
119
- $CSSext = $cxt[1];
120
- }
121
-
122
- $regexp = '/<link[^>]*href=["\']([^>"\']*)["\'][^>]*?rel=["\']stylesheet["\'].*?>/si';
123
- $x = preg_match_all($regexp,$html,$cxt);
124
- if ($x) {
125
- $match += $x;
126
- $CSSext = array_merge($CSSext,$cxt[1]);
127
- }
128
-
129
- // look for @import stylesheets
130
- //$regexp = '/@import url\([\'\"]{0,1}([^\)]*?\.css)[\'\"]{0,1}\)/si';
131
- $regexp = '/@import url\([\'\"]{0,1}([^\)]*?\.css(\?\S+)?)[\'\"]{0,1}\)/si';
132
- $x = preg_match_all($regexp,$html,$cxt);
133
- if ($x) {
134
- $match += $x;
135
- $CSSext = array_merge($CSSext,$cxt[1]);
136
- }
137
-
138
- // look for @import without the url()
139
- //$regexp = '/@import [\'\"]{0,1}([^;]*?\.css)[\'\"]{0,1}/si';
140
- $regexp = '/@import [\'\"]{0,1}([^;]*?\.css(\?\S+)?)[\'\"]{0,1}/si';
141
- $x = preg_match_all($regexp,$html,$cxt);
142
- if ($x) {
143
- $match += $x;
144
- $CSSext = array_merge($CSSext,$cxt[1]);
145
- }
146
-
147
- $ind = 0;
148
- $CSSstr = '';
149
-
150
- if (!is_array($this->cascadeCSS)) $this->cascadeCSS = array();
151
-
152
- while($match){
153
- $path = $CSSext[$ind];
154
- $this->mpdf->GetFullPath($path);
155
- $CSSextblock = $this->mpdf->_get_file($path);
156
- if ($CSSextblock) {
157
- // look for embedded @import stylesheets in other stylesheets
158
- // and fix url paths (including background-images) relative to stylesheet
159
- //$regexpem = '/@import url\([\'\"]{0,1}(.*?\.css)[\'\"]{0,1}\)/si';
160
- $regexpem = '/@import url\([\'\"]{0,1}(.*?\.css(\?\S+)?)[\'\"]{0,1}\)/si';
161
- $xem = preg_match_all($regexpem,$CSSextblock,$cxtem);
162
- $cssBasePath = preg_replace('/\/[^\/]*$/','',$path) . '/';
163
- if ($xem) {
164
- foreach($cxtem[1] AS $cxtembedded) {
165
- // path is relative to original stlyesheet!!
166
- $this->mpdf->GetFullPath($cxtembedded, $cssBasePath );
167
- $match++;
168
- $CSSext[] = $cxtembedded;
169
- }
170
- }
171
- $regexpem = '/(background[^;]*url\s*\(\s*[\'\"]{0,1})([^\)\'\"]*)([\'\"]{0,1}\s*\))/si';
172
- $xem = preg_match_all($regexpem,$CSSextblock,$cxtem);
173
- if ($xem) {
174
- for ($i=0;$i<count($cxtem[0]);$i++) {
175
- // path is relative to original stlyesheet!!
176
- $embedded = $cxtem[2][$i];
177
- if (!preg_match('/^data:image/i', $embedded)) { // mPDF 5.5.13
178
- $this->mpdf->GetFullPath($embedded, $cssBasePath );
179
- $CSSextblock = preg_replace('/'.preg_quote($cxtem[0][$i],'/').'/', ($cxtem[1][$i].$embedded.$cxtem[3][$i]), $CSSextblock);
180
- }
181
- }
182
- }
183
- $CSSstr .= ' '.$CSSextblock;
184
- }
185
- $match--;
186
- $ind++;
187
- } //end of match
188
-
189
- $match = 0; // reset value, if needed
190
- // CSS as <style> in HTML document
191
- $regexp = '/<style.*?>(.*?)<\/style>/si';
192
- $match = preg_match_all($regexp,$html,$CSSblock);
193
- if ($match) {
194
- $tmpCSSstr = implode(' ',$CSSblock[1]);
195
- $regexpem = '/(background[^;]*url\s*\(\s*[\'\"]{0,1})([^\)\'\"]*)([\'\"]{0,1}\s*\))/si';
196
- $xem = preg_match_all($regexpem,$tmpCSSstr ,$cxtem);
197
- if ($xem) {
198
- for ($i=0;$i<count($cxtem[0]);$i++) {
199
- $embedded = $cxtem[2][$i];
200
- if (!preg_match('/^data:image/i', $embedded)) { // mPDF 5.5.13
201
- //$this->mpdf->GetFullPath($embedded); /* Blue Liquid Designs Removed to allow both URL and PATHs to images */
202
- $tmpCSSstr = preg_replace('/'.preg_quote($cxtem[0][$i],'/').'/', ($cxtem[1][$i].$embedded.$cxtem[3][$i]), $tmpCSSstr );
203
- }
204
- }
205
- }
206
- $CSSstr .= ' '.$tmpCSSstr;
207
- }
208
- // Remove comments
209
- $CSSstr = preg_replace('|/\*.*?\*/|s',' ',$CSSstr);
210
- $CSSstr = preg_replace('/[\s\n\r\t\f]/s',' ',$CSSstr);
211
-
212
- if (preg_match('/@media/',$CSSstr)) {
213
- preg_match_all('/@media(.*?)\{(([^\{\}]*\{[^\{\}]*\})+)\s*\}/is',$CSSstr,$m);
214
- for($i=0; $i<count($m[0]); $i++) {
215
- if ($this->mpdf->CSSselectMedia && !preg_match('/('.trim($this->mpdf->CSSselectMedia).'|all)/i',$m[1][$i])) {
216
- $CSSstr = preg_replace('/'.preg_quote($m[0][$i],'/').'/','',$CSSstr);
217
- }
218
- else {
219
- $CSSstr = preg_replace('/'.preg_quote($m[0][$i],'/').'/',' '.$m[2][$i].' ',$CSSstr);
220
- }
221
- }
222
- }
223
-
224
- // Replace any background: url(data:image... with temporary image file reference
225
- preg_match_all("/(url\(data:image\/(jpeg|gif|png);base64,(.*?)\))/si", $CSSstr, $idata); // mPDF 5.7.2
226
- if (count($idata[0])) {
227
- for($i=0;$i<count($idata[0]);$i++) {
228
- $file = _MPDF_TEMP_PATH.'_tempCSSidata'.RAND(1,10000).'_'.$i.'.'.$idata[2][$i];
229
- //Save to local file
230
- file_put_contents($file, base64_decode($idata[3][$i]));
231
- // $this->mpdf->GetFullPath($file); // ? is this needed - NO mPDF 5.6.03
232
- $CSSstr = str_replace($idata[0][$i], 'url("'.$file.'")', $CSSstr); // mPDF 5.5.17
233
- }
234
- }
235
-
236
- $CSSstr = preg_replace('/(<\!\-\-|\-\->)/s',' ',$CSSstr);
237
- if ($CSSstr ) {
238
- preg_match_all('/(.*?)\{(.*?)\}/',$CSSstr,$styles);
239
- for($i=0; $i < count($styles[1]) ; $i++) {
240
- // SET array e.g. $classproperties['COLOR'] = '#ffffff';
241
- $stylestr= trim($styles[2][$i]);
242
- $stylearr = explode(';',$stylestr);
243
- foreach($stylearr AS $sta) {
244
- if (trim($sta)) {
245
- // Changed to allow style="background: url('http://www.bpm1.com/bg.jpg')"
246
- list($property,$value) = explode(':',$sta,2);
247
- $property = trim($property);
248
- $value = preg_replace('/\s*!important/i','',$value);
249
- $value = trim($value);
250
- if ($property && ($value || $value==='0')) {
251
- // Ignores -webkit-gradient so doesn't override -moz-
252
- if ((strtoupper($property)=='BACKGROUND-IMAGE' || strtoupper($property)=='BACKGROUND') && preg_match('/-webkit-gradient/i',$value)) {
253
- continue;
254
- }
255
- $classproperties[strtoupper($property)] = $value;
256
- }
257
- }
258
- }
259
- $classproperties = $this->fixCSS($classproperties);
260
- $tagstr = strtoupper(trim($styles[1][$i]));
261
- $tagarr = explode(',',$tagstr);
262
- $pageselectors = false; // used to turn on $this->mpdf->mirrorMargins
263
- foreach($tagarr AS $tg) {
264
- // mPDF 5.7.4
265
- if (preg_match('/NTH-CHILD\((\s*(([\-+]?\d*)N(\s*[\-+]\s*\d+)?|[\-+]?\d+|ODD|EVEN)\s*)\)/',$tg,$m) ) {
266
- $tg = preg_replace('/NTH-CHILD\(.*\)/', 'NTH-CHILD('.str_replace(' ','',$m[1]).')', $tg);
267
- }
268
- $tags = preg_split('/\s+/',trim($tg));
269
- $level = count($tags);
270
- $t = '';
271
- $t2 = '';
272
- $t3 = '';
273
- if (trim($tags[0])=='@PAGE') {
274
- if (isset($tags[0])) { $t = trim($tags[0]); }
275
- if (isset($tags[1])) { $t2 = trim($tags[1]); }
276
- if (isset($tags[2])) { $t3 = trim($tags[2]); }
277
- $tag = '';
278
- if ($level==1) { $tag = $t; }
279
- else if ($level==2 && preg_match('/^[:](.*)$/',$t2,$m)) {
280
- $tag = $t.'>>PSEUDO>>'.$m[1];
281
- if ($m[1]=='LEFT' || $m[1]=='RIGHT') { $pageselectors = true; } // used to turn on $this->mpdf->mirrorMargins
282
- }
283
- else if ($level==2) { $tag = $t.'>>NAMED>>'.$t2; }
284
- else if ($level==3 && preg_match('/^[:](.*)$/',$t3,$m)) {
285
- $tag = $t.'>>NAMED>>'.$t2.'>>PSEUDO>>'.$m[1];
286
- if ($m[1]=='LEFT' || $m[1]=='RIGHT') { $pageselectors = true; } // used to turn on $this->mpdf->mirrorMargins
287
- }
288
- if (isset($this->CSS[$tag]) && $tag) { $this->CSS[$tag] = $this->array_merge_recursive_unique($this->CSS[$tag], $classproperties); }
289
- else if ($tag) { $this->CSS[$tag] = $classproperties; }
290
- }
291
-
292
- else if ($level == 1) { // e.g. p or .class or #id or p.class or p#id
293
- if (isset($tags[0])) { $t = trim($tags[0]); }
294
- if ($t) {
295
- $tag = '';
296
- if (preg_match('/^[.](.*)$/',$t,$m)) { $tag = 'CLASS>>'.$m[1]; }
297
- else if (preg_match('/^[#](.*)$/',$t,$m)) { $tag = 'ID>>'.$m[1]; }
298
- else if (preg_match('/^('.$this->mpdf->allowedCSStags.')[.](.*)$/',$t,$m)) { $tag = $m[1].'>>CLASS>>'.$m[2]; }
299
- else if (preg_match('/^('.$this->mpdf->allowedCSStags.')\s*:NTH-CHILD\((.*)\)$/',$t,$m)) { $tag = $m[1].'>>SELECTORNTHCHILD>>'.$m[2]; }
300
- else if (preg_match('/^('.$this->mpdf->allowedCSStags.')[#](.*)$/',$t,$m)) { $tag = $m[1].'>>ID>>'.$m[2]; }
301
- else if (preg_match('/^('.$this->mpdf->allowedCSStags.')$/',$t)) { $tag= $t; }
302
- if (isset($this->CSS[$tag]) && $tag) { $this->CSS[$tag] = $this->array_merge_recursive_unique($this->CSS[$tag], $classproperties); }
303
- else if ($tag) { $this->CSS[$tag] = $classproperties; }
304
- }
305
- }
306
- else {
307
- $tmp = array();
308
- for($n=0;$n<$level;$n++) {
309
- if (isset($tags[$n])) { $t = trim($tags[$n]); }
310
- else { $t = ''; }
311
- if ($t) {
312
- $tag = '';
313
- if (preg_match('/^[.](.*)$/',$t,$m)) { $tag = 'CLASS>>'.$m[1]; }
314
- else if (preg_match('/^[#](.*)$/',$t,$m)) { $tag = 'ID>>'.$m[1]; }
315
- else if (preg_match('/^('.$this->mpdf->allowedCSStags.')[.](.*)$/',$t,$m)) { $tag = $m[1].'>>CLASS>>'.$m[2]; }
316
- else if (preg_match('/^('.$this->mpdf->allowedCSStags.')\s*:NTH-CHILD\((.*)\)$/',$t,$m)) { $tag = $m[1].'>>SELECTORNTHCHILD>>'.$m[2]; }
317
- else if (preg_match('/^('.$this->mpdf->allowedCSStags.')[#](.*)$/',$t,$m)) { $tag = $m[1].'>>ID>>'.$m[2]; }
318
- else if (preg_match('/^('.$this->mpdf->allowedCSStags.')$/',$t)) { $tag= $t; }
319
-
320
- if ($tag) $tmp[] = $tag;
321
- else { break; }
322
- }
323
- }
324
-
325
- if ($tag) {
326
- $x = &$this->cascadeCSS;
327
- foreach($tmp AS $tp) { $x = &$x[$tp]; }
328
- $x = $this->array_merge_recursive_unique($x, $classproperties);
329
- $x['depth'] = $level;
330
- }
331
- }
332
- }
333
- if ($pageselectors) { $this->mpdf->mirrorMargins = true; }
334
- $properties = array();
335
- $values = array();
336
- $classproperties = array();
337
- }
338
- } // end of if
339
- //Remove CSS (tags and content), if any
340
- $regexp = '/<style.*?>(.*?)<\/style>/si'; // it can be <style> or <style type="txt/css">
341
- $html = preg_replace($regexp,'',$html);
342
- //print_r($this->CSS); exit;
343
- //print_r($this->cascadeCSS); exit;
344
- return $html;
345
- }
346
-
347
-
348
-
349
- function readInlineCSS($html) {
350
- //Fix incomplete CSS code
351
- $size = strlen($html)-1;
352
- if (substr($html,$size,1) != ';') $html .= ';';
353
- //Make CSS[Name-of-the-class] = array(key => value)
354
- $regexp = '|\\s*?(\\S+?):(.+?);|i';
355
- preg_match_all( $regexp, $html, $styleinfo);
356
- $properties = $styleinfo[1];
357
- $values = $styleinfo[2];
358
- //Array-properties and Array-values must have the SAME SIZE!
359
- $classproperties = array();
360
- for($i = 0; $i < count($properties) ; $i++) {
361
- // Ignores -webkit-gradient so doesn't override -moz-
362
- if ((strtoupper($properties[$i])=='BACKGROUND-IMAGE' || strtoupper($properties[$i])=='BACKGROUND') && preg_match('/-webkit-gradient/i',$values[$i])) {
363
- continue;
364
- }
365
- $classproperties[strtoupper($properties[$i])] = trim($values[$i]);
366
- }
367
- return $this->fixCSS($classproperties);
368
- }
369
-
370
-
371
-
372
- function _fix_borderStr($bd) {
373
- preg_match_all("/\((.*?)\)/", $bd, $m);
374
- if (count($m[1])) {
375
- for($i=0;$i<count($m[1]);$i++) {
376
- $sub = preg_replace("/ /", "", $m[1][$i]);
377
- $bd = preg_replace('/'.preg_quote($m[1][$i], '/').'/si', $sub, $bd);
378
- }
379
- }
380
-
381
- $prop = preg_split('/\s+/',trim($bd));
382
- $w = 'medium';
383
- $c = '#000000';
384
- $s = 'none';
385
-
386
- if ( count($prop) == 1 ) {
387
- // solid
388
- if (in_array($prop[0],$this->mpdf->borderstyles) || $prop[0] == 'none' || $prop[0] == 'hidden' ) { $s = $prop[0]; }
389
- // #000000
390
- else if (is_array($this->mpdf->ConvertColor($prop[0]))) { $c = $prop[0]; }
391
- // 1px
392
- else { $w = $prop[0]; }
393
- }
394
- else if (count($prop) == 2 ) {
395
- // 1px solid
396
- if (in_array($prop[1],$this->mpdf->borderstyles) || $prop[1] == 'none' || $prop[1] == 'hidden' ) { $w = $prop[0]; $s = $prop[1]; }
397
- // solid #000000
398
- else if (in_array($prop[0],$this->mpdf->borderstyles) || $prop[0] == 'none' || $prop[0] == 'hidden' ) { $s = $prop[0]; $c = $prop[1]; }
399
- // 1px #000000
400
- else { $w = $prop[0]; $c = $prop[1]; }
401
- }
402
- else if ( count($prop) == 3 ) {
403
- // Change #000000 1px solid to 1px solid #000000 (proper)
404
- if (substr($prop[0],0,1) == '#') { $c = $prop[0]; $w = $prop[1]; $s = $prop[2]; }
405
- // Change solid #000000 1px to 1px solid #000000 (proper)
406
- else if (substr($prop[0],1,1) == '#') { $s = $prop[0]; $c = $prop[1]; $w = $prop[2]; }
407
- // Change solid 1px #000000 to 1px solid #000000 (proper)
408
- else if (in_array($prop[0],$this->mpdf->borderstyles) || $prop[0] == 'none' || $prop[0] == 'hidden' ) {
409
- $s = $prop[0]; $w = $prop[1]; $c = $prop[2];
410
- }
411
- else { $w = $prop[0]; $s = $prop[1]; $c = $prop[2]; }
412
- }
413
- else { return ''; }
414
- $s = strtolower($s);
415
- return $w.' '.$s.' '.$c;
416
- }
417
-
418
-
419
-
420
- function fixCSS($prop) {
421
- if (!is_array($prop) || (count($prop)==0)) return array();
422
- $newprop = array();
423
- foreach($prop AS $k => $v) {
424
- if ($k != 'BACKGROUND-IMAGE' && $k != 'BACKGROUND' && $k != 'ODD-HEADER-NAME' && $k != 'EVEN-HEADER-NAME' && $k != 'ODD-FOOTER-NAME' && $k != 'EVEN-FOOTER-NAME' && $k != 'HEADER' && $k != 'FOOTER') {
425
- $v = strtolower($v);
426
- }
427
-
428
- if ($k == 'FONT') {
429
- $s = trim($v);
430
- preg_match_all('/\"(.*?)\"/',$s,$ff);
431
- if (count($ff[1])) {
432
- foreach($ff[1] AS $ffp) {
433
- $w = preg_split('/\s+/',$ffp);
434
- $s = preg_replace('/\"'.$ffp.'\"/',$w[0],$s);
435
- }
436
- }
437
- preg_match_all('/\'(.*?)\'/',$s,$ff);
438
- if (count($ff[1])) {
439
- foreach($ff[1] AS $ffp) {
440
- $w = preg_split('/\s+/',$ffp);
441
- $s = preg_replace('/\''.$ffp.'\'/',$w[0],$s);
442
- }
443
- }
444
- $s = preg_replace('/\s*,\s*/',',',$s);
445
- $bits = preg_split('/\s+/',$s);
446
- if (count($bits)>1) {
447
- $k = 'FONT-FAMILY'; $v = $bits[(count($bits)-1)];
448
- $fs = $bits[(count($bits)-2)];
449
- if (preg_match('/(.*?)\/(.*)/',$fs, $fsp)) {
450
- $newprop['FONT-SIZE'] = $fsp[1];
451
- $newprop['LINE-HEIGHT'] = $fsp[2];
452
- }
453
- else { $newprop['FONT-SIZE'] = $fs; }
454
- if (preg_match('/(italic|oblique)/i',$s)) { $newprop['FONT-STYLE'] = 'italic'; }
455
- else { $newprop['FONT-STYLE'] = 'normal'; }
456
- if (preg_match('/bold/i',$s)) { $newprop['FONT-WEIGHT'] = 'bold'; }
457
- else { $newprop['FONT-WEIGHT'] = 'normal'; }
458
- if (preg_match('/small-caps/i',$s)) { $newprop['TEXT-TRANSFORM'] = 'uppercase'; }
459
- }
460
- }
461
- if ($k == 'FONT-FAMILY') {
462
- $aux_fontlist = explode(",",$v);
463
- $found = 0;
464
- foreach($aux_fontlist AS $f) {
465
- $fonttype = trim($f);
466
- $fonttype = preg_replace('/["\']*(.*?)["\']*/','\\1',$fonttype);
467
- $fonttype = preg_replace('/ /','',$fonttype);
468
- $v = strtolower(trim($fonttype));
469
- if (isset($this->mpdf->fonttrans[$v]) && $this->mpdf->fonttrans[$v]) { $v = $this->mpdf->fonttrans[$v]; }
470
- if ((!$this->mpdf->onlyCoreFonts && in_array($v,$this->mpdf->available_unifonts)) ||
471
- in_array($v,array('ccourier','ctimes','chelvetica')) ||
472
- ($this->mpdf->onlyCoreFonts && in_array($v,array('courier','times','helvetica','arial'))) ||
473
- in_array($v, array('sjis','uhc','big5','gb'))) {
474
- $newprop[$k] = $v;
475
- $found = 1;
476
- break;
477
- }
478
- }
479
- if (!$found) {
480
- foreach($aux_fontlist AS $f) {
481
- $fonttype = trim($f);
482
- $fonttype = preg_replace('/["\']*(.*?)["\']*/','\\1',$fonttype);
483
- $fonttype = preg_replace('/ /','',$fonttype);
484
- $v = strtolower(trim($fonttype));
485
- if (isset($this->mpdf->fonttrans[$v]) && $this->mpdf->fonttrans[$v]) { $v = $this->mpdf->fonttrans[$v]; }
486
- if (in_array($v,$this->mpdf->sans_fonts) || in_array($v,$this->mpdf->serif_fonts) || in_array($v,$this->mpdf->mono_fonts) ) {
487
- $newprop[$k] = $v;
488
- break;
489
- }
490
- }
491
- }
492
- }
493
- else if ($k == 'MARGIN') {
494
- $tmp = $this->expand24($v);
495
- $newprop['MARGIN-TOP'] = $tmp['T'];
496
- $newprop['MARGIN-RIGHT'] = $tmp['R'];
497
- $newprop['MARGIN-BOTTOM'] = $tmp['B'];
498
- $newprop['MARGIN-LEFT'] = $tmp['L'];
499
- }
500
- /*-- BORDER-RADIUS --*/
501
- else if ($k == 'BORDER-RADIUS' || $k == 'BORDER-TOP-LEFT-RADIUS' || $k == 'BORDER-TOP-RIGHT-RADIUS' || $k == 'BORDER-BOTTOM-LEFT-RADIUS' || $k == 'BORDER-BOTTOM-RIGHT-RADIUS') {
502
- $tmp = $this->border_radius_expand($v,$k);
503
- if (isset($tmp['TL-H'])) $newprop['BORDER-TOP-LEFT-RADIUS-H'] = $tmp['TL-H'];
504
- if (isset($tmp['TL-V'])) $newprop['BORDER-TOP-LEFT-RADIUS-V'] = $tmp['TL-V'];
505
- if (isset($tmp['TR-H'])) $newprop['BORDER-TOP-RIGHT-RADIUS-H'] = $tmp['TR-H'];
506
- if (isset($tmp['TR-V'])) $newprop['BORDER-TOP-RIGHT-RADIUS-V'] = $tmp['TR-V'];
507
- if (isset($tmp['BL-H'])) $newprop['BORDER-BOTTOM-LEFT-RADIUS-H'] = $tmp['BL-H'];
508
- if (isset($tmp['BL-V'])) $newprop['BORDER-BOTTOM-LEFT-RADIUS-V'] = $tmp['BL-V'];
509
- if (isset($tmp['BR-H'])) $newprop['BORDER-BOTTOM-RIGHT-RADIUS-H'] = $tmp['BR-H'];
510
- if (isset($tmp['BR-V'])) $newprop['BORDER-BOTTOM-RIGHT-RADIUS-V'] = $tmp['BR-V'];
511
- }
512
- /*-- END BORDER-RADIUS --*/
513
- else if ($k == 'PADDING') {
514
- $tmp = $this->expand24($v);
515
- $newprop['PADDING-TOP'] = $tmp['T'];
516
- $newprop['PADDING-RIGHT'] = $tmp['R'];
517
- $newprop['PADDING-BOTTOM'] = $tmp['B'];
518
- $newprop['PADDING-LEFT'] = $tmp['L'];
519
- }
520
- else if ($k == 'BORDER') {
521
- if ($v == '1') { $v = '1px solid #000000'; }
522
- else { $v = $this->_fix_borderStr($v); }
523
- $newprop['BORDER-TOP'] = $v;
524
- $newprop['BORDER-RIGHT'] = $v;
525
- $newprop['BORDER-BOTTOM'] = $v;
526
- $newprop['BORDER-LEFT'] = $v;
527
- }
528
- else if ($k == 'BORDER-TOP') {
529
- $newprop['BORDER-TOP'] = $this->_fix_borderStr($v);
530
- }
531
- else if ($k == 'BORDER-RIGHT') {
532
- $newprop['BORDER-RIGHT'] = $this->_fix_borderStr($v);
533
- }
534
- else if ($k == 'BORDER-BOTTOM') {
535
- $newprop['BORDER-BOTTOM'] = $this->_fix_borderStr($v);
536
- }
537
- else if ($k == 'BORDER-LEFT') {
538
- $newprop['BORDER-LEFT'] = $this->_fix_borderStr($v);
539
- }
540
- else if ($k == 'BORDER-STYLE') {
541
- $e = $this->expand24($v);
542
- $newprop['BORDER-TOP-STYLE'] = $e['T'];
543
- $newprop['BORDER-RIGHT-STYLE'] = $e['R'];
544
- $newprop['BORDER-BOTTOM-STYLE'] = $e['B'];
545
- $newprop['BORDER-LEFT-STYLE'] = $e['L'];
546
- }
547
- else if ($k == 'BORDER-WIDTH') {
548
- $e = $this->expand24($v);
549
- $newprop['BORDER-TOP-WIDTH'] = $e['T'];
550
- $newprop['BORDER-RIGHT-WIDTH'] = $e['R'];
551
- $newprop['BORDER-BOTTOM-WIDTH'] = $e['B'];
552
- $newprop['BORDER-LEFT-WIDTH'] = $e['L'];
553
- }
554
- else if ($k == 'BORDER-COLOR') {
555
- $e = $this->expand24($v);
556
- $newprop['BORDER-TOP-COLOR'] = $e['T'];
557
- $newprop['BORDER-RIGHT-COLOR'] = $e['R'];
558
- $newprop['BORDER-BOTTOM-COLOR'] = $e['B'];
559
- $newprop['BORDER-LEFT-COLOR'] = $e['L'];
560
- }
561
-
562
- else if ($k == 'BORDER-SPACING') {
563
- $prop = preg_split('/\s+/',trim($v));
564
- if (count($prop) == 1 ) {
565
- $newprop['BORDER-SPACING-H'] = $prop[0];
566
- $newprop['BORDER-SPACING-V'] = $prop[0];
567
- }
568
- else if (count($prop) == 2 ) {
569
- $newprop['BORDER-SPACING-H'] = $prop[0];
570
- $newprop['BORDER-SPACING-V'] = $prop[1];
571
- }
572
- }
573
- else if ($k == 'TEXT-OUTLINE') { // mPDF 5.6.07
574
- $prop = preg_split('/\s+/',trim($v));
575
- if (trim(strtolower($v)) == 'none' ) {
576
- $newprop['TEXT-OUTLINE'] = 'none';
577
- }
578
- else if (count($prop) == 2 ) {
579
- $newprop['TEXT-OUTLINE-WIDTH'] = $prop[0];
580
- $newprop['TEXT-OUTLINE-COLOR'] = $prop[1];
581
- }
582
- else if (count($prop) == 3 ) {
583
- $newprop['TEXT-OUTLINE-WIDTH'] = $prop[0];
584
- $newprop['TEXT-OUTLINE-COLOR'] = $prop[2];
585
- }
586
- }
587
- else if ($k == 'SIZE') {
588
- $prop = preg_split('/\s+/',trim($v));
589
- if (preg_match('/(auto|portrait|landscape)/',$prop[0])) {
590
- $newprop['SIZE'] = strtoupper($prop[0]);
591
- }
592
- else if (count($prop) == 1 ) {
593
- $newprop['SIZE']['W'] = $this->mpdf->ConvertSize($prop[0]);
594
- $newprop['SIZE']['H'] = $this->mpdf->ConvertSize($prop[0]);
595
- }
596
- else if (count($prop) == 2 ) {
597
- $newprop['SIZE']['W'] = $this->mpdf->ConvertSize($prop[0]);
598
- $newprop['SIZE']['H'] = $this->mpdf->ConvertSize($prop[1]);
599
- }
600
- }
601
- else if ($k == 'SHEET-SIZE') {
602
- $prop = preg_split('/\s+/',trim($v));
603
- if (count($prop) == 2 ) {
604
- $newprop['SHEET-SIZE'] = array($this->mpdf->ConvertSize($prop[0]), $this->mpdf->ConvertSize($prop[1]));
605
- }
606
- else {
607
- if(preg_match('/([0-9a-zA-Z]*)-L/i',$v,$m)) { // e.g. A4-L = A$ landscape
608
- $ft = $this->mpdf->_getPageFormat($m[1]);
609
- $format = array($ft[1],$ft[0]);
610
- }
611
- else { $format = $this->mpdf->_getPageFormat($v); }
612
- if ($format) { $newprop['SHEET-SIZE'] = array($format[0]/_MPDFK, $format[1]/_MPDFK); }
613
- }
614
- }
615
- else if ($k == 'BACKGROUND') {
616
- $bg = $this->parseCSSbackground($v);
617
- if ($bg['c']) { $newprop['BACKGROUND-COLOR'] = $bg['c']; }
618
- else { $newprop['BACKGROUND-COLOR'] = 'transparent'; }
619
- /*-- BACKGROUNDS --*/
620
- if ($bg['i']) {
621
- $newprop['BACKGROUND-IMAGE'] = $bg['i'];
622
- if ($bg['r']) { $newprop['BACKGROUND-REPEAT'] = $bg['r']; }
623
- if ($bg['p']) { $newprop['BACKGROUND-POSITION'] = $bg['p']; }
624
- }
625
- else { $newprop['BACKGROUND-IMAGE'] = ''; }
626
- /*-- END BACKGROUNDS --*/
627
- }
628
- /*-- BACKGROUNDS --*/
629
- else if ($k == 'BACKGROUND-IMAGE') {
630
- if (preg_match('/(-moz-)*(repeating-)*(linear|radial)-gradient\(.*\)/i',$v,$m)) {
631
- $newprop['BACKGROUND-IMAGE'] = $m[0];
632
- continue;
633
- }
634
- if (preg_match('/url\([\'\"]{0,1}(.*?)[\'\"]{0,1}\)/i',$v,$m)) {
635
- $newprop['BACKGROUND-IMAGE'] = $m[1];
636
- }
637
-
638
- else if (strtolower($v)=='none') { $newprop['BACKGROUND-IMAGE'] = ''; }
639
-
640
- }
641
- else if ($k == 'BACKGROUND-REPEAT') {
642
- if (preg_match('/(repeat-x|repeat-y|no-repeat|repeat)/i',$v,$m)) {
643
- $newprop['BACKGROUND-REPEAT'] = strtolower($m[1]);
644
- }
645
- }
646
- else if ($k == 'BACKGROUND-POSITION') {
647
- $s = $v;
648
- $bits = preg_split('/\s+/',trim($s));
649
- // These should be Position x1 or x2
650
- if (count($bits)==1) {
651
- if (preg_match('/bottom/',$bits[0])) { $bg['p'] = '50% 100%'; }
652
- else if (preg_match('/top/',$bits[0])) { $bg['p'] = '50% 0%'; }
653
- else { $bg['p'] = $bits[0] . ' 50%'; }
654
- }
655
- else if (count($bits)==2) {
656
- // Can be either right center or center right
657
- if (preg_match('/(top|bottom)/',$bits[0]) || preg_match('/(left|right)/',$bits[1])) {
658
- $bg['p'] = $bits[1] . ' '.$bits[0];
659
- }
660
- else {
661
- $bg['p'] = $bits[0] . ' '.$bits[1];
662
- }
663
- }
664
- if ($bg['p']) {
665
- $bg['p'] = preg_replace('/(left|top)/','0%',$bg['p']);
666
- $bg['p'] = preg_replace('/(right|bottom)/','100%',$bg['p']);
667
- $bg['p'] = preg_replace('/(center)/','50%',$bg['p']);
668
- if (!preg_match('/[\-]{0,1}\d+(in|cm|mm|pt|pc|em|ex|px|%)* [\-]{0,1}\d+(in|cm|mm|pt|pc|em|ex|px|%)*/',$bg['p'])) {
669
- $bg['p'] = false;
670
- }
671
- }
672
- if ($bg['p']) { $newprop['BACKGROUND-POSITION'] = $bg['p']; }
673
- }
674
- /*-- END BACKGROUNDS --*/
675
- else if ($k == 'IMAGE-ORIENTATION') {
676
- if (preg_match('/([\-]*[0-9\.]+)(deg|grad|rad)/i',$v,$m)) {
677
- $angle = $m[1] + 0;
678
- if (strtolower($m[2])=='deg') { $angle = $angle; }
679
- else if (strtolower($m[2])=='grad') { $angle *= (360/400); }
680
- else if (strtolower($m[2])=='rad') { $angle = rad2deg($angle); }
681
- while($angle < 0) { $angle += 360; }
682
- $angle = ($angle % 360);
683
- $angle /= 90;
684
- $angle = round($angle) * 90;
685
- $newprop['IMAGE-ORIENTATION'] = $angle;
686
- }
687
- }
688
- // mPDF 5.6.13
689
- else if ($k == 'TEXT-ALIGN') {
690
- if (preg_match('/["\'](.){1}["\']/i',$v,$m)) {
691
- $d = array_search($m[1],$this->mpdf->decimal_align);
692
- if ($d !== false) { $newprop['TEXT-ALIGN'] = $d; }
693
- if (preg_match('/(center|left|right)/i',$v,$m)) { $newprop['TEXT-ALIGN'] .= strtoupper(substr($m[1],0,1)); }
694
- else { $newprop['TEXT-ALIGN'] .= 'R'; } // default = R
695
- }
696
- else if (preg_match('/["\'](\\\[a-fA-F0-9]{1,6})["\']/i',$v,$m)) {
697
- $utf8 = codeHex2utf(substr($m[1],1,6));
698
- $d = array_search($utf8,$this->mpdf->decimal_align);
699
- if ($d !== false) { $newprop['TEXT-ALIGN'] = $d; }
700
- if (preg_match('/(center|left|right)/i',$v,$m)) { $newprop['TEXT-ALIGN'] .= strtoupper(substr($m[1],0,1)); }
701
- else { $newprop['TEXT-ALIGN'] .= 'R'; } // default = R
702
- }
703
- else { $newprop[$k] = $v; }
704
- }
705
- else if ($k == 'LIST-STYLE') { // mPDF 5.7.2
706
- if (preg_match('/(lower-roman|upper-roman|lower-latin|lower-alpha|upper-latin|upper-alpha|none|decimal|disc|circle|square|arabic-indic|bengali|devanagari|gujarati|gurmukhi|kannada|malayalam|oriya|persian|tamil|telugu|thai|urdu|cambodian|khmer|lao)/i',$v,$m)
707
- || preg_match('/U\+([a-fA-F0-9]+)/i',$v,$m)) {
708
- $newprop['LIST-STYLE-TYPE'] = strtolower(trim($m[1]));
709
- }
710
- }
711
-
712
-
713
- else {
714
- $newprop[$k] = $v;
715
- }
716
- }
717
-
718
- return $newprop;
719
- }
720
-
721
- function setCSSboxshadow($v) {
722
- $sh = array();
723
- $c = preg_match_all('/(rgba|rgb|device-cmyka|cmyka|device-cmyk|cmyk|hsla|hsl)\(.*?\)/',$v,$x); // mPDF 5.6.05
724
- for($i=0; $i<$c; $i++) {
725
- $col = preg_replace('/,/','*',$x[0][$i]);
726
- $v = preg_replace('/'.preg_quote($x[0][$i],'/').'/',$col,$v);
727
- }
728
- $ss = explode(',',$v);
729
- foreach ($ss AS $s) {
730
- $new = array('inset'=>false, 'blur'=>0, 'spread'=>0);
731
- if (preg_match('/inset/i',$s)) { $new['inset'] = true; $s = preg_replace('/\s*inset\s*/','',$s); }
732
- $p = explode(' ',trim($s));
733
- if (isset($p[0])) { $new['x'] = $this->mpdf->ConvertSize(trim($p[0]),$this->mpdf->blk[$this->mpdf->blklvl-1]['inner_width'],$this->mpdf->FontSize,false); }
734
- if (isset($p[1])) { $new['y'] = $this->mpdf->ConvertSize(trim($p[1]),$this->mpdf->blk[$this->mpdf->blklvl-1]['inner_width'],$this->mpdf->FontSize,false); }
735
- if (isset($p[2])) {
736
- if (preg_match('/^\s*[\.\-0-9]/',$p[2])) {
737
- $new['blur'] = $this->mpdf->ConvertSize(trim($p[2]),$this->mpdf->blk[$this->mpdf->blklvl-1]['inner_width'],$this->mpdf->FontSize,false);
738
- }
739
- else { $new['col'] = $this->mpdf->ConvertColor(preg_replace('/\*/',',',$p[2])); }
740
- if (isset($p[3])) {
741
- if (preg_match('/^\s*[\.\-0-9]/',$p[3])) {
742
- $new['spread'] = $this->mpdf->ConvertSize(trim($p[3]),$this->mpdf->blk[$this->mpdf->blklvl-1]['inner_width'],$this->mpdf->FontSize,false);
743
- }
744
- else { $new['col'] = $this->mpdf->ConvertColor(preg_replace('/\*/',',',$p[3])); }
745
- if (isset($p[4])) {
746
- $new['col'] = $this->mpdf->ConvertColor(preg_replace('/\*/',',',$p[4]));
747
- }
748
- }
749
- }
750
- if (!$new['col']) { $new['col'] = $this->mpdf->ConvertColor('#888888'); }
751
- if (isset($new['y'])) { array_unshift($sh, $new); }
752
- }
753
- return $sh;
754
- }
755
-
756
- function setCSStextshadow($v) {
757
- $sh = array();
758
- $c = preg_match_all('/(rgba|rgb|device-cmyka|cmyka|device-cmyk|cmyk|hsla|hsl)\(.*?\)/',$v,$x); // mPDF 5.6.05
759
- for($i=0; $i<$c; $i++) {
760
- $col = preg_replace('/,/','*',$x[0][$i]);
761
- $v = preg_replace('/'.preg_quote($x[0][$i],'/').'/',$col,$v);
762
- }
763
- $ss = explode(',',$v);
764
- foreach ($ss AS $s) {
765
- $new = array('blur'=>0);
766
- $p = explode(' ',trim($s));
767
- if (isset($p[0])) { $new['x'] = $this->mpdf->ConvertSize(trim($p[0]),$this->mpdf->blk[$this->mpdf->blklvl-1]['inner_width'],$this->mpdf->FontSize,false); }
768
- if (isset($p[1])) { $new['y'] = $this->mpdf->ConvertSize(trim($p[1]),$this->mpdf->blk[$this->mpdf->blklvl-1]['inner_width'],$this->mpdf->FontSize,false); }
769
- if (isset($p[2])) {
770
- if (preg_match('/^\s*[\.\-0-9]/',$p[2])) {
771
- $new['blur'] = $this->mpdf->ConvertSize(trim($p[2]),$this->mpdf->blk[$this->mpdf->blklvl-1]['inner_width'],$this->mpdf->FontSize,false);
772
- }
773
- else { $new['col'] = $this->mpdf->ConvertColor(preg_replace('/\*/',',',$p[2])); }
774
- if (isset($p[3])) {
775
- $new['col'] = $this->mpdf->ConvertColor(preg_replace('/\*/',',',$p[3]));
776
- }
777
- }
778
- if (!$new['col']) { $new['col'] = $this->mpdf->ConvertColor('#888888'); }
779
- if (isset($new['y'])) { array_unshift($sh, $new); }
780
- }
781
- return $sh;
782
- }
783
-
784
- function parseCSSbackground($s) {
785
- $bg = array('c'=>false, 'i'=>false, 'r'=>false, 'p'=>false, );
786
- /*-- BACKGROUNDS --*/
787
- if (preg_match('/(-moz-)*(repeating-)*(linear|radial)-gradient\(.*\)/i',$s,$m)) {
788
- $bg['i'] = $m[0];
789
- }
790
- else
791
- /*-- END BACKGROUNDS --*/
792
- if (preg_match('/url\(/i',$s)) {
793
- // If color, set and strip it off
794
- // mPDF 5.6.05
795
- if (preg_match('/^\s*(#[0-9a-fA-F]{3,6}|(rgba|rgb|device-cmyka|cmyka|device-cmyk|cmyk|hsla|hsl|spot)\(.*?\)|[a-zA-Z]{3,})\s+(url\(.*)/i',$s,$m)) {
796
- $bg['c'] = strtolower($m[1]);
797
- $s = $m[3];
798
- }
799
- /*-- BACKGROUNDS --*/
800
- if (preg_match('/url\([\'\"]{0,1}(.*?)[\'\"]{0,1}\)\s*(.*)/i',$s,$m)) {
801
- $bg['i'] = $m[1];
802
- $s = strtolower($m[2]);
803
- if (preg_match('/(repeat-x|repeat-y|no-repeat|repeat)/',$s,$m)) {
804
- $bg['r'] = $m[1];
805
- }
806
- // Remove repeat, attachment (discarded) and also any inherit
807
- $s = preg_replace('/(repeat-x|repeat-y|no-repeat|repeat|scroll|fixed|inherit)/','',$s);
808
- $bits = preg_split('/\s+/',trim($s));
809
- // These should be Position x1 or x2
810
- if (count($bits)==1) {
811
- if (preg_match('/bottom/',$bits[0])) { $bg['p'] = '50% 100%'; }
812
- else if (preg_match('/top/',$bits[0])) { $bg['p'] = '50% 0%'; }
813
- else { $bg['p'] = $bits[0] . ' 50%'; }
814
- }
815
- else if (count($bits)==2) {
816
- // Can be either right center or center right
817
- if (preg_match('/(top|bottom)/',$bits[0]) || preg_match('/(left|right)/',$bits[1])) {
818
- $bg['p'] = $bits[1] . ' '.$bits[0];
819
- }
820
- else {
821
- $bg['p'] = $bits[0] . ' '.$bits[1];
822
- }
823
- }
824
- if ($bg['p']) {
825
- $bg['p'] = preg_replace('/(left|top)/','0%',$bg['p']);
826
- $bg['p'] = preg_replace('/(right|bottom)/','100%',$bg['p']);
827
- $bg['p'] = preg_replace('/(center)/','50%',$bg['p']);
828
- if (!preg_match('/[\-]{0,1}\d+(in|cm|mm|pt|pc|em|ex|px|%)* [\-]{0,1}\d+(in|cm|mm|pt|pc|em|ex|px|%)*/',$bg['p'])) {
829
- $bg['p'] = false;
830
- }
831
- }
832
- }
833
- /*-- END BACKGROUNDS --*/
834
- }
835
- else if (preg_match('/^\s*(#[0-9a-fA-F]{3,6}|(rgba|rgb|device-cmyka|cmyka|device-cmyk|cmyk|hsla|hsl|spot)\(.*?\)|[a-zA-Z]{3,})/i',$s,$m)) { $bg['c'] = strtolower($m[1]); } // mPDF 5.6.05
836
- return ($bg);
837
- }
838
-
839
-
840
- function expand24($mp) {
841
- $prop = preg_split('/\s+/',trim($mp));
842
- if (count($prop) == 1 ) {
843
- return array('T' => $prop[0], 'R' => $prop[0], 'B' => $prop[0], 'L'=> $prop[0]);
844
- }
845
- if (count($prop) == 2 ) {
846
- return array('T' => $prop[0], 'R' => $prop[1], 'B' => $prop[0], 'L'=> $prop[1]);
847
- }
848
-
849
- if (count($prop) == 3 ) {
850
- return array('T' => $prop[0], 'R' => $prop[1], 'B' => $prop[2], 'L'=> $prop[1]);
851
- }
852
- if (count($prop) == 4 ) {
853
- return array('T' => $prop[0], 'R' => $prop[1], 'B' => $prop[2], 'L'=> $prop[3]);
854
- }
855
- return array();
856
- }
857
-
858
- /*-- BORDER-RADIUS --*/
859
- function border_radius_expand($val,$k) {
860
- $b = array();
861
- if ($k == 'BORDER-RADIUS') {
862
- $hv = explode('/',trim($val));
863
- $prop = preg_split('/\s+/',trim($hv[0]));
864
- if (count($prop)==1) {
865
- $b['TL-H'] = $b['TR-H'] = $b['BR-H'] = $b['BL-H'] = $prop[0];
866
- }
867
- else if (count($prop)==2) {
868
- $b['TL-H'] = $b['BR-H'] = $prop[0];
869
- $b['TR-H'] = $b['BL-H'] = $prop[1];
870
- }
871
- else if (count($prop)==3) {
872
- $b['TL-H'] = $prop[0];
873
- $b['TR-H'] = $b['BL-H'] = $prop[1];
874
- $b['BR-H'] = $prop[2];
875
- }
876
- else if (count($prop)==4) {
877
- $b['TL-H'] = $prop[0];
878
- $b['TR-H'] = $prop[1];
879
- $b['BR-H'] = $prop[2];
880
- $b['BL-H'] = $prop[3];
881
- }
882
- if (count($hv)==2) {
883
- $prop = preg_split('/\s+/',trim($hv[1]));
884
- if (count($prop)==1) {
885
- $b['TL-V'] = $b['TR-V'] = $b['BR-V'] = $b['BL-V'] = $prop[0];
886
- }
887
- else if (count($prop)==2) {
888
- $b['TL-V'] = $b['BR-V'] = $prop[0];
889
- $b['TR-V'] = $b['BL-V'] = $prop[1];
890
- }
891
- else if (count($prop)==3) {
892
- $b['TL-V'] = $prop[0];
893
- $b['TR-V'] = $b['BL-V'] = $prop[1];
894
- $b['BR-V'] = $prop[2];
895
- }
896
- else if (count($prop)==4) {
897
- $b['TL-V'] = $prop[0];
898
- $b['TR-V'] = $prop[1];
899
- $b['BR-V'] = $prop[2];
900
- $b['BL-V'] = $prop[3];
901
- }
902
- }
903
- else {
904
- $b['TL-V'] = $b['TL-H'];
905
- $b['TR-V'] = $b['TR-H'];
906
- $b['BL-V'] = $b['BL-H'];
907
- $b['BR-V'] = $b['BR-H'];
908
- }
909
- return $b;
910
- }
911
-
912
- // Parse 2
913
- $h = 0;
914
- $v = 0;
915
- $prop = preg_split('/\s+/',trim($val));
916
- if (count($prop)==1) { $h = $v = $val; }
917
- else { $h = $prop[0]; $v = $prop[1]; }
918
- if ($h==0 || $v==0) { $h = $v = 0; }
919
- if ($k == 'BORDER-TOP-LEFT-RADIUS') {
920
- $b['TL-H'] = $h;
921
- $b['TL-V'] = $v;
922
- }
923
- else if ($k == 'BORDER-TOP-RIGHT-RADIUS') {
924
- $b['TR-H'] = $h;
925
- $b['TR-V'] = $v;
926
- }
927
- else if ($k == 'BORDER-BOTTOM-LEFT-RADIUS') {
928
- $b['BL-H'] = $h;
929
- $b['BL-V'] = $v;
930
- }
931
- else if ($k == 'BORDER-BOTTOM-RIGHT-RADIUS') {
932
- $b['BR-H'] = $h;
933
- $b['BR-V'] = $v;
934
- }
935
- return $b;
936
-
937
- }
938
- /*-- END BORDER-RADIUS --*/
939
-
940
- function _mergeCSS($p, &$t) {
941
- // Save Cascading CSS e.g. "div.topic p" at this block level
942
- if (isset($p) && $p) {
943
- if ($t) {
944
- $t = $this->array_merge_recursive_unique($t, $p);
945
- }
946
- else { $t = $p; }
947
- }
948
- }
949
-
950
- // for CSS handling
951
- function array_merge_recursive_unique($array1, $array2) {
952
- $arrays = func_get_args();
953
- $narrays = count($arrays);
954
- $ret = $arrays[0];
955
- for ($i = 1; $i < $narrays; $i ++) {
956
- foreach ($arrays[$i] as $key => $value) {
957
- if (((string) $key) === ((string) intval($key))) { // integer or string as integer key - append
958
- $ret[] = $value;
959
- }
960
- else { // string key - merge
961
- if (is_array($value) && isset($ret[$key])) {
962
- $ret[$key] = $this->array_merge_recursive_unique($ret[$key], $value);
963
- }
964
- else {
965
- $ret[$key] = $value;
966
- }
967
- }
968
- }
969
- }
970
- return $ret;
971
- }
972
-
973
-
974
-
975
- function _mergeFullCSS($p, &$t, $tag, $classes, $id) {
976
- $this->_mergeCSS($p[$tag], $t);
977
- // STYLESHEET CLASS e.g. .smallone{} .redletter{}
978
- foreach($classes AS $class) {
979
- $this->_mergeCSS($p['CLASS>>'.$class], $t);
980
- }
981
- // STYLESHEET nth-child SELECTOR e.g. tr:nth-child(odd) td:nth-child(2n+1)
982
- if ($tag=='TR' && isset($p) && $p) {
983
- foreach($p AS $k=>$val) {
984
- if (preg_match('/'.$tag.'>>SELECTORNTHCHILD>>(.*)/',$k, $m)) {
985
- $select = false;
986
- if ($tag=='TR') {
987
- $row = $this->mpdf->row;
988
- $thnr = (isset($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['is_thead']) ? count($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['is_thead']) : 0);
989
- $tfnr = (isset($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['is_tfoot']) ? count($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['is_tfoot']) : 0);
990
- if ($this->mpdf->tabletfoot) { $row -= $thnr; }
991
- else if (!$this->mpdf->tablethead) { $row -= ($thnr + $tfnr); }
992
- if (preg_match('/(([\-+]?\d*)?N([\-+]\d+)?|[\-+]?\d+|ODD|EVEN)/',$m[1],$a)) { // mPDF 5.7.4
993
- $select = $this->_nthchild($a, $row);
994
- }
995
- }
996
- else if ($tag=='TD' || $tag=='TH') {
997
- if (preg_match('/(([\-+]?\d*)?N([\-+]\d+)?|[\-+]?\d+|ODD|EVEN)/',$m[1],$a)) { // mPDF 5.7.4
998
- $select = $this->_nthchild($a, $this->mpdf->col);
999
- }
1000
- }
1001
- if ($select) {
1002
- $this->_mergeCSS($p[$tag.'>>SELECTORNTHCHILD>>'.$m[1]], $t);
1003
- }
1004
- }
1005
- }
1006
- }
1007
- // STYLESHEET CLASS e.g. #smallone{} #redletter{}
1008
- if (isset($id) && $id) {
1009
- $this->_mergeCSS($p['ID>>'.$id], $t);
1010
- }
1011
- // STYLESHEET CLASS e.g. .smallone{} .redletter{}
1012
- foreach($classes AS $class) {
1013
- $this->_mergeCSS($p[$tag.'>>CLASS>>'.$class], $t);
1014
- }
1015
- // STYLESHEET CLASS e.g. #smallone{} #redletter{}
1016
- if (isset($id)) {
1017
- $this->_mergeCSS($p[$tag.'>>ID>>'.$id], $t);
1018
- }
1019
- }
1020
-
1021
- function setBorderDominance($prop, $val) {
1022
- if (isset($prop['BORDER-LEFT']) && $prop['BORDER-LEFT']) { $this->cell_border_dominance_L = $val; }
1023
- if (isset($prop['BORDER-RIGHT']) && $prop['BORDER-RIGHT']) { $this->cell_border_dominance_R = $val; }
1024
- if (isset($prop['BORDER-TOP']) && $prop['BORDER-TOP']) { $this->cell_border_dominance_T = $val; }
1025
- if (isset($prop['BORDER-BOTTOM']) && $prop['BORDER-BOTTOM']) { $this->cell_border_dominance_B = $val; }
1026
- }
1027
-
1028
- function _set_mergedCSS(&$m, &$p, $d=true, $bd=false) {
1029
- if (isset($m)) {
1030
- if ((isset($m['depth']) && $m['depth']>1) || $d==false) { // include check for 'depth'
1031
- if ($bd) { $this->setBorderDominance($m, $bd); } // *TABLES*
1032
- if (is_array($m)) {
1033
- $p = array_merge($p,$m);
1034
- $this->_mergeBorders($p,$m);
1035
- }
1036
- }
1037
- }
1038
- }
1039
-
1040
-
1041
- function _mergeBorders(&$b, &$a) { // Merges $a['BORDER-TOP-STYLE'] to $b['BORDER-TOP'] etc.
1042
- foreach(array('TOP','RIGHT','BOTTOM','LEFT') AS $side) {
1043
- foreach(array('STYLE','WIDTH','COLOR') AS $el) {
1044
- if (isset($a['BORDER-'.$side.'-'.$el])) { // e.g. $b['BORDER-TOP-STYLE']
1045
- $s = trim($a['BORDER-'.$side.'-'.$el]);
1046
- if (isset($b['BORDER-'.$side])) { // e.g. $b['BORDER-TOP']
1047
- $p = trim($b['BORDER-'.$side]);
1048
- }
1049
- else { $p = ''; }
1050
- if ($el=='STYLE') {
1051
- if ($p) { $b['BORDER-'.$side] = preg_replace('/(\S+)\s+(\S+)\s+(\S+)/', '\\1 '.$s.' \\3', $p); }
1052
- else { $b['BORDER-'.$side] = '0px '.$s.' #000000'; }
1053
- }
1054
- else if ($el=='WIDTH') {
1055
- if ($p) { $b['BORDER-'.$side] = preg_replace('/(\S+)\s+(\S+)\s+(\S+)/', $s.' \\2 \\3', $p); }
1056
- else { $b['BORDER-'.$side] = $s.' none #000000'; }
1057
- }
1058
- else if ($el=='COLOR') {
1059
- if ($p) { $b['BORDER-'.$side] = preg_replace('/(\S+)\s+(\S+)\s+(\S+)/', '\\1 \\2 '.$s, $p); }
1060
- else { $b['BORDER-'.$side] = '0px none '.$s; }
1061
- }
1062
- }
1063
- }
1064
- }
1065
- }
1066
-
1067
-
1068
- function MergeCSS($inherit,$tag,$attr) {
1069
- $p = array();
1070
- $zp = array();
1071
-
1072
- $classes = array();
1073
- if (isset($attr['CLASS'])) {
1074
- $classes = preg_split('/\s+/',$attr['CLASS']);
1075
- }
1076
- if (!isset($attr['ID'])) { $attr['ID']=''; }
1077
- //===============================================
1078
- /*-- TABLES --*/
1079
- // Set Inherited properties
1080
- if ($inherit == 'TOPTABLE') { // $tag = TABLE
1081
- //===============================================
1082
- // Save Cascading CSS e.g. "div.topic p" at this block level
1083
-
1084
- if (isset($this->mpdf->blk[$this->mpdf->blklvl]['cascadeCSS'])) {
1085
- $this->tablecascadeCSS[0] = $this->mpdf->blk[$this->mpdf->blklvl]['cascadeCSS'];
1086
- }
1087
- else {
1088
- $this->tablecascadeCSS[0] = $this->cascadeCSS;
1089
- }
1090
- }
1091
- //===============================================
1092
- // Set Inherited properties
1093
- if ($inherit == 'TOPTABLE' || $inherit == 'TABLE') {
1094
- //Cascade everything from last level that is not an actual property, or defined by current tag/attributes
1095
- if (isset($this->tablecascadeCSS[$this->tbCSSlvl-1]) && is_array($this->tablecascadeCSS[$this->tbCSSlvl-1])) {
1096
- foreach($this->tablecascadeCSS[$this->tbCSSlvl-1] AS $k=>$v) {
1097
- $this->tablecascadeCSS[$this->tbCSSlvl][$k] = $v;
1098
- }
1099
- }
1100
- $this->_mergeFullCSS($this->cascadeCSS, $this->tablecascadeCSS[$this->tbCSSlvl], $tag, $classes, $attr['ID']);
1101
- //===============================================
1102
- // Cascading forward CSS e.g. "table.topic td" for this table in $this->tablecascadeCSS
1103
- //===============================================
1104
- // STYLESHEET TAG e.g. table
1105
- $this->_mergeFullCSS($this->tablecascadeCSS[$this->tbCSSlvl-1], $this->tablecascadeCSS[$this->tbCSSlvl], $tag, $classes, $attr['ID']);
1106
- //===============================================
1107
- }
1108
- /*-- END TABLES --*/
1109
- //===============================================
1110
- /*-- LISTS --*/
1111
- // Set Inherited properties
1112
- if ($inherit == 'TOPLIST') { // $tag = UL,OL
1113
- //===============================================
1114
- // Save Cascading CSS e.g. "div.topic p" at this block level
1115
- if (isset($this->mpdf->blk[$this->mpdf->blklvl]['cascadeCSS'])) {
1116
- $this->listcascadeCSS[0] = $this->mpdf->blk[$this->mpdf->blklvl]['cascadeCSS'];
1117
- }
1118
- else {
1119
- $this->listcascadeCSS[0] = $this->cascadeCSS;
1120
- }
1121
- }
1122
- //===============================================
1123
- // Set Inherited properties
1124
- if ($inherit == 'TOPLIST' || $inherit == 'LIST') {
1125
- //Cascade everything from last level that is not an actual property, or defined by current tag/attributes
1126
- if (isset($this->listcascadeCSS[$this->listCSSlvl-1]) && is_array($this->listcascadeCSS[$this->listCSSlvl-1])) {
1127
- foreach($this->listcascadeCSS[$this->listCSSlvl-1] AS $k=>$v) {
1128
- $this->listcascadeCSS[$this->listCSSlvl][$k] = $v;
1129
- }
1130
- }
1131
- $this->_mergeFullCSS($this->cascadeCSS, $this->listcascadeCSS[$this->listCSSlvl], $tag, $classes, $attr['ID']);
1132
- //===============================================
1133
- // Cascading forward CSS e.g. "table.topic td" for this list in $this->listcascadeCSS
1134
- //===============================================
1135
- // STYLESHEET TAG e.g. table
1136
- $this->_mergeFullCSS($this->listcascadeCSS[$this->listCSSlvl-1], $this->listcascadeCSS[$this->listCSSlvl], $tag, $classes, $attr['ID']);
1137
- //===============================================
1138
- }
1139
- /*-- END LISTS --*/
1140
- //===============================================
1141
- // Set Inherited properties
1142
- if ($inherit == 'BLOCK') {
1143
- if (isset($this->mpdf->blk[$this->mpdf->blklvl-1]['cascadeCSS']) && is_array($this->mpdf->blk[$this->mpdf->blklvl-1]['cascadeCSS'])) {
1144
- foreach($this->mpdf->blk[$this->mpdf->blklvl-1]['cascadeCSS'] AS $k=>$v) {
1145
- $this->mpdf->blk[$this->mpdf->blklvl]['cascadeCSS'][$k] = $v;
1146
-
1147
- }
1148
- }
1149
-
1150
- //===============================================
1151
- // Save Cascading CSS e.g. "div.topic p" at this block level
1152
- $this->_mergeFullCSS($this->cascadeCSS, $this->mpdf->blk[$this->mpdf->blklvl]['cascadeCSS'], $tag, $classes, $attr['ID']);
1153
- //===============================================
1154
- // Cascading forward CSS
1155
- //===============================================
1156
- $this->_mergeFullCSS($this->mpdf->blk[$this->mpdf->blklvl-1]['cascadeCSS'], $this->mpdf->blk[$this->mpdf->blklvl]['cascadeCSS'], $tag, $classes, $attr['ID']);
1157
- //===============================================
1158
- // Block properties
1159
- if (isset($this->mpdf->blk[$this->mpdf->blklvl-1]['margin_collapse']) && $this->mpdf->blk[$this->mpdf->blklvl-1]['margin_collapse']) { $p['MARGIN-COLLAPSE'] = 'COLLAPSE'; } // custom tag, but follows CSS principle that border-collapse is inherited
1160
- if (isset($this->mpdf->blk[$this->mpdf->blklvl-1]['line_height']) && $this->mpdf->blk[$this->mpdf->blklvl-1]['line_height']) { $p['LINE-HEIGHT'] = $this->mpdf->blk[$this->mpdf->blklvl-1]['line_height']; }
1161
-
1162
- if (isset($this->mpdf->blk[$this->mpdf->blklvl-1]['direction']) && $this->mpdf->blk[$this->mpdf->blklvl-1]['direction']) { $p['DIRECTION'] = $this->mpdf->blk[$this->mpdf->blklvl-1]['direction']; }
1163
-
1164
- if (isset($this->mpdf->blk[$this->mpdf->blklvl-1]['align']) && $this->mpdf->blk[$this->mpdf->blklvl-1]['align']) {
1165
- if ($this->mpdf->blk[$this->mpdf->blklvl-1]['align'] == 'L') { $p['TEXT-ALIGN'] = 'left'; }
1166
- else if ($this->mpdf->blk[$this->mpdf->blklvl-1]['align'] == 'J') { $p['TEXT-ALIGN'] = 'justify'; }
1167
- else if ($this->mpdf->blk[$this->mpdf->blklvl-1]['align'] == 'R') { $p['TEXT-ALIGN'] = 'right'; }
1168
- else if ($this->mpdf->blk[$this->mpdf->blklvl-1]['align'] == 'C') { $p['TEXT-ALIGN'] = 'center'; }
1169
- }
1170
- if ($this->mpdf->ColActive || $this->mpdf->keep_block_together) {
1171
- if (isset($this->mpdf->blk[$this->mpdf->blklvl-1]['bgcolor']) && $this->mpdf->blk[$this->mpdf->blklvl-1]['bgcolor']) { // Doesn't officially inherit, but default value is transparent (?=inherited)
1172
- $cor = $this->mpdf->blk[$this->mpdf->blklvl-1]['bgcolorarray' ];
1173
- $p['BACKGROUND-COLOR'] = $this->mpdf->_colAtoString($cor);
1174
- }
1175
- }
1176
-
1177
- if (isset($this->mpdf->blk[$this->mpdf->blklvl-1]['text_indent']) && ($this->mpdf->blk[$this->mpdf->blklvl-1]['text_indent'] || $this->mpdf->blk[$this->mpdf->blklvl-1]['text_indent']===0)) { $p['TEXT-INDENT'] = $this->mpdf->blk[$this->mpdf->blklvl-1]['text_indent']; }
1178
- if (isset($this->mpdf->blk[$this->mpdf->blklvl-1]['InlineProperties'])) {
1179
- $biilp = $this->mpdf->blk[$this->mpdf->blklvl-1]['InlineProperties'];
1180
- }
1181
- else { $biilp = null; }
1182
- if (isset($biilp[ 'family' ]) && $biilp[ 'family' ]) { $p['FONT-FAMILY'] = $biilp[ 'family' ]; }
1183
- if (isset($biilp[ 'I' ]) && $biilp[ 'I' ]) { $p['FONT-STYLE'] = 'italic'; }
1184
- if (isset($biilp[ 'sizePt' ]) && $biilp[ 'sizePt' ]) { $p['FONT-SIZE'] = $biilp[ 'sizePt' ] . 'pt'; }
1185
- if (isset($biilp[ 'B' ]) && $biilp[ 'B' ]) { $p['FONT-WEIGHT'] = 'bold'; }
1186
- if (isset($biilp[ 'colorarray' ]) && $biilp[ 'colorarray' ]) {
1187
- $cor = $biilp[ 'colorarray' ];
1188
- $p['COLOR'] = $this->mpdf->_colAtoString($cor);
1189
- }
1190
- if (isset($biilp[ 'fontkerning' ])) {
1191
- if ($biilp[ 'fontkerning' ]) { $p['FONT-KERNING'] = 'normal'; }
1192
- else { $p['FONT-KERNING'] = 'none'; }
1193
- }
1194
- if (isset($biilp[ 'lSpacingCSS' ]) && $biilp[ 'lSpacingCSS' ]) { $p['LETTER-SPACING'] = $biilp[ 'lSpacingCSS' ]; }
1195
- if (isset($biilp[ 'wSpacingCSS' ]) && $biilp[ 'wSpacingCSS' ]) { $p['WORD-SPACING'] = $biilp[ 'wSpacingCSS' ]; }
1196
- if (isset($biilp[ 'toupper' ]) && $biilp[ 'toupper' ]) { $p['TEXT-TRANSFORM'] = 'uppercase'; }
1197
- else if (isset($biilp[ 'tolower' ]) && $biilp[ 'tolower' ]) { $p['TEXT-TRANSFORM'] = 'lowercase'; }
1198
- else if (isset($biilp[ 'capitalize' ]) && $biilp[ 'capitalize' ]) { $p['TEXT-TRANSFORM'] = 'capitalize'; }
1199
- // CSS says text-decoration is not inherited, but IE7 does??
1200
- if (isset($biilp[ 'underline' ]) && $biilp[ 'underline' ]) { $p['TEXT-DECORATION'] = 'underline'; }
1201
- if (isset($biilp[ 'smCaps' ]) && $biilp[ 'smCaps' ]) { $p['FONT-VARIANT'] = 'small-caps'; }
1202
-
1203
- }
1204
- //===============================================
1205
- //===============================================
1206
- /*-- LISTS --*/
1207
- // Set Inherited properties
1208
- if ($inherit == 'TOPLIST') {
1209
- if ($this->listCSSlvl == 1) {
1210
- $bilp = $this->mpdf->blk[$this->mpdf->blklvl]['InlineProperties'];
1211
- if (isset($bilp[ 'family' ]) && $bilp[ 'family' ]) { $p['FONT-FAMILY'] = $bilp[ 'family' ]; }
1212
- if (isset($bilp[ 'I' ]) && $bilp[ 'I' ]) { $p['FONT-STYLE'] = 'italic'; }
1213
- if (isset($bilp[ 'sizePt' ]) && $bilp[ 'sizePt' ]) { $p['FONT-SIZE'] = $bilp[ 'sizePt' ] . 'pt'; }
1214
- if (isset($bilp[ 'B' ]) && $bilp[ 'B' ]) { $p['FONT-WEIGHT'] = 'bold'; }
1215
- if (isset($bilp[ 'colorarray' ]) && $bilp[ 'colorarray' ]) {
1216
- $cor = $bilp[ 'colorarray' ];
1217
- $p['COLOR'] = $this->mpdf->_colAtoString($cor);
1218
- }
1219
- if (isset($bilp[ 'toupper' ]) && $bilp[ 'toupper' ]) { $p['TEXT-TRANSFORM'] = 'uppercase'; }
1220
- else if (isset($bilp[ 'tolower' ]) && $bilp[ 'tolower' ]) { $p['TEXT-TRANSFORM'] = 'lowercase'; }
1221
- else if (isset($bilp[ 'capitalize' ]) && $bilp[ 'capitalize' ]) { $p['TEXT-TRANSFORM'] = 'capitalize'; }
1222
- if (isset($bilp[ 'fontkerning' ])) {
1223
- if ($bilp[ 'fontkerning' ]) { $p['FONT-KERNING'] = 'normal'; }
1224
- else { $p['FONT-KERNING'] = 'none'; }
1225
- }
1226
- if (isset($bilp[ 'lSpacingCSS' ]) && $bilp[ 'lSpacingCSS' ]) { $p['LETTER-SPACING'] = $bilp[ 'lSpacingCSS' ]; }
1227
- if (isset($bilp[ 'wSpacingCSS' ]) && $bilp[ 'wSpacingCSS' ]) { $p['WORD-SPACING'] = $bilp[ 'wSpacingCSS' ]; }
1228
- // CSS says text-decoration is not inherited, but IE7 does??
1229
- if (isset($bilp[ 'underline' ]) && $bilp[ 'underline' ]) { $p['TEXT-DECORATION'] = 'underline'; }
1230
- if (isset($bilp[ 'smCaps' ]) && $bilp[ 'smCaps' ]) { $p['FONT-VARIANT'] = 'small-caps'; }
1231
- if ($tag=='LI') {
1232
- // Note to self - this should never work, as TOPLIST is not called when LI (see code removed in v5.3)
1233
- $this->mpdf->Error("If you see this message, please report this as a bug to the mPDF Forum.");
1234
- }
1235
- }
1236
- }
1237
- /*-- END LISTS --*/
1238
- //===============================================
1239
- //===============================================
1240
- // DEFAULT for this TAG set in DefaultCSS
1241
- if (isset($this->mpdf->defaultCSS[$tag])) {
1242
- $zp = $this->fixCSS($this->mpdf->defaultCSS[$tag]);
1243
- if (is_array($zp)) { // Default overwrites Inherited
1244
- $p = array_merge($p,$zp); // !! Note other way round !!
1245
- $this->_mergeBorders($p,$zp);
1246
- }
1247
- }
1248
- //===============================================
1249
- /*-- TABLES --*/
1250
- // mPDF 5.7.3
1251
- // cellSpacing overwrites TABLE default but not specific CSS set on table
1252
- if ($tag=='TABLE' && isset($attr['CELLSPACING'])) {
1253
- $p['BORDER-SPACING-H'] = $p['BORDER-SPACING-V'] = $attr['CELLSPACING'];
1254
- }
1255
- // cellPadding overwrites TD/TH default but not specific CSS set on cell
1256
- if (($tag=='TD' || $tag=='TH') && isset($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['cell_padding']) && ($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['cell_padding'] || $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['cell_padding']==='0')) { // mPDF 5.7.3
1257
- $p['PADDING-LEFT'] = $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['cell_padding'];
1258
- $p['PADDING-RIGHT'] = $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['cell_padding'];
1259
- $p['PADDING-TOP'] = $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['cell_padding'];
1260
- $p['PADDING-BOTTOM'] = $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['cell_padding'];
1261
- }
1262
- /*-- END TABLES --*/
1263
- //===============================================
1264
- // STYLESHEET TAG e.g. h1 p div table
1265
- if (isset($this->CSS[$tag]) && $this->CSS[$tag]) {
1266
- $zp = $this->CSS[$tag];
1267
- if ($tag=='TD' || $tag=='TH') { $this->setBorderDominance($zp, 9); } // *TABLES* // *TABLES-ADVANCED-BORDERS*
1268
- if (is_array($zp)) {
1269
- $p = array_merge($p,$zp);
1270
- $this->_mergeBorders($p,$zp);
1271
- }
1272
- }
1273
- //===============================================
1274
- // STYLESHEET CLASS e.g. .smallone{} .redletter{}
1275
- foreach($classes AS $class) {
1276
- $zp = array();
1277
- if (isset($this->CSS['CLASS>>'.$class]) && $this->CSS['CLASS>>'.$class]) { $zp = $this->CSS['CLASS>>'.$class]; }
1278
- if ($tag=='TD' || $tag=='TH') { $this->setBorderDominance($zp, 9); } // *TABLES* // *TABLES-ADVANCED-BORDERS*
1279
- if (is_array($zp)) {
1280
- $p = array_merge($p,$zp);
1281
- $this->_mergeBorders($p,$zp);
1282
- }
1283
- }
1284
- //===============================================
1285
- /*-- TABLES --*/
1286
- // STYLESHEET nth-child SELECTOR e.g. tr:nth-child(odd) td:nth-child(2n+1)
1287
- if ($tag=='TR' || $tag=='TD' || $tag=='TH') {
1288
- foreach($this->CSS AS $k=>$val) {
1289
- if (preg_match('/'.$tag.'>>SELECTORNTHCHILD>>(.*)/',$k, $m)) {
1290
- $select = false;
1291
- if ($tag=='TR') {
1292
- $row = $this->mpdf->row;
1293
- $thnr = (isset($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['is_thead']) ? count($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['is_thead']) : 0);
1294
- $tfnr = (isset($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['is_tfoot']) ? count($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['is_tfoot']) : 0);
1295
- if ($this->mpdf->tabletfoot) { $row -= $thnr; }
1296
- else if (!$this->mpdf->tablethead) { $row -= ($thnr + $tfnr); }
1297
- if (preg_match('/(([\-+]?\d*)?N([\-+]\d+)?|[\-+]?\d+|ODD|EVEN)/',$m[1],$a)) { // mPDF 5.7.4
1298
- $select = $this->_nthchild($a, $row);
1299
- }
1300
- }
1301
- else if ($tag=='TD' || $tag=='TH') {
1302
- if (preg_match('/(([\-+]?\d*)?N([\-+]\d+)?|[\-+]?\d+|ODD|EVEN)/',$m[1],$a)) { // mPDF 5.7.4
1303
- $select = $this->_nthchild($a, $this->mpdf->col);
1304
- }
1305
- }
1306
- if ($select) {
1307
- $zp = $this->CSS[$tag.'>>SELECTORNTHCHILD>>'.$m[1]];
1308
- if ($tag=='TD' || $tag=='TH') { $this->setBorderDominance($zp, 9); }
1309
- if (is_array($zp)) {
1310
- $p = array_merge($p,$zp);
1311
- $this->_mergeBorders($p,$zp);
1312
- }
1313
- }
1314
- }
1315
- }
1316
- }
1317
- /*-- END TABLES --*/
1318
- //===============================================
1319
- // STYLESHEET ID e.g. #smallone{} #redletter{}
1320
- if (isset($attr['ID']) && isset($this->CSS['ID>>'.$attr['ID']]) && $this->CSS['ID>>'.$attr['ID']]) {
1321
- $zp = $this->CSS['ID>>'.$attr['ID']];
1322
- if ($tag=='TD' || $tag=='TH') { $this->setBorderDominance($zp, 9); } // *TABLES* // *TABLES-ADVANCED-BORDERS*
1323
- if (is_array($zp)) {
1324
- $p = array_merge($p,$zp);
1325
- $this->_mergeBorders($p,$zp);
1326
- }
1327
- }
1328
- //===============================================
1329
- // STYLESHEET CLASS e.g. p.smallone{} div.redletter{}
1330
- foreach($classes AS $class) {
1331
- $zp = array();
1332
- if (isset($this->CSS[$tag.'>>CLASS>>'.$class]) && $this->CSS[$tag.'>>CLASS>>'.$class]) { $zp = $this->CSS[$tag.'>>CLASS>>'.$class]; }
1333
- if ($tag=='TD' || $tag=='TH') { $this->setBorderDominance($zp, 9); } // *TABLES* // *TABLES-ADVANCED-BORDERS*
1334
- if (is_array($zp)) {
1335
- $p = array_merge($p,$zp);
1336
- $this->_mergeBorders($p,$zp);
1337
- }
1338
- }
1339
- //===============================================
1340
- // STYLESHEET CLASS e.g. p#smallone{} div#redletter{}
1341
- if (isset($attr['ID']) && isset($this->CSS[$tag.'>>ID>>'.$attr['ID']]) && $this->CSS[$tag.'>>ID>>'.$attr['ID']]) {
1342
- $zp = $this->CSS[$tag.'>>ID>>'.$attr['ID']];
1343
- if ($tag=='TD' || $tag=='TH') { $this->setBorderDominance($zp, 9); } // *TABLES* // *TABLES-ADVANCED-BORDERS*
1344
- if (is_array($zp)) {
1345
- $p = array_merge($p,$zp);
1346
- $this->_mergeBorders($p,$zp);
1347
- }
1348
- }
1349
- //===============================================
1350
- // Cascaded e.g. div.class p only works for block level
1351
- if ($inherit == 'BLOCK') {
1352
- $this->_set_mergedCSS($this->mpdf->blk[$this->mpdf->blklvl-1]['cascadeCSS'][$tag], $p);
1353
- foreach($classes AS $class) {
1354
- $this->_set_mergedCSS($this->mpdf->blk[$this->mpdf->blklvl-1]['cascadeCSS']['CLASS>>'.$class], $p);
1355
- }
1356
- $this->_set_mergedCSS($this->mpdf->blk[$this->mpdf->blklvl-1]['cascadeCSS']['ID>>'.$attr['ID']], $p);
1357
- foreach($classes AS $class) {
1358
- $this->_set_mergedCSS($this->mpdf->blk[$this->mpdf->blklvl-1]['cascadeCSS'][$tag.'>>CLASS>>'.$class], $p);
1359
- }
1360
- $this->_set_mergedCSS($this->mpdf->blk[$this->mpdf->blklvl-1]['cascadeCSS'][$tag.'>>ID>>'.$attr['ID']], $p);
1361
- }
1362
- else if ($inherit == 'INLINE') {
1363
- $this->_set_mergedCSS($this->mpdf->blk[$this->mpdf->blklvl]['cascadeCSS'][$tag], $p);
1364
- foreach($classes AS $class) {
1365
- $this->_set_mergedCSS($this->mpdf->blk[$this->mpdf->blklvl]['cascadeCSS']['CLASS>>'.$class], $p);
1366
- }
1367
- $this->_set_mergedCSS($this->mpdf->blk[$this->mpdf->blklvl]['cascadeCSS']['ID>>'.$attr['ID']], $p);
1368
- foreach($classes AS $class) {
1369
- $this->_set_mergedCSS($this->mpdf->blk[$this->mpdf->blklvl]['cascadeCSS'][$tag.'>>CLASS>>'.$class], $p);
1370
- }
1371
- $this->_set_mergedCSS($this->mpdf->blk[$this->mpdf->blklvl]['cascadeCSS'][$tag.'>>ID>>'.$attr['ID']], $p);
1372
- }
1373
- /*-- TABLES --*/
1374
- else if ($inherit == 'TOPTABLE' || $inherit == 'TABLE') { // NB looks at $this->tablecascadeCSS-1 for cascading CSS
1375
- // false, 9 = don't check for 'depth' and do set border dominance
1376
- $this->_set_mergedCSS($this->tablecascadeCSS[$this->tbCSSlvl-1][$tag], $p, false, 9);
1377
- foreach($classes AS $class) {
1378
- $this->_set_mergedCSS($this->tablecascadeCSS[$this->tbCSSlvl-1]['CLASS>>'.$class], $p, false, 9);
1379
- }
1380
- // STYLESHEET nth-child SELECTOR e.g. tr:nth-child(odd) td:nth-child(2n+1)
1381
- if ($tag=='TR' || $tag=='TD' || $tag=='TH') {
1382
- foreach($this->tablecascadeCSS[$this->tbCSSlvl-1] AS $k=>$val) {
1383
- if (preg_match('/'.$tag.'>>SELECTORNTHCHILD>>(.*)/',$k, $m)) {
1384
- $select = false;
1385
- if ($tag=='TR') {
1386
- $row = $this->mpdf->row;
1387
- $thnr = (isset($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['is_thead']) ? count($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['is_thead']) : 0);
1388
- $tfnr = (isset($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['is_tfoot']) ? count($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['is_tfoot']) : 0);
1389
- if ($this->mpdf->tabletfoot) { $row -= $thnr; }
1390
- else if (!$this->mpdf->tablethead) { $row -= ($thnr + $tfnr); }
1391
- if (preg_match('/(([\-+]?\d*)?N([\-+]\d+)?|[\-+]?\d+|ODD|EVEN)/',$m[1],$a)) { // mPDF 5.7.4
1392
- $select = $this->_nthchild($a, $row);
1393
- }
1394
- }
1395
- else if ($tag=='TD' || $tag=='TH') {
1396
- if (preg_match('/(([\-+]?\d*)?N([\-+]\d+)?|[\-+]?\d+|ODD|EVEN)/',$m[1],$a)) { // mPDF 5.7.4
1397
- $select = $this->_nthchild($a, $this->mpdf->col);
1398
- }
1399
- }
1400
- if ($select) {
1401
- $this->_set_mergedCSS($this->tablecascadeCSS[$this->tbCSSlvl-1][$tag.'>>SELECTORNTHCHILD>>'.$m[1]], $p, false, 9);
1402
- }
1403
- }
1404
- }
1405
- }
1406
- $this->_set_mergedCSS($this->tablecascadeCSS[$this->tbCSSlvl-1]['ID>>'.$attr['ID']], $p, false, 9);
1407
- foreach($classes AS $class) {
1408
- $this->_set_mergedCSS($this->tablecascadeCSS[$this->tbCSSlvl-1][$tag.'>>CLASS>>'.$class], $p, false, 9);
1409
- }
1410
- $this->_set_mergedCSS($this->tablecascadeCSS[$this->tbCSSlvl-1][$tag.'>>ID>>'.$attr['ID']], $p, false, 9);
1411
- }
1412
- /*-- END TABLES --*/
1413
- //===============================================
1414
- /*-- LISTS --*/
1415
- else if ($inherit == 'TOPLIST' || $inherit == 'LIST') { // NB looks at $this->listcascadeCSS-1 for cascading CSS
1416
- // false = don't check for 'depth'
1417
- $this->_set_mergedCSS($this->listcascadeCSS[$this->listCSSlvl-1][$tag], $p, false);
1418
- foreach($classes AS $class) {
1419
- $this->_set_mergedCSS($this->listcascadeCSS[$this->listCSSlvl-1]['CLASS>>'.$class], $p, false);
1420
- }
1421
- $this->_set_mergedCSS($this->listcascadeCSS[$this->listCSSlvl-1]['ID>>'.$attr['ID']], $p, false);
1422
- foreach($classes AS $class) {
1423
- $this->_set_mergedCSS($this->listcascadeCSS[$this->listCSSlvl-1][$tag.'>>CLASS>>'.$class], $p, false);
1424
- }
1425
- $this->_set_mergedCSS($this->listcascadeCSS[$this->listCSSlvl-1][$tag.'>>ID>>'.$attr['ID']], $p, false);
1426
- }
1427
- /*-- END LISTS --*/
1428
- //===============================================
1429
- //===============================================
1430
- // INLINE STYLE e.g. style="CSS:property"
1431
- if (isset($attr['STYLE'])) {
1432
- $zp = $this->readInlineCSS($attr['STYLE']);
1433
- if ($tag=='TD' || $tag=='TH') { $this->setBorderDominance($zp, 9); } // *TABLES* // *TABLES-ADVANCED-BORDERS*
1434
- if (is_array($zp)) {
1435
- $p = array_merge($p,$zp);
1436
- $this->_mergeBorders($p,$zp);
1437
- }
1438
- }
1439
- //===============================================
1440
- //===============================================
1441
- // INLINE ATTRIBUTES e.g. .. ALIGN="CENTER">
1442
- if (isset($attr['LANG']) and $attr['LANG']!='') {
1443
- $p['LANG'] = $attr['LANG'];
1444
- }
1445
- if (isset($attr['COLOR']) and $attr['COLOR']!='') {
1446
- $p['COLOR'] = $attr['COLOR'];
1447
- }
1448
- if ($tag != 'INPUT') {
1449
- if (isset($attr['WIDTH']) and $attr['WIDTH']!='') {
1450
- $p['WIDTH'] = $attr['WIDTH'];
1451
- }
1452
- if (isset($attr['HEIGHT']) and $attr['HEIGHT']!='') {
1453
- $p['HEIGHT'] = $attr['HEIGHT'];
1454
- }
1455
- }
1456
- if ($tag == 'FONT') {
1457
- if (isset($attr['FACE'])) {
1458
- $p['FONT-FAMILY'] = $attr['FACE'];
1459
- }
1460
- if (isset($attr['SIZE']) and $attr['SIZE']!='') {
1461
- $s = '';
1462
- if ($attr['SIZE'] === '+1') { $s = '120%'; }
1463
- else if ($attr['SIZE'] === '-1') { $s = '86%'; }
1464
- else if ($attr['SIZE'] === '1') { $s = 'XX-SMALL'; }
1465
- else if ($attr['SIZE'] == '2') { $s = 'X-SMALL'; }
1466
- else if ($attr['SIZE'] == '3') { $s = 'SMALL'; }
1467
- else if ($attr['SIZE'] == '4') { $s = 'MEDIUM'; }
1468
- else if ($attr['SIZE'] == '5') { $s = 'LARGE'; }
1469
- else if ($attr['SIZE'] == '6') { $s = 'X-LARGE'; }
1470
- else if ($attr['SIZE'] == '7') { $s = 'XX-LARGE'; }
1471
- if ($s) $p['FONT-SIZE'] = $s;
1472
- }
1473
- }
1474
- if (isset($attr['VALIGN']) and $attr['VALIGN']!='') {
1475
- $p['VERTICAL-ALIGN'] = $attr['VALIGN'];
1476
- }
1477
- if (isset($attr['VSPACE']) and $attr['VSPACE']!='') {
1478
- $p['MARGIN-TOP'] = $attr['VSPACE'];
1479
- $p['MARGIN-BOTTOM'] = $attr['VSPACE'];
1480
- }
1481
- if (isset($attr['HSPACE']) and $attr['HSPACE']!='') {
1482
- $p['MARGIN-LEFT'] = $attr['HSPACE'];
1483
- $p['MARGIN-RIGHT'] = $attr['HSPACE'];
1484
- }
1485
- //===============================================
1486
- return $p;
1487
- }
1488
-
1489
- function PreviewBlockCSS($tag,$attr) {
1490
- // Looks ahead from current block level to a new level
1491
- $p = array();
1492
- $zp = array();
1493
- $oldcascadeCSS = $this->mpdf->blk[$this->mpdf->blklvl]['cascadeCSS'];
1494
- $classes = array();
1495
- if (isset($attr['CLASS'])) { $classes = preg_split('/\s+/',$attr['CLASS']); }
1496
- //===============================================
1497
- // DEFAULT for this TAG set in DefaultCSS
1498
- if (isset($this->mpdf->defaultCSS[$tag])) {
1499
- $zp = $this->fixCSS($this->mpdf->defaultCSS[$tag]);
1500
- if (is_array($zp)) { $p = array_merge($zp,$p); } // Inherited overwrites default
1501
- }
1502
- // STYLESHEET TAG e.g. h1 p div table
1503
- if (isset($this->CSS[$tag])) {
1504
- $zp = $this->CSS[$tag];
1505
- if (is_array($zp)) { $p = array_merge($p,$zp); }
1506
- }
1507
- // STYLESHEET CLASS e.g. .smallone{} .redletter{}
1508
- foreach($classes AS $class) {
1509
- $zp = array();
1510
- if (isset($this->CSS['CLASS>>'.$class])) { $zp = $this->CSS['CLASS>>'.$class]; }
1511
- if (is_array($zp)) { $p = array_merge($p,$zp); }
1512
- }
1513
- // STYLESHEET ID e.g. #smallone{} #redletter{}
1514
- if (isset($attr['ID']) && isset($this->CSS['ID>>'.$attr['ID']])) {
1515
- $zp = $this->CSS['ID>>'.$attr['ID']];
1516
- if (is_array($zp)) { $p = array_merge($p,$zp); }
1517
- }
1518
- // STYLESHEET CLASS e.g. p.smallone{} div.redletter{}
1519
- foreach($classes AS $class) {
1520
- $zp = array();
1521
- if (isset($this->CSS[$tag.'>>CLASS>>'.$class])) { $zp = $this->CSS[$tag.'>>CLASS>>'.$class]; }
1522
- if (is_array($zp)) { $p = array_merge($p,$zp); }
1523
- }
1524
- // STYLESHEET CLASS e.g. p#smallone{} div#redletter{}
1525
- if (isset($attr['ID']) && isset($this->CSS[$tag.'>>ID>>'.$attr['ID']])) {
1526
- $zp = $this->CSS[$tag.'>>ID>>'.$attr['ID']];
1527
- if (is_array($zp)) { $p = array_merge($p,$zp); }
1528
- }
1529
- //===============================================
1530
- // STYLESHEET TAG e.g. div h1 div p
1531
-
1532
- $this->_set_mergedCSS($oldcascadeCSS[$tag], $p);
1533
- // STYLESHEET CLASS e.g. .smallone{} .redletter{}
1534
- foreach($classes AS $class) {
1535
-
1536
- $this->_set_mergedCSS($oldcascadeCSS['CLASS>>'.$class], $p);
1537
- }
1538
- // STYLESHEET CLASS e.g. #smallone{} #redletter{}
1539
- if (isset($attr['ID'])) {
1540
-
1541
- $this->_set_mergedCSS($oldcascadeCSS['ID>>'.$attr['ID']], $p);
1542
- }
1543
- // STYLESHEET CLASS e.g. div.smallone{} p.redletter{}
1544
- foreach($classes AS $class) {
1545
-
1546
- $this->_set_mergedCSS($oldcascadeCSS[$tag.'>>CLASS>>'.$class], $p);
1547
- }
1548
- // STYLESHEET CLASS e.g. div#smallone{} p#redletter{}
1549
- if (isset($attr['ID'])) {
1550
-
1551
- $this->_set_mergedCSS($oldcascadeCSS[$tag.'>>ID>>'.$attr['ID']], $p);
1552
- }
1553
- //===============================================
1554
- // INLINE STYLE e.g. style="CSS:property"
1555
- if (isset($attr['STYLE'])) {
1556
- $zp = $this->readInlineCSS($attr['STYLE']);
1557
- if (is_array($zp)) { $p = array_merge($p,$zp); }
1558
- }
1559
- //===============================================
1560
- return $p;
1561
- }
1562
-
1563
- // mPDF 5.7.4 nth-child
1564
- function _nthchild($f, $c) {
1565
- // $f is formual e.g. 2N+1 spilt into a preg_match array
1566
- // $c is the comparator value e.g row or column number
1567
- $c += 1;
1568
- $select = false;
1569
- $a=1; $b=1;
1570
- if ($f[0]=='ODD') { $a=2; $b=1; }
1571
- else if ($f[0]=='EVEN') { $a=2; $b=0; }
1572
- else if (count($f)==2) { $a=0; $b=$f[1]+0; } // e.g. (+6)
1573
- else if (count($f)==3) { // e.g. (2N)
1574
- if ($f[2]=='') { $a=1; }
1575
- else if ($f[2]=='-') { $a=-1; }
1576
- else { $a=$f[2]+0; }
1577
- $b=0;
1578
- }
1579
- else if (count($f)==4) { // e.g. (2N+6)
1580
- if ($f[2]=='') { $a=1; }
1581
- else if ($f[2]=='-') { $a=-1; }
1582
- else { $a=$f[2]+0; }
1583
- $b=$f[3]+0;
1584
- }
1585
- else { return false; }
1586
- if ($a>0) {
1587
- if (((($c % $a) - $b) % $a) == 0 && $c >= $b) { $select = true; }
1588
- }
1589
- else if ($a==0) {
1590
- if ($c == $b) { $select = true; }
1591
- }
1592
- else { // if ($a<0)
1593
- if (((($c % $a) - $b) % $a) == 0 && $c <= $b) { $select = true; }
1594
- }
1595
- return $select;
1596
- }
1597
-
1598
-
1599
-
1600
- } // end of class
1601
-
1602
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
mPDF/classes/svg.php CHANGED
@@ -2178,10 +2178,10 @@ function svgDefineTxtStyle($critere_style)
2178
 
2179
  case 'path':
2180
  $path = $attribs['d'];
2181
- // mPDF 5.6.65
2182
- preg_match_all('/([MZLHVCSQTAmzlhvcsqta])([eE ,\-.\d]+)*/', $path, $commands, PREG_SET_ORDER);
2183
  $path_cmd = '';
2184
- $svg_class->subPathInit = true;
2185
  // mPDF 5.0.039
2186
  $svg_class->pathBBox = array(999999,999999,-999999,-999999);
2187
  foreach($commands as $c){
2178
 
2179
  case 'path':
2180
  $path = $attribs['d'];
2181
+ // mPDF 4.4.003
2182
+ preg_match_all('/([MZLHVCSQTAmzlhvcsqta])([e ,\-.\d]+)*/', $path, $commands, PREG_SET_ORDER);
2183
  $path_cmd = '';
2184
+ $svg_class->subPathInit = true; // mPDF 4.4.003
2185
  // mPDF 5.0.039
2186
  $svg_class->pathBBox = array(999999,999999,-999999,-999999);
2187
  foreach($commands as $c){
mPDF/classes/tocontents.php CHANGED
@@ -5,7 +5,11 @@ class tocontents {
5
  var $mpdf = null;
6
  var $_toc;
7
  var $TOCmark;
8
- var $TOCoutdent; // mPDF 5.6.31
 
 
 
 
9
  var $TOCpreHTML;
10
  var $TOCpostHTML;
11
  var $TOCbookmarkText;
@@ -36,17 +40,22 @@ function tocontents(&$mpdf) {
36
  $this->m_TOC=array();
37
  }
38
 
39
- function TOCpagebreak($tocfont='', $tocfontsize='', $tocindent='', $TOCusePaging=true, $TOCuseLinking='', $toc_orientation='', $toc_mgl='',$toc_mgr='',$toc_mgt='',$toc_mgb='',$toc_mgh='',$toc_mgf='',$toc_ohname='',$toc_ehname='',$toc_ofname='',$toc_efname='',$toc_ohvalue=0,$toc_ehvalue=0,$toc_ofvalue=0, $toc_efvalue=0, $toc_preHTML='', $toc_postHTML='', $toc_bookmarkText='', $resetpagenum='', $pagenumstyle='', $suppress='', $orientation='', $mgl='',$mgr='',$mgt='',$mgb='',$mgh='',$mgf='',$ohname='',$ehname='',$ofname='',$efname='',$ohvalue=0,$ehvalue=0,$ofvalue=0,$efvalue=0, $toc_id=0, $pagesel='', $toc_pagesel='', $sheetsize='', $toc_sheetsize='', $tocoutdent='') { // mPDF 5.6.19
40
  if (strtoupper($toc_id)=='ALL') { $toc_id = '_mpdf_all'; }
41
  else if (!$toc_id) { $toc_id = 0; }
42
  else { $toc_id = strtolower($toc_id); }
43
 
 
 
 
44
  if ($TOCusePaging === false || strtolower($TOCusePaging) == "off" || $TOCusePaging === 0 || $TOCusePaging === "0" || $TOCusePaging === "") { $TOCusePaging = false; }
45
  else { $TOCusePaging = true; }
46
  if (!$TOCuseLinking) { $TOCuseLinking = false; }
47
  if ($toc_id) {
48
  $this->m_TOC[$toc_id]['TOCmark'] = $this->mpdf->page;
49
- $this->m_TOC[$toc_id]['TOCoutdent'] = $tocoutdent;
 
 
50
  $this->m_TOC[$toc_id]['TOCorientation'] = $toc_orientation;
51
  $this->m_TOC[$toc_id]['TOCuseLinking'] = $TOCuseLinking;
52
  $this->m_TOC[$toc_id]['TOCusePaging'] = $TOCusePaging;
@@ -74,7 +83,9 @@ function TOCpagebreak($tocfont='', $tocfontsize='', $tocindent='', $TOCusePaging
74
  }
75
  else {
76
  $this->TOCmark = $this->mpdf->page;
77
- $this->TOCoutdent = $tocoutdent;
 
 
78
  $this->TOCorientation = $toc_orientation;
79
  $this->TOCuseLinking = $TOCuseLinking;
80
  $this->TOCusePaging = $TOCusePaging;
@@ -103,7 +114,7 @@ function TOCpagebreak($tocfont='', $tocfontsize='', $tocindent='', $TOCusePaging
103
  }
104
 
105
  // Initiate, and Mark a place for the Table of Contents to be inserted
106
- function TOC($tocfont='', $tocfontsize=0, $tocindent=0, $resetpagenum='', $pagenumstyle='', $suppress='', $toc_orientation='', $TOCusePaging=true, $TOCuseLinking=false, $toc_id=0, $tocoutdent='') { // mPDF 5.6.19) {
107
  if (strtoupper($toc_id)=='ALL') { $toc_id = '_mpdf_all'; }
108
  else if (!$toc_id) { $toc_id = 0; }
109
  else { $toc_id = strtolower($toc_id); }
@@ -118,16 +129,22 @@ function TOC($tocfont='', $tocfontsize=0, $tocindent=0, $resetpagenum='', $pagen
118
  else {
119
  $this->mpdf->PageNumSubstitutions[] = array('from'=>$this->mpdf->page, 'reset'=> $resetpagenum, 'type'=>$pagenumstyle, 'suppress'=>$suppress);
120
  }
 
 
121
  if ($toc_id) {
122
  $this->m_TOC[$toc_id]['TOCmark'] = $this->mpdf->page;
123
- $this->m_TOC[$toc_id]['TOCoutdent'] = $tocoutdent;
 
 
124
  $this->m_TOC[$toc_id]['TOCorientation'] = $toc_orientation;
125
  $this->m_TOC[$toc_id]['TOCuseLinking'] = $TOCuseLinking;
126
  $this->m_TOC[$toc_id]['TOCusePaging'] = $TOCusePaging;
127
  }
128
  else {
129
  $this->TOCmark = $this->mpdf->page;
130
- $this->TOCoutdent = $tocoutdent;
 
 
131
  $this->TOCorientation = $toc_orientation;
132
  $this->TOCuseLinking = $TOCuseLinking;
133
  $this->TOCusePaging = $TOCusePaging;
@@ -156,7 +173,9 @@ function insertTOC() {
156
  if ($toci==0 && $this->TOCmark) {
157
  $toc_id = 0;
158
  $toc_page = $this->TOCmark;
159
- $tocoutdent = $this->TOCoutdent;
 
 
160
  $toc_orientation = $this->TOCorientation;
161
  $TOCuseLinking = $this->TOCuseLinking;
162
  $TOCusePaging = $this->TOCusePaging;
@@ -185,7 +204,9 @@ function insertTOC() {
185
 
186
  $toc_id = key($this->m_TOC);
187
  $toc_page = $this->m_TOC[$toc_id]['TOCmark'];
188
- $tocoutdent = $this->m_TOC[$toc_id]['TOCoutdent'];
 
 
189
  $toc_orientation = $this->m_TOC[$toc_id]['TOCorientation'];
190
  $TOCuseLinking = $this->m_TOC[$toc_id]['TOCuseLinking'];
191
  $TOCusePaging = $this->m_TOC[$toc_id]['TOCusePaging'];
@@ -213,40 +234,134 @@ function insertTOC() {
213
  $toc_sheet_size = $this->m_TOC[$toc_id]['TOCsheetsize'];
214
  next($this->m_TOC);
215
  }
 
 
216
 
217
- // mPDF 5.6.31
218
-
219
  if (!$toc_orientation) { $toc_orientation= $this->mpdf->DefOrientation; }
220
  $this->mpdf->AddPage($toc_orientation, '', '', '', "on", $toc_mgl, $toc_mgr, $toc_mgt, $toc_mgb, $toc_mgh, $toc_mgf, $toc_ohname, $toc_ehname, $toc_ofname, $toc_efname, $toc_ohvalue, $toc_ehvalue, $toc_ofvalue, $toc_efvalue, $toc_page_selector, $toc_sheet_size );
221
 
222
- $this->mpdf->writingToC = true; // mPDF 5.6.38
223
- // mPDF 5.6.31
 
224
  $tocstart=count($this->mpdf->pages);
225
  if ($toc_preHTML) { $this->mpdf->WriteHTML($toc_preHTML); }
226
 
227
-
228
- // mPDF 5.6.19
229
- $html ='<div class="mpdf_toc" id="mpdf_toc_'.$toc_id.'">';
230
  foreach($this->_toc as $t) {
231
  if ($t['toc_id']==='_mpdf_all' || $t['toc_id']===$toc_id ) {
232
- $html .= '<div class="mpdf_toc_level_'.$t['l'].'">';
233
- if ($TOCuseLinking) { $html .= '<a class="mpdf_toc_a" href="#__mpdfinternallink_'.$t['link'].'">'; }
234
- $html .= '<span class="mpdf_toc_t_level_'.$t['l'].'">'.$t['t'].'</span>';
235
- if ($TOCuseLinking) { $html .= '</a>'; }
236
- if (!$tocoutdent) { $tocoutdent = '0'; }
237
- if ($TOCusePaging) { $html .= ' <dottab outdent="'.$tocoutdent.'" /> ';
238
- if ($TOCuseLinking) { $html .= '<a class="mpdf_toc_a" href="#__mpdfinternallink_'.$t['link'].'">'; }
239
- $html .= '<span class="mpdf_toc_p_level_'.$t['l'].'">'.$this->mpdf->docPageNum($t['p']).'</span>';
240
- if ($TOCuseLinking) { $html .= '</a>'; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
241
  }
242
- $html .= '</div>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
243
  }
244
  }
245
- $html .= '</div>';
246
- $this->mpdf->WriteHTML($html);
247
 
248
  if ($toc_postHTML) { $this->mpdf->WriteHTML($toc_postHTML); }
249
- $this->mpdf->writingToC = false; // mPDF 5.6.38
250
  $this->mpdf->AddPage($toc_orientation,'E');
251
 
252
  $n_toc = $this->mpdf->page - $tocstart + 1;
@@ -347,7 +462,9 @@ function insertTOC() {
347
 
348
 
349
  function openTagTOC($attr) {
350
- if (isset($attr['OUTDENT']) && $attr['OUTDENT']) { $tocoutdent = $attr['OUTDENT']; } else { $tocoutdent = ''; } // mPDF 5.6.19
 
 
351
  if (isset($attr['RESETPAGENUM']) && $attr['RESETPAGENUM']) { $resetpagenum = $attr['RESETPAGENUM']; } else { $resetpagenum = ''; }
352
  if (isset($attr['PAGENUMSTYLE']) && $attr['PAGENUMSTYLE']) { $pagenumstyle = $attr['PAGENUMSTYLE']; } else { $pagenumstyle= ''; }
353
  if (isset($attr['SUPPRESS']) && $attr['SUPPRESS']) { $suppress = $attr['SUPPRESS']; } else { $suppress = ''; }
@@ -357,14 +474,16 @@ function openTagTOC($attr) {
357
  if (isset($attr['LINKS']) && (strtoupper($attr['LINKS'])=='ON' || $attr['LINKS']==1)) { $links = true; }
358
  else { $links = false; }
359
  if (isset($attr['NAME']) && $attr['NAME']) { $toc_id = strtolower($attr['NAME']); } else { $toc_id = 0; }
360
- $this->TOC('',0,0,$resetpagenum, $pagenumstyle, $suppress, $toc_orientation, $paging, $links, $toc_id, $tocoutdent); // mPDF 5.6.19 5.6.31
361
  }
362
 
363
 
364
  function openTagTOCPAGEBREAK($attr) {
365
  if (isset($attr['NAME']) && $attr['NAME']) { $toc_id = strtolower($attr['NAME']); } else { $toc_id = 0; }
366
  if ($toc_id) {
367
- if (isset($attr['OUTDENT']) && $attr['OUTDENT']) { $this->m_TOC[$toc_id]['TOCoutdent'] = $attr['OUTDENT']; } else { $this->m_TOC[$toc_id]['TOCoutdent'] = ''; } // mPDF 5.6.19
 
 
368
  if (isset($attr['TOC-ORIENTATION']) && $attr['TOC-ORIENTATION']) { $this->m_TOC[$toc_id]['TOCorientation'] = $attr['TOC-ORIENTATION']; } else { $this->m_TOC[$toc_id]['TOCorientation'] = ''; }
369
  if (isset($attr['PAGING']) && (strtoupper($attr['PAGING'])=='OFF' || $attr['PAGING']==='0')) { $this->m_TOC[$toc_id]['TOCusePaging'] = false; }
370
  else { $this->m_TOC[$toc_id]['TOCusePaging'] = true; }
@@ -403,7 +522,9 @@ function openTagTOCPAGEBREAK($attr) {
403
  if (isset($attr['TOC-BOOKMARKTEXT']) && $attr['TOC-BOOKMARKTEXT']) { $this->m_TOC[$toc_id]['TOCbookmarkText'] = htmlspecialchars_decode($attr['TOC-BOOKMARKTEXT'],ENT_QUOTES); } // *BOOKMARKS*
404
  }
405
  else {
406
- if (isset($attr['OUTDENT']) && $attr['OUTDENT']) { $this->TOCoutdent = $attr['OUTDENT']; } else { $this->TOCoutdent = ''; } // mPDF 5.6.19
 
 
407
  if (isset($attr['TOC-ORIENTATION']) && $attr['TOC-ORIENTATION']) { $this->TOCorientation = $attr['TOC-ORIENTATION']; } else { $this->TOCorientation = ''; }
408
  if (isset($attr['PAGING']) && (strtoupper($attr['PAGING'])=='OFF' || $attr['PAGING']==='0')) { $this->TOCusePaging = false; }
409
  else { $this->TOCusePaging = true; }
@@ -427,7 +548,6 @@ function openTagTOCPAGEBREAK($attr) {
427
  else if (isset($attr['TOC-ODD-HEADER-VALUE']) && ($attr['TOC-ODD-HEADER-VALUE']=='-1' || strtoupper($attr['TOC-ODD-HEADER-VALUE'])=='OFF')) { $this->TOC_odd_header_value = -1; }
428
  if (isset($attr['TOC-EVEN-HEADER-VALUE']) && ($attr['TOC-EVEN-HEADER-VALUE']=='1' || strtoupper($attr['TOC-EVEN-HEADER-VALUE'])=='ON')) { $this->TOC_even_header_value = 1; }
429
  else if (isset($attr['TOC-EVEN-HEADER-VALUE']) && ($attr['TOC-EVEN-HEADER-VALUE']=='-1' || strtoupper($attr['TOC-EVEN-HEADER-VALUE'])=='OFF')) { $this->TOC_even_header_value = -1; }
430
-
431
  if (isset($attr['TOC-ODD-FOOTER-VALUE']) && ($attr['TOC-ODD-FOOTER-VALUE']=='1' || strtoupper($attr['TOC-ODD-FOOTER-VALUE'])=='ON')) { $this->TOC_odd_footer_value = 1; }
432
  else if (isset($attr['TOC-ODD-FOOTER-VALUE']) && ($attr['TOC-ODD-FOOTER-VALUE']=='-1' || strtoupper($attr['TOC-ODD-FOOTER-VALUE'])=='OFF')) { $this->TOC_odd_footer_value = -1; }
433
  if (isset($attr['TOC-EVEN-FOOTER-VALUE']) && ($attr['TOC-EVEN-FOOTER-VALUE']=='1' || strtoupper($attr['TOC-EVEN-FOOTER-VALUE'])=='ON')) { $this->TOC_even_footer_value = 1; }
@@ -436,6 +556,7 @@ function openTagTOCPAGEBREAK($attr) {
436
  else { $this->TOC_page_selector = ''; }
437
  if (isset($attr['TOC-SHEET-SIZE']) && $attr['TOC-SHEET-SIZE']) { $this->TOCsheetsize = $attr['TOC-SHEET-SIZE']; } else { $this->TOCsheetsize = ''; }
438
 
 
439
  if (isset($attr['TOC-PREHTML']) && $attr['TOC-PREHTML']) { $this->TOCpreHTML = htmlspecialchars_decode($attr['TOC-PREHTML'],ENT_QUOTES); }
440
  if (isset($attr['TOC-POSTHTML']) && $attr['TOC-POSTHTML']) { $this->TOCpostHTML = htmlspecialchars_decode($attr['TOC-POSTHTML'],ENT_QUOTES); }
441
  if (isset($attr['TOC-BOOKMARKTEXT']) && $attr['TOC-BOOKMARKTEXT']) { $this->TOCbookmarkText = htmlspecialchars_decode($attr['TOC-BOOKMARKTEXT'],ENT_QUOTES); }
5
  var $mpdf = null;
6
  var $_toc;
7
  var $TOCmark;
8
+ var $TOCfont;
9
+ var $TOCfontsize;
10
+ var $TOCindent;
11
+ var $TOCheader;
12
+ var $TOCfooter;
13
  var $TOCpreHTML;
14
  var $TOCpostHTML;
15
  var $TOCbookmarkText;
40
  $this->m_TOC=array();
41
  }
42
 
43
+ function TOCpagebreak($tocfont='', $tocfontsize='', $tocindent='', $TOCusePaging=true, $TOCuseLinking='', $toc_orientation='', $toc_mgl='',$toc_mgr='',$toc_mgt='',$toc_mgb='',$toc_mgh='',$toc_mgf='',$toc_ohname='',$toc_ehname='',$toc_ofname='',$toc_efname='',$toc_ohvalue=0,$toc_ehvalue=0,$toc_ofvalue=0, $toc_efvalue=0, $toc_preHTML='', $toc_postHTML='', $toc_bookmarkText='', $resetpagenum='', $pagenumstyle='', $suppress='', $orientation='', $mgl='',$mgr='',$mgt='',$mgb='',$mgh='',$mgf='',$ohname='',$ehname='',$ofname='',$efname='',$ohvalue=0,$ehvalue=0,$ofvalue=0,$efvalue=0, $toc_id=0, $pagesel='', $toc_pagesel='', $sheetsize='', $toc_sheetsize='') {
44
  if (strtoupper($toc_id)=='ALL') { $toc_id = '_mpdf_all'; }
45
  else if (!$toc_id) { $toc_id = 0; }
46
  else { $toc_id = strtolower($toc_id); }
47
 
48
+ if (!$tocfont) { $tocfont = $this->mpdf->default_font; }
49
+ if (!$tocfontsize) { $tocfontsize = $this->mpdf->default_font_size; }
50
+ if (!$tocindent && $tocindent !== 0) { $tocindent = 5; }
51
  if ($TOCusePaging === false || strtolower($TOCusePaging) == "off" || $TOCusePaging === 0 || $TOCusePaging === "0" || $TOCusePaging === "") { $TOCusePaging = false; }
52
  else { $TOCusePaging = true; }
53
  if (!$TOCuseLinking) { $TOCuseLinking = false; }
54
  if ($toc_id) {
55
  $this->m_TOC[$toc_id]['TOCmark'] = $this->mpdf->page;
56
+ $this->m_TOC[$toc_id]['TOCfont'] = $tocfont;
57
+ $this->m_TOC[$toc_id]['TOCfontsize'] = $tocfontsize;
58
+ $this->m_TOC[$toc_id]['TOCindent'] = $tocindent;
59
  $this->m_TOC[$toc_id]['TOCorientation'] = $toc_orientation;
60
  $this->m_TOC[$toc_id]['TOCuseLinking'] = $TOCuseLinking;
61
  $this->m_TOC[$toc_id]['TOCusePaging'] = $TOCusePaging;
83
  }
84
  else {
85
  $this->TOCmark = $this->mpdf->page;
86
+ $this->TOCfont = $tocfont;
87
+ $this->TOCfontsize = $tocfontsize;
88
+ $this->TOCindent = $tocindent;
89
  $this->TOCorientation = $toc_orientation;
90
  $this->TOCuseLinking = $TOCuseLinking;
91
  $this->TOCusePaging = $TOCusePaging;
114
  }
115
 
116
  // Initiate, and Mark a place for the Table of Contents to be inserted
117
+ function TOC($tocfont='', $tocfontsize=8, $tocindent=5, $resetpagenum='', $pagenumstyle='', $suppress='', $toc_orientation='', $TOCusePaging=true, $TOCuseLinking=false, $toc_id=0) {
118
  if (strtoupper($toc_id)=='ALL') { $toc_id = '_mpdf_all'; }
119
  else if (!$toc_id) { $toc_id = 0; }
120
  else { $toc_id = strtolower($toc_id); }
129
  else {
130
  $this->mpdf->PageNumSubstitutions[] = array('from'=>$this->mpdf->page, 'reset'=> $resetpagenum, 'type'=>$pagenumstyle, 'suppress'=>$suppress);
131
  }
132
+ if (!$tocfont) { $tocfont = $this->mpdf->default_font; }
133
+ if (!$tocfontsize) { $tocfontsize = $this->mpdf->default_font_size; }
134
  if ($toc_id) {
135
  $this->m_TOC[$toc_id]['TOCmark'] = $this->mpdf->page;
136
+ $this->m_TOC[$toc_id]['TOCfont'] = $tocfont;
137
+ $this->m_TOC[$toc_id]['TOCfontsize'] = $tocfontsize;
138
+ $this->m_TOC[$toc_id]['TOCindent'] = $tocindent;
139
  $this->m_TOC[$toc_id]['TOCorientation'] = $toc_orientation;
140
  $this->m_TOC[$toc_id]['TOCuseLinking'] = $TOCuseLinking;
141
  $this->m_TOC[$toc_id]['TOCusePaging'] = $TOCusePaging;
142
  }
143
  else {
144
  $this->TOCmark = $this->mpdf->page;
145
+ $this->TOCfont = $tocfont;
146
+ $this->TOCfontsize = $tocfontsize;
147
+ $this->TOCindent = $tocindent;
148
  $this->TOCorientation = $toc_orientation;
149
  $this->TOCuseLinking = $TOCuseLinking;
150
  $this->TOCusePaging = $TOCusePaging;
173
  if ($toci==0 && $this->TOCmark) {
174
  $toc_id = 0;
175
  $toc_page = $this->TOCmark;
176
+ $tocfont = $this->TOCfont;
177
+ $tocfontsize = $this->TOCfontsize;
178
+ $tocindent = $this->TOCindent;
179
  $toc_orientation = $this->TOCorientation;
180
  $TOCuseLinking = $this->TOCuseLinking;
181
  $TOCusePaging = $this->TOCusePaging;
204
 
205
  $toc_id = key($this->m_TOC);
206
  $toc_page = $this->m_TOC[$toc_id]['TOCmark'];
207
+ $tocfont = $this->m_TOC[$toc_id]['TOCfont'];
208
+ $tocfontsize = $this->m_TOC[$toc_id]['TOCfontsize'];
209
+ $tocindent = $this->m_TOC[$toc_id]['TOCindent'];
210
  $toc_orientation = $this->m_TOC[$toc_id]['TOCorientation'];
211
  $TOCuseLinking = $this->m_TOC[$toc_id]['TOCuseLinking'];
212
  $TOCusePaging = $this->m_TOC[$toc_id]['TOCusePaging'];
234
  $toc_sheet_size = $this->m_TOC[$toc_id]['TOCsheetsize'];
235
  next($this->m_TOC);
236
  }
237
+ if ($this->TOCheader) { $this->mpdf->SetHeader($this->TOCheader); }
238
+ else if ($this->TOCheader !== false) { $this->mpdf->SetHeader(); }
239
 
240
+ if (!$tocindent && $tocindent !== 0) { $tocindent = 5; }
 
241
  if (!$toc_orientation) { $toc_orientation= $this->mpdf->DefOrientation; }
242
  $this->mpdf->AddPage($toc_orientation, '', '', '', "on", $toc_mgl, $toc_mgr, $toc_mgt, $toc_mgb, $toc_mgh, $toc_mgf, $toc_ohname, $toc_ehname, $toc_ofname, $toc_efname, $toc_ohvalue, $toc_ehvalue, $toc_ofvalue, $toc_efvalue, $toc_page_selector, $toc_sheet_size );
243
 
244
+ if ($this->TOCfooter) { $this->mpdf->SetFooter($this->TOCfooter); }
245
+ else if ($this->TOCfooter !== false) { $this->mpdf->SetFooter(); }
246
+
247
  $tocstart=count($this->mpdf->pages);
248
  if ($toc_preHTML) { $this->mpdf->WriteHTML($toc_preHTML); }
249
 
 
 
 
250
  foreach($this->_toc as $t) {
251
  if ($t['toc_id']==='_mpdf_all' || $t['toc_id']===$toc_id ) {
252
+ $tpgno = $this->mpdf->docPageNum($t['p']);
253
+ $lineheightcorr = max(0,2-$t['l']); // mPDF 5.4.15
254
+ //Offset
255
+ $level=$t['l'];
256
+
257
+ if ($TOCuseLinking) { $tlink = $t['link']; }
258
+ else { $tlink = ''; }
259
+
260
+ if ($this->mpdf->directionality == 'rtl') {
261
+ $weight='';
262
+ if($level==0)
263
+ $weight='B';
264
+ $str=$t['t'];
265
+ $fullstr = $str;
266
+ $this->mpdf->SetFont($tocfont,$weight,$tocfontsize,true,true);
267
+ $PageCellSize=$this->mpdf->GetStringWidth($tpgno )+2;
268
+ $strsize=$this->mpdf->GetStringWidth($str);
269
+ $repdots = $this->mpdf->GetStringWidth(str_repeat('.',5)); // mPDF 5.3.07
270
+ $cw = count(explode(' ',$str));
271
+ while (($strsize + $repdots +4 + $PageCellSize) > $this->mpdf->pgwidth && $cw>1) { // mPDF 5.3.07
272
+ $str = implode(' ',explode(' ',$str,-1));
273
+ $strsize=$this->mpdf->GetStringWidth($str);
274
+ $cw = count(explode(' ',$str));
275
+ }
276
+ $sl = strlen($str);
277
+ $rem = substr($fullstr, ($sl+1));
278
+
279
+ $this->mpdf->magic_reverse_dir($str, true, $this->mpdf->directionality); // *RTL*
280
+
281
+ if ($TOCusePaging) {
282
+ //Page number
283
+ $this->mpdf->SetFont($tocfont,'',$tocfontsize);
284
+ $this->mpdf->Cell($PageCellSize,$this->mpdf->FontSize+$lineheightcorr,$tpgno ,0,0,'L',0,$tlink);
285
+
286
+ //Filling dots
287
+ $w=$this->mpdf->w-$this->mpdf->lMargin-$this->mpdf->rMargin-$PageCellSize-($level*$tocindent)-($strsize+2);
288
+ $nb=intval($w/$this->mpdf->GetCharWidth('.',false)); // mPDF 5.3.04
289
+ if ($nb>0) {
290
+ $dots=str_repeat('.',$nb);
291
+ $this->mpdf->Cell($w+2,$this->mpdf->FontSize+$lineheightcorr,$dots,0,0,'L');
292
+ }
293
+ // Text
294
+ $this->mpdf->SetFont($tocfont,$weight,$tocfontsize);
295
+ $this->mpdf->Cell($strsize-($level*$tocindent),$this->mpdf->FontSize+$lineheightcorr,$str,0,1,'R',0,$tlink);
296
+ }
297
+ else {
298
+ // Text
299
+ $this->mpdf->SetFont($tocfont,$weight,$tocfontsize);
300
+ $this->mpdf->Cell($this->mpdf->pgwidth -($level*$tocindent),$this->mpdf->FontSize+$lineheightcorr,$str,0,1,'R',0,$tlink);
301
+ }
302
+
303
+ if ($rem) {
304
+ $this->mpdf->x += 10;
305
+ $this->mpdf->SetFont($tocfont,$weight,$tocfontsize,true,true);
306
+ $this->mpdf->MultiCell($this->mpdf->pgwidth -($level*$tocindent)-15,$this->mpdf->FontSize+$lineheightcorr,$rem,0,R,0,$tlink,'rtl',true);
307
  }
308
+ }
309
+ // LTR
310
+ else {
311
+ // Text
312
+ $weight='';
313
+ if($level==0)
314
+ $weight='B';
315
+ $str=$t['t'];
316
+ $fullstr = $str;
317
+ $this->mpdf->SetFont($tocfont,$weight,$tocfontsize,true,true);
318
+ if($level>0 && $tocindent) { $this->mpdf->Cell($level*$tocindent,$this->mpdf->FontSize+$lineheightcorr); }
319
+
320
+ // Font-specific ligature substitution for Indic fonts
321
+ if (isset($this->mpdf->CurrentFont['indic']) && $this->mpdf->CurrentFont['indic']) $this->mpdf->ConvertIndic($str); // *INDIC*
322
+
323
+ $PageCellSize=$this->mpdf->GetStringWidth($tpgno )+2;
324
+ $strsize=$this->mpdf->GetStringWidth($str);
325
+ $repdots = $this->mpdf->GetStringWidth(str_repeat('.',5)); // mPDF 5.3.07
326
+ $cw = count(explode(' ',$str));
327
+ while (($strsize + $repdots +4+ $PageCellSize + ($level*$tocindent)) > $this->mpdf->pgwidth && $cw>1) { // mPDF 5.3.07
328
+ $str = implode(' ',explode(' ',$str,-1));
329
+ $strsize=$this->mpdf->GetStringWidth($str);
330
+ $cw = count(explode(' ',$str));
331
+ }
332
+ $sl = strlen($str);
333
+ $rem = substr($fullstr, ($sl+1));
334
+
335
+ if ($TOCusePaging) {
336
+ // Text
337
+ $this->mpdf->Cell($strsize+2,$this->mpdf->FontSize+$lineheightcorr,$str,0,0,'',0,$tlink);
338
+
339
+ //Filling dots
340
+ $this->mpdf->SetFont($tocfont,'',$tocfontsize);
341
+ $w=$this->mpdf->w-$this->mpdf->lMargin-$this->mpdf->rMargin-$PageCellSize-($level*$tocindent)-($strsize+2);
342
+ $nb=intval($w/$this->mpdf->GetCharWidth('.',false)); // mPDF 5.3.04
343
+ if ($nb>0) { $dots=str_repeat('.',$nb); }
344
+ else { $this->mpdf->y += $this->mpdf->lineheight; $dots=str_repeat('.',5); } // ..... 5 dots?
345
+ $this->mpdf->Cell($w,$this->mpdf->FontSize+$lineheightcorr,$dots,0,0,'R');
346
+
347
+ //Page number
348
+ $this->mpdf->Cell($PageCellSize,$this->mpdf->FontSize+$lineheightcorr,$tpgno ,0,1,'R',0,$tlink);
349
+ }
350
+ else {
351
+ // Text only
352
+ $this->mpdf->Cell($strsize+2,$this->mpdf->FontSize+$lineheightcorr,$str,0,1,'',0,$tlink); // forces new line
353
+ }
354
+ if ($rem) {
355
+ $this->mpdf->x += 5 + $PageCellSize + ($level*$tocindent);
356
+ $this->mpdf->SetFont($tocfont,$weight,$tocfontsize,true,true);
357
+ $this->mpdf->MultiCell($strsize+2,$this->mpdf->FontSize+$lineheightcorr,$rem,0,L,0,$tlink,'ltr',true);
358
+ }
359
+
360
+ } // *RTL*
361
  }
362
  }
 
 
363
 
364
  if ($toc_postHTML) { $this->mpdf->WriteHTML($toc_postHTML); }
 
365
  $this->mpdf->AddPage($toc_orientation,'E');
366
 
367
  $n_toc = $this->mpdf->page - $tocstart + 1;
462
 
463
 
464
  function openTagTOC($attr) {
465
+ if (isset($attr['FONT-SIZE']) && $attr['FONT-SIZE']) { $tocfontsize = $attr['FONT-SIZE']; } else { $tocfontsize = ''; }
466
+ if (isset($attr['FONT']) && $attr['FONT']) { $tocfont = $attr['FONT']; } else { $tocfont = ''; }
467
+ if (isset($attr['INDENT']) && $attr['INDENT']) { $tocindent = $attr['INDENT']; } else { $tocindent = ''; }
468
  if (isset($attr['RESETPAGENUM']) && $attr['RESETPAGENUM']) { $resetpagenum = $attr['RESETPAGENUM']; } else { $resetpagenum = ''; }
469
  if (isset($attr['PAGENUMSTYLE']) && $attr['PAGENUMSTYLE']) { $pagenumstyle = $attr['PAGENUMSTYLE']; } else { $pagenumstyle= ''; }
470
  if (isset($attr['SUPPRESS']) && $attr['SUPPRESS']) { $suppress = $attr['SUPPRESS']; } else { $suppress = ''; }
474
  if (isset($attr['LINKS']) && (strtoupper($attr['LINKS'])=='ON' || $attr['LINKS']==1)) { $links = true; }
475
  else { $links = false; }
476
  if (isset($attr['NAME']) && $attr['NAME']) { $toc_id = strtolower($attr['NAME']); } else { $toc_id = 0; }
477
+ $this->TOC($tocfont,$tocfontsize,$tocindent,$resetpagenum, $pagenumstyle, $suppress, $toc_orientation, $paging, $links, $toc_id);
478
  }
479
 
480
 
481
  function openTagTOCPAGEBREAK($attr) {
482
  if (isset($attr['NAME']) && $attr['NAME']) { $toc_id = strtolower($attr['NAME']); } else { $toc_id = 0; }
483
  if ($toc_id) {
484
+ if (isset($attr['FONT-SIZE'])) { $this->m_TOC[$toc_id]['TOCfontsize'] = $attr['FONT-SIZE']; } else { $this->m_TOC[$toc_id]['TOCfontsize'] = $this->mpdf->default_font_size; }
485
+ if (isset($attr['FONT'])) { $this->m_TOC[$toc_id]['TOCfont'] = $attr['FONT']; } else { $this->m_TOC[$toc_id]['TOCfont'] = $this->mpdf->default_font; }
486
+ if (isset($attr['INDENT']) && $attr['INDENT']) { $this->m_TOC[$toc_id]['TOCindent'] = $attr['INDENT']; } else { $this->m_TOC[$toc_id]['TOCindent'] = ''; }
487
  if (isset($attr['TOC-ORIENTATION']) && $attr['TOC-ORIENTATION']) { $this->m_TOC[$toc_id]['TOCorientation'] = $attr['TOC-ORIENTATION']; } else { $this->m_TOC[$toc_id]['TOCorientation'] = ''; }
488
  if (isset($attr['PAGING']) && (strtoupper($attr['PAGING'])=='OFF' || $attr['PAGING']==='0')) { $this->m_TOC[$toc_id]['TOCusePaging'] = false; }
489
  else { $this->m_TOC[$toc_id]['TOCusePaging'] = true; }
522
  if (isset($attr['TOC-BOOKMARKTEXT']) && $attr['TOC-BOOKMARKTEXT']) { $this->m_TOC[$toc_id]['TOCbookmarkText'] = htmlspecialchars_decode($attr['TOC-BOOKMARKTEXT'],ENT_QUOTES); } // *BOOKMARKS*
523
  }
524
  else {
525
+ if (isset($attr['FONT-SIZE'])) { $this->TOCfontsize = $attr['FONT-SIZE']; } else { $this->TOCfontsize = $this->mpdf->default_font_size; }
526
+ if (isset($attr['FONT'])) { $this->TOCfont = $attr['FONT']; } else { $this->TOCfont = $this->mpdf->default_font; }
527
+ if (isset($attr['INDENT']) && $attr['INDENT']) { $this->TOCindent = $attr['INDENT']; } else { $this->TOCindent = ''; }
528
  if (isset($attr['TOC-ORIENTATION']) && $attr['TOC-ORIENTATION']) { $this->TOCorientation = $attr['TOC-ORIENTATION']; } else { $this->TOCorientation = ''; }
529
  if (isset($attr['PAGING']) && (strtoupper($attr['PAGING'])=='OFF' || $attr['PAGING']==='0')) { $this->TOCusePaging = false; }
530
  else { $this->TOCusePaging = true; }
548
  else if (isset($attr['TOC-ODD-HEADER-VALUE']) && ($attr['TOC-ODD-HEADER-VALUE']=='-1' || strtoupper($attr['TOC-ODD-HEADER-VALUE'])=='OFF')) { $this->TOC_odd_header_value = -1; }
549
  if (isset($attr['TOC-EVEN-HEADER-VALUE']) && ($attr['TOC-EVEN-HEADER-VALUE']=='1' || strtoupper($attr['TOC-EVEN-HEADER-VALUE'])=='ON')) { $this->TOC_even_header_value = 1; }
550
  else if (isset($attr['TOC-EVEN-HEADER-VALUE']) && ($attr['TOC-EVEN-HEADER-VALUE']=='-1' || strtoupper($attr['TOC-EVEN-HEADER-VALUE'])=='OFF')) { $this->TOC_even_header_value = -1; }
 
551
  if (isset($attr['TOC-ODD-FOOTER-VALUE']) && ($attr['TOC-ODD-FOOTER-VALUE']=='1' || strtoupper($attr['TOC-ODD-FOOTER-VALUE'])=='ON')) { $this->TOC_odd_footer_value = 1; }
552
  else if (isset($attr['TOC-ODD-FOOTER-VALUE']) && ($attr['TOC-ODD-FOOTER-VALUE']=='-1' || strtoupper($attr['TOC-ODD-FOOTER-VALUE'])=='OFF')) { $this->TOC_odd_footer_value = -1; }
553
  if (isset($attr['TOC-EVEN-FOOTER-VALUE']) && ($attr['TOC-EVEN-FOOTER-VALUE']=='1' || strtoupper($attr['TOC-EVEN-FOOTER-VALUE'])=='ON')) { $this->TOC_even_footer_value = 1; }
556
  else { $this->TOC_page_selector = ''; }
557
  if (isset($attr['TOC-SHEET-SIZE']) && $attr['TOC-SHEET-SIZE']) { $this->TOCsheetsize = $attr['TOC-SHEET-SIZE']; } else { $this->TOCsheetsize = ''; }
558
 
559
+
560
  if (isset($attr['TOC-PREHTML']) && $attr['TOC-PREHTML']) { $this->TOCpreHTML = htmlspecialchars_decode($attr['TOC-PREHTML'],ENT_QUOTES); }
561
  if (isset($attr['TOC-POSTHTML']) && $attr['TOC-POSTHTML']) { $this->TOCpostHTML = htmlspecialchars_decode($attr['TOC-POSTHTML'],ENT_QUOTES); }
562
  if (isset($attr['TOC-BOOKMARKTEXT']) && $attr['TOC-BOOKMARKTEXT']) { $this->TOCbookmarkText = htmlspecialchars_decode($attr['TOC-BOOKMARKTEXT'],ENT_QUOTES); }
mPDF/classes/ttfontsuni.php CHANGED
@@ -124,7 +124,7 @@ var $kerninfo;
124
  }
125
 
126
 
127
- function readTableDirectory($debug=false) {
128
  $this->numTables = $this->read_ushort();
129
  $this->searchRange = $this->read_ushort();
130
  $this->entrySelector = $this->read_ushort();
@@ -138,7 +138,7 @@ var $kerninfo;
138
  $record['length'] = $this->read_ulong();
139
  $this->tables[$record['tag']] = $record;
140
  }
141
- //if ($debug) $this->checksumTables();
142
  }
143
 
144
  function checksumTables() {
@@ -154,7 +154,6 @@ var $kerninfo;
154
  $checksum = $this->sub32($checksum, $adjustment);
155
  }
156
  $xchecksum = $t['checksum'];
157
-
158
  if ($xchecksum != $checksum)
159
  die(sprintf('TTF file "%s": invalid checksum %s table: %s (expected %s)', $this->filename,dechex($checksum[0]).dechex($checksum[1]),$t['tag'],dechex($xchecksum[0]).dechex($xchecksum[1])));
160
  }
@@ -334,9 +333,9 @@ var $kerninfo;
334
  $this->seek($this->TTCFonts[$TTCfontID]['offset']);
335
  $this->version = $version = $this->read_ulong(); // TTFont version again now
336
  }
337
-
338
  $this->readTableDirectory($debug);
339
 
 
340
  // cmap - Character to glyph index mapping table
341
  $cmap_offset = $this->seek_table("cmap");
342
  $this->skip(2);
124
  }
125
 
126
 
127
+ function readTableDirectory($debug=false) {
128
  $this->numTables = $this->read_ushort();
129
  $this->searchRange = $this->read_ushort();
130
  $this->entrySelector = $this->read_ushort();
138
  $record['length'] = $this->read_ulong();
139
  $this->tables[$record['tag']] = $record;
140
  }
141
+ if ($debug) $this->checksumTables();
142
  }
143
 
144
  function checksumTables() {
154
  $checksum = $this->sub32($checksum, $adjustment);
155
  }
156
  $xchecksum = $t['checksum'];
 
157
  if ($xchecksum != $checksum)
158
  die(sprintf('TTF file "%s": invalid checksum %s table: %s (expected %s)', $this->filename,dechex($checksum[0]).dechex($checksum[1]),$t['tag'],dechex($xchecksum[0]).dechex($xchecksum[1])));
159
  }
333
  $this->seek($this->TTCFonts[$TTCfontID]['offset']);
334
  $this->version = $version = $this->read_ulong(); // TTFont version again now
335
  }
 
336
  $this->readTableDirectory($debug);
337
 
338
+
339
  // cmap - Character to glyph index mapping table
340
  $cmap_offset = $this->seek_table("cmap");
341
  $this->skip(2);
mPDF/compress.php DELETED
@@ -1,172 +0,0 @@
1
- <?php
2
-
3
- $excl = array( 'HTML-CSS', 'DIRECTW', 'TABLES', 'LISTS', 'IMAGES-CORE',
4
- 'IMAGES-BMP', 'IMAGES-WMF', 'TABLES-ADVANCED-BORDERS', 'HTMLHEADERS-FOOTERS', 'COLUMNS', 'TOC', 'INDEX', 'BOOKMARKS', 'BARCODES', 'FORMS', 'WATERMARK', 'CJK-FONTS', 'RTL', 'INDIC', 'ANNOTATIONS', 'BACKGROUNDS', 'CSS-FLOAT', 'CSS-IMAGE-FLOAT', 'CSS-POSITION', 'CSS-PAGE', 'BORDER-RADIUS', 'HYPHENATION', 'ENCRYPTION', 'IMPORTS', 'PROGRESS-BAR');
5
-
6
-
7
- // *DIRECTW* = Write, WriteText, WriteCell, Text, Shaded_box, AutosizeText
8
- // IMAGES-CORE = [PNG, GIF, and JPG] NB background-images and watermark images
9
-
10
- // Excluding 'HTML-CSS' will also exclude: 'TABLES', 'LISTS', 'TABLES-ADVANCED-BORDERS', 'HTMLHEADERS-FOOTERS', 'FORMS', 'BACKGROUNDS', 'CSS-FLOAT', 'CSS-IMAGE-FLOAT', 'CSS-POSITION', 'CSS-PAGE', 'BORDER-RADIUS'
11
-
12
- // Text is marked in mpdf_source.php with e.g. :
13
- /*-- TABLES-ADVANCED-BORDERS --*/
14
- /*-- END TABLES-ADVANCED-BORDERS --*/
15
- // *TABLES-ADVANCED-BORDERS*
16
-
17
-
18
- if (!isset($_POST['generate']) || $_POST['generate']!='generate') {
19
-
20
-
21
- if (!file_exists('mpdf_source.php')) {
22
- die("ERROR - Could not find mpdf_source.php file in current directory. Please rename mpdf.php as mpdf_source.php");
23
- }
24
-
25
-
26
-
27
-
28
- echo '<html>
29
- <head>
30
- <script language=javascript>
31
- checked=false;
32
- function checkedAll (frm1) {
33
- var aa= document.getElementById("frm1");
34
- if (checked == false)
35
- {
36
- checked = true
37
- }
38
- else
39
- {
40
- checked = false
41
- }
42
- for (var i =0; i < aa.elements.length; i++)
43
- {
44
- aa.elements[i].checked = checked;
45
- }
46
- }
47
- </script>
48
- </head>
49
- <body>
50
- <p><span style="color:red; font-weight: bold;">WARNING</span>: This utility will OVERWRITE mpdf.php file in the current directory.</p>
51
- <p>Select the functions you wish to INCLUDE in your mpdf.php program. When you click generate, a new mpdf.php file will be written to the current directory.</p>
52
- <div><b>Notes</b>
53
- <ul>
54
- <li>HTML-CSS is required for many of the other functions to work including: Tables, Lists, Backgrounds, Forms, Border-radius and all other CSS</li>
55
- <li>DIRECTW includes the functions to Write directly to the PDF file e.g. Write, WriteText, WriteCell, Text, Shaded_box, AutosizeText</li>
56
- <li>You must include either HTML-CSS or DIRECTW</li>
57
- <li>JPG, PNG and JPG images are supported with IMAGES-CORE</li>
58
- <li>For WMF Images, you must include both IMAGES-CORE and IMAGES-WMF</li>
59
- <li>IMAGES-CORE are required for BACKGROUNDS (IMAGES) or WATERMARKS to work</li>
60
- </ul>
61
- </div>
62
- <input type="checkbox" name="checkall" onclick="checkedAll(frm1);"> <i>Select/Unselect All</i><br /><br />
63
-
64
- <form id="frm1" action="compress.php" method="POST">
65
- ';
66
- foreach($excl AS $k=>$ex) {
67
- echo '<input type="checkbox" value="1" name="inc['.$ex.']"';
68
- if ($k==0 || ($k > 1 && $k < 5)) {
69
- echo ' checked="checked"';
70
- }
71
- echo ' /> '.$ex.'<br />';
72
- }
73
-
74
- echo '<br />
75
- <input type="submit" name="generate" value="generate" />
76
- </form>
77
- </body>
78
- </html>';
79
- exit;
80
- }
81
-
82
- $inc = $_POST['inc'];
83
- if (is_array($inc) && count($inc)>0 ) {
84
- foreach($inc AS $i=>$v) {
85
- $key = array_search($i, $excl);
86
- unset($excl[$key]);
87
- }
88
- }
89
-
90
- if (!defined('PHP_VERSION_ID')) {
91
- $version = explode('.', PHP_VERSION);
92
- define('PHP_VERSION_ID', ($version[0] * 10000 + $version[1] * 100 + $version[2]));
93
- }
94
- if (PHP_VERSION_ID < 50300) { $mqr = @get_magic_quotes_runtime(); }
95
- else { $mqr=0; }
96
- if ($mqr) { set_magic_quotes_runtime(0); }
97
-
98
- $l = file('mpdf_source.php');
99
- if (!count($l)) { die("ERROR - Could not find mpdf_source.php file in current directory"); }
100
- $exclflags = array();
101
- $x = '';
102
-
103
- // Excluding 'HTML-CSS' will also exclude: 'TABLES', 'LISTS', 'TABLES-ADVANCED-BORDERS', 'HTMLHEADERS-FOOTERS', 'FORMS', 'BACKGROUNDS', 'CSS-FLOAT', 'CSS-IMAGE-FLOAT', 'CSS-POSITION', 'CSS-PAGE', 'BORDER-RADIUS'
104
- if ($excl[0]=='HTML-CSS') {
105
- $excl[] = 'TABLES';
106
- $excl[] = 'LISTS';
107
- $excl[] = 'TABLES-ADVANCED-BORDERS';
108
- $excl[] = 'HTMLHEADERS-FOOTERS';
109
- $excl[] = 'FORMS';
110
- $excl[] = 'BACKGROUNDS';
111
- $excl[] = 'CSS-FLOAT';
112
- $excl[] = 'CSS-IMAGE-FLOAT';
113
- $excl[] = 'CSS-POSITION';
114
- $excl[] = 'CSS-PAGE';
115
- $excl[] = 'BORDER-RADIUS';
116
- }
117
- $excl = array_unique($excl);
118
-
119
- foreach($l AS $k=>$ln) {
120
- $exclude = false;
121
- // *XXXXX*
122
- preg_match_all("/\/\/ \*([A-Za-z\-]+)\*/", $ln, $m);
123
- foreach($m[1] AS $mm) {
124
- if (in_array($mm, $excl)) {
125
- $exclude = true;
126
- }
127
- }
128
- /*-- XXXXX --*/
129
- preg_match_all("/\/\*-- ([A-Za-z\-]+) --\*\//", $ln, $m);
130
- foreach($m[1] AS $mm) {
131
- if (in_array($mm, $excl)) {
132
- $exclflags[$mm] = true;
133
- }
134
- $exclude = true;
135
- }
136
- $exclflags = array_unique($exclflags);
137
- /*-- END XXXX --*/
138
- preg_match_all("/\/\*-- END ([A-Za-z\-]+) --\*\//", $ln, $m);
139
- foreach($m[1] AS $mm) {
140
- if (in_array($mm, $excl)) {
141
- unset($exclflags[$mm]);
142
- }
143
- $exclude = true;
144
- }
145
- if (count($exclflags)==0 && !$exclude) {
146
- $x .= $ln;
147
- }
148
- }
149
- // mPDF 5.0
150
- if (function_exists('file_put_contents')) {
151
- $check = file_put_contents('mpdf.php', $x);
152
- }
153
- else {
154
- $f=fopen('mpdf.php', 'w');
155
- $check = fwrite($f, $x);
156
- fclose($f);
157
- }
158
- if (!$check) { die("ERROR - Could not write to mpdf.php file. Are permissions correctly set?"); }
159
- echo '<p><b>mPDF file generated successfully!</b></p>';
160
- echo '<div>mPDF file size '.number_format((strlen($x)/1024)).' kB</div>';
161
-
162
- unset($l);
163
- unset($x);
164
-
165
- include('mpdf.php');
166
- $mpdf = new mPDF();
167
-
168
- echo '<div>Memory usage on loading mPDF class '.number_format((memory_get_usage(true)/(1024*1024)),2).' MB</div>';
169
-
170
- exit;
171
-
172
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
mPDF/config.php CHANGED
@@ -1,25 +1,5 @@
1
  <?php
2
 
3
- // mPDF 5.7
4
- // Specify whether to automatically generate bookmarks or ToC entries from h1 - h6 tags
5
- $this->h2bookmarks = array();
6
- $this->h2toc = array();
7
- /* Define arrays with e.g. the tag=>ToC-level
8
- Remember bookmark and ToC levels start at 0
9
- (does not work inside tables)
10
- Only the default ToC will be used if > 1 ToCs are defined for the document
11
- H1 - H6 must be uppercase
12
- $this->h2toc = array('H1'=>0, 'H2'=>1, 'H3'=>2);
13
- $this->h2bookmarks = array('H1'=>0, 'H2'=>1, 'H3'=>2);
14
- */
15
-
16
- // mPDF 5.7
17
- // Text-align on decimal marks
18
- // Allowed characters for alignment on decimal marks. Additional codes must start with D
19
- // Non-ASCII characters should be in utf-8 encoding
20
- // DM - middot U+00B7
21
- // DA - arabic decimal mark U+066B
22
- $this->decimal_align = array('DP'=>'.', 'DC'=>',', 'DM'=>"\xc2\xb7", 'DA'=>"\xd9\xab", 'DD'=>'-');
23
 
24
  // PAGING
25
  $this->mirrorMargins = 0;
@@ -58,7 +38,7 @@ $this->maxTTFFilesize = 2000;
58
  // 100 will force always to subset
59
  // This value is overridden if you set new mPDF('s)
60
  // and/or Can set at runtime
61
- $this->percentSubset = 60;
62
 
63
  $this->useAdobeCJK = true; // Uses Adobe CJK fonts for CJK languages
64
  // default TRUE; only set false if you have defined some available fonts that support CJK
@@ -69,11 +49,11 @@ $this->useAdobeCJK = true; // Uses Adobe CJK fonts for CJK languages
69
  // May improve function with some PostScript printers (GhostScript/GSView)
70
  // Does not work with TTC font collections
71
  // Slightly smaller file; increased processing time
72
- (defined('PDF_REPACK_FONT') && PDF_REPACK_FONT === true) ? $this->repackageTTF = true : $this->repackageTTF = false;
73
 
74
  // Allows automatic character set conversion if "charset=xxx" detected in html header (WriteHTML() )
75
  $this->allow_charset_conversion = true;
76
- $this->biDirectional=false; // automatically determine BIDI text in LTR page
77
  $this->autoFontGroupSize = 2; // 1: individual words are spanned; 2: words+; 3: as big chunks as possible.
78
  $this->useLang = true; // Default changed in mPDF 4.0
79
 
@@ -81,7 +61,7 @@ $this->useSubstitutions = true; // Substitute missing characters in UTF-8(multi
81
  $this->falseBoldWeight = 5; // Weight for bold text when using an artificial (outline) bold; value 0 (off) - 10 (rec. max)
82
 
83
  // CONFIGURATION
84
- $this->allow_output_buffering = true;
85
 
86
  $this->enableImports = true; // Adding mPDFI functions
87
 
@@ -98,8 +78,8 @@ $this->dpi = 96; // To interpret "px" pixel values in HTML/CSS (see img_dpi
98
  // If you are confident input html is valid XHTML, turning this off may make it more reliable(?)
99
  $this->allow_html_optional_endtags = true;
100
 
101
- $this->ignore_invalid_utf8 = true;
102
- $this->text_input_as_HTML = true; // Converts all entities in Text inputs to UTF-8 before encoding
103
  $this->useGraphs = false;
104
 
105
 
@@ -141,10 +121,10 @@ if(WP_DEBUG === true)
141
  {
142
  $this->showStats = true;
143
  $this->debug = true;
144
- $this->debugfonts = true; // Checks and reports on errors when parsing TTF files - adds significantly to processing time
145
- $this->showImageErrors = false;
146
- $this->table_error_report = false; /* shows inaccurate error about too small a cell width when enabled */
147
- $this->table_error_report_param = ''; // Parameter which can be passed to show in error report i.e. chapter number being processed//
148
  }
149
  else
150
  {
@@ -153,7 +133,7 @@ else
153
  $this->debugfonts = false; // Checks and reports on errors when parsing TTF files - adds significantly to processing time
154
  $this->showImageErrors = false;
155
  $this->table_error_report = false; // Die and report error if table is too wide to contain whole words
156
- $this->table_error_report_param = ''; // Parameter which can be passed to show in error report i.e. chapter number being processed//
157
  }
158
 
159
 
@@ -196,23 +176,24 @@ $this->footer_line_spacing = 0.25; // spacing between bottom of header and line
196
  // If 'pad' margin-top sets fixed distance in mm (padding) between bottom of header and top of text.
197
  // If 'stretch' margin-top sets a minimum distance in mm between top of page and top of text, which expands if header is too large to fit.
198
  $this->setAutoTopMargin = 'stretch';
199
- $this->setAutoBottomMargin = 'strech';
200
  $this->autoMarginPadding = 2; // distance in mm used as padding if 'stretch' mode is used
201
 
202
 
 
203
  // TABLES
204
- (defined('PDF_ENABLE_SIMPLE_TABLES') && PDF_ENABLE_SIMPLE_TABLES === true) ? $this->simpleTables = true : $this->simpleTables = false; // Forces all cells to have same border, background etc. Improves performance
205
- $this->packTableData = false; // Reduce memory usage processing tables (but with increased processing time)
206
  // Using disk to cache table data can reduce memory usage dramatically, but at a cost of increased
207
  // executon time and disk access (read and write)
208
- global $gfpdfe_data;
209
 
 
210
  if($gfpdfe_data->can_write_pdf_temp_dir === false)
211
  {
212
  $this->cacheTables = false;
213
  }
214
  else
215
- {
216
  $this->cacheTables = true;
217
  }
218
 
@@ -229,7 +210,8 @@ $this->tableMinSizePriority = false; // If page-break-inside:avoid but cannot fi
229
 
230
  $this->use_kwt = true; // "Keep-with-table"
231
  $this->iterationCounter = false; // Set to TRUE to use table Head iteration counter
232
- $this->splitTableBorderWidth = 0; // Use table border (using this width in mm) when table breaks across pages
 
233
  // Recommended to use small value e.g. 0.01
234
 
235
 
@@ -249,6 +231,7 @@ $this->jSmaxChar = 2; // Maximum spacing to allocate to character spacing. (0 =
249
 
250
  $this->jSmaxCharLast = 1; // Maximum character spacing allowed (carried over) when finishing a last line
251
  $this->jSmaxWordLast = 2; // Maximum word spacing allowed (carried over) when finishing a last line
 
252
  $this->normalLineheight = 1.33; // Value used for line-height when CSS specified as 'normal' (default)
253
 
254
  // Small Caps
@@ -258,9 +241,11 @@ $this->smCapsStretch = 110; // % to stretch small caps horizontally (i.e. 100 =
258
  // CJK Line-breaking
259
  $this->allowCJKorphans = true; // FALSE=always wrap to next line; TRUE=squeeze or overflow
260
  $this->allowCJKoverflow = false; // FALSE=squeeze; TRUE=overflow (only some characters, and disabled in tables)
261
- $this->CJKforceend = false; // Forces overflowng punctuation to hang outside right margin mPDF 5.6.40
262
 
263
  // HYPHENATION
 
 
264
  $this->SHYlang = "en"; // Should be one of: 'en','de','es','fi','fr','it','nl','pl','ru','sv'
265
  $this->SHYleftmin = 2;
266
  $this->SHYrightmin = 2;
@@ -279,12 +264,12 @@ $this->list_indent_first_level = 0; // 1/0 yex/no to indent first level of list
279
  $this->list_number_suffix = '.'; // Content to follow a numbered list marker e.g. '.' gives 1. or IV.; ')' gives 1) or a)
280
 
281
  // ACTIVE FORMS
282
- $this->useActiveForms = false;
283
 
284
  // WATERMARKS
285
- $this->watermarkImgBehind = true;
286
- $this->showWatermarkText = 1;
287
- $this->showWatermarkImage = 1;
288
  $this->watermarkText = '';
289
  $this->watermarkImage = '';
290
  $this->watermark_font = '';
@@ -309,7 +294,6 @@ $this->defaultCSS = array(
309
  'TEXT-INDENT' => '0pt',
310
  'LINE-HEIGHT' => 'normal',
311
  'MARGIN-COLLAPSE' => 'collapse', /* Custom property to collapse top/bottom margins at top/bottom of page - ignored in tables/lists */
312
- 'HYPHENS' => 'manual', /* mPDF 5.6.08 */
313
  ),
314
  'P' => array(
315
  'MARGIN' => '1.12em 0',
@@ -582,7 +566,7 @@ $this->allowedCSStags = 'DIV|P|H1|H2|H3|H4|H5|H6|FORM|IMG|A|BODY|TABLE|HR|THEAD|
582
  $this->allowedCSStags .= '|ARTICLE|ASIDE|FIGURE|FIGCAPTION|FOOTER|HEADER|HGROUP|NAV|SECTION|MARK|DETAILS|SUMMARY|METER|PROGRESS|TIME'; // mPDF 5.5.09
583
  $this->allowedCSStags .= '|SPAN|TT|I|B|BIG|SMALL|EM|STRONG|DFN|CODE|SAMP|KBD|VAR|CITE|ABBR|ACRONYM|STRIKE|S|U|DEL|INS|Q|FONT';
584
  $this->allowedCSStags .= '|SELECT|INPUT|TEXTAREA|CAPTION|FIELDSET|LEGEND'; // mPDF 5.4.18
585
- $this->allowedCSStags .= '|TEXTCIRCLE|DOTTAB'; // mPDF 5.5.23 // mPDF 5.6.33
586
 
587
  $this->outerblocktags = array('DIV','FORM','CENTER','DL','FIELDSET','ARTICLE','ASIDE','FIGURE','FIGCAPTION', 'FOOTER','HEADER','HGROUP','NAV','SECTION','DETAILS','SUMMARY'); // mPDF 5.5.09 // mPDF 5.5.22
588
  $this->innerblocktags = array('P','BLOCKQUOTE','ADDRESS','PRE','H1','H2','H3','H4','H5','H6','DT','DD','CAPTION');
1
  <?php
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
 
4
  // PAGING
5
  $this->mirrorMargins = 0;
38
  // 100 will force always to subset
39
  // This value is overridden if you set new mPDF('s)
40
  // and/or Can set at runtime
41
+ $this->percentSubset = 100;
42
 
43
  $this->useAdobeCJK = true; // Uses Adobe CJK fonts for CJK languages
44
  // default TRUE; only set false if you have defined some available fonts that support CJK
49
  // May improve function with some PostScript printers (GhostScript/GSView)
50
  // Does not work with TTC font collections
51
  // Slightly smaller file; increased processing time
52
+ $this->repackageTTF = false;
53
 
54
  // Allows automatic character set conversion if "charset=xxx" detected in html header (WriteHTML() )
55
  $this->allow_charset_conversion = true;
56
+ $this->biDirectional=true; // automatically determine BIDI text in LTR page
57
  $this->autoFontGroupSize = 2; // 1: individual words are spanned; 2: words+; 3: as big chunks as possible.
58
  $this->useLang = true; // Default changed in mPDF 4.0
59
 
61
  $this->falseBoldWeight = 5; // Weight for bold text when using an artificial (outline) bold; value 0 (off) - 10 (rec. max)
62
 
63
  // CONFIGURATION
64
+ $this->allow_output_buffering = false;
65
 
66
  $this->enableImports = true; // Adding mPDFI functions
67
 
78
  // If you are confident input html is valid XHTML, turning this off may make it more reliable(?)
79
  $this->allow_html_optional_endtags = true;
80
 
81
+ $this->ignore_invalid_utf8 = false;
82
+ $this->text_input_as_HTML = false; // Converts all entities in Text inputs to UTF-8 before encoding
83
  $this->useGraphs = false;
84
 
85
 
121
  {
122
  $this->showStats = true;
123
  $this->debug = true;
124
+ $this->debugfonts = false; // Checks and reports on errors when parsing TTF files - adds significantly to processing time
125
+ $this->showImageErrors = true;
126
+ $this->table_error_report = false; // Die and report error if table is too wide to contain whole words
127
+ $this->table_error_report_param = ''; // Parameter which can be passed to show in error report i.e. chapter number being processed//
128
  }
129
  else
130
  {
133
  $this->debugfonts = false; // Checks and reports on errors when parsing TTF files - adds significantly to processing time
134
  $this->showImageErrors = false;
135
  $this->table_error_report = false; // Die and report error if table is too wide to contain whole words
136
+ $this->table_error_report_param = ''; // Parameter which can be passed to show in error report i.e. chapter number being processed//
137
  }
138
 
139
 
176
  // If 'pad' margin-top sets fixed distance in mm (padding) between bottom of header and top of text.
177
  // If 'stretch' margin-top sets a minimum distance in mm between top of page and top of text, which expands if header is too large to fit.
178
  $this->setAutoTopMargin = 'stretch';
179
+ $this->setAutoBottomMargin = 'stretch';
180
  $this->autoMarginPadding = 2; // distance in mm used as padding if 'stretch' mode is used
181
 
182
 
183
+
184
  // TABLES
185
+ $this->simpleTables = false; // Forces all cells to have same border, background etc. Improves performance
186
+ $this->packTableData = true; // Reduce memory usage processing tables (but with increased processing time)
187
  // Using disk to cache table data can reduce memory usage dramatically, but at a cost of increased
188
  // executon time and disk access (read and write)
 
189
 
190
+ global $gfpdfe_data;
191
  if($gfpdfe_data->can_write_pdf_temp_dir === false)
192
  {
193
  $this->cacheTables = false;
194
  }
195
  else
196
+ {
197
  $this->cacheTables = true;
198
  }
199
 
210
 
211
  $this->use_kwt = true; // "Keep-with-table"
212
  $this->iterationCounter = false; // Set to TRUE to use table Head iteration counter
213
+ // mPDF 5.4.16
214
+ $this->splitTableBorderWidth = 0.01; // Use table border (using this width in mm) when table breaks across pages
215
  // Recommended to use small value e.g. 0.01
216
 
217
 
231
 
232
  $this->jSmaxCharLast = 1; // Maximum character spacing allowed (carried over) when finishing a last line
233
  $this->jSmaxWordLast = 2; // Maximum word spacing allowed (carried over) when finishing a last line
234
+ $this->orphansAllowed = 5; // No of SUP or SUB characters to include on line to avoid leaving e.g. end of line//<sup>32</sup>
235
  $this->normalLineheight = 1.33; // Value used for line-height when CSS specified as 'normal' (default)
236
 
237
  // Small Caps
241
  // CJK Line-breaking
242
  $this->allowCJKorphans = true; // FALSE=always wrap to next line; TRUE=squeeze or overflow
243
  $this->allowCJKoverflow = false; // FALSE=squeeze; TRUE=overflow (only some characters, and disabled in tables)
244
+
245
 
246
  // HYPHENATION
247
+ $this->hyphenate = false;
248
+ $this->hyphenateTables = false;
249
  $this->SHYlang = "en"; // Should be one of: 'en','de','es','fi','fr','it','nl','pl','ru','sv'
250
  $this->SHYleftmin = 2;
251
  $this->SHYrightmin = 2;
264
  $this->list_number_suffix = '.'; // Content to follow a numbered list marker e.g. '.' gives 1. or IV.; ')' gives 1) or a)
265
 
266
  // ACTIVE FORMS
267
+ $this->useActiveForms = true;
268
 
269
  // WATERMARKS
270
+ $this->watermarkImgBehind = false;
271
+ $this->showWatermarkText = 0;
272
+ $this->showWatermarkImage = 0;
273
  $this->watermarkText = '';
274
  $this->watermarkImage = '';
275
  $this->watermark_font = '';
294
  'TEXT-INDENT' => '0pt',
295
  'LINE-HEIGHT' => 'normal',
296
  'MARGIN-COLLAPSE' => 'collapse', /* Custom property to collapse top/bottom margins at top/bottom of page - ignored in tables/lists */
 
297
  ),
298
  'P' => array(
299
  'MARGIN' => '1.12em 0',
566
  $this->allowedCSStags .= '|ARTICLE|ASIDE|FIGURE|FIGCAPTION|FOOTER|HEADER|HGROUP|NAV|SECTION|MARK|DETAILS|SUMMARY|METER|PROGRESS|TIME'; // mPDF 5.5.09
567
  $this->allowedCSStags .= '|SPAN|TT|I|B|BIG|SMALL|EM|STRONG|DFN|CODE|SAMP|KBD|VAR|CITE|ABBR|ACRONYM|STRIKE|S|U|DEL|INS|Q|FONT';
568
  $this->allowedCSStags .= '|SELECT|INPUT|TEXTAREA|CAPTION|FIELDSET|LEGEND'; // mPDF 5.4.18
569
+ $this->allowedCSStags .= '|TEXTCIRCLE'; // mPDF 5.5.23
570
 
571
  $this->outerblocktags = array('DIV','FORM','CENTER','DL','FIELDSET','ARTICLE','ASIDE','FIGURE','FIGCAPTION', 'FOOTER','HEADER','HGROUP','NAV','SECTION','DETAILS','SUMMARY'); // mPDF 5.5.09 // mPDF 5.5.22
572
  $this->innerblocktags = array('P','BLOCKQUOTE','ADDRESS','PRE','H1','H2','H3','H4','H5','H6','DT','DD','CAPTION');
mPDF/config_cp.php CHANGED
@@ -96,7 +96,7 @@ function GetLangOpts($llcc, $adobeCJK) {
96
  }
97
  /* Uncomment these lines if CJK fonts available */
98
  else {
99
- $unifonts = "sun-exta,sun-extb,hannoma,hannomb";
100
  }
101
  break;
102
 
@@ -104,9 +104,8 @@ function GetLangOpts($llcc, $adobeCJK) {
104
  if ($adobeCJK) {
105
  $unifonts = "uhc,uhcB,uhcI,uhcBI";
106
  }
107
- /* Uncomment these lines if CJK fonts available */
108
  else {
109
- $unifonts = "unbatang_0613";
110
  }
111
  break;
112
 
@@ -117,7 +116,7 @@ function GetLangOpts($llcc, $adobeCJK) {
117
  }
118
  /* Uncomment these lines if CJK fonts available */
119
  else {
120
- $unifonts = "sun-exta,sun-extb,hannoma,hannomb";
121
  }
122
  }
123
  else if ($country == "CN") {
@@ -126,7 +125,7 @@ function GetLangOpts($llcc, $adobeCJK) {
126
  }
127
  /* Uncomment these lines if CJK fonts available */
128
  else {
129
- $unifonts = "sun-exta,sun-extb,hannoma,hannomb";
130
  }
131
  }
132
  else {
@@ -135,7 +134,7 @@ function GetLangOpts($llcc, $adobeCJK) {
135
  }
136
  /* Uncomment these lines if CJK fonts available */
137
  else {
138
- $unifonts = "sun-exta,sun-extb,hannoma,hannomb";
139
  }
140
  }
141
  break;
96
  }
97
  /* Uncomment these lines if CJK fonts available */
98
  else {
99
+ $unifonts = "sun-exta,sun-extb";
100
  }
101
  break;
102
 
104
  if ($adobeCJK) {
105
  $unifonts = "uhc,uhcB,uhcI,uhcBI";
106
  }
 
107
  else {
108
+ $unifonts = "unbatang";
109
  }
110
  break;
111
 
116
  }
117
  /* Uncomment these lines if CJK fonts available */
118
  else {
119
+ $unifonts = "sun-exta,sun-extb";
120
  }
121
  }
122
  else if ($country == "CN") {
125
  }
126
  /* Uncomment these lines if CJK fonts available */
127
  else {
128
+ $unifonts = "sun-exta,sun-extb";
129
  }
130
  }
131
  else {
134
  }
135
  /* Uncomment these lines if CJK fonts available */
136
  else {
137
+ $unifonts = "sun-exta,sun-extb";
138
  }
139
  }
140
  break;
mPDF/config_fonts.php CHANGED
@@ -43,19 +43,20 @@ by including the font-family in $this->sans_fonts below
43
  To aid backwards compatability some are included:
44
  */
45
  $this->fonttrans = array(
46
- 'helvetica' => 'chelvetica',
47
- 'arial' => 'chelvetica',
 
48
  'timesnewroman' => 'ctimes',
49
- 'times' => 'ctimes',
50
- 'courier' => 'ccourier',
51
- 'trebuchet' => 'trebuchetms',
52
- 'comic' => 'comicsansms',
53
- 'franklin' => 'franklingothicbook',
54
- 'albertus' => 'albertusmedium',
55
- 'arialuni' => 'arialunicodems',
56
- 'zn_hannom_a' => 'hannoma',
57
- 'ocr-b' => 'ocrb',
58
- 'ocr-b10bt' => 'ocrb',
59
  );
60
 
61
  /*
@@ -200,21 +201,9 @@ $this->fontdata = array(
200
  ),
201
 
202
 
203
-
204
-
205
  /* Examples of some CJK fonts */
206
- /*
207
- "unbatang_0613" => array(
208
- 'R' => "UnBatang_0613.ttf",
209
- ),
210
- "sun-exta" => array(
211
- 'R' => "Sun-ExtA.ttf",
212
- 'sip-ext' => 'sun-extb',
213
- ),
214
- "sun-extb" => array(
215
- 'R' => "Sun-ExtB.ttf",
216
- ),
217
- "hannoma" => array(
218
  'R' => "HAN NOM A.ttf",
219
  'sip-ext' => 'hannomb',
220
  ),
@@ -270,13 +259,11 @@ $this->fontdata = array(
270
  * Blue Liquid Designs Edit
271
  * Include the font configuration file defined by the plugin
272
  */
273
-
274
- if(file_exists($gfpdfe_data->template_font_location . 'config.php'))
275
  {
276
- include $gfpdfe_data->template_font_location . 'config.php';
277
  }
278
 
279
-
280
  // Add fonts to this array if they contain characters in the SIP or SMP Unicode planes
281
  // but you do not require them. This allows a more efficient form of subsetting to be used.
282
  $this->BMPonly = array(
43
  To aid backwards compatability some are included:
44
  */
45
  $this->fonttrans = array(
46
+ 'arial' => 'chelvetica',
47
+ 'helvetica' => 'chelvetica',
48
+ 'times' => 'ctimes',
49
  'timesnewroman' => 'ctimes',
50
+ 'courier' => 'ccourier',
51
+ 'couriernew' => 'ccourier',
52
+ 'trebuchet' => 'trebuchetms',
53
+ 'comic' => 'comicsansms',
54
+ 'franklin' => 'franklingothicbook',
55
+ 'albertus' => 'albertusmedium',
56
+ 'arialuni' => 'arialunicodems',
57
+ 'zn_hannom_a' => 'hannoma',
58
+ 'ocr-b' => 'ocrb',
59
+ 'ocr-b10bt' => 'ocrb',
60
  );
61
 
62
  /*
201
  ),
202
 
203
 
 
 
204
  /* Examples of some CJK fonts */
205
+
206
+ /*"hannoma" => array(
 
 
 
 
 
 
 
 
 
 
207
  'R' => "HAN NOM A.ttf",
208
  'sip-ext' => 'hannomb',
209
  ),
259
  * Blue Liquid Designs Edit
260
  * Include the font configuration file defined by the plugin
261
  */
262
+ if(file_exists(PDF_TEMPLATE_LOCATION.'fonts/config.php'))
 
263
  {
264
+ include PDF_TEMPLATE_LOCATION.'fonts/config.php';
265
  }
266
 
 
267
  // Add fonts to this array if they contain characters in the SIP or SMP Unicode planes
268
  // but you do not require them. This allows a more efficient form of subsetting to be used.
269
  $this->BMPonly = array(
mPDF/includes/functions.php CHANGED
@@ -1,35 +1,5 @@
1
  <?php
2
 
3
- // mPDF 5.7
4
- // Replace a section of an array with the elements in reverse
5
- if(!function_exists('array_splice_reverse'))
6
- {
7
- function array_splice_reverse(&$arr, $offset, $length) {
8
- $tmp = (array_reverse(array_slice($arr, $offset, $length)));
9
- array_splice($arr, $offset, $length, $tmp);
10
- }
11
- }
12
-
13
-
14
- // mPDF 5.6.23
15
- if(!function_exists('array_insert')) {
16
- function array_insert(&$array, $value, $offset) {
17
- if (is_array($array)) {
18
- $array = array_values($array);
19
- $offset = intval($offset);
20
- if ($offset < 0 || $offset >= count($array)) { array_push($array, $value); }
21
- else if ($offset == 0) { array_unshift($array, $value); }
22
- else {
23
- $temp = array_slice($array, 0, $offset);
24
- array_push($temp, $value);
25
- $array = array_slice($array, $offset);
26
- $array = array_merge($temp, $array);
27
- }
28
- }
29
- else { $array = array($value); }
30
- return count($array);
31
- }
32
- }
33
 
34
  function urlencode_part($url) { // mPDF 5.6.02
35
  if (!preg_match('/^[a-z]+:\/\//i',$url)) { return $url; }
@@ -105,30 +75,12 @@ function PreparePreText($text,$ff='//FF//') {
105
  if(!function_exists('strcode2utf')){
106
  function strcode2utf($str,$lo=true) {
107
  //converts all the &#nnn; and &#xhhh; in a string to Unicode
108
- // mPDF 5.7
109
- if ($lo) {
110
- $str = preg_replace_callback('/\&\#([0-9]+)\;/m', 'code2utf_lo_callback', $str);
111
- $str = preg_replace_callback('/\&\#x([0-9a-fA-F]+)\;/m', 'codeHex2utf_lo_callback', $str);
112
- }
113
- else {
114
- $str = preg_replace_callback('/\&\#([0-9]+)\;/m', 'code2utf_callback', $str);
115
- $str = preg_replace_callback('/\&\#x([0-9a-fA-F]+)\;/m', 'codeHex2utf_callback', $str);
116
- }
117
  return $str;
118
  }
119
  }
120
- function code2utf_callback($matches) {
121
- return code2utf($matches[1], 0);
122
- }
123
- function code2utf_lo_callback($matches) {
124
- return code2utf($matches[1], 1);
125
- }
126
- function codeHex2utf_callback($matches) {
127
- return codeHex2utf($matches[1], 0);
128
- }
129
- function codeHex2utf_lo_callback($matches) {
130
- return codeHex2utf($matches[1], 1);
131
- }
132
 
133
  if(!function_exists('code2utf')){
134
  function code2utf($num,$lo=true){
1
  <?php
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
 
4
  function urlencode_part($url) { // mPDF 5.6.02
5
  if (!preg_match('/^[a-z]+:\/\//i',$url)) { return $url; }
75
  if(!function_exists('strcode2utf')){
76
  function strcode2utf($str,$lo=true) {
77
  //converts all the &#nnn; and &#xhhh; in a string to Unicode
78
+ if ($lo) { $lo = 1; } else { $lo = 0; }
79
+ $str = preg_replace('/\&\#([0-9]+)\;/me', "code2utf('\\1',{$lo})",$str);
80
+ $str = preg_replace('/\&\#x([0-9a-fA-F]+)\;/me', "codeHex2utf('\\1',{$lo})",$str);
 
 
 
 
 
 
81
  return $str;
82
  }
83
  }
 
 
 
 
 
 
 
 
 
 
 
 
84
 
85
  if(!function_exists('code2utf')){
86
  function code2utf($num,$lo=true){
mPDF/includes/out.php CHANGED
@@ -1,10 +1,9 @@
1
  <?php
2
 
3
- $path = '../tmp/';
4
 
5
  $tempfilename = $_REQUEST['filename'].'.pdf';
6
- if (strstr($tempfilename,'/') || strstr($tempfilename,'\\')) { die("Filename should not contain \ or / "); }
7
  $opname = $_REQUEST['opname'];
 
8
  $dest = $_REQUEST['dest'];
9
  if ($tempfilename && file_exists($path.$tempfilename)) {
10
  // mPDF 5.3.17
@@ -39,7 +38,7 @@ $dest = $_REQUEST['dest'];
39
  // don't use length if server using compression
40
  header('Content-Length: '.$filesize);
41
  }
42
- $fd=fopen($path.$tempfilename,'rb');
43
  fpassthru($fd);
44
  fclose($fd);
45
  unlink($path.$tempfilename);
1
  <?php
2
 
 
3
 
4
  $tempfilename = $_REQUEST['filename'].'.pdf';
 
5
  $opname = $_REQUEST['opname'];
6
+ $path = urldecode($_REQUEST['path']);
7
  $dest = $_REQUEST['dest'];
8
  if ($tempfilename && file_exists($path.$tempfilename)) {
9
  // mPDF 5.3.17
38
  // don't use length if server using compression
39
  header('Content-Length: '.$filesize);
40
  }
41
+ $fd=fopen($path.$tempfilename,'rb'); // mPDF 5.3.85
42
  fpassthru($fd);
43
  fclose($fd);
44
  unlink($path.$tempfilename);
mPDF/mpdf-extra-lite.php CHANGED
@@ -2393,17 +2393,7 @@ function AddFont($family,$style='') {
2393
  }
2394
  if (!$ttffile) {
2395
  $ttffile = _MPDF_TTFONTPATH.$this->fontdata[$family][$stylekey];
2396
- if (!file_exists($ttffile)) {
2397
- /*
2398
- * Try load in the font file from the PDF_TEMPLATE
2399
- */
2400
- global $gfpdfe_data;
2401
- $ttffile = $gfpdfe_data->template_site_location . 'fonts/' . $this->fontdata[$family][$stylekey];
2402
- if(!file_exists($ttffile))
2403
- {
2404
- die("mPDF Error - cannot find TTF TrueType font file - ".$ttffile);
2405
- }
2406
- }
2407
  }
2408
  $ttfstat = stat($ttffile);
2409
 
@@ -5511,11 +5501,6 @@ function SetTextOutline($width, $col=0) {
5511
  }
5512
 
5513
  function Image($file,$x,$y,$w=0,$h=0,$type='',$link='',$paint=true, $constrain=true, $watermark=false, $shownoimg=true, $allowvector=true) {
5514
- if(!file_exists($file))
5515
- {
5516
- return false;
5517
- }
5518
-
5519
  $orig_srcpath = $file;
5520
  $this->GetFullPath($file);
5521
 
@@ -5927,13 +5912,13 @@ function SetXY($x,$y)
5927
 
5928
  function Output($name='',$dest='')
5929
  {
5930
-
5931
- global $gfpdfe_data;
5932
  //Output PDF to some destination
5933
  if ($this->showStats) {
5934
- file_put_contents($gfpdfe_data->template_save_location . 'mPDF_performance_log.txt', date('Y-m-d h:i:s') . ' Generated in '.sprintf('%.2F',(microtime(true) - $this->time0))." seconds\r\n", FILE_APPEND);
 
 
 
5935
  }
5936
-
5937
  //Finish document if necessary
5938
  if($this->state < 3) $this->Close();
5939
  // fn. error_get_last is only in PHP>=5.2
@@ -5953,10 +5938,12 @@ function Output($name='',$dest='')
5953
  if (count($this->PDFAXwarnings) && (($this->PDFA && !$this->PDFAauto) || ($this->PDFX && !$this->PDFXauto))) {
5954
  if ($this->PDFA) {
5955
  echo '<div>WARNING - This file could not be generated as it stands as a PDFA1-b compliant file.</div>';
 
5956
  echo '<div>Action that mPDF will take to automatically force PDFA1-b compliance are shown in brackets.</div>';
5957
  }
5958
  else {
5959
  echo '<div>WARNING - This file could not be generated as it stands as a PDFX/1-a compliant file.</div>';
 
5960
  echo '<div>Action that mPDF will take to automatically force PDFX/1-a compliance are shown in brackets.</div>';
5961
  }
5962
  echo '<div>Warning(s) generated:</div><ul>';
@@ -5969,13 +5956,13 @@ function Output($name='',$dest='')
5969
  }
5970
 
5971
  if ($this->showStats) {
5972
- /* Blue Liquid Designs Edit
5973
- Log to File instead */
5974
- $log = date('Y-m-d h:i:s') . ' Compiled in '.sprintf('%.2F',(microtime(true) - $this->time0))." seconds (total)\n\r";
5975
- $log .= 'Peak Memory usage '.number_format((memory_get_peak_usage(true)/(1024*1024)),2)." MB\n";
5976
- $log .= 'PDF file size '.number_format((strlen($this->buffer)/1024))." kB\n";
5977
- $log .= 'Number of fonts '.count($this->fonts)."\n";
5978
- file_put_contents($gfpdfe_data->template_save_location . 'mPDF_performance_log.txt', $log, FILE_APPEND);
5979
  }
5980
 
5981
 
@@ -21911,11 +21898,6 @@ function purify_utf8($html,$lo=true) {
21911
  function purify_utf8_text($txt) {
21912
  // For TEXT
21913
  // Make sure UTF-8 string of characters
21914
- if(!mb_strlen($txt))
21915
- {
21916
- $txt = ' ';
21917
- }
21918
-
21919
  if (!$this->is_utf8($txt)) { $this->Error("Text contains invalid UTF-8 character(s)"); }
21920
 
21921
  $txt = preg_replace("/\r/", "", $txt );
2393
  }
2394
  if (!$ttffile) {
2395
  $ttffile = _MPDF_TTFONTPATH.$this->fontdata[$family][$stylekey];
2396
+ if (!file_exists($ttffile)) { die("mPDF Error - cannot find TTF TrueType font file - ".$ttffile); }
 
 
 
 
 
 
 
 
 
 
2397
  }
2398
  $ttfstat = stat($ttffile);
2399
 
5501
  }
5502
 
5503
  function Image($file,$x,$y,$w=0,$h=0,$type='',$link='',$paint=true, $constrain=true, $watermark=false, $shownoimg=true, $allowvector=true) {
 
 
 
 
 
5504
  $orig_srcpath = $file;
5505
  $this->GetFullPath($file);
5506
 
5912
 
5913
  function Output($name='',$dest='')
5914
  {
 
 
5915
  //Output PDF to some destination
5916
  if ($this->showStats) {
5917
+ /*BLUE LIQUID DESIGNS EDIT
5918
+ Write to file instead */
5919
+
5920
+ file_put_contents('performance_log.txt', date('Y-m-d h:i:s') . ' Generated in '.sprintf('%.2F',(microtime(true) - $this->time0))." seconds\r\n", FILE_APPEND);
5921
  }
 
5922
  //Finish document if necessary
5923
  if($this->state < 3) $this->Close();
5924
  // fn. error_get_last is only in PHP>=5.2
5938
  if (count($this->PDFAXwarnings) && (($this->PDFA && !$this->PDFAauto) || ($this->PDFX && !$this->PDFXauto))) {
5939
  if ($this->PDFA) {
5940
  echo '<div>WARNING - This file could not be generated as it stands as a PDFA1-b compliant file.</div>';
5941
+ echo '<div>These issues can be automatically fixed by mPDF using <i>$mpdf-&gt;PDFAauto=true;</i></div>';
5942
  echo '<div>Action that mPDF will take to automatically force PDFA1-b compliance are shown in brackets.</div>';
5943
  }
5944
  else {
5945
  echo '<div>WARNING - This file could not be generated as it stands as a PDFX/1-a compliant file.</div>';
5946
+ echo '<div>These issues can be automatically fixed by mPDF using <i>$mpdf-&gt;PDFXauto=true;</i></div>';
5947
  echo '<div>Action that mPDF will take to automatically force PDFX/1-a compliance are shown in brackets.</div>';
5948
  }
5949
  echo '<div>Warning(s) generated:</div><ul>';
5956
  }
5957
 
5958
  if ($this->showStats) {
5959
+ /* Blue Liquid Designs Edit
5960
+ Log to File instead */
5961
+ $log = date('Y-m-d h:i:s') . ' Compiled in '.sprintf('%.2F',(microtime(true) - $this->time0))." seconds (total)\n\r";
5962
+ $log .= 'Peak Memory usage '.number_format((memory_get_peak_usage(true)/(1024*1024)),2)." MB\n";
5963
+ $log .= 'PDF file size '.number_format((strlen($this->buffer)/1024))." kB\n";
5964
+ $log .= 'Number of fonts '.count($this->fonts)."\n";
5965
+ file_put_contents('performance_log.txt', $log, FILE_APPEND);
5966
  }
5967
 
5968
 
21898
  function purify_utf8_text($txt) {
21899
  // For TEXT
21900
  // Make sure UTF-8 string of characters
 
 
 
 
 
21901
  if (!$this->is_utf8($txt)) { $this->Error("Text contains invalid UTF-8 character(s)"); }
21902
 
21903
  $txt = preg_replace("/\r/", "", $txt );
mPDF/mpdf-lite.php CHANGED
@@ -2719,17 +2719,7 @@ function AddFont($family,$style='') {
2719
  }
2720
  if (!$ttffile) {
2721
  $ttffile = _MPDF_TTFONTPATH.$this->fontdata[$family][$stylekey];
2722
- if (!file_exists($ttffile)) {
2723
- /*
2724
- * Try load in the font file from the PDF_TEMPLATE
2725
- */
2726
- global $gfpdfe_data;
2727
- $ttffile = $gfpdfe_data->template_site_location . 'fonts/' . $this->fontdata[$family][$stylekey];
2728
- if(!file_exists($ttffile))
2729
- {
2730
- die("mPDF Error - cannot find TTF TrueType font file - ".$ttffile);
2731
- }
2732
- }
2733
  }
2734
  $ttfstat = stat($ttffile);
2735
 
@@ -5968,11 +5958,6 @@ function SetTextOutline($width, $col=0) {
5968
  }
5969
 
5970
  function Image($file,$x,$y,$w=0,$h=0,$type='',$link='',$paint=true, $constrain=true, $watermark=false, $shownoimg=true, $allowvector=true) {
5971
- if(!file_exists($file))
5972
- {
5973
- return false;
5974
- }
5975
-
5976
  $orig_srcpath = $file;
5977
  $this->GetFullPath($file);
5978
 
@@ -6457,12 +6442,13 @@ function SetXY($x,$y)
6457
 
6458
  function Output($name='',$dest='')
6459
  {
6460
- global $gfpdfe_data;
6461
  //Output PDF to some destination
6462
  if ($this->showStats) {
6463
- file_put_contents($gfpdfe_data->template_save_location . 'mPDF_performance_log.txt', date('Y-m-d h:i:s') . ' Generated in '.sprintf('%.2F',(microtime(true) - $this->time0))." seconds\r\n", FILE_APPEND);
 
 
 
6464
  }
6465
-
6466
  //Finish document if necessary
6467
  if($this->state < 3) $this->Close();
6468
  // fn. error_get_last is only in PHP>=5.2
@@ -6482,10 +6468,12 @@ function Output($name='',$dest='')
6482
  if (count($this->PDFAXwarnings) && (($this->PDFA && !$this->PDFAauto) || ($this->PDFX && !$this->PDFXauto))) {
6483
  if ($this->PDFA) {
6484
  echo '<div>WARNING - This file could not be generated as it stands as a PDFA1-b compliant file.</div>';
 
6485
  echo '<div>Action that mPDF will take to automatically force PDFA1-b compliance are shown in brackets.</div>';
6486
  }
6487
  else {
6488
  echo '<div>WARNING - This file could not be generated as it stands as a PDFX/1-a compliant file.</div>';
 
6489
  echo '<div>Action that mPDF will take to automatically force PDFX/1-a compliance are shown in brackets.</div>';
6490
  }
6491
  echo '<div>Warning(s) generated:</div><ul>';
@@ -6498,13 +6486,13 @@ function Output($name='',$dest='')
6498
  }
6499
 
6500
  if ($this->showStats) {
6501
- /* Blue Liquid Designs Edit
6502
- Log to File instead */
6503
- $log = date('Y-m-d h:i:s') . ' Compiled in '.sprintf('%.2F',(microtime(true) - $this->time0))." seconds (total)\n\r";
6504
- $log .= 'Peak Memory usage '.number_format((memory_get_peak_usage(true)/(1024*1024)),2)." MB\n";
6505
- $log .= 'PDF file size '.number_format((strlen($this->buffer)/1024))." kB\n";
6506
- $log .= 'Number of fonts '.count($this->fonts)."\n";
6507
- file_put_contents($gfpdfe_data->template_save_location . 'mPDF_performance_log.txt', $log, FILE_APPEND);
6508
  }
6509
 
6510
 
@@ -10890,14 +10878,12 @@ function Footer() {
10890
 
10891
  if (($this->mirrorMargins && ($this->page%2==0) && $this->HTMLFooterE) || ($this->mirrorMargins && ($this->page%2==1) && $this->HTMLFooter) || (!$this->mirrorMargins && $this->HTMLFooter)) {
10892
  $this->writeHTMLFooters();
10893
- if (($this->watermarkText) && ($this->showWatermarkText)) {
10894
- $this->BeginLayer(-100);
10895
  $this->watermark( $this->watermarkText, 45, 120, $this->watermarkTextAlpha); // Watermark text
10896
- }
10897
- if (($this->watermarkImage) && ($this->showWatermarkImage)) {
10898
- $this->BeginLayer(10000);
10899
  $this->watermarkImg( $this->watermarkImage, $this->watermarkImageAlpha); // Watermark image
10900
- }
10901
  return;
10902
  }
10903
 
@@ -11608,7 +11594,7 @@ function WriteFixedPosHTML($html='',$x, $y, $w, $h, $overflow='visible', $boundi
11608
  $this->blk[1]['attr'] = $attr;
11609
  $this->Reset();
11610
  $p = $this->MergeCSS('BLOCK',$tag,$attr);
11611
- if (isset($p['ROTATE']) && ($p['ROTATE']==90 || $p['ROTATE']==-90) || $p['ROTATE'] == 180 || $p['ROTATE'] == -180) { $rotate = $p['ROTATE']; }
11612
  else { $rotate = 0; }
11613
  if (isset($p['OVERFLOW'])) { $overflow = strtolower($p['OVERFLOW']); }
11614
  if (strtolower($p['POSITION']) == 'fixed') {
@@ -14067,8 +14053,8 @@ function OpenTag($tag,$attr)
14067
  if (strpos($size,',')) { $size = explode(',',$size); }
14068
  }
14069
  else { $size = 'D'; }
14070
- if (isset($attr['POSITION']) && $attr['POSITION']) {
14071
- $pos = $attr['POSITION'];
14072
  if (strpos($pos,',')) { $pos = explode(',',$pos); }
14073
  }
14074
  else { $pos = 'P'; }
@@ -26471,11 +26457,6 @@ function purify_utf8($html,$lo=true) {
26471
  function purify_utf8_text($txt) {
26472
  // For TEXT
26473
  // Make sure UTF-8 string of characters
26474
- if(!mb_strlen($txt))
26475
- {
26476
- $txt = ' ';
26477
- }
26478
-
26479
  if (!$this->is_utf8($txt)) { $this->Error("Text contains invalid UTF-8 character(s)"); }
26480
 
26481
  $txt = preg_replace("/\r/", "", $txt );
2719
  }
2720
  if (!$ttffile) {
2721
  $ttffile = _MPDF_TTFONTPATH.$this->fontdata[$family][$stylekey];
2722
+ if (!file_exists($ttffile)) { die("mPDF Error - cannot find TTF TrueType font file - ".$ttffile); }
 
 
 
 
 
 
 
 
 
 
2723
  }
2724
  $ttfstat = stat($ttffile);
2725
 
5958
  }
5959
 
5960
  function Image($file,$x,$y,$w=0,$h=0,$type='',$link='',$paint=true, $constrain=true, $watermark=false, $shownoimg=true, $allowvector=true) {
 
 
 
 
 
5961
  $orig_srcpath = $file;
5962
  $this->GetFullPath($file);
5963
 
6442
 
6443
  function Output($name='',$dest='')
6444
  {
 
6445
  //Output PDF to some destination
6446
  if ($this->showStats) {
6447
+ /*BLUE LIQUID DESIGNS EDIT
6448
+ Write to file instead */
6449
+
6450
+ file_put_contents('performance_log.txt', date('Y-m-d h:i:s') . ' Generated in '.sprintf('%.2F',(microtime(true) - $this->time0))." seconds\r\n", FILE_APPEND);
6451
  }
 
6452
  //Finish document if necessary
6453
  if($this->state < 3) $this->Close();
6454
  // fn. error_get_last is only in PHP>=5.2
6468
  if (count($this->PDFAXwarnings) && (($this->PDFA && !$this->PDFAauto) || ($this->PDFX && !$this->PDFXauto))) {
6469
  if ($this->PDFA) {
6470
  echo '<div>WARNING - This file could not be generated as it stands as a PDFA1-b compliant file.</div>';
6471
+ echo '<div>These issues can be automatically fixed by mPDF using <i>$mpdf-&gt;PDFAauto=true;</i></div>';
6472
  echo '<div>Action that mPDF will take to automatically force PDFA1-b compliance are shown in brackets.</div>';
6473
  }
6474
  else {
6475
  echo '<div>WARNING - This file could not be generated as it stands as a PDFX/1-a compliant file.</div>';
6476
+ echo '<div>These issues can be automatically fixed by mPDF using <i>$mpdf-&gt;PDFXauto=true;</i></div>';
6477
  echo '<div>Action that mPDF will take to automatically force PDFX/1-a compliance are shown in brackets.</div>';
6478
  }
6479
  echo '<div>Warning(s) generated:</div><ul>';
6486
  }
6487
 
6488
  if ($this->showStats) {
6489
+ /* Blue Liquid Designs Edit
6490
+ Log to File instead */
6491
+ $log = date('Y-m-d h:i:s') . ' Compiled in '.sprintf('%.2F',(microtime(true) - $this->time0))." seconds (total)\n\r";
6492
+ $log .= 'Peak Memory usage '.number_format((memory_get_peak_usage(true)/(1024*1024)),2)." MB\n";
6493
+ $log .= 'PDF file size '.number_format((strlen($this->buffer)/1024))." kB\n";
6494
+ $log .= 'Number of fonts '.count($this->fonts)."\n";
6495
+ file_put_contents('performance_log.txt', $log, FILE_APPEND);
6496
  }
6497
 
6498
 
10878
 
10879
  if (($this->mirrorMargins && ($this->page%2==0) && $this->HTMLFooterE) || ($this->mirrorMargins && ($this->page%2==1) && $this->HTMLFooter) || (!$this->mirrorMargins && $this->HTMLFooter)) {
10880
  $this->writeHTMLFooters();
10881
+ if (($this->watermarkText) && ($this->showWatermarkText)) {
 
10882
  $this->watermark( $this->watermarkText, 45, 120, $this->watermarkTextAlpha); // Watermark text
10883
+ }
10884
+ if (($this->watermarkImage) && ($this->showWatermarkImage)) {
 
10885
  $this->watermarkImg( $this->watermarkImage, $this->watermarkImageAlpha); // Watermark image
10886
+ }
10887
  return;
10888
  }
10889
 
11594
  $this->blk[1]['attr'] = $attr;
11595
  $this->Reset();
11596
  $p = $this->MergeCSS('BLOCK',$tag,$attr);
11597
+ if (isset($p['ROTATE']) && ($p['ROTATE']==90 || $p['ROTATE']==-90)) { $rotate = $p['ROTATE']; }
11598
  else { $rotate = 0; }
11599
  if (isset($p['OVERFLOW'])) { $overflow = strtolower($p['OVERFLOW']); }
11600
  if (strtolower($p['POSITION']) == 'fixed') {
14053
  if (strpos($size,',')) { $size = explode(',',$size); }
14054
  }
14055
  else { $size = 'D'; }
14056
+ if (isset($attr['POS']) && $attr['POS']) {
14057
+ $pos = $attr['POS'];
14058
  if (strpos($pos,',')) { $pos = explode(',',$pos); }
14059
  }
14060
  else { $pos = 'P'; }
26457
  function purify_utf8_text($txt) {
26458
  // For TEXT
26459
  // Make sure UTF-8 string of characters
 
 
 
 
 
26460
  if (!$this->is_utf8($txt)) { $this->Error("Text contains invalid UTF-8 character(s)"); }
26461
 
26462
  $txt = preg_replace("/\r/", "", $txt );
mPDF/mpdf.php CHANGED
@@ -2,10 +2,10 @@
2
 
3
  // ******************************************************************************
4
  // Software: mPDF, Unicode-HTML Free PDF generator *
5
- // Version: 5.7.1 based on *
6
  // FPDF by Olivier PLATHEY *
7
  // HTML2FPDF by Renato Coelho *
8
- // Date: 2013-09-01 *
9
  // Author: Ian Back <ianb@bpm1.com> *
10
  // License: GPL *
11
  // *
@@ -13,7 +13,7 @@
13
  // ******************************************************************************
14
 
15
 
16
- define('mPDF_VERSION','5.7.1');
17
 
18
  //Scale factor
19
  define('_MPDFK', (72/25.4));
@@ -70,11 +70,11 @@ class mPDF
70
  // EXTERNAL (PUBLIC) VARIABLES
71
  // Define these in config.php
72
  ///////////////////////////////
73
- var $CJKforceend; // mPDF 5.6.40
74
- // mPDF 5.6.34
75
- var $h2bookmarks;
76
- var $h2toc;
77
- var $decimal_align; // mPDF 5.6.13
78
  var $margBuffer; // mPDF 5.4.04
79
  var $splitTableBorderWidth; // mPDF 5.4.16
80
 
@@ -139,6 +139,8 @@ var $incrementFPR2;
139
  var $incrementFPR3;
140
  var $incrementFPR4;
141
 
 
 
142
  var $SHYlang;
143
  var $SHYleftmin;
144
  var $SHYrightmin;
@@ -188,6 +190,7 @@ var $jSmaxChar;
188
  var $jSmaxCharLast;
189
  var $jSmaxWordLast;
190
 
 
191
  var $max_colH_correction;
192
 
193
 
@@ -258,7 +261,6 @@ var $useSubstitutionsMB; // alias = $useSubstitutions
258
  //////////////////////
259
  // CLASS OBJECTS
260
  //////////////////////
261
- var $cssmgr;
262
  var $grad;
263
  var $bmp;
264
  var $wmf;
@@ -269,12 +271,6 @@ var $directw;
269
  //////////////////////
270
  // INTERNAL VARIABLES
271
  //////////////////////
272
- var $writingToC; // mPDF 5.6.38
273
- // mPDF 5.6.01
274
- var $layers;
275
- var $current_layer;
276
- var $open_layer_pane;
277
- var $decimal_offset; // mPDF 5.6.13
278
  var $inMeter; // mPDF 5.5.09
279
 
280
  var $CJKleading;
@@ -379,6 +375,8 @@ var $cell_border_dominance_L;
379
  var $cell_border_dominance_R;
380
  var $cell_border_dominance_T;
381
  var $cell_border_dominance_B;
 
 
382
  var $table_keep_together;
383
  var $plainCell_properties;
384
  var $inherit_lineheight;
@@ -389,6 +387,8 @@ var $outerfilled;
389
  var $blockContext;
390
  var $floatDivs;
391
 
 
 
392
 
393
  var $patterns;
394
  var $pageBackgrounds;
@@ -526,6 +526,8 @@ var $defaultSubsFont;
526
  // List of ALL available CJK fonts (incl. styles) (Adobe add-ons) hw removed
527
  var $available_CJK_fonts;
528
 
 
 
529
  var $HTMLHeader;
530
  var $HTMLFooter;
531
  var $HTMLHeaderE;
@@ -634,6 +636,7 @@ var $dash_on;
634
  var $dotted_on;
635
  var $strike;
636
 
 
637
  var $textbuffer;
638
  var $currentfontstyle;
639
  var $currentfontfamily;
@@ -645,7 +648,8 @@ var $enabledtags;
645
 
646
  var $lineheight;
647
  var $basepath;
648
- var $textparam;
 
649
 
650
  var $specialcontent;
651
  var $selectoption;
@@ -738,6 +742,7 @@ var $charspacing;
738
 
739
  //Private properties FROM FPDF
740
  var $DisplayPreferences;
 
741
  var $flowingBlockAttr;
742
  var $page; //current page number
743
  var $n; //current object number
@@ -849,7 +854,6 @@ function mPDF($mode='',$format='A4',$default_font_size=0,$default_font='',$mgl=1
849
  $this->useOddEven =& $this->mirrorMargins;
850
  $this->useSubstitutionsMB =& $this->useSubstitutions;
851
 
852
- $this->writingToC = false; // mPDF 5.6.38
853
  // mPDF 5.6.01
854
  $this->layers = array();
855
  $this->current_layer = 0;
@@ -892,7 +896,6 @@ function mPDF($mode='',$format='A4',$default_font_size=0,$default_font='',$mgl=1
892
  $this->smCapsStretch = 100;
893
  $this->margBuffer = 0; // mPDF 5.4.04
894
  $this->inMeter = false; // mPDF 5.5.09
895
- $this->decimal_offset = 0;
896
 
897
  $this->defTextColor = $this->TextColor = $this->SetTColor($this->ConvertColor(0),true);
898
  $this->defDrawColor = $this->DrawColor = $this->SetDColor($this->ConvertColor(0),true);
@@ -947,6 +950,9 @@ function mPDF($mode='',$format='A4',$default_font_size=0,$default_font='',$mgl=1
947
  $this->floatDivs = array();
948
  $this->DisplayPreferences='';
949
 
 
 
 
950
  $this->patterns = array(); // Tiling patterns used for backgrounds
951
  $this->pageBackgrounds = array();
952
  $this->writingHTMLheader = false; // internal flag - used both for writing HTMLHeaders/Footers and FixedPos block
@@ -1033,6 +1039,7 @@ function mPDF($mode='',$format='A4',$default_font_size=0,$default_font='',$mgl=1
1033
  $this->useRC128encryption = false;
1034
  $this->uniqid = '';
1035
 
 
1036
  $this->bufferoutput = false;
1037
  $this->encrypted=false; //whether document is protected
1038
  $this->BMoutlines=array();
@@ -1078,6 +1085,7 @@ function mPDF($mode='',$format='A4',$default_font_size=0,$default_font='',$mgl=1
1078
  $this->usingCoreFont = false;
1079
  $this->charspacing=0;
1080
 
 
1081
  $this->autoPageBreak = true;
1082
 
1083
  require(_MPDF_PATH.'config.php'); // config data
@@ -1213,13 +1221,10 @@ function mPDF($mode='',$format='A4',$default_font_size=0,$default_font='',$mgl=1
1213
  else { $this->useSubstitutions = false; }
1214
 
1215
  /*-- HTML-CSS --*/
1216
-
1217
- if (!class_exists('cssmgr', false)) { include(_MPDF_PATH .'classes/cssmgr.php'); }
1218
- $this->cssmgr = new cssmgr($this);
1219
  if (file_exists(_MPDF_PATH.'mpdf.css')) {
1220
  $css = file_get_contents(_MPDF_PATH.'mpdf.css');
1221
- $css2 = $this->cssmgr->ReadDefaultCSS($css);
1222
- $this->defaultCSS = $this->cssmgr->array_merge_recursive_unique($this->defaultCSS,$css2);
1223
  }
1224
  /*-- END HTML-CSS --*/
1225
 
@@ -1291,12 +1296,14 @@ function mPDF($mode='',$format='A4',$default_font_size=0,$default_font='',$mgl=1
1291
  $this->colorarray=array();
1292
  $this->spanbgcolorarray=array();
1293
  $this->textbuffer=array();
 
1294
  $this->internallink=array();
1295
  $this->basepath = "";
1296
 
1297
  $this->SetBasePath('');
1298
 
1299
- $this->textparam = array();
 
1300
 
1301
  $this->specialcontent = '';
1302
  $this->selectoption = array();
@@ -1788,100 +1795,50 @@ function Close() {
1788
  }
1789
 
1790
  /*-- BACKGROUNDS --*/
1791
- function _resizeBackgroundImage($imw, $imh, $cw, $ch, $resize=0, $repx, $repy, $pba=array(), $size=array()) { // mPDF 5.6.10
1792
- // pba is background positioning area (from CSS background-origin) may not always be set [x,y,w,h]
1793
- // size is from CSS3 background-size - takes precendence over old resize
1794
- // $w - absolute length or % or auto or cover | contain
1795
- // $h - absolute length or % or auto or cover | contain
1796
- // mPDF 5.6.10
1797
- if (isset($pba['w'])) $cw = $pba['w'];
1798
- if (isset($pba['h'])) $ch = $pba['h'];
1799
-
1800
  $cw = $cw*_MPDFK;
1801
  $ch = $ch*_MPDFK;
1802
- if (empty($size) && !$resize) { return array($imw, $imh, $repx, $repy); }
1803
-
1804
- // mPDF 5.6.10
1805
- if (isset($size['w']) && $size['w']) {
1806
- if ($size['w']=='contain') {
1807
- // Scale the image, while preserving its intrinsic aspect ratio (if any), to the largest size such that both its width and its height can fit inside the background positioning area.
1808
- // Same as resize==3
1809
- $h = $imh * $cw/$imw;
1810
- $w = $cw;
1811
- if ($h > $ch) {
1812
- $w = $w * $ch/$h;
1813
- $h = $ch;
1814
- }
1815
- }
1816
- else if ($size['w']=='cover') {
1817
- // Scale the image, while preserving its intrinsic aspect ratio (if any), to the smallest size such that both its width and its height can completely cover the background positioning area.
1818
- $h = $imh * $cw/$imw;
1819
- $w = $cw;
1820
- if ($h < $ch) {
1821
- $w = $w * $h/$ch;
1822
- $h = $ch;
1823
- }
1824
- }
1825
- else {
1826
- if (stristr($size['w'] ,'%')) {
1827
- $size['w'] += 0;
1828
- $size['w'] /= 100;
1829
- $size['w'] = ($cw * $size['w']);
1830
- }
1831
- if (stristr($size['h'] ,'%')) {
1832
- $size['h'] += 0;
1833
- $size['h'] /= 100;
1834
- $size['h'] = ($ch * $size['h']);
1835
- }
1836
- if ($size['w']=='auto' && $size['h']=='auto') {
1837
- $w = $imw;
1838
- $h = $imh;
1839
- }
1840
- else if ($size['w']=='auto' && $size['h']!='auto') {
1841
- $w = $imw * $size['h']/$imh;
1842
- $h = $size['h'];
1843
- }
1844
- else if ($size['w']!='auto' && $size['h']=='auto') {
1845
- $h = $imh * $size['w']/$imw;
1846
- $w = $size['w'];
1847
- }
1848
- else {
1849
- $w = $size['w'];
1850
- $h = $size['h'];
1851
- }
1852
- }
1853
- return array($w, $h, $repx, $repy);
1854
- }
1855
- else if ($resize==1 && $imw > $cw) {
1856
  $h = $imh * $cw/$imw;
 
1857
  return array($cw, $h, $repx, $repy);
1858
  }
1859
  else if ($resize==2 && $imh > $ch) {
1860
  $w = $imw * $ch/$imh;
 
1861
  return array($w, $ch, $repx, $repy);
1862
  }
1863
  else if ($resize==3) {
1864
  $w = $imw;
1865
  $h = $imh;
 
1866
  if ($w > $cw) {
1867
  $h = $h * $cw/$w;
1868
  $w = $cw;
 
1869
  }
1870
  if ($h > $ch) {
1871
  $w = $w * $ch/$h;
1872
  $h = $ch;
 
 
1873
  }
1874
  return array($w, $h, $repx, $repy);
1875
  }
1876
  else if ($resize==4) {
1877
  $h = $imh * $cw/$imw;
 
1878
  return array($cw, $h, $repx, $repy);
1879
  }
1880
  else if ($resize==5) {
1881
  $w = $imw * $ch/$imh;
 
1882
  return array($w, $ch, $repx, $repy);
1883
  }
1884
  else if ($resize==6) {
 
 
1885
  return array($cw, $ch, $repx, $repy);
1886
  }
1887
  return array($imw, $imh, $repx, $repy);
@@ -1889,25 +1846,8 @@ function _resizeBackgroundImage($imw, $imh, $cw, $ch, $resize=0, $repx, $repy, $
1889
 
1890
 
1891
  function SetBackground(&$properties, &$maxwidth) {
1892
- // mPDF 5.6.10 5.6.11
1893
- if (isset($properties['BACKGROUND-ORIGIN']) && ($properties['BACKGROUND-ORIGIN']=='border-box' || $properties['BACKGROUND-ORIGIN']== 'content-box')) { $origin = $properties['BACKGROUND-ORIGIN']; }
1894
- else { $origin = 'padding-box'; }
1895
- // mPDF 5.6.10
1896
- if (isset($properties['BACKGROUND-SIZE'])) {
1897
- if (stristr($properties['BACKGROUND-SIZE'] ,'contain') ) { $bsw = $bsh = 'contain'; }
1898
- else if (stristr($properties['BACKGROUND-SIZE'] ,'cover') ) { $bsw = $bsh = 'cover'; }
1899
- else {
1900
- $bsw = $bsh = 'auto';
1901
- $sz = preg_split('/\s+/',trim($properties['BACKGROUND-SIZE']));
1902
- if (count($sz)==2) { $bsw = $sz[0]; $bsh = $sz[1]; }
1903
- else { $bsw = $sz[0]; }
1904
- if (!stristr($bsw ,'%') && !stristr($bsw ,'auto') ) { $bsw = $this->ConvertSize($bsw ,$maxwidth,$this->FontSize); }
1905
- if (!stristr($bsh ,'%') && !stristr($bsh ,'auto') ) { $bsh = $this->ConvertSize($bsh ,$maxwidth,$this->FontSize); }
1906
- }
1907
- $size = array('w'=>$bsw, 'h'=>$bsh);
1908
- }
1909
  if (preg_match('/(-moz-)*(repeating-)*(linear|radial)-gradient/',$properties['BACKGROUND-IMAGE'])) {
1910
- return array('gradient'=>$properties['BACKGROUND-IMAGE'], 'origin'=>$origin, 'size'=>$size ); // mPDF 5.6.10
1911
  }
1912
  else {
1913
  $file = $properties['BACKGROUND-IMAGE'];
@@ -1948,7 +1888,7 @@ function SetBackground(&$properties, &$maxwidth) {
1948
  else { $resize = 0; }
1949
  if (isset($properties['BACKGROUND-IMAGE-OPACITY'])) { $opacity = $properties['BACKGROUND-IMAGE-OPACITY']; }
1950
  else { $opacity = 1; }
1951
- return array('image_id'=>$image_id, 'orig_w'=>$orig_w, 'orig_h'=>$orig_h, 'x_pos'=>$x_pos, 'y_pos'=>$y_pos, 'x_repeat'=>$x_repeat, 'y_repeat'=>$y_repeat, 'resize'=>$resize, 'opacity'=>$opacity, 'itype'=>$sizesarray['itype'], 'origin'=>$origin, 'size'=>$size );
1952
  }
1953
  }
1954
  return false;
@@ -2055,8 +1995,8 @@ function PrintPageBackgrounds($adjustmenty=0) {
2055
  }
2056
  /*-- BACKGROUNDS --*/
2057
  foreach ($pbs AS $pb) {
2058
- // mPDF 5.6.01 - LAYERS
2059
- if ((isset($pb['gradient']) && $pb['gradient']) || (isset($pb['image_id']) && $pb['image_id'])) {
2060
  if($pb['z-index']>0) {
2061
  $this->current_layer = $pb['z-index'];
2062
  $s .= "\n".'/OCGZ-index /ZI'.$pb['z-index'].' BDC'."\n";
@@ -2069,116 +2009,54 @@ function PrintPageBackgrounds($adjustmenty=0) {
2069
  else if($pb['visibility']=='hidden')
2070
  $s .= '/OC /OC3 BDC'."\n";
2071
  }
2072
- }
2073
- if (isset($pb['gradient']) && $pb['gradient']) {
2074
  if (isset($pb['clippath']) && $pb['clippath']) { $s .= $pb['clippath']."\n"; }
2075
  $s .= $this->grad->Gradient($pb['x'], $pb['y'], $pb['w'], $pb['h'], $pb['gradtype'], $pb['stops'], $pb['colorspace'], $pb['coords'], $pb['extend'], true);
2076
  if (isset($pb['clippath']) && $pb['clippath']) { $s .= 'Q'."\n"; }
2077
  }
2078
- else if (isset($pb['image_id']) && $pb['image_id']) { // Background Image
2079
  $pb['y'] -= $adjustmenty;
2080
  $pb['h'] += $adjustmenty;
2081
  $n = count($this->patterns)+1;
2082
- list($orig_w, $orig_h, $x_repeat, $y_repeat) = $this->_resizeBackgroundImage($pb['orig_w'], $pb['orig_h'], $pb['w'], $pb['h'], $pb['resize'], $pb['x_repeat'], $pb['y_repeat'], $pb['bpa'], $pb['size']); // mPDF 5.6.10
2083
- $this->patterns[$n] = array('x'=>$pb['x'], 'y'=>$pb['y'], 'w'=>$pb['w'], 'h'=>$pb['h'], 'pgh'=>$this->h, 'image_id'=>$pb['image_id'], 'orig_w'=>$orig_w, 'orig_h'=>$orig_h, 'x_pos'=>$pb['x_pos'], 'y_pos'=>$pb['y_pos'], 'x_repeat'=>$x_repeat, 'y_repeat'=>$y_repeat, 'itype'=>$pb['itype'], 'bpa'=>$pb['bpa']); // mPDF 5.6.10
2084
  $x = $pb['x']*_MPDFK;
2085
  $y = ($this->h - $pb['y'])*_MPDFK;
2086
  $w = $pb['w']*_MPDFK;
2087
  $h = -$pb['h']*_MPDFK;
2088
  if (isset($pb['clippath']) && $pb['clippath']) { $s .= $pb['clippath']."\n"; }
2089
- if ($this->writingHTMLfooter || $this->writingHTMLheader) { // Write each (tiles) image rather than use as a pattern
2090
  $iw = $pb['orig_w']/_MPDFK;
2091
  $ih = $pb['orig_h']/_MPDFK;
2092
-
2093
  $w = $pb['w'];
2094
  $h = $pb['h'];
2095
  $x0 = $pb['x'];
2096
  $y0 = $pb['y'];
2097
 
2098
- // mPDF 5.6.11
2099
- if (isset($pb['bpa']) && $pb['bpa']) {
2100
- $w = $pb['bpa']['w'];
2101
- $h = $pb['bpa']['h'];
2102
- $x0 = $pb['bpa']['x'];
2103
- $y0 = $pb['bpa']['y'];
2104
- }
2105
-
2106
- // mPDF 5.6.11
2107
- if (isset($pb['size']['w']) && $pb['size']['w']) {
2108
- $size = $pb['size'];
2109
-
2110
- if ($size['w']=='contain') {
2111
- // Scale the image, while preserving its intrinsic aspect ratio (if any), to the largest size such that both its width and its height can fit inside the background positioning area.
2112
- // Same as resize==3
2113
- $ih = $ih * $pb['bpa']['w']/$iw;
2114
- $iw = $pb['bpa']['w'];
2115
- if ($ih > $pb['bpa']['h']) {
2116
- $iw = $iw * $pb['bpa']['h']/$ih;
2117
- $ih = $pb['bpa']['h'];
2118
- }
2119
- }
2120
- else if ($size['w']=='cover') {
2121
- // Scale the image, while preserving its intrinsic aspect ratio (if any), to the smallest size such that both its width and its height can completely cover the background positioning area.
2122
- $ih = $ih * $pb['bpa']['w']/$iw;
2123
- $iw = $pb['bpa']['w'];
2124
- if ($ih < $pb['bpa']['h']) {
2125
- $iw = $iw * $ih/$pb['bpa']['h'];
2126
- $ih = $pb['bpa']['h'];
2127
- }
2128
- }
2129
- else {
2130
- if (stristr($size['w'] ,'%')) {
2131
- $size['w'] += 0;
2132
- $size['w'] /= 100;
2133
- $size['w'] = ($pb['bpa']['w'] * $size['w']);
2134
- }
2135
- if (stristr($size['h'] ,'%')) {
2136
- $size['h'] += 0;
2137
- $size['h'] /= 100;
2138
- $size['h'] = ($pb['bpa']['h'] * $size['h']);
2139
- }
2140
- if ($size['w']=='auto' && $size['h']=='auto') {
2141
- $iw = $iw;
2142
- $ih = $ih;
2143
- }
2144
- else if ($size['w']=='auto' && $size['h']!='auto') {
2145
- $iw = $iw * $size['h']/$ih;
2146
- $ih = $size['h'];
2147
- }
2148
- else if ($size['w']!='auto' && $size['h']=='auto') {
2149
- $ih = $ih * $size['w']/$iw;
2150
- $iw = $size['w'];
2151
- }
2152
- else {
2153
- $iw = $size['w'];
2154
- $ih = $size['h'];
2155
- }
2156
- }
2157
- }
2158
-
2159
  // Number to repeat
2160
- if ($pb['x_repeat']) { $nx = ceil($pb['w']/$iw)+1; } // mPDF 5.6.11
2161
  else { $nx = 1; }
2162
- if ($pb['y_repeat']) { $ny = ceil($pb['h']/$ih)+1; } // mPDF 5.6.11
2163
  else { $ny = 1; }
2164
 
2165
  $x_pos = $pb['x_pos'];
2166
  if (stristr($x_pos ,'%') ) {
2167
  $x_pos += 0;
2168
  $x_pos /= 100;
2169
- $x_pos = ($pb['bpa']['w'] * $x_pos) - ($iw * $x_pos); // mPDF 5.6.11
2170
  }
2171
  $y_pos = $pb['y_pos'];
2172
  if (stristr($y_pos ,'%') ) {
2173
  $y_pos += 0;
2174
  $y_pos /= 100;
2175
- $y_pos = ($pb['bpa']['h'] * $y_pos) - ($ih * $y_pos); // mPDF 5.6.11
2176
  }
2177
  if ($nx>1) {
2178
- while($x_pos>($pb['x']-$pb['bpa']['x'])) { $x_pos -= $iw; } // mPDF 5.6.11
2179
  }
2180
  if ($ny>1) {
2181
- while($y_pos>($pb['y']-$pb['bpa']['y'])) { $y_pos -= $ih; } // mPDF 5.6.11
2182
  }
2183
  for($xi=0;$xi<$nx;$xi++) {
2184
  for($yi=0;$yi<$ny;$yi++) {
@@ -2317,6 +2195,8 @@ function AddPageByArray($a) {
2317
  }
2318
 
2319
 
 
 
2320
  function AddPage($orientation='',$condition='', $resetpagenum='', $pagenumstyle='', $suppress='',$mgl='',$mgr='',$mgt='',$mgb='',$mgh='',$mgf='',$ohname='',$ehname='',$ofname='',$efname='',$ohvalue=0,$ehvalue=0,$ofvalue=0,$efvalue=0,$pagesel='',$newformat='')
2321
  {
2322
  /*-- CSS-FLOAT --*/
@@ -3022,24 +2902,10 @@ function AddFont($family,$style='') {
3022
  $ttffile = _MPDF_SYSTEM_TTFONTS.$this->fontdata[$family][$stylekey];
3023
  if (!file_exists($ttffile)) { $ttffile = ''; }
3024
  }
3025
-
3026
  if (!$ttffile) {
3027
  $ttffile = _MPDF_TTFONTPATH.$this->fontdata[$family][$stylekey];
3028
-
3029
- if (!file_exists($ttffile)) {
3030
- /*
3031
- * Try load in the font file from the PDF_TEMPLATE
3032
- */
3033
- global $gfpdfe_data;
3034
- $ttffile = $gfpdfe_data->template_site_location . 'fonts/' . $this->fontdata[$family][$stylekey];
3035
-
3036
- if(!file_exists($ttffile))
3037
- {
3038
- die("mPDF Error - cannot find TTF TrueType font file - ".$ttffile);
3039
- }
3040
- }
3041
  }
3042
-
3043
  $ttfstat = stat($ttffile);
3044
 
3045
  if (isset($this->fontdata[$family]['TTCfontID'][$stylekey])) { $TTCfontID = $this->fontdata[$family]['TTCfontID'][$stylekey]; }
@@ -3903,7 +3769,7 @@ function Cell($w,$h=0,$txt='',$border=0,$ln=0,$align='',$fill=0,$link='', $curre
3903
  if($this->ColorFlag) $s .='q '.$this->TextColor.' ';
3904
 
3905
  // OUTLINE
3906
- if($this->textparam['outline-s'] && !$this->S) { // mPDF 5.6.07
3907
  $s .=' '.sprintf('%.3F w',$this->LineWidth*_MPDFK).' ';
3908
  $s .=" $this->DrawColor ";
3909
  $s .=" 2 Tr ";
@@ -3914,7 +3780,6 @@ function Cell($w,$h=0,$txt='',$border=0,$ln=0,$align='',$fill=0,$link='', $curre
3914
  $tc = strtoupper($this->TextColor); // change 0 0 0 rg to 0 0 0 RG
3915
  if($this->FillColor!=$tc) { $s .= ' '.$tc.' '; } // stroke (outline) = same colour as text(fill)
3916
  }
3917
- else { $s .=" 0 Tr "; } // mPDF 5.6.07
3918
 
3919
  if (strpos($this->ReqFontStyle,"I") !== false && strpos($this->FontStyle,"I") === false) { // Artificial italic
3920
  $aix = '1 0 0.261799 1 %.3F %.3F Tm ';
@@ -4289,7 +4154,7 @@ function MultiCell($w,$h,$txt,$border=0,$align='',$fill=0,$link='',$directionali
4289
 
4290
  if (!$this->usingCoreFont) {
4291
  $checkCursive=false;
4292
- if ($this->biDirectional) { $checkCursive=true; }
4293
  else if (isset($this->CurrentFont['indic']) && $this->CurrentFont['indic']) { $checkCursive=true; } // *INDIC*
4294
  while($i<$nb) {
4295
  //Get next character
@@ -4482,7 +4347,8 @@ function saveInlineProperties() {
4482
  $saved[ 'SUB' ] = $this->SUB;
4483
  $saved[ 'linewidth' ] = $this->LineWidth;
4484
  $saved[ 'drawcolor' ] = $this->DrawColor;
4485
- $saved[ 'textparam' ] = $this->textparam;
 
4486
  $saved[ 'toupper' ] = $this->toupper;
4487
  $saved[ 'tolower' ] = $this->tolower;
4488
  $saved[ 'capitalize' ] = $this->capitalize;
@@ -4496,8 +4362,8 @@ function saveInlineProperties() {
4496
  $saved[ 'border' ] = $this->spanborddet;
4497
  $saved[ 'color' ] = $this->TextColor;
4498
  $saved[ 'bgcolor' ] = $this->FillColor;
4499
- $saved[ 'lang' ] = $this->currentLang;
4500
- $saved[ 'display_off' ] = $this->inlineDisplayOff;
4501
 
4502
  return $saved;
4503
  }
@@ -4531,7 +4397,8 @@ function restoreInlineProperties( &$saved) {
4531
  $this->SUB = $saved[ 'SUB' ];
4532
  $this->LineWidth = $saved[ 'linewidth' ];
4533
  $this->DrawColor = $saved[ 'drawcolor' ];
4534
- $this->textparam = $saved[ 'textparam' ];
 
4535
  $this->inlineDisplayOff = $saved['display_off'];
4536
 
4537
  $this->toupper = $saved[ 'toupper' ];
@@ -4618,7 +4485,8 @@ function saveFont() {
4618
  $saved[ 'SUB' ] = $this->SUB;
4619
  $saved[ 'linewidth' ] = $this->LineWidth;
4620
  $saved[ 'drawcolor' ] = $this->DrawColor;
4621
- $saved[ 'textparam' ] = $this->textparam;
 
4622
  $saved[ 'ReqFontStyle' ] = $this->ReqFontStyle;
4623
  $saved[ 'fontkerning' ] = $this->kerning;
4624
  $saved[ 'fixedlSpacing' ] = $this->fixedlSpacing;
@@ -4652,7 +4520,8 @@ function restoreFont( &$saved, $write=true) {
4652
  $this->SUB = $saved[ 'SUB' ];
4653
  $this->LineWidth = $saved[ 'linewidth' ];
4654
  $this->DrawColor = $saved[ 'drawcolor' ];
4655
- $this->textparam = $saved[ 'textparam' ];
 
4656
  if ($write) {
4657
  $this->SetFont($saved[ 'family' ],$saved[ 'style' ].($this->U ? 'U' : '').($this->S ? 'S' : ''),$saved[ 'sizePt' ],true,true); // force output
4658
  $fontout = (sprintf('BT /F%d %.3F Tf ET', $this->CurrentFont['i'], $this->FontSizePt));
@@ -4718,8 +4587,6 @@ function finishFlowingBlock($endofblock=false, $next='') {
4718
  $fill = 0;
4719
  }
4720
 
4721
- $hanger = ''; // mPDF 5.6.40
4722
-
4723
  // Always right trim!
4724
  // Right trim content and adjust width if need to justify (later)
4725
  if (isset($content[count($content)-1]) && preg_match('/[ ]+$/',$content[count($content)-1], $m)) {
@@ -5005,7 +4872,6 @@ function finishFlowingBlock($endofblock=false, $next='') {
5005
  if ($newblock && ($blockstate==1 || $blockstate==3) && $lineCount == 0 && !$is_table && !$is_list) {
5006
  $this->blk[$this->blklvl]['y0'] = $this->y;
5007
  $this->blk[$this->blklvl]['startpage'] = $this->page;
5008
- if ($this->blk[$this->blklvl]['float']) { $this->blk[$this->blklvl]['float_start_y'] = $this->y; } // mPDF 5.6.63
5009
  if ($this->ColActive) { $this->breakpoints[$this->CurrCol][] = $this->y; } // *COLUMNS*
5010
  }
5011
 
@@ -5050,14 +4916,13 @@ function finishFlowingBlock($endofblock=false, $next='') {
5050
  if ($content) {
5051
 
5052
  // In FinishFlowing Block no lines are justified as it is always last line
5053
- // but if CJKorphan has allowed content width to go over max width, use J charspacing to compress line
5054
  // JUSTIFICATION J - NOT!
5055
  $nb_carac = 0;
5056
  $nb_spaces = 0;
5057
  $jcharspacing = 0;
5058
  $jws = 0;
5059
  $inclCursive=false;
5060
- $dottab = false; // mPDF 5.6.19
5061
  foreach ( $content as $k => $chunk ) {
5062
  if (!isset($this->objectbuffer[$k]) || (isset($this->objectbuffer[$k]) && !$this->objectbuffer[$k])) {
5063
  if ($this->usingCoreFont) {
@@ -5073,34 +4938,15 @@ function finishFlowingBlock($endofblock=false, $next='') {
5073
  if (preg_match("/([".$this->pregHIchars.$this->pregBNchars.$this->pregPAchars."])/u", $chunk)) { $inclCursive = true; } // *INDIC*
5074
  }
5075
  }
5076
- else if ($this->objectbuffer[$k]['type']=='dottab') { $dottab = $this->objectbuffer[$k]['outdent']; } // mPDF 5.6.19
5077
  }
5078
  // if it's justified, we need to find the char/word spacing (or if orphans have allowed length of line to go over the maxwidth)
5079
  // If "orphans" in fact is just a final space - ignore this
5080
- // mPDF 5.6.40
5081
- $lastchar = mb_substr($content[(count($content)-1)],mb_strlen($content[(count($content)-1)], $this->mb_enc)-1, 1, $this->mb_enc);
5082
- if (preg_match("/[".$this->CJKoverflow."]/u", $lastchar)) { $CJKoverflow = true; }
5083
- else {$CJKoverflow = false; }
5084
- if ((((($contentWidth + $lastitalic) > $maxWidth) && ($content[count($content)-1] != ' ') ) ||
5085
- (!$endofblock && $align=='J' && ($next=='image' || $next=='select' || $next=='input' || $next=='textarea' || ($next=='br' && $this->justifyB4br)))) && !($CJKoverflow && $this->allowCJKoverflow) ) { // mPDF 5.6.40
5086
  // WORD SPACING
5087
  list($jcharspacing,$jws) = $this->GetJspacing($nb_carac,$nb_spaces,($maxWidth-$lastitalic-$contentWidth-$WidthCorrection-(($this->cMarginL+$this->cMarginR)*_MPDFK)-($paddingL+$paddingR +(($fpaddingL + $fpaddingR) * _MPDFK) )),$inclCursive);
5088
  }
5089
- /*-- CJK-FONTS --*/
5090
- // mPDF 5.6.40
5091
- else if ($this->checkCJK && $align=='J' && $CJKoverflow && $this->allowCJKoverflow && $this->CJKforceend) {
5092
- // force-end overhang
5093
- $hanger = mb_substr($content[count($content)-1],mb_strlen($content[count($content)-1],$this->mb_enc)-1,1,$this->mb_enc );
5094
- if (preg_match("/[".$this->CJKoverflow."]/u", $hanger)) {
5095
- $content[count($content)-1] = mb_substr($content[count($content)-1],0,mb_strlen($content[count($content)-1],$this->mb_enc)-1,$this->mb_enc );
5096
- $this->restoreFont( $font[ count($content)-1 ],false );
5097
- $contentWidth -= $this->GetStringWidth($hanger) * _MPDFK;
5098
- $nb_carac -= 1;
5099
- list($jcharspacing,$jws) = $this->GetJspacing($nb_carac,$nb_spaces,($maxWidth-$lastitalic-$contentWidth-$WidthCorrection-(($this->cMarginL+$this->cMarginR)*_MPDFK)-($paddingL+$paddingR +(($fpaddingL + $fpaddingR) * _MPDFK) )),$inclCursive);
5100
- }
5101
- }
5102
- /*-- END CJK-FONTS --*/
5103
-
5104
  // Check if will fit at word/char spacing of previous line - if so continue it
5105
  // but only allow a maximum of $this->jSmaxWordLast and $this->jSmaxCharLast
5106
  else if ($contentWidth < ($maxWidth - $lastitalic-$WidthCorrection - (($this->cMarginL+$this->cMarginR)* _MPDFK) - ($paddingL+$paddingR +(($fpaddingL + $fpaddingR) * _MPDFK))) && !$this->fixedlSpacing) {
@@ -5155,11 +5001,11 @@ function finishFlowingBlock($endofblock=false, $next='') {
5155
  /*-- END RTL --*/
5156
 
5157
  $this->x = $currentx + $this->cMarginL + $ipaddingL + $fpaddingL;
5158
- if ($dottab !== false && $blockdir=='rtl') { $this->x -= $dottab; } // mPDF 5.6.19
5159
- else if ($align == 'R') { $this->x += $empty; }
5160
  else if ($align == 'J' && $blockdir == 'rtl') { $this->x += $empty; }
5161
  else if ($align == 'C') { $this->x += ($empty / 2); }
5162
 
 
5163
  // Paragraph INDENT
5164
  $WidthCorrection = 0;
5165
  if (($newblock) && ($blockstate==1 || $blockstate==3) && isset($this->blk[$this->blklvl]['text_indent']) && ($lineCount == 0) && (!$is_table) && (!$is_list) && ($align !='C')) {
@@ -5206,28 +5052,15 @@ function finishFlowingBlock($endofblock=false, $next='') {
5206
  }
5207
 
5208
 
 
5209
  // DIRECTIONALITY RTL
5210
  if ((($blockdir == 'rtl') && ($contains_rtl )) || $all_rtl ) { $this->restoreFont( $font[ $arraysize-1 - $k ] ); }
5211
  else { $this->restoreFont( $font[ $k ] ); }
5212
 
5213
- // mPDF 5.6.13 Decimal alignment - set in _tableWrite
5214
- if ($is_table && substr($align,0,1)=='D' && $k==0 ) {
5215
- $dp = $this->decimal_align[substr($align,0,2)];
5216
- $s = preg_split('/'.preg_quote($dp,'/').'/', $content[0], 2); // ? needs to be /u if not core
5217
- $s0 = $this->GetStringWidth($s[0], false);
5218
- $this->x += ($this->decimal_offset - $s0);
5219
- }
5220
-
5221
  $this->SetSpacing(($this->fixedlSpacing*_MPDFK)+$jcharspacing,($this->fixedlSpacing+$this->minwSpacing)*_MPDFK+$jws);
5222
  $this->fixedlSpacing = false;
5223
  $this->minwSpacing = 0;
5224
 
5225
- // mPDF 5.6.26
5226
- $save_vis = $this->visibility;
5227
- if (isset($this->textparam['visibility']) && $this->textparam['visibility'] && $this->textparam['visibility'] != $this->visibility) {
5228
- $this->SetVisibility($this->textparam['visibility']);
5229
- }
5230
-
5231
  // *********** SPAN BACKGROUND COLOR ***************** //
5232
  if (isset($this->spanbgcolor) && $this->spanbgcolor) {
5233
  $cor = $this->spanbgcolorarray;
@@ -5245,26 +5078,14 @@ function finishFlowingBlock($endofblock=false, $next='') {
5245
  if (isset($this->objectbuffer[$dirk])) {
5246
  if ($this->objectbuffer[$dirk]['type']=='dottab') {
5247
  $this->objectbuffer[$dirk]['OUTER-WIDTH'] +=$empty;
5248
- $this->objectbuffer[$dirk]['OUTER-WIDTH'] +=$this->objectbuffer[$dirk]['outdent']; // mPDF 5.6.19
5249
  }
5250
  $stringWidth = $this->objectbuffer[$dirk]['OUTER-WIDTH'];
5251
  }
5252
 
5253
  if ($stringWidth==0) { $stringWidth = 0.000001; }
5254
- if ($k == $arraysize-1) {
5255
- // mPDF 5.6.40
5256
- if ($this->checkCJK && $CJKoverflow && $align=='J' && $this->allowCJKoverflow && $hanger && $this->CJKforceend) {
5257
- // force-end overhang
5258
- $this->Cell( $stringWidth, $lineHeight, $chunk, '', 0, '', $fill, $this->HREF, $currentx,0,0,'M', $fill, $af, $bf, true );
5259
- $this->Cell( $this->GetStringWidth($hanger), $lineHeight, $hanger, '', 1, '', $fill, $this->HREF, $currentx,0,0,'M', $fill, $af, $bf, true );
5260
- }
5261
- else {
5262
- $this->Cell( $stringWidth, $lineHeight, $chunk, '', 1, '', $fill, $this->HREF, $currentx,0,0,'M', $fill, $af, $bf, true );
5263
- }
5264
- }
5265
  else $this->Cell( $stringWidth, $lineHeight, $chunk, '', 0, '', $fill, $this->HREF, 0, 0,0,'M', $fill, $af, $bf, true );//first or middle part
5266
 
5267
-
5268
  if (!empty($this->spanborddet)) {
5269
  if (strpos($contentB[$k],'R')!==false && $k != $arraysize-1) $this->x += $this->spanborddet['R']['w'];
5270
  }
@@ -5273,17 +5094,14 @@ function finishFlowingBlock($endofblock=false, $next='') {
5273
  $fill = $save_fill; $spanfill = 0;
5274
  if ($fill) { $this->SetFColor($bcor); }
5275
  }
5276
- // mPDF 5.6.26
5277
- if (isset($this->textparam['visibility']) && $this->textparam['visibility'] && $this->visibility != $save_vis) {
5278
- $this->SetVisibility($save_vis);
5279
- }
5280
-
5281
  }
5282
 
5283
  $this->printobjectbuffer($is_table, $blockdir);
5284
 
 
5285
  $this->objectbuffer = array();
5286
 
 
5287
  $this->ResetSpacing();
5288
 
5289
  /*-- LISTS --*/
@@ -5306,7 +5124,7 @@ function finishFlowingBlock($endofblock=false, $next='') {
5306
  $this->x = $currentx;
5307
  if (isset($bull['x'])) { $this->x += $bull['x']; }
5308
  $this->y -= $lineHeight;
5309
- if (isset($bull['col']) && $bull['col']) { $this->SetTColor($bull['col']); } // mPDF 5.6.67
5310
 
5311
  if (isset($bull['txt'])) { $this->Cell($bull['w'], $lineHeight,$bull['txt'],'','',$bull['align'],0,'',0,-$this->cMarginL, -$this->cMarginR ); }
5312
  if (isset($bull['font']) && $bull['font'] == 'czapfdingbats') {
@@ -5607,30 +5425,25 @@ function printobjectbuffer($is_table=false, $blockdir=false) {
5607
 
5608
  // DOT-TAB
5609
  if ($objattr['type'] == 'dottab') {
5610
- // mPDF 5.6.19
5611
- if (isset($objattr['fontfamily'])) { $this->SetFont($objattr['fontfamily'],'',$objattr['fontsize'] ); }
5612
  $sp = $this->GetStringWidth(' ');
5613
  $nb=floor(($w-2*$sp)/$this->GetStringWidth('.'));
5614
  if ($nb>0) { $dots=' '.str_repeat('.',$nb).' '; }
5615
  else { $dots=' '; }
5616
  $col = $this->ConvertColor(0);
5617
- if (isset($objattr['colorarray']) && ($objattr['colorarray'])) { // mPDF 5.6.19
5618
  $col = $objattr['colorarray'];
5619
  }
5620
  $this->SetTColor($col);
5621
- $save_dh = $this->divheight; // mPDF 5.6.19
5622
  $save_sbd = $this->spanborddet;
5623
  $save_u = $this->U;
5624
  $save_s = $this->strike;
5625
  $this->spanborddet = '';
5626
- $this->divheight = 0; // mPDF 5.6.19
5627
  $this->U = false;
5628
  $this->strike = false;
5629
  $this->Cell($w,$h,$dots,0,0,'C');
5630
  $this->spanborddet = $save_sbd;
5631
  $this->U = $save_u;
5632
  $this->strike = $save_s;
5633
- $this->divheight = $save_dh; // mPDF 5.6.19
5634
  // mPDF 5.0
5635
  $this->SetTColor($this->ConvertColor(0));
5636
  }
@@ -5715,8 +5528,16 @@ function WriteFlowingBlock( $s)
5715
  // where the line should be cutoff if it is to be justified
5716
  $cutoffWidth = $contentWidth;
5717
 
 
 
 
 
 
 
 
 
 
5718
  $CJKoverflow = false;
5719
- $hanger = ''; // mPDF 5.6.40
5720
 
5721
  // COLS
5722
  $oldcolumn = $this->CurrCol;
@@ -5802,6 +5623,9 @@ function WriteFlowingBlock( $s)
5802
  $tmp = mb_strlen( $s, $this->mb_enc );
5803
  }
5804
 
 
 
 
5805
  // for every character in the string
5806
  for ( $i = 0; $i < $tmp; $i++ ) {
5807
  // extract the current character
@@ -5837,13 +5661,34 @@ function WriteFlowingBlock( $s)
5837
  $cw += $rbw*_MPDFK;
5838
  $contentB[(count($contentB)-1)] .= 'R';
5839
  }
5840
- // mPDF 5.6.45
5841
- if ($c==' ') {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5842
  $currContent .= $c;
5843
  $cutoffWidth = $contentWidth;
5844
  $contentWidth += $cw;
 
5845
  continue;
5846
  }
 
5847
 
5848
  // ADDED for Paragraph_indent
5849
  $WidthCorrection = 0;
@@ -5886,10 +5731,6 @@ function WriteFlowingBlock( $s)
5886
  $savedContentB = '';
5887
  $savedFont = array();
5888
  $savedObj = array();
5889
- // mPDF 5.6.20
5890
- $savedPreContent = array();
5891
- $savedPreContentB = array();
5892
- $savedPreFont = array();
5893
 
5894
  // cut off and save any partial words at the end of the string
5895
  $words = explode( ' ', $currContent );
@@ -5897,29 +5738,14 @@ function WriteFlowingBlock( $s)
5897
  // HYPHENATION
5898
  $currWord = $words[count($words)-1] ;
5899
  $success = false;
5900
-
5901
- // mPDF 5.6.21 Hard Hyphens -
5902
- $hardsuccess = false;
5903
- if ($this->textparam['hyphens'] != 2 && preg_match("/\-/",$currWord)) {
5904
- $rem = $maxWidth - $WidthCorrection - (($this->cMarginL+$this->cMarginR)*_MPDFK) - ($paddingL+$paddingR +(($fpaddingL + $fpaddingR) * _MPDFK) );
5905
- list($hardsuccess,$pre,$post,$prelength) = $this->hardHyphenate($currWord, (($rem-$cutoffWidth)/_MPDFK -$this->GetCharWidth("-", false)) );
5906
- if ($hardsuccess) {
5907
- $already = array_pop( $words );
5908
- $forward = mb_substr($already,$prelength+1,mb_strlen($already, $this->mb_enc), $this->mb_enc);
5909
- $words[] = $pre.'-';
5910
- $words[] = $forward;
5911
- $currContent = mb_substr($currContent,0,mb_strlen($currContent, $this->mb_enc)+1-mb_strlen($post, $this->mb_enc), $this->mb_enc) . '-';
5912
- }
5913
- }
5914
-
5915
  /*-- HYPHENATION --*/
5916
  // Soft Hyphens chr(173)
5917
- else if ($this->textparam['hyphens'] != 2 && (!$this->usingCoreFont && preg_match("/\xc2\xad/",$currWord)) || ($this->usingCoreFont && preg_match("/".chr(173)."/",$currWord) && ($this->FontFamily!='csymbol' && $this->FontFamily!='czapfdingbats')) ) { // mPDF 5.6.06
5918
  $rem = $maxWidth - $WidthCorrection - (($this->cMarginL+$this->cMarginR)*_MPDFK) - ($paddingL+$paddingR +(($fpaddingL + $fpaddingR) * _MPDFK) );
5919
- list($success,$pre,$post,$prelength) = $this->softHyphenate($currWord, (($rem-$cutoffWidth)/_MPDFK -$this->GetCharWidth(" ", false)) );
5920
  }
5921
 
5922
- if (!$success && !$hardsuccess && $this->textparam['hyphens'] == 1 ) { // mPDF 5.6.06 // mPDF 5.6.21
5923
  // Look ahead to get current word
5924
  for($ac = $i; $ac<(mb_strlen($s)-1); $ac++) {
5925
  $addc = mb_substr($s,$ac,1,$this->mb_enc );
@@ -5938,91 +5764,57 @@ function WriteFlowingBlock( $s)
5938
  }
5939
  /*-- END HYPHENATION --*/
5940
 
5941
- // mPDF 5.6.13 Decimal alignment (cancel if wraps to > 1 line)
5942
- if ($is_table && substr($align,0,1)=='D' ) { $align=substr($align,2,1); }
5943
-
5944
  /*-- CJK-FONTS --*/
5945
- // mPDF 5.6.42
5946
- if ($this->checkCJK) {
 
5947
  $lastchar = mb_substr($words[(count($words)-1)],mb_strlen($words[(count($words)-1)], $this->mb_enc)-1, 1, $this->mb_enc);
5948
- }
5949
- // Next character is suitable to add as overhanging or squeezed punctuation
5950
- if ($this->checkCJK && preg_match("/[".$this->CJKoverflow."]/u", $c) && $this->allowCJKorphans && !$CJKoverflow) {
5951
- // add character onto this line
5952
- $currContent .= $c;
5953
- $cutoffWidth = $contentWidth;
5954
- $contentWidth += $cw;
5955
- $CJKoverflow = true;
5956
- continue;
5957
- }
5958
- // Last character that fits is not allowed to end a line - move lastchar(s) to start of next line
5959
- else if ($this->checkCJK && preg_match("/[".$this->CJKleading."]/u", $lastchar)) {
5960
- //move lastchar(s) to next line
5961
- $m0 = $lastchar;
5962
- $m1 = $c;
5963
- while(preg_match("/[".$this->CJKleading."]/u", $m0) && mb_strlen($words[(count($words)-1)], $this->mb_enc)>2) {
5964
- // trim last letter off word[0]
5965
- $words[(count($words)-1)] = mb_substr($words[(count($words)-1)],0,mb_strlen($words[(count($words)-1)], $this->mb_enc)-1, $this->mb_enc);
5966
- // and add it to savedContent for next line
5967
- $savedContent = $m0.$savedContent;
5968
- $m1 = $lastchar;
5969
- $lastchar = mb_substr($words[(count($words)-1)],mb_strlen($words[(count($words)-1)], $this->mb_enc)-1, 1, $this->mb_enc);
5970
  $m0 = $lastchar;
5971
- }
5972
- $lastContent = '';
5973
- for ( $w = 0; $w < count( $words ) ; $w++) { $lastContent .= $words[ $w ]." "; }
5974
- $savedFont = $this->saveFont();
5975
- // replace the current content with the cropped version
5976
- $currContent = rtrim( $lastContent );
5977
- }
5978
- // Next character is not allowed to start a new line
5979
- else if ($this->checkCJK && preg_match("/[".$this->CJKfollowing."]/u", $c)) {
5980
- // try squeezing another character(s) onto this line = Oikomi
5981
- if ($this->allowCJKorphans && !$CJKoverflow) { // mPDF 5.6.40
5982
- $lookahead = mb_substr($s,$i+1,1,$this->mb_enc );
5983
- //if lookahead is not another following char
5984
- if (!$lookahead || ($lookahead && !preg_match("/[".$this->CJKfollowing."]/u", $lookahead))) {
5985
- $currContent .= $c;
5986
- $cutoffWidth = $contentWidth;
5987
- $contentWidth += $cw;
5988
- if ($this->allowCJKoverflow && preg_match("/[".$this->CJKoverflow."]/u", $c)) { $CJKoverflow = true; }
5989
- continue;
5990
  }
5991
- }
5992
- // or move lastchar(s) to next line to keep $c company = Oidashi
5993
- $m0 = $lastchar;
5994
- $m1 = $c;
5995
- while(preg_match("/[".$this->CJKfollowing."]/u", $m1) && mb_strlen($words[(count($words)-1)], $this->mb_enc)>2) {
5996
- // trim last letter off word[0]
5997
- $words[(count($words)-1)] = mb_substr($words[(count($words)-1)],0,mb_strlen($words[(count($words)-1)], $this->mb_enc)-1, $this->mb_enc);
5998
- // and add it to savedContent for next line
5999
- $savedContent = $m0.$savedContent;
6000
- $m1 = $lastchar;
6001
- $lastchar = mb_substr($words[(count($words)-1)],mb_strlen($words[(count($words)-1)], $this->mb_enc)-1, 1, $this->mb_enc);
6002
- $m0 = $lastchar;
6003
- }
6004
- $lastContent = '';
6005
- for ( $w = 0; $w < count( $words ) ; $w++) { $lastContent .= $words[ $w ]." "; }
6006
- $savedFont = $this->saveFont();
6007
- // replace the current content with the cropped version
6008
- $currContent = rtrim( $lastContent );
6009
- }
6010
- // mPDF 5.6.42
6011
- else if ($this->checkCJK && preg_match("/([".$this->pregCJKchars."]+[0-9\x{ff10}-\x{ff19}]+$)/u", $words[0])) {
6012
- $lookahead = mb_substr($s,$i,16,$this->mb_enc );
6013
- //and if lookahead starts with a few numerals
6014
- if ($lookahead && (preg_match("/^([0-9\x{ff10}-\x{ff19}]+[".$this->pregCJKchars."]+)/u", $lookahead) || preg_match("/^([0-9\x{ff10}-\x{ff19}]+$)/u", $lookahead)) ) {
6015
- // or move lastchar(s) to next line to keep numerals together
6016
  $m0 = $lastchar;
6017
- while(preg_match("/[0-9\x{ff10}-\x{ff19}]/u", $m0) && mb_strlen($words[(count($words)-1)], $this->mb_enc)>2) {
 
6018
  // trim last letter off word[0]
6019
  $words[(count($words)-1)] = mb_substr($words[(count($words)-1)],0,mb_strlen($words[(count($words)-1)], $this->mb_enc)-1, $this->mb_enc);
6020
  // and add it to savedContent for next line
6021
  $savedContent = $m0.$savedContent;
 
6022
  $lastchar = mb_substr($words[(count($words)-1)],mb_strlen($words[(count($words)-1)], $this->mb_enc)-1, 1, $this->mb_enc);
6023
  $m0 = $lastchar;
6024
  }
 
 
6025
  }
 
6026
  $lastContent = '';
6027
  for ( $w = 0; $w < count( $words ) ; $w++) { $lastContent .= $words[ $w ]." "; }
6028
  $savedFont = $this->saveFont();
@@ -6035,70 +5827,18 @@ function WriteFlowingBlock( $s)
6035
  if ( count( $words ) == 1 ) {
6036
  // TO correct for error when word too wide for page - but only when one long word from left to right margin
6037
  if (count($content) == 1 && $currContent != ' ') {
 
 
6038
  $lastchar = mb_substr($words[0],mb_strlen($words[0], $this->mb_enc)-1, 1, $this->mb_enc);
6039
  $lastContent = $words[0];
6040
  $savedFont = $this->saveFont();
6041
  // replace the current content with the cropped version
6042
  $currContent = rtrim( $lastContent );
6043
  }
6044
- // mPDF 5.6.20
6045
- else if ( count($content)>1
6046
- && (!isset($this->objectbuffer[(count($content)-1)]) && !isset($this->objectbuffer[(count($content)-2)]))
6047
- && substr($content[count($content)-2],-1,1) != ' '
6048
- && substr($currContent,0,1) != ' '
6049
- ) {
6050
- // Go back to find a space in a previous chunk of content
6051
- $found = false;
6052
- for ($ix=count($content)-1;$ix>=0;$ix--) {
6053
- // mPDF 5.6.29
6054
- if ($this->usingCoreFont && preg_match('/[ '.chr(173).']/',$content[$ix],$m)) { $match = $m[0]; $found = $ix; break; }
6055
- else if (!$this->usingCoreFont) {
6056
- if (preg_match('/[ ]/',$content[$ix])) { $match = ' '; $found = $ix; break; }
6057
- else if (preg_match('/[\x{00AD}]/u',$content[$ix])) {
6058
- // even though it is UTF-8 replace it temporarily with chr(173)
6059
- $content[$ix] = preg_replace('/[\x{00AD}]/u',chr(173),$content[$ix]);
6060
- $match = chr(173); $found = $ix; break;
6061
- }
6062
- }
6063
- }
6064
- if ($found !== false) {
6065
- $charpos = strrpos($content[$found],$match); // mPDF 5.6.29
6066
- for ($ix=count($content)-1;$ix>$found;$ix--) {
6067
- // save and crop off any subsequent chunks
6068
- $savedPreContent[] = array_pop($content);
6069
- $savedPreContentB[] = array_pop($contentB);
6070
- $savedPreFont[] = array_pop($font);
6071
- }
6072
- if (substr($content[count($content)-1],$charpos+1,strlen($content[count($content)-1])-1) != '') {
6073
- $savedPreContent[] = substr($content[count($content)-1],$charpos+1,strlen($content[count($content)-1])-1);
6074
- $savedPreContentB[] = preg_replace('/L/','',$contentB[count($content)-1]); // ???
6075
- $savedPreFont[] = $font[count($content)-1];
6076
- }
6077
- $savedContent = '';
6078
- $savedContentB = '';
6079
- $savedFont = array();
6080
-
6081
- $currContent =& $content[ count( $content ) - 1 ];
6082
- $currContent = substr($currContent,0,$charpos);
6083
- if ($match == chr(173)) { $currContent .= '-'; } // mPDF 5.6.29
6084
- if (strpos($contentB[(count($contentB)-1)],'R')!==false) { // ???
6085
- $contentB[count($content)-1] = preg_replace('/R/','',$contentB[count($content)-1]); // ???
6086
- }
6087
-
6088
- $currContent = rtrim( $currContent );
6089
- }
6090
- else {
6091
- $savedContent = array_pop( $content );
6092
- $savedContentB = array_pop($contentB);
6093
- $savedFont = array_pop( $font );
6094
- $currContent =& $content[ count( $content ) - 1 ];
6095
- $currContent = rtrim( $currContent );
6096
- }
6097
- }
6098
  else {
6099
  // save and crop off the content currently on the stack
6100
  $savedContent = array_pop( $content );
6101
- $savedContentB = array_pop($contentB); // mPDF 5.6.20
6102
  $savedFont = array_pop( $font );
6103
  // trim any trailing spaces off the last bit of content
6104
  $currContent =& $content[ count( $content ) - 1 ];
@@ -6179,12 +5919,6 @@ function WriteFlowingBlock( $s)
6179
  {
6180
  $this->restoreFont( $font[ $k ]);
6181
  if (!isset($this->objectbuffer[$k])) {
6182
- // mPDF 5.6.40
6183
- if ($this->checkCJK && $k == count($content)-1 && $CJKoverflow && $align=='J' && $this->allowCJKoverflow && $this->CJKforceend) {
6184
- // force-end overhang
6185
- $hanger = mb_substr($chunk,mb_strlen($chunk,$this->mb_enc)-1,1,$this->mb_enc );
6186
- $content[$k] = $chunk = mb_substr($chunk,0,mb_strlen($chunk,$this->mb_enc)-1,$this->mb_enc );
6187
- }
6188
  if (!$this->usingCoreFont) {
6189
  $content[$k] = $chunk = str_replace("\xc2\xad",'',$chunk );
6190
  if (isset($this->CurrentFont['indic']) && $this->CurrentFont['indic']) { $checkCursive=true; } // *INDIC*
@@ -6304,7 +6038,7 @@ function WriteFlowingBlock( $s)
6304
  $nb_carac = 0;
6305
  $nb_spaces = 0;
6306
  // if it's justified, we need to find the char/word spacing (or if orphans have allowed length of line to go over the maxwidth)
6307
- if ( ($align == 'J' && !$CJKoverflow) || (($cutoffWidth + $lastitalic > $maxWidth - $WidthCorrection - (($this->cMarginL+$this->cMarginR)*_MPDFK) - ($paddingL+$paddingR +(($fpaddingL + $fpaddingR) * _MPDFK) ) + 0.001) && (!$CJKoverflow || ($CJKoverflow && !$this->allowCJKoverflow))) || $CJKoverflow && $align=='J' && $this->allowCJKoverflow && $hanger && $this->CJKforceend) { // 0.001 is to correct for deviations converting mm=>pts // mPDF 5.6.40
6308
  // JUSTIFY J (Use character spacing)
6309
  // WORD SPACING
6310
  foreach ( $content as $k => $chunk ) {
@@ -6361,10 +6095,6 @@ function WriteFlowingBlock( $s)
6361
  $this->keep_block_together = 0;
6362
  }
6363
 
6364
- if ($this->kwt && !$is_table) { // mPDF 5.7+
6365
- $this->printkwtbuffer();
6366
- $this->kwt = false;
6367
- }
6368
 
6369
  /*-- COLUMNS --*/
6370
  // COLS
@@ -6389,7 +6119,6 @@ function WriteFlowingBlock( $s)
6389
  if (($newblock) && ($blockstate==1 || $blockstate==3) && ($lineCount == 1) && (!$is_table) && (!$is_list)) {
6390
  $this->blk[$this->blklvl]['y0'] = $this->y;
6391
  $this->blk[$this->blklvl]['startpage'] = $this->page;
6392
- if ($this->blk[$this->blklvl]['float']) { $this->blk[$this->blklvl]['float_start_y'] = $this->y; } // mPDF 5.6.63
6393
  }
6394
 
6395
  // TOP PADDING and BORDER spacing/fill
@@ -6481,11 +6210,6 @@ function WriteFlowingBlock( $s)
6481
  $this->fixedlSpacing = false;
6482
  $this->minwSpacing = 0;
6483
 
6484
- // mPDF 5.6.26
6485
- $save_vis = $this->visibility;
6486
- if (isset($this->textparam['visibility']) && $this->textparam['visibility'] && $this->textparam['visibility'] != $this->visibility) {
6487
- $this->SetVisibility($this->textparam['visibility']);
6488
- }
6489
  // *********** SPAN BACKGROUND COLOR ***************** //
6490
  if ($this->spanbgcolor) {
6491
  $cor = $this->spanbgcolorarray;
@@ -6507,16 +6231,7 @@ function WriteFlowingBlock( $s)
6507
  if ($stringWidth==0) { $stringWidth = 0.000001; }
6508
  if ($k == $arraysize-1) {
6509
  $stringWidth -= ( $this->charspacing / _MPDFK );
6510
- // mPDF 5.6.40
6511
- if ($this->checkCJK && $CJKoverflow && $align=='J' && $this->allowCJKoverflow && $hanger && $this->CJKforceend) {
6512
- // force-end overhang
6513
- $this->Cell( $stringWidth, $lineHeight, $chunk, '', 0, '', $fill, $this->HREF, $currentx,0,0,'M', $fill, $af, $bf, true );
6514
- $this->Cell( $this->GetStringWidth($hanger), $lineHeight, $hanger, '', 1, '', $fill, $this->HREF, $currentx,0,0,'M', $fill, $af, $bf, true );
6515
- }
6516
- else {
6517
- $this->Cell( $stringWidth, $lineHeight, $chunk, '', 1, '', $fill, $this->HREF, $currentx,0,0,'M', $fill, $af, $bf, true ); //mono-style line or last part (skips line)
6518
- }
6519
-
6520
  }
6521
  else $this->Cell( $stringWidth, $lineHeight, $chunk, '', 0, '', $fill, $this->HREF, 0, 0,0,'M', $fill, $af, $bf, true );//first or middle part
6522
 
@@ -6528,11 +6243,6 @@ function WriteFlowingBlock( $s)
6528
  $fill = $save_fill; $spanfill = 0;
6529
  if ($fill) { $this->SetFColor($bcor); }
6530
  }
6531
- // mPDF 5.6.26
6532
- if (isset($this->textparam['visibility']) && $this->textparam['visibility'] && $this->visibility != $save_vis) {
6533
- $this->SetVisibility($save_vis);
6534
- }
6535
-
6536
  }
6537
  if (!$is_table) {
6538
  $this->maxPosR = max($this->maxPosR , ($this->w - $this->rMargin - $this->blk[$this->blklvl]['outer_right_margin']));
@@ -6564,7 +6274,7 @@ function WriteFlowingBlock( $s)
6564
  $this->x = $currentx;
6565
  if (isset($bull['x'])) { $this->x += $bull['x']; }
6566
  $this->y -= $lineHeight;
6567
- if (isset($bull['col']) && $bull['col']) { $this->SetTColor($bull['col']); } // mPDF 5.6.67
6568
  if (isset($bull['txt'])) { $this->Cell($bull['w'], $lineHeight,$bull['txt'],'','',$bull['align'],0,'',0,-$this->cMarginL, -$this->cMarginR ); }
6569
  if (isset($bull['font']) && $bull['font'] == 'czapfdingbats') {
6570
  $this->bullet = false;
@@ -6588,6 +6298,13 @@ function WriteFlowingBlock( $s)
6588
  $lineHeight = $this->divheight;
6589
  $valign = 'M';
6590
 
 
 
 
 
 
 
 
6591
  $font = array();
6592
  $content = array();
6593
  $contentB = array();
@@ -6599,52 +6316,17 @@ function WriteFlowingBlock( $s)
6599
  $contentB[] = '';
6600
  $contentWidth += $savedObj['OUTER-WIDTH'] * _MPDFK;
6601
  }
6602
- // mPDF 5.6.20
6603
- if (count($savedPreContent) > 0) {
6604
- for($ix=count($savedPreContent)-1;$ix>=0;$ix--) {
6605
- $font[] = $savedPreFont[$ix];
6606
- $content[] = $savedPreContent[$ix];
6607
- $contentB[] = $savedPreContentB[$ix];
6608
- $this->restoreFont( $savedPreFont[$ix] );
6609
- $lbw = $rbw = 0; // Border widths
6610
- if (!empty($this->spanborddet)) {
6611
- $lbw = $this->spanborddet['L']['w'];
6612
- $rbw = $this->spanborddet['R']['w'];
6613
- }
6614
- if ($ix>0) {
6615
- $contentWidth += $this->GetStringWidth( $savedPreContent[$ix] ) * _MPDFK;
6616
- if (strpos($savedPreContentB[$ix],'L')!==false) $contentWidth += $lbw;
6617
- if (strpos($savedPreContentB[$ix],'R')!==false) $contentWidth += $rbw;
6618
- }
6619
- }
6620
- $savedPreContent = array();
6621
- $savedPreContentB = array();
6622
- $savedPreFont = array();
6623
- $content[ (count($content)-1) ] .= $c;
6624
- }
6625
- else {
6626
- $font[] = $savedFont;
6627
- $content[] = $savedContent . $c;
6628
- $contentB[] = $savedContentB ;
6629
- }
6630
-
6631
  $currContent =& $content[ (count($content)-1) ];
6632
-
6633
  // CJK - strip CJK space at end of line
6634
  // &#x3000; = \xe3\x80\x80 = CJK space
6635
  if ($this->checkCJK && $currContent == "\xe3\x80\x80") { $currContent = '' ; } // *CJK-FONTS*
6636
-
6637
- $this->restoreFont( $savedFont );
6638
- $lbw = $rbw = 0; // Border widths
6639
- if (!empty($this->spanborddet)) {
6640
- $lbw = $this->spanborddet['L']['w'];
6641
- $rbw = $this->spanborddet['R']['w'];
6642
- }
6643
  $contentWidth += $this->GetStringWidth( $currContent ) * _MPDFK;
6644
  if (strpos($savedContentB,'L')!==false) $contentWidth += $lbw;
6645
  $cutoffWidth = $contentWidth;
6646
  $CJKoverflow = false;
6647
- $hanger = ''; // mPDF 5.6.40
6648
  }
6649
  // another character will fit, so add it on
6650
  else {
@@ -6787,23 +6469,24 @@ function _SetTextRendering($mode) {
6787
 
6788
  }
6789
 
6790
- function SetTextOutline($params=array()) { // mPDF 5.6.07
6791
- if (isset($params['outline-s']) && $params['outline-s'])
6792
- {
6793
- $this->SetLineWidth($params['outline-WIDTH']);
6794
- $this->SetDColor($params['outline-COLOR']);
6795
- $tr = ('2 Tr');
6796
- if($this->page>0 && ((isset($this->pageoutput[$this->page]['TextRendering']) && $this->pageoutput[$this->page]['TextRendering'] != $tr) || !isset($this->pageoutput[$this->page]['TextRendering']) || $this->keep_block_together)) { $this->_out($tr); }
6797
- $this->pageoutput[$this->page]['TextRendering'] = $tr;
6798
- }
6799
- else //Now resets all values
6800
  {
 
6801
  $this->SetLineWidth(0.2);
6802
  $this->SetDColor($this->ConvertColor(0));
6803
  $this->_SetTextRendering(0);
6804
  $tr = ('0 Tr');
6805
  if($this->page>0 && ((isset($this->pageoutput[$this->page]['TextRendering']) && $this->pageoutput[$this->page]['TextRendering'] != $tr) || !isset($this->pageoutput[$this->page]['TextRendering']) || $this->keep_block_together)) { $this->_out($tr); }
6806
  $this->pageoutput[$this->page]['TextRendering'] = $tr;
 
 
 
 
 
 
 
 
6807
  }
6808
  }
6809
 
@@ -7287,7 +6970,7 @@ function DivLn($h,$level=-3,$move_y=true,$collapsible=false,$state=0) {
7287
  for ($blvl=$firstblockfill;$blvl<=$level;$blvl++) {
7288
  $this->SetBlockFill($blvl);
7289
  $this->x = $this->lMargin + $this->blk[$blvl]['outer_left_margin'];
7290
- if ($last_x != $this->lMargin + $this->blk[$blvl]['outer_left_margin'] || $last_w != $this->blk[$blvl]['width'] || $last_fc != $this->FillColor || $this->blk[$blvl]['border_top']['s'] || $this->blk[$blvl]['border_bottom']['s'] || $this->blk[$blvl]['border_left']['s'] || $this->blk[$blvl]['border_right']['s']) { // mPDF 5.6.55
7291
  $x = $this->x;
7292
  $this->Cell( ($this->blk[$blvl]['width']), $h, '', '', 0, '', 1);
7293
  if (!$this->keep_block_together && !$this->writingHTMLheader && !$this->writingHTMLfooter) {
@@ -7341,11 +7024,12 @@ function SetXY($x,$y)
7341
 
7342
  function Output($name='',$dest='')
7343
  {
7344
- global $gfpdfe_data;
7345
-
7346
  //Output PDF to some destination
7347
  if ($this->showStats) {
7348
- file_put_contents($gfpdfe_data->template_save_location . 'mPDF_performance_log.txt', date('Y-m-d h:i:s') . ' Generated in '.sprintf('%.2F',(microtime(true) - $this->time0))." seconds\r\n", FILE_APPEND);
 
 
 
7349
  }
7350
  //Finish document if necessary
7351
  if ($this->progressBar) { $this->UpdateProgressBar(1,'100','Finished'); } // *PROGRESS-BAR*
@@ -7363,14 +7047,17 @@ function Output($name='',$dest='')
7363
  }
7364
  }
7365
 
 
7366
  if (($this->PDFA || $this->PDFX) && $this->encrypted) { $this->Error("PDFA1-b or PDFX/1-a does not permit encryption of documents."); }
7367
  if (count($this->PDFAXwarnings) && (($this->PDFA && !$this->PDFAauto) || ($this->PDFX && !$this->PDFXauto))) {
7368
  if ($this->PDFA) {
7369
  echo '<div>WARNING - This file could not be generated as it stands as a PDFA1-b compliant file.</div>';
 
7370
  echo '<div>Action that mPDF will take to automatically force PDFA1-b compliance are shown in brackets.</div>';
7371
  }
7372
  else {
7373
  echo '<div>WARNING - This file could not be generated as it stands as a PDFX/1-a compliant file.</div>';
 
7374
  echo '<div>Action that mPDF will take to automatically force PDFX/1-a compliance are shown in brackets.</div>';
7375
  }
7376
  echo '<div>Warning(s) generated:</div><ul>';
@@ -7383,13 +7070,13 @@ function Output($name='',$dest='')
7383
  }
7384
 
7385
  if ($this->showStats) {
7386
- /* Blue Liquid Designs Edit
7387
- Log to File instead */
7388
- $log = date('Y-m-d h:i:s') . ' Compiled in '.sprintf('%.2F',(microtime(true) - $this->time0))." seconds (total)\n\r";
7389
- $log .= 'Peak Memory usage '.number_format((memory_get_peak_usage(true)/(1024*1024)),2)." MB\n";
7390
- $log .= 'PDF file size '.number_format((strlen($this->buffer)/1024))." kB\n";
7391
- $log .= 'Number of fonts '.count($this->fonts)."\n";
7392
- file_put_contents($gfpdfe_data->template_save_location . 'mPDF_performance_log.txt', $log, FILE_APPEND);
7393
  }
7394
 
7395
 
@@ -7520,7 +7207,7 @@ function Output($name='',$dest='')
7520
  $interval = 3600;
7521
  if ($handle = opendir(preg_replace('/\/$/','',_MPDF_TEMP_PATH))) {
7522
  while (false !== ($file = readdir($handle))) {
7523
- if (!is_dir($file) && ((filemtime(_MPDF_TEMP_PATH.$file)+$interval) < time()) && ($file != "..") && ($file != ".") && (substr($file, 0, 1) !== '.') && ($file !='dummy.txt')) { // mPDF 5.7
7524
  unlink(_MPDF_TEMP_PATH.$file);
7525
  }
7526
  }
@@ -7583,19 +7270,11 @@ function _puthtmlheaders() {
7583
  $this->pgwidth = $this->w - $this->lMargin - $this->rMargin;
7584
  $this->x = $this->lMargin;
7585
  $this->y = $this->margin_header;
7586
- // mPDF 5.6.47
7587
- $pn = $this->docPageNum($n);
7588
- if ($pn)
7589
- $pnstr = $this->pagenumPrefix.$pn.$this->pagenumSuffix;
7590
- else { $pnstr = ''; }
7591
- $html = str_replace('{PAGENO}',$pnstr,$html);
7592
- $pnt = $this->docPageNumTotal($n);
7593
- if ($pnt)
7594
- $pntstr = $this->nbpgPrefix.$pnt.$this->nbpgSuffix;
7595
- else { $pntstr = ''; }
7596
- $html = str_replace($this->aliasNbPgGp,$pntstr,$html ); // {nbpg}
7597
  $html = str_replace($this->aliasNbPg,$nb,$html ); // {nb}
7598
- $html = preg_replace_callback('/\{DATE\s+(.*?)\}/', array($this, 'date_callback') ,$html ); // mPDF 5.7
7599
 
7600
  $this->HTMLheaderPageLinks = array();
7601
  $this->HTMLheaderPageAnnots = array();
@@ -7666,19 +7345,11 @@ function _puthtmlheaders() {
7666
 
7667
  // if bottom-margin==0, corrects to avoid division by zero
7668
  if ($this->y == $this->h) { $top_y = $this->y = ($this->h - 0.1); }
7669
- // mPDF 5.6.47
7670
- $pn = $this->docPageNum($n);
7671
- if ($pn)
7672
- $pnstr = $this->pagenumPrefix.$pn.$this->pagenumSuffix;
7673
- else { $pnstr = ''; }
7674
- $html = str_replace('{PAGENO}',$pnstr,$html);
7675
- $pnt = $this->docPageNumTotal($n);
7676
- if ($pnt)
7677
- $pntstr = $this->nbpgPrefix.$pnt.$this->nbpgSuffix;
7678
- else { $pntstr = ''; }
7679
- $html = str_replace($this->aliasNbPgGp,$pntstr,$html ); // {nbpg}
7680
  $html = str_replace($this->aliasNbPg,$nb,$html ); // {nb}
7681
- $html = preg_replace_callback('/\{DATE\s+(.*?)\}/', array($this, 'date_callback') ,$html ); // mPDF 5.7
7682
 
7683
 
7684
  $this->HTMLheaderPageLinks = array();
@@ -7804,7 +7475,7 @@ function _putpages()
7804
  for($n=1;$n<=$nb;$n++)
7805
  {
7806
  $thispage = $this->pages[$n];
7807
- // unset($this->pages[$n]); // mPDF 5.6.47
7808
  if(isset($this->OrientationChanges[$n])) {
7809
  $hPt=$this->pageDim[$n]['w']*_MPDFK;
7810
  $wPt=$this->pageDim[$n]['h']*_MPDFK;
@@ -9175,7 +8846,7 @@ function _putcatalog() {
9175
 
9176
  // mPDF 5.6.01
9177
  if ($this->hasOC || count($this->layers)) {
9178
- $p = $v = $h = $l = $loff = $lall = $as = ''; // mPDF 5.6.28
9179
  if ($this->hasOC) {
9180
  if (($this->hasOC & 1) == 1) $p=$this->n_ocg_print.' 0 R';
9181
  if (($this->hasOC & 2) == 2) $v=$this->n_ocg_view.' 0 R';
@@ -9184,14 +8855,12 @@ function _putcatalog() {
9184
  }
9185
 
9186
  if(count($this->layers)) {
9187
- foreach($this->layers as $k=>$layer) { // mPDF 5.6.28
9188
- if (strtolower($this->layerDetails[$k]['state'])=='hidden') { $loff .= $layer['n'].' 0 R '; }
9189
- else { $l .= $layer['n'].' 0 R '; }
9190
- $lall .= $layer['n'].' 0 R ';
9191
  }
9192
  }
9193
- $this->_out("/OCProperties <</OCGs [$p $v $h $lall] /D <</ON [$p $l] /OFF [$v $h $loff] "); // mPDF 5.6.28
9194
- $this->_out("/Order [$v $p $h $lall] "); // mPDF 5.6.28
9195
  if ($as) $this->_out("/AS [$as] ");
9196
  $this->_out(">>>>");
9197
 
@@ -9317,6 +8986,7 @@ function _beginpage($orientation,$mgl='',$mgr='',$mgt='',$mgb='',$mgh='',$mgf=''
9317
  $this->state=2;
9318
  $resetHTMLHeadersrequired = false;
9319
 
 
9320
  if ($newformat) { $this->_setPageSize($newformat, $orientation); }
9321
  /*-- CSS-PAGE --*/
9322
  // Paged media (page-box)
@@ -9557,6 +9227,7 @@ function _beginpage($orientation,$mgl='',$mgr='',$mgt='',$mgb='',$mgh='',$mgf=''
9557
  }
9558
  /*-- END HTMLHEADERS-FOOTERS --*/
9559
  }
 
9560
  /*-- HTMLHEADERS-FOOTERS --*/
9561
  if ($resetHTMLHeadersrequired) {
9562
  $this->SetHTMLHeader($this->HTMLHeader );
@@ -9726,6 +9397,21 @@ function _getImage(&$file, $firsttime=true, $allowvector=true, $orig_srcpath=fal
9726
  $this->file_get_contents_by_curl($file, $data); // needs full url?? even on local (never needed for local)
9727
  if ($data) { $type = $this->_imageTypeFromString($data); }
9728
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9729
 
9730
  }
9731
  if (!$data) { return $this->_imageError($file, $firsttime, 'Could not find image file'); }
@@ -11018,7 +10704,7 @@ function SetDefaultFont($font) {
11018
  $this->original_default_font = $font;
11019
  if (!$this->watermark_font ) { $this->watermark_font = $font; } // *WATERMARK*
11020
  $this->defaultCSS['BODY']['FONT-FAMILY'] = $font;
11021
- $this->cssmgr->CSS['BODY']['FONT-FAMILY'] = $font;
11022
  }
11023
 
11024
  function SetDefaultFontSize($fontsize) {
@@ -11026,13 +10712,13 @@ function SetDefaultFontSize($fontsize) {
11026
  $this->original_default_font_size = $fontsize;
11027
  $this->SetFontSize($fontsize);
11028
  $this->defaultCSS['BODY']['FONT-SIZE'] = $fontsize . 'pt';
11029
- $this->cssmgr->CSS['BODY']['FONT-SIZE'] = $fontsize . 'pt';
11030
  }
11031
 
11032
  function SetDefaultBodyCSS($prop, $val) {
11033
  if ($prop) {
11034
  $this->defaultCSS['BODY'][strtoupper($prop)] = $val;
11035
- $this->cssmgr->CSS['BODY'][strtoupper($prop)] = $val;
11036
  }
11037
  }
11038
 
@@ -11060,7 +10746,7 @@ function SetDirectionality($dir='ltr') {
11060
  $this->defaultAlign = 'L';
11061
  $this->defaultTableAlign = 'L';
11062
  } // *RTL*
11063
- $this->cssmgr->CSS['BODY']['DIRECTION'] = $this->directionality;
11064
  }
11065
 
11066
 
@@ -11136,16 +10822,15 @@ function GetFullPath(&$path,$basepath='') {
11136
  if (!$basepath) { $basepath = $this->basepath; }
11137
  //Fix path value
11138
  $path = str_replace("\\","/",$path); //If on Windows
11139
- $path = preg_replace('/^\/\//','http://',$path); // mPDF 5.6.27
11140
  $regexp = '|^./|'; // Inadvertently corrects "./path/etc" and "//www.domain.com/etc"
11141
  $path = preg_replace($regexp,'',$path);
11142
 
11143
-
11144
  if(substr($path,0,1) == '#') { return; }
11145
  if (stristr($path,"mailto:") !== false) { return; }
11146
  if (strpos($path,"../") !== false ) { //It is a Relative Link
11147
  $backtrackamount = substr_count($path,"../");
11148
- $maxbacktrack = substr_count($basepath,"/") - 3; // mPDF 5.6.18
11149
  $filepath = str_replace("../",'',$path);
11150
  $path = $basepath;
11151
  //If it is an invalid relative link, then make it go to directory root
@@ -11207,6 +10892,7 @@ function docPageNum($num = 0, $extras = false) {
11207
  $ppgno = $num;
11208
  $suppress = 0;
11209
  $offset = 0;
 
11210
  $lastreset = 0;
11211
  foreach($this->PageNumSubstitutions AS $psarr) {
11212
  if ($num >= $psarr['from']) {
@@ -11289,14 +10975,6 @@ function docPageNumTotal($num = 0, $extras = false) {
11289
  }
11290
  if ($suppress) { return ''; }
11291
  $ppgno = $ppgend-$ppgstart+$offset;
11292
-
11293
- // mPDF 5.6.47
11294
- foreach($this->pgsIns AS $k => $v) {
11295
- if ($k>$ppgstart && $k<$ppgend) {
11296
- $ppgno -= $v;
11297
- }
11298
- }
11299
-
11300
  if ($extras) { $ppgno = $this->nbpgPrefix . $ppgno . $this->nbpgSuffix; }
11301
  return $ppgno;
11302
  }
@@ -11369,7 +11047,7 @@ function Header($content='') {
11369
  if (isset($h[$side][$pos]['content']) && $h[$side][$pos]['content']) {
11370
  $hd = str_replace('{PAGENO}',$pgno,$h[$side][$pos]['content']);
11371
  $hd = str_replace($this->aliasNbPgGp,$this->nbpgPrefix.$this->aliasNbPgGp.$this->nbpgSuffix,$hd);
11372
- $hd = preg_replace_callback('/\{DATE\s+(.*?)\}/', array($this, 'date_callback') ,$hd); // mPDF 5.7
11373
  if (isset($h[$side][$pos]['font-family']) && $h[$side][$pos]['font-family']) { $hff = $h[$side][$pos]['font-family']; }
11374
  else { $hff = $this->original_default_font; }
11375
  if (isset($h[$side][$pos]['font-size']) && $h[$side][$pos]['font-size']) { $hfsz = $h[$side][$pos]['font-size']; }
@@ -11440,7 +11118,7 @@ function Header($content='') {
11440
 
11441
  /*-- TABLES --*/
11442
  function TableHeaderFooter($content='',$tablestartpage='',$tablestartcolumn ='',$horf = 'H',$level, $firstSpread=true, $finalSpread=true) {
11443
- if(($horf=='H' || $horf=='F') && !empty($content) && !empty($content[0])) { // mPDF 5.6.61
11444
  $table = &$this->table[1][1];
11445
  // Advance down page by half width of top border
11446
 
@@ -12073,7 +11751,7 @@ function _getHtmlHeight($html) {
12073
  $html = str_replace('{PAGENO}',$this->pagenumPrefix.$this->docPageNum($this->page).$this->pagenumSuffix,$html);
12074
  $html = str_replace($this->aliasNbPgGp,$this->nbpgPrefix.$this->docPageNumTotal($this->page).$this->nbpgSuffix,$html );
12075
  $html = str_replace($this->aliasNbPg,$this->page,$html );
12076
- $html = preg_replace_callback('/\{DATE\s+(.*?)\}/', array($this, 'date_callback') ,$html ); // mPDF 5.7
12077
  $this->HTMLheaderPageLinks = array();
12078
  $this->HTMLheaderPageAnnots = array();
12079
  $this->HTMLheaderPageForms = array();
@@ -12508,7 +12186,7 @@ function Footer() {
12508
  if (isset($h[$side][$pos]['content']) && $h[$side][$pos]['content']) {
12509
  $hd = str_replace('{PAGENO}',$pgno,$h[$side][$pos]['content']);
12510
  $hd = str_replace($this->aliasNbPgGp,$this->nbpgPrefix.$this->aliasNbPgGp.$this->nbpgSuffix,$hd);
12511
- $hd = preg_replace_callback('/\{DATE\s+(.*?)\}/', array($this, 'date_callback') ,$hd); // mPDF 5.7
12512
  if (isset($h[$side][$pos]['font-family']) && $h[$side][$pos]['font-family']) { $hff = $h[$side][$pos]['font-family']; }
12513
  else { $hff = $this->original_default_font; }
12514
  if (isset($h[$side][$pos]['font-size']) && $h[$side][$pos]['font-size']) { $hfsz = $h[$side][$pos]['font-size']; }
@@ -12571,12 +12249,13 @@ function Footer() {
12571
 
12572
  }
12573
 
 
 
12574
  ///////////////////
12575
  // HYPHENATION
12576
  ///////////////////
12577
- // mPDF 5.6.21
12578
- // Hard hyphens
12579
- function hardHyphenate($word, $maxWidth) {
12580
  // Don't hyphenate web addresses
12581
  if (preg_match('/^(http:|www\.)/',$word)) { return array(false,'','',''); }
12582
 
@@ -12592,11 +12271,12 @@ function hardHyphenate($word, $maxWidth) {
12592
  $wl = mb_strlen($word,'UTF-8');
12593
  }
12594
  while($offset < $wl) {
 
12595
  if (!$this->usingCoreFont) {
12596
- $p = mb_strpos($word, "-", $offset, 'UTF-8');
12597
  }
12598
  else if ($this->FontFamily!='csymbol' && $this->FontFamily!='czapfdingbats') {
12599
- $p = strpos($word, "-", $offset);
12600
  }
12601
  if ($p !== false) { $poss[] = $p - count($poss); }
12602
  else { break; }
@@ -12623,89 +12303,34 @@ function hardHyphenate($word, $maxWidth) {
12623
  return array($success,$pre,$post,$prelength);
12624
  }
12625
 
12626
-
12627
- /*-- HYPHENATION --*/
12628
- ///////////////////
12629
- ///////////////////
12630
- // HYPHENATION
12631
  ///////////////////
12632
- // Soft hyphs
12633
- function softHyphenate($word, $maxWidth) {
 
12634
  // Don't hyphenate web addresses
12635
  if (preg_match('/^(http:|www\.)/',$word)) { return array(false,'','',''); }
12636
 
 
12637
  // Get dictionary
12638
- $poss = array();
12639
- $softhyphens = array();
12640
- $offset = 0;
12641
- $p = true;
12642
- if ($this->usingCoreFont) {
12643
- $wl = strlen($word);
12644
- }
12645
- else {
12646
- $wl = mb_strlen($word,'UTF-8');
12647
- }
12648
- while($offset < $wl) {
12649
- // Soft Hyphens chr(173)
12650
- if (!$this->usingCoreFont) {
12651
- $p = mb_strpos($word, "\xc2\xad", $offset, 'UTF-8');
12652
- }
12653
- else if ($this->FontFamily!='csymbol' && $this->FontFamily!='czapfdingbats') {
12654
- $p = strpos($word, chr(173), $offset);
12655
- }
12656
- if ($p !== false) { $poss[] = $p; }
12657
- else { break; }
12658
- $offset = $p+1;
12659
- }
12660
- $success = false;
12661
- foreach($poss AS $i) {
12662
- if ($this->usingCoreFont) {
12663
- $a = substr($word,0,$i);
12664
- if ($this->GetStringWidth($a.'-') > $maxWidth) { break ; }
12665
- $pre = $a;
12666
- $post = substr($word,$i,strlen($word));
12667
- $prelength = strlen($pre);
12668
- }
12669
- else {
12670
- $a = mb_substr($word,0,$i,'UTF-8');
12671
- if ($this->GetStringWidth($a.'-') > $maxWidth) { break ; }
12672
- $pre = $a;
12673
- $post = mb_substr($word,$i,mb_strlen($word,'UTF-8'),'UTF-8');
12674
- $prelength = mb_strlen($pre, 'UTF-8');
12675
- }
12676
- $success = true;
12677
- }
12678
- return array($success,$pre,$post,$prelength);
12679
- }
12680
-
12681
- ///////////////////
12682
- // Word hyphenation
12683
- function hyphenateWord($word, $maxWidth) {
12684
- // Do everything inside this function in utf-8
12685
- // Don't hyphenate web addresses
12686
- if (preg_match('/^(http:|www\.)/',$word)) { return array(false,'','',''); }
12687
-
12688
-
12689
- // Get dictionary
12690
- if (!$this->loadedSHYdictionary) {
12691
- if (file_exists(_MPDF_PATH.'patterns/dictionary.txt')) {
12692
- $this->SHYdictionary = file(_MPDF_PATH.'patterns/dictionary.txt',FILE_SKIP_EMPTY_LINES);
12693
- foreach($this->SHYdictionary as $entry) {
12694
- $entry = trim($entry);
12695
- $poss = array();
12696
- $offset = 0;
12697
- $p = true;
12698
- $wl = mb_strlen($entry ,'UTF-8');
12699
- while($offset < $wl) {
12700
- $p = mb_strpos($entry, '/', $offset, 'UTF-8');
12701
- if ($p !== false) { $poss[] = $p - count($poss); }
12702
- else { break; }
12703
- $offset = $p+1;
12704
- }
12705
- if (count($poss)) { $this->SHYdictionaryWords[str_replace('/', '', mb_strtolower($entry))] = $poss; }
12706
- }
12707
- }
12708
- $this->loadedSHYdictionary = true;
12709
  }
12710
 
12711
  if (!in_array($this->SHYlang,$this->SHYlanguages)) { return array(false,'','',''); }
@@ -12855,12 +12480,8 @@ function WriteHTML($html,$sub=0,$init=true,$close=true) {
12855
  if ($sub < 2) {
12856
  $this->ReadMetaTags($html);
12857
 
12858
- // mPDF 5.6.18
12859
- if (preg_match('/<base[^>]*href=["\']([^"\'>]*)["\']/i', $html, $m)) {
12860
- $this->SetBasePath($m[1]);
12861
- }
12862
  // NB default stylesheet now in mPDF.css - read on initialising class
12863
- $html = $this->cssmgr->ReadCSS($html);
12864
 
12865
  if ($this->useLang && !$this->usingCoreFont && preg_match('/<html [^>]*lang=[\'\"](.*?)[\'\"]/ism',$html,$m)) {
12866
  $html_lang = $m[1];
@@ -12875,7 +12496,7 @@ function WriteHTML($html,$sub=0,$init=true,$close=true) {
12875
  $html = $m[2];
12876
  // Changed to allow style="background: url('bg.jpg')"
12877
  if (preg_match('/style=[\"](.*?)[\"]/ism',$m[1],$mm) || preg_match('/style=[\'](.*?)[\']/ism',$m[1],$mm)) {
12878
- $zproperties = $this->cssmgr->readInlineCSS($mm[1]);
12879
  }
12880
  if (preg_match('/dir=[\'\"]\s*rtl\s*[\'\"]/ism',$m[1])) {
12881
  $zproperties['DIRECTION'] = 'rtl';
@@ -12887,22 +12508,22 @@ function WriteHTML($html,$sub=0,$init=true,$close=true) {
12887
 
12888
  }
12889
  }
12890
- $properties = $this->cssmgr->MergeCSS('BLOCK','BODY','');
12891
- if ($zproperties) { $properties = $this->cssmgr->array_merge_recursive_unique($properties,$zproperties); }
12892
 
12893
  if (isset($properties['DIRECTION']) && $properties['DIRECTION']) {
12894
- $this->cssmgr->CSS['BODY']['DIRECTION'] = $properties['DIRECTION'];
12895
  }
12896
- if (!isset($this->cssmgr->CSS['BODY']['DIRECTION'])) {
12897
- $this->cssmgr->CSS['BODY']['DIRECTION'] = $this->directionality;
12898
  }
12899
- else { $this->SetDirectionality($this->cssmgr->CSS['BODY']['DIRECTION']); }
12900
 
12901
  $this->setCSS($properties,'','BODY');
12902
  $this->blk[0]['InlineProperties'] = $this->saveInlineProperties();
12903
 
12904
  if ($sub == 1) { return ''; }
12905
- if (!isset($this->cssmgr->CSS['BODY'])) { $this->cssmgr->CSS['BODY'] = array(); }
12906
 
12907
  /*-- BACKGROUNDS --*/
12908
  if (isset($properties['BACKGROUND-GRADIENT'])) {
@@ -12917,7 +12538,7 @@ function WriteHTML($html,$sub=0,$init=true,$close=true) {
12917
 
12918
  /*-- CSS-PAGE --*/
12919
  // If page-box is set
12920
- if ($this->state==0 && isset($this->cssmgr->CSS['@PAGE']) && $this->cssmgr->CSS['@PAGE'] ) {
12921
  $this->page_box['current'] = '';
12922
  $this->page_box['using'] = true;
12923
  list($pborientation,$pbmgl,$pbmgr,$pbmgt,$pbmgb,$pbmgh,$pbmgf,$hname,$fname,$bg,$resetpagenum,$pagenumstyle,$suppress,$marks,$newformat) = $this->SetPagedMediaCSS('', false, 'O');
@@ -12953,7 +12574,7 @@ function WriteHTML($html,$sub=0,$init=true,$close=true) {
12953
  $this->bufferoutput = true;
12954
  $this->textbuffer=array();
12955
  $this->headerbuffer='';
12956
- $properties = $this->cssmgr->MergeCSS('BLOCK','BODY','');
12957
  $this->setCSS($properties,'','BODY');
12958
  }
12959
 
@@ -13052,31 +12673,26 @@ function WriteHTML($html,$sub=0,$init=true,$close=true) {
13052
  }
13053
  // CONVERT ENCODING
13054
  $e = mb_convert_encoding($e,$this->mb_enc,'UTF-8');
13055
- // mPDF 5.6.41
13056
- if ($this->toupper) { $e = mb_strtoupper($e,$this->mb_enc); }
13057
- if ($this->tolower) { $e = mb_strtolower($e,$this->mb_enc); }
13058
- if ($this->capitalize) { $e = mb_convert_case($e, MB_CASE_TITLE, "UTF-8"); }
13059
  }
13060
  else {
13061
  if ($this->checkSIP && $this->CurrentFont['sipext'] && $this->subPos<$i && !$this->specialcontent) {
13062
  $cnt += $this->SubstituteCharsSIP($a, $i, $e);
13063
  }
13064
-
13065
  if ($this->useSubstitutions && !$this->onlyCoreFonts && $this->CurrentFont['type']!='Type0' && $this->subPos<$i && !$this->specialcontent) {
13066
- // mPDF 5.6.62 removes U+200E/U+200F LTR and RTL mark and U+200C/U+200D Zero-width Joiner and Non-joiner
13067
- $e = preg_replace("/[\xe2\x80\x8c\xe2\x80\x8d\xe2\x80\x8e\xe2\x80\x8f]/u",'',$e);
13068
  $cnt += $this->SubstituteCharsMB($a, $i, $e);
13069
  }
13070
- if ($this->biDirectional) { // *RTL*
13071
- // mPDF 5.7+
13072
- $e = preg_replace_callback("/([".$this->pregRTLchars."]+)/u", array($this, 'arabJoinPregCallback'), $e ); // *RTL*
 
 
13073
  } // *RTL*
13074
  // Font-specific ligature substitution for Indic fonts
13075
  if (isset($this->CurrentFont['indic']) && $this->CurrentFont['indic']) $this->ConvertIndic($e); // *INDIC*
13076
 
13077
- // mPDF 5.6.62 removes U+200E/U+200F LTR and RTL mark and U+200C/U+200D Zero-width Joiner and Non-joiner
13078
- $e = preg_replace("/[\xe2\x80\x8c\xe2\x80\x8d\xe2\x80\x8e\xe2\x80\x8f]/u",'',$e);
13079
-
13080
  if ($this->toupper) { $e = mb_strtoupper($e,$this->mb_enc); }
13081
  if ($this->tolower) { $e = mb_strtolower($e,$this->mb_enc); }
13082
  if ($this->capitalize) { $e = mb_convert_case($e, MB_CASE_TITLE, "UTF-8"); }
@@ -13152,27 +12768,6 @@ function WriteHTML($html,$sub=0,$init=true,$close=true) {
13152
 
13153
  if ($this->checkCJK && preg_match("/([".$this->pregCJKchars."])/u", $e)) { $this->tableCJK = true; } // *CJK-FONTS*
13154
 
13155
- // mPDF 5.6.13 Decimal mark alignment
13156
- if (substr($this->cell[$this->row][$this->col]['a'],0,1) == 'D') {
13157
- $dp = $this->decimal_align[substr($this->cell[$this->row][$this->col]['a'],0,2)];
13158
- $s = preg_split('/'.preg_quote($dp,'/').'/', $e, 2); // ? needs to be /u if not core
13159
- $s0 = $this->GetStringWidth($s[0], false);
13160
- if ($s[1]) { $s1 = $this->GetStringWidth(($s[1].$dp), false); }
13161
- else $s1 = 0;
13162
- if (!isset($this->table[$this->tableLevel][$this->tbctr[$this->tableLevel]]['decimal_align'][$this->col]['maxs0'])) {
13163
- $this->table[$this->tableLevel][$this->tbctr[$this->tableLevel]]['decimal_align'][$this->col]['maxs0'] = $s0;
13164
- }
13165
- else {
13166
- $this->table[$this->tableLevel][$this->tbctr[$this->tableLevel]]['decimal_align'][$this->col]['maxs0'] = max($s0, $this->table[$this->tableLevel][$this->tbctr[$this->tableLevel]]['decimal_align'][$this->col]['maxs0']);
13167
- }
13168
- if (!isset($this->table[$this->tableLevel][$this->tbctr[$this->tableLevel]]['decimal_align'][$this->col]['maxs1'])) {
13169
- $this->table[$this->tableLevel][$this->tbctr[$this->tableLevel]]['decimal_align'][$this->col]['maxs1'] = $s1;
13170
- }
13171
- else {
13172
- $this->table[$this->tableLevel][$this->tbctr[$this->tableLevel]]['decimal_align'][$this->col]['maxs1'] = max($s1, $this->table[$this->tableLevel][$this->tbctr[$this->tableLevel]]['decimal_align'][$this->col]['maxs1']);
13173
- }
13174
- }
13175
-
13176
  if ($this->tableLevel==1 && $this->useGraphs) {
13177
  $this->graphs[$this->currentGraphId]['data'][$this->row][$this->col] = $e;
13178
  }
@@ -13273,8 +12868,8 @@ function WriteHTML($html,$sub=0,$init=true,$close=true) {
13273
  /*-- END CSS-POSITION --*/
13274
  $regexp = '|=\'(.*?)\'|s'; // eliminate single quotes, if any
13275
  $e = preg_replace($regexp,"=\"\$1\"",$e);
13276
- // changes anykey=anyvalue to anykey="anyvalue" (only do this inside [some] tags)
13277
- if (substr($e,0,10)!='pageheader' && substr($e,0,10)!='pagefooter' && substr($e,0,12)!='tocpagebreak') { // mPDF 5.6.69
13278
  $regexp = '| (\\w+?)=([^\\s>"]+)|si';
13279
  $e = preg_replace($regexp," \$1=\"\$2\"",$e);
13280
  }
@@ -13303,9 +12898,8 @@ function WriteHTML($html,$sub=0,$init=true,$close=true) {
13303
  $contents2=array();
13304
  // Changed to allow style="background: url('bg.jpg')"
13305
  // mPDF 5.5.17 Changed to improve performance; maximum length of \S (attribute) = 16
13306
- // mPDF 5.6.30 Increase allowed attribute name to 32 - cutting off "toc-even-header-name" etc.
13307
- preg_match_all('/\\S{1,32}=["][^"]*["]/',$e,$contents1);
13308
- preg_match_all('/\\S{1,32}=[\'][^\']*[\']/i',$e,$contents2);
13309
 
13310
  $contents = array_merge($contents1, $contents2);
13311
  preg_match('/\\S+/',$e,$a2);
@@ -13474,15 +13068,15 @@ function WriteFixedPosHTML($html='',$x, $y, $w, $h, $overflow='visible', $boundi
13474
 
13475
  $this->blk[0]['blockContext'] = $this->blockContext;
13476
 
13477
- $properties = $this->cssmgr->MergeCSS('BLOCK','BODY','');
13478
  $this->setCSS($properties,'','BODY');
13479
  $this->blklvl = 1;
13480
  $this->initialiseBlock($this->blk[1]);
13481
  $this->blk[1]['tag'] = $tag;
13482
  $this->blk[1]['attr'] = $attr;
13483
  $this->Reset();
13484
- $p = $this->cssmgr->MergeCSS('BLOCK',$tag,$attr);
13485
- if (isset($p['ROTATE']) && ($p['ROTATE']==90 || $p['ROTATE']==-90 || $p['ROTATE'] == 180 || $p['ROTATE'] == -180) ) { $rotate = $p['ROTATE']; }
13486
  else { $rotate = 0; }
13487
  if (isset($p['OVERFLOW'])) { $overflow = strtolower($p['OVERFLOW']); }
13488
  if (strtolower($p['POSITION']) == 'fixed') {
@@ -13509,6 +13103,7 @@ function WriteFixedPosHTML($html='',$x, $y, $w, $h, $overflow='visible', $boundi
13509
  if (isset($p['FONT-WEIGHT'])) { $css .= 'font-weight: '.strtolower($p['FONT-WEIGHT']).'; '; }
13510
  if (isset($p['FONT-SIZE'])) { $css .= 'font-size: '.strtolower($p['FONT-SIZE']).'; '; }
13511
  if (isset($p['LINE-HEIGHT'])) { $css .= 'line-height: '.strtolower($p['LINE-HEIGHT']).'; '; }
 
13512
  if (isset($p['TEXT-SHADOW'])) { $css .= 'text-shadow: '.strtolower($p['TEXT-SHADOW']).'; '; }
13513
  if (isset($p['LETTER-SPACING'])) { $css .= 'letter-spacing: '.strtolower($p['LETTER-SPACING']).'; '; }
13514
  if (isset($p['FONT-VARIANT'])) { $css .= 'font-variant: '.strtolower($p['FONT-VARIANT']).'; '; }
@@ -13540,7 +13135,7 @@ function WriteFixedPosHTML($html='',$x, $y, $w, $h, $overflow='visible', $boundi
13540
  $pb['BORDER-BOTTOM-RIGHT-RADIUS-H'] = $p['BORDER-BOTTOM-RIGHT-RADIUS-H'];
13541
  $pb['BORDER-BOTTOM-RIGHT-RADIUS-V'] = $p['BORDER-BOTTOM-RIGHT-RADIUS-V'];
13542
  if (isset($p['BACKGROUND-COLOR'])) { $pb['BACKGROUND-COLOR'] = $p['BACKGROUND-COLOR']; }
13543
- if (isset($p['BOX-SHADOW'])) { $pb['BOX-SHADOW'] = $p['BOX-SHADOW']; }
13544
  /*-- BACKGROUNDS --*/
13545
  if (isset($p['BACKGROUND-IMAGE'])) { $pb['BACKGROUND-IMAGE'] = $p['BACKGROUND-IMAGE']; }
13546
  if (isset($p['BACKGROUND-IMAGE-RESIZE'])) { $pb['BACKGROUND-IMAGE-RESIZE'] = $p['BACKGROUND-IMAGE-RESIZE']; }
@@ -13548,10 +13143,6 @@ function WriteFixedPosHTML($html='',$x, $y, $w, $h, $overflow='visible', $boundi
13548
  if (isset($p['BACKGROUND-REPEAT'])) { $pb['BACKGROUND-REPEAT'] = $p['BACKGROUND-REPEAT']; }
13549
  if (isset($p['BACKGROUND-POSITION'])) { $pb['BACKGROUND-POSITION'] = $p['BACKGROUND-POSITION']; }
13550
  if (isset($p['BACKGROUND-GRADIENT'])) { $pb['BACKGROUND-GRADIENT'] = $p['BACKGROUND-GRADIENT']; }
13551
- if (isset($p['BACKGROUND-SIZE'])) { $pb['BACKGROUND-SIZE'] = $p['BACKGROUND-SIZE']; } // mPDF 5.6.12
13552
- if (isset($p['BACKGROUND-ORIGIN'])) { $pb['BACKGROUND-ORIGIN'] = $p['BACKGROUND-ORIGIN']; } // mPDF 5.6.12
13553
- if (isset($p['BACKGROUND-CLIP'])) { $pb['BACKGROUND-CLIP'] = $p['BACKGROUND-CLIP']; } // mPDF 5.6.12
13554
-
13555
  /*-- END BACKGROUNDS --*/
13556
 
13557
  $this->setCSS($pb,'BLOCK',$tag);
@@ -13826,6 +13417,7 @@ function WriteFixedPosHTML($html='',$x, $y, $w, $h, $overflow='visible', $boundi
13826
  $inner_h = $h;
13827
 
13828
  }
 
13829
  $this->lMargin=$x;
13830
  $this->rMargin=$this->w - $w - $x;
13831
  // SET POSITION & FONT VALUES
@@ -14169,6 +13761,536 @@ function border_details($bd) {
14169
  }
14170
 
14171
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14172
 
14173
  /*-- END HTML-CSS --*/
14174
 
@@ -14180,36 +14302,594 @@ function fixLineheight($v) {
14180
  else if (strtoupper($v) == 'NORMAL') {
14181
  return $this->normalLineheight;
14182
  }
14183
- else {
14184
- $tlh = $this->ConvertSize($v,$this->FontSize,$this->FontSize,true);
14185
- if ($tlh) { return ($tlh.'mm'); }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14186
  }
14187
- return $this->normalLineheight;
14188
- }
14189
-
14190
-
14191
- /*-- BORDER-RADIUS --*/
14192
- function _borderPadding($a, $b, &$px, &$py) {
14193
- // $px and py are padding long axis (x) and short axis (y)
14194
- $added = 0; // extra padding
14195
-
14196
- $x = $a-$px;
14197
- $y = $b-$py;
14198
- // Check if Falls within ellipse of border radius
14199
- if ( ( (($x+$added)*($x+$added))/($a*$a) + (($y+$added)*($y+$added))/($b*$b) ) <=1 ) { return false; }
14200
-
14201
- $t = atan2($y,$x);
14202
-
14203
- $newx = $b / sqrt((($b*$b)/($a*$a)) + ( tan($t) * tan($t) ) );
14204
- $newy = $a / sqrt((($a*$a)/($b*$b)) + ( (1/tan($t)) * (1/tan($t)) ) );
14205
- $px = max($px, $a - $newx + $added);
14206
- $py = max($py, $b - $newy + $added);
14207
  }
14208
- /*-- END BORDER-RADIUS --*/
14209
-
14210
-
14211
-
14212
- /*-- HTML-CSS --*/
14213
 
14214
 
14215
  /*-- CSS-PAGE --*/
@@ -14235,7 +14915,7 @@ function SetPagedMediaCSS($name='', $first, $oddEven) {
14235
  $p['MARGIN-FOOTER'] = strval($this->orig_fMargin).'mm';
14236
 
14237
  // Basic page + selector
14238
- if (isset($this->cssmgr->CSS['@PAGE'])) { $zp = $this->cssmgr->CSS['@PAGE']; }
14239
  else { $zp = array(); }
14240
  if (is_array($zp) && !empty($zp)) { $p = array_merge($p,$zp); }
14241
 
@@ -14253,8 +14933,8 @@ function SetPagedMediaCSS($name='', $first, $oddEven) {
14253
  }
14254
 
14255
  // If right/Odd page
14256
- if (isset($this->cssmgr->CSS['@PAGE>>PSEUDO>>RIGHT']) && $side=='R') {
14257
- $zp = $this->cssmgr->CSS['@PAGE>>PSEUDO>>RIGHT'];
14258
  }
14259
  else { $zp = array(); }
14260
  if (isset($zp['SIZE'])) { unset($zp['SIZE']); }
@@ -14265,8 +14945,8 @@ function SetPagedMediaCSS($name='', $first, $oddEven) {
14265
  if (is_array($zp) && !empty($zp)) { $p = array_merge($p,$zp); }
14266
 
14267
  // If left/Even page
14268
- if (isset($this->cssmgr->CSS['@PAGE>>PSEUDO>>LEFT']) && $side=='L') {
14269
- $zp = $this->cssmgr->CSS['@PAGE>>PSEUDO>>LEFT'];
14270
  }
14271
  else { $zp = array(); }
14272
  if (isset($zp['SIZE'])) { unset($zp['SIZE']); }
@@ -14277,7 +14957,7 @@ function SetPagedMediaCSS($name='', $first, $oddEven) {
14277
  if (is_array($zp) && !empty($zp)) { $p = array_merge($p,$zp); }
14278
 
14279
  // If first page
14280
- if (isset($this->cssmgr->CSS['@PAGE>>PSEUDO>>FIRST']) && $first) { $zp = $this->cssmgr->CSS['@PAGE>>PSEUDO>>FIRST']; }
14281
  else { $zp = array(); }
14282
  if (isset($zp['SIZE'])) { unset($zp['SIZE']); }
14283
  if (isset($zp['SHEET-SIZE'])) { unset($zp['SHEET-SIZE']); }
@@ -14285,7 +14965,7 @@ function SetPagedMediaCSS($name='', $first, $oddEven) {
14285
 
14286
  // If named page
14287
  if ($name) {
14288
- if (isset($this->cssmgr->CSS['@PAGE>>NAMED>>'.$name])) { $zp = $this->cssmgr->CSS['@PAGE>>NAMED>>'.$name]; }
14289
  else { $zp = array(); }
14290
  if (is_array($zp) && !empty($zp)) { $p = array_merge($p,$zp); }
14291
 
@@ -14303,7 +14983,7 @@ function SetPagedMediaCSS($name='', $first, $oddEven) {
14303
  }
14304
 
14305
  // If named right/Odd page
14306
- if (isset($this->cssmgr->CSS['@PAGE>>NAMED>>'.$name.'>>PSEUDO>>RIGHT']) && $side=='R') { $zp = $this->cssmgr->CSS['@PAGE>>NAMED>>'.$name.'>>PSEUDO>>RIGHT']; }
14307
  else { $zp = array(); }
14308
  if (isset($zp['SIZE'])) { unset($zp['SIZE']); }
14309
  if (isset($zp['SHEET-SIZE'])) { unset($zp['SHEET-SIZE']); }
@@ -14313,7 +14993,7 @@ function SetPagedMediaCSS($name='', $first, $oddEven) {
14313
  if (is_array($zp) && !empty($zp)) { $p = array_merge($p,$zp); }
14314
 
14315
  // If named left/Even page
14316
- if (isset($this->cssmgr->CSS['@PAGE>>NAMED>>'.$name.'>>PSEUDO>>LEFT']) && $side=='L') { $zp = $this->cssmgr->CSS['@PAGE>>NAMED>>'.$name.'>>PSEUDO>>LEFT']; }
14317
  else { $zp = array(); }
14318
  if (isset($zp['SIZE'])) { unset($zp['SIZE']); }
14319
  if (isset($zp['SHEET-SIZE'])) { unset($zp['SHEET-SIZE']); }
@@ -14323,7 +15003,7 @@ function SetPagedMediaCSS($name='', $first, $oddEven) {
14323
  if (is_array($zp) && !empty($zp)) { $p = array_merge($p,$zp); }
14324
 
14325
  // If named first page
14326
- if (isset($this->cssmgr->CSS['@PAGE>>NAMED>>'.$name.'>>PSEUDO>>FIRST']) && $first) { $zp = $this->cssmgr->CSS['@PAGE>>NAMED>>'.$name.'>>PSEUDO>>FIRST']; }
14327
  else { $zp = array(); }
14328
  if (isset($zp['SIZE'])) { unset($zp['SIZE']); }
14329
  if (isset($zp['SHEET-SIZE'])) { unset($zp['SHEET-SIZE']); }
@@ -14421,6 +15101,80 @@ function SetPagedMediaCSS($name='', $first, $oddEven) {
14421
  }
14422
  /*-- END CSS-PAGE --*/
14423
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14424
 
14425
 
14426
  /*-- CSS-FLOAT --*/
@@ -14532,20 +15286,6 @@ function OpenTag($tag,$attr)
14532
  $objattr['border_bottom']['w'] = 0;
14533
  $objattr['border_left']['w'] = 0;
14534
  $objattr['border_right']['w'] = 0;
14535
-
14536
- // mPDF 5.6.19
14537
- $properties = $this->cssmgr->MergeCSS('INLINE',$tag,$attr); // mPDF 5.6.33
14538
- if (isset($properties['OUTDENT'])) { // mPDF 5.6.33
14539
- $objattr['outdent'] = $this->ConvertSize($properties['OUTDENT'],$this->blk[$this->blklvl]['inner_width'],$this->FontSize,false);
14540
- }
14541
- else if (isset($attr['OUTDENT'])) {
14542
- $objattr['outdent'] = $this->ConvertSize($attr['OUTDENT'],$this->blk[$this->blklvl]['inner_width'],$this->FontSize,false);
14543
- }
14544
- else { $objattr['outdent'] = 0; }
14545
-
14546
- $objattr['fontfamily'] = $this->FontFamily;
14547
- $objattr['fontsize'] = $this->FontSizePt;
14548
-
14549
  $e = "\xbb\xa4\xactype=dottab,objattr=".serialize($objattr)."\xbb\xa4\xac";
14550
  /*-- TABLES --*/
14551
  // Output it to buffers
@@ -14592,8 +15332,8 @@ function OpenTag($tag,$attr)
14592
  }
14593
 
14594
  if (isset($attr['HEADER-STYLE']) || isset($attr['FOOTER-STYLE'])) { // font-family,size,weight,style,color
14595
- if ($tag=='PAGEHEADER') { $properties = $this->cssmgr->readInlineCSS($attr['HEADER-STYLE']); }
14596
- else { $properties = $this->cssmgr->readInlineCSS($attr['FOOTER-STYLE']); }
14597
  if (isset($properties['FONT-FAMILY'])) {
14598
  $p['L']['font-family'] = $properties['FONT-FAMILY'];
14599
  $p['C']['font-family'] = $properties['FONT-FAMILY'];
@@ -14621,8 +15361,8 @@ function OpenTag($tag,$attr)
14621
  }
14622
  }
14623
  if (isset($attr['HEADER-STYLE-LEFT']) || isset($attr['FOOTER-STYLE-LEFT'])) {
14624
- if ($tag=='PAGEHEADER') { $properties = $this->cssmgr->readInlineCSS($attr['HEADER-STYLE-LEFT']); }
14625
- else { $properties = $this->cssmgr->readInlineCSS($attr['FOOTER-STYLE-LEFT']); }
14626
  if (isset($properties['FONT-FAMILY'])) { $p['L']['font-family'] = $properties['FONT-FAMILY']; }
14627
  if (isset($properties['FONT-SIZE'])) { $p['L']['font-size'] = $this->ConvertSize($properties['FONT-SIZE']) * _MPDFK; }
14628
  if (isset($properties['FONT-WEIGHT']) && $properties['FONT-WEIGHT']=='bold') { $p['L']['font-style'] ='B'; }
@@ -14630,8 +15370,8 @@ function OpenTag($tag,$attr)
14630
  if (isset($properties['COLOR'])) { $p['L']['color'] = $properties['COLOR']; }
14631
  }
14632
  if (isset($attr['HEADER-STYLE-CENTER']) || isset($attr['FOOTER-STYLE-CENTER'])) {
14633
- if ($tag=='PAGEHEADER') { $properties = $this->cssmgr->readInlineCSS($attr['HEADER-STYLE-CENTER']); }
14634
- else { $properties = $this->cssmgr->readInlineCSS($attr['FOOTER-STYLE-CENTER']); }
14635
  if (isset($properties['FONT-FAMILY'])) { $p['C']['font-family'] = $properties['FONT-FAMILY']; }
14636
  if (isset($properties['FONT-SIZE'])) { $p['C']['font-size'] = $this->ConvertSize($properties['FONT-SIZE']) * _MPDFK; }
14637
  if (isset($properties['FONT-WEIGHT']) && $properties['FONT-WEIGHT']=='bold') { $p['C']['font-style'] = 'B'; }
@@ -14639,8 +15379,8 @@ function OpenTag($tag,$attr)
14639
  if (isset($properties['COLOR'])) { $p['C']['color'] = $properties['COLOR']; }
14640
  }
14641
  if (isset($attr['HEADER-STYLE-RIGHT']) || isset($attr['FOOTER-STYLE-RIGHT'])) {
14642
- if ($tag=='PAGEHEADER') { $properties = $this->cssmgr->readInlineCSS($attr['HEADER-STYLE-RIGHT']); }
14643
- else { $properties = $this->cssmgr->readInlineCSS($attr['FOOTER-STYLE-RIGHT']); }
14644
  if (isset($properties['FONT-FAMILY'])) { $p['R']['font-family'] = $properties['FONT-FAMILY']; }
14645
  if (isset($properties['FONT-SIZE'])) { $p['R']['font-size'] = $this->ConvertSize($properties['FONT-SIZE']) * _MPDFK; }
14646
  if (isset($properties['FONT-WEIGHT']) && $properties['FONT-WEIGHT']=='bold') { $p['R']['font-style'] = 'B'; }
@@ -14791,6 +15531,7 @@ function OpenTag($tag,$attr)
14791
  }
14792
  else { $newformat = ''; }
14793
 
 
14794
  $mgr = $mgl = $mgt = $mgb = $mgh = $mgf = '';
14795
  if (isset($attr['MARGIN-RIGHT'])) { $mgr = $this->ConvertSize($attr['MARGIN-RIGHT'],$this->w,$this->FontSize,false); }
14796
  if (isset($attr['MARGIN-LEFT'])) { $mgl = $this->ConvertSize($attr['MARGIN-LEFT'],$this->w,$this->FontSize,false); }
@@ -14937,19 +15678,18 @@ function OpenTag($tag,$attr)
14937
 
14938
 
14939
  case 'WATERMARKIMAGE':
14940
- if (isset($attr['ORIG_SRC'])) { $src = $attr['ORIG_SRC']; } else { $src = ''; }
14941
  if (isset($attr['ALPHA']) && $attr['ALPHA']>0) { $alpha = $attr['ALPHA']; } else { $alpha = -1; }
14942
  if (isset($attr['SIZE']) && $attr['SIZE']) {
14943
  $size = $attr['SIZE'];
14944
  if (strpos($size,',')) { $size = explode(',',$size); }
14945
  }
14946
  else { $size = 'D'; }
14947
- if (isset($attr['POSITION']) && $attr['POSITION']) {
14948
- $pos = $attr['POSITION'];
14949
  if (strpos($pos,',')) { $pos = explode(',',$pos); }
14950
  }
14951
  else { $pos = 'P'; }
14952
-
14953
  $this->SetWatermarkImage($src, $alpha, $size, $pos);
14954
  break;
14955
  /*-- END WATERMARK --*/
@@ -15151,7 +15891,7 @@ function OpenTag($tag,$attr)
15151
  if (!isset($this->InlineProperties[$tag])) $this->InlineProperties[$tag] = $this->saveInlineProperties(); // mPDF 5.4.13
15152
  if (isset($annot)) { $this->InlineAnnots[$tag] = $annot; } // *ANNOTATIONS*
15153
  }
15154
- $properties = $this->cssmgr->MergeCSS('INLINE',$tag,$attr);
15155
  if (!empty($properties)) $this->setCSS($properties,'INLINE');
15156
  break;
15157
 
@@ -15177,7 +15917,7 @@ function OpenTag($tag,$attr)
15177
  }
15178
  if (isset($attr['HREF'])) {
15179
  $this->InlineProperties['A'] = $this->saveInlineProperties();
15180
- $properties = $this->cssmgr->MergeCSS('',$tag,$attr);
15181
  if (!empty($properties)) $this->setCSS($properties,'INLINE');
15182
  $this->HREF=htmlspecialchars_decode(urldecode($attr['HREF']));
15183
  }
@@ -15185,7 +15925,7 @@ function OpenTag($tag,$attr)
15185
 
15186
  case 'LEGEND': // mPDF 5.4.18
15187
  $this->InlineProperties['LEGEND'] = $this->saveInlineProperties();
15188
- $properties = $this->cssmgr->MergeCSS('',$tag,$attr);
15189
  if (!empty($properties)) $this->setCSS($properties,'INLINE');
15190
  break;
15191
 
@@ -15238,7 +15978,7 @@ function OpenTag($tag,$attr)
15238
  $objattr['border_left']['w'] = 0;
15239
  $objattr['border_right']['w'] = 0;
15240
 
15241
- $properties = $this->cssmgr->MergeCSS('',$tag,$attr);
15242
  if(isset($properties ['DISPLAY']) && strtolower($properties ['DISPLAY'])=='none') {
15243
  return;
15244
  }
@@ -15269,11 +16009,10 @@ function OpenTag($tag,$attr)
15269
  $w = 0;
15270
  $h = 0;
15271
  if(isset($properties['WIDTH'])) $w = $this->ConvertSize($properties['WIDTH'],$this->blk[$this->blklvl]['inner_width'],$this->FontSize,false);
15272
- else if(isset($attr['WIDTH'])) $w = $this->ConvertSize($attr['WIDTH'],$this->blk[$this->blklvl]['inner_width'],$this->FontSize,false);
15273
-
15274
  if(isset($properties['HEIGHT'])) $h = $this->ConvertSize($properties['HEIGHT'],$this->blk[$this->blklvl]['inner_width'],$this->FontSize,false);
15275
- else if(isset($attr['HEIGHT'])) $h = $this->ConvertSize($attr['HEIGHT'],$this->blk[$this->blklvl]['inner_width'],$this->FontSize,false);
15276
 
 
 
15277
  if (isset($properties['OPACITY']) && $properties['OPACITY'] > 0 && $properties['OPACITY'] <= 1) { $objattr['opacity'] = $properties['OPACITY']; }
15278
  if ($this->HREF) {
15279
  if (strpos($this->HREF,".") === false && strpos($this->HREF,"@") !== 0) {
@@ -15361,7 +16100,7 @@ function OpenTag($tag,$attr)
15361
  case 'BR':
15362
  // Added mPDF 3.0 Float DIV - CLEAR
15363
  if (isset($attr['STYLE'])) {
15364
- $properties = $this->cssmgr->readInlineCSS($attr['STYLE']);
15365
  if (isset($properties['CLEAR'])) { $this->ClearFloats(strtoupper($properties['CLEAR']),$this->blklvl); } // *CSS-FLOAT*
15366
  }
15367
 
@@ -15435,7 +16174,7 @@ function OpenTag($tag,$attr)
15435
  case 'HGROUP':
15436
  case 'NAV':
15437
  case 'SECTION':
15438
- $p = $this->cssmgr->PreviewBlockCSS($tag,$attr);
15439
  if(isset($p['DISPLAY']) && strtolower($p['DISPLAY'])=='none') {
15440
  $this->blklvl++;
15441
  $this->blk[$this->blklvl]['hide'] = true;
@@ -15512,7 +16251,7 @@ function OpenTag($tag,$attr)
15512
  if ($tag == 'CENTER' && $this->tdbegin) { $this->cell[$this->row][$this->col]['a'] = $align['center']; }
15513
 
15514
  $this->InlineProperties['BLOCKINTABLE'] = $this->saveInlineProperties();
15515
- $properties = $this->cssmgr->MergeCSS('',$tag,$attr);
15516
  if (!empty($properties)) $this->setCSS($properties,'INLINE');
15517
 
15518
 
@@ -15544,7 +16283,7 @@ function OpenTag($tag,$attr)
15544
  $currblk['attr'] = $attr;
15545
 
15546
  $this->Reset();
15547
- $properties = $this->cssmgr->MergeCSS('BLOCK',$tag,$attr);
15548
  $pagesel = '';
15549
  /*-- CSS-PAGE --*/
15550
 
@@ -15592,7 +16331,7 @@ function OpenTag($tag,$attr)
15592
  $this->blk[0]['width'] =& $this->pgwidth;
15593
  $this->blk[0]['inner_width'] =& $this->pgwidth;
15594
  $this->blk[0]['blockContext'] = $this->blockContext;
15595
- $properties = $this->cssmgr->MergeCSS('BLOCK','BODY','');
15596
  $this->setCSS($properties,'','BODY');
15597
  $this->blklvl++;
15598
  $currblk =& $this->blk[$this->blklvl];
@@ -15603,7 +16342,7 @@ function OpenTag($tag,$attr)
15603
  $currblk['attr'] = $attr;
15604
 
15605
  $this->Reset();
15606
- $properties = $this->cssmgr->MergeCSS('BLOCK',$tag,$attr);
15607
  }
15608
  /*-- COLUMNS --*/
15609
  if ($save_cols) {
@@ -15960,7 +16699,7 @@ function OpenTag($tag,$attr)
15960
  case 'HR':
15961
  // Added mPDF 3.0 Float DIV - CLEAR
15962
  if (isset($attr['STYLE'])) {
15963
- $properties = $this->cssmgr->readInlineCSS($attr['STYLE']);
15964
  if (isset($properties['CLEAR'])) { $this->ClearFloats(strtoupper($properties['CLEAR']),$this->blklvl); } // *CSS-FLOAT*
15965
  }
15966
 
@@ -15977,13 +16716,11 @@ function OpenTag($tag,$attr)
15977
  $objattr['border_bottom']['w'] = 0;
15978
  $objattr['border_left']['w'] = 0;
15979
  $objattr['border_right']['w'] = 0;
15980
- $properties = $this->cssmgr->MergeCSS('',$tag,$attr);
15981
  if (isset($properties['MARGIN-TOP'])) { $objattr['margin_top'] = $this->ConvertSize($properties['MARGIN-TOP'],$this->blk[$this->blklvl]['inner_width'],$this->FontSize,false); }
15982
  if (isset($properties['MARGIN-BOTTOM'])) { $objattr['margin_bottom'] = $this->ConvertSize($properties['MARGIN-BOTTOM'],$this->blk[$this->blklvl]['inner_width'],$this->FontSize,false); }
15983
  if (isset($properties['WIDTH'])) { $objattr['width'] = $this->ConvertSize($properties['WIDTH'],$this->blk[$this->blklvl]['inner_width']); }
15984
- else if(isset($attr['WIDTH']) && $attr['WIDTH'] != '') $objattr['width'] = $this->ConvertSize($attr['WIDTH'],$this->blk[$this->blklvl]['inner_width']);
15985
  if (isset($properties['TEXT-ALIGN'])) { $objattr['align'] = $align[strtolower($properties['TEXT-ALIGN'])]; }
15986
- else if(isset($attr['ALIGN']) && $attr['ALIGN'] != '') $objattr['align'] = $align[strtolower($attr['ALIGN'])];
15987
 
15988
  if (isset($properties['MARGIN-LEFT']) && strtolower($properties['MARGIN-LEFT'])=='auto') {
15989
  $objattr['align'] = 'R';
@@ -15995,9 +16732,11 @@ function OpenTag($tag,$attr)
15995
  }
15996
  }
15997
  if (isset($properties['COLOR'])) { $objattr['color'] = $this->ConvertColor($properties['COLOR']); }
15998
- else if(isset($attr['COLOR']) && $attr['COLOR'] != '') $objattr['color'] = $this->ConvertColor($attr['COLOR']);
15999
  if (isset($properties['HEIGHT'])) { $objattr['linewidth'] = $this->ConvertSize($properties['HEIGHT'],$this->blk[$this->blklvl]['inner_width'],$this->FontSize,false); }
16000
 
 
 
 
16001
 
16002
  /*-- TABLES --*/
16003
  if ($this->tableLevel) {
@@ -16083,7 +16822,7 @@ function OpenTag($tag,$attr)
16083
  else { $objattr['bheight'] = 1; }
16084
  if(isset($attr['PR']) && $attr['PR']>0) { $objattr['pr_ratio'] = $attr['PR']; }
16085
  else { $objattr['pr_ratio'] = ''; }
16086
- $properties = $this->cssmgr->MergeCSS('',$tag,$attr);
16087
  if(isset($properties ['DISPLAY']) && strtolower($properties ['DISPLAY'])=='none') {
16088
  return;
16089
  }
@@ -16199,7 +16938,7 @@ function OpenTag($tag,$attr)
16199
  case 'SELECT':
16200
  $this->lastoptionaltag = ''; // Save current HTML specified optional endtag
16201
  $this->InlineProperties[$tag] = $this->saveInlineProperties();
16202
- $properties = $this->cssmgr->MergeCSS('',$tag,$attr);
16203
  if (isset($properties['FONT-FAMILY'])) {
16204
  $this->SetFont($properties['FONT-FAMILY'],$this->FontStyle,0,false);
16205
  }
@@ -16279,7 +17018,7 @@ function OpenTag($tag,$attr)
16279
  if (isset($attr['ONFORMAT'])) { $objattr['onFormat'] = $attr['ONFORMAT']; }
16280
  }
16281
  $this->InlineProperties[$tag] = $this->saveInlineProperties();
16282
- $properties = $this->cssmgr->MergeCSS('',$tag,$attr);
16283
  if (isset($properties['FONT-FAMILY'])) {
16284
  $this->SetFont($properties['FONT-FAMILY'],'',0,false);
16285
  }
@@ -16291,8 +17030,8 @@ function OpenTag($tag,$attr)
16291
  $objattr['fontfamily'] = $this->FontFamily;
16292
  $objattr['fontsize'] = $this->FontSizePt;
16293
  if ($this->useActiveForms) {
16294
- if(isset($properties['TEXT-ALIGN'])) { $objattr['text_align'] = $align[strtolower($properties['TEXT-ALIGN'])]; }
16295
- else if(isset($attr['ALIGN'])) { $objattr['text_align'] = $align[strtolower($attr['ALIGN'])]; }
16296
  if (isset($properties['OVERFLOW']) && strtolower($properties['OVERFLOW'])=='hidden') { $objattr['donotscroll'] = true; }
16297
  if (isset($properties['BORDER-TOP-COLOR'])) { $objattr['border-col'] = $this->ConvertColor($properties['BORDER-TOP-COLOR']); }
16298
  if (isset($properties['BACKGROUND-COLOR'])) { $objattr['background-col'] = $this->ConvertColor($properties['BACKGROUND-COLOR']); }
@@ -16372,7 +17111,7 @@ function OpenTag($tag,$attr)
16372
  }
16373
 
16374
  $this->InlineProperties[$tag] = $this->saveInlineProperties();
16375
- $properties = $this->cssmgr->MergeCSS('',$tag,$attr);
16376
  $objattr['vertical-align'] = '';
16377
 
16378
  if (isset($properties['FONT-FAMILY'])) {
@@ -16686,7 +17425,7 @@ function OpenTag($tag,$attr)
16686
  if(isset($attr['SRC'])) {
16687
  $srcpath = $attr['SRC'];
16688
  $orig_srcpath = $attr['ORIG_SRC'];
16689
- $properties = $this->cssmgr->MergeCSS('',$tag,$attr);
16690
  if(isset($properties ['DISPLAY']) && strtolower($properties ['DISPLAY'])=='none') {
16691
  return;
16692
  }
@@ -16726,20 +17465,16 @@ function OpenTag($tag,$attr)
16726
  $w = 0;
16727
  $h = 0;
16728
  if(isset($properties['WIDTH'])) $w = $this->ConvertSize($properties['WIDTH'],$this->blk[$this->blklvl]['inner_width'],$this->FontSize,false);
16729
- else if(isset($attr['WIDTH'])) $w = $this->ConvertSize($attr['WIDTH'],$this->blk[$this->blklvl]['inner_width'],$this->FontSize,false);
16730
  if(isset($properties['HEIGHT'])) $h = $this->ConvertSize($properties['HEIGHT'],$this->blk[$this->blklvl]['inner_width'],$this->FontSize,false);
16731
- else if(isset($attr['HEIGHT'])) $h = $this->ConvertSize($attr['HEIGHT'],$this->blk[$this->blklvl]['inner_width'],$this->FontSize,false);
16732
- // mPDF 5.5.15 // mPDF 5.6.60
16733
  $maxw=$maxh=$minw=$minh=false;
16734
  if(isset($properties['MAX-WIDTH'])) $maxw = $this->ConvertSize($properties['MAX-WIDTH'],$this->blk[$this->blklvl]['inner_width'],$this->FontSize,false);
16735
- else if(isset($attr['MAX-WIDTH'])) $maxw = $this->ConvertSize($attr['MAX-WIDTH'],$this->blk[$this->blklvl]['inner_width'],$this->FontSize,false);
16736
  if(isset($properties['MAX-HEIGHT'])) $maxh = $this->ConvertSize($properties['MAX-HEIGHT'],$this->blk[$this->blklvl]['inner_width'],$this->FontSize,false);
16737
- else if(isset($attr['MAX-HEIGHT'])) $maxh = $this->ConvertSize($attr['MAX-HEIGHT'],$this->blk[$this->blklvl]['inner_width'],$this->FontSize,false);
16738
  if(isset($properties['MIN-WIDTH'])) $minw = $this->ConvertSize($properties['MIN-WIDTH'],$this->blk[$this->blklvl]['inner_width'],$this->FontSize,false);
16739
- else if(isset($attr['MIN-WIDTH'])) $minw = $this->ConvertSize($attr['MIN-WIDTH'],$this->blk[$this->blklvl]['inner_width'],$this->FontSize,false);
16740
  if(isset($properties['MIN-HEIGHT'])) $minh = $this->ConvertSize($properties['MIN-HEIGHT'],$this->blk[$this->blklvl]['inner_width'],$this->FontSize,false);
16741
- else if(isset($attr['MIN-HEIGHT'])) $minh = $this->ConvertSize($attr['MIN-HEIGHT'],$this->blk[$this->blklvl]['inner_width'],$this->FontSize,false);
16742
 
 
 
16743
  if (isset($properties['OPACITY']) && $properties['OPACITY'] > 0 && $properties['OPACITY'] <= 1) { $objattr['opacity'] = $properties['OPACITY']; }
16744
  if ($this->HREF) {
16745
  if (strpos($this->HREF,".") === false && strpos($this->HREF,"@") !== 0) {
@@ -16946,7 +17681,7 @@ function OpenTag($tag,$attr)
16946
  $objattr['char-width'] = 100;
16947
 
16948
  $this->InlineProperties[$tag] = $this->saveInlineProperties();
16949
- $properties = $this->cssmgr->MergeCSS('INLINE',$tag,$attr);
16950
 
16951
  if(isset($properties ['DISPLAY']) && strtolower($properties ['DISPLAY'])=='none') {
16952
  return;
@@ -17103,7 +17838,7 @@ function OpenTag($tag,$attr)
17103
  $this->table[$this->tableLevel][$this->tbctr[$this->tableLevel]]['currcol'] = $this->col;
17104
  }
17105
  $this->tableLevel++;
17106
- $this->cssmgr->tbCSSlvl++;
17107
 
17108
  if ($this->tableLevel>1) { // inherit table properties from cell in which nested
17109
  $this->base_table_properties['FONT-KERNING'] = $this->kerning ;
@@ -17169,7 +17904,7 @@ function OpenTag($tag,$attr)
17169
  $table['a'] = false;
17170
  $table['border_spacing_H'] = false;
17171
  $table['border_spacing_V'] = false;
17172
- $table['decimal_align'] = false; // mPDF 5.6.13
17173
  $this->Reset();
17174
  $this->InlineProperties = array();
17175
  $this->spanlvl = 0;
@@ -17193,32 +17928,23 @@ function OpenTag($tag,$attr)
17193
  }
17194
 
17195
  // ADDED CSS FUNCIONS FOR TABLE
17196
- if ($this->cssmgr->tbCSSlvl==1) {
17197
- $properties = $this->cssmgr->MergeCSS('TOPTABLE',$tag,$attr);
17198
  }
17199
  else {
17200
- $properties = $this->cssmgr->MergeCSS('TABLE',$tag,$attr);
17201
  }
17202
  $w = '';
17203
  if (isset($properties['WIDTH'])) { $w = $properties['WIDTH']; }
17204
- else if (isset($attr['WIDTH']) && $attr['WIDTH']) { $w = $attr['WIDTH']; }
17205
-
17206
 
17207
  if(isset($properties['DIRECTION']) && $properties['DIRECTION']) { $table['direction'] = strtolower($properties['DIRECTION']); }
17208
- else if(isset($attr['DIR']) && $attr['DIR']) { $table['direction'] = strtolower($attr['DIR']); }
17209
  else if (!isset($table['direction'])){ $table['direction'] = $this->blk[$this->blklvl]['direction']; }
17210
 
17211
  if (isset($properties['BACKGROUND-COLOR'])) { $table['bgcolor'][-1] = $properties['BACKGROUND-COLOR']; }
17212
  else if (isset($properties['BACKGROUND'])) { $table['bgcolor'][-1] = $properties['BACKGROUND']; }
17213
- else if (isset($attr['BGCOLOR'])) { $table['bgcolor'][-1] = $attr['BGCOLOR']; }
17214
  if (isset($properties['VERTICAL-ALIGN'])) { $table['va'] = $align[strtolower($properties['VERTICAL-ALIGN'])]; }
17215
  if (isset($properties['TEXT-ALIGN'])) { $table['txta'] = $align[strtolower($properties['TEXT-ALIGN'])]; }
17216
- if (isset($attr['ALIGN'])) { $table['a'] = $align[strtolower($attr['ALIGN'])]; }
17217
- if (!$table['a']) {
17218
- if ($table['direction'] == 'rtl' ) { $table['a'] = 'R'; }
17219
- else { $table['a'] = 'L'; }
17220
- }
17221
-
17222
  if (isset($properties['AUTOSIZE']) && $properties['AUTOSIZE'] && $this->tableLevel ==1) {
17223
  $this->shrink_this_table_to_fit = $properties['AUTOSIZE'];
17224
  if ($this->shrink_this_table_to_fit < 1) { $this->shrink_this_table_to_fit = 0; }
@@ -17362,10 +18088,6 @@ function OpenTag($tag,$attr)
17362
  $table['borders_separate'] = false;
17363
  }
17364
 
17365
- if (!$table['borders_separate']) { $table['border_spacing_H'] = $table['border_spacing_V'] = 0; }
17366
- else if (isset($attr['CELLSPACING'])) {
17367
- $table['border_spacing_H'] = $table['border_spacing_V'] = $this->ConvertSize($attr['CELLSPACING'],$this->blk[$this->blklvl]['inner_width']);
17368
- }
17369
  if (isset($properties['BORDER-SPACING-H'])) {
17370
  $table['border_spacing_H'] = $this->ConvertSize($properties['BORDER-SPACING-H'],$this->blk[$this->blklvl]['inner_width'],$this->FontSize,false);
17371
  }
@@ -17404,6 +18126,10 @@ function OpenTag($tag,$attr)
17404
 
17405
  $properties = array();
17406
 
 
 
 
 
17407
 
17408
 
17409
  if (isset($attr['CELLPADDING'])) {
@@ -17427,8 +18153,15 @@ function OpenTag($tag,$attr)
17427
  else {
17428
  $this->table_border_attr_set = 0;
17429
  }
 
 
 
 
 
 
17430
 
17431
- if ($w) {
 
17432
  $maxwidth = $this->blk[$this->blklvl]['inner_width'];
17433
  if ($table['borders_separate']) {
17434
  $tblblw = $table['margin']['L'] + $table['margin']['R'] + $table['border_details']['L']['w']/2 + $table['border_details']['R']['w']/2;
@@ -17497,10 +18230,10 @@ function OpenTag($tag,$attr)
17497
 
17498
  case 'THEAD':
17499
  $this->lastoptionaltag = $tag; // Save current HTML specified optional endtag
17500
- $this->cssmgr->tbCSSlvl++;
17501
  $this->tablethead = 1;
17502
  $this->tabletfoot = 0;
17503
- $properties = $this->cssmgr->MergeCSS('TABLE',$tag,$attr);
17504
  if (isset($properties['FONT-WEIGHT'])) {
17505
  if (strtoupper($properties['FONT-WEIGHT']) == 'BOLD') { $this->thead_font_weight = 'B'; }
17506
  else { $this->thead_font_weight = ''; }
@@ -17526,10 +18259,10 @@ function OpenTag($tag,$attr)
17526
 
17527
  case 'TFOOT':
17528
  $this->lastoptionaltag = $tag; // Save current HTML specified optional endtag
17529
- $this->cssmgr->tbCSSlvl++;
17530
  $this->tabletfoot = 1;
17531
  $this->tablethead = 0;
17532
- $properties = $this->cssmgr->MergeCSS('TABLE',$tag,$attr);
17533
  if (isset($properties['FONT-WEIGHT'])) {
17534
  if (strtoupper($properties['FONT-WEIGHT']) == 'BOLD') { $this->tfoot_font_weight = 'B'; }
17535
  else { $this->tfoot_font_weight = ''; }
@@ -17558,18 +18291,18 @@ function OpenTag($tag,$attr)
17558
  $this->tablethead = 0;
17559
  $this->tabletfoot = 0;
17560
  $this->lastoptionaltag = $tag; // Save current HTML specified optional endtag
17561
- $this->cssmgr->tbCSSlvl++;
17562
- $this->cssmgr->MergeCSS('TABLE',$tag,$attr);
17563
  break;
17564
 
17565
 
17566
  case 'TR':
17567
  $this->lastoptionaltag = $tag; // Save current HTML specified optional endtag
17568
- $this->cssmgr->tbCSSlvl++;
17569
  $this->row++;
17570
  $this->table[$this->tableLevel][$this->tbctr[$this->tableLevel]]['nr']++;
17571
  $this->col = -1;
17572
- $properties = $this->cssmgr->MergeCSS('TABLE',$tag,$attr);
17573
 
17574
  if (!$this->simpleTables && (!isset($this->table[$this->tableLevel][$this->tbctr[$this->tableLevel]]['borders_separate']) || !$this->table[$this->tableLevel][$this->tbctr[$this->tableLevel]]['borders_separate'])) {
17575
  if (isset($properties['BORDER-LEFT']) && $properties['BORDER-LEFT']) { $this->table[$this->tableLevel][$this->tbctr[$this->tableLevel]]['trborder-left'][$this->row] = $properties['BORDER-LEFT']; }
@@ -17579,7 +18312,6 @@ function OpenTag($tag,$attr)
17579
  }
17580
 
17581
  if (isset($properties['BACKGROUND-COLOR'])) { $this->table[$this->tableLevel][$this->tbctr[$this->tableLevel]]['bgcolor'][$this->row] = $properties['BACKGROUND-COLOR']; }
17582
- else if (isset($attr['BGCOLOR'])) $this->table[$this->tableLevel][$this->tbctr[$this->tableLevel]]['bgcolor'][$this->row] = $attr['BGCOLOR'];
17583
 
17584
  /*-- BACKGROUNDS --*/
17585
  if (isset($properties['BACKGROUND-GRADIENT']) && !$this->kwt && !$this->ColActive) { $this->table[$this->tableLevel][$this->tbctr[$this->tableLevel]]['trgradients'][$this->row] = $properties['BACKGROUND-GRADIENT']; }
@@ -17591,11 +18323,14 @@ function OpenTag($tag,$attr)
17591
  /*-- END BACKGROUNDS --*/
17592
 
17593
 
 
 
17594
  if (isset($properties['TEXT-ROTATE'])) {
17595
  $this->trow_text_rotate = $properties['TEXT-ROTATE'];
17596
  }
17597
  if (isset($attr['TEXT-ROTATE'])) $this->trow_text_rotate = $attr['TEXT-ROTATE'];
17598
 
 
17599
  if ($this->tablethead) { $this->table[$this->tableLevel][$this->tbctr[$this->tableLevel]]['is_thead'][$this->row] = true; }
17600
  if ($this->tabletfoot) { $this->table[$this->tableLevel][$this->tbctr[$this->tableLevel]]['is_tfoot'][$this->row] = true; }
17601
  $properties = array();
@@ -17606,7 +18341,7 @@ function OpenTag($tag,$attr)
17606
  case 'TD':
17607
  $this->ignorefollowingspaces = true;
17608
  $this->lastoptionaltag = $tag; // Save current HTML specified optional endtag
17609
- $this->cssmgr->tbCSSlvl++;
17610
  $this->InlineProperties = array();
17611
  $this->spanlvl = 0;
17612
  $this->tdbegin = true;
@@ -17725,8 +18460,8 @@ function OpenTag($tag,$attr)
17725
  $this->cell_border_dominance_T = 0;
17726
  $this->cell_border_dominance_B = 0;
17727
 
17728
- $properties = $this->cssmgr->MergeCSS('TABLE',$tag,$attr);
17729
- $properties = $this->cssmgr->array_merge_recursive_unique($this->base_table_properties, $properties);
17730
 
17731
  if (isset($properties['FONT-KERNING']) && (strtoupper($properties['FONT-KERNING'])=='NORMAL' || strtoupper($properties['FONT-KERNING'])=='AUTO')) {
17732
  $this->kerning = true;
@@ -17749,18 +18484,9 @@ function OpenTag($tag,$attr)
17749
  $this->minwSpacing = 0;
17750
  $this->wSpacingCSS = '';
17751
  }
17752
- // mPDF 5.6.08
17753
- if (isset($properties['HYPHENS']) && $properties['HYPHENS']) {
17754
- if (strtoupper($properties['HYPHENS']) == 'NONE') { $this->textparam['hyphens'] = 2; }
17755
- else if (strtoupper($properties['HYPHENS']) == 'AUTO') { $this->textparam['hyphens'] = 1; }
17756
- else if (strtoupper($properties['HYPHENS']) == 'MANUAL') { $this->textparam['hyphens'] = 0; }
17757
- }
17758
 
17759
  if (isset($properties['BACKGROUND-COLOR'])) { $c['bgcolor'] = $properties['BACKGROUND-COLOR']; }
17760
  else if (isset($properties['BACKGROUND'])) { $c['bgcolor'] = $properties['BACKGROUND']; }
17761
- else if (isset($attr['BGCOLOR'])) $c['bgcolor'] = $attr['BGCOLOR'];
17762
-
17763
-
17764
 
17765
  /*-- BACKGROUNDS --*/
17766
  if (isset($properties['BACKGROUND-GRADIENT'])) { $c['gradient'] = $properties['BACKGROUND-GRADIENT']; }
@@ -17771,34 +18497,9 @@ function OpenTag($tag,$attr)
17771
  if ($ret) { $c['background-image'] = $ret; }
17772
  }
17773
  /*-- END BACKGROUNDS --*/
17774
- if (isset($properties['VERTICAL-ALIGN'])) { $c['va']=$align[strtolower($properties['VERTICAL-ALIGN'])]; }
17775
- else if (isset($attr['VALIGN'])) $c['va'] = $align[strtolower($attr['VALIGN'])];
17776
-
17777
-
17778
- // mPDF 5.6.13
17779
- if (isset($properties['TEXT-ALIGN']) && $properties['TEXT-ALIGN']) {
17780
- if (substr($properties['TEXT-ALIGN'],0,1)=='D') { $c['a'] = $properties['TEXT-ALIGN']; }
17781
- else { $c['a'] = $align[strtolower($properties['TEXT-ALIGN'])]; }
17782
- }
17783
- // mPDF 5.6.13
17784
- if (isset($attr['ALIGN']) && $attr['ALIGN']) {
17785
- if (strtolower($attr['ALIGN']) == 'char') {
17786
- if (isset($attr['CHAR']) && $attr['CHAR']) {
17787
- $char = html_entity_decode($attr['CHAR']);
17788
- $char = strcode2utf($char);
17789
- $d = array_search($char,$this->decimal_align);
17790
- if ($d !== false) { $c['a'] = $d.'R'; }
17791
- }
17792
- else { $c['a'] = 'DPR'; }
17793
- }
17794
- else { $c['a'] = $align[strtolower($attr['ALIGN'])]; }
17795
- }
17796
-
17797
- if (!$c['a']) {
17798
- if (isset($table['direction']) && $table['direction'] == 'rtl' ) { $c['a'] = 'R'; }
17799
- else { $c['a'] = 'L'; }
17800
- }
17801
 
 
 
17802
 
17803
  if (isset($properties['TEXT-ROTATE']) && ($properties['TEXT-ROTATE'] || $properties['TEXT-ROTATE']==="0")){
17804
  $c['R'] = $properties['TEXT-ROTATE'];
@@ -17899,15 +18600,13 @@ function OpenTag($tag,$attr)
17899
 
17900
  $w = '';
17901
  if (isset($properties['WIDTH'])) { $w = $properties['WIDTH']; }
17902
- else if (isset($attr['WIDTH'])) { $w = $attr['WIDTH']; }
17903
  if ($w) {
17904
  if (strpos($w,'%') && !$this->ignore_table_percents ) { $c['wpercent'] = $w + 0; } // makes 80% -> 80
17905
  else if (!strpos($w,'%') && !$this->ignore_table_widths ) { $c['w'] = $this->ConvertSize($w,$this->blk[$this->blklvl]['inner_width'],$this->FontSize,false); }
17906
  }
17907
 
17908
  if (isset($properties['HEIGHT']) && !strpos($properties['HEIGHT'],'%')) { $c['h'] = $this->ConvertSize($properties['HEIGHT'],$this->blk[$this->blklvl]['inner_width'],$this->FontSize,false); }
17909
- else if (isset($attr['HEIGHT']) && !strpos($attr['HEIGHT'],'%')) $c['h'] = $this->ConvertSize($attr['HEIGHT'],$this->blk[$this->blklvl]['inner_width'],$this->FontSize,false);
17910
-
17911
 
17912
  if (isset($properties['COLOR'])) {
17913
  $cor = $this->ConvertColor($properties['COLOR']);
@@ -17940,7 +18639,7 @@ function OpenTag($tag,$attr)
17940
  else if (strtoupper($properties['TEXT-DECORATION']) == 'UNDERLINE') { $this->SetStyle('U',true); }
17941
  }
17942
  if (isset($properties['TEXT-SHADOW'])) {
17943
- $ts = $this->cssmgr->setCSStextshadow($properties['TEXT-SHADOW']);
17944
  if ($ts) { $this->textshadow = $ts; }
17945
  }
17946
  if (isset($properties['TEXT-TRANSFORM'])) {
@@ -17953,6 +18652,19 @@ function OpenTag($tag,$attr)
17953
  }
17954
  $properties = array();
17955
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17956
  if (isset($attr['TEXT-ROTATE'])) {
17957
  $c['R'] = $attr['TEXT-ROTATE'];
17958
  }
@@ -17994,7 +18706,7 @@ function OpenTag($tag,$attr)
17994
 
17995
  $this->linebreakjustfinished=false;
17996
  $this->lastoptionaltag = ''; // Save current HTML specified optional endtag
17997
- $this->cssmgr->listCSSlvl++;
17998
  if((!$this->tableLevel) && ($this->listlvl == 0)) {
17999
  $blockstate = 0;
18000
  //if ($this->lastblocklevelchange == 1) { $blockstate = -1; } // Top margins/padding only
@@ -18027,9 +18739,7 @@ function OpenTag($tag,$attr)
18027
  $this->listlist[$this->listlvl]['MAXNUM'] = $this->listnum; //save previous lvl's maxnum
18028
  }
18029
  $this->listlvl++;
18030
- // mPDF 5.6.15
18031
- if (isset($attr['START'])) { $this->listnum = intval($attr['START']); }
18032
- else { $this->listnum = 0; }
18033
  $this->listlist[$this->listlvl] = array('TYPE'=>$this->listtype,'MAXNUM'=>$this->listnum);
18034
  break;
18035
  }
@@ -18040,23 +18750,23 @@ function OpenTag($tag,$attr)
18040
  if (($this->PDFA && !$this->PDFAauto) || ($this->PDFX && !$this->PDFXauto)) { $this->PDFAXwarnings[] = "List bullets cannot use core font Zapfdingbats in PDFA1-b or PDFX/1-a. (Substitute characters from current font used if available, otherwise substitutes hyphen '-')"; }
18041
  }
18042
 
18043
- if ($this->cssmgr->listCSSlvl==1) {
18044
- $properties = $this->cssmgr->MergeCSS('TOPLIST',$tag,$attr);
18045
  }
18046
  else {
18047
- $properties = $this->cssmgr->MergeCSS('LIST',$tag,$attr);
18048
  }
18049
  if (!empty($properties)) $this->setCSS($properties,'LIST');
18050
  // List-type
18051
 
18052
  $this->listtype = '';
18053
- if (isset($properties['LIST-STYLE-TYPE'])) {
 
18054
  $this->listtype = $this->_getListStyle($properties['LIST-STYLE-TYPE']);
18055
  }
18056
  else if (isset($properties['LIST-STYLE'])) {
18057
  $this->listtype = $this->_getListStyle($properties['LIST-STYLE']);
18058
  }
18059
- else if (isset($attr['TYPE']) && $attr['TYPE']) { $this->listtype = $attr['TYPE']; }
18060
  if (!$this->listtype) {
18061
  if ($tag == 'OL') $this->listtype = '1';
18062
  if ($tag == 'UL') {
@@ -18068,9 +18778,7 @@ function OpenTag($tag,$attr)
18068
  if ($this->listlvl == 0) {
18069
  $this->inherit_lineheight = 0;
18070
  $this->listlvl++; // first depth level
18071
- // mPDF 5.6.15
18072
- if (isset($attr['START'])) { $this->listnum = intval($attr['START']); }
18073
- else { $this->listnum = 0; }
18074
  $this->listDir = (isset($this->blk[$this->blklvl]['direction']) ? $this->blk[$this->blklvl]['direction'] : null);
18075
  $occur = $this->listoccur[$this->listlvl] = 1;
18076
  $this->listlist[$this->listlvl][1] = array('TYPE'=>$this->listtype,'MAXNUM'=>$this->listnum);
@@ -18086,9 +18794,7 @@ function OpenTag($tag,$attr)
18086
  $occur = $this->listoccur[$this->listlvl];
18087
  $this->listlist[$this->listlvl][$occur]['MAXNUM'] = $this->listnum; //save previous lvl's maxnum
18088
  $this->listlvl++;
18089
- // mPDF 5.6.15
18090
- if (isset($attr['START'])) { $this->listnum = intval($attr['START']); }
18091
- else { $this->listnum = 0; }
18092
 
18093
 
18094
  if (!isset($this->listoccur[$this->listlvl]) || $this->listoccur[$this->listlvl] == 0) $this->listoccur[$this->listlvl] = 1;
@@ -18117,7 +18823,7 @@ function OpenTag($tag,$attr)
18117
  }
18118
 
18119
  if (isset($properties['DIRECTION']) && $properties['DIRECTION']) { $this->listDir = strtolower($properties['DIRECTION']); }
18120
- else if (isset($attr['DIR']) && $attr['DIR']) { $this->listDir = strtolower($attr['DIR']); }
18121
 
18122
  }
18123
  $this->list_indent[$this->listlvl][$occur] = 5; // mm default indent for each level
@@ -18234,19 +18940,19 @@ function OpenTag($tag,$attr)
18234
  }
18235
  $this->listjustfinished = false;
18236
 
18237
- $this->cssmgr->listCSSlvl++;
18238
- $properties = $this->cssmgr->MergeCSS('LIST',$tag,$attr);
18239
  if (!empty($properties)) $this->setCSS($properties,'LIST');
18240
  $this->InlineProperties['LISTITEM'][$this->listlvl][$this->listoccur[$this->listlvl]][$this->listnum] = $this->saveInlineProperties();
18241
 
18242
  // List-type
18243
- if (isset($properties['LIST-STYLE-TYPE'])) {
 
18244
  $this->listitemtype = $this->_getListStyle($properties['LIST-STYLE-TYPE']);
18245
  }
18246
  else if (isset($properties['LIST-STYLE'])) {
18247
  $this->listitemtype = $this->_getListStyle($properties['LIST-STYLE']);
18248
  }
18249
- else if (isset($attr['TYPE']) && $attr['TYPE']) { $this->listitemtype = $attr['TYPE']; }
18250
  else $this->listitemtype = '';
18251
  break;
18252
  /*-- END LISTS --*/
@@ -18429,41 +19135,6 @@ function CloseTag($tag)
18429
  if ($this->listlvl>0) { return; }
18430
  /*-- END LISTS --*/
18431
 
18432
- // mPDF 5.6.34
18433
- if (preg_match('/^H\d/',$tag) && !$this->tableLevel && !$this->writingToC) { // mPDF 5.6.38
18434
- if (isset($this->h2toc[$tag]) || isset($this->h2bookmarks[$tag])) {
18435
- $content = '';
18436
- if (count($this->textbuffer)==1) { $content = $this->textbuffer[0][0]; }
18437
- else {
18438
- for ($i=0;$i<count($this->textbuffer);$i++) {
18439
- if (substr($this->textbuffer[$i][0],0,3) != "\xbb\xa4\xac") { //inline object
18440
- $content .= $this->textbuffer[$i][0];
18441
- }
18442
- }
18443
- }
18444
- /*-- TOC --*/
18445
- if (isset($this->h2toc[$tag])) {
18446
- $objattr = array();
18447
- $objattr['type'] = 'toc';
18448
- $objattr['toclevel'] = $this->h2toc[$tag];
18449
- $objattr['CONTENT'] = htmlspecialchars($content); // mPDF 5.6.37
18450
- $e = "\xbb\xa4\xactype=toc,objattr=".serialize($objattr)."\xbb\xa4\xac";
18451
- array_unshift($this->textbuffer,array($e));
18452
- }
18453
- /*-- END TOC --*/
18454
- /*-- BOOKMARKS --*/
18455
- if (isset($this->h2bookmarks[$tag])) {
18456
- $objattr = array();
18457
- $objattr['type'] = 'bookmark';
18458
- $objattr['bklevel'] = $this->h2bookmarks[$tag];
18459
- $objattr['CONTENT'] = $content;
18460
- $e = "\xbb\xa4\xactype=toc,objattr=".serialize($objattr)."\xbb\xa4\xac";
18461
- array_unshift($this->textbuffer,array($e));
18462
- }
18463
- /*-- END BOOKMARKS --*/
18464
- }
18465
- }
18466
-
18467
  /*-- TABLES --*/
18468
  if($this->tableLevel) {
18469
  if ($this->linebreakjustfinished) { $this->blockjustfinished=false; }
@@ -18672,7 +19343,7 @@ function CloseTag($tag)
18672
  $this->blk[0]['width'] =& $this->pgwidth;
18673
  $this->blk[0]['inner_width'] =& $this->pgwidth;
18674
  $this->blk[0]['blockContext'] = $this->blockContext;
18675
- $properties = $this->cssmgr->MergeCSS('BLOCK','BODY','');
18676
  $this->setCSS($properties,'','BODY');
18677
  $this->blklvl++;
18678
  $currblk =& $this->blk[$this->blklvl];
@@ -18683,7 +19354,7 @@ function CloseTag($tag)
18683
  $currblk['attr'] = $attr;
18684
 
18685
  $this->Reset();
18686
- $properties = $this->cssmgr->MergeCSS('BLOCK',$tag,$attr);
18687
  }
18688
  /*-- COLUMNS --*/
18689
  if ($save_cols) {
@@ -18720,8 +19391,8 @@ function CloseTag($tag)
18720
 
18721
  if(($tag=='TH' or $tag=='TD') && $this->tableLevel) {
18722
  $this->lastoptionaltag = 'TR';
18723
- unset($this->cssmgr->tablecascadeCSS[$this->cssmgr->tbCSSlvl]);
18724
- $this->cssmgr->tbCSSlvl--;
18725
  if (!$this->tdbegin) { return; }
18726
  $this->tdbegin = false;
18727
  // Added for correct calculation of cell column width - otherwise misses the last line if not end </p> etc.
@@ -18785,22 +19456,22 @@ function CloseTag($tag)
18785
  }
18786
  }
18787
  $this->lastoptionaltag = '';
18788
- unset($this->cssmgr->tablecascadeCSS[$this->cssmgr->tbCSSlvl]);
18789
- $this->cssmgr->tbCSSlvl--;
18790
  $this->trow_text_rotate = '';
18791
  $this->tabletheadjustfinished = false;
18792
  }
18793
 
18794
  if($tag=='TBODY') {
18795
  $this->lastoptionaltag = '';
18796
- unset($this->cssmgr->tablecascadeCSS[$this->cssmgr->tbCSSlvl]);
18797
- $this->cssmgr->tbCSSlvl--;
18798
  }
18799
 
18800
  if($tag=='THEAD') {
18801
  $this->lastoptionaltag = '';
18802
- unset($this->cssmgr->tablecascadeCSS[$this->cssmgr->tbCSSlvl]);
18803
- $this->cssmgr->tbCSSlvl--;
18804
  $this->tablethead = 0;
18805
  $this->tabletheadjustfinished = true;
18806
  $this->ResetStyles();
@@ -18814,8 +19485,8 @@ function CloseTag($tag)
18814
 
18815
  if($tag=='TFOOT') {
18816
  $this->lastoptionaltag = '';
18817
- unset($this->cssmgr->tablecascadeCSS[$this->cssmgr->tbCSSlvl]);
18818
- $this->cssmgr->tbCSSlvl--;
18819
  $this->tabletfoot = 0;
18820
  $this->ResetStyles();
18821
  $this->tfoot_font_weight = '';
@@ -18830,8 +19501,8 @@ function CloseTag($tag)
18830
  if ($this->progressBar) { $this->UpdateProgressBar(1,'','TABLE'); } // *PROGRESS-BAR*
18831
  if ($this->progressBar) { $this->UpdateProgressBar(7,0,''); } // *PROGRESS-BAR*
18832
  $this->lastoptionaltag = '';
18833
- unset($this->cssmgr->tablecascadeCSS[$this->cssmgr->tbCSSlvl]);
18834
- $this->cssmgr->tbCSSlvl--;
18835
  $this->ignorefollowingspaces = true; //Eliminate exceeding left-side spaces
18836
  $this->table[$this->tableLevel][$this->tbctr[$this->tableLevel]]['cells'] = $this->cell;
18837
  $this->table[$this->tableLevel][$this->tbctr[$this->tableLevel]]['wc'] = array_pad(array(),$this->table[$this->tableLevel][$this->tbctr[$this->tableLevel]]['nc'],array('miw'=>0,'maw'=>0));
@@ -19427,8 +20098,8 @@ function CloseTag($tag)
19427
  $this->tableLevel=0;
19428
  $this->tbctr=array();
19429
  $this->innermostTableLevel=0;
19430
- $this->cssmgr->tbCSSlvl = 0;
19431
- $this->cssmgr->tablecascadeCSS = array();
19432
 
19433
  unset($this->cell);
19434
  $this->cell=array(); //array
@@ -19484,7 +20155,7 @@ function CloseTag($tag)
19484
  $this->blk[0]['width'] =& $this->pgwidth;
19485
  $this->blk[0]['inner_width'] =& $this->pgwidth;
19486
  $this->blk[0]['blockContext'] = $this->blockContext;
19487
- $properties = $this->cssmgr->MergeCSS('BLOCK','BODY','');
19488
  $this->setCSS($properties,'','BODY');
19489
  }
19490
 
@@ -19522,16 +20193,16 @@ function CloseTag($tag)
19522
 
19523
  if($tag=='LI') {
19524
  $this->lastoptionaltag = '';
19525
- unset($this->cssmgr->listcascadeCSS[$this->cssmgr->listCSSlvl]);
19526
- $this->cssmgr->listCSSlvl--;
19527
  if (isset($this->listoccur[$this->listlvl]) && isset($this->InlineProperties['LIST'][$this->listlvl][$this->listoccur[$this->listlvl]])) { $this->restoreInlineProperties($this->InlineProperties['LIST'][$this->listlvl][$this->listoccur[$this->listlvl]]); }
19528
  }
19529
 
19530
 
19531
  if(($tag=='UL') or ($tag=='OL')) {
19532
  $this->ignorefollowingspaces = true; //Eliminate exceeding left-side spaces
19533
- unset($this->cssmgr->listcascadeCSS[$this->cssmgr->listCSSlvl]);
19534
- $this->cssmgr->listCSSlvl--;
19535
 
19536
  $this->lastoptionaltag = '';
19537
  /*-- TABLES --*/
@@ -19587,8 +20258,8 @@ function CloseTag($tag)
19587
  }
19588
  if (isset($this->blk[$this->blklvl]['InlineProperties'])) { $this->restoreInlineProperties($this->blk[$this->blklvl]['InlineProperties']);}
19589
  $this->listjustfinished = true;
19590
- $this->cssmgr->listCSSlvl = 0;
19591
- $this->cssmgr->listcascadeCSS = array();
19592
  $this->blockjustfinished=true;
19593
  $this->lastblockbottommargin = $this->list_margin_bottom;
19594
  }
@@ -19945,53 +20616,11 @@ arabic-indic | bengali | cambodian | devanagari | gujarati | gurmukhi | kannada
19945
  /*-- END LISTS --*/
19946
 
19947
  function _saveTextBuffer($t, $link = '', $intlink = '') {
19948
- // $this->textbuffer[] = array($t,$link,$this->currentfontstyle,$this->colorarray,$this->currentfontfamily,$this->SUP,$this->SUB,$intlink,$this->strike,$this->textparam,$this->spanbgcolorarray,$this->currentfontsize,$this->ReqFontStyle,$this->kerning,$this->lSpacingCSS,$this->wSpacingCSS,$this->spanborddet, $this->textshadow);
19949
- // mPDF 5.6.14
19950
- $arr = array();
19951
- $arr[0] = $t;
19952
- if (isset($link) && $link) $arr[1] = $link;
19953
- $arr[2] = $this->currentfontstyle;
19954
- if (isset($this->colorarray) && $this->colorarray) $arr[3] = $this->colorarray;
19955
- $arr[4] = $this->currentfontfamily;
19956
- if (isset($this->SUP) && $this->SUP) $arr[5] = $this->SUP;
19957
- if (isset($this->SUB) && $this->SUB) $arr[6] = $this->SUB;
19958
- if (isset($intlink) && $intlink) $arr[7] = $intlink;
19959
- if (isset($this->strike) && $this->strike) $arr[8] = $this->strike;
19960
- if (isset($this->textparam) && $this->textparam) $arr[9] = $this->textparam;
19961
- if (isset($this->spanbgcolorarray) && $this->spanbgcolorarray) $arr[10] = $this->spanbgcolorarray;
19962
- $arr[11] = $this->currentfontsize;
19963
- if (isset($this->ReqFontStyle) && $this->ReqFontStyle) $arr[12] = $this->ReqFontStyle;
19964
- if (isset($this->kerning) && $this->kerning) $arr[13] = $this->kerning;
19965
- if (isset($this->lSpacingCSS) && $this->lSpacingCSS) $arr[14] = $this->lSpacingCSS;
19966
- if (isset($this->wSpacingCSS) && $this->wSpacingCSS) $arr[15] = $this->wSpacingCSS;
19967
- if (isset($this->spanborddet) && $this->spanborddet) $arr[16] = $this->spanborddet;
19968
- if (isset($this->textshadow) && $this->textshadow) $arr[17] = $this->textshadow;
19969
- $this->textbuffer[] = $arr;
19970
  }
19971
 
19972
  function _saveCellTextBuffer($t, $link = '', $intlink = '') {
19973
- // $this->cell[$this->row][$this->col]['textbuffer'][] = array($t,$link,$this->currentfontstyle,$this->colorarray,$this->currentfontfamily,$this->SUP,$this->SUB,$intlink,$this->strike,$this->textparam,$this->spanbgcolorarray,$this->currentfontsize,$this->ReqFontStyle,$this->kerning,$this->lSpacingCSS,$this->wSpacingCSS,$this->spanborddet, $this->textshadow);
19974
- // mPDF 5.6.14
19975
- $arr = array();
19976
- $arr[0] = $t;
19977
- if (isset($link) && $link) $arr[1] = $link;
19978
- $arr[2] = $this->currentfontstyle;
19979
- if (isset($this->colorarray) && $this->colorarray) $arr[3] = $this->colorarray;
19980
- $arr[4] = $this->currentfontfamily;
19981
- if (isset($this->SUP) && $this->SUP) $arr[5] = $this->SUP;
19982
- if (isset($this->SUB) && $this->SUB) $arr[6] = $this->SUB;
19983
- if (isset($intlink) && $intlink) $arr[7] = $intlink;
19984
- if (isset($this->strike) && $this->strike) $arr[8] = $this->strike;
19985
- if (isset($this->textparam) && $this->textparam) $arr[9] = $this->textparam;
19986
- if (isset($this->spanbgcolorarray) && $this->spanbgcolorarray) $arr[10] = $this->spanbgcolorarray;
19987
- $arr[11] = $this->currentfontsize;
19988
- if (isset($this->ReqFontStyle) && $this->ReqFontStyle) $arr[12] = $this->ReqFontStyle;
19989
- if (isset($this->kerning) && $this->kerning) $arr[13] = $this->kerning;
19990
- if (isset($this->lSpacingCSS) && $this->lSpacingCSS) $arr[14] = $this->lSpacingCSS;
19991
- if (isset($this->wSpacingCSS) && $this->wSpacingCSS) $arr[15] = $this->wSpacingCSS;
19992
- if (isset($this->spanborddet) && $this->spanborddet) $arr[16] = $this->spanborddet;
19993
- if (isset($this->textshadow) && $this->textshadow) $arr[17] = $this->textshadow;
19994
- $this->cell[$this->row][$this->col]['textbuffer'][] = $arr;
19995
  }
19996
 
19997
 
@@ -20095,7 +20724,7 @@ function printbuffer($arrayaux,$blockstate=0,$is_table=false,$is_list=false)
20095
  }
20096
 
20097
  if(isset($vetor[15])) { // Word spacing
20098
- $this->wSpacingCSS = $vetor[15];
20099
  if ($this->wSpacingCSS && strtoupper($this->wSpacingCSS) != 'NORMAL') {
20100
  $this->minwSpacing = $this->ConvertSize($this->wSpacingCSS,$this->FontSize);
20101
  }
@@ -20116,16 +20745,18 @@ function printbuffer($arrayaux,$blockstate=0,$is_table=false,$is_list=false)
20116
  $this->spanbgcolorarray = $vetor[10];
20117
  $this->spanbgcolor = true;
20118
  }
20119
- if(isset($vetor[9]) and !empty($vetor[9])) // Text parameters - Outline + hyphens
20120
  {
20121
- $this->textparam = $vetor[9] ; // mPDF 5.6.14
20122
- $this->SetTextOutline($this->textparam); // mPDF 5.6.07
 
 
20123
  }
20124
  if(isset($vetor[8]) and $vetor[8] === true) // strike-through the text
20125
  {
20126
  $this->strike = true;
20127
  }
20128
- if(isset($vetor[7]) and $vetor[7] != '') // internal target: <a name="anyvalue">
20129
  {
20130
  $ily = $this->y;
20131
  if ($this->keep_block_together) { $this->internallink[$vetor[7]] = array("Y"=>$ily,"PAGE"=>$this->page, "kt"=>true ); }
@@ -20166,6 +20797,7 @@ function printbuffer($arrayaux,$blockstate=0,$is_table=false,$is_list=false)
20166
  }
20167
  if(isset($vetor[1]) and $vetor[1] != '') //LINK
20168
  {
 
20169
  if (strpos($vetor[1],".") === false && strpos($vetor[1],"@") !== 0) //assuming every external link has a dot indicating extension (e.g: .html .txt .zip www.somewhere.com etc.)
20170
  {
20171
  //Repeated reference to same anchor?
@@ -20584,8 +21216,9 @@ function printbuffer($arrayaux,$blockstate=0,$is_table=false,$is_list=false)
20584
  $this->spanborder = false;
20585
  $this->spanborddet = array();
20586
  $this->HREF = '';
20587
- $this->textparam = array();
20588
- $this->SetTextOutline();
 
20589
  $this->SUP = false;
20590
  $this->SUB = false;
20591
 
@@ -20671,7 +21304,6 @@ function _setBorderLine($b, $k=1) {
20671
  }
20672
  }
20673
 
20674
- // mPDF 5.6.52
20675
  function PaintDivBB($divider='',$blockstate=0,$blvl=0) {
20676
  // Borders & backgrounds are done elsewhere for columns - messes up the repositioning in printcolumnbuffer
20677
  if ($this->ColActive) { return ; } // *COLUMNS*
@@ -20771,13 +21403,6 @@ function PaintDivBB($divider='',$blockstate=0,$blvl=0) {
20771
  }
20772
  /*-- END BORDER-RADIUS --*/
20773
 
20774
- $tbcol = $this->ConvertColor(255);
20775
- for($l=0; $l <= $blvl; $l++) {
20776
- if ($this->blk[$l]['bgcolor']) {
20777
- $tbcol = $this->blk[$l]['bgcolorarray'];
20778
- }
20779
- }
20780
-
20781
  // BORDERS
20782
  if (isset($this->blk[$blvl]['y0']) && $this->blk[$blvl]['y0']) { $y0 = $this->blk[$blvl]['y0']; }
20783
  $h = $y1 - $y0;
@@ -20824,104 +21449,66 @@ function PaintDivBB($divider='',$blockstate=0,$blvl=0) {
20824
  }
20825
 
20826
  if (isset($tbd['s']) && $tbd['s']) {
20827
- if (!$brset && $tbd['style']!='dotted' && $tbd['style']!='dashed') {
20828
- $this->_out('q');
20829
- $this->SetLineWidth(0);
20830
- $this->_out(sprintf('%.3F %.3F m ',($x0)*_MPDFK, ($this->h-($y0))*_MPDFK));
20831
- $this->_out(sprintf('%.3F %.3F l ',($x0 + $border_left)*_MPDFK, ($this->h-($y0 + $border_top))*_MPDFK));
20832
- $this->_out(sprintf('%.3F %.3F l ',($x0 + $w - $border_right)*_MPDFK, ($this->h-($y0 + $border_top))*_MPDFK));
20833
- $this->_out(sprintf('%.3F %.3F l ',($x0 + $w)*_MPDFK, ($this->h-($y0))*_MPDFK));
20834
- $this->_out(' h W n '); // Ends path no-op & Sets the clipping path
20835
- }
20836
-
20837
  $this->_setBorderLine($tbd);
20838
- if ($tbd['style']=='dotted' || $tbd['style']=='dashed') {
20839
- $legbreakL -= $border_top/2; // because line cap different
20840
- $legbreakR += $border_top/2;
20841
- $this->_setDashBorder($tbd['style'],$divider,$continuingpage,'T');
20842
- }
20843
  /*-- BORDER-RADIUS --*/
20844
- else if (($brTL_V && $brTL_H) || ($brTR_V && $brTR_H) || $tbd['style']=='solid' || $tbd['style']=='double' ) { // mPDF 5.6.58
20845
  $this->SetLineJoin(0);
20846
  $this->SetLineCap(0);
20847
  }
20848
- $s = '';
20849
  if ($brTR_H && $brTR_V) {
20850
- $s .= ($this->_EllipseArc($x0 + $w - $brTR_H, $y0 + $brTR_V, $brTR_H - $border_top/2 , $brTR_V - $border_top/2 , 1, 2, true))."\n";
20851
- }
20852
- else
20853
- /*-- END BORDER-RADIUS --*/
20854
- if ($tbd['style']=='solid' || $tbd['style']=='double') {
20855
- $s .= (sprintf('%.3F %.3F m ',($x0 + $w)*_MPDFK, ($this->h-($y0 + ($border_top/2)))*_MPDFK))."\n";
20856
  }
20857
  else {
20858
- $s .= (sprintf('%.3F %.3F m ',($x0 + $w - ($border_top/2))*_MPDFK, ($this->h-($y0 + ($border_top/2)))*_MPDFK))."\n";
20859
- }
20860
  /*-- BORDER-RADIUS --*/
 
20861
  if ($brTL_H && $brTL_V ) {
20862
  // mPDF 5.4.18
20863
  if ($legend) {
20864
  if ($legbreakR < ($x0 + $w - $brTR_H)) {
20865
- $s .= (sprintf('%.3F %.3F l ', $legbreakR*_MPDFK, ($this->h-($y0 + ($border_top/2)))*_MPDFK))."\n";
20866
  }
20867
- if ($legbreakL > ($x0 + $brTL_H )) {
20868
- $s .= (sprintf('%.3F %.3F m ',$legbreakL*_MPDFK, ($this->h-($y0 + ($border_top/2)))*_MPDFK))."\n";
20869
- $s .= (sprintf('%.3F %.3F l ',($x0 + $brTL_H )*_MPDFK, ($this->h-($y0 + ($border_top/2)))*_MPDFK)."\n");
20870
  }
20871
  else {
20872
- $s .= (sprintf('%.3F %.3F m ',($x0 + $brTL_H )*_MPDFK, ($this->h-($y0 + ($border_top/2)))*_MPDFK))."\n";
20873
  }
20874
  }
20875
  else {
20876
- $s .= (sprintf('%.3F %.3F l ',($x0 + $brTL_H )*_MPDFK, ($this->h-($y0 + ($border_top/2)))*_MPDFK))."\n";
20877
  }
20878
- $s .= ($this->_EllipseArc($x0 + $brTL_H, $y0 + $brTL_V, $brTL_H - $border_top/2 , $brTL_V - $border_top/2 , 2, 1))."\n";
20879
  }
20880
  else {
20881
  /*-- END BORDER-RADIUS --*/
20882
  // mPDF 5.4.18
20883
  if ($legend) {
20884
- if ($legbreakR < ($x0 + $w)) {
20885
- $s .= (sprintf('%.3F %.3F l ',$legbreakR*_MPDFK, ($this->h-($y0 + ($border_top/2)))*_MPDFK))."\n";
20886
- }
20887
- if ($legbreakL > ($x0)) {
20888
- $s .= (sprintf('%.3F %.3F m ',$legbreakL*_MPDFK, ($this->h-($y0 + ($border_top/2)))*_MPDFK))."\n";
20889
- if ($tbd['style']=='solid' || $tbd['style']=='double') {
20890
- $s .= (sprintf('%.3F %.3F l ',($x0)*_MPDFK, ($this->h-($y0 + ($border_top/2)))*_MPDFK))."\n";
20891
- }
20892
- else {
20893
- $s .= (sprintf('%.3F %.3F l ',($x0 + ($border_top/2))*_MPDFK, ($this->h-($y0 + ($border_top/2)))*_MPDFK))."\n";
20894
- }
20895
  }
20896
- else if ($tbd['style']=='solid' || $tbd['style']=='double') {
20897
- $s .= (sprintf('%.3F %.3F m ', ($x0)*_MPDFK, ($this->h-($y0 + ($border_top/2)))*_MPDFK))."\n";
 
20898
  }
20899
  else {
20900
- $s .= (sprintf('%.3F %.3F m ', ($x0 + $border_top/2)*_MPDFK, ($this->h-($y0 + ($border_top/2)))*_MPDFK))."\n";
20901
  }
20902
  }
20903
- else if ($tbd['style']=='solid' || $tbd['style']=='double') {
20904
- $s .= (sprintf('%.3F %.3F l ',($x0)*_MPDFK, ($this->h-($y0 + ($border_top/2)))*_MPDFK))."\n";
20905
- }
20906
  else {
20907
- $s .= (sprintf('%.3F %.3F l ',($x0 + ($border_top/2))*_MPDFK, ($this->h-($y0 + ($border_top/2)))*_MPDFK))."\n";
20908
  }
20909
  /*-- BORDER-RADIUS --*/
20910
  }
20911
  /*-- END BORDER-RADIUS --*/
20912
- $s .= 'S'."\n";
20913
- $this->_out($s);
20914
-
20915
- if ($tbd['style']=='double') {
20916
- $this->SetLineWidth($tbd['w']/3);
20917
- $this->SetDColor($tbcol);
20918
- $this->_out($s);
20919
- }
20920
- if (!$brset && $tbd['style']!='dotted' && $tbd['style']!='dashed') { $this->_out('Q'); }
20921
 
20922
  // Reset Corners and Dash off
20923
- $this->SetLineWidth(0.1); // mPDF 5.6.57
20924
- $this->SetDColor($this->ConvertColor(0));
20925
  $this->SetLineJoin(2);
20926
  $this->SetLineCap(2);
20927
  $this->SetDash();
@@ -20932,62 +21519,34 @@ function PaintDivBB($divider='',$blockstate=0,$blvl=0) {
20932
  if ($this->blk[$blvl]['border_bottom'] && $blockstate != 1 && $divider != 'pagebottom') {
20933
  $tbd = $this->blk[$blvl]['border_bottom'];
20934
  if (isset($tbd['s']) && $tbd['s']) {
20935
- if (!$brset && $tbd['style']!='dotted' && $tbd['style']!='dashed') {
20936
- $this->_out('q');
20937
- $this->SetLineWidth(0);
20938
- $this->_out(sprintf('%.3F %.3F m ',($x0)*_MPDFK, ($this->h-($y0 + $h))*_MPDFK));
20939
- $this->_out(sprintf('%.3F %.3F l ',($x0 + $border_left)*_MPDFK, ($this->h-($y0 + $h - $border_bottom))*_MPDFK));
20940
- $this->_out(sprintf('%.3F %.3F l ',($x0 + $w - $border_right)*_MPDFK, ($this->h-($y0 + $h - $border_bottom))*_MPDFK));
20941
- $this->_out(sprintf('%.3F %.3F l ',($x0 + $w)*_MPDFK, ($this->h-($y0 + $h))*_MPDFK));
20942
- $this->_out(' h W n '); // Ends path no-op & Sets the clipping path
20943
- }
20944
-
20945
  $this->_setBorderLine($tbd);
20946
  if ($tbd['style']=='dotted' || $tbd['style']=='dashed') { $this->_setDashBorder($tbd['style'],$divider,$continuingpage,'B'); }
20947
  /*-- BORDER-RADIUS --*/
20948
- else if (($brBL_V && $brBL_H) || ($brBR_V && $brBR_H) || $tbd['style']=='solid' || $tbd['style']=='double' ) { // mPDF 5.6.58
20949
  $this->SetLineJoin(0);
20950
  $this->SetLineCap(0);
20951
  }
20952
- $s = '';
20953
  if ($brBL_H && $brBL_V) {
20954
- $s .= ($this->_EllipseArc($x0 + $brBL_H, $y0 + $h - $brBL_V, $brBL_H - $border_bottom/2 , $brBL_V - $border_bottom/2 , 3, 2, true))."\n";
20955
- }
20956
- else
20957
- /*-- END BORDER-RADIUS --*/
20958
- if ($tbd['style']=='solid' || $tbd['style']=='double') {
20959
- $s .= (sprintf('%.3F %.3F m ',($x0)*_MPDFK, ($this->h-($y0 + $h - ($border_bottom/2)))*_MPDFK))."\n";
20960
  }
20961
  else {
20962
- $s .= (sprintf('%.3F %.3F m ',($x0 + ($border_bottom/2))*_MPDFK, ($this->h-($y0 + $h - ($border_bottom/2)))*_MPDFK))."\n";
20963
- }
20964
  /*-- BORDER-RADIUS --*/
20965
- if ($brBR_H && $brBR_V ) {
20966
- $s .= (sprintf('%.3F %.3F l ',($x0 + $w - ($border_bottom/2) - $brBR_H )*_MPDFK, ($this->h-($y0 + $h - ($border_bottom/2)))*_MPDFK))."\n";
20967
- $s .= ($this->_EllipseArc($x0 + $w - $brBR_H, $y0 + $h - $brBR_V, $brBR_H - $border_bottom/2 , $brBR_V - $border_bottom/2 , 4, 1))."\n";
20968
  }
20969
- else
20970
- /*-- END BORDER-RADIUS --*/
20971
- if ($tbd['style']=='solid' || $tbd['style']=='double') {
20972
- $s .= (sprintf('%.3F %.3F l ',($x0 + $w)*_MPDFK, ($this->h-($y0 + $h - ($border_bottom/2)))*_MPDFK))."\n";
20973
  }
20974
  else {
20975
- $s .= (sprintf('%.3F %.3F l ',($x0 + $w - ($border_bottom/2))*_MPDFK, ($this->h-($y0 + $h - ($border_bottom/2)))*_MPDFK))."\n";
20976
- }
20977
- $s .= 'S'."\n";
20978
- $this->_out($s);
20979
-
20980
- if ($tbd['style']=='double') {
20981
- $this->SetLineWidth($tbd['w']/3);
20982
- $this->SetDColor($tbcol);
20983
- $this->_out($s);
20984
  }
20985
- if (!$brset && $tbd['style']!='dotted' && $tbd['style']!='dashed') { $this->_out('Q'); }
20986
-
20987
 
20988
  // Reset Corners and Dash off
20989
- $this->SetLineWidth(0.1); // mPDF 5.6.57
20990
- $this->SetDColor($this->ConvertColor(0));
20991
  $this->SetLineJoin(2);
20992
  $this->SetLineCap(2);
20993
  $this->SetDash();
@@ -20996,61 +21555,34 @@ function PaintDivBB($divider='',$blockstate=0,$blvl=0) {
20996
  if ($this->blk[$blvl]['border_left']) {
20997
  $tbd = $this->blk[$blvl]['border_left'];
20998
  if (isset($tbd['s']) && $tbd['s']) {
20999
- if (!$brset && $tbd['style']!='dotted' && $tbd['style']!='dashed') {
21000
- $this->_out('q');
21001
- $this->SetLineWidth(0);
21002
- $this->_out(sprintf('%.3F %.3F m ',($x0)*_MPDFK, ($this->h-($y0))*_MPDFK));
21003
- $this->_out(sprintf('%.3F %.3F l ',($x0 + $border_left)*_MPDFK, ($this->h-($y0+$border_top))*_MPDFK));
21004
- $this->_out(sprintf('%.3F %.3F l ',($x0 + $border_left)*_MPDFK, ($this->h-($y0 + $h - $border_bottom))*_MPDFK));
21005
- $this->_out(sprintf('%.3F %.3F l ',($x0)*_MPDFK, ($this->h-($y0 + $h))*_MPDFK));
21006
- $this->_out(' h W n '); // Ends path no-op & Sets the clipping path
21007
- }
21008
-
21009
  $this->_setBorderLine($tbd);
21010
  if ($tbd['style']=='dotted' || $tbd['style']=='dashed') { $this->_setDashBorder($tbd['style'],$divider,$continuingpage,'L'); }
21011
  /*-- BORDER-RADIUS --*/
21012
- else if (($brTL_V && $brTL_H) || ($brBL_V && $brBL_H) || $tbd['style']=='solid' || $tbd['style']=='double' ) { // mPDF 5.6.58
21013
  $this->SetLineJoin(0);
21014
  $this->SetLineCap(0);
21015
  }
21016
- $s = '';
21017
  if ($brTL_V && $brTL_H) {
21018
- $s .= ($this->_EllipseArc($x0 + $brTL_H, $y0 + $brTL_V, $brTL_H - $border_left/2 , $brTL_V - $border_left/2, 2, 2, true))."\n";
21019
- }
21020
- else
21021
- /*-- END BORDER-RADIUS --*/
21022
- if ($tbd['style']=='solid' || $tbd['style']=='double') {
21023
- $s .= (sprintf('%.3F %.3F m ',($x0 + ($border_left/2))*_MPDFK, ($this->h-($y0))*_MPDFK))."\n";
21024
  }
21025
  else {
21026
- $s .= (sprintf('%.3F %.3F m ',($x0 + ($border_left/2))*_MPDFK, ($this->h-($y0 + ($border_left/2)))*_MPDFK))."\n";
21027
- }
21028
  /*-- BORDER-RADIUS --*/
21029
- if ($brBL_V && $brBL_H ) {
21030
- $s .= (sprintf('%.3F %.3F l ',($x0 + ($border_left/2))*_MPDFK, ($this->h-($y0 + $h - ($border_left/2)- $brBL_V) )*_MPDFK))."\n";
21031
- $s .= ($this->_EllipseArc($x0 + $brBL_H, $y0 + $h - $brBL_V, $brBL_H - $border_left/2 , $brBL_V - $border_left/2, 3, 1))."\n";
21032
  }
21033
- else
21034
- /*-- END BORDER-RADIUS --*/
21035
- if ($tbd['style']=='solid' || $tbd['style']=='double') {
21036
- $s .= (sprintf('%.3F %.3F l ',($x0 + ($border_left/2))*_MPDFK, ($this->h-($y0 + $h) )*_MPDFK))."\n";
21037
  }
21038
  else {
21039
- $s .= (sprintf('%.3F %.3F l ',($x0 + ($border_left/2))*_MPDFK, ($this->h-($y0 + $h - ($border_left/2)) )*_MPDFK))."\n";
21040
- }
21041
- $s .= 'S'."\n";
21042
- $this->_out($s);
21043
-
21044
- if ($tbd['style']=='double') {
21045
- $this->SetLineWidth($tbd['w']/3);
21046
- $this->SetDColor($tbcol);
21047
- $this->_out($s);
21048
  }
21049
- if (!$brset && $tbd['style']!='dotted' && $tbd['style']!='dashed') { $this->_out('Q'); }
 
21050
 
21051
  // Reset Corners and Dash off
21052
- $this->SetLineWidth(0.1); // mPDF 5.6.57
21053
- $this->SetDColor($this->ConvertColor(0));
21054
  $this->SetLineJoin(2);
21055
  $this->SetLineCap(2);
21056
  $this->SetDash();
@@ -21059,67 +21591,88 @@ function PaintDivBB($divider='',$blockstate=0,$blvl=0) {
21059
  if ($this->blk[$blvl]['border_right']) {
21060
  $tbd = $this->blk[$blvl]['border_right'];
21061
  if (isset($tbd['s']) && $tbd['s']) {
21062
- if (!$brset && $tbd['style']!='dotted' && $tbd['style']!='dashed') {
21063
- $this->_out('q');
21064
- $this->SetLineWidth(0);
21065
- $this->_out(sprintf('%.3F %.3F m ',($x0 + $w)*_MPDFK, ($this->h-($y0))*_MPDFK));
21066
- $this->_out(sprintf('%.3F %.3F l ',($x0 + $w - $border_right)*_MPDFK, ($this->h-($y0+$border_top))*_MPDFK));
21067
- $this->_out(sprintf('%.3F %.3F l ',($x0 + $w - $border_right)*_MPDFK, ($this->h-($y0 + $h - $border_bottom))*_MPDFK));
21068
- $this->_out(sprintf('%.3F %.3F l ',($x0 + $w)*_MPDFK, ($this->h-($y0 + $h))*_MPDFK));
21069
- $this->_out(' h W n '); // Ends path no-op & Sets the clipping path
21070
- }
21071
-
21072
  $this->_setBorderLine($tbd);
21073
  if ($tbd['style']=='dotted' || $tbd['style']=='dashed') { $this->_setDashBorder($tbd['style'],$divider,$continuingpage,'R'); }
21074
  /*-- BORDER-RADIUS --*/
21075
- else if (($brTR_V && $brTR_H) || ($brBR_V && $brBR_H) || $tbd['style']=='solid' || $tbd['style']=='double' ) { // mPDF 5.6.58
21076
  $this->SetLineJoin(0);
21077
  $this->SetLineCap(0);
21078
  }
21079
- $s = '';
21080
  if ($brBR_V && $brBR_H) {
21081
- $s .= ($this->_EllipseArc($x0 + $w - $brBR_H, $y0 + $h - $brBR_V, $brBR_H - $border_right/2 , $brBR_V - $border_right/2, 4, 2, true))."\n";
21082
- }
21083
- else
21084
- /*-- END BORDER-RADIUS --*/
21085
- if ($tbd['style']=='solid' || $tbd['style']=='double') {
21086
- $s .= (sprintf('%.3F %.3F m ',($x0 + $w - ($border_right/2))*_MPDFK, ($this->h-($y0 + $h))*_MPDFK))."\n";
21087
  }
21088
  else {
21089
- $s .= (sprintf('%.3F %.3F m ',($x0 + $w - ($border_right/2))*_MPDFK, ($this->h-($y0 + $h - ($border_right/2)))*_MPDFK))."\n";
21090
- }
21091
  /*-- BORDER-RADIUS --*/
21092
- if ($brTR_V && $brTR_H ) {
21093
- $s .= (sprintf('%.3F %.3F l ',($x0 + $w - ($border_right/2))*_MPDFK, ($this->h-($y0 + ($border_right/2) + $brTR_V) )*_MPDFK))."\n";
21094
- $s .= ($this->_EllipseArc($x0 + $w - $brTR_H, $y0 + $brTR_V, $brTR_H - $border_right/2 , $brTR_V - $border_right/2, 1, 1))."\n";
21095
  }
21096
- else
21097
- /*-- END BORDER-RADIUS --*/
21098
- if ($tbd['style']=='solid' || $tbd['style']=='double') {
21099
- $s .= (sprintf('%.3F %.3F l ',($x0 + $w - ($border_right/2))*_MPDFK, ($this->h-($y0) )*_MPDFK))."\n";
21100
  }
21101
  else {
21102
- $s .= (sprintf('%.3F %.3F l ',($x0 + $w - ($border_right/2))*_MPDFK, ($this->h-($y0 + ($border_right/2)) )*_MPDFK))."\n";
21103
- }
21104
- $s .= 'S'."\n";
21105
- $this->_out($s);
21106
-
21107
- if ($tbd['style']=='double') {
21108
- $this->SetLineWidth($tbd['w']/3);
21109
- $this->SetDColor($tbcol);
21110
- $this->_out($s);
21111
  }
21112
- if (!$brset && $tbd['style']!='dotted' && $tbd['style']!='dashed') { $this->_out('Q'); }
 
21113
 
21114
  // Reset Corners and Dash off
21115
- $this->SetLineWidth(0.1); // mPDF 5.6.57
21116
- $this->SetDColor($this->ConvertColor(0));
21117
  $this->SetLineJoin(2);
21118
  $this->SetLineCap(2);
21119
  $this->SetDash();
21120
  }
21121
  }
21122
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21123
 
21124
  $this->SetDash();
21125
  $this->y = $save_y;
@@ -21134,6 +21687,7 @@ function PaintDivBB($divider='',$blockstate=0,$blvl=0) {
21134
  $bgy0 = $y0;
21135
  $bgy1 = $y1;
21136
 
 
21137
  // Defined br values represent the radius of the outer curve - need to take border-width/2 from each radius for drawing the borders
21138
  if (isset($this->blk[$blvl]['background_clip']) && $this->blk[$blvl]['background_clip'] == 'padding-box') {
21139
  $brbgTL_H = max(0, $brTL_H - $this->blk[$blvl]['border_left']['w']);
@@ -21153,26 +21707,8 @@ function PaintDivBB($divider='',$blockstate=0,$blvl=0) {
21153
  $bgy1 -= $this->blk[$blvl]['border_bottom']['w'];
21154
  }
21155
  }
21156
- // mPDF 5.6.09
21157
- else if (isset($this->blk[$blvl]['background_clip']) && $this->blk[$blvl]['background_clip'] == 'content-box') {
21158
- $brbgTL_H = max(0, $brTL_H - $this->blk[$blvl]['border_left']['w'] - $this->blk[$blvl]['padding_left']);
21159
- $brbgTL_V = max(0, $brTL_V - $this->blk[$blvl]['border_top']['w'] - $this->blk[$blvl]['padding_top']);
21160
- $brbgTR_H = max(0, $brTR_H - $this->blk[$blvl]['border_right']['w'] - $this->blk[$blvl]['padding_right']);
21161
- $brbgTR_V = max(0, $brTR_V - $this->blk[$blvl]['border_top']['w'] - $this->blk[$blvl]['padding_top']);
21162
- $brbgBL_H = max(0, $brBL_H - $this->blk[$blvl]['border_left']['w'] - $this->blk[$blvl]['padding_left']);
21163
- $brbgBL_V = max(0, $brBL_V - $this->blk[$blvl]['border_bottom']['w'] - $this->blk[$blvl]['padding_bottom']);
21164
- $brbgBR_H = max(0, $brBR_H - $this->blk[$blvl]['border_right']['w'] - $this->blk[$blvl]['padding_right']);
21165
- $brbgBR_V = max(0, $brBR_V - $this->blk[$blvl]['border_bottom']['w'] - $this->blk[$blvl]['padding_bottom']);
21166
- $bgx0 += $this->blk[$blvl]['border_left']['w'] + $this->blk[$blvl]['padding_left'];
21167
- $bgx1 -= $this->blk[$blvl]['border_right']['w'] + $this->blk[$blvl]['padding_right'];
21168
- if (($this->blk[$blvl]['border_top']['w'] || $this->blk[$blvl]['padding_top']) && $divider != 'pagetop' && !$continuingpage) {
21169
- $bgy0 += $this->blk[$blvl]['border_top']['w'] + $this->blk[$blvl]['padding_top'];
21170
- }
21171
- if (($this->blk[$blvl]['border_bottom']['w'] || $this->blk[$blvl]['padding_bottom']) && $blockstate != 1 && $divider != 'pagebottom') {
21172
- $bgy1 -= $this->blk[$blvl]['border_bottom']['w'] + $this->blk[$blvl]['padding_bottom'];
21173
- }
21174
- }
21175
  else {
 
21176
  $brbgTL_H = $brTL_H;
21177
  $brbgTL_V = $brTL_V;
21178
  $brbgTR_H = $brTR_H;
@@ -21181,7 +21717,9 @@ function PaintDivBB($divider='',$blockstate=0,$blvl=0) {
21181
  $brbgBL_V = $brBL_V;
21182
  $brbgBR_H = $brBR_H;
21183
  $brbgBR_V = $brBR_V;
 
21184
  }
 
21185
 
21186
  // Set clipping path
21187
  $s = ' q 0 w '; // Line width=0
@@ -21528,60 +22066,13 @@ function PaintDivBB($divider='',$blockstate=0,$blvl=0) {
21528
  $this->pageBackgrounds[$blvl][] = array('gradient'=>true, 'x'=>$gx, 'y'=>$gy, 'w'=>$w, 'h'=>$h, 'gradtype'=>$g['type'], 'stops'=>$g['stops'], 'colorspace'=>$g['colorspace'], 'coords'=>$g['coords'], 'extend'=>$g['extend'], 'clippath'=>$s, 'visibility'=>$this->visibility, 'z-index'=>$this->current_layer); // mPDF 5.6.01
21529
  }
21530
  }
 
21531
  if (isset($this->blk[$blvl]['background-image'])) {
21532
  if ($this->blk[$blvl]['background-image']['gradient'] && preg_match('/(-moz-)*(repeating-)*(linear|radial)-gradient/', $this->blk[$blvl]['background-image']['gradient'] )) {
21533
  $g = $this->grad->parseMozGradient( $this->blk[$blvl]['background-image']['gradient'] );
21534
  if ($g) {
21535
  $gx = $x0;
21536
- $gy = $y0;
21537
- // mPDF 5.6.11
21538
- // origin specifies the background-positioning-area (bpa)
21539
- if ($this->blk[$blvl]['background-image']['origin'] == 'padding-box') {
21540
- $gx += $this->blk[$blvl]['border_left']['w'];
21541
- $w -= ($this->blk[$blvl]['border_left']['w'] + $this->blk[$blvl]['border_right']['w']);
21542
- if ($this->blk[$blvl]['border_top'] && $divider != 'pagetop' && !$continuingpage) {
21543
- $gy += $this->blk[$blvl]['border_top']['w'];
21544
- }
21545
- if ($this->blk[$blvl]['border_bottom'] && $blockstate != 1 && $divider != 'pagebottom') {
21546
- $gy1 = $y1 - $this->blk[$blvl]['border_bottom']['w'];
21547
- }
21548
- else { $gy1 = $y1; }
21549
- $h = $gy1 - $gy;
21550
- }
21551
- else if ($this->blk[$blvl]['background-image']['origin'] == 'content-box') {
21552
- $gx += $this->blk[$blvl]['border_left']['w'] + $this->blk[$blvl]['padding_left'];
21553
- $w -= ($this->blk[$blvl]['border_left']['w'] + $this->blk[$blvl]['padding_left'] + $this->blk[$blvl]['border_right']['w'] + $this->blk[$blvl]['padding_right']);
21554
- if ($this->blk[$blvl]['border_top'] && $divider != 'pagetop' && !$continuingpage) {
21555
- $gy += $this->blk[$blvl]['border_top']['w'] + $this->blk[$blvl]['padding_top'];
21556
- }
21557
- if ($this->blk[$blvl]['border_bottom'] && $blockstate != 1 && $divider != 'pagebottom') {
21558
- $gy1 = $y1 - ($this->blk[$blvl]['border_bottom']['w'] + $this->blk[$blvl]['padding_bottom']);
21559
- }
21560
- else { $gy1 = $y1 - $this->blk[$blvl]['padding_bottom']; }
21561
- $h = $gy1 - $gy;
21562
- }
21563
-
21564
- if (isset($this->blk[$blvl]['background-image']['size']['w']) && $this->blk[$blvl]['background-image']['size']['w']) {
21565
- $size = $this->blk[$blvl]['background-image']['size'];
21566
- if ($size['w']!='contain' && $size['w']!='cover') {
21567
- if (stristr($size['w'] ,'%')) {
21568
- $size['w'] += 0;
21569
- $size['w'] /= 100;
21570
- $w *= $size['w'];
21571
- }
21572
- else if ($size['w']!='auto') {
21573
- $w = $size['w'];
21574
- }
21575
- if (stristr($size['h'] ,'%')) {
21576
- $size['h'] += 0;
21577
- $size['h'] /= 100;
21578
- $h *= $size['h'];
21579
- }
21580
- else if ($size['h']!='auto') {
21581
- $h = $size['h'];
21582
- }
21583
- }
21584
- }
21585
  $this->pageBackgrounds[$blvl][] = array('gradient'=>true, 'x'=>$gx, 'y'=>$gy, 'w'=>$w, 'h'=>$h, 'gradtype'=>$g['type'], 'stops'=>$g['stops'], 'colorspace'=>$g['colorspace'], 'coords'=>$g['coords'], 'extend'=>$g['extend'], 'clippath'=>$s, 'visibility'=>$this->visibility, 'z-index'=>$this->current_layer); // mPDF 5.6.01
21586
  }
21587
  }
@@ -21596,38 +22087,7 @@ function PaintDivBB($divider='',$blockstate=0,$blvl=0) {
21596
  $resize = $this->blk[$blvl]['background-image']['resize'];
21597
  $opacity = $this->blk[$blvl]['background-image']['opacity'];
21598
  $itype = $this->blk[$blvl]['background-image']['itype'];
21599
- $size = $this->blk[$blvl]['background-image']['size']; // mPDF 5.6.10
21600
- // mPDF 5.6.10
21601
- // origin specifies the background-positioning-area (bpa)
21602
- $bpa = array('x'=>$x0, 'y'=>$y0, 'w'=>$w, 'h'=>$h);
21603
- if ($this->blk[$blvl]['background-image']['origin'] == 'padding-box') {
21604
- $bpa['x'] = $x0 + $this->blk[$blvl]['border_left']['w'];
21605
- $bpa['w'] = $w - ($this->blk[$blvl]['border_left']['w'] + $this->blk[$blvl]['border_right']['w']);
21606
- if ($this->blk[$blvl]['border_top'] && $divider != 'pagetop' && !$continuingpage) {
21607
- $bpa['y'] = $y0 + $this->blk[$blvl]['border_top']['w'];
21608
- }
21609
- else { $bpa['y'] = $y0; }
21610
- if ($this->blk[$blvl]['border_bottom'] && $blockstate != 1 && $divider != 'pagebottom') {
21611
- $bpay = $y1 - $this->blk[$blvl]['border_bottom']['w'];
21612
- }
21613
- else { $bpay = $y1; }
21614
- $bpa['h'] = $bpay - $bpa['y'];
21615
- }
21616
- // mPDF 5.6.09
21617
- else if ($this->blk[$blvl]['background-image']['origin'] == 'content-box') {
21618
- $bpa['x'] = $x0 + $this->blk[$blvl]['border_left']['w'] + $this->blk[$blvl]['padding_left'];
21619
- $bpa['w'] = $w - ($this->blk[$blvl]['border_left']['w'] + $this->blk[$blvl]['padding_left'] + $this->blk[$blvl]['border_right']['w'] + $this->blk[$blvl]['padding_right']);
21620
- if ($this->blk[$blvl]['border_top'] && $divider != 'pagetop' && !$continuingpage) {
21621
- $bpa['y'] = $y0 + $this->blk[$blvl]['border_top']['w'] + $this->blk[$blvl]['padding_top'];
21622
- }
21623
- else { $bpa['y'] = $y0 + $this->blk[$blvl]['padding_top']; }
21624
- if ($this->blk[$blvl]['border_bottom'] && $blockstate != 1 && $divider != 'pagebottom') {
21625
- $bpay = $y1 - ($this->blk[$blvl]['border_bottom']['w'] + $this->blk[$blvl]['padding_bottom']);
21626
- }
21627
- else { $bpay = $y1 - $this->blk[$blvl]['padding_bottom']; }
21628
- $bpa['h'] = $bpay - $bpa['y'];
21629
- }
21630
- $this->pageBackgrounds[$blvl][] = array('x'=>$x0, 'y'=>$y0, 'w'=>$w, 'h'=>$h, 'image_id'=>$image_id, 'orig_w'=>$orig_w, 'orig_h'=>$orig_h, 'x_pos'=>$x_pos, 'y_pos'=>$y_pos, 'x_repeat'=>$x_repeat, 'y_repeat'=>$y_repeat, 'clippath'=>$s, 'resize'=>$resize, 'opacity'=>$opacity, 'itype'=>$itype, 'visibility'=>$this->visibility, 'z-index'=>$this->current_layer, 'size'=>$size, 'bpa'=>$bpa ); // mPDF 5.6.01 5.6.10
21631
  }
21632
  }
21633
  /*-- END BACKGROUNDS --*/
@@ -21702,6 +22162,7 @@ function _EllipseArc($x0, $y0, $rx, $ry, $seg = 1, $part=false, $start=false) {
21702
 
21703
  function PaintDivLnBorder($state=0,$blvl=0,$h) {
21704
  // $state = 0 normal; 1 top; 2 bottom; 3 top and bottom
 
21705
  $this->ColDetails[$this->CurrCol]['bottom_margin'] = $this->y + $h;
21706
 
21707
  $save_y = $this->y;
@@ -21717,16 +22178,8 @@ function PaintDivLnBorder($state=0,$blvl=0,$h) {
21717
  if (isset($tbd['s']) && $tbd['s']) {
21718
  $this->_setBorderLine($tbd);
21719
  $this->y = $y0 + ($tbd['w']/2);
21720
- // mPDF 5.6.56
21721
- if ($tbd['style']=='dotted' || $tbd['style']=='dashed') {
21722
- $this->_setDashBorder($tbd['style'],'',$continuingpage,'T');
21723
- $this->Line($x0 + ($tbd['w']/2) , $this->y , $x0 + $w - ($tbd['w']/2), $this->y);
21724
- }
21725
- else {
21726
- $this->SetLineJoin(0);
21727
- $this->SetLineCap(0);
21728
- $this->Line($x0, $this->y , $x0 + $w, $this->y);
21729
- }
21730
  $this->y += $tbd['w'];
21731
  // Reset Corners and Dash off
21732
  $this->SetLineJoin(2);
@@ -21738,18 +22191,9 @@ function PaintDivLnBorder($state=0,$blvl=0,$h) {
21738
  $tbd = $this->blk[$blvl]['border_left'];
21739
  if (isset($tbd['s']) && $tbd['s']) {
21740
  $this->_setBorderLine($tbd);
21741
- // mPDF 5.6.56
21742
- if ($tbd['style']=='dotted' || $tbd['style']=='dashed') {
21743
- $this->y = $y0 + ($tbd['w']/2);
21744
- $this->_setDashBorder($tbd['style'],'',$continuingpage,'L');
21745
- $this->Line($x0 + ($tbd['w']/2), $this->y, $x0 + ($tbd['w']/2), $y0 + $h -($tbd['w']/2));
21746
- }
21747
- else {
21748
- $this->y = $y0;
21749
- $this->SetLineJoin(0);
21750
- $this->SetLineCap(0);
21751
- $this->Line($x0 + ($tbd['w']/2), $this->y, $x0 + ($tbd['w']/2), $y0 + $h);
21752
- }
21753
  $this->y += $tbd['w'];
21754
  // Reset Corners and Dash off
21755
  $this->SetLineJoin(2);
@@ -21761,18 +22205,9 @@ function PaintDivLnBorder($state=0,$blvl=0,$h) {
21761
  $tbd = $this->blk[$blvl]['border_right'];
21762
  if (isset($tbd['s']) && $tbd['s']) {
21763
  $this->_setBorderLine($tbd);
21764
- // mPDF 5.6.56
21765
- if ($tbd['style']=='dotted' || $tbd['style']=='dashed') {
21766
- $this->y = $y0 + ($tbd['w']/2);
21767
- $this->_setDashBorder($tbd['style'],'',$continuingpage,'R');
21768
- $this->Line($x0 + $w - ($tbd['w']/2), $this->y, $x0 + $w - ($tbd['w']/2), $y0 + $h - ($tbd['w']/2));
21769
- }
21770
- else {
21771
- $this->y = $y0;
21772
- $this->SetLineJoin(0);
21773
- $this->SetLineCap(0);
21774
- $this->Line($x0 + $w - ($tbd['w']/2), $this->y, $x0 + $w - ($tbd['w']/2), $y0 + $h);
21775
- }
21776
  $this->y += $tbd['w'];
21777
  // Reset Corners and Dash off
21778
  $this->SetLineJoin(2);
@@ -21785,16 +22220,8 @@ function PaintDivLnBorder($state=0,$blvl=0,$h) {
21785
  if (isset($tbd['s']) && $tbd['s']) {
21786
  $this->_setBorderLine($tbd);
21787
  $this->y = $y0 + $h - ($tbd['w']/2);
21788
- // mPDF 5.6.56
21789
- if ($tbd['style']=='dotted' || $tbd['style']=='dashed') {
21790
- $this->_setDashBorder($tbd['style'],'',$continuingpage,'B');
21791
- $this->Line($x0 + ($tbd['w']/2) , $this->y, $x0 + $w - ($tbd['w']/2), $this->y);
21792
- }
21793
- else {
21794
- $this->SetLineJoin(0);
21795
- $this->SetLineCap(0);
21796
- $this->Line($x0, $this->y, $x0 + $w, $this->y);
21797
- }
21798
  $this->y += $tbd['w'];
21799
  // Reset Corners and Dash off
21800
  $this->SetLineJoin(2);
@@ -21889,8 +22316,9 @@ function Reset() {
21889
  $this->ResetStyles();
21890
 
21891
  $this->HREF = '';
21892
- $this->textparam = array();
21893
- $this->SetTextOutline();
 
21894
 
21895
  $this->SUP = false;
21896
  $this->SUB = false;
@@ -21938,9 +22366,9 @@ function Reset() {
21938
  $this->oldy = -1;
21939
 
21940
  $bodystyle = array();
21941
- if (isset($this->cssmgr->CSS['BODY']['FONT-STYLE'])) { $bodystyle['FONT-STYLE'] = $this->cssmgr->CSS['BODY']['FONT-STYLE']; }
21942
- if (isset($this->cssmgr->CSS['BODY']['FONT-WEIGHT'])) { $bodystyle['FONT-WEIGHT'] = $this->cssmgr->CSS['BODY']['FONT-WEIGHT']; }
21943
- if (isset($this->cssmgr->CSS['BODY']['COLOR'])) { $bodystyle['COLOR'] = $this->cssmgr->CSS['BODY']['COLOR']; }
21944
  if (isset($bodystyle)) { $this->setCSS($bodystyle,'BLOCK','BODY'); }
21945
 
21946
  }
@@ -21979,6 +22407,360 @@ function ReadCharset($html) {
21979
  }
21980
  }
21981
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
  // ******************************************************************************
4
  // Software: mPDF, Unicode-HTML Free PDF generator *
5
+ // Version: 5.6 based on *
6
  // FPDF by Olivier PLATHEY *
7
  // HTML2FPDF by Renato Coelho *
8
+ // Date: 2013-01-20 *
9
  // Author: Ian Back <ianb@bpm1.com> *
10
  // License: GPL *
11
  // *
13
  // ******************************************************************************
14
 
15
 
16
+ define('mPDF_VERSION','5.6');
17
 
18
  //Scale factor
19
  define('_MPDFK', (72/25.4));
70
  // EXTERNAL (PUBLIC) VARIABLES
71
  // Define these in config.php
72
  ///////////////////////////////
73
+ // mPDF 5.6.01
74
+ var $layers;
75
+ var $current_layer;
76
+ var $open_layer_pane;
77
+
78
  var $margBuffer; // mPDF 5.4.04
79
  var $splitTableBorderWidth; // mPDF 5.4.16
80
 
139
  var $incrementFPR3;
140
  var $incrementFPR4;
141
 
142
+ var $hyphenate;
143
+ var $hyphenateTables;
144
  var $SHYlang;
145
  var $SHYleftmin;
146
  var $SHYrightmin;
190
  var $jSmaxCharLast;
191
  var $jSmaxWordLast;
192
 
193
+ var $orphansAllowed;
194
  var $max_colH_correction;
195
 
196
 
261
  //////////////////////
262
  // CLASS OBJECTS
263
  //////////////////////
 
264
  var $grad;
265
  var $bmp;
266
  var $wmf;
271
  //////////////////////
272
  // INTERNAL VARIABLES
273
  //////////////////////
 
 
 
 
 
 
274
  var $inMeter; // mPDF 5.5.09
275
 
276
  var $CJKleading;
375
  var $cell_border_dominance_R;
376
  var $cell_border_dominance_T;
377
  var $cell_border_dominance_B;
378
+ var $tbCSSlvl;
379
+ var $listCSSlvl;
380
  var $table_keep_together;
381
  var $plainCell_properties;
382
  var $inherit_lineheight;
387
  var $blockContext;
388
  var $floatDivs;
389
 
390
+ var $tablecascadeCSS;
391
+ var $listcascadeCSS;
392
 
393
  var $patterns;
394
  var $pageBackgrounds;
526
  // List of ALL available CJK fonts (incl. styles) (Adobe add-ons) hw removed
527
  var $available_CJK_fonts;
528
 
529
+ var $cascadeCSS;
530
+
531
  var $HTMLHeader;
532
  var $HTMLFooter;
533
  var $HTMLHeaderE;
636
  var $dotted_on;
637
  var $strike;
638
 
639
+ var $CSS;
640
  var $textbuffer;
641
  var $currentfontstyle;
642
  var $currentfontfamily;
648
 
649
  var $lineheight;
650
  var $basepath;
651
+ var $outlineparam;
652
+ var $outline_on;
653
 
654
  var $specialcontent;
655
  var $selectoption;
742
 
743
  //Private properties FROM FPDF
744
  var $DisplayPreferences;
745
+ var $outlines;
746
  var $flowingBlockAttr;
747
  var $page; //current page number
748
  var $n; //current object number
854
  $this->useOddEven =& $this->mirrorMargins;
855
  $this->useSubstitutionsMB =& $this->useSubstitutions;
856
 
 
857
  // mPDF 5.6.01
858
  $this->layers = array();
859
  $this->current_layer = 0;
896
  $this->smCapsStretch = 100;
897
  $this->margBuffer = 0; // mPDF 5.4.04
898
  $this->inMeter = false; // mPDF 5.5.09
 
899
 
900
  $this->defTextColor = $this->TextColor = $this->SetTColor($this->ConvertColor(0),true);
901
  $this->defDrawColor = $this->DrawColor = $this->SetDColor($this->ConvertColor(0),true);
950
  $this->floatDivs = array();
951
  $this->DisplayPreferences='';
952
 
953
+ $this->tablecascadeCSS = array();
954
+ $this->listcascadeCSS = array();
955
+
956
  $this->patterns = array(); // Tiling patterns used for backgrounds
957
  $this->pageBackgrounds = array();
958
  $this->writingHTMLheader = false; // internal flag - used both for writing HTMLHeaders/Footers and FixedPos block
1039
  $this->useRC128encryption = false;
1040
  $this->uniqid = '';
1041
 
1042
+ $this->cascadeCSS = array();
1043
  $this->bufferoutput = false;
1044
  $this->encrypted=false; //whether document is protected
1045
  $this->BMoutlines=array();
1085
  $this->usingCoreFont = false;
1086
  $this->charspacing=0;
1087
 
1088
+ $this->outlines=array();
1089
  $this->autoPageBreak = true;
1090
 
1091
  require(_MPDF_PATH.'config.php'); // config data
1221
  else { $this->useSubstitutions = false; }
1222
 
1223
  /*-- HTML-CSS --*/
 
 
 
1224
  if (file_exists(_MPDF_PATH.'mpdf.css')) {
1225
  $css = file_get_contents(_MPDF_PATH.'mpdf.css');
1226
+ $css2 = $this->ReadDefaultCSS($css);
1227
+ $this->defaultCSS = $this->array_merge_recursive_unique($this->defaultCSS,$css2);
1228
  }
1229
  /*-- END HTML-CSS --*/
1230
 
1296
  $this->colorarray=array();
1297
  $this->spanbgcolorarray=array();
1298
  $this->textbuffer=array();
1299
+ $this->CSS=array();
1300
  $this->internallink=array();
1301
  $this->basepath = "";
1302
 
1303
  $this->SetBasePath('');
1304
 
1305
+ $this->outlineparam = array();
1306
+ $this->outline_on = false;
1307
 
1308
  $this->specialcontent = '';
1309
  $this->selectoption = array();
1795
  }
1796
 
1797
  /*-- BACKGROUNDS --*/
1798
+ function _resizeBackgroundImage($imw, $imh, $cw, $ch, $resize=0, $repx, $repy) {
 
 
 
 
 
 
 
 
1799
  $cw = $cw*_MPDFK;
1800
  $ch = $ch*_MPDFK;
1801
+ if (!$resize) { return array($imw, $imh, $repx, $repy); }
1802
+ if ($resize==1 && $imw > $cw) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1803
  $h = $imh * $cw/$imw;
1804
+ $repx = false;
1805
  return array($cw, $h, $repx, $repy);
1806
  }
1807
  else if ($resize==2 && $imh > $ch) {
1808
  $w = $imw * $ch/$imh;
1809
+ $repy = false;
1810
  return array($w, $ch, $repx, $repy);
1811
  }
1812
  else if ($resize==3) {
1813
  $w = $imw;
1814
  $h = $imh;
1815
+ $saverepx = $repx;
1816
  if ($w > $cw) {
1817
  $h = $h * $cw/$w;
1818
  $w = $cw;
1819
+ $repx = false;
1820
  }
1821
  if ($h > $ch) {
1822
  $w = $w * $ch/$h;
1823
  $h = $ch;
1824
+ $repy = false;
1825
+ $repx = $saverepx;
1826
  }
1827
  return array($w, $h, $repx, $repy);
1828
  }
1829
  else if ($resize==4) {
1830
  $h = $imh * $cw/$imw;
1831
+ $repx = false;
1832
  return array($cw, $h, $repx, $repy);
1833
  }
1834
  else if ($resize==5) {
1835
  $w = $imw * $ch/$imh;
1836
+ $repy = false;
1837
  return array($w, $ch, $repx, $repy);
1838
  }
1839
  else if ($resize==6) {
1840
+ $repx = false;
1841
+ $repy = false;
1842
  return array($cw, $ch, $repx, $repy);
1843
  }
1844
  return array($imw, $imh, $repx, $repy);
1846
 
1847
 
1848
  function SetBackground(&$properties, &$maxwidth) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1849
  if (preg_match('/(-moz-)*(repeating-)*(linear|radial)-gradient/',$properties['BACKGROUND-IMAGE'])) {
1850
+ return array('gradient'=>$properties['BACKGROUND-IMAGE']);
1851
  }
1852
  else {
1853
  $file = $properties['BACKGROUND-IMAGE'];
1888
  else { $resize = 0; }
1889
  if (isset($properties['BACKGROUND-IMAGE-OPACITY'])) { $opacity = $properties['BACKGROUND-IMAGE-OPACITY']; }
1890
  else { $opacity = 1; }
1891
+ return array('image_id'=>$image_id, 'orig_w'=>$orig_w, 'orig_h'=>$orig_h, 'x_pos'=>$x_pos, 'y_pos'=>$y_pos, 'x_repeat'=>$x_repeat, 'y_repeat'=>$y_repeat, 'resize'=>$resize, 'opacity'=>$opacity, 'itype'=>$sizesarray['itype']);
1892
  }
1893
  }
1894
  return false;
1995
  }
1996
  /*-- BACKGROUNDS --*/
1997
  foreach ($pbs AS $pb) {
1998
+ // mPDF 5.6.01 - LAYERS
1999
+ if ((isset($pb['gradient']) && $pb['gradient']) || (isset($pb['image_id']) && $pb['image_id'])) {
2000
  if($pb['z-index']>0) {
2001
  $this->current_layer = $pb['z-index'];
2002
  $s .= "\n".'/OCGZ-index /ZI'.$pb['z-index'].' BDC'."\n";
2009
  else if($pb['visibility']=='hidden')
2010
  $s .= '/OC /OC3 BDC'."\n";
2011
  }
2012
+ }
2013
+ if (isset($pb['gradient']) && $pb['gradient']) {
2014
  if (isset($pb['clippath']) && $pb['clippath']) { $s .= $pb['clippath']."\n"; }
2015
  $s .= $this->grad->Gradient($pb['x'], $pb['y'], $pb['w'], $pb['h'], $pb['gradtype'], $pb['stops'], $pb['colorspace'], $pb['coords'], $pb['extend'], true);
2016
  if (isset($pb['clippath']) && $pb['clippath']) { $s .= 'Q'."\n"; }
2017
  }
2018
+ else if (isset($pb['image_id']) && $pb['image_id']) { // Background pattern
2019
  $pb['y'] -= $adjustmenty;
2020
  $pb['h'] += $adjustmenty;
2021
  $n = count($this->patterns)+1;
2022
+ list($orig_w, $orig_h, $x_repeat, $y_repeat) = $this->_resizeBackgroundImage($pb['orig_w'], $pb['orig_h'], $pb['w'], $pb['h'], $pb['resize'], $pb['x_repeat'], $pb['y_repeat']);
2023
+ $this->patterns[$n] = array('x'=>$pb['x'], 'y'=>$pb['y'], 'w'=>$pb['w'], 'h'=>$pb['h'], 'pgh'=>$this->h, 'image_id'=>$pb['image_id'], 'orig_w'=>$orig_w, 'orig_h'=>$orig_h, 'x_pos'=>$pb['x_pos'], 'y_pos'=>$pb['y_pos'], 'x_repeat'=>$x_repeat, 'y_repeat'=>$y_repeat, 'itype'=>$pb['itype']);
2024
  $x = $pb['x']*_MPDFK;
2025
  $y = ($this->h - $pb['y'])*_MPDFK;
2026
  $w = $pb['w']*_MPDFK;
2027
  $h = -$pb['h']*_MPDFK;
2028
  if (isset($pb['clippath']) && $pb['clippath']) { $s .= $pb['clippath']."\n"; }
2029
+ if ($this->writingHTMLfooter || $this->writingHTMLheader) {
2030
  $iw = $pb['orig_w']/_MPDFK;
2031
  $ih = $pb['orig_h']/_MPDFK;
 
2032
  $w = $pb['w'];
2033
  $h = $pb['h'];
2034
  $x0 = $pb['x'];
2035
  $y0 = $pb['y'];
2036
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2037
  // Number to repeat
2038
+ if ($pb['x_repeat']) { $nx = ceil($w/$iw); }
2039
  else { $nx = 1; }
2040
+ if ($pb['y_repeat']) { $ny = ceil($h/$ih); }
2041
  else { $ny = 1; }
2042
 
2043
  $x_pos = $pb['x_pos'];
2044
  if (stristr($x_pos ,'%') ) {
2045
  $x_pos += 0;
2046
  $x_pos /= 100;
2047
+ $x_pos = ($w * $x_pos) - ($iw * $x_pos);
2048
  }
2049
  $y_pos = $pb['y_pos'];
2050
  if (stristr($y_pos ,'%') ) {
2051
  $y_pos += 0;
2052
  $y_pos /= 100;
2053
+ $y_pos = ($h * $y_pos) - ($ih * $y_pos);
2054
  }
2055
  if ($nx>1) {
2056
+ while($x_pos>0) { $x_pos -= $iw; }
2057
  }
2058
  if ($ny>1) {
2059
+ while($y_pos>0) { $y_pos -= $ih; }
2060
  }
2061
  for($xi=0;$xi<$nx;$xi++) {
2062
  for($yi=0;$yi<$ny;$yi++) {
2195
  }
2196
 
2197
 
2198
+
2199
+
2200
  function AddPage($orientation='',$condition='', $resetpagenum='', $pagenumstyle='', $suppress='',$mgl='',$mgr='',$mgt='',$mgb='',$mgh='',$mgf='',$ohname='',$ehname='',$ofname='',$efname='',$ohvalue=0,$ehvalue=0,$ofvalue=0,$efvalue=0,$pagesel='',$newformat='')
2201
  {
2202
  /*-- CSS-FLOAT --*/
2902
  $ttffile = _MPDF_SYSTEM_TTFONTS.$this->fontdata[$family][$stylekey];
2903
  if (!file_exists($ttffile)) { $ttffile = ''; }
2904
  }
 
2905
  if (!$ttffile) {
2906
  $ttffile = _MPDF_TTFONTPATH.$this->fontdata[$family][$stylekey];
2907
+ if (!file_exists($ttffile)) { die("mPDF Error - cannot find TTF TrueType font file - ".$ttffile); }
 
 
 
 
 
 
 
 
 
 
 
 
2908
  }
 
2909
  $ttfstat = stat($ttffile);
2910
 
2911
  if (isset($this->fontdata[$family]['TTCfontID'][$stylekey])) { $TTCfontID = $this->fontdata[$family]['TTCfontID'][$stylekey]; }
3769
  if($this->ColorFlag) $s .='q '.$this->TextColor.' ';
3770
 
3771
  // OUTLINE
3772
+ if($this->outline_on && !$this->S) {
3773
  $s .=' '.sprintf('%.3F w',$this->LineWidth*_MPDFK).' ';
3774
  $s .=" $this->DrawColor ";
3775
  $s .=" 2 Tr ";
3780
  $tc = strtoupper($this->TextColor); // change 0 0 0 rg to 0 0 0 RG
3781
  if($this->FillColor!=$tc) { $s .= ' '.$tc.' '; } // stroke (outline) = same colour as text(fill)
3782
  }
 
3783
 
3784
  if (strpos($this->ReqFontStyle,"I") !== false && strpos($this->FontStyle,"I") === false) { // Artificial italic
3785
  $aix = '1 0 0.261799 1 %.3F %.3F Tm ';
4154
 
4155
  if (!$this->usingCoreFont) {
4156
  $checkCursive=false;
4157
+ if ($this->biDirectional) { $checkCursive=true; } // *RTL*
4158
  else if (isset($this->CurrentFont['indic']) && $this->CurrentFont['indic']) { $checkCursive=true; } // *INDIC*
4159
  while($i<$nb) {
4160
  //Get next character
4347
  $saved[ 'SUB' ] = $this->SUB;
4348
  $saved[ 'linewidth' ] = $this->LineWidth;
4349
  $saved[ 'drawcolor' ] = $this->DrawColor;
4350
+ $saved[ 'is_outline' ] = $this->outline_on;
4351
+ $saved[ 'outlineparam' ] = $this->outlineparam;
4352
  $saved[ 'toupper' ] = $this->toupper;
4353
  $saved[ 'tolower' ] = $this->tolower;
4354
  $saved[ 'capitalize' ] = $this->capitalize;
4362
  $saved[ 'border' ] = $this->spanborddet;
4363
  $saved[ 'color' ] = $this->TextColor;
4364
  $saved[ 'bgcolor' ] = $this->FillColor;
4365
+ $saved['lang'] = $this->currentLang;
4366
+ $saved['display_off'] = $this->inlineDisplayOff;
4367
 
4368
  return $saved;
4369
  }
4397
  $this->SUB = $saved[ 'SUB' ];
4398
  $this->LineWidth = $saved[ 'linewidth' ];
4399
  $this->DrawColor = $saved[ 'drawcolor' ];
4400
+ $this->outline_on = $saved[ 'is_outline' ];
4401
+ $this->outlineparam = $saved[ 'outlineparam' ];
4402
  $this->inlineDisplayOff = $saved['display_off'];
4403
 
4404
  $this->toupper = $saved[ 'toupper' ];
4485
  $saved[ 'SUB' ] = $this->SUB;
4486
  $saved[ 'linewidth' ] = $this->LineWidth;
4487
  $saved[ 'drawcolor' ] = $this->DrawColor;
4488
+ $saved[ 'is_outline' ] = $this->outline_on;
4489
+ $saved[ 'outlineparam' ] = $this->outlineparam;
4490
  $saved[ 'ReqFontStyle' ] = $this->ReqFontStyle;
4491
  $saved[ 'fontkerning' ] = $this->kerning;
4492
  $saved[ 'fixedlSpacing' ] = $this->fixedlSpacing;
4520
  $this->SUB = $saved[ 'SUB' ];
4521
  $this->LineWidth = $saved[ 'linewidth' ];
4522
  $this->DrawColor = $saved[ 'drawcolor' ];
4523
+ $this->outline_on = $saved[ 'is_outline' ];
4524
+ $this->outlineparam = $saved[ 'outlineparam' ];
4525
  if ($write) {
4526
  $this->SetFont($saved[ 'family' ],$saved[ 'style' ].($this->U ? 'U' : '').($this->S ? 'S' : ''),$saved[ 'sizePt' ],true,true); // force output
4527
  $fontout = (sprintf('BT /F%d %.3F Tf ET', $this->CurrentFont['i'], $this->FontSizePt));
4587
  $fill = 0;
4588
  }
4589
 
 
 
4590
  // Always right trim!
4591
  // Right trim content and adjust width if need to justify (later)
4592
  if (isset($content[count($content)-1]) && preg_match('/[ ]+$/',$content[count($content)-1], $m)) {
4872
  if ($newblock && ($blockstate==1 || $blockstate==3) && $lineCount == 0 && !$is_table && !$is_list) {
4873
  $this->blk[$this->blklvl]['y0'] = $this->y;
4874
  $this->blk[$this->blklvl]['startpage'] = $this->page;
 
4875
  if ($this->ColActive) { $this->breakpoints[$this->CurrCol][] = $this->y; } // *COLUMNS*
4876
  }
4877
 
4916
  if ($content) {
4917
 
4918
  // In FinishFlowing Block no lines are justified as it is always last line
4919
+ // but if orphansAllowed have allowed content width to go over max width, use J charspacing to compress line
4920
  // JUSTIFICATION J - NOT!
4921
  $nb_carac = 0;
4922
  $nb_spaces = 0;
4923
  $jcharspacing = 0;
4924
  $jws = 0;
4925
  $inclCursive=false;
 
4926
  foreach ( $content as $k => $chunk ) {
4927
  if (!isset($this->objectbuffer[$k]) || (isset($this->objectbuffer[$k]) && !$this->objectbuffer[$k])) {
4928
  if ($this->usingCoreFont) {
4938
  if (preg_match("/([".$this->pregHIchars.$this->pregBNchars.$this->pregPAchars."])/u", $chunk)) { $inclCursive = true; } // *INDIC*
4939
  }
4940
  }
 
4941
  }
4942
  // if it's justified, we need to find the char/word spacing (or if orphans have allowed length of line to go over the maxwidth)
4943
  // If "orphans" in fact is just a final space - ignore this
4944
+ if (((($contentWidth + $lastitalic) > $maxWidth) && ($content[count($content)-1] != ' ') ) ||
4945
+ (!$endofblock && $align=='J' && ($next=='image' || $next=='select' || $next=='input' || $next=='textarea' || ($next=='br' && $this->justifyB4br)))
4946
+ ) {
 
 
 
4947
  // WORD SPACING
4948
  list($jcharspacing,$jws) = $this->GetJspacing($nb_carac,$nb_spaces,($maxWidth-$lastitalic-$contentWidth-$WidthCorrection-(($this->cMarginL+$this->cMarginR)*_MPDFK)-($paddingL+$paddingR +(($fpaddingL + $fpaddingR) * _MPDFK) )),$inclCursive);
4949
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4950
  // Check if will fit at word/char spacing of previous line - if so continue it
4951
  // but only allow a maximum of $this->jSmaxWordLast and $this->jSmaxCharLast
4952
  else if ($contentWidth < ($maxWidth - $lastitalic-$WidthCorrection - (($this->cMarginL+$this->cMarginR)* _MPDFK) - ($paddingL+$paddingR +(($fpaddingL + $fpaddingR) * _MPDFK))) && !$this->fixedlSpacing) {
5001
  /*-- END RTL --*/
5002
 
5003
  $this->x = $currentx + $this->cMarginL + $ipaddingL + $fpaddingL;
5004
+ if ($align == 'R') { $this->x += $empty; }
 
5005
  else if ($align == 'J' && $blockdir == 'rtl') { $this->x += $empty; }
5006
  else if ($align == 'C') { $this->x += ($empty / 2); }
5007
 
5008
+
5009
  // Paragraph INDENT
5010
  $WidthCorrection = 0;
5011
  if (($newblock) && ($blockstate==1 || $blockstate==3) && isset($this->blk[$this->blklvl]['text_indent']) && ($lineCount == 0) && (!$is_table) && (!$is_list) && ($align !='C')) {
5052
  }
5053
 
5054
 
5055
+
5056
  // DIRECTIONALITY RTL
5057
  if ((($blockdir == 'rtl') && ($contains_rtl )) || $all_rtl ) { $this->restoreFont( $font[ $arraysize-1 - $k ] ); }
5058
  else { $this->restoreFont( $font[ $k ] ); }
5059
 
 
 
 
 
 
 
 
 
5060
  $this->SetSpacing(($this->fixedlSpacing*_MPDFK)+$jcharspacing,($this->fixedlSpacing+$this->minwSpacing)*_MPDFK+$jws);
5061
  $this->fixedlSpacing = false;
5062
  $this->minwSpacing = 0;
5063
 
 
 
 
 
 
 
5064
  // *********** SPAN BACKGROUND COLOR ***************** //
5065
  if (isset($this->spanbgcolor) && $this->spanbgcolor) {
5066
  $cor = $this->spanbgcolorarray;
5078
  if (isset($this->objectbuffer[$dirk])) {
5079
  if ($this->objectbuffer[$dirk]['type']=='dottab') {
5080
  $this->objectbuffer[$dirk]['OUTER-WIDTH'] +=$empty;
 
5081
  }
5082
  $stringWidth = $this->objectbuffer[$dirk]['OUTER-WIDTH'];
5083
  }
5084
 
5085
  if ($stringWidth==0) { $stringWidth = 0.000001; }
5086
+ if ($k == $arraysize-1) $this->Cell( $stringWidth, $lineHeight, $chunk, '', 1, '', $fill, $this->HREF , $currentx,0,0,'M', $fill, $af, $bf, true ); //mono-style line or last part (skips line)
 
 
 
 
 
 
 
 
 
 
5087
  else $this->Cell( $stringWidth, $lineHeight, $chunk, '', 0, '', $fill, $this->HREF, 0, 0,0,'M', $fill, $af, $bf, true );//first or middle part
5088
 
 
5089
  if (!empty($this->spanborddet)) {
5090
  if (strpos($contentB[$k],'R')!==false && $k != $arraysize-1) $this->x += $this->spanborddet['R']['w'];
5091
  }
5094
  $fill = $save_fill; $spanfill = 0;
5095
  if ($fill) { $this->SetFColor($bcor); }
5096
  }
 
 
 
 
 
5097
  }
5098
 
5099
  $this->printobjectbuffer($is_table, $blockdir);
5100
 
5101
+
5102
  $this->objectbuffer = array();
5103
 
5104
+
5105
  $this->ResetSpacing();
5106
 
5107
  /*-- LISTS --*/
5124
  $this->x = $currentx;
5125
  if (isset($bull['x'])) { $this->x += $bull['x']; }
5126
  $this->y -= $lineHeight;
5127
+ if (is_array($bull['col'])) { $this->SetTColor($bull['col']); }
5128
 
5129
  if (isset($bull['txt'])) { $this->Cell($bull['w'], $lineHeight,$bull['txt'],'','',$bull['align'],0,'',0,-$this->cMarginL, -$this->cMarginR ); }
5130
  if (isset($bull['font']) && $bull['font'] == 'czapfdingbats') {
5425
 
5426
  // DOT-TAB
5427
  if ($objattr['type'] == 'dottab') {
 
 
5428
  $sp = $this->GetStringWidth(' ');
5429
  $nb=floor(($w-2*$sp)/$this->GetStringWidth('.'));
5430
  if ($nb>0) { $dots=' '.str_repeat('.',$nb).' '; }
5431
  else { $dots=' '; }
5432
  $col = $this->ConvertColor(0);
5433
+ if (isset($objattr['colorarray']) && is_array($objattr['colorarray'])) {
5434
  $col = $objattr['colorarray'];
5435
  }
5436
  $this->SetTColor($col);
 
5437
  $save_sbd = $this->spanborddet;
5438
  $save_u = $this->U;
5439
  $save_s = $this->strike;
5440
  $this->spanborddet = '';
 
5441
  $this->U = false;
5442
  $this->strike = false;
5443
  $this->Cell($w,$h,$dots,0,0,'C');
5444
  $this->spanborddet = $save_sbd;
5445
  $this->U = $save_u;
5446
  $this->strike = $save_s;
 
5447
  // mPDF 5.0
5448
  $this->SetTColor($this->ConvertColor(0));
5449
  }
5528
  // where the line should be cutoff if it is to be justified
5529
  $cutoffWidth = $contentWidth;
5530
 
5531
+ $curlyquote = mb_convert_encoding("\xe2\x80\x9e",$this->mb_enc,'UTF-8');
5532
+ $curlylowquote = mb_convert_encoding("\xe2\x80\x9d",$this->mb_enc,'UTF-8');
5533
+ // mPDF 5.5.07
5534
+ $raquote = mb_convert_encoding("\xc2\xbb",$this->mb_enc,'UTF-8'); //&#187; &raquo;
5535
+ // mPDF 5.5.20
5536
+ $rsquo = mb_convert_encoding("\xe2\x80\x99",$this->mb_enc,'UTF-8'); //&#8217; &rsquo;
5537
+ $sbquo = mb_convert_encoding("\xe2\x80\x9a",$this->mb_enc,'UTF-8'); //&#8218; &sbquo;
5538
+ $bdquo = mb_convert_encoding("\xe2\x80\xba",$this->mb_enc,'UTF-8'); //&#8222; &bdquo;
5539
+
5540
  $CJKoverflow = false;
 
5541
 
5542
  // COLS
5543
  $oldcolumn = $this->CurrCol;
5623
  $tmp = mb_strlen( $s, $this->mb_enc );
5624
  }
5625
 
5626
+ $orphs = 0;
5627
+ $check = 0;
5628
+
5629
  // for every character in the string
5630
  for ( $i = 0; $i < $tmp; $i++ ) {
5631
  // extract the current character
5661
  $cw += $rbw*_MPDFK;
5662
  $contentB[(count($contentB)-1)] .= 'R';
5663
  }
5664
+
5665
+ if ($c==' ') { $check = 1; }
5666
+
5667
+ // CHECK for ORPHANS
5668
+ else if ($c=='.' || $c==',' || $c==')' || $c==']' || $c==';' || $c==':' || $c=='!' || $c=='?'|| $c=='"' || $c==$curlyquote || $c==$curlylowquote || $c==$raquote || $c==$rsquo || $c==$sbquo || $c==$bdquo ) {$check++; } // mPDF 5.5.07 mPDF 5.5.20
5669
+ /*-- CJK-FONTS --*/
5670
+ else if ($this->checkCJK) {
5671
+ if ((!$is_table && $this->CJKfollowing && preg_match("/[".$this->CJKfollowing."]/u", $c)) || ($is_table && preg_match("/[".$this->CJKoverflow ."]/u", $c))) { $check++; }
5672
+ else { $check = 0; }
5673
+ }
5674
+ /*-- END CJK-FONTS --*/
5675
+ else { $check = 0; }
5676
+
5677
+ // There's an orphan '. ' or ', ' or <sup>32</sup> about to be cut off at the end of line
5678
+ if($check==1) {
5679
+ $currContent .= $c;
5680
+ $cutoffWidth = $contentWidth;
5681
+ $contentWidth += $cw;
5682
+ continue;
5683
+ }
5684
+ if(($this->SUP || $this->SUB) && ($orphs < $this->orphansAllowed)) { // ? disable orphans in table if borders used
5685
  $currContent .= $c;
5686
  $cutoffWidth = $contentWidth;
5687
  $contentWidth += $cw;
5688
+ $orphs++;
5689
  continue;
5690
  }
5691
+ else { $orphs = 0; }
5692
 
5693
  // ADDED for Paragraph_indent
5694
  $WidthCorrection = 0;
5731
  $savedContentB = '';
5732
  $savedFont = array();
5733
  $savedObj = array();
 
 
 
 
5734
 
5735
  // cut off and save any partial words at the end of the string
5736
  $words = explode( ' ', $currContent );
5738
  // HYPHENATION
5739
  $currWord = $words[count($words)-1] ;
5740
  $success = false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5741
  /*-- HYPHENATION --*/
5742
  // Soft Hyphens chr(173)
5743
+ if ((!$this->usingCoreFont && preg_match("/\xc2\xad/",$currWord)) || ($this->usingCoreFont && preg_match("/".chr(173)."/",$currWord) && ($this->FontFamily!='csymbol' && $this->FontFamily!='czapfdingbats')) ) {
5744
  $rem = $maxWidth - $WidthCorrection - (($this->cMarginL+$this->cMarginR)*_MPDFK) - ($paddingL+$paddingR +(($fpaddingL + $fpaddingR) * _MPDFK) );
5745
+ list($success,$pre,$post,$prelength) = $this->softHyphenate($currWord, (($rem-$cutoffWidth)/_MPDFK -$this->GetCharWidthNonCore(" ", false)) );
5746
  }
5747
 
5748
+ if (!$success && ($this->hyphenate || ($this->hyphenateTables && $is_table))) {
5749
  // Look ahead to get current word
5750
  for($ac = $i; $ac<(mb_strlen($s)-1); $ac++) {
5751
  $addc = mb_substr($s,$ac,1,$this->mb_enc );
5764
  }
5765
  /*-- END HYPHENATION --*/
5766
 
 
 
 
5767
  /*-- CJK-FONTS --*/
5768
+ // mPDF 5.5.10
5769
+ // if current overflow character is CJK
5770
+ if ($this->checkCJK && preg_match("/[".$this->pregCJKchars."]/u", $c)) {
5771
  $lastchar = mb_substr($words[(count($words)-1)],mb_strlen($words[(count($words)-1)], $this->mb_enc)-1, 1, $this->mb_enc);
5772
+ if ($this->checkCJK) {
5773
+ // Last character that fits is not allowed to end a line - move lastchar(s) to start of next line
5774
+ if (!$is_table && preg_match("/[".$this->CJKleading."]/u", $lastchar)) {
5775
+ //move lastchar(s) to next line
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5776
  $m0 = $lastchar;
5777
+ $m1 = $c;
5778
+ while(preg_match("/[".$this->CJKleading."]/u", $m0) && mb_strlen($words[(count($words)-1)], $this->mb_enc)>2) {
5779
+ // trim last letter off word[0]
5780
+ $words[(count($words)-1)] = mb_substr($words[(count($words)-1)],0,mb_strlen($words[(count($words)-1)], $this->mb_enc)-1, $this->mb_enc);
5781
+ // and add it to savedContent for next line
5782
+ $savedContent = $m0.$savedContent;
5783
+ $m1 = $lastchar;
5784
+ $lastchar = mb_substr($words[(count($words)-1)],mb_strlen($words[(count($words)-1)], $this->mb_enc)-1, 1, $this->mb_enc);
5785
+ $m0 = $lastchar;
 
 
 
 
 
 
 
 
 
 
5786
  }
5787
+ }
5788
+ // Next character is not allowed to start a new line - move lastchar(s) to next line
5789
+ else if (!$is_table && preg_match("/[".$this->CJKfollowing."]/u", $c)) {
5790
+ // try squeezing another character(s) onto this line = Oikomi
5791
+ if ($this->allowCJKorphans) {
5792
+ $lookahead = mb_substr($s,$i+1,1,$this->mb_enc );
5793
+ //if lookahead is not another following char
5794
+ if ($lookahead && !preg_match("/[".$this->CJKfollowing."]/u", $lookahead)) {
5795
+ $currContent .= $c;
5796
+ $cutoffWidth = $contentWidth;
5797
+ $contentWidth += $cw;
5798
+ if ($this->allowCJKoverflow && !$is_table && preg_match("/[".$this->CJKoverflow."]/u", $c)) { $CJKoverflow = true; }
5799
+ continue;
5800
+ }
5801
+ }
5802
+ // or move lastchar(s) to next line to keep $c company = Oidashi
 
 
 
 
 
 
 
 
 
5803
  $m0 = $lastchar;
5804
+ $m1 = $c;
5805
+ while(preg_match("/[".$this->CJKfollowing."]/u", $m1) && mb_strlen($words[(count($words)-1)], $this->mb_enc)>2) {
5806
  // trim last letter off word[0]
5807
  $words[(count($words)-1)] = mb_substr($words[(count($words)-1)],0,mb_strlen($words[(count($words)-1)], $this->mb_enc)-1, $this->mb_enc);
5808
  // and add it to savedContent for next line
5809
  $savedContent = $m0.$savedContent;
5810
+ $m1 = $lastchar;
5811
  $lastchar = mb_substr($words[(count($words)-1)],mb_strlen($words[(count($words)-1)], $this->mb_enc)-1, 1, $this->mb_enc);
5812
  $m0 = $lastchar;
5813
  }
5814
+
5815
+ }
5816
  }
5817
+
5818
  $lastContent = '';
5819
  for ( $w = 0; $w < count( $words ) ; $w++) { $lastContent .= $words[ $w ]." "; }
5820
  $savedFont = $this->saveFont();
5827
  if ( count( $words ) == 1 ) {
5828
  // TO correct for error when word too wide for page - but only when one long word from left to right margin
5829
  if (count($content) == 1 && $currContent != ' ') {
5830
+
5831
+ // mPDF 5.5.10
5832
  $lastchar = mb_substr($words[0],mb_strlen($words[0], $this->mb_enc)-1, 1, $this->mb_enc);
5833
  $lastContent = $words[0];
5834
  $savedFont = $this->saveFont();
5835
  // replace the current content with the cropped version
5836
  $currContent = rtrim( $lastContent );
5837
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5838
  else {
5839
  // save and crop off the content currently on the stack
5840
  $savedContent = array_pop( $content );
5841
+ $savedContentB = $contentB[(count($contentB)-1)];
5842
  $savedFont = array_pop( $font );
5843
  // trim any trailing spaces off the last bit of content
5844
  $currContent =& $content[ count( $content ) - 1 ];
5919
  {
5920
  $this->restoreFont( $font[ $k ]);
5921
  if (!isset($this->objectbuffer[$k])) {
 
 
 
 
 
 
5922
  if (!$this->usingCoreFont) {
5923
  $content[$k] = $chunk = str_replace("\xc2\xad",'',$chunk );
5924
  if (isset($this->CurrentFont['indic']) && $this->CurrentFont['indic']) { $checkCursive=true; } // *INDIC*
6038
  $nb_carac = 0;
6039
  $nb_spaces = 0;
6040
  // if it's justified, we need to find the char/word spacing (or if orphans have allowed length of line to go over the maxwidth)
6041
+ if(( $align == 'J' ) || (($cutoffWidth + $lastitalic > $maxWidth - $WidthCorrection - (($this->cMarginL+$this->cMarginR)*_MPDFK) - ($paddingL+$paddingR +(($fpaddingL + $fpaddingR) * _MPDFK) ) + 0.001) && !$CJKoverflow)) { // 0.001 is to correct for deviations converting mm=>pts
6042
  // JUSTIFY J (Use character spacing)
6043
  // WORD SPACING
6044
  foreach ( $content as $k => $chunk ) {
6095
  $this->keep_block_together = 0;
6096
  }
6097
 
 
 
 
 
6098
 
6099
  /*-- COLUMNS --*/
6100
  // COLS
6119
  if (($newblock) && ($blockstate==1 || $blockstate==3) && ($lineCount == 1) && (!$is_table) && (!$is_list)) {
6120
  $this->blk[$this->blklvl]['y0'] = $this->y;
6121
  $this->blk[$this->blklvl]['startpage'] = $this->page;
 
6122
  }
6123
 
6124
  // TOP PADDING and BORDER spacing/fill
6210
  $this->fixedlSpacing = false;
6211
  $this->minwSpacing = 0;
6212
 
 
 
 
 
 
6213
  // *********** SPAN BACKGROUND COLOR ***************** //
6214
  if ($this->spanbgcolor) {
6215
  $cor = $this->spanbgcolorarray;
6231
  if ($stringWidth==0) { $stringWidth = 0.000001; }
6232
  if ($k == $arraysize-1) {
6233
  $stringWidth -= ( $this->charspacing / _MPDFK );
6234
+ $this->Cell( $stringWidth, $lineHeight, $chunk, '', 1, '', $fill, $this->HREF, $currentx,0,0,'M', $fill, $af, $bf, true ); //mono-style line or last part (skips line)
 
 
 
 
 
 
 
 
 
6235
  }
6236
  else $this->Cell( $stringWidth, $lineHeight, $chunk, '', 0, '', $fill, $this->HREF, 0, 0,0,'M', $fill, $af, $bf, true );//first or middle part
6237
 
6243
  $fill = $save_fill; $spanfill = 0;
6244
  if ($fill) { $this->SetFColor($bcor); }
6245
  }
 
 
 
 
 
6246
  }
6247
  if (!$is_table) {
6248
  $this->maxPosR = max($this->maxPosR , ($this->w - $this->rMargin - $this->blk[$this->blklvl]['outer_right_margin']));
6274
  $this->x = $currentx;
6275
  if (isset($bull['x'])) { $this->x += $bull['x']; }
6276
  $this->y -= $lineHeight;
6277
+ if (is_array($bull['col'])) { $this->SetTColor($bull['col']); }
6278
  if (isset($bull['txt'])) { $this->Cell($bull['w'], $lineHeight,$bull['txt'],'','',$bull['align'],0,'',0,-$this->cMarginL, -$this->cMarginR ); }
6279
  if (isset($bull['font']) && $bull['font'] == 'czapfdingbats') {
6280
  $this->bullet = false;
6298
  $lineHeight = $this->divheight;
6299
  $valign = 'M';
6300
 
6301
+ $this->restoreFont( $savedFont );
6302
+ $lbw = $rbw = 0; // Border widths
6303
+ if (!empty($this->spanborddet)) {
6304
+ $lbw = $this->spanborddet['L']['w'];
6305
+ $rbw = $this->spanborddet['R']['w'];
6306
+ }
6307
+
6308
  $font = array();
6309
  $content = array();
6310
  $contentB = array();
6316
  $contentB[] = '';
6317
  $contentWidth += $savedObj['OUTER-WIDTH'] * _MPDFK;
6318
  }
6319
+ $font[] = $savedFont;
6320
+ $content[] = $savedContent . $c;
6321
+ $contentB[] = $savedContentB ;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6322
  $currContent =& $content[ (count($content)-1) ];
 
6323
  // CJK - strip CJK space at end of line
6324
  // &#x3000; = \xe3\x80\x80 = CJK space
6325
  if ($this->checkCJK && $currContent == "\xe3\x80\x80") { $currContent = '' ; } // *CJK-FONTS*
 
 
 
 
 
 
 
6326
  $contentWidth += $this->GetStringWidth( $currContent ) * _MPDFK;
6327
  if (strpos($savedContentB,'L')!==false) $contentWidth += $lbw;
6328
  $cutoffWidth = $contentWidth;
6329
  $CJKoverflow = false;
 
6330
  }
6331
  // another character will fit, so add it on
6332
  else {
6469
 
6470
  }
6471
 
6472
+ function SetTextOutline($width, $col=0) {
6473
+ if ($width == false) //Now resets all values
 
 
 
 
 
 
 
 
6474
  {
6475
+ $this->outline_on = false;
6476
  $this->SetLineWidth(0.2);
6477
  $this->SetDColor($this->ConvertColor(0));
6478
  $this->_SetTextRendering(0);
6479
  $tr = ('0 Tr');
6480
  if($this->page>0 && ((isset($this->pageoutput[$this->page]['TextRendering']) && $this->pageoutput[$this->page]['TextRendering'] != $tr) || !isset($this->pageoutput[$this->page]['TextRendering']) || $this->keep_block_together)) { $this->_out($tr); }
6481
  $this->pageoutput[$this->page]['TextRendering'] = $tr;
6482
+ }
6483
+ else
6484
+ {
6485
+ $this->SetLineWidth($width);
6486
+ $this->SetDColor($col);
6487
+ $tr = ('2 Tr');
6488
+ if($this->page>0 && ((isset($this->pageoutput[$this->page]['TextRendering']) && $this->pageoutput[$this->page]['TextRendering'] != $tr) || !isset($this->pageoutput[$this->page]['TextRendering']) || $this->keep_block_together)) { $this->_out($tr); }
6489
+ $this->pageoutput[$this->page]['TextRendering'] = $tr;
6490
  }
6491
  }
6492
 
6970
  for ($blvl=$firstblockfill;$blvl<=$level;$blvl++) {
6971
  $this->SetBlockFill($blvl);
6972
  $this->x = $this->lMargin + $this->blk[$blvl]['outer_left_margin'];
6973
+ if ($last_x != $this->lMargin + $this->blk[$blvl]['outer_left_margin'] || $last_w != $this->blk[$blvl]['width'] || $last_fc != $this->FillColor) {
6974
  $x = $this->x;
6975
  $this->Cell( ($this->blk[$blvl]['width']), $h, '', '', 0, '', 1);
6976
  if (!$this->keep_block_together && !$this->writingHTMLheader && !$this->writingHTMLfooter) {
7024
 
7025
  function Output($name='',$dest='')
7026
  {
 
 
7027
  //Output PDF to some destination
7028
  if ($this->showStats) {
7029
+ /*BLUE LIQUID DESIGNS EDIT
7030
+ Write to file instead */
7031
+
7032
+ file_put_contents('performance_log.txt', date('Y-m-d h:i:s') . ' Generated in '.sprintf('%.2F',(microtime(true) - $this->time0))." seconds\r\n", FILE_APPEND);
7033
  }
7034
  //Finish document if necessary
7035
  if ($this->progressBar) { $this->UpdateProgressBar(1,'100','Finished'); } // *PROGRESS-BAR*
7047
  }
7048
  }
7049
 
7050
+
7051
  if (($this->PDFA || $this->PDFX) && $this->encrypted) { $this->Error("PDFA1-b or PDFX/1-a does not permit encryption of documents."); }
7052
  if (count($this->PDFAXwarnings) && (($this->PDFA && !$this->PDFAauto) || ($this->PDFX && !$this->PDFXauto))) {
7053
  if ($this->PDFA) {
7054
  echo '<div>WARNING - This file could not be generated as it stands as a PDFA1-b compliant file.</div>';
7055
+ echo '<div>These issues can be automatically fixed by mPDF using <i>$mpdf-&gt;PDFAauto=true;</i></div>';
7056
  echo '<div>Action that mPDF will take to automatically force PDFA1-b compliance are shown in brackets.</div>';
7057
  }
7058
  else {
7059
  echo '<div>WARNING - This file could not be generated as it stands as a PDFX/1-a compliant file.</div>';
7060
+ echo '<div>These issues can be automatically fixed by mPDF using <i>$mpdf-&gt;PDFXauto=true;</i></div>';
7061
  echo '<div>Action that mPDF will take to automatically force PDFX/1-a compliance are shown in brackets.</div>';
7062
  }
7063
  echo '<div>Warning(s) generated:</div><ul>';
7070
  }
7071
 
7072
  if ($this->showStats) {
7073
+ /* Blue Liquid Designs Edit
7074
+ Log to File instead */
7075
+ $log = date('Y-m-d h:i:s') . ' Compiled in '.sprintf('%.2F',(microtime(true) - $this->time0))." seconds (total)\n\r";
7076
+ $log .= 'Peak Memory usage '.number_format((memory_get_peak_usage(true)/(1024*1024)),2)." MB\n";
7077
+ $log .= 'PDF file size '.number_format((strlen($this->buffer)/1024))." kB\n";
7078
+ $log .= 'Number of fonts '.count($this->fonts)."\n";
7079
+ file_put_contents('performance_log.txt', $log, FILE_APPEND);
7080
  }
7081
 
7082
 
7207
  $interval = 3600;
7208
  if ($handle = opendir(preg_replace('/\/$/','',_MPDF_TEMP_PATH))) {
7209
  while (false !== ($file = readdir($handle))) {
7210
+ if (!is_dir($file) && ((filemtime(_MPDF_TEMP_PATH.$file)+$interval) < time()) && ($file != "..") && ($file != ".")) { // mPDF 5.4.19
7211
  unlink(_MPDF_TEMP_PATH.$file);
7212
  }
7213
  }
7270
  $this->pgwidth = $this->w - $this->lMargin - $this->rMargin;
7271
  $this->x = $this->lMargin;
7272
  $this->y = $this->margin_header;
7273
+
7274
+ $html = str_replace('{PAGENO}',$this->pagenumPrefix.$this->docPageNum($n).$this->pagenumSuffix,$html);
7275
+ $html = str_replace($this->aliasNbPgGp,$this->nbpgPrefix.$this->docPageNumTotal($n).$this->nbpgSuffix,$html ); // {nbpg}
 
 
 
 
 
 
 
 
7276
  $html = str_replace($this->aliasNbPg,$nb,$html ); // {nb}
7277
+ $html = preg_replace('/\{DATE\s+(.*?)\}/e',"date('\\1')",$html );
7278
 
7279
  $this->HTMLheaderPageLinks = array();
7280
  $this->HTMLheaderPageAnnots = array();
7345
 
7346
  // if bottom-margin==0, corrects to avoid division by zero
7347
  if ($this->y == $this->h) { $top_y = $this->y = ($this->h - 0.1); }
7348
+
7349
+ $html = str_replace('{PAGENO}',$this->pagenumPrefix.$this->docPageNum($n).$this->pagenumSuffix,$html);
7350
+ $html = str_replace($this->aliasNbPgGp,$this->nbpgPrefix.$this->docPageNumTotal($n).$this->nbpgSuffix,$html ); // {nbpg}
 
 
 
 
 
 
 
 
7351
  $html = str_replace($this->aliasNbPg,$nb,$html ); // {nb}
7352
+ $html = preg_replace('/\{DATE\s+(.*?)\}/e',"date('\\1')",$html );
7353
 
7354
 
7355
  $this->HTMLheaderPageLinks = array();
7475
  for($n=1;$n<=$nb;$n++)
7476
  {
7477
  $thispage = $this->pages[$n];
7478
+ unset($this->pages[$n]);
7479
  if(isset($this->OrientationChanges[$n])) {
7480
  $hPt=$this->pageDim[$n]['w']*_MPDFK;
7481
  $wPt=$this->pageDim[$n]['h']*_MPDFK;
8846
 
8847
  // mPDF 5.6.01
8848
  if ($this->hasOC || count($this->layers)) {
8849
+ $p = $v = $h = $l = $as = '';
8850
  if ($this->hasOC) {
8851
  if (($this->hasOC & 1) == 1) $p=$this->n_ocg_print.' 0 R';
8852
  if (($this->hasOC & 2) == 2) $v=$this->n_ocg_view.' 0 R';
8855
  }
8856
 
8857
  if(count($this->layers)) {
8858
+ foreach($this->layers as $layer) {
8859
+ $l .= $layer['n'].' 0 R ';
 
 
8860
  }
8861
  }
8862
+ $this->_out("/OCProperties <</OCGs [$p $v $h $l] /D <</ON [$p $l] /OFF [$v $h] ");
8863
+ $this->_out("/Order [$v $p $h $l] ");
8864
  if ($as) $this->_out("/AS [$as] ");
8865
  $this->_out(">>>>");
8866
 
8986
  $this->state=2;
8987
  $resetHTMLHeadersrequired = false;
8988
 
8989
+
8990
  if ($newformat) { $this->_setPageSize($newformat, $orientation); }
8991
  /*-- CSS-PAGE --*/
8992
  // Paged media (page-box)
9227
  }
9228
  /*-- END HTMLHEADERS-FOOTERS --*/
9229
  }
9230
+
9231
  /*-- HTMLHEADERS-FOOTERS --*/
9232
  if ($resetHTMLHeadersrequired) {
9233
  $this->SetHTMLHeader($this->HTMLHeader );
9397
  $this->file_get_contents_by_curl($file, $data); // needs full url?? even on local (never needed for local)
9398
  if ($data) { $type = $this->_imageTypeFromString($data); }
9399
  }
9400
+ if(!data)
9401
+ {
9402
+ /* Blue Liquid Designs Edit
9403
+ Ensure Wordpress compatibility
9404
+ */
9405
+ if( !class_exists( 'WP_Http' ) ) {
9406
+ include_once( ABSPATH . WPINC. '/class-http.php' );
9407
+ }
9408
+ $request = new WP_Http();
9409
+ $result = $request->request($full_url);
9410
+ if ( !is_wp_error($result) ) {
9411
+ $data = $result['body'];
9412
+ $type = $this->_imageTypeFromString($data);
9413
+ }
9414
+ }
9415
 
9416
  }
9417
  if (!$data) { return $this->_imageError($file, $firsttime, 'Could not find image file'); }
10704
  $this->original_default_font = $font;
10705
  if (!$this->watermark_font ) { $this->watermark_font = $font; } // *WATERMARK*
10706
  $this->defaultCSS['BODY']['FONT-FAMILY'] = $font;
10707
+ $this->CSS['BODY']['FONT-FAMILY'] = $font;
10708
  }
10709
 
10710
  function SetDefaultFontSize($fontsize) {
10712
  $this->original_default_font_size = $fontsize;
10713
  $this->SetFontSize($fontsize);
10714
  $this->defaultCSS['BODY']['FONT-SIZE'] = $fontsize . 'pt';
10715
+ $this->CSS['BODY']['FONT-SIZE'] = $fontsize . 'pt';
10716
  }
10717
 
10718
  function SetDefaultBodyCSS($prop, $val) {
10719
  if ($prop) {
10720
  $this->defaultCSS['BODY'][strtoupper($prop)] = $val;
10721
+ $this->CSS['BODY'][strtoupper($prop)] = $val;
10722
  }
10723
  }
10724
 
10746
  $this->defaultAlign = 'L';
10747
  $this->defaultTableAlign = 'L';
10748
  } // *RTL*
10749
+ $this->CSS['BODY']['DIRECTION'] = $this->directionality;
10750
  }
10751
 
10752
 
10822
  if (!$basepath) { $basepath = $this->basepath; }
10823
  //Fix path value
10824
  $path = str_replace("\\","/",$path); //If on Windows
10825
+ //Get link info and obtain its absolute path
10826
  $regexp = '|^./|'; // Inadvertently corrects "./path/etc" and "//www.domain.com/etc"
10827
  $path = preg_replace($regexp,'',$path);
10828
 
 
10829
  if(substr($path,0,1) == '#') { return; }
10830
  if (stristr($path,"mailto:") !== false) { return; }
10831
  if (strpos($path,"../") !== false ) { //It is a Relative Link
10832
  $backtrackamount = substr_count($path,"../");
10833
+ $maxbacktrack = substr_count($basepath,"/") - 1;
10834
  $filepath = str_replace("../",'',$path);
10835
  $path = $basepath;
10836
  //If it is an invalid relative link, then make it go to directory root
10892
  $ppgno = $num;
10893
  $suppress = 0;
10894
  $offset = 0;
10895
+
10896
  $lastreset = 0;
10897
  foreach($this->PageNumSubstitutions AS $psarr) {
10898
  if ($num >= $psarr['from']) {
10975
  }
10976
  if ($suppress) { return ''; }
10977
  $ppgno = $ppgend-$ppgstart+$offset;
 
 
 
 
 
 
 
 
10978
  if ($extras) { $ppgno = $this->nbpgPrefix . $ppgno . $this->nbpgSuffix; }
10979
  return $ppgno;
10980
  }
11047
  if (isset($h[$side][$pos]['content']) && $h[$side][$pos]['content']) {
11048
  $hd = str_replace('{PAGENO}',$pgno,$h[$side][$pos]['content']);
11049
  $hd = str_replace($this->aliasNbPgGp,$this->nbpgPrefix.$this->aliasNbPgGp.$this->nbpgSuffix,$hd);
11050
+ $hd = preg_replace('/\{DATE\s+(.*?)\}/e',"date('\\1')",$hd);
11051
  if (isset($h[$side][$pos]['font-family']) && $h[$side][$pos]['font-family']) { $hff = $h[$side][$pos]['font-family']; }
11052
  else { $hff = $this->original_default_font; }
11053
  if (isset($h[$side][$pos]['font-size']) && $h[$side][$pos]['font-size']) { $hfsz = $h[$side][$pos]['font-size']; }
11118
 
11119
  /*-- TABLES --*/
11120
  function TableHeaderFooter($content='',$tablestartpage='',$tablestartcolumn ='',$horf = 'H',$level, $firstSpread=true, $finalSpread=true) {
11121
+ if(($horf=='H' || $horf=='F') && !empty($content)) {
11122
  $table = &$this->table[1][1];
11123
  // Advance down page by half width of top border
11124
 
11751
  $html = str_replace('{PAGENO}',$this->pagenumPrefix.$this->docPageNum($this->page).$this->pagenumSuffix,$html);
11752
  $html = str_replace($this->aliasNbPgGp,$this->nbpgPrefix.$this->docPageNumTotal($this->page).$this->nbpgSuffix,$html );
11753
  $html = str_replace($this->aliasNbPg,$this->page,$html );
11754
+ $html = preg_replace('/\{DATE\s+(.*?)\}/e',"date('\\1')",$html );
11755
  $this->HTMLheaderPageLinks = array();
11756
  $this->HTMLheaderPageAnnots = array();
11757
  $this->HTMLheaderPageForms = array();
12186
  if (isset($h[$side][$pos]['content']) && $h[$side][$pos]['content']) {
12187
  $hd = str_replace('{PAGENO}',$pgno,$h[$side][$pos]['content']);
12188
  $hd = str_replace($this->aliasNbPgGp,$this->nbpgPrefix.$this->aliasNbPgGp.$this->nbpgSuffix,$hd);
12189
+ $hd = preg_replace('/\{DATE\s+(.*?)\}/e',"date('\\1')",$hd);
12190
  if (isset($h[$side][$pos]['font-family']) && $h[$side][$pos]['font-family']) { $hff = $h[$side][$pos]['font-family']; }
12191
  else { $hff = $this->original_default_font; }
12192
  if (isset($h[$side][$pos]['font-size']) && $h[$side][$pos]['font-size']) { $hfsz = $h[$side][$pos]['font-size']; }
12249
 
12250
  }
12251
 
12252
+ /*-- HYPHENATION --*/
12253
+ ///////////////////
12254
  ///////////////////
12255
  // HYPHENATION
12256
  ///////////////////
12257
+ // Soft hyphs
12258
+ function softHyphenate($word, $maxWidth) {
 
12259
  // Don't hyphenate web addresses
12260
  if (preg_match('/^(http:|www\.)/',$word)) { return array(false,'','',''); }
12261
 
12271
  $wl = mb_strlen($word,'UTF-8');
12272
  }
12273
  while($offset < $wl) {
12274
+ // Soft Hyphens chr(173)
12275
  if (!$this->usingCoreFont) {
12276
+ $p = mb_strpos($word, "\xc2\xad", $offset, 'UTF-8');
12277
  }
12278
  else if ($this->FontFamily!='csymbol' && $this->FontFamily!='czapfdingbats') {
12279
+ $p = strpos($word, chr(173), $offset);
12280
  }
12281
  if ($p !== false) { $poss[] = $p - count($poss); }
12282
  else { break; }
12303
  return array($success,$pre,$post,$prelength);
12304
  }
12305
 
 
 
 
 
 
12306
  ///////////////////
12307
+ // Word hyphenation
12308
+ function hyphenateWord($word, $maxWidth) {
12309
+ // Do everything inside this function in utf-8
12310
  // Don't hyphenate web addresses
12311
  if (preg_match('/^(http:|www\.)/',$word)) { return array(false,'','',''); }
12312
 
12313
+
12314
  // Get dictionary
12315
+ if (!$this->loadedSHYdictionary) {
12316
+ if (file_exists(_MPDF_PATH.'patterns/dictionary.txt')) {
12317
+ $this->SHYdictionary = file(_MPDF_PATH.'patterns/dictionary.txt',FILE_SKIP_EMPTY_LINES);
12318
+ foreach($this->SHYdictionary as $entry) {
12319
+ $entry = trim($entry);
12320
+ $poss = array();
12321
+ $offset = 0;
12322
+ $p = true;
12323
+ $wl = mb_strlen($entry ,'UTF-8');
12324
+ while($offset < $wl) {
12325
+ $p = mb_strpos($entry, '/', $offset, 'UTF-8');
12326
+ if ($p !== false) { $poss[] = $p - count($poss); }
12327
+ else { break; }
12328
+ $offset = $p+1;
12329
+ }
12330
+ if (count($poss)) { $this->SHYdictionaryWords[str_replace('/', '', mb_strtolower($entry))] = $poss; }
12331
+ }
12332
+ }
12333
+ $this->loadedSHYdictionary = true;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12334
  }
12335
 
12336
  if (!in_array($this->SHYlang,$this->SHYlanguages)) { return array(false,'','',''); }
12480
  if ($sub < 2) {
12481
  $this->ReadMetaTags($html);
12482
 
 
 
 
 
12483
  // NB default stylesheet now in mPDF.css - read on initialising class
12484
+ $html = $this->ReadCSS($html);
12485
 
12486
  if ($this->useLang && !$this->usingCoreFont && preg_match('/<html [^>]*lang=[\'\"](.*?)[\'\"]/ism',$html,$m)) {
12487
  $html_lang = $m[1];
12496
  $html = $m[2];
12497
  // Changed to allow style="background: url('bg.jpg')"
12498
  if (preg_match('/style=[\"](.*?)[\"]/ism',$m[1],$mm) || preg_match('/style=[\'](.*?)[\']/ism',$m[1],$mm)) {
12499
+ $zproperties = $this->readInlineCSS($mm[1]);
12500
  }
12501
  if (preg_match('/dir=[\'\"]\s*rtl\s*[\'\"]/ism',$m[1])) {
12502
  $zproperties['DIRECTION'] = 'rtl';
12508
 
12509
  }
12510
  }
12511
+ $properties = $this->MergeCSS('BLOCK','BODY','');
12512
+ if ($zproperties) { $properties = $this->array_merge_recursive_unique($properties,$zproperties); }
12513
 
12514
  if (isset($properties['DIRECTION']) && $properties['DIRECTION']) {
12515
+ $this->CSS['BODY']['DIRECTION'] = $properties['DIRECTION'];
12516
  }
12517
+ if (!isset($this->CSS['BODY']['DIRECTION'])) {
12518
+ $this->CSS['BODY']['DIRECTION'] = $this->directionality;
12519
  }
12520
+ else { $this->SetDirectionality($this->CSS['BODY']['DIRECTION']); }
12521
 
12522
  $this->setCSS($properties,'','BODY');
12523
  $this->blk[0]['InlineProperties'] = $this->saveInlineProperties();
12524
 
12525
  if ($sub == 1) { return ''; }
12526
+ if (!isset($this->CSS['BODY'])) { $this->CSS['BODY'] = array(); }
12527
 
12528
  /*-- BACKGROUNDS --*/
12529
  if (isset($properties['BACKGROUND-GRADIENT'])) {
12538
 
12539
  /*-- CSS-PAGE --*/
12540
  // If page-box is set
12541
+ if ($this->state==0 && isset($this->CSS['@PAGE']) && $this->CSS['@PAGE'] ) {
12542
  $this->page_box['current'] = '';
12543
  $this->page_box['using'] = true;
12544
  list($pborientation,$pbmgl,$pbmgr,$pbmgt,$pbmgb,$pbmgh,$pbmgf,$hname,$fname,$bg,$resetpagenum,$pagenumstyle,$suppress,$marks,$newformat) = $this->SetPagedMediaCSS('', false, 'O');
12574
  $this->bufferoutput = true;
12575
  $this->textbuffer=array();
12576
  $this->headerbuffer='';
12577
+ $properties = $this->MergeCSS('BLOCK','BODY','');
12578
  $this->setCSS($properties,'','BODY');
12579
  }
12580
 
12673
  }
12674
  // CONVERT ENCODING
12675
  $e = mb_convert_encoding($e,$this->mb_enc,'UTF-8');
12676
+ if ($this->toupper) { $e = strtoupper($e); }
12677
+ if ($this->tolower) { $e = strtolower($e); }
12678
+ if ($this->capitalize) { $e = ucwords($e); }
 
12679
  }
12680
  else {
12681
  if ($this->checkSIP && $this->CurrentFont['sipext'] && $this->subPos<$i && !$this->specialcontent) {
12682
  $cnt += $this->SubstituteCharsSIP($a, $i, $e);
12683
  }
 
12684
  if ($this->useSubstitutions && !$this->onlyCoreFonts && $this->CurrentFont['type']!='Type0' && $this->subPos<$i && !$this->specialcontent) {
 
 
12685
  $cnt += $this->SubstituteCharsMB($a, $i, $e);
12686
  }
12687
+ if ($this->biDirectional) { // *RTL*
12688
+ $e = preg_replace("/([".$this->pregRTLchars."]+)/ue", '$this->ArabJoin(stripslashes(\'\\1\'))', $e); // *RTL*
12689
+ // mPDF 5.4.05 removes U+200E/U+200F LTR and RTL mark
12690
+ // mPDF 5.4.06 removes U+200C/U+200D Zero-width Joiner and Non-joiner
12691
+ $e = preg_replace("/[\xe2\x80\x8c\xe2\x80\x8d\xe2\x80\x8e\xe2\x80\x8f]/u",'',$e);
12692
  } // *RTL*
12693
  // Font-specific ligature substitution for Indic fonts
12694
  if (isset($this->CurrentFont['indic']) && $this->CurrentFont['indic']) $this->ConvertIndic($e); // *INDIC*
12695
 
 
 
 
12696
  if ($this->toupper) { $e = mb_strtoupper($e,$this->mb_enc); }
12697
  if ($this->tolower) { $e = mb_strtolower($e,$this->mb_enc); }
12698
  if ($this->capitalize) { $e = mb_convert_case($e, MB_CASE_TITLE, "UTF-8"); }
12768
 
12769
  if ($this->checkCJK && preg_match("/([".$this->pregCJKchars."])/u", $e)) { $this->tableCJK = true; } // *CJK-FONTS*
12770
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12771
  if ($this->tableLevel==1 && $this->useGraphs) {
12772
  $this->graphs[$this->currentGraphId]['data'][$this->row][$this->col] = $e;
12773
  }
12868
  /*-- END CSS-POSITION --*/
12869
  $regexp = '|=\'(.*?)\'|s'; // eliminate single quotes, if any
12870
  $e = preg_replace($regexp,"=\"\$1\"",$e);
12871
+ // changes anykey=anyvalue to anykey="anyvalue" (only do this inside tags)
12872
+ if (substr($e,0,10)!='pageheader' && substr($e,0,10)!='pagefooter') {
12873
  $regexp = '| (\\w+?)=([^\\s>"]+)|si';
12874
  $e = preg_replace($regexp," \$1=\"\$2\"",$e);
12875
  }
12898
  $contents2=array();
12899
  // Changed to allow style="background: url('bg.jpg')"
12900
  // mPDF 5.5.17 Changed to improve performance; maximum length of \S (attribute) = 16
12901
+ preg_match_all('/\\S{1,16}=["][^"]*["]/',$e,$contents1);
12902
+ preg_match_all('/\\S{1,16}=[\'][^\']*[\']/i',$e,$contents2);
 
12903
 
12904
  $contents = array_merge($contents1, $contents2);
12905
  preg_match('/\\S+/',$e,$a2);
13068
 
13069
  $this->blk[0]['blockContext'] = $this->blockContext;
13070
 
13071
+ $properties = $this->MergeCSS('BLOCK','BODY','');
13072
  $this->setCSS($properties,'','BODY');
13073
  $this->blklvl = 1;
13074
  $this->initialiseBlock($this->blk[1]);
13075
  $this->blk[1]['tag'] = $tag;
13076
  $this->blk[1]['attr'] = $attr;
13077
  $this->Reset();
13078
+ $p = $this->MergeCSS('BLOCK',$tag,$attr);
13079
+ if (isset($p['ROTATE']) && ($p['ROTATE']==90 || $p['ROTATE']==-90)) { $rotate = $p['ROTATE']; }
13080
  else { $rotate = 0; }
13081
  if (isset($p['OVERFLOW'])) { $overflow = strtolower($p['OVERFLOW']); }
13082
  if (strtolower($p['POSITION']) == 'fixed') {
13103
  if (isset($p['FONT-WEIGHT'])) { $css .= 'font-weight: '.strtolower($p['FONT-WEIGHT']).'; '; }
13104
  if (isset($p['FONT-SIZE'])) { $css .= 'font-size: '.strtolower($p['FONT-SIZE']).'; '; }
13105
  if (isset($p['LINE-HEIGHT'])) { $css .= 'line-height: '.strtolower($p['LINE-HEIGHT']).'; '; }
13106
+ if (isset($p['TEXT-ALIGN'])) { $css .= 'text-align: '.strtolower($p['TEXT-ALIGN']).'; '; }
13107
  if (isset($p['TEXT-SHADOW'])) { $css .= 'text-shadow: '.strtolower($p['TEXT-SHADOW']).'; '; }
13108
  if (isset($p['LETTER-SPACING'])) { $css .= 'letter-spacing: '.strtolower($p['LETTER-SPACING']).'; '; }
13109
  if (isset($p['FONT-VARIANT'])) { $css .= 'font-variant: '.strtolower($p['FONT-VARIANT']).'; '; }
13135
  $pb['BORDER-BOTTOM-RIGHT-RADIUS-H'] = $p['BORDER-BOTTOM-RIGHT-RADIUS-H'];
13136
  $pb['BORDER-BOTTOM-RIGHT-RADIUS-V'] = $p['BORDER-BOTTOM-RIGHT-RADIUS-V'];
13137
  if (isset($p['BACKGROUND-COLOR'])) { $pb['BACKGROUND-COLOR'] = $p['BACKGROUND-COLOR']; }
13138
+ if (isset($p['BOX-SHADOW'])) { $pb['BOX-SHADOW'] = $p['BOX-SHADOW']; }
13139
  /*-- BACKGROUNDS --*/
13140
  if (isset($p['BACKGROUND-IMAGE'])) { $pb['BACKGROUND-IMAGE'] = $p['BACKGROUND-IMAGE']; }
13141
  if (isset($p['BACKGROUND-IMAGE-RESIZE'])) { $pb['BACKGROUND-IMAGE-RESIZE'] = $p['BACKGROUND-IMAGE-RESIZE']; }
13143
  if (isset($p['BACKGROUND-REPEAT'])) { $pb['BACKGROUND-REPEAT'] = $p['BACKGROUND-REPEAT']; }
13144
  if (isset($p['BACKGROUND-POSITION'])) { $pb['BACKGROUND-POSITION'] = $p['BACKGROUND-POSITION']; }
13145
  if (isset($p['BACKGROUND-GRADIENT'])) { $pb['BACKGROUND-GRADIENT'] = $p['BACKGROUND-GRADIENT']; }
 
 
 
 
13146
  /*-- END BACKGROUNDS --*/
13147
 
13148
  $this->setCSS($pb,'BLOCK',$tag);
13417
  $inner_h = $h;
13418
 
13419
  }
13420
+
13421
  $this->lMargin=$x;
13422
  $this->rMargin=$this->w - $w - $x;
13423
  // SET POSITION & FONT VALUES
13761
  }
13762
 
13763
 
13764
+ function _fix_borderStr($bd) {
13765
+ // mPDF 5.5.04
13766
+ preg_match_all("/\((.*?)\)/", $bd, $m);
13767
+ if (count($m[1])) {
13768
+ for($i=0;$i<count($m[1]);$i++) {
13769
+ $sub = preg_replace("/ /", "", $m[1][$i]);
13770
+ $bd = preg_replace('/'.preg_quote($m[1][$i], '/').'/si', $sub, $bd);
13771
+ }
13772
+ }
13773
+
13774
+ $prop = preg_split('/\s+/',trim($bd));
13775
+ $w = 'medium';
13776
+ $c = '#000000';
13777
+ $s = 'none';
13778
+
13779
+ if ( count($prop) == 1 ) {
13780
+ // solid
13781
+ if (in_array($prop[0],$this->borderstyles) || $prop[0] == 'none' || $prop[0] == 'hidden' ) { $s = $prop[0]; }
13782
+ // #000000
13783
+ else if (is_array($this->ConvertColor($prop[0]))) { $c = $prop[0]; }
13784
+ // 1px
13785
+ else { $w = $prop[0]; }
13786
+ }
13787
+ else if (count($prop) == 2 ) {
13788
+ // 1px solid
13789
+ if (in_array($prop[1],$this->borderstyles) || $prop[1] == 'none' || $prop[1] == 'hidden' ) { $w = $prop[0]; $s = $prop[1]; }
13790
+ // solid #000000
13791
+ else if (in_array($prop[0],$this->borderstyles) || $prop[0] == 'none' || $prop[0] == 'hidden' ) { $s = $prop[0]; $c = $prop[1]; }
13792
+ // 1px #000000
13793
+ else { $w = $prop[0]; $c = $prop[1]; }
13794
+ }
13795
+ else if ( count($prop) == 3 ) {
13796
+ // Change #000000 1px solid to 1px solid #000000 (proper)
13797
+ if (substr($prop[0],0,1) == '#') { $c = $prop[0]; $w = $prop[1]; $s = $prop[2]; }
13798
+ // Change solid #000000 1px to 1px solid #000000 (proper)
13799
+ else if (substr($prop[0],1,1) == '#') { $s = $prop[0]; $c = $prop[1]; $w = $prop[2]; }
13800
+ // Change solid 1px #000000 to 1px solid #000000 (proper)
13801
+ else if (in_array($prop[0],$this->borderstyles) || $prop[0] == 'none' || $prop[0] == 'hidden' ) {
13802
+ $s = $prop[0]; $w = $prop[1]; $c = $prop[2];
13803
+ }
13804
+ else { $w = $prop[0]; $s = $prop[1]; $c = $prop[2]; }
13805
+ }
13806
+ else { return ''; }
13807
+ $s = strtolower($s);
13808
+ return $w.' '.$s.' '.$c;
13809
+ }
13810
+
13811
+
13812
+
13813
+ // NEW FUNCTION FOR CSS MARGIN or PADDING called from SetCSS
13814
+ function fixCSS($prop) {
13815
+ if (!is_array($prop) || (count($prop)==0)) return array();
13816
+ $newprop = array();
13817
+ foreach($prop AS $k => $v) {
13818
+ if ($k != 'BACKGROUND-IMAGE' && $k != 'BACKGROUND' && $k != 'ODD-HEADER-NAME' && $k != 'EVEN-HEADER-NAME' && $k != 'ODD-FOOTER-NAME' && $k != 'EVEN-FOOTER-NAME' && $k != 'HEADER' && $k != 'FOOTER') {
13819
+ $v = strtolower($v);
13820
+ }
13821
+
13822
+ if ($k == 'FONT') {
13823
+ $s = trim($v);
13824
+ preg_match_all('/\"(.*?)\"/',$s,$ff);
13825
+ if (count($ff[1])) {
13826
+ foreach($ff[1] AS $ffp) {
13827
+ $w = preg_split('/\s+/',$ffp);
13828
+ $s = preg_replace('/\"'.$ffp.'\"/',$w[0],$s);
13829
+ }
13830
+ }
13831
+ preg_match_all('/\'(.*?)\'/',$s,$ff);
13832
+ if (count($ff[1])) {
13833
+ foreach($ff[1] AS $ffp) {
13834
+ $w = preg_split('/\s+/',$ffp);
13835
+ $s = preg_replace('/\''.$ffp.'\'/',$w[0],$s);
13836
+ }
13837
+ }
13838
+ $s = preg_replace('/\s*,\s*/',',',$s);
13839
+ $bits = preg_split('/\s+/',$s);
13840
+ if (count($bits)>1) {
13841
+ $k = 'FONT-FAMILY'; $v = $bits[(count($bits)-1)];
13842
+ $fs = $bits[(count($bits)-2)];
13843
+ if (preg_match('/(.*?)\/(.*)/',$fs, $fsp)) {
13844
+ $newprop['FONT-SIZE'] = $fsp[1];
13845
+ $newprop['LINE-HEIGHT'] = $fsp[2];
13846
+ }
13847
+ else { $newprop['FONT-SIZE'] = $fs; }
13848
+ if (preg_match('/(italic|oblique)/i',$s)) { $newprop['FONT-STYLE'] = 'italic'; }
13849
+ else { $newprop['FONT-STYLE'] = 'normal'; }
13850
+ if (preg_match('/bold/i',$s)) { $newprop['FONT-WEIGHT'] = 'bold'; }
13851
+ else { $newprop['FONT-WEIGHT'] = 'normal'; }
13852
+ if (preg_match('/small-caps/i',$s)) { $newprop['TEXT-TRANSFORM'] = 'uppercase'; }
13853
+ }
13854
+ }
13855
+ if ($k == 'FONT-FAMILY') {
13856
+ $aux_fontlist = explode(",",$v);
13857
+ $found = 0;
13858
+ foreach($aux_fontlist AS $f) {
13859
+ $fonttype = trim($f);
13860
+ $fonttype = preg_replace('/["\']*(.*?)["\']*/','\\1',$fonttype);
13861
+ $fonttype = preg_replace('/ /','',$fonttype);
13862
+ $v = strtolower(trim($fonttype));
13863
+ if (isset($this->fonttrans[$v]) && $this->fonttrans[$v]) { $v = $this->fonttrans[$v]; }
13864
+ if ((!$this->onlyCoreFonts && in_array($v,$this->available_unifonts)) ||
13865
+ in_array($v,array('ccourier','ctimes','chelvetica')) ||
13866
+ ($this->onlyCoreFonts && in_array($v,array('courier','times','helvetica','arial'))) ||
13867
+ in_array($v, array('sjis','uhc','big5','gb'))) {
13868
+ $newprop[$k] = $v;
13869
+ $found = 1;
13870
+ break;
13871
+ }
13872
+ }
13873
+ if (!$found) {
13874
+ foreach($aux_fontlist AS $f) {
13875
+ $fonttype = trim($f);
13876
+ $fonttype = preg_replace('/["\']*(.*?)["\']*/','\\1',$fonttype);
13877
+ $fonttype = preg_replace('/ /','',$fonttype);
13878
+ $v = strtolower(trim($fonttype));
13879
+ if (isset($this->fonttrans[$v]) && $this->fonttrans[$v]) { $v = $this->fonttrans[$v]; }
13880
+ if (in_array($v,$this->sans_fonts) || in_array($v,$this->serif_fonts) || in_array($v,$this->mono_fonts) ) {
13881
+ $newprop[$k] = $v;
13882
+ break;
13883
+ }
13884
+ }
13885
+ }
13886
+ }
13887
+ else if ($k == 'MARGIN') {
13888
+ $tmp = $this->expand24($v);
13889
+ $newprop['MARGIN-TOP'] = $tmp['T'];
13890
+ $newprop['MARGIN-RIGHT'] = $tmp['R'];
13891
+ $newprop['MARGIN-BOTTOM'] = $tmp['B'];
13892
+ $newprop['MARGIN-LEFT'] = $tmp['L'];
13893
+ }
13894
+ /*-- BORDER-RADIUS --*/
13895
+ else if ($k == 'BORDER-RADIUS' || $k == 'BORDER-TOP-LEFT-RADIUS' || $k == 'BORDER-TOP-RIGHT-RADIUS' || $k == 'BORDER-BOTTOM-LEFT-RADIUS' || $k == 'BORDER-BOTTOM-RIGHT-RADIUS') {
13896
+ $tmp = $this->border_radius_expand($v,$k);
13897
+ if (isset($tmp['TL-H'])) $newprop['BORDER-TOP-LEFT-RADIUS-H'] = $tmp['TL-H'];
13898
+ if (isset($tmp['TL-V'])) $newprop['BORDER-TOP-LEFT-RADIUS-V'] = $tmp['TL-V'];
13899
+ if (isset($tmp['TR-H'])) $newprop['BORDER-TOP-RIGHT-RADIUS-H'] = $tmp['TR-H'];
13900
+ if (isset($tmp['TR-V'])) $newprop['BORDER-TOP-RIGHT-RADIUS-V'] = $tmp['TR-V'];
13901
+ if (isset($tmp['BL-H'])) $newprop['BORDER-BOTTOM-LEFT-RADIUS-H'] = $tmp['BL-H'];
13902
+ if (isset($tmp['BL-V'])) $newprop['BORDER-BOTTOM-LEFT-RADIUS-V'] = $tmp['BL-V'];
13903
+ if (isset($tmp['BR-H'])) $newprop['BORDER-BOTTOM-RIGHT-RADIUS-H'] = $tmp['BR-H'];
13904
+ if (isset($tmp['BR-V'])) $newprop['BORDER-BOTTOM-RIGHT-RADIUS-V'] = $tmp['BR-V'];
13905
+ }
13906
+ /*-- END BORDER-RADIUS --*/
13907
+ else if ($k == 'PADDING') {
13908
+ $tmp = $this->expand24($v);
13909
+ $newprop['PADDING-TOP'] = $tmp['T'];
13910
+ $newprop['PADDING-RIGHT'] = $tmp['R'];
13911
+ $newprop['PADDING-BOTTOM'] = $tmp['B'];
13912
+ $newprop['PADDING-LEFT'] = $tmp['L'];
13913
+ }
13914
+ else if ($k == 'BORDER') {
13915
+ if ($v == '1') { $v = '1px solid #000000'; }
13916
+ else { $v = $this->_fix_borderStr($v); }
13917
+ $newprop['BORDER-TOP'] = $v;
13918
+ $newprop['BORDER-RIGHT'] = $v;
13919
+ $newprop['BORDER-BOTTOM'] = $v;
13920
+ $newprop['BORDER-LEFT'] = $v;
13921
+ }
13922
+ else if ($k == 'BORDER-TOP') {
13923
+ $newprop['BORDER-TOP'] = $this->_fix_borderStr($v);
13924
+ }
13925
+ else if ($k == 'BORDER-RIGHT') {
13926
+ $newprop['BORDER-RIGHT'] = $this->_fix_borderStr($v);
13927
+ }
13928
+ else if ($k == 'BORDER-BOTTOM') {
13929
+ $newprop['BORDER-BOTTOM'] = $this->_fix_borderStr($v);
13930
+ }
13931
+ else if ($k == 'BORDER-LEFT') {
13932
+ $newprop['BORDER-LEFT'] = $this->_fix_borderStr($v);
13933
+ }
13934
+ else if ($k == 'BORDER-STYLE') {
13935
+ $e = $this->expand24($v);
13936
+ $newprop['BORDER-TOP-STYLE'] = $e['T'];
13937
+ $newprop['BORDER-RIGHT-STYLE'] = $e['R'];
13938
+ $newprop['BORDER-BOTTOM-STYLE'] = $e['B'];
13939
+ $newprop['BORDER-LEFT-STYLE'] = $e['L'];
13940
+ }
13941
+ else if ($k == 'BORDER-WIDTH') {
13942
+ $e = $this->expand24($v);
13943
+ $newprop['BORDER-TOP-WIDTH'] = $e['T'];
13944
+ $newprop['BORDER-RIGHT-WIDTH'] = $e['R'];
13945
+ $newprop['BORDER-BOTTOM-WIDTH'] = $e['B'];
13946
+ $newprop['BORDER-LEFT-WIDTH'] = $e['L'];
13947
+ }
13948
+ else if ($k == 'BORDER-COLOR') {
13949
+ $e = $this->expand24($v);
13950
+ $newprop['BORDER-TOP-COLOR'] = $e['T'];
13951
+ $newprop['BORDER-RIGHT-COLOR'] = $e['R'];
13952
+ $newprop['BORDER-BOTTOM-COLOR'] = $e['B'];
13953
+ $newprop['BORDER-LEFT-COLOR'] = $e['L'];
13954
+ }
13955
+
13956
+ else if ($k == 'BORDER-SPACING') {
13957
+ $prop = preg_split('/\s+/',trim($v));
13958
+ if (count($prop) == 1 ) {
13959
+ $newprop['BORDER-SPACING-H'] = $prop[0];
13960
+ $newprop['BORDER-SPACING-V'] = $prop[0];
13961
+ }
13962
+ else if (count($prop) == 2 ) {
13963
+ $newprop['BORDER-SPACING-H'] = $prop[0];
13964
+ $newprop['BORDER-SPACING-V'] = $prop[1];
13965
+ }
13966
+ }
13967
+ else if ($k == 'SIZE') {
13968
+ $prop = preg_split('/\s+/',trim($v));
13969
+ if (preg_match('/(auto|portrait|landscape)/',$prop[0])) {
13970
+ $newprop['SIZE'] = strtoupper($prop[0]);
13971
+ }
13972
+ else if (count($prop) == 1 ) {
13973
+ $newprop['SIZE']['W'] = $this->ConvertSize($prop[0]);
13974
+ $newprop['SIZE']['H'] = $this->ConvertSize($prop[0]);
13975
+ }
13976
+ else if (count($prop) == 2 ) {
13977
+ $newprop['SIZE']['W'] = $this->ConvertSize($prop[0]);
13978
+ $newprop['SIZE']['H'] = $this->ConvertSize($prop[1]);
13979
+ }
13980
+ }
13981
+ else if ($k == 'SHEET-SIZE') {
13982
+ $prop = preg_split('/\s+/',trim($v));
13983
+ if (count($prop) == 2 ) {
13984
+ $newprop['SHEET-SIZE'] = array($this->ConvertSize($prop[0]), $this->ConvertSize($prop[1]));
13985
+ }
13986
+ else {
13987
+ if(preg_match('/([0-9a-zA-Z]*)-L/i',$v,$m)) { // e.g. A4-L = A$ landscape
13988
+ $ft = $this->_getPageFormat($m[1]);
13989
+ $format = array($ft[1],$ft[0]);
13990
+ }
13991
+ else { $format = $this->_getPageFormat($v); }
13992
+ if ($format) { $newprop['SHEET-SIZE'] = array($format[0]/_MPDFK, $format[1]/_MPDFK); }
13993
+ }
13994
+ }
13995
+ else if ($k == 'BACKGROUND') {
13996
+ $bg = $this->parseCSSbackground($v);
13997
+ if ($bg['c']) { $newprop['BACKGROUND-COLOR'] = $bg['c']; }
13998
+ else { $newprop['BACKGROUND-COLOR'] = 'transparent'; }
13999
+ /*-- BACKGROUNDS --*/
14000
+ if ($bg['i']) {
14001
+ $newprop['BACKGROUND-IMAGE'] = $bg['i'];
14002
+ if ($bg['r']) { $newprop['BACKGROUND-REPEAT'] = $bg['r']; }
14003
+ if ($bg['p']) { $newprop['BACKGROUND-POSITION'] = $bg['p']; }
14004
+ }
14005
+ else { $newprop['BACKGROUND-IMAGE'] = ''; }
14006
+ /*-- END BACKGROUNDS --*/
14007
+ }
14008
+ /*-- BACKGROUNDS --*/
14009
+ else if ($k == 'BACKGROUND-IMAGE') {
14010
+ if (preg_match('/(-moz-)*(repeating-)*(linear|radial)-gradient\(.*\)/i',$v,$m)) {
14011
+ $newprop['BACKGROUND-IMAGE'] = $m[0];
14012
+ continue;
14013
+ }
14014
+ if (preg_match('/url\([\'\"]{0,1}(.*?)[\'\"]{0,1}\)/i',$v,$m)) {
14015
+ $newprop['BACKGROUND-IMAGE'] = $m[1];
14016
+ }
14017
+
14018
+ else if (strtolower($v)=='none') { $newprop['BACKGROUND-IMAGE'] = ''; }
14019
+
14020
+ }
14021
+ else if ($k == 'BACKGROUND-REPEAT') {
14022
+ if (preg_match('/(repeat-x|repeat-y|no-repeat|repeat)/i',$v,$m)) {
14023
+ $newprop['BACKGROUND-REPEAT'] = strtolower($m[1]);
14024
+ }
14025
+ }
14026
+ else if ($k == 'BACKGROUND-POSITION') {
14027
+ $s = $v;
14028
+ $bits = preg_split('/\s+/',trim($s));
14029
+ // These should be Position x1 or x2
14030
+ if (count($bits)==1) {
14031
+ if (preg_match('/bottom/',$bits[0])) { $bg['p'] = '50% 100%'; }
14032
+ else if (preg_match('/top/',$bits[0])) { $bg['p'] = '50% 0%'; }
14033
+ else { $bg['p'] = $bits[0] . ' 50%'; }
14034
+ }
14035
+ else if (count($bits)==2) {
14036
+ // Can be either right center or center right
14037
+ if (preg_match('/(top|bottom)/',$bits[0]) || preg_match('/(left|right)/',$bits[1])) {
14038
+ $bg['p'] = $bits[1] . ' '.$bits[0];
14039
+ }
14040
+ else {
14041
+ $bg['p'] = $bits[0] . ' '.$bits[1];
14042
+ }
14043
+ }
14044
+ if ($bg['p']) {
14045
+ $bg['p'] = preg_replace('/(left|top)/','0%',$bg['p']);
14046
+ $bg['p'] = preg_replace('/(right|bottom)/','100%',$bg['p']);
14047
+ $bg['p'] = preg_replace('/(center)/','50%',$bg['p']);
14048
+ if (!preg_match('/[\-]{0,1}\d+(in|cm|mm|pt|pc|em|ex|px|%)* [\-]{0,1}\d+(in|cm|mm|pt|pc|em|ex|px|%)*/',$bg['p'])) {
14049
+ $bg['p'] = false;
14050
+ }
14051
+ }
14052
+ if ($bg['p']) { $newprop['BACKGROUND-POSITION'] = $bg['p']; }
14053
+ }
14054
+ /*-- END BACKGROUNDS --*/
14055
+ else if ($k == 'IMAGE-ORIENTATION') {
14056
+ if (preg_match('/([\-]*[0-9\.]+)(deg|grad|rad)/i',$v,$m)) {
14057
+ $angle = $m[1] + 0;
14058
+ if (strtolower($m[2])=='deg') { $angle = $angle; }
14059
+ else if (strtolower($m[2])=='grad') { $angle *= (360/400); }
14060
+ else if (strtolower($m[2])=='rad') { $angle = rad2deg($angle); }
14061
+ while($angle < 0) { $angle += 360; }
14062
+ $angle = ($angle % 360);
14063
+ $angle /= 90;
14064
+ $angle = round($angle) * 90;
14065
+ $newprop['IMAGE-ORIENTATION'] = $angle;
14066
+ }
14067
+ }
14068
+ else {
14069
+ $newprop[$k] = $v;
14070
+ }
14071
+ }
14072
+
14073
+ return $newprop;
14074
+ }
14075
+
14076
+ function setCSSboxshadow($v) {
14077
+ $sh = array();
14078
+ $c = preg_match_all('/(rgba|rgb|cmyka|cmyk|hsla|hsl)\(.*?\)/',$v,$x);
14079
+ for($i=0; $i<$c; $i++) {
14080
+ $col = preg_replace('/,/','*',$x[0][$i]);
14081
+ $v = preg_replace('/'.preg_quote($x[0][$i],'/').'/',$col,$v);
14082
+ }
14083
+ $ss = explode(',',$v);
14084
+ foreach ($ss AS $s) {
14085
+ $new = array('inset'=>false, 'blur'=>0, 'spread'=>0);
14086
+ if (preg_match('/inset/i',$s)) { $new['inset'] = true; $s = preg_replace('/\s*inset\s*/','',$s); }
14087
+ $p = explode(' ',trim($s));
14088
+ if (isset($p[0])) { $new['x'] = $this->ConvertSize(trim($p[0]),$this->blk[$this->blklvl-1]['inner_width'],$this->FontSize,false); }
14089
+ if (isset($p[1])) { $new['y'] = $this->ConvertSize(trim($p[1]),$this->blk[$this->blklvl-1]['inner_width'],$this->FontSize,false); }
14090
+ if (isset($p[2])) {
14091
+ if (preg_match('/^\s*[\.\-0-9]/',$p[2])) {
14092
+ $new['blur'] = $this->ConvertSize(trim($p[2]),$this->blk[$this->blklvl-1]['inner_width'],$this->FontSize,false);
14093
+ }
14094
+ else { $new['col'] = $this->ConvertColor(preg_replace('/\*/',',',$p[2])); }
14095
+ if (isset($p[3])) {
14096
+ if (preg_match('/^\s*[\.\-0-9]/',$p[3])) {
14097
+ $new['spread'] = $this->ConvertSize(trim($p[3]),$this->blk[$this->blklvl-1]['inner_width'],$this->FontSize,false);
14098
+ }
14099
+ else { $new['col'] = $this->ConvertColor(preg_replace('/\*/',',',$p[3])); }
14100
+ if (isset($p[4])) {
14101
+ $new['col'] = $this->ConvertColor(preg_replace('/\*/',',',$p[4]));
14102
+ }
14103
+ }
14104
+ }
14105
+ if (!$new['col']) { $new['col'] = $this->ConvertColor('#888888'); }
14106
+ if (isset($new['y'])) { array_unshift($sh, $new); }
14107
+ }
14108
+ return $sh;
14109
+ }
14110
+
14111
+ function setCSStextshadow($v) {
14112
+ $sh = array();
14113
+ $c = preg_match_all('/(rgba|rgb|cmyka|cmyk|hsla|hsl)\(.*?\)/',$v,$x);
14114
+ for($i=0; $i<$c; $i++) {
14115
+ $col = preg_replace('/,/','*',$x[0][$i]);
14116
+ $v = preg_replace('/'.preg_quote($x[0][$i],'/').'/',$col,$v);
14117
+ }
14118
+ $ss = explode(',',$v);
14119
+ foreach ($ss AS $s) {
14120
+ $new = array('blur'=>0);
14121
+ $p = explode(' ',trim($s));
14122
+ if (isset($p[0])) { $new['x'] = $this->ConvertSize(trim($p[0]),$this->blk[$this->blklvl-1]['inner_width'],$this->FontSize,false); }
14123
+ if (isset($p[1])) { $new['y'] = $this->ConvertSize(trim($p[1]),$this->blk[$this->blklvl-1]['inner_width'],$this->FontSize,false); }
14124
+ if (isset($p[2])) {
14125
+ if (preg_match('/^\s*[\.\-0-9]/',$p[2])) {
14126
+ $new['blur'] = $this->ConvertSize(trim($p[2]),$this->blk[$this->blklvl-1]['inner_width'],$this->FontSize,false);
14127
+ }
14128
+ else { $new['col'] = $this->ConvertColor(preg_replace('/\*/',',',$p[2])); }
14129
+ if (isset($p[3])) {
14130
+ $new['col'] = $this->ConvertColor(preg_replace('/\*/',',',$p[3]));
14131
+ }
14132
+ }
14133
+ if (!$new['col']) { $new['col'] = $this->ConvertColor('#888888'); }
14134
+ if (isset($new['y'])) { array_unshift($sh, $new); }
14135
+ }
14136
+ return $sh;
14137
+ }
14138
+
14139
+ function parseCSSbackground($s) {
14140
+ $bg = array('c'=>false, 'i'=>false, 'r'=>false, 'p'=>false, );
14141
+ /*-- BACKGROUNDS --*/
14142
+ if (preg_match('/(-moz-)*(repeating-)*(linear|radial)-gradient\(.*\)/i',$s,$m)) {
14143
+ $bg['i'] = $m[0];
14144
+ }
14145
+ else
14146
+ /*-- END BACKGROUNDS --*/
14147
+ if (preg_match('/url\(/i',$s)) {
14148
+ // If color, set and strip it off
14149
+ if (preg_match('/^\s*(#[0-9a-fA-F]{3,6}|(rgba|rgb|cmyka|cmyk|hsla|hsl|spot)\(.*?\)|[a-zA-Z]{3,})\s+(url\(.*)/i',$s,$m)) {
14150
+ $bg['c'] = strtolower($m[1]);
14151
+ $s = $m[3];
14152
+ }
14153
+ /*-- BACKGROUNDS --*/
14154
+ if (preg_match('/url\([\'\"]{0,1}(.*?)[\'\"]{0,1}\)\s*(.*)/i',$s,$m)) {
14155
+ $bg['i'] = $m[1];
14156
+ $s = strtolower($m[2]);
14157
+ if (preg_match('/(repeat-x|repeat-y|no-repeat|repeat)/',$s,$m)) {
14158
+ $bg['r'] = $m[1];
14159
+ }
14160
+ // Remove repeat, attachment (discarded) and also any inherit
14161
+ $s = preg_replace('/(repeat-x|repeat-y|no-repeat|repeat|scroll|fixed|inherit)/','',$s);
14162
+ $bits = preg_split('/\s+/',trim($s));
14163
+ // These should be Position x1 or x2
14164
+ if (count($bits)==1) {
14165
+ if (preg_match('/bottom/',$bits[0])) { $bg['p'] = '50% 100%'; }
14166
+ else if (preg_match('/top/',$bits[0])) { $bg['p'] = '50% 0%'; }
14167
+ else { $bg['p'] = $bits[0] . ' 50%'; }
14168
+ }
14169
+ else if (count($bits)==2) {
14170
+ // Can be either right center or center right
14171
+ if (preg_match('/(top|bottom)/',$bits[0]) || preg_match('/(left|right)/',$bits[1])) {
14172
+ $bg['p'] = $bits[1] . ' '.$bits[0];
14173
+ }
14174
+ else {
14175
+ $bg['p'] = $bits[0] . ' '.$bits[1];
14176
+ }
14177
+ }
14178
+ if ($bg['p']) {
14179
+ $bg['p'] = preg_replace('/(left|top)/','0%',$bg['p']);
14180
+ $bg['p'] = preg_replace('/(right|bottom)/','100%',$bg['p']);
14181
+ $bg['p'] = preg_replace('/(center)/','50%',$bg['p']);
14182
+ if (!preg_match('/[\-]{0,1}\d+(in|cm|mm|pt|pc|em|ex|px|%)* [\-]{0,1}\d+(in|cm|mm|pt|pc|em|ex|px|%)*/',$bg['p'])) {
14183
+ $bg['p'] = false;
14184
+ }
14185
+ }
14186
+ }
14187
+ /*-- END BACKGROUNDS --*/
14188
+ }
14189
+ else if (preg_match('/^\s*(#[0-9a-fA-F]{3,6}|(rgba|rgb|cmyka|cmyk|hsla|hsl|spot)\(.*?\)|[a-zA-Z]{3,})/i',$s,$m)) { $bg['c'] = strtolower($m[1]); }
14190
+ return ($bg);
14191
+ }
14192
+
14193
+
14194
+ function expand24($mp) {
14195
+ $prop = preg_split('/\s+/',trim($mp));
14196
+ if (count($prop) == 1 ) {
14197
+ return array('T' => $prop[0], 'R' => $prop[0], 'B' => $prop[0], 'L'=> $prop[0]);
14198
+ }
14199
+ if (count($prop) == 2 ) {
14200
+ return array('T' => $prop[0], 'R' => $prop[1], 'B' => $prop[0], 'L'=> $prop[1]);
14201
+ }
14202
+
14203
+ if (count($prop) == 3 ) {
14204
+ return array('T' => $prop[0], 'R' => $prop[1], 'B' => $prop[2], 'L'=> $prop[1]);
14205
+ }
14206
+ if (count($prop) == 4 ) {
14207
+ return array('T' => $prop[0], 'R' => $prop[1], 'B' => $prop[2], 'L'=> $prop[3]);
14208
+ }
14209
+ return array();
14210
+ }
14211
+
14212
+ /*-- BORDER-RADIUS --*/
14213
+ function border_radius_expand($val,$k) {
14214
+ $b = array();
14215
+ if ($k == 'BORDER-RADIUS') {
14216
+ $hv = explode('/',trim($val));
14217
+ $prop = preg_split('/\s+/',trim($hv[0]));
14218
+ if (count($prop)==1) {
14219
+ $b['TL-H'] = $b['TR-H'] = $b['BR-H'] = $b['BL-H'] = $prop[0];
14220
+ }
14221
+ else if (count($prop)==2) {
14222
+ $b['TL-H'] = $b['BR-H'] = $prop[0];
14223
+ $b['TR-H'] = $b['BL-H'] = $prop[1];
14224
+ }
14225
+ else if (count($prop)==3) {
14226
+ $b['TL-H'] = $prop[0];
14227
+ $b['TR-H'] = $b['BL-H'] = $prop[1];
14228
+ $b['BR-H'] = $prop[2];
14229
+ }
14230
+ else if (count($prop)==4) {
14231
+ $b['TL-H'] = $prop[0];
14232
+ $b['TR-H'] = $prop[1];
14233
+ $b['BR-H'] = $prop[2];
14234
+ $b['BL-H'] = $prop[3];
14235
+ }
14236
+ if (count($hv)==2) {
14237
+ $prop = preg_split('/\s+/',trim($hv[1]));
14238
+ if (count($prop)==1) {
14239
+ $b['TL-V'] = $b['TR-V'] = $b['BR-V'] = $b['BL-V'] = $prop[0];
14240
+ }
14241
+ else if (count($prop)==2) {
14242
+ $b['TL-V'] = $b['BR-V'] = $prop[0];
14243
+ $b['TR-V'] = $b['BL-V'] = $prop[1];
14244
+ }
14245
+ else if (count($prop)==3) {
14246
+ $b['TL-V'] = $prop[0];
14247
+ $b['TR-V'] = $b['BL-V'] = $prop[1];
14248
+ $b['BR-V'] = $prop[2];
14249
+ }
14250
+ else if (count($prop)==4) {
14251
+ $b['TL-V'] = $prop[0];
14252
+ $b['TR-V'] = $prop[1];
14253
+ $b['BR-V'] = $prop[2];
14254
+ $b['BL-V'] = $prop[3];
14255
+ }
14256
+ }
14257
+ else {
14258
+ $b['TL-V'] = $b['TL-H'];
14259
+ $b['TR-V'] = $b['TR-H'];
14260
+ $b['BL-V'] = $b['BL-H'];
14261
+ $b['BR-V'] = $b['BR-H'];
14262
+ }
14263
+ return $b;
14264
+ }
14265
+
14266
+ // Parse 2
14267
+ $h = 0;
14268
+ $v = 0;
14269
+ $prop = preg_split('/\s+/',trim($val));
14270
+ if (count($prop)==1) { $h = $v = $val; }
14271
+ else { $h = $prop[0]; $v = $prop[1]; }
14272
+ if ($h==0 || $v==0) { $h = $v = 0; }
14273
+ if ($k == 'BORDER-TOP-LEFT-RADIUS') {
14274
+ $b['TL-H'] = $h;
14275
+ $b['TL-V'] = $v;
14276
+ }
14277
+ else if ($k == 'BORDER-TOP-RIGHT-RADIUS') {
14278
+ $b['TR-H'] = $h;
14279
+ $b['TR-V'] = $v;
14280
+ }
14281
+ else if ($k == 'BORDER-BOTTOM-LEFT-RADIUS') {
14282
+ $b['BL-H'] = $h;
14283
+ $b['BL-V'] = $v;
14284
+ }
14285
+ else if ($k == 'BORDER-BOTTOM-RIGHT-RADIUS') {
14286
+ $b['BR-H'] = $h;
14287
+ $b['BR-V'] = $v;
14288
+ }
14289
+ return $b;
14290
+
14291
+ }
14292
+ /*-- END BORDER-RADIUS --*/
14293
+
14294
 
14295
  /*-- END HTML-CSS --*/
14296
 
14302
  else if (strtoupper($v) == 'NORMAL') {
14303
  return $this->normalLineheight;
14304
  }
14305
+ else {
14306
+ $tlh = $this->ConvertSize($v,$this->FontSize,$this->FontSize,true);
14307
+ if ($tlh) { return ($tlh.'mm'); }
14308
+ }
14309
+ return $this->normalLineheight;
14310
+ }
14311
+
14312
+
14313
+ /*-- BORDER-RADIUS --*/
14314
+ function _borderPadding($a, $b, &$px, &$py) {
14315
+ // $px and py are padding long axis (x) and short axis (y)
14316
+ $added = 0; // extra padding
14317
+
14318
+ $x = $a-$px;
14319
+ $y = $b-$py;
14320
+ // Check if Falls within ellipse of border radius
14321
+ if ( ( (($x+$added)*($x+$added))/($a*$a) + (($y+$added)*($y+$added))/($b*$b) ) <=1 ) { return false; }
14322
+
14323
+ $t = atan2($y,$x);
14324
+
14325
+ $newx = $b / sqrt((($b*$b)/($a*$a)) + ( tan($t) * tan($t) ) );
14326
+ $newy = $a / sqrt((($a*$a)/($b*$b)) + ( (1/tan($t)) * (1/tan($t)) ) );
14327
+ $px = max($px, $a - $newx + $added);
14328
+ $py = max($py, $b - $newy + $added);
14329
+ }
14330
+ /*-- END BORDER-RADIUS --*/
14331
+
14332
+
14333
+ /*-- TABLES --*/
14334
+ function setBorderDominance($prop, $val) {
14335
+ if (isset($prop['BORDER-LEFT']) && $prop['BORDER-LEFT']) { $this->cell_border_dominance_L = $val; }
14336
+ if (isset($prop['BORDER-RIGHT']) && $prop['BORDER-RIGHT']) { $this->cell_border_dominance_R = $val; }
14337
+ if (isset($prop['BORDER-TOP']) && $prop['BORDER-TOP']) { $this->cell_border_dominance_T = $val; }
14338
+ if (isset($prop['BORDER-BOTTOM']) && $prop['BORDER-BOTTOM']) { $this->cell_border_dominance_B = $val; }
14339
+ }
14340
+ /*-- END TABLES --*/
14341
+
14342
+
14343
+ /*-- HTML-CSS --*/
14344
+ function _mergeCSS($p, &$t) {
14345
+ // Save Cascading CSS e.g. "div.topic p" at this block level
14346
+ if (isset($p) && $p) {
14347
+ if ($t) {
14348
+ $t = $this->array_merge_recursive_unique($t, $p);
14349
+ }
14350
+ else { $t = $p; }
14351
+ }
14352
+ }
14353
+
14354
+ // for CSS handling
14355
+ function array_merge_recursive_unique($array1, $array2) {
14356
+ $arrays = func_get_args();
14357
+ $narrays = count($arrays);
14358
+ $ret = $arrays[0];
14359
+ for ($i = 1; $i < $narrays; $i ++) {
14360
+ foreach ($arrays[$i] as $key => $value) {
14361
+ if (((string) $key) === ((string) intval($key))) { // integer or string as integer key - append
14362
+ $ret[] = $value;
14363
+ }
14364
+ else { // string key - merge
14365
+ if (is_array($value) && isset($ret[$key])) {
14366
+ $ret[$key] = $this->array_merge_recursive_unique($ret[$key], $value);
14367
+ }
14368
+ else {
14369
+ $ret[$key] = $value;
14370
+ }
14371
+ }
14372
+ }
14373
+ }
14374
+ return $ret;
14375
+ }
14376
+
14377
+
14378
+
14379
+ function _mergeFullCSS($p, &$t, $tag, $classes, $id) {
14380
+ $this->_mergeCSS($p[$tag], $t);
14381
+ // STYLESHEET CLASS e.g. .smallone{} .redletter{}
14382
+ foreach($classes AS $class) {
14383
+ $this->_mergeCSS($p['CLASS>>'.$class], $t);
14384
+ }
14385
+ // STYLESHEET nth-child SELECTOR e.g. tr:nth-child(odd) td:nth-child(2n+1)
14386
+ if ($tag=='TR' && isset($p) && $p) {
14387
+ foreach($p AS $k=>$val) {
14388
+ if (preg_match('/'.$tag.'>>SELECTORNTHCHILD>>(.*)/',$k, $m)) {
14389
+ $select = false;
14390
+ if ($tag=='TR') {
14391
+ $row = $this->row;
14392
+ $thnr = (isset($this->table[$this->tableLevel][$this->tbctr[$this->tableLevel]]['is_thead']) ? count($this->table[$this->tableLevel][$this->tbctr[$this->tableLevel]]['is_thead']) : 0);
14393
+ $tfnr = (isset($this->table[$this->tableLevel][$this->tbctr[$this->tableLevel]]['is_tfoot']) ? count($this->table[$this->tableLevel][$this->tbctr[$this->tableLevel]]['is_tfoot']) : 0);
14394
+ if ($this->tabletfoot) { $row -= $thnr; }
14395
+ else if (!$this->tablethead) { $row -= ($thnr + $tfnr); }
14396
+ if ($m[1]=='ODD' && ($row % 2) == 0) { $select = true; }
14397
+ else if ($m[1]=='EVEN' && ($row % 2) == 1) { $select = true; }
14398
+ else if (preg_match('/(\d+)N\+(\d+)/',$m[1],$a)) {
14399
+ if ((($row + 1) % $a[1]) == $a[2]) { $select = true; }
14400
+ }
14401
+ }
14402
+ else if ($tag=='TD' || $tag=='TH') {
14403
+ if ($m[1]=='ODD' && ($this->col % 2) == 0) { $select = true; }
14404
+ else if ($m[1]=='EVEN' && ($this->col % 2) == 1) { $select = true; }
14405
+ else if (preg_match('/(\d+)N\+(\d+)/',$m[1],$a)) {
14406
+ if ((($this->col + 1) % $a[1]) == $a[2]) { $select = true; }
14407
+ }
14408
+ }
14409
+ if ($select) {
14410
+ $this->_mergeCSS($p[$tag.'>>SELECTORNTHCHILD>>'.$m[1]], $t);
14411
+ }
14412
+ }
14413
+ }
14414
+ }
14415
+ // STYLESHEET CLASS e.g. #smallone{} #redletter{}
14416
+ if (isset($id) && $id) {
14417
+ $this->_mergeCSS($p['ID>>'.$id], $t);
14418
+ }
14419
+ // STYLESHEET CLASS e.g. .smallone{} .redletter{}
14420
+ foreach($classes AS $class) {
14421
+ $this->_mergeCSS($p[$tag.'>>CLASS>>'.$class], $t);
14422
+ }
14423
+ // STYLESHEET CLASS e.g. #smallone{} #redletter{}
14424
+ if (isset($id)) {
14425
+ $this->_mergeCSS($p[$tag.'>>ID>>'.$id], $t);
14426
+ }
14427
+ }
14428
+
14429
+
14430
+ function _set_mergedCSS(&$m, &$p, $d=true, $bd=false) {
14431
+ if (isset($m)) {
14432
+ if ((isset($m['depth']) && $m['depth']>1) || $d==false) { // include check for 'depth'
14433
+ if ($bd) { $this->setBorderDominance($m, $bd); } // *TABLES*
14434
+ if (is_array($m)) {
14435
+ $p = array_merge($p,$m);
14436
+ $this->_mergeBorders($p,$m);
14437
+ }
14438
+ }
14439
+ }
14440
+ }
14441
+
14442
+
14443
+ function _mergeBorders(&$b, &$a) { // Merges $a['BORDER-TOP-STYLE'] to $b['BORDER-TOP'] etc.
14444
+ foreach(array('TOP','RIGHT','BOTTOM','LEFT') AS $side) {
14445
+ foreach(array('STYLE','WIDTH','COLOR') AS $el) {
14446
+ if (isset($a['BORDER-'.$side.'-'.$el])) { // e.g. $b['BORDER-TOP-STYLE']
14447
+ $s = trim($a['BORDER-'.$side.'-'.$el]);
14448
+ if (isset($b['BORDER-'.$side])) { // e.g. $b['BORDER-TOP']
14449
+ $p = trim($b['BORDER-'.$side]);
14450
+ }
14451
+ else { $p = ''; }
14452
+ if ($el=='STYLE') {
14453
+ if ($p) { $b['BORDER-'.$side] = preg_replace('/(\S+)\s+(\S+)\s+(\S+)/', '\\1 '.$s.' \\3', $p); }
14454
+ else { $b['BORDER-'.$side] = '0px '.$s.' #000000'; }
14455
+ }
14456
+ else if ($el=='WIDTH') {
14457
+ if ($p) { $b['BORDER-'.$side] = preg_replace('/(\S+)\s+(\S+)\s+(\S+)/', $s.' \\2 \\3', $p); }
14458
+ else { $b['BORDER-'.$side] = $s.' none #000000'; }
14459
+ }
14460
+ else if ($el=='COLOR') {
14461
+ if ($p) { $b['BORDER-'.$side] = preg_replace('/(\S+)\s+(\S+)\s+(\S+)/', '\\1 \\2 '.$s, $p); }
14462
+ else { $b['BORDER-'.$side] = '0px none '.$s; }
14463
+ }
14464
+ }
14465
+ }
14466
+ }
14467
+ }
14468
+
14469
+
14470
+ function MergeCSS($inherit,$tag,$attr) {
14471
+ $p = array();
14472
+ $zp = array();
14473
+
14474
+ $classes = array();
14475
+ if (isset($attr['CLASS'])) {
14476
+ $classes = preg_split('/\s+/',$attr['CLASS']);
14477
+ }
14478
+ if (!isset($attr['ID'])) { $attr['ID']=''; }
14479
+ //===============================================
14480
+ /*-- TABLES --*/
14481
+ // Set Inherited properties
14482
+ if ($inherit == 'TOPTABLE') { // $tag = TABLE
14483
+ //===============================================
14484
+ // Save Cascading CSS e.g. "div.topic p" at this block level
14485
+
14486
+ if (isset($this->blk[$this->blklvl]['cascadeCSS'])) {
14487
+ $this->tablecascadeCSS[0] = $this->blk[$this->blklvl]['cascadeCSS'];
14488
+ }
14489
+ else {
14490
+ $this->tablecascadeCSS[0] = $this->cascadeCSS;
14491
+ }
14492
+ }
14493
+ //===============================================
14494
+ // Set Inherited properties
14495
+ if ($inherit == 'TOPTABLE' || $inherit == 'TABLE') {
14496
+ //Cascade everything from last level that is not an actual property, or defined by current tag/attributes
14497
+ if (isset($this->tablecascadeCSS[$this->tbCSSlvl-1]) && is_array($this->tablecascadeCSS[$this->tbCSSlvl-1])) {
14498
+ foreach($this->tablecascadeCSS[$this->tbCSSlvl-1] AS $k=>$v) {
14499
+ $this->tablecascadeCSS[$this->tbCSSlvl][$k] = $v;
14500
+ }
14501
+ }
14502
+ $this->_mergeFullCSS($this->cascadeCSS, $this->tablecascadeCSS[$this->tbCSSlvl], $tag, $classes, $attr['ID']);
14503
+ //===============================================
14504
+ // Cascading forward CSS e.g. "table.topic td" for this table in $this->tablecascadeCSS
14505
+ //===============================================
14506
+ // STYLESHEET TAG e.g. table
14507
+ $this->_mergeFullCSS($this->tablecascadeCSS[$this->tbCSSlvl-1], $this->tablecascadeCSS[$this->tbCSSlvl], $tag, $classes, $attr['ID']);
14508
+ //===============================================
14509
+ }
14510
+ /*-- END TABLES --*/
14511
+ //===============================================
14512
+ /*-- LISTS --*/
14513
+ // Set Inherited properties
14514
+ if ($inherit == 'TOPLIST') { // $tag = UL,OL
14515
+ //===============================================
14516
+ // Save Cascading CSS e.g. "div.topic p" at this block level
14517
+ if (isset($this->blk[$this->blklvl]['cascadeCSS'])) {
14518
+ $this->listcascadeCSS[0] = $this->blk[$this->blklvl]['cascadeCSS'];
14519
+ }
14520
+ else {
14521
+ $this->listcascadeCSS[0] = $this->cascadeCSS;
14522
+ }
14523
+ }
14524
+ //===============================================
14525
+ // Set Inherited properties
14526
+ if ($inherit == 'TOPLIST' || $inherit == 'LIST') {
14527
+ //Cascade everything from last level that is not an actual property, or defined by current tag/attributes
14528
+ if (isset($this->listcascadeCSS[$this->listCSSlvl-1]) && is_array($this->listcascadeCSS[$this->listCSSlvl-1])) {
14529
+ foreach($this->listcascadeCSS[$this->listCSSlvl-1] AS $k=>$v) {
14530
+ $this->listcascadeCSS[$this->listCSSlvl][$k] = $v;
14531
+ }
14532
+ }
14533
+ $this->_mergeFullCSS($this->cascadeCSS, $this->listcascadeCSS[$this->listCSSlvl], $tag, $classes, $attr['ID']);
14534
+ //===============================================
14535
+ // Cascading forward CSS e.g. "table.topic td" for this list in $this->listcascadeCSS
14536
+ //===============================================
14537
+ // STYLESHEET TAG e.g. table
14538
+ $this->_mergeFullCSS($this->listcascadeCSS[$this->listCSSlvl-1], $this->listcascadeCSS[$this->listCSSlvl], $tag, $classes, $attr['ID']);
14539
+ //===============================================
14540
+ }
14541
+ /*-- END LISTS --*/
14542
+ //===============================================
14543
+ // Set Inherited properties
14544
+ if ($inherit == 'BLOCK') {
14545
+ if (isset($this->blk[$this->blklvl-1]['cascadeCSS']) && is_array($this->blk[$this->blklvl-1]['cascadeCSS'])) {
14546
+ foreach($this->blk[$this->blklvl-1]['cascadeCSS'] AS $k=>$v) {
14547
+ $this->blk[$this->blklvl]['cascadeCSS'][$k] = $v;
14548
+
14549
+ }
14550
+ }
14551
+
14552
+ //===============================================
14553
+ // Save Cascading CSS e.g. "div.topic p" at this block level
14554
+ $this->_mergeFullCSS($this->cascadeCSS, $this->blk[$this->blklvl]['cascadeCSS'], $tag, $classes, $attr['ID']);
14555
+ //===============================================
14556
+ // Cascading forward CSS
14557
+ //===============================================
14558
+ $this->_mergeFullCSS($this->blk[$this->blklvl-1]['cascadeCSS'], $this->blk[$this->blklvl]['cascadeCSS'], $tag, $classes, $attr['ID']);
14559
+ //===============================================
14560
+ // Block properties
14561
+ if (isset($this->blk[$this->blklvl-1]['margin_collapse']) && $this->blk[$this->blklvl-1]['margin_collapse']) { $p['MARGIN-COLLAPSE'] = 'COLLAPSE'; } // custom tag, but follows CSS principle that border-collapse is inherited
14562
+ if (isset($this->blk[$this->blklvl-1]['line_height']) && $this->blk[$this->blklvl-1]['line_height']) { $p['LINE-HEIGHT'] = $this->blk[$this->blklvl-1]['line_height']; }
14563
+
14564
+ if (isset($this->blk[$this->blklvl-1]['direction']) && $this->blk[$this->blklvl-1]['direction']) { $p['DIRECTION'] = $this->blk[$this->blklvl-1]['direction']; }
14565
+
14566
+ if (isset($this->blk[$this->blklvl-1]['align']) && $this->blk[$this->blklvl-1]['align']) {
14567
+ if ($this->blk[$this->blklvl-1]['align'] == 'L') { $p['TEXT-ALIGN'] = 'left'; }
14568
+ else if ($this->blk[$this->blklvl-1]['align'] == 'J') { $p['TEXT-ALIGN'] = 'justify'; }
14569
+ else if ($this->blk[$this->blklvl-1]['align'] == 'R') { $p['TEXT-ALIGN'] = 'right'; }
14570
+ else if ($this->blk[$this->blklvl-1]['align'] == 'C') { $p['TEXT-ALIGN'] = 'center'; }
14571
+ }
14572
+ if ($this->ColActive || $this->keep_block_together) {
14573
+ if (isset($this->blk[$this->blklvl-1]['bgcolor']) && $this->blk[$this->blklvl-1]['bgcolor']) { // Doesn't officially inherit, but default value is transparent (?=inherited)
14574
+ $cor = $this->blk[$this->blklvl-1]['bgcolorarray' ];
14575
+ $p['BACKGROUND-COLOR'] = $this->_colAtoString($cor);
14576
+ }
14577
+ }
14578
+
14579
+ if (isset($this->blk[$this->blklvl-1]['text_indent']) && ($this->blk[$this->blklvl-1]['text_indent'] || $this->blk[$this->blklvl-1]['text_indent']===0)) { $p['TEXT-INDENT'] = $this->blk[$this->blklvl-1]['text_indent']; }
14580
+ if (isset($this->blk[$this->blklvl-1]['InlineProperties'])) {
14581
+ $biilp = $this->blk[$this->blklvl-1]['InlineProperties'];
14582
+ }
14583
+ else { $biilp = null; }
14584
+ if (isset($biilp[ 'family' ]) && $biilp[ 'family' ]) { $p['FONT-FAMILY'] = $biilp[ 'family' ]; }
14585
+ if (isset($biilp[ 'I' ]) && $biilp[ 'I' ]) { $p['FONT-STYLE'] = 'italic'; }
14586
+ if (isset($biilp[ 'sizePt' ]) && $biilp[ 'sizePt' ]) { $p['FONT-SIZE'] = $biilp[ 'sizePt' ] . 'pt'; }
14587
+ if (isset($biilp[ 'B' ]) && $biilp[ 'B' ]) { $p['FONT-WEIGHT'] = 'bold'; }
14588
+ if (isset($biilp[ 'colorarray' ]) && $biilp[ 'colorarray' ]) {
14589
+ $cor = $biilp[ 'colorarray' ];
14590
+ $p['COLOR'] = $this->_colAtoString($cor);
14591
+ }
14592
+ if (isset($biilp[ 'fontkerning' ])) {
14593
+ if ($biilp[ 'fontkerning' ]) { $p['FONT-KERNING'] = 'normal'; }
14594
+ else { $p['FONT-KERNING'] = 'none'; }
14595
+ }
14596
+ if (isset($biilp[ 'lSpacingCSS' ]) && $biilp[ 'lSpacingCSS' ]) { $p['LETTER-SPACING'] = $biilp[ 'lSpacingCSS' ]; }
14597
+ if (isset($biilp[ 'wSpacingCSS' ]) && $biilp[ 'wSpacingCSS' ]) { $p['WORD-SPACING'] = $biilp[ 'wSpacingCSS' ]; }
14598
+ if (isset($biilp[ 'toupper' ]) && $biilp[ 'toupper' ]) { $p['TEXT-TRANSFORM'] = 'uppercase'; }
14599
+ else if (isset($biilp[ 'tolower' ]) && $biilp[ 'tolower' ]) { $p['TEXT-TRANSFORM'] = 'lowercase'; }
14600
+ else if (isset($biilp[ 'capitalize' ]) && $biilp[ 'capitalize' ]) { $p['TEXT-TRANSFORM'] = 'capitalize'; }
14601
+ // CSS says text-decoration is not inherited, but IE7 does??
14602
+ if (isset($biilp[ 'underline' ]) && $biilp[ 'underline' ]) { $p['TEXT-DECORATION'] = 'underline'; }
14603
+ if (isset($biilp[ 'smCaps' ]) && $biilp[ 'smCaps' ]) { $p['FONT-VARIANT'] = 'small-caps'; }
14604
+
14605
+ }
14606
+ //===============================================
14607
+ //===============================================
14608
+ /*-- LISTS --*/
14609
+ // Set Inherited properties
14610
+ if ($inherit == 'TOPLIST') {
14611
+ if ($this->listCSSlvl == 1) {
14612
+ $bilp = $this->blk[$this->blklvl]['InlineProperties'];
14613
+ if (isset($bilp[ 'family' ]) && $bilp[ 'family' ]) { $p['FONT-FAMILY'] = $bilp[ 'family' ]; }
14614
+ if (isset($bilp[ 'I' ]) && $bilp[ 'I' ]) { $p['FONT-STYLE'] = 'italic'; }
14615
+ if (isset($bilp[ 'sizePt' ]) && $bilp[ 'sizePt' ]) { $p['FONT-SIZE'] = $bilp[ 'sizePt' ] . 'pt'; }
14616
+ if (isset($bilp[ 'B' ]) && $bilp[ 'B' ]) { $p['FONT-WEIGHT'] = 'bold'; }
14617
+ if (isset($bilp[ 'colorarray' ]) && $bilp[ 'colorarray' ]) {
14618
+ $cor = $bilp[ 'colorarray' ];
14619
+ $p['COLOR'] = $this->_colAtoString($cor);
14620
+ }
14621
+ if (isset($bilp[ 'toupper' ]) && $bilp[ 'toupper' ]) { $p['TEXT-TRANSFORM'] = 'uppercase'; }
14622
+ else if (isset($bilp[ 'tolower' ]) && $bilp[ 'tolower' ]) { $p['TEXT-TRANSFORM'] = 'lowercase'; }
14623
+ else if (isset($bilp[ 'capitalize' ]) && $bilp[ 'capitalize' ]) { $p['TEXT-TRANSFORM'] = 'capitalize'; }
14624
+ if (isset($bilp[ 'fontkerning' ])) {
14625
+ if ($bilp[ 'fontkerning' ]) { $p['FONT-KERNING'] = 'normal'; }
14626
+ else { $p['FONT-KERNING'] = 'none'; }
14627
+ }
14628
+ if (isset($bilp[ 'lSpacingCSS' ]) && $bilp[ 'lSpacingCSS' ]) { $p['LETTER-SPACING'] = $bilp[ 'lSpacingCSS' ]; }
14629
+ if (isset($bilp[ 'wSpacingCSS' ]) && $bilp[ 'wSpacingCSS' ]) { $p['WORD-SPACING'] = $bilp[ 'wSpacingCSS' ]; }
14630
+ // CSS says text-decoration is not inherited, but IE7 does??
14631
+ if (isset($bilp[ 'underline' ]) && $bilp[ 'underline' ]) { $p['TEXT-DECORATION'] = 'underline'; }
14632
+ if (isset($bilp[ 'smCaps' ]) && $bilp[ 'smCaps' ]) { $p['FONT-VARIANT'] = 'small-caps'; }
14633
+ if ($tag=='LI') {
14634
+ // Note to self - this should never work, as TOPLIST is not called when LI (see code removed in v5.3)
14635
+ $this->Error("If you see this message, please report this as a bug to the mPDF Forum.");
14636
+ }
14637
+ }
14638
+ }
14639
+ /*-- END LISTS --*/
14640
+ //===============================================
14641
+ //===============================================
14642
+ // DEFAULT for this TAG set in DefaultCSS
14643
+ if (isset($this->defaultCSS[$tag])) {
14644
+ $zp = $this->fixCSS($this->defaultCSS[$tag]);
14645
+ if (is_array($zp)) { // Default overwrites Inherited
14646
+ $p = array_merge($p,$zp); // !! Note other way round !!
14647
+ $this->_mergeBorders($p,$zp);
14648
+ }
14649
+ }
14650
+ //===============================================
14651
+ /*-- TABLES --*/
14652
+ // cellPadding overwrites TD/TH default but not specific CSS set on cell
14653
+ if (($tag=='TD' || $tag=='TH') && isset($this->table[$this->tableLevel][$this->tbctr[$this->tableLevel]]['cell_padding']) && ($this->table[$this->tableLevel][$this->tbctr[$this->tableLevel]]['cell_padding'] || $this->table[$this->tableLevel][$this->tbctr[$this->tableLevel]]['cell_padding']===0)) {
14654
+ $p['PADDING-LEFT'] = $this->table[$this->tableLevel][$this->tbctr[$this->tableLevel]]['cell_padding'];
14655
+ $p['PADDING-RIGHT'] = $this->table[$this->tableLevel][$this->tbctr[$this->tableLevel]]['cell_padding'];
14656
+ $p['PADDING-TOP'] = $this->table[$this->tableLevel][$this->tbctr[$this->tableLevel]]['cell_padding'];
14657
+ $p['PADDING-BOTTOM'] = $this->table[$this->tableLevel][$this->tbctr[$this->tableLevel]]['cell_padding'];
14658
+ }
14659
+ /*-- END TABLES --*/
14660
+ //===============================================
14661
+ // STYLESHEET TAG e.g. h1 p div table
14662
+ if (isset($this->CSS[$tag]) && $this->CSS[$tag]) {
14663
+ $zp = $this->CSS[$tag];
14664
+ if ($tag=='TD' || $tag=='TH') { $this->setBorderDominance($zp, 9); } // *TABLES* // *TABLES-ADVANCED-BORDERS*
14665
+ if (is_array($zp)) {
14666
+ $p = array_merge($p,$zp);
14667
+ $this->_mergeBorders($p,$zp);
14668
+ }
14669
+ }
14670
+ //===============================================
14671
+ // STYLESHEET CLASS e.g. .smallone{} .redletter{}
14672
+ foreach($classes AS $class) {
14673
+ $zp = array();
14674
+ if (isset($this->CSS['CLASS>>'.$class]) && $this->CSS['CLASS>>'.$class]) { $zp = $this->CSS['CLASS>>'.$class]; }
14675
+ if ($tag=='TD' || $tag=='TH') { $this->setBorderDominance($zp, 9); } // *TABLES* // *TABLES-ADVANCED-BORDERS*
14676
+ if (is_array($zp)) {
14677
+ $p = array_merge($p,$zp);
14678
+ $this->_mergeBorders($p,$zp);
14679
+ }
14680
+ }
14681
+ //===============================================
14682
+ /*-- TABLES --*/
14683
+ // STYLESHEET nth-child SELECTOR e.g. tr:nth-child(odd) td:nth-child(2n+1)
14684
+ if ($tag=='TR' || $tag=='TD' || $tag=='TH') {
14685
+ foreach($this->CSS AS $k=>$val) {
14686
+ if (preg_match('/'.$tag.'>>SELECTORNTHCHILD>>(.*)/',$k, $m)) {
14687
+ $select = false;
14688
+ if ($tag=='TR') {
14689
+ $row = $this->row;
14690
+ $thnr = (isset($this->table[$this->tableLevel][$this->tbctr[$this->tableLevel]]['is_thead']) ? count($this->table[$this->tableLevel][$this->tbctr[$this->tableLevel]]['is_thead']) : 0);
14691
+ $tfnr = (isset($this->table[$this->tableLevel][$this->tbctr[$this->tableLevel]]['is_tfoot']) ? count($this->table[$this->tableLevel][$this->tbctr[$this->tableLevel]]['is_tfoot']) : 0);
14692
+ if ($this->tabletfoot) { $row -= $thnr; }
14693
+ else if (!$this->tablethead) { $row -= ($thnr + $tfnr); }
14694
+ if ($m[1]=='ODD' && ($row % 2) == 0) { $select = true; }
14695
+ else if ($m[1]=='EVEN' && ($row % 2) == 1) { $select = true; }
14696
+ else if (preg_match('/(\d+)N\+(\d+)/',$m[1],$a)) {
14697
+ if ((($row + 1) % $a[1]) == $a[2]) { $select = true; }
14698
+ }
14699
+ }
14700
+ else if ($tag=='TD' || $tag=='TH') {
14701
+ if ($m[1]=='ODD' && ($this->col % 2) == 0) { $select = true; }
14702
+ else if ($m[1]=='EVEN' && ($this->col % 2) == 1) { $select = true; }
14703
+ else if (preg_match('/(\d+)N\+(\d+)/',$m[1],$a)) {
14704
+ if ((($this->col+1) % $a[1]) == $a[2]) { $select = true; }
14705
+ }
14706
+ }
14707
+ if ($select) {
14708
+ $zp = $this->CSS[$tag.'>>SELECTORNTHCHILD>>'.$m[1]];
14709
+ if ($tag=='TD' || $tag=='TH') { $this->setBorderDominance($zp, 9); }
14710
+ if (is_array($zp)) {
14711
+ $p = array_merge($p,$zp);
14712
+ $this->_mergeBorders($p,$zp);
14713
+ }
14714
+ }
14715
+ }
14716
+ }
14717
+ }
14718
+ /*-- END TABLES --*/
14719
+ //===============================================
14720
+ // STYLESHEET ID e.g. #smallone{} #redletter{}
14721
+ if (isset($attr['ID']) && isset($this->CSS['ID>>'.$attr['ID']]) && $this->CSS['ID>>'.$attr['ID']]) {
14722
+ $zp = $this->CSS['ID>>'.$attr['ID']];
14723
+ if ($tag=='TD' || $tag=='TH') { $this->setBorderDominance($zp, 9); } // *TABLES* // *TABLES-ADVANCED-BORDERS*
14724
+ if (is_array($zp)) {
14725
+ $p = array_merge($p,$zp);
14726
+ $this->_mergeBorders($p,$zp);
14727
+ }
14728
+ }
14729
+ //===============================================
14730
+ // STYLESHEET CLASS e.g. p.smallone{} div.redletter{}
14731
+ foreach($classes AS $class) {
14732
+ $zp = array();
14733
+ if (isset($this->CSS[$tag.'>>CLASS>>'.$class]) && $this->CSS[$tag.'>>CLASS>>'.$class]) { $zp = $this->CSS[$tag.'>>CLASS>>'.$class]; }
14734
+ if ($tag=='TD' || $tag=='TH') { $this->setBorderDominance($zp, 9); } // *TABLES* // *TABLES-ADVANCED-BORDERS*
14735
+ if (is_array($zp)) {
14736
+ $p = array_merge($p,$zp);
14737
+ $this->_mergeBorders($p,$zp);
14738
+ }
14739
+ }
14740
+ //===============================================
14741
+ // STYLESHEET CLASS e.g. p#smallone{} div#redletter{}
14742
+ if (isset($attr['ID']) && isset($this->CSS[$tag.'>>ID>>'.$attr['ID']]) && $this->CSS[$tag.'>>ID>>'.$attr['ID']]) {
14743
+ $zp = $this->CSS[$tag.'>>ID>>'.$attr['ID']];
14744
+ if ($tag=='TD' || $tag=='TH') { $this->setBorderDominance($zp, 9); } // *TABLES* // *TABLES-ADVANCED-BORDERS*
14745
+ if (is_array($zp)) {
14746
+ $p = array_merge($p,$zp);
14747
+ $this->_mergeBorders($p,$zp);
14748
+ }
14749
+ }
14750
+ //===============================================
14751
+ // Cascaded e.g. div.class p only works for block level
14752
+ if ($inherit == 'BLOCK') {
14753
+ $this->_set_mergedCSS($this->blk[$this->blklvl-1]['cascadeCSS'][$tag], $p);
14754
+ foreach($classes AS $class) {
14755
+ $this->_set_mergedCSS($this->blk[$this->blklvl-1]['cascadeCSS']['CLASS>>'.$class], $p);
14756
+ }
14757
+ $this->_set_mergedCSS($this->blk[$this->blklvl-1]['cascadeCSS']['ID>>'.$attr['ID']], $p);
14758
+ foreach($classes AS $class) {
14759
+ $this->_set_mergedCSS($this->blk[$this->blklvl-1]['cascadeCSS'][$tag.'>>CLASS>>'.$class], $p);
14760
+ }
14761
+ $this->_set_mergedCSS($this->blk[$this->blklvl-1]['cascadeCSS'][$tag.'>>ID>>'.$attr['ID']], $p);
14762
+ }
14763
+ else if ($inherit == 'INLINE') {
14764
+ $this->_set_mergedCSS($this->blk[$this->blklvl]['cascadeCSS'][$tag], $p);
14765
+ foreach($classes AS $class) {
14766
+ $this->_set_mergedCSS($this->blk[$this->blklvl]['cascadeCSS']['CLASS>>'.$class], $p);
14767
+ }
14768
+ $this->_set_mergedCSS($this->blk[$this->blklvl]['cascadeCSS']['ID>>'.$attr['ID']], $p);
14769
+ foreach($classes AS $class) {
14770
+ $this->_set_mergedCSS($this->blk[$this->blklvl]['cascadeCSS'][$tag.'>>CLASS>>'.$class], $p);
14771
+ }
14772
+ $this->_set_mergedCSS($this->blk[$this->blklvl]['cascadeCSS'][$tag.'>>ID>>'.$attr['ID']], $p);
14773
+ }
14774
+ /*-- TABLES --*/
14775
+ else if ($inherit == 'TOPTABLE' || $inherit == 'TABLE') { // NB looks at $this->tablecascadeCSS-1 for cascading CSS
14776
+ // false, 9 = don't check for 'depth' and do set border dominance
14777
+ $this->_set_mergedCSS($this->tablecascadeCSS[$this->tbCSSlvl-1][$tag], $p, false, 9);
14778
+ foreach($classes AS $class) {
14779
+ $this->_set_mergedCSS($this->tablecascadeCSS[$this->tbCSSlvl-1]['CLASS>>'.$class], $p, false, 9);
14780
+ }
14781
+ // STYLESHEET nth-child SELECTOR e.g. tr:nth-child(odd) td:nth-child(2n+1)
14782
+ if ($tag=='TR' || $tag=='TD' || $tag=='TH') {
14783
+ foreach($this->tablecascadeCSS[$this->tbCSSlvl-1] AS $k=>$val) {
14784
+ if (preg_match('/'.$tag.'>>SELECTORNTHCHILD>>(.*)/',$k, $m)) {
14785
+ $select = false;
14786
+ if ($tag=='TR') {
14787
+ $row = $this->row;
14788
+ $thnr = (isset($this->table[$this->tableLevel][$this->tbctr[$this->tableLevel]]['is_thead']) ? count($this->table[$this->tableLevel][$this->tbctr[$this->tableLevel]]['is_thead']) : 0);
14789
+ $tfnr = (isset($this->table[$this->tableLevel][$this->tbctr[$this->tableLevel]]['is_tfoot']) ? count($this->table[$this->tableLevel][$this->tbctr[$this->tableLevel]]['is_tfoot']) : 0);
14790
+ if ($this->tabletfoot) { $row -= $thnr; }
14791
+ else if (!$this->tablethead) { $row -= ($thnr + $tfnr); }
14792
+ if ($m[1]=='ODD' && ($row % 2) == 0) { $select = true; }
14793
+ else if ($m[1]=='EVEN' && ($row % 2) == 1) { $select = true; }
14794
+ else if (preg_match('/(\d+)N\+(\d+)/',$m[1],$a)) {
14795
+ if ((($row + 1) % $a[1]) == $a[2]) { $select = true; }
14796
+ }
14797
+ }
14798
+ else if ($tag=='TD' || $tag=='TH') {
14799
+ if ($m[1]=='ODD' && ($this->col % 2) == 0) { $select = true; }
14800
+ else if ($m[1]=='EVEN' && ($this->col % 2) == 1) { $select = true; }
14801
+ else if (preg_match('/(\d+)N\+(\d+)/',$m[1],$a)) {
14802
+ if ((($this->col + 1) % $a[1]) == $a[2]) { $select = true; }
14803
+ }
14804
+ }
14805
+ if ($select) {
14806
+ $this->_set_mergedCSS($this->tablecascadeCSS[$this->tbCSSlvl-1][$tag.'>>SELECTORNTHCHILD>>'.$m[1]], $p, false, 9);
14807
+ }
14808
+ }
14809
+ }
14810
+ }
14811
+ $this->_set_mergedCSS($this->tablecascadeCSS[$this->tbCSSlvl-1]['ID>>'.$attr['ID']], $p, false, 9);
14812
+ foreach($classes AS $class) {
14813
+ $this->_set_mergedCSS($this->tablecascadeCSS[$this->tbCSSlvl-1][$tag.'>>CLASS>>'.$class], $p, false, 9);
14814
+ }
14815
+ $this->_set_mergedCSS($this->tablecascadeCSS[$this->tbCSSlvl-1][$tag.'>>ID>>'.$attr['ID']], $p, false, 9);
14816
+ }
14817
+ /*-- END TABLES --*/
14818
+ //===============================================
14819
+ /*-- LISTS --*/
14820
+ else if ($inherit == 'TOPLIST' || $inherit == 'LIST') { // NB looks at $this->listcascadeCSS-1 for cascading CSS
14821
+ // false = don't check for 'depth'
14822
+ $this->_set_mergedCSS($this->listcascadeCSS[$this->listCSSlvl-1][$tag], $p, false);
14823
+ foreach($classes AS $class) {
14824
+ $this->_set_mergedCSS($this->listcascadeCSS[$this->listCSSlvl-1]['CLASS>>'.$class], $p, false);
14825
+ }
14826
+ $this->_set_mergedCSS($this->listcascadeCSS[$this->listCSSlvl-1]['ID>>'.$attr['ID']], $p, false);
14827
+ foreach($classes AS $class) {
14828
+ $this->_set_mergedCSS($this->listcascadeCSS[$this->listCSSlvl-1][$tag.'>>CLASS>>'.$class], $p, false);
14829
+ }
14830
+ $this->_set_mergedCSS($this->listcascadeCSS[$this->listCSSlvl-1][$tag.'>>ID>>'.$attr['ID']], $p, false);
14831
+ }
14832
+ /*-- END LISTS --*/
14833
+ //===============================================
14834
+ //===============================================
14835
+ // INLINE STYLE e.g. style="CSS:property"
14836
+ if (isset($attr['STYLE'])) {
14837
+ $zp = $this->readInlineCSS($attr['STYLE']);
14838
+ if ($tag=='TD' || $tag=='TH') { $this->setBorderDominance($zp, 9); } // *TABLES* // *TABLES-ADVANCED-BORDERS*
14839
+ if (is_array($zp)) {
14840
+ $p = array_merge($p,$zp);
14841
+ $this->_mergeBorders($p,$zp);
14842
+ }
14843
+ }
14844
+ //===============================================
14845
+ //===============================================
14846
+ // INLINE ATTRIBUTES e.g. .. ALIGN="CENTER">
14847
+ if (isset($attr['LANG']) and $attr['LANG']!='') {
14848
+ $p['LANG'] = $attr['LANG'];
14849
+ }
14850
+ if (isset($attr['COLOR']) and $attr['COLOR']!='') {
14851
+ $p['COLOR'] = $attr['COLOR'];
14852
+ }
14853
+ if ($tag != 'INPUT') {
14854
+ if (isset($attr['WIDTH']) and $attr['WIDTH']!='') {
14855
+ $p['WIDTH'] = $attr['WIDTH'];
14856
+ }
14857
+ if (isset($attr['HEIGHT']) and $attr['HEIGHT']!='') {
14858
+ $p['HEIGHT'] = $attr['HEIGHT'];
14859
+ }
14860
+ }
14861
+ if ($tag == 'FONT') {
14862
+ if (isset($attr['FACE'])) {
14863
+ $p['FONT-FAMILY'] = $attr['FACE'];
14864
+ }
14865
+ if (isset($attr['SIZE']) and $attr['SIZE']!='') {
14866
+ $s = '';
14867
+ if ($attr['SIZE'] === '+1') { $s = '120%'; }
14868
+ else if ($attr['SIZE'] === '-1') { $s = '86%'; }
14869
+ else if ($attr['SIZE'] === '1') { $s = 'XX-SMALL'; }
14870
+ else if ($attr['SIZE'] == '2') { $s = 'X-SMALL'; }
14871
+ else if ($attr['SIZE'] == '3') { $s = 'SMALL'; }
14872
+ else if ($attr['SIZE'] == '4') { $s = 'MEDIUM'; }
14873
+ else if ($attr['SIZE'] == '5') { $s = 'LARGE'; }
14874
+ else if ($attr['SIZE'] == '6') { $s = 'X-LARGE'; }
14875
+ else if ($attr['SIZE'] == '7') { $s = 'XX-LARGE'; }
14876
+ if ($s) $p['FONT-SIZE'] = $s;
14877
+ }
14878
+ }
14879
+ if (isset($attr['VALIGN']) and $attr['VALIGN']!='') {
14880
+ $p['VERTICAL-ALIGN'] = $attr['VALIGN'];
14881
+ }
14882
+ if (isset($attr['VSPACE']) and $attr['VSPACE']!='') {
14883
+ $p['MARGIN-TOP'] = $attr['VSPACE'];
14884
+ $p['MARGIN-BOTTOM'] = $attr['VSPACE'];
14885
  }
14886
+ if (isset($attr['HSPACE']) and $attr['HSPACE']!='') {
14887
+ $p['MARGIN-LEFT'] = $attr['HSPACE'];
14888
+ $p['MARGIN-RIGHT'] = $attr['HSPACE'];
14889
+ }
14890
+ //===============================================
14891
+ return $p;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14892
  }
 
 
 
 
 
14893
 
14894
 
14895
  /*-- CSS-PAGE --*/
14915
  $p['MARGIN-FOOTER'] = strval($this->orig_fMargin).'mm';
14916
 
14917
  // Basic page + selector
14918
+ if (isset($this->CSS['@PAGE'])) { $zp = $this->CSS['@PAGE']; }
14919
  else { $zp = array(); }
14920
  if (is_array($zp) && !empty($zp)) { $p = array_merge($p,$zp); }
14921
 
14933
  }
14934
 
14935
  // If right/Odd page
14936
+ if (isset($this->CSS['@PAGE>>PSEUDO>>RIGHT']) && $side=='R') {
14937
+ $zp = $this->CSS['@PAGE>>PSEUDO>>RIGHT'];
14938
  }
14939
  else { $zp = array(); }
14940
  if (isset($zp['SIZE'])) { unset($zp['SIZE']); }
14945
  if (is_array($zp) && !empty($zp)) { $p = array_merge($p,$zp); }
14946
 
14947
  // If left/Even page
14948
+ if (isset($this->CSS['@PAGE>>PSEUDO>>LEFT']) && $side=='L') {
14949
+ $zp = $this->CSS['@PAGE>>PSEUDO>>LEFT'];
14950
  }
14951
  else { $zp = array(); }
14952
  if (isset($zp['SIZE'])) { unset($zp['SIZE']); }
14957
  if (is_array($zp) && !empty($zp)) { $p = array_merge($p,$zp); }
14958
 
14959
  // If first page
14960
+ if (isset($this->CSS['@PAGE>>PSEUDO>>FIRST']) && $first) { $zp = $this->CSS['@PAGE>>PSEUDO>>FIRST']; }
14961
  else { $zp = array(); }
14962
  if (isset($zp['SIZE'])) { unset($zp['SIZE']); }
14963
  if (isset($zp['SHEET-SIZE'])) { unset($zp['SHEET-SIZE']); }
14965
 
14966
  // If named page
14967
  if ($name) {
14968
+ if (isset($this->CSS['@PAGE>>NAMED>>'.$name])) { $zp = $this->CSS['@PAGE>>NAMED>>'.$name]; }
14969
  else { $zp = array(); }
14970
  if (is_array($zp) && !empty($zp)) { $p = array_merge($p,$zp); }
14971
 
14983
  }
14984
 
14985
  // If named right/Odd page
14986
+ if (isset($this->CSS['@PAGE>>NAMED>>'.$name.'>>PSEUDO>>RIGHT']) && $side=='R') { $zp = $this->CSS['@PAGE>>NAMED>>'.$name.'>>PSEUDO>>RIGHT']; }
14987
  else { $zp = array(); }
14988
  if (isset($zp['SIZE'])) { unset($zp['SIZE']); }
14989
  if (isset($zp['SHEET-SIZE'])) { unset($zp['SHEET-SIZE']); }
14993
  if (is_array($zp) && !empty($zp)) { $p = array_merge($p,$zp); }
14994
 
14995
  // If named left/Even page
14996
+ if (isset($this->CSS['@PAGE>>NAMED>>'.$name.'>>PSEUDO>>LEFT']) && $side=='L') { $zp = $this->CSS['@PAGE>>NAMED>>'.$name.'>>PSEUDO>>LEFT']; }
14997
  else { $zp = array(); }
14998
  if (isset($zp['SIZE'])) { unset($zp['SIZE']); }
14999
  if (isset($zp['SHEET-SIZE'])) { unset($zp['SHEET-SIZE']); }
15003
  if (is_array($zp) && !empty($zp)) { $p = array_merge($p,$zp); }
15004
 
15005
  // If named first page
15006
+ if (isset($this->CSS['@PAGE>>NAMED>>'.$name.'>>PSEUDO>>FIRST']) && $first) { $zp = $this->CSS['@PAGE>>NAMED>>'.$name.'>>PSEUDO>>FIRST']; }
15007
  else { $zp = array(); }
15008
  if (isset($zp['SIZE'])) { unset($zp['SIZE']); }
15009
  if (isset($zp['SHEET-SIZE'])) { unset($zp['SHEET-SIZE']); }
15101
  }
15102
  /*-- END CSS-PAGE --*/
15103
 
15104
+ function PreviewBlockCSS($tag,$attr) {
15105
+ // Looks ahead from current block level to a new level
15106
+ $p = array();
15107
+ $zp = array();
15108
+ $oldcascadeCSS = $this->blk[$this->blklvl]['cascadeCSS'];
15109
+ $classes = array();
15110
+ if (isset($attr['CLASS'])) { $classes = preg_split('/\s+/',$attr['CLASS']); }
15111
+ //===============================================
15112
+ // DEFAULT for this TAG set in DefaultCSS
15113
+ if (isset($this->defaultCSS[$tag])) {
15114
+ $zp = $this->fixCSS($this->defaultCSS[$tag]);
15115
+ if (is_array($zp)) { $p = array_merge($zp,$p); } // Inherited overwrites default
15116
+ }
15117
+ // STYLESHEET TAG e.g. h1 p div table
15118
+ if (isset($this->CSS[$tag])) {
15119
+ $zp = $this->CSS[$tag];
15120
+ if (is_array($zp)) { $p = array_merge($p,$zp); }
15121
+ }
15122
+ // STYLESHEET CLASS e.g. .smallone{} .redletter{}
15123
+ foreach($classes AS $class) {
15124
+ $zp = array();
15125
+ if (isset($this->CSS['CLASS>>'.$class])) { $zp = $this->CSS['CLASS>>'.$class]; }
15126
+ if (is_array($zp)) { $p = array_merge($p,$zp); }
15127
+ }
15128
+ // STYLESHEET ID e.g. #smallone{} #redletter{}
15129
+ if (isset($attr['ID']) && isset($this->CSS['ID>>'.$attr['ID']])) {
15130
+ $zp = $this->CSS['ID>>'.$attr['ID']];
15131
+ if (is_array($zp)) { $p = array_merge($p,$zp); }
15132
+ }
15133
+ // STYLESHEET CLASS e.g. p.smallone{} div.redletter{}
15134
+ foreach($classes AS $class) {
15135
+ $zp = array();
15136
+ if (isset($this->CSS[$tag.'>>CLASS>>'.$class])) { $zp = $this->CSS[$tag.'>>CLASS>>'.$class]; }
15137
+ if (is_array($zp)) { $p = array_merge($p,$zp); }
15138
+ }
15139
+ // STYLESHEET CLASS e.g. p#smallone{} div#redletter{}
15140
+ if (isset($attr['ID']) && isset($this->CSS[$tag.'>>ID>>'.$attr['ID']])) {
15141
+ $zp = $this->CSS[$tag.'>>ID>>'.$attr['ID']];
15142
+ if (is_array($zp)) { $p = array_merge($p,$zp); }
15143
+ }
15144
+ //===============================================
15145
+ // STYLESHEET TAG e.g. div h1 div p
15146
+
15147
+ $this->_set_mergedCSS($oldcascadeCSS[$tag], $p);
15148
+ // STYLESHEET CLASS e.g. .smallone{} .redletter{}
15149
+ foreach($classes AS $class) {
15150
+
15151
+ $this->_set_mergedCSS($oldcascadeCSS['CLASS>>'.$class], $p);
15152
+ }
15153
+ // STYLESHEET CLASS e.g. #smallone{} #redletter{}
15154
+ if (isset($attr['ID'])) {
15155
+
15156
+ $this->_set_mergedCSS($oldcascadeCSS['ID>>'.$attr['ID']], $p);
15157
+ }
15158
+ // STYLESHEET CLASS e.g. div.smallone{} p.redletter{}
15159
+ foreach($classes AS $class) {
15160
+
15161
+ $this->_set_mergedCSS($oldcascadeCSS[$tag.'>>CLASS>>'.$class], $p);
15162
+ }
15163
+ // STYLESHEET CLASS e.g. div#smallone{} p#redletter{}
15164
+ if (isset($attr['ID'])) {
15165
+
15166
+ $this->_set_mergedCSS($oldcascadeCSS[$tag.'>>ID>>'.$attr['ID']], $p);
15167
+ }
15168
+ //===============================================
15169
+ // INLINE STYLE e.g. style="CSS:property"
15170
+ if (isset($attr['STYLE'])) {
15171
+ $zp = $this->readInlineCSS($attr['STYLE']);
15172
+ if (is_array($zp)) { $p = array_merge($p,$zp); }
15173
+ }
15174
+ //===============================================
15175
+ return $p;
15176
+ }
15177
+
15178
 
15179
 
15180
  /*-- CSS-FLOAT --*/
15286
  $objattr['border_bottom']['w'] = 0;
15287
  $objattr['border_left']['w'] = 0;
15288
  $objattr['border_right']['w'] = 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15289
  $e = "\xbb\xa4\xactype=dottab,objattr=".serialize($objattr)."\xbb\xa4\xac";
15290
  /*-- TABLES --*/
15291
  // Output it to buffers
15332
  }
15333
 
15334
  if (isset($attr['HEADER-STYLE']) || isset($attr['FOOTER-STYLE'])) { // font-family,size,weight,style,color
15335
+ if ($tag=='PAGEHEADER') { $properties = $this->readInlineCSS($attr['HEADER-STYLE']); }
15336
+ else { $properties = $this->readInlineCSS($attr['FOOTER-STYLE']); }
15337
  if (isset($properties['FONT-FAMILY'])) {
15338
  $p['L']['font-family'] = $properties['FONT-FAMILY'];
15339
  $p['C']['font-family'] = $properties['FONT-FAMILY'];
15361
  }
15362
  }
15363
  if (isset($attr['HEADER-STYLE-LEFT']) || isset($attr['FOOTER-STYLE-LEFT'])) {
15364
+ if ($tag=='PAGEHEADER') { $properties = $this->readInlineCSS($attr['HEADER-STYLE-LEFT']); }
15365
+ else { $properties = $this->readInlineCSS($attr['FOOTER-STYLE-LEFT']); }
15366
  if (isset($properties['FONT-FAMILY'])) { $p['L']['font-family'] = $properties['FONT-FAMILY']; }
15367
  if (isset($properties['FONT-SIZE'])) { $p['L']['font-size'] = $this->ConvertSize($properties['FONT-SIZE']) * _MPDFK; }
15368
  if (isset($properties['FONT-WEIGHT']) && $properties['FONT-WEIGHT']=='bold') { $p['L']['font-style'] ='B'; }
15370
  if (isset($properties['COLOR'])) { $p['L']['color'] = $properties['COLOR']; }
15371
  }
15372
  if (isset($attr['HEADER-STYLE-CENTER']) || isset($attr['FOOTER-STYLE-CENTER'])) {
15373
+ if ($tag=='PAGEHEADER') { $properties = $this->readInlineCSS($attr['HEADER-STYLE-CENTER']); }
15374
+ else { $properties = $this->readInlineCSS($attr['FOOTER-STYLE-CENTER']); }
15375
  if (isset($properties['FONT-FAMILY'])) { $p['C']['font-family'] = $properties['FONT-FAMILY']; }
15376
  if (isset($properties['FONT-SIZE'])) { $p['C']['font-size'] = $this->ConvertSize($properties['FONT-SIZE']) * _MPDFK; }
15377
  if (isset($properties['FONT-WEIGHT']) && $properties['FONT-WEIGHT']=='bold') { $p['C']['font-style'] = 'B'; }
15379
  if (isset($properties['COLOR'])) { $p['C']['color'] = $properties['COLOR']; }
15380
  }
15381
  if (isset($attr['HEADER-STYLE-RIGHT']) || isset($attr['FOOTER-STYLE-RIGHT'])) {
15382
+ if ($tag=='PAGEHEADER') { $properties = $this->readInlineCSS($attr['HEADER-STYLE-RIGHT']); }
15383
+ else { $properties = $this->readInlineCSS($attr['FOOTER-STYLE-RIGHT']); }
15384
  if (isset($properties['FONT-FAMILY'])) { $p['R']['font-family'] = $properties['FONT-FAMILY']; }
15385
  if (isset($properties['FONT-SIZE'])) { $p['R']['font-size'] = $this->ConvertSize($properties['FONT-SIZE']) * _MPDFK; }
15386
  if (isset($properties['FONT-WEIGHT']) && $properties['FONT-WEIGHT']=='bold') { $p['R']['font-style'] = 'B'; }
15531
  }
15532
  else { $newformat = ''; }
15533
 
15534
+
15535
  $mgr = $mgl = $mgt = $mgb = $mgh = $mgf = '';
15536
  if (isset($attr['MARGIN-RIGHT'])) { $mgr = $this->ConvertSize($attr['MARGIN-RIGHT'],$this->w,$this->FontSize,false); }
15537
  if (isset($attr['MARGIN-LEFT'])) { $mgl = $this->ConvertSize($attr['MARGIN-LEFT'],$this->w,$this->FontSize,false); }
15678
 
15679
 
15680
  case 'WATERMARKIMAGE':
15681
+ if (isset($attr['SRC'])) { $src = $attr['SRC']; } else { $src = ''; }
15682
  if (isset($attr['ALPHA']) && $attr['ALPHA']>0) { $alpha = $attr['ALPHA']; } else { $alpha = -1; }
15683
  if (isset($attr['SIZE']) && $attr['SIZE']) {
15684
  $size = $attr['SIZE'];
15685
  if (strpos($size,',')) { $size = explode(',',$size); }
15686
  }
15687
  else { $size = 'D'; }
15688
+ if (isset($attr['POS']) && $attr['POS']) {
15689
+ $pos = $attr['POS'];
15690
  if (strpos($pos,',')) { $pos = explode(',',$pos); }
15691
  }
15692
  else { $pos = 'P'; }
 
15693
  $this->SetWatermarkImage($src, $alpha, $size, $pos);
15694
  break;
15695
  /*-- END WATERMARK --*/
15891
  if (!isset($this->InlineProperties[$tag])) $this->InlineProperties[$tag] = $this->saveInlineProperties(); // mPDF 5.4.13
15892
  if (isset($annot)) { $this->InlineAnnots[$tag] = $annot; } // *ANNOTATIONS*
15893
  }
15894
+ $properties = $this->MergeCSS('INLINE',$tag,$attr);
15895
  if (!empty($properties)) $this->setCSS($properties,'INLINE');
15896
  break;
15897
 
15917
  }
15918
  if (isset($attr['HREF'])) {
15919
  $this->InlineProperties['A'] = $this->saveInlineProperties();
15920
+ $properties = $this->MergeCSS('',$tag,$attr);
15921
  if (!empty($properties)) $this->setCSS($properties,'INLINE');
15922
  $this->HREF=htmlspecialchars_decode(urldecode($attr['HREF']));
15923
  }
15925
 
15926
  case 'LEGEND': // mPDF 5.4.18
15927
  $this->InlineProperties['LEGEND'] = $this->saveInlineProperties();
15928
+ $properties = $this->MergeCSS('',$tag,$attr);
15929
  if (!empty($properties)) $this->setCSS($properties,'INLINE');
15930
  break;
15931
 
15978
  $objattr['border_left']['w'] = 0;
15979
  $objattr['border_right']['w'] = 0;
15980
 
15981
+ $properties = $this->MergeCSS('',$tag,$attr);
15982
  if(isset($properties ['DISPLAY']) && strtolower($properties ['DISPLAY'])=='none') {
15983
  return;
15984
  }
16009
  $w = 0;
16010
  $h = 0;
16011
  if(isset($properties['WIDTH'])) $w = $this->ConvertSize($properties['WIDTH'],$this->blk[$this->blklvl]['inner_width'],$this->FontSize,false);
 
 
16012
  if(isset($properties['HEIGHT'])) $h = $this->ConvertSize($properties['HEIGHT'],$this->blk[$this->blklvl]['inner_width'],$this->FontSize,false);
 
16013
 
16014
+ if(isset($attr['WIDTH'])) $w = $this->ConvertSize($attr['WIDTH'],$this->blk[$this->blklvl]['inner_width'],$this->FontSize,false);
16015
+ if(isset($attr['HEIGHT'])) $h = $this->ConvertSize($attr['HEIGHT'],$this->blk[$this->blklvl]['inner_width'],$this->FontSize,false);
16016
  if (isset($properties['OPACITY']) && $properties['OPACITY'] > 0 && $properties['OPACITY'] <= 1) { $objattr['opacity'] = $properties['OPACITY']; }
16017
  if ($this->HREF) {
16018
  if (strpos($this->HREF,".") === false && strpos($this->HREF,"@") !== 0) {
16100
  case 'BR':
16101
  // Added mPDF 3.0 Float DIV - CLEAR
16102
  if (isset($attr['STYLE'])) {
16103
+ $properties = $this->readInlineCSS($attr['STYLE']);
16104
  if (isset($properties['CLEAR'])) { $this->ClearFloats(strtoupper($properties['CLEAR']),$this->blklvl); } // *CSS-FLOAT*
16105
  }
16106
 
16174
  case 'HGROUP':
16175
  case 'NAV':
16176
  case 'SECTION':
16177
+ $p = $this->PreviewBlockCSS($tag,$attr);
16178
  if(isset($p['DISPLAY']) && strtolower($p['DISPLAY'])=='none') {
16179
  $this->blklvl++;
16180
  $this->blk[$this->blklvl]['hide'] = true;
16251
  if ($tag == 'CENTER' && $this->tdbegin) { $this->cell[$this->row][$this->col]['a'] = $align['center']; }
16252
 
16253
  $this->InlineProperties['BLOCKINTABLE'] = $this->saveInlineProperties();
16254
+ $properties = $this->MergeCSS('',$tag,$attr);
16255
  if (!empty($properties)) $this->setCSS($properties,'INLINE');
16256
 
16257
 
16283
  $currblk['attr'] = $attr;
16284
 
16285
  $this->Reset();
16286
+ $properties = $this->MergeCSS('BLOCK',$tag,$attr);
16287
  $pagesel = '';
16288
  /*-- CSS-PAGE --*/
16289
 
16331
  $this->blk[0]['width'] =& $this->pgwidth;
16332
  $this->blk[0]['inner_width'] =& $this->pgwidth;
16333
  $this->blk[0]['blockContext'] = $this->blockContext;
16334
+ $properties = $this->MergeCSS('BLOCK','BODY','');
16335
  $this->setCSS($properties,'','BODY');
16336
  $this->blklvl++;
16337
  $currblk =& $this->blk[$this->blklvl];
16342
  $currblk['attr'] = $attr;
16343
 
16344
  $this->Reset();
16345
+ $properties = $this->MergeCSS('BLOCK',$tag,$attr);
16346
  }
16347
  /*-- COLUMNS --*/
16348
  if ($save_cols) {
16699
  case 'HR':
16700
  // Added mPDF 3.0 Float DIV - CLEAR
16701
  if (isset($attr['STYLE'])) {
16702
+ $properties = $this->readInlineCSS($attr['STYLE']);
16703
  if (isset($properties['CLEAR'])) { $this->ClearFloats(strtoupper($properties['CLEAR']),$this->blklvl); } // *CSS-FLOAT*
16704
  }
16705
 
16716
  $objattr['border_bottom']['w'] = 0;
16717
  $objattr['border_left']['w'] = 0;
16718
  $objattr['border_right']['w'] = 0;
16719
+ $properties = $this->MergeCSS('',$tag,$attr);
16720
  if (isset($properties['MARGIN-TOP'])) { $objattr['margin_top'] = $this->ConvertSize($properties['MARGIN-TOP'],$this->blk[$this->blklvl]['inner_width'],$this->FontSize,false); }
16721
  if (isset($properties['MARGIN-BOTTOM'])) { $objattr['margin_bottom'] = $this->ConvertSize($properties['MARGIN-BOTTOM'],$this->blk[$this->blklvl]['inner_width'],$this->FontSize,false); }
16722
  if (isset($properties['WIDTH'])) { $objattr['width'] = $this->ConvertSize($properties['WIDTH'],$this->blk[$this->blklvl]['inner_width']); }
 
16723
  if (isset($properties['TEXT-ALIGN'])) { $objattr['align'] = $align[strtolower($properties['TEXT-ALIGN'])]; }
 
16724
 
16725
  if (isset($properties['MARGIN-LEFT']) && strtolower($properties['MARGIN-LEFT'])=='auto') {
16726
  $objattr['align'] = 'R';
16732
  }
16733
  }
16734
  if (isset($properties['COLOR'])) { $objattr['color'] = $this->ConvertColor($properties['COLOR']); }
 
16735
  if (isset($properties['HEIGHT'])) { $objattr['linewidth'] = $this->ConvertSize($properties['HEIGHT'],$this->blk[$this->blklvl]['inner_width'],$this->FontSize,false); }
16736
 
16737
+ if(isset($attr['WIDTH']) && $attr['WIDTH'] != '') $objattr['width'] = $this->ConvertSize($attr['WIDTH'],$this->blk[$this->blklvl]['inner_width']);
16738
+ if(isset($attr['ALIGN']) && $attr['ALIGN'] != '') $objattr['align'] = $align[strtolower($attr['ALIGN'])];
16739
+ if(isset($attr['COLOR']) && $attr['COLOR'] != '') $objattr['color'] = $this->ConvertColor($attr['COLOR']);
16740
 
16741
  /*-- TABLES --*/
16742
  if ($this->tableLevel) {
16822
  else { $objattr['bheight'] = 1; }
16823
  if(isset($attr['PR']) && $attr['PR']>0) { $objattr['pr_ratio'] = $attr['PR']; }
16824
  else { $objattr['pr_ratio'] = ''; }
16825
+ $properties = $this->MergeCSS('',$tag,$attr);
16826
  if(isset($properties ['DISPLAY']) && strtolower($properties ['DISPLAY'])=='none') {
16827
  return;
16828
  }
16938
  case 'SELECT':
16939
  $this->lastoptionaltag = ''; // Save current HTML specified optional endtag
16940
  $this->InlineProperties[$tag] = $this->saveInlineProperties();
16941
+ $properties = $this->MergeCSS('',$tag,$attr);
16942
  if (isset($properties['FONT-FAMILY'])) {
16943
  $this->SetFont($properties['FONT-FAMILY'],$this->FontStyle,0,false);
16944
  }
17018
  if (isset($attr['ONFORMAT'])) { $objattr['onFormat'] = $attr['ONFORMAT']; }
17019
  }
17020
  $this->InlineProperties[$tag] = $this->saveInlineProperties();
17021
+ $properties = $this->MergeCSS('',$tag,$attr);
17022
  if (isset($properties['FONT-FAMILY'])) {
17023
  $this->SetFont($properties['FONT-FAMILY'],'',0,false);
17024
  }
17030
  $objattr['fontfamily'] = $this->FontFamily;
17031
  $objattr['fontsize'] = $this->FontSizePt;
17032
  if ($this->useActiveForms) {
17033
+ if(isset($attr['ALIGN'])) { $objattr['text_align'] = $align[strtolower($attr['ALIGN'])]; }
17034
+ else if(isset($properties['TEXT-ALIGN'])) { $objattr['text_align'] = $align[strtolower($properties['TEXT-ALIGN'])]; }
17035
  if (isset($properties['OVERFLOW']) && strtolower($properties['OVERFLOW'])=='hidden') { $objattr['donotscroll'] = true; }
17036
  if (isset($properties['BORDER-TOP-COLOR'])) { $objattr['border-col'] = $this->ConvertColor($properties['BORDER-TOP-COLOR']); }
17037
  if (isset($properties['BACKGROUND-COLOR'])) { $objattr['background-col'] = $this->ConvertColor($properties['BACKGROUND-COLOR']); }
17111
  }
17112
 
17113
  $this->InlineProperties[$tag] = $this->saveInlineProperties();
17114
+ $properties = $this->MergeCSS('',$tag,$attr);
17115
  $objattr['vertical-align'] = '';
17116
 
17117
  if (isset($properties['FONT-FAMILY'])) {
17425
  if(isset($attr['SRC'])) {
17426
  $srcpath = $attr['SRC'];
17427
  $orig_srcpath = $attr['ORIG_SRC'];
17428
+ $properties = $this->MergeCSS('',$tag,$attr);
17429
  if(isset($properties ['DISPLAY']) && strtolower($properties ['DISPLAY'])=='none') {
17430
  return;
17431
  }
17465
  $w = 0;
17466
  $h = 0;
17467
  if(isset($properties['WIDTH'])) $w = $this->ConvertSize($properties['WIDTH'],$this->blk[$this->blklvl]['inner_width'],$this->FontSize,false);
 
17468
  if(isset($properties['HEIGHT'])) $h = $this->ConvertSize($properties['HEIGHT'],$this->blk[$this->blklvl]['inner_width'],$this->FontSize,false);
17469
+ // mPDF 5.5.15
 
17470
  $maxw=$maxh=$minw=$minh=false;
17471
  if(isset($properties['MAX-WIDTH'])) $maxw = $this->ConvertSize($properties['MAX-WIDTH'],$this->blk[$this->blklvl]['inner_width'],$this->FontSize,false);
 
17472
  if(isset($properties['MAX-HEIGHT'])) $maxh = $this->ConvertSize($properties['MAX-HEIGHT'],$this->blk[$this->blklvl]['inner_width'],$this->FontSize,false);
 
17473
  if(isset($properties['MIN-WIDTH'])) $minw = $this->ConvertSize($properties['MIN-WIDTH'],$this->blk[$this->blklvl]['inner_width'],$this->FontSize,false);
 
17474
  if(isset($properties['MIN-HEIGHT'])) $minh = $this->ConvertSize($properties['MIN-HEIGHT'],$this->blk[$this->blklvl]['inner_width'],$this->FontSize,false);
 
17475
 
17476
+ if(isset($attr['WIDTH'])) $w = $this->ConvertSize($attr['WIDTH'],$this->blk[$this->blklvl]['inner_width'],$this->FontSize,false);
17477
+ if(isset($attr['HEIGHT'])) $h = $this->ConvertSize($attr['HEIGHT'],$this->blk[$this->blklvl]['inner_width'],$this->FontSize,false);
17478
  if (isset($properties['OPACITY']) && $properties['OPACITY'] > 0 && $properties['OPACITY'] <= 1) { $objattr['opacity'] = $properties['OPACITY']; }
17479
  if ($this->HREF) {
17480
  if (strpos($this->HREF,".") === false && strpos($this->HREF,"@") !== 0) {
17681
  $objattr['char-width'] = 100;
17682
 
17683
  $this->InlineProperties[$tag] = $this->saveInlineProperties();
17684
+ $properties = $this->MergeCSS('INLINE',$tag,$attr);
17685
 
17686
  if(isset($properties ['DISPLAY']) && strtolower($properties ['DISPLAY'])=='none') {
17687
  return;
17838
  $this->table[$this->tableLevel][$this->tbctr[$this->tableLevel]]['currcol'] = $this->col;
17839
  }
17840
  $this->tableLevel++;
17841
+ $this->tbCSSlvl++;
17842
 
17843
  if ($this->tableLevel>1) { // inherit table properties from cell in which nested
17844
  $this->base_table_properties['FONT-KERNING'] = $this->kerning ;
17904
  $table['a'] = false;
17905
  $table['border_spacing_H'] = false;
17906
  $table['border_spacing_V'] = false;
17907
+
17908
  $this->Reset();
17909
  $this->InlineProperties = array();
17910
  $this->spanlvl = 0;
17928
  }
17929
 
17930
  // ADDED CSS FUNCIONS FOR TABLE
17931
+ if ($this->tbCSSlvl==1) {
17932
+ $properties = $this->MergeCSS('TOPTABLE',$tag,$attr);
17933
  }
17934
  else {
17935
+ $properties = $this->MergeCSS('TABLE',$tag,$attr);
17936
  }
17937
  $w = '';
17938
  if (isset($properties['WIDTH'])) { $w = $properties['WIDTH']; }
 
 
17939
 
17940
  if(isset($properties['DIRECTION']) && $properties['DIRECTION']) { $table['direction'] = strtolower($properties['DIRECTION']); }
17941
+ if(isset($attr['DIR']) && $attr['DIR']) { $table['direction'] = strtolower($attr['DIR']); }
17942
  else if (!isset($table['direction'])){ $table['direction'] = $this->blk[$this->blklvl]['direction']; }
17943
 
17944
  if (isset($properties['BACKGROUND-COLOR'])) { $table['bgcolor'][-1] = $properties['BACKGROUND-COLOR']; }
17945
  else if (isset($properties['BACKGROUND'])) { $table['bgcolor'][-1] = $properties['BACKGROUND']; }
 
17946
  if (isset($properties['VERTICAL-ALIGN'])) { $table['va'] = $align[strtolower($properties['VERTICAL-ALIGN'])]; }
17947
  if (isset($properties['TEXT-ALIGN'])) { $table['txta'] = $align[strtolower($properties['TEXT-ALIGN'])]; }
 
 
 
 
 
 
17948
  if (isset($properties['AUTOSIZE']) && $properties['AUTOSIZE'] && $this->tableLevel ==1) {
17949
  $this->shrink_this_table_to_fit = $properties['AUTOSIZE'];
17950
  if ($this->shrink_this_table_to_fit < 1) { $this->shrink_this_table_to_fit = 0; }
18088
  $table['borders_separate'] = false;
18089
  }
18090
 
 
 
 
 
18091
  if (isset($properties['BORDER-SPACING-H'])) {
18092
  $table['border_spacing_H'] = $this->ConvertSize($properties['BORDER-SPACING-H'],$this->blk[$this->blklvl]['inner_width'],$this->FontSize,false);
18093
  }
18126
 
18127
  $properties = array();
18128
 
18129
+ if (!$table['borders_separate']) { $table['border_spacing_H'] = $table['border_spacing_V'] = 0; }
18130
+ else if (isset($attr['CELLSPACING'])) {
18131
+ $table['border_spacing_H'] = $table['border_spacing_V'] = $this->ConvertSize($attr['CELLSPACING'],$this->blk[$this->blklvl]['inner_width']);
18132
+ }
18133
 
18134
 
18135
  if (isset($attr['CELLPADDING'])) {
18153
  else {
18154
  $this->table_border_attr_set = 0;
18155
  }
18156
+ if (isset($attr['ALIGN'])) { $table['a'] = $align[strtolower($attr['ALIGN'])]; }
18157
+ if (!$table['a']) {
18158
+ if ($table['direction'] == 'rtl' ) { $table['a'] = 'R'; }
18159
+ else { $table['a'] = 'L'; }
18160
+ }
18161
+ if (isset($attr['BGCOLOR'])) { $table['bgcolor'][-1] = $attr['BGCOLOR']; }
18162
 
18163
+ if (isset($attr['WIDTH']) && $attr['WIDTH']) { $w = $attr['WIDTH']; }
18164
+ if ($w) { // set here or earlier in $properties
18165
  $maxwidth = $this->blk[$this->blklvl]['inner_width'];
18166
  if ($table['borders_separate']) {
18167
  $tblblw = $table['margin']['L'] + $table['margin']['R'] + $table['border_details']['L']['w']/2 + $table['border_details']['R']['w']/2;
18230
 
18231
  case 'THEAD':
18232
  $this->lastoptionaltag = $tag; // Save current HTML specified optional endtag
18233
+ $this->tbCSSlvl++;
18234
  $this->tablethead = 1;
18235
  $this->tabletfoot = 0;
18236
+ $properties = $this->MergeCSS('TABLE',$tag,$attr);
18237
  if (isset($properties['FONT-WEIGHT'])) {
18238
  if (strtoupper($properties['FONT-WEIGHT']) == 'BOLD') { $this->thead_font_weight = 'B'; }
18239
  else { $this->thead_font_weight = ''; }
18259
 
18260
  case 'TFOOT':
18261
  $this->lastoptionaltag = $tag; // Save current HTML specified optional endtag
18262
+ $this->tbCSSlvl++;
18263
  $this->tabletfoot = 1;
18264
  $this->tablethead = 0;
18265
+ $properties = $this->MergeCSS('TABLE',$tag,$attr);
18266
  if (isset($properties['FONT-WEIGHT'])) {
18267
  if (strtoupper($properties['FONT-WEIGHT']) == 'BOLD') { $this->tfoot_font_weight = 'B'; }
18268
  else { $this->tfoot_font_weight = ''; }
18291
  $this->tablethead = 0;
18292
  $this->tabletfoot = 0;
18293
  $this->lastoptionaltag = $tag; // Save current HTML specified optional endtag
18294
+ $this->tbCSSlvl++;
18295
+ $this->MergeCSS('TABLE',$tag,$attr);
18296
  break;
18297
 
18298
 
18299
  case 'TR':
18300
  $this->lastoptionaltag = $tag; // Save current HTML specified optional endtag
18301
+ $this->tbCSSlvl++;
18302
  $this->row++;
18303
  $this->table[$this->tableLevel][$this->tbctr[$this->tableLevel]]['nr']++;
18304
  $this->col = -1;
18305
+ $properties = $this->MergeCSS('TABLE',$tag,$attr);
18306
 
18307
  if (!$this->simpleTables && (!isset($this->table[$this->tableLevel][$this->tbctr[$this->tableLevel]]['borders_separate']) || !$this->table[$this->tableLevel][$this->tbctr[$this->tableLevel]]['borders_separate'])) {
18308
  if (isset($properties['BORDER-LEFT']) && $properties['BORDER-LEFT']) { $this->table[$this->tableLevel][$this->tbctr[$this->tableLevel]]['trborder-left'][$this->row] = $properties['BORDER-LEFT']; }
18312
  }
18313
 
18314
  if (isset($properties['BACKGROUND-COLOR'])) { $this->table[$this->tableLevel][$this->tbctr[$this->tableLevel]]['bgcolor'][$this->row] = $properties['BACKGROUND-COLOR']; }
 
18315
 
18316
  /*-- BACKGROUNDS --*/
18317
  if (isset($properties['BACKGROUND-GRADIENT']) && !$this->kwt && !$this->ColActive) { $this->table[$this->tableLevel][$this->tbctr[$this->tableLevel]]['trgradients'][$this->row] = $properties['BACKGROUND-GRADIENT']; }
18323
  /*-- END BACKGROUNDS --*/
18324
 
18325
 
18326
+
18327
+
18328
  if (isset($properties['TEXT-ROTATE'])) {
18329
  $this->trow_text_rotate = $properties['TEXT-ROTATE'];
18330
  }
18331
  if (isset($attr['TEXT-ROTATE'])) $this->trow_text_rotate = $attr['TEXT-ROTATE'];
18332
 
18333
+ if (isset($attr['BGCOLOR'])) $this->table[$this->tableLevel][$this->tbctr[$this->tableLevel]]['bgcolor'][$this->row] = $attr['BGCOLOR'];
18334
  if ($this->tablethead) { $this->table[$this->tableLevel][$this->tbctr[$this->tableLevel]]['is_thead'][$this->row] = true; }
18335
  if ($this->tabletfoot) { $this->table[$this->tableLevel][$this->tbctr[$this->tableLevel]]['is_tfoot'][$this->row] = true; }
18336
  $properties = array();
18341
  case 'TD':
18342
  $this->ignorefollowingspaces = true;
18343
  $this->lastoptionaltag = $tag; // Save current HTML specified optional endtag
18344
+ $this->tbCSSlvl++;
18345
  $this->InlineProperties = array();
18346
  $this->spanlvl = 0;
18347
  $this->tdbegin = true;
18460
  $this->cell_border_dominance_T = 0;
18461
  $this->cell_border_dominance_B = 0;
18462
 
18463
+ $properties = $this->MergeCSS('TABLE',$tag,$attr);
18464
+ $properties = $this->array_merge_recursive_unique($this->base_table_properties, $properties);
18465
 
18466
  if (isset($properties['FONT-KERNING']) && (strtoupper($properties['FONT-KERNING'])=='NORMAL' || strtoupper($properties['FONT-KERNING'])=='AUTO')) {
18467
  $this->kerning = true;
18484
  $this->minwSpacing = 0;
18485
  $this->wSpacingCSS = '';
18486
  }
 
 
 
 
 
 
18487
 
18488
  if (isset($properties['BACKGROUND-COLOR'])) { $c['bgcolor'] = $properties['BACKGROUND-COLOR']; }
18489
  else if (isset($properties['BACKGROUND'])) { $c['bgcolor'] = $properties['BACKGROUND']; }
 
 
 
18490
 
18491
  /*-- BACKGROUNDS --*/
18492
  if (isset($properties['BACKGROUND-GRADIENT'])) { $c['gradient'] = $properties['BACKGROUND-GRADIENT']; }
18497
  if ($ret) { $c['background-image'] = $ret; }
18498
  }
18499
  /*-- END BACKGROUNDS --*/
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18500
 
18501
+ if (isset($properties['VERTICAL-ALIGN'])) { $c['va']=$align[strtolower($properties['VERTICAL-ALIGN'])]; }
18502
+ if (isset($properties['TEXT-ALIGN'])) { $c['a'] = $align[strtolower($properties['TEXT-ALIGN'])]; }
18503
 
18504
  if (isset($properties['TEXT-ROTATE']) && ($properties['TEXT-ROTATE'] || $properties['TEXT-ROTATE']==="0")){
18505
  $c['R'] = $properties['TEXT-ROTATE'];
18600
 
18601
  $w = '';
18602
  if (isset($properties['WIDTH'])) { $w = $properties['WIDTH']; }
18603
+ if (isset($attr['WIDTH'])) { $w = $attr['WIDTH']; }
18604
  if ($w) {
18605
  if (strpos($w,'%') && !$this->ignore_table_percents ) { $c['wpercent'] = $w + 0; } // makes 80% -> 80
18606
  else if (!strpos($w,'%') && !$this->ignore_table_widths ) { $c['w'] = $this->ConvertSize($w,$this->blk[$this->blklvl]['inner_width'],$this->FontSize,false); }
18607
  }
18608
 
18609
  if (isset($properties['HEIGHT']) && !strpos($properties['HEIGHT'],'%')) { $c['h'] = $this->ConvertSize($properties['HEIGHT'],$this->blk[$this->blklvl]['inner_width'],$this->FontSize,false); }
 
 
18610
 
18611
  if (isset($properties['COLOR'])) {
18612
  $cor = $this->ConvertColor($properties['COLOR']);
18639
  else if (strtoupper($properties['TEXT-DECORATION']) == 'UNDERLINE') { $this->SetStyle('U',true); }
18640
  }
18641
  if (isset($properties['TEXT-SHADOW'])) {
18642
+ $ts = $this->setCSStextshadow($properties['TEXT-SHADOW']);
18643
  if ($ts) { $this->textshadow = $ts; }
18644
  }
18645
  if (isset($properties['TEXT-TRANSFORM'])) {
18652
  }
18653
  $properties = array();
18654
 
18655
+
18656
+ if (isset($attr['HEIGHT']) && !strpos($attr['HEIGHT'],'%')) $c['h'] = $this->ConvertSize($attr['HEIGHT'],$this->blk[$this->blklvl]['inner_width'],$this->FontSize,false);
18657
+
18658
+ if (isset($attr['ALIGN'])) $c['a'] = $align[strtolower($attr['ALIGN'])];
18659
+
18660
+ if (!$c['a']) {
18661
+ if (isset($table['direction']) && $table['direction'] == 'rtl' ) { $c['a'] = 'R'; }
18662
+ else { $c['a'] = 'L'; }
18663
+ }
18664
+ if (isset($attr['VALIGN'])) $c['va'] = $align[strtolower($attr['VALIGN'])];
18665
+
18666
+
18667
+ if (isset($attr['BGCOLOR'])) $c['bgcolor'] = $attr['BGCOLOR'];
18668
  if (isset($attr['TEXT-ROTATE'])) {
18669
  $c['R'] = $attr['TEXT-ROTATE'];
18670
  }
18706
 
18707
  $this->linebreakjustfinished=false;
18708
  $this->lastoptionaltag = ''; // Save current HTML specified optional endtag
18709
+ $this->listCSSlvl++;
18710
  if((!$this->tableLevel) && ($this->listlvl == 0)) {
18711
  $blockstate = 0;
18712
  //if ($this->lastblocklevelchange == 1) { $blockstate = -1; } // Top margins/padding only
18739
  $this->listlist[$this->listlvl]['MAXNUM'] = $this->listnum; //save previous lvl's maxnum
18740
  }
18741
  $this->listlvl++;
18742
+ $this->listnum = 0; // reset
 
 
18743
  $this->listlist[$this->listlvl] = array('TYPE'=>$this->listtype,'MAXNUM'=>$this->listnum);
18744
  break;
18745
  }
18750
  if (($this->PDFA && !$this->PDFAauto) || ($this->PDFX && !$this->PDFXauto)) { $this->PDFAXwarnings[] = "List bullets cannot use core font Zapfdingbats in PDFA1-b or PDFX/1-a. (Substitute characters from current font used if available, otherwise substitutes hyphen '-')"; }
18751
  }
18752
 
18753
+ if ($this->listCSSlvl==1) {
18754
+ $properties = $this->MergeCSS('TOPLIST',$tag,$attr);
18755
  }
18756
  else {
18757
+ $properties = $this->MergeCSS('LIST',$tag,$attr);
18758
  }
18759
  if (!empty($properties)) $this->setCSS($properties,'LIST');
18760
  // List-type
18761
 
18762
  $this->listtype = '';
18763
+ if (isset($attr['TYPE']) && $attr['TYPE']) { $this->listtype = $attr['TYPE']; }
18764
+ else if (isset($properties['LIST-STYLE-TYPE'])) {
18765
  $this->listtype = $this->_getListStyle($properties['LIST-STYLE-TYPE']);
18766
  }
18767
  else if (isset($properties['LIST-STYLE'])) {
18768
  $this->listtype = $this->_getListStyle($properties['LIST-STYLE']);
18769
  }
 
18770
  if (!$this->listtype) {
18771
  if ($tag == 'OL') $this->listtype = '1';
18772
  if ($tag == 'UL') {
18778
  if ($this->listlvl == 0) {
18779
  $this->inherit_lineheight = 0;
18780
  $this->listlvl++; // first depth level
18781
+ $this->listnum = 0; // reset
 
 
18782
  $this->listDir = (isset($this->blk[$this->blklvl]['direction']) ? $this->blk[$this->blklvl]['direction'] : null);
18783
  $occur = $this->listoccur[$this->listlvl] = 1;
18784
  $this->listlist[$this->listlvl][1] = array('TYPE'=>$this->listtype,'MAXNUM'=>$this->listnum);
18794
  $occur = $this->listoccur[$this->listlvl];
18795
  $this->listlist[$this->listlvl][$occur]['MAXNUM'] = $this->listnum; //save previous lvl's maxnum
18796
  $this->listlvl++;
18797
+ $this->listnum = 0; // reset
 
 
18798
 
18799
 
18800
  if (!isset($this->listoccur[$this->listlvl]) || $this->listoccur[$this->listlvl] == 0) $this->listoccur[$this->listlvl] = 1;
18823
  }
18824
 
18825
  if (isset($properties['DIRECTION']) && $properties['DIRECTION']) { $this->listDir = strtolower($properties['DIRECTION']); }
18826
+ if (isset($attr['DIR']) && $attr['DIR']) { $this->listDir = strtolower($attr['DIR']); }
18827
 
18828
  }
18829
  $this->list_indent[$this->listlvl][$occur] = 5; // mm default indent for each level
18940
  }
18941
  $this->listjustfinished = false;
18942
 
18943
+ $this->listCSSlvl++;
18944
+ $properties = $this->MergeCSS('LIST',$tag,$attr);
18945
  if (!empty($properties)) $this->setCSS($properties,'LIST');
18946
  $this->InlineProperties['LISTITEM'][$this->listlvl][$this->listoccur[$this->listlvl]][$this->listnum] = $this->saveInlineProperties();
18947
 
18948
  // List-type
18949
+ if (isset($attr['TYPE']) && $attr['TYPE']) { $this->listitemtype = $attr['TYPE']; }
18950
+ else if (isset($properties['LIST-STYLE-TYPE'])) {
18951
  $this->listitemtype = $this->_getListStyle($properties['LIST-STYLE-TYPE']);
18952
  }
18953
  else if (isset($properties['LIST-STYLE'])) {
18954
  $this->listitemtype = $this->_getListStyle($properties['LIST-STYLE']);
18955
  }
 
18956
  else $this->listitemtype = '';
18957
  break;
18958
  /*-- END LISTS --*/
19135
  if ($this->listlvl>0) { return; }
19136
  /*-- END LISTS --*/
19137
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19138
  /*-- TABLES --*/
19139
  if($this->tableLevel) {
19140
  if ($this->linebreakjustfinished) { $this->blockjustfinished=false; }
19343
  $this->blk[0]['width'] =& $this->pgwidth;
19344
  $this->blk[0]['inner_width'] =& $this->pgwidth;
19345
  $this->blk[0]['blockContext'] = $this->blockContext;
19346
+ $properties = $this->MergeCSS('BLOCK','BODY','');
19347
  $this->setCSS($properties,'','BODY');
19348
  $this->blklvl++;
19349
  $currblk =& $this->blk[$this->blklvl];
19354
  $currblk['attr'] = $attr;
19355
 
19356
  $this->Reset();
19357
+ $properties = $this->MergeCSS('BLOCK',$tag,$attr);
19358
  }
19359
  /*-- COLUMNS --*/
19360
  if ($save_cols) {
19391
 
19392
  if(($tag=='TH' or $tag=='TD') && $this->tableLevel) {
19393
  $this->lastoptionaltag = 'TR';
19394
+ unset($this->tablecascadeCSS[$this->tbCSSlvl]);
19395
+ $this->tbCSSlvl--;
19396
  if (!$this->tdbegin) { return; }
19397
  $this->tdbegin = false;
19398
  // Added for correct calculation of cell column width - otherwise misses the last line if not end </p> etc.
19456
  }
19457
  }
19458
  $this->lastoptionaltag = '';
19459
+ unset($this->tablecascadeCSS[$this->tbCSSlvl]);
19460
+ $this->tbCSSlvl--;
19461
  $this->trow_text_rotate = '';
19462
  $this->tabletheadjustfinished = false;
19463
  }
19464
 
19465
  if($tag=='TBODY') {
19466
  $this->lastoptionaltag = '';
19467
+ unset($this->tablecascadeCSS[$this->tbCSSlvl]);
19468
+ $this->tbCSSlvl--;
19469
  }
19470
 
19471
  if($tag=='THEAD') {
19472
  $this->lastoptionaltag = '';
19473
+ unset($this->tablecascadeCSS[$this->tbCSSlvl]);
19474
+ $this->tbCSSlvl--;
19475
  $this->tablethead = 0;
19476
  $this->tabletheadjustfinished = true;
19477
  $this->ResetStyles();
19485
 
19486
  if($tag=='TFOOT') {
19487
  $this->lastoptionaltag = '';
19488
+ unset($this->tablecascadeCSS[$this->tbCSSlvl]);
19489
+ $this->tbCSSlvl--;
19490
  $this->tabletfoot = 0;
19491
  $this->ResetStyles();
19492
  $this->tfoot_font_weight = '';
19501
  if ($this->progressBar) { $this->UpdateProgressBar(1,'','TABLE'); } // *PROGRESS-BAR*
19502
  if ($this->progressBar) { $this->UpdateProgressBar(7,0,''); } // *PROGRESS-BAR*
19503
  $this->lastoptionaltag = '';
19504
+ unset($this->tablecascadeCSS[$this->tbCSSlvl]);
19505
+ $this->tbCSSlvl--;
19506
  $this->ignorefollowingspaces = true; //Eliminate exceeding left-side spaces
19507
  $this->table[$this->tableLevel][$this->tbctr[$this->tableLevel]]['cells'] = $this->cell;
19508
  $this->table[$this->tableLevel][$this->tbctr[$this->tableLevel]]['wc'] = array_pad(array(),$this->table[$this->tableLevel][$this->tbctr[$this->tableLevel]]['nc'],array('miw'=>0,'maw'=>0));
20098
  $this->tableLevel=0;
20099
  $this->tbctr=array();
20100
  $this->innermostTableLevel=0;
20101
+ $this->tbCSSlvl = 0;
20102
+ $this->tablecascadeCSS = array();
20103
 
20104
  unset($this->cell);
20105
  $this->cell=array(); //array
20155
  $this->blk[0]['width'] =& $this->pgwidth;
20156
  $this->blk[0]['inner_width'] =& $this->pgwidth;
20157
  $this->blk[0]['blockContext'] = $this->blockContext;
20158
+ $properties = $this->MergeCSS('BLOCK','BODY','');
20159
  $this->setCSS($properties,'','BODY');
20160
  }
20161
 
20193
 
20194
  if($tag=='LI') {
20195
  $this->lastoptionaltag = '';
20196
+ unset($this->listcascadeCSS[$this->listCSSlvl]);
20197
+ $this->listCSSlvl--;
20198
  if (isset($this->listoccur[$this->listlvl]) && isset($this->InlineProperties['LIST'][$this->listlvl][$this->listoccur[$this->listlvl]])) { $this->restoreInlineProperties($this->InlineProperties['LIST'][$this->listlvl][$this->listoccur[$this->listlvl]]); }
20199
  }
20200
 
20201
 
20202
  if(($tag=='UL') or ($tag=='OL')) {
20203
  $this->ignorefollowingspaces = true; //Eliminate exceeding left-side spaces
20204
+ unset($this->listcascadeCSS[$this->listCSSlvl]);
20205
+ $this->listCSSlvl--;
20206
 
20207
  $this->lastoptionaltag = '';
20208
  /*-- TABLES --*/
20258
  }
20259
  if (isset($this->blk[$this->blklvl]['InlineProperties'])) { $this->restoreInlineProperties($this->blk[$this->blklvl]['InlineProperties']);}
20260
  $this->listjustfinished = true;
20261
+ $this->listCSSlvl = 0;
20262
+ $this->listcascadeCSS = array();
20263
  $this->blockjustfinished=true;
20264
  $this->lastblockbottommargin = $this->list_margin_bottom;
20265
  }
20616
  /*-- END LISTS --*/
20617
 
20618
  function _saveTextBuffer($t, $link = '', $intlink = '') {
20619
+ $this->textbuffer[] = array($t,$link,$this->currentfontstyle,$this->colorarray,$this->currentfontfamily,$this->SUP,$this->SUB,$intlink,$this->strike,$this->outlineparam,$this->spanbgcolorarray,$this->currentfontsize,$this->ReqFontStyle,$this->kerning,$this->lSpacingCSS,$this->wSpacingCSS,$this->spanborddet, $this->textshadow);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20620
  }
20621
 
20622
  function _saveCellTextBuffer($t, $link = '', $intlink = '') {
20623
+ $this->cell[$this->row][$this->col]['textbuffer'][] = array($t,$link,$this->currentfontstyle,$this->colorarray,$this->currentfontfamily,$this->SUP,$this->SUB,$intlink,$this->strike,$this->outlineparam,$this->spanbgcolorarray,$this->currentfontsize,$this->ReqFontStyle,$this->kerning,$this->lSpacingCSS,$this->wSpacingCSS,$this->spanborddet, $this->textshadow);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20624
  }
20625
 
20626
 
20724
  }
20725
 
20726
  if(isset($vetor[15])) { // Word spacing
20727
+ $this->wSpacingCSS = $vetor[15];
20728
  if ($this->wSpacingCSS && strtoupper($this->wSpacingCSS) != 'NORMAL') {
20729
  $this->minwSpacing = $this->ConvertSize($this->wSpacingCSS,$this->FontSize);
20730
  }
20745
  $this->spanbgcolorarray = $vetor[10];
20746
  $this->spanbgcolor = true;
20747
  }
20748
+ if(isset($vetor[9]) and !empty($vetor[9])) // Outline parameters
20749
  {
20750
+ $cor = $vetor[9]['COLOR'];
20751
+ $outlinewidth = $vetor[9]['WIDTH'];
20752
+ $this->SetTextOutline($outlinewidth,$cor);
20753
+ $this->outline_on = true;
20754
  }
20755
  if(isset($vetor[8]) and $vetor[8] === true) // strike-through the text
20756
  {
20757
  $this->strike = true;
20758
  }
20759
+ if(isset($vetor[7]) and $vetor[7] != '') // internal link: <a name="anyvalue">
20760
  {
20761
  $ily = $this->y;
20762
  if ($this->keep_block_together) { $this->internallink[$vetor[7]] = array("Y"=>$ily,"PAGE"=>$this->page, "kt"=>true ); }
20797
  }
20798
  if(isset($vetor[1]) and $vetor[1] != '') //LINK
20799
  {
20800
+
20801
  if (strpos($vetor[1],".") === false && strpos($vetor[1],"@") !== 0) //assuming every external link has a dot indicating extension (e.g: .html .txt .zip www.somewhere.com etc.)
20802
  {
20803
  //Repeated reference to same anchor?
21216
  $this->spanborder = false;
21217
  $this->spanborddet = array();
21218
  $this->HREF = '';
21219
+ $this->outlineparam = array();
21220
+ $this->SetTextOutline(false);
21221
+ $this->outline_on = false;
21222
  $this->SUP = false;
21223
  $this->SUB = false;
21224
 
21304
  }
21305
  }
21306
 
 
21307
  function PaintDivBB($divider='',$blockstate=0,$blvl=0) {
21308
  // Borders & backgrounds are done elsewhere for columns - messes up the repositioning in printcolumnbuffer
21309
  if ($this->ColActive) { return ; } // *COLUMNS*
21403
  }
21404
  /*-- END BORDER-RADIUS --*/
21405
 
 
 
 
 
 
 
 
21406
  // BORDERS
21407
  if (isset($this->blk[$blvl]['y0']) && $this->blk[$blvl]['y0']) { $y0 = $this->blk[$blvl]['y0']; }
21408
  $h = $y1 - $y0;
21449
  }
21450
 
21451
  if (isset($tbd['s']) && $tbd['s']) {
 
 
 
 
 
 
 
 
 
 
21452
  $this->_setBorderLine($tbd);
21453
+ if ($tbd['style']=='dotted' || $tbd['style']=='dashed') { $this->_setDashBorder($tbd['style'],$divider,$continuingpage,'T'); }
 
 
 
 
21454
  /*-- BORDER-RADIUS --*/
21455
+ else if (($brTL_V && $brTL_H) || ($brTR_V && $brTR_H)) {
21456
  $this->SetLineJoin(0);
21457
  $this->SetLineCap(0);
21458
  }
 
21459
  if ($brTR_H && $brTR_V) {
21460
+ $this->_out($this->_EllipseArc($x0 + $w - $brTR_H, $y0 + $brTR_V, $brTR_H - $border_top/2 , $brTR_V - $border_top/2 , 1, 2, true));
 
 
 
 
 
21461
  }
21462
  else {
21463
+ /*-- END BORDER-RADIUS --*/
21464
+ $this->_out(sprintf('%.3F %.3F m ',($x0 + $w - ($border_top/2))*_MPDFK, ($this->h-($y0 + ($border_top/2)))*_MPDFK));
21465
  /*-- BORDER-RADIUS --*/
21466
+ }
21467
  if ($brTL_H && $brTL_V ) {
21468
  // mPDF 5.4.18
21469
  if ($legend) {
21470
  if ($legbreakR < ($x0 + $w - $brTR_H)) {
21471
+ $this->_out(sprintf('%.3F %.3F l ', $legbreakR*_MPDFK, ($this->h-($y0 + ($border_top/2)))*_MPDFK));
21472
  }
21473
+ if ($legbreakL > ($x0 + $border_top/2 + $brTL_H )) {
21474
+ $this->_out(sprintf('%.3F %.3F m ',$legbreakL*_MPDFK, ($this->h-($y0 + ($border_top/2)))*_MPDFK));
21475
+ $this->_out(sprintf('%.3F %.3F l ',($x0 + ($border_top/2) + $brTL_H )*_MPDFK, ($this->h-($y0 + ($border_top/2)))*_MPDFK));
21476
  }
21477
  else {
21478
+ $this->_out(sprintf('%.3F %.3F m ',($x0 + ($border_top/2) + $brTL_H )*_MPDFK, ($this->h-($y0 + ($border_top/2)))*_MPDFK));
21479
  }
21480
  }
21481
  else {
21482
+ $this->_out(sprintf('%.3F %.3F l ',($x0 + ($border_top/2) + $brTL_H )*_MPDFK, ($this->h-($y0 + ($border_top/2)))*_MPDFK));
21483
  }
21484
+ $this->_out($this->_EllipseArc($x0 + $brTL_H, $y0 + $brTL_V, $brTL_H - $border_top/2 , $brTL_V - $border_top/2 , 2, 1));
21485
  }
21486
  else {
21487
  /*-- END BORDER-RADIUS --*/
21488
  // mPDF 5.4.18
21489
  if ($legend) {
21490
+ $legbreakL -= $border_top/2; // because line cap different if not radius
21491
+ $legbreakR += $border_top/2;
21492
+ if ($legbreakR < ($x0 + $w - ($border_top/2))) {
21493
+ $this->_out(sprintf('%.3F %.3F l ',$legbreakR*_MPDFK, ($this->h-($y0 + ($border_top/2)))*_MPDFK));
 
 
 
 
 
 
 
21494
  }
21495
+ if ($legbreakL > ($x0 + $border_top/2)) {
21496
+ $this->_out(sprintf('%.3F %.3F m ',$legbreakL*_MPDFK, ($this->h-($y0 + ($border_top/2)))*_MPDFK));
21497
+ $this->_out(sprintf('%.3F %.3F l ',($x0 + ($border_top/2))*_MPDFK, ($this->h-($y0 + ($border_top/2)))*_MPDFK));
21498
  }
21499
  else {
21500
+ $this->_out(sprintf('%.3F %.3F m ', ($x0 + $border_top/2)*_MPDFK, ($this->h-($y0 + ($border_top/2)))*_MPDFK));
21501
  }
21502
  }
 
 
 
21503
  else {
21504
+ $this->_out(sprintf('%.3F %.3F l ',($x0 + ($border_top/2))*_MPDFK, ($this->h-($y0 + ($border_top/2)))*_MPDFK));
21505
  }
21506
  /*-- BORDER-RADIUS --*/
21507
  }
21508
  /*-- END BORDER-RADIUS --*/
21509
+ $this->_out('S');
 
 
 
 
 
 
 
 
21510
 
21511
  // Reset Corners and Dash off
 
 
21512
  $this->SetLineJoin(2);
21513
  $this->SetLineCap(2);
21514
  $this->SetDash();
21519
  if ($this->blk[$blvl]['border_bottom'] && $blockstate != 1 && $divider != 'pagebottom') {
21520
  $tbd = $this->blk[$blvl]['border_bottom'];
21521
  if (isset($tbd['s']) && $tbd['s']) {
 
 
 
 
 
 
 
 
 
 
21522
  $this->_setBorderLine($tbd);
21523
  if ($tbd['style']=='dotted' || $tbd['style']=='dashed') { $this->_setDashBorder($tbd['style'],$divider,$continuingpage,'B'); }
21524
  /*-- BORDER-RADIUS --*/
21525
+ else if (($brBL_V && $brBL_H) || ($brBR_V && $brBR_H)) {
21526
  $this->SetLineJoin(0);
21527
  $this->SetLineCap(0);
21528
  }
 
21529
  if ($brBL_H && $brBL_V) {
21530
+ $this->_out($this->_EllipseArc($x0 + $brBL_H, $y0 + $h - $brBL_V, $brBL_H - $border_bottom/2 , $brBL_V - $border_bottom/2 , 3, 2, true));
 
 
 
 
 
21531
  }
21532
  else {
21533
+ /*-- END BORDER-RADIUS --*/
21534
+ $this->_out(sprintf('%.3F %.3F m ',($x0 + ($border_bottom/2))*_MPDFK, ($this->h-($y0 + $h - ($border_bottom/2)))*_MPDFK));
21535
  /*-- BORDER-RADIUS --*/
 
 
 
21536
  }
21537
+ if ($brBR_H && $brBR_V ) {
21538
+ $this->_out(sprintf('%.3F %.3F l ',($x0 + $w - ($border_bottom/2) - $brBR_H )*_MPDFK, ($this->h-($y0 + $h - ($border_bottom/2)))*_MPDFK));
21539
+ $this->_out($this->_EllipseArc($x0 + $w - $brBR_H, $y0 + $h - $brBR_V, $brBR_H - $border_bottom/2 , $brBR_V - $border_bottom/2 , 4, 1));
 
21540
  }
21541
  else {
21542
+ /*-- END BORDER-RADIUS --*/
21543
+ $this->_out(sprintf('%.3F %.3F l ',($x0 + $w - ($border_bottom/2) )*_MPDFK, ($this->h-($y0 + $h - ($border_bottom/2)))*_MPDFK));
21544
+ /*-- BORDER-RADIUS --*/
 
 
 
 
 
 
21545
  }
21546
+ /*-- END BORDER-RADIUS --*/
21547
+ $this->_out('S');
21548
 
21549
  // Reset Corners and Dash off
 
 
21550
  $this->SetLineJoin(2);
21551
  $this->SetLineCap(2);
21552
  $this->SetDash();
21555
  if ($this->blk[$blvl]['border_left']) {
21556
  $tbd = $this->blk[$blvl]['border_left'];
21557
  if (isset($tbd['s']) && $tbd['s']) {
 
 
 
 
 
 
 
 
 
 
21558
  $this->_setBorderLine($tbd);
21559
  if ($tbd['style']=='dotted' || $tbd['style']=='dashed') { $this->_setDashBorder($tbd['style'],$divider,$continuingpage,'L'); }
21560
  /*-- BORDER-RADIUS --*/
21561
+ else if (($brTL_V && $brTL_H) || ($brBL_V && $brBL_H)) {
21562
  $this->SetLineJoin(0);
21563
  $this->SetLineCap(0);
21564
  }
 
21565
  if ($brTL_V && $brTL_H) {
21566
+ $this->_out($this->_EllipseArc($x0 + $brTL_H, $y0 + $brTL_V, $brTL_H - $border_left/2 , $brTL_V - $border_left/2, 2, 2, true));
 
 
 
 
 
21567
  }
21568
  else {
21569
+ /*-- END BORDER-RADIUS --*/
21570
+ $this->_out(sprintf('%.3F %.3F m ',($x0 + ($border_left/2))*_MPDFK, ($this->h-($y0 + ($border_left/2)))*_MPDFK));
21571
  /*-- BORDER-RADIUS --*/
 
 
 
21572
  }
21573
+ if ($brBL_V && $brBL_H ) {
21574
+ $this->_out(sprintf('%.3F %.3F l ',($x0 + ($border_left/2))*_MPDFK, ($this->h-($y0 + $h - ($border_left/2)- $brBL_V) )*_MPDFK));
21575
+ $this->_out($this->_EllipseArc($x0 + $brBL_H, $y0 + $h - $brBL_V, $brBL_H - $border_left/2 , $brBL_V - $border_left/2, 3, 1));
 
21576
  }
21577
  else {
21578
+ /*-- END BORDER-RADIUS --*/
21579
+ $this->_out(sprintf('%.3F %.3F l ',($x0 + ($border_left/2))*_MPDFK, ($this->h-($y0 + $h - ($border_left/2)) )*_MPDFK));
21580
+ /*-- BORDER-RADIUS --*/
 
 
 
 
 
 
21581
  }
21582
+ /*-- END BORDER-RADIUS --*/
21583
+ $this->_out('S');
21584
 
21585
  // Reset Corners and Dash off
 
 
21586
  $this->SetLineJoin(2);
21587
  $this->SetLineCap(2);
21588
  $this->SetDash();
21591
  if ($this->blk[$blvl]['border_right']) {
21592
  $tbd = $this->blk[$blvl]['border_right'];
21593
  if (isset($tbd['s']) && $tbd['s']) {
 
 
 
 
 
 
 
 
 
 
21594
  $this->_setBorderLine($tbd);
21595
  if ($tbd['style']=='dotted' || $tbd['style']=='dashed') { $this->_setDashBorder($tbd['style'],$divider,$continuingpage,'R'); }
21596
  /*-- BORDER-RADIUS --*/
21597
+ else if (($brTR_V && $brTR_H) || ($brBR_V && $brBR_H)) {
21598
  $this->SetLineJoin(0);
21599
  $this->SetLineCap(0);
21600
  }
 
21601
  if ($brBR_V && $brBR_H) {
21602
+ $this->_out($this->_EllipseArc($x0 + $w - $brBR_H, $y0 + $h - $brBR_V, $brBR_H - $border_right/2 , $brBR_V - $border_right/2, 4, 2, true));
 
 
 
 
 
21603
  }
21604
  else {
21605
+ /*-- END BORDER-RADIUS --*/
21606
+ $this->_out(sprintf('%.3F %.3F m ',($x0 + $w - ($border_right/2))*_MPDFK, ($this->h-($y0 + $h - ($border_right/2)))*_MPDFK));
21607
  /*-- BORDER-RADIUS --*/
 
 
 
21608
  }
21609
+ if ($brTR_V && $brTR_H ) {
21610
+ $this->_out(sprintf('%.3F %.3F l ',($x0 + $w - ($border_right/2))*_MPDFK, ($this->h-($y0 + ($border_right/2) + $brTR_V) )*_MPDFK));
21611
+ $this->_out($this->_EllipseArc($x0 + $w - $brTR_H, $y0 + $brTR_V, $brTR_H - $border_right/2 , $brTR_V - $border_right/2, 1, 1));
 
21612
  }
21613
  else {
21614
+ /*-- END BORDER-RADIUS --*/
21615
+ $this->_out(sprintf('%.3F %.3F l ',($x0 + $w - ($border_right/2))*_MPDFK, ($this->h-($y0 + ($border_right/2)) )*_MPDFK));
21616
+ /*-- BORDER-RADIUS --*/
 
 
 
 
 
 
21617
  }
21618
+ /*-- END BORDER-RADIUS --*/
21619
+ $this->_out('S');
21620
 
21621
  // Reset Corners and Dash off
 
 
21622
  $this->SetLineJoin(2);
21623
  $this->SetLineCap(2);
21624
  $this->SetDash();
21625
  }
21626
  }
21627
 
21628
+ if (!$brset) { // not if border-radius used
21629
+ $tbcol = $this->ConvertColor(255);
21630
+ for($l=0; $l <= $blvl; $l++) {
21631
+ if ($this->blk[$l]['bgcolor']) {
21632
+ $tbcol = $this->blk[$l]['bgcolorarray'];
21633
+ }
21634
+ }
21635
+ }
21636
+ if ($this->blk[$blvl]['border_top'] && $divider != 'pagetop' && !$continuingpage) {
21637
+ $tbd = $this->blk[$blvl]['border_top'];
21638
+ if (isset($tbd['s']) && $tbd['s']) {
21639
+ if (!$brset && $tbd['style']=='double') {
21640
+ $this->SetLineWidth($tbd['w']/3);
21641
+ $this->SetDColor($tbcol);
21642
+ $this->_out(sprintf('%.3F %.3F m %.3F %.3F l S', ($x0 + $w - ($border_top/2))*_MPDFK, ($this->h-($y0 + ($border_top/2)))*_MPDFK, ($x0 + ($border_top/2))*_MPDFK, ($this->h-($y0 + ($border_top/2)))*_MPDFK ));
21643
+ }
21644
+ }
21645
+ }
21646
+ if ($this->blk[$blvl]['border_bottom'] && $blockstate != 1 && $divider != 'pagebottom') {
21647
+ $tbd = $this->blk[$blvl]['border_bottom'];
21648
+ if (isset($tbd['s']) && $tbd['s']) {
21649
+ if (!$brset && $tbd['style']=='double') {
21650
+ $this->SetLineWidth($tbd['w']/3);
21651
+ $this->SetDColor($tbcol);
21652
+ $this->_out(sprintf('%.3F %.3F m %.3F %.3F l S', ($x0 + ($border_bottom/2))*_MPDFK, ($this->h-($y0 + $h - ($border_bottom/2)))*_MPDFK, ($x0 + $w - ($border_bottom/2) )*_MPDFK, ($this->h-($y0 + $h - ($border_bottom/2)))*_MPDFK ));
21653
+ }
21654
+ }
21655
+ }
21656
+ if ($this->blk[$blvl]['border_left']) {
21657
+ $tbd = $this->blk[$blvl]['border_left'];
21658
+ if (isset($tbd['s']) && $tbd['s']) {
21659
+ if (!$brset && $tbd['style']=='double') {
21660
+ $this->SetLineWidth($tbd['w']/3);
21661
+ $this->SetDColor($tbcol);
21662
+ $this->_out(sprintf('%.3F %.3F m %.3F %.3F l S', ($x0 + ($border_left/2))*_MPDFK, ($this->h-($y0 + ($border_left/2)))*_MPDFK, ($x0 + ($border_left/2))*_MPDFK, ($this->h-($y0 + $h - ($border_left/2)) )*_MPDFK));
21663
+ }
21664
+ }
21665
+ }
21666
+ if ($this->blk[$blvl]['border_right']) {
21667
+ $tbd = $this->blk[$blvl]['border_right'];
21668
+ if (isset($tbd['s']) && $tbd['s']) {
21669
+ if (!$brset && $tbd['style']=='double') {
21670
+ $this->SetLineWidth($tbd['w']/3);
21671
+ $this->SetDColor($tbcol);
21672
+ $this->_out(sprintf('%.3F %.3F m %.3F %.3F l S', ($x0 + $w - ($border_right/2))*_MPDFK, ($this->h-($y0 + $h - ($border_right/2)))*_MPDFK, ($x0 + $w - ($border_right/2))*_MPDFK, ($this->h-($y0 + ($border_right/2)) )*_MPDFK));
21673
+ }
21674
+ }
21675
+ }
21676
 
21677
  $this->SetDash();
21678
  $this->y = $save_y;
21687
  $bgy0 = $y0;
21688
  $bgy1 = $y1;
21689
 
21690
+ /*-- BORDER-RADIUS --*/
21691
  // Defined br values represent the radius of the outer curve - need to take border-width/2 from each radius for drawing the borders
21692
  if (isset($this->blk[$blvl]['background_clip']) && $this->blk[$blvl]['background_clip'] == 'padding-box') {
21693
  $brbgTL_H = max(0, $brTL_H - $this->blk[$blvl]['border_left']['w']);
21707
  $bgy1 -= $this->blk[$blvl]['border_bottom']['w'];
21708
  }
21709
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21710
  else {
21711
+ /*-- END BORDER-RADIUS --*/
21712
  $brbgTL_H = $brTL_H;
21713
  $brbgTL_V = $brTL_V;
21714
  $brbgTR_H = $brTR_H;
21717
  $brbgBL_V = $brBL_V;
21718
  $brbgBR_H = $brBR_H;
21719
  $brbgBR_V = $brBR_V;
21720
+ /*-- BORDER-RADIUS --*/
21721
  }
21722
+ /*-- END BORDER-RADIUS --*/
21723
 
21724
  // Set clipping path
21725
  $s = ' q 0 w '; // Line width=0
22066
  $this->pageBackgrounds[$blvl][] = array('gradient'=>true, 'x'=>$gx, 'y'=>$gy, 'w'=>$w, 'h'=>$h, 'gradtype'=>$g['type'], 'stops'=>$g['stops'], 'colorspace'=>$g['colorspace'], 'coords'=>$g['coords'], 'extend'=>$g['extend'], 'clippath'=>$s, 'visibility'=>$this->visibility, 'z-index'=>$this->current_layer); // mPDF 5.6.01
22067
  }
22068
  }
22069
+
22070
  if (isset($this->blk[$blvl]['background-image'])) {
22071
  if ($this->blk[$blvl]['background-image']['gradient'] && preg_match('/(-moz-)*(repeating-)*(linear|radial)-gradient/', $this->blk[$blvl]['background-image']['gradient'] )) {
22072
  $g = $this->grad->parseMozGradient( $this->blk[$blvl]['background-image']['gradient'] );
22073
  if ($g) {
22074
  $gx = $x0;
22075
+ $gy = $y0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22076
  $this->pageBackgrounds[$blvl][] = array('gradient'=>true, 'x'=>$gx, 'y'=>$gy, 'w'=>$w, 'h'=>$h, 'gradtype'=>$g['type'], 'stops'=>$g['stops'], 'colorspace'=>$g['colorspace'], 'coords'=>$g['coords'], 'extend'=>$g['extend'], 'clippath'=>$s, 'visibility'=>$this->visibility, 'z-index'=>$this->current_layer); // mPDF 5.6.01
22077
  }
22078
  }
22087
  $resize = $this->blk[$blvl]['background-image']['resize'];
22088
  $opacity = $this->blk[$blvl]['background-image']['opacity'];
22089
  $itype = $this->blk[$blvl]['background-image']['itype'];
22090
+ $this->pageBackgrounds[$blvl][] = array('x'=>$x0, 'y'=>$y0, 'w'=>$w, 'h'=>$h, 'image_id'=>$image_id, 'orig_w'=>$orig_w, 'orig_h'=>$orig_h, 'x_pos'=>$x_pos, 'y_pos'=>$y_pos, 'x_repeat'=>$x_repeat, 'y_repeat'=>$y_repeat, 'clippath'=>$s, 'resize'=>$resize, 'opacity'=>$opacity, 'itype'=>$itype, 'visibility'=>$this->visibility, 'z-index'=>$this->current_layer); // mPDF 5.6.01
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22091
  }
22092
  }
22093
  /*-- END BACKGROUNDS --*/
22162
 
22163
  function PaintDivLnBorder($state=0,$blvl=0,$h) {
22164
  // $state = 0 normal; 1 top; 2 bottom; 3 top and bottom
22165
+
22166
  $this->ColDetails[$this->CurrCol]['bottom_margin'] = $this->y + $h;
22167
 
22168
  $save_y = $this->y;
22178
  if (isset($tbd['s']) && $tbd['s']) {
22179
  $this->_setBorderLine($tbd);
22180
  $this->y = $y0 + ($tbd['w']/2);
22181
+ if ($tbd['style']=='dotted' || $tbd['style']=='dashed') { $this->_setDashBorder($tbd['style'],'',$continuingpage,'T'); }
22182
+ $this->Line($x0 + ($tbd['w']/2) , $this->y , $x0 + $w - ($tbd['w']/2), $this->y);
 
 
 
 
 
 
 
 
22183
  $this->y += $tbd['w'];
22184
  // Reset Corners and Dash off
22185
  $this->SetLineJoin(2);
22191
  $tbd = $this->blk[$blvl]['border_left'];
22192
  if (isset($tbd['s']) && $tbd['s']) {
22193
  $this->_setBorderLine($tbd);
22194
+ $this->y = $y0 + ($tbd['w']/2);
22195
+ if ($tbd['style']=='dotted' || $tbd['style']=='dashed') { $this->_setDashBorder($tbd['style'],'',$continuingpage,'L'); }
22196
+ $this->Line($x0 + ($tbd['w']/2), $this->y, $x0 + ($tbd['w']/2), $y0 + $h -($tbd['w']/2));
 
 
 
 
 
 
 
 
 
22197
  $this->y += $tbd['w'];
22198
  // Reset Corners and Dash off
22199
  $this->SetLineJoin(2);
22205
  $tbd = $this->blk[$blvl]['border_right'];
22206
  if (isset($tbd['s']) && $tbd['s']) {
22207
  $this->_setBorderLine($tbd);
22208
+ $this->y = $y0 + ($tbd['w']/2);
22209
+ if ($tbd['style']=='dotted' || $tbd['style']=='dashed') { $this->_setDashBorder($tbd['style'],'',$continuingpage,'R'); }
22210
+ $this->Line($x0 + $w - ($tbd['w']/2), $this->y, $x0 + $w - ($tbd['w']/2), $y0 + $h - ($tbd['w']/2));
 
 
 
 
 
 
 
 
 
22211
  $this->y += $tbd['w'];
22212
  // Reset Corners and Dash off
22213
  $this->SetLineJoin(2);
22220
  if (isset($tbd['s']) && $tbd['s']) {
22221
  $this->_setBorderLine($tbd);
22222
  $this->y = $y0 + $h - ($tbd['w']/2);
22223
+ if ($tbd['style']=='dotted' || $tbd['style']=='dashed') { $this->_setDashBorder($tbd['style'],'',$continuingpage,'B'); }
22224
+ $this->Line($x0 + ($tbd['w']/2) , $this->y, $x0 + $w - ($tbd['w']/2), $this->y);
 
 
 
 
 
 
 
 
22225
  $this->y += $tbd['w'];
22226
  // Reset Corners and Dash off
22227
  $this->SetLineJoin(2);
22316
  $this->ResetStyles();
22317
 
22318
  $this->HREF = '';
22319
+ $this->outlineparam = array();
22320
+ $this->outline_on = false;
22321
+ $this->SetTextOutline(false);
22322
 
22323
  $this->SUP = false;
22324
  $this->SUB = false;
22366
  $this->oldy = -1;
22367
 
22368
  $bodystyle = array();
22369
+ if (isset($this->CSS['BODY']['FONT-STYLE'])) { $bodystyle['FONT-STYLE'] = $this->CSS['BODY']['FONT-STYLE']; }
22370
+ if (isset($this->CSS['BODY']['FONT-WEIGHT'])) { $bodystyle['FONT-WEIGHT'] = $this->CSS['BODY']['FONT-WEIGHT']; }
22371
+ if (isset($this->CSS['BODY']['COLOR'])) { $bodystyle['COLOR'] = $this->CSS['BODY']['COLOR']; }
22372
  if (isset($bodystyle)) { $this->setCSS($bodystyle,'BLOCK','BODY'); }
22373
 
22374
  }
22407
  }
22408
  }
22409
  }
22410
+ /*-- END HTML-CSS --*/
22411
+
22412
+ //////////////////
22413
+ /// CSS parser ///
22414
+ //////////////////
22415
+ //////////////////
22416
+ /// CSS parser ///
22417
+ //////////////////
22418
+ //////////////////
22419
+ /// CSS parser ///
22420
+ //////////////////
22421
+
22422
+ /*-- HTML-CSS --*/
22423
+ function ReadDefaultCSS($CSSstr) {
22424
+ $CSS = array();
22425
+ $CSSstr = preg_replace('|/\*.*?\*/|s',' ',$CSSstr);
22426
+ $CSSstr = preg_replace('/[\s\n\r\t\f]/s',' ',$CSSstr);
22427
+ $CSSstr = preg_replace('/(<\!\-\-|\-\->)/s',' ',$CSSstr);
22428
+ if ($CSSstr ) {
22429
+ preg_match_all('/(.*?)\{(.*?)\}/',$CSSstr,$styles);
22430
+ for($i=0; $i < count($styles[1]) ; $i++) {
22431
+ $stylestr= trim($styles[2][$i]);
22432
+ $stylearr = explode(';',$stylestr);
22433
+ foreach($stylearr AS $sta) {
22434
+ if (trim($sta)) {
22435
+ // Changed to allow style="background: url('http://www.bpm1.com/bg.jpg')"
22436
+ list($property,$value) = explode(':',$sta,2);
22437
+ $property = trim($property);
22438
+ $value = preg_replace('/\s*!important/i','',$value);
22439
+ $value = trim($value);
22440
+ if ($property && ($value || $value==='0')) {
22441
+ $classproperties[strtoupper($property)] = $value;
22442
+ }
22443
+ }
22444
+ }
22445
+ $classproperties = $this->fixCSS($classproperties);
22446
+ $tagstr = strtoupper(trim($styles[1][$i]));
22447
+ $tagarr = explode(',',$tagstr);
22448
+ foreach($tagarr AS $tg) {
22449
+ $tags = preg_split('/\s+/',trim($tg));
22450
+ $level = count($tags);
22451
+ if ($level == 1) { // e.g. p or .class or #id or p.class or p#id
22452
+ $t = trim($tags[0]);
22453
+ if ($t) {
22454
+ $tag = '';
22455
+ if (preg_match('/^('.$this->allowedCSStags.')$/',$t)) { $tag= $t; }
22456
+ if ($this->CSS[$tag] && $tag) { $CSS[$tag] = $this->array_merge_recursive_unique($CSS[$tag], $classproperties); }
22457
+ else if ($tag) { $CSS[$tag] = $classproperties; }
22458
+ }
22459
+ }
22460
+ }
22461
+ $properties = array();
22462
+ $values = array();
22463
+ $classproperties = array();
22464
+ }
22465
+
22466
+ } // end of if
22467
+ return $CSS;
22468
+ }
22469
+
22470
+
22471
+
22472
+
22473
+ function ReadCSS($html) {
22474
+ preg_match_all('/<style[^>]*media=["\']([^"\'>]*)["\'].*?<\/style>/is',$html,$m);
22475
+ for($i=0; $i<count($m[0]); $i++) {
22476
+ if ($this->CSSselectMedia && !preg_match('/('.trim($this->CSSselectMedia).'|all)/i',$m[1][$i])) {
22477
+ $html = preg_replace('/'.preg_quote($m[0][$i],'/').'/','',$html);
22478
+ }
22479
+ }
22480
+ preg_match_all('/<link[^>]*media=["\']([^"\'>]*)["\'].*?>/is',$html,$m);
22481
+ for($i=0; $i<count($m[0]); $i++) {
22482
+ if ($this->CSSselectMedia && !preg_match('/('.trim($this->CSSselectMedia).'|all)/i',$m[1][$i])) {
22483
+ $html = preg_replace('/'.preg_quote($m[0][$i],'/').'/','',$html);
22484
+ }
22485
+ }
22486
+
22487
+ // mPDF 5.5.02
22488
+ // Remove Comment tags <!-- ... --> inside CSS as <style> in HTML document
22489
+ // Remove Comment tags /* ... */ inside CSS as <style> in HTML document
22490
+ // But first, we replace upper and mixed case closing style tag with lower
22491
+ // case so we can use str_replace later.
22492
+ preg_replace('/<\/style>/i', '</style>', $html);
22493
+ preg_match_all('/<style.*?>(.*?)<\/style>/si',$html,$m);
22494
+ if (count($m[1])) {
22495
+ for($i=0;$i<count($m[1]);$i++) {
22496
+ // Remove comment tags
22497
+ $sub = preg_replace('/(<\!\-\-|\-\->)/s',' ',$m[1][$i]);
22498
+ $sub = '>'.preg_replace('|/\*.*?\*/|s',' ',$sub).'</style>';
22499
+ $html = str_replace('>'.$m[1][$i].'</style>', $sub, $html);
22500
+ }
22501
+ }
22502
+
22503
+
22504
+ $html = preg_replace('/<!--mpdf/i','',$html);
22505
+ $html = preg_replace('/mpdf-->/i','',$html);
22506
+ $html = preg_replace('/<\!\-\-.*?\-\->/s',' ',$html);
22507
+
22508
+ $match = 0; // no match for instance
22509
+ $regexp = ''; // This helps debugging: showing what is the REAL string being processed
22510
+ $CSSext = array();
22511
+
22512
+ //CSS inside external files
22513
+ $regexp = '/<link[^>]*rel=["\']stylesheet["\'][^>]*href=["\']([^>"\']*)["\'].*?>/si';
22514
+ $x = preg_match_all($regexp,$html,$cxt);
22515
+ if ($x) {
22516
+ $match += $x;
22517
+ $CSSext = $cxt[1];
22518
+ }
22519
+
22520
+ $regexp = '/<link[^>]*href=["\']([^>"\']*)["\'][^>]*?rel=["\']stylesheet["\'].*?>/si';
22521
+ $x = preg_match_all($regexp,$html,$cxt);
22522
+ if ($x) {
22523
+ $match += $x;
22524
+ $CSSext = array_merge($CSSext,$cxt[1]);
22525
+ }
22526
+
22527
+ // look for @import stylesheets
22528
+ //$regexp = '/@import url\([\'\"]{0,1}([^\)]*?\.css)[\'\"]{0,1}\)/si';
22529
+ $regexp = '/@import url\([\'\"]{0,1}([^\)]*?\.css(\?\S+)?)[\'\"]{0,1}\)/si';
22530
+ $x = preg_match_all($regexp,$html,$cxt);
22531
+ if ($x) {
22532
+ $match += $x;
22533
+ $CSSext = array_merge($CSSext,$cxt[1]);
22534
+ }
22535
+
22536
+ // look for @import without the url()
22537
+ //$regexp = '/@import [\'\"]{0,1}([^;]*?\.css)[\'\"]{0,1}/si';
22538
+ $regexp = '/@import [\'\"]{0,1}([^;]*?\.css(\?\S+)?)[\'\"]{0,1}/si';
22539
+ $x = preg_match_all($regexp,$html,$cxt);
22540
+ if ($x) {
22541
+ $match += $x;
22542
+ $CSSext = array_merge($CSSext,$cxt[1]);
22543
+ }
22544
+
22545
+ $ind = 0;
22546
+ $CSSstr = '';
22547
+
22548
+ if (!is_array($this->cascadeCSS)) $this->cascadeCSS = array();
22549
+
22550
+ while($match){
22551
+ $path = $CSSext[$ind];
22552
+ $this->GetFullPath($path);
22553
+ $CSSextblock = $this->_get_file($path);
22554
+ if ($CSSextblock) {
22555
+ // look for embedded @import stylesheets in other stylesheets
22556
+ // and fix url paths (including background-images) relative to stylesheet
22557
+ //$regexpem = '/@import url\([\'\"]{0,1}(.*?\.css)[\'\"]{0,1}\)/si';
22558
+ $regexpem = '/@import url\([\'\"]{0,1}(.*?\.css(\?\S+)?)[\'\"]{0,1}\)/si';
22559
+ $xem = preg_match_all($regexpem,$CSSextblock,$cxtem);
22560
+ $cssBasePath = preg_replace('/\/[^\/]*$/','',$path) . '/';
22561
+ if ($xem) {
22562
+ foreach($cxtem[1] AS $cxtembedded) {
22563
+ // path is relative to original stlyesheet!!
22564
+ $this->GetFullPath($cxtembedded, $cssBasePath );
22565
+ $match++;
22566
+ $CSSext[] = $cxtembedded;
22567
+ }
22568
+ }
22569
+ $regexpem = '/(background[^;]*url\s*\(\s*[\'\"]{0,1})([^\)\'\"]*)([\'\"]{0,1}\s*\))/si';
22570
+ $xem = preg_match_all($regexpem,$CSSextblock,$cxtem);
22571
+ if ($xem) {
22572
+ for ($i=0;$i<count($cxtem[0]);$i++) {
22573
+ // path is relative to original stlyesheet!!
22574
+ $embedded = $cxtem[2][$i];
22575
+ if (!preg_match('/^data:image/i', $embedded)) { // mPDF 5.5.13
22576
+ $this->GetFullPath($embedded, $cssBasePath );
22577
+ $CSSextblock = preg_replace('/'.preg_quote($cxtem[0][$i],'/').'/', ($cxtem[1][$i].$embedded.$cxtem[3][$i]), $CSSextblock);
22578
+ }
22579
+ }
22580
+ }
22581
+ $CSSstr .= ' '.$CSSextblock;
22582
+ }
22583
+ $match--;
22584
+ $ind++;
22585
+ } //end of match
22586
+
22587
+ $match = 0; // reset value, if needed
22588
+ // CSS as <style> in HTML document
22589
+ $regexp = '/<style.*?>(.*?)<\/style>/si';
22590
+ $match = preg_match_all($regexp,$html,$CSSblock);
22591
+ if ($match) {
22592
+ $tmpCSSstr = implode(' ',$CSSblock[1]);
22593
+ $regexpem = '/(background[^;]*url\s*\(\s*[\'\"]{0,1})([^\)\'\"]*)([\'\"]{0,1}\s*\))/si';
22594
+ $xem = preg_match_a