Version Description
- Feature - Add support for Gravity Forms 2.0 Rich Text Editor field
- Feature - Hide Gravity PDF major upgrade prompts when compatibility checks fail
Download this release
Release Info
Developer | Blue Liquid Designs |
Plugin | Gravity PDF |
Version | 3.7.8 |
Comparing to | |
See all releases |
Code changes from version 3.7.7 to 3.7.8
- README.txt +525 -521
- depreciated.php +42 -42
- helper/data.php +124 -124
- helper/installation-update-manager.php +675 -675
- helper/notices.php +395 -395
- helper/pdf-common.php +319 -319
- helper/pdf-configuration-indexer.php +440 -440
- helper/pdf-entry-detail.php +2053 -2037
- helper/pdf-render.php +320 -320
- initialisation/configuration.php.example +395 -395
- initialisation/template.css +131 -131
- initialisation/templates/default-template-no-style.php +46 -46
- initialisation/templates/default-template-two-rows.php +46 -46
- initialisation/templates/default-template.php +44 -44
- initialisation/templates/example-advanced-headers_07.php +109 -109
- initialisation/templates/example-backgrounds-and-borders02.php +163 -163
- initialisation/templates/example-basic-html01.php +156 -156
- initialisation/templates/example-different-page-size_08.php +81 -81
- initialisation/templates/example-float-and-positioning05.php +156 -156
- initialisation/templates/example-header-and-footer_06.php +108 -108
- initialisation/templates/example-images03.php +239 -239
- initialisation/templates/example-tables04.php +1731 -1731
- initialisation/templates/example-template.php +94 -94
- initialisation/templates/example-watermark09.php +135 -135
- languages/pdfextended-en_GB.po +856 -856
- languages/pdfextended-fr_FR.po +1024 -1024
- mPDF/CHANGELOG.txt +25 -25
- mPDF/CREDITS.txt +92 -92
- mPDF/FONT INFO.txt +164 -164
- mPDF/LICENSE.txt +340 -340
- mPDF/README.txt +5 -5
- mPDF/classes/barcode.php +1965 -1965
- mPDF/classes/bmp.php +246 -246
- mPDF/classes/cssmgr.php +0 -568
README.txt
CHANGED
@@ -1,521 +1,525 @@
|
|
1 |
-
=== Plugin Name ===
|
2 |
-
Contributors: blueliquiddesigns
|
3 |
-
Donate link: https://gravitypdf.com
|
4 |
-
Tags: gravity, forms, pdf, automation, attachment
|
5 |
-
Requires at least: 3.9
|
6 |
-
Tested up to: 4.5
|
7 |
-
Stable tag: 3.7.
|
8 |
-
License: GPLv2 or later
|
9 |
-
License URI: http://www.gnu.org/licenses/gpl.txt
|
10 |
-
|
11 |
-
Automatically generate, email and download PDF documents with Gravity Forms and Gravity PDF.
|
12 |
-
|
13 |
-
== Description ==
|
14 |
-
|
15 |
-
|
16 |
-
If you have ever used Gravity Forms you’ll know just how powerful it is to build forms and capture information with WordPress. But what it lacks is an easy way to display that information as a document. That’s where our plugin comes into the picture. The software allows you to generate a PDF document, that includes data captured through Gravity Forms, by using HTML/CSS templates. Use the tools you know and love to easily create PDFs.
|
17 |
-
|
18 |
-
Note: The software is a [developer toolkit](https://developer.gravitypdf.com/) with limited UX controls. To create custom PDF templates you need to be familiar with PHP, HTML and CSS. [Alternativly we offer development services](https://gravitypdf.com/) and can create and install the PDF templates for you.
|
19 |
-
|
20 |
-
**Benefits**
|
21 |
-
|
22 |
-
* Save Hours in Data Entry - You’ll never have to fill out documents by hand. The software automates the entire process for you.
|
23 |
-
* Completely Digitise Your Paperwork - Go completely paperless, saving on printing costs, reduce waste and help the environment at the same time.
|
24 |
-
* Never Lose a Document - As long as the original entry is available you will have access to the entry’s PDFs from your website.
|
25 |
-
* Better Client Management - Your clients can complete one form and have multiple documents automatically generated, which means you’ll never forget to complete a document.
|
26 |
-
* Password Protected Documents - Worried about security? You can easily password protect the PDFs with a 128-bit encryption and even let the user select a password when filling out a form.
|
27 |
-
* Automatic Email PDFs - Automatically email the PDF when a user completes the form. Have it emailed to people in your organisation, the user, or both.
|
28 |
-
* Paywall Your Document - Using Gravity Forms payment add-ons – like PayPal, Authorize.net or Stripe – you can restrict access to the PDF until after the payment is verified.
|
29 |
-
* Conditional Content - Gravity Forms allows you to show fields based on conditions you define in your form, and so does our software. You can even have completely different PDFs generated based on the user responses.
|
30 |
-
|
31 |
-
**PDF Features**
|
32 |
-
|
33 |
-
The PDF software includes powerful feature that allow you to control the look and feel of your document. It includes:
|
34 |
-
|
35 |
-
* Language Support - almost all languages are supported including RTL (right to left) languages like Arabic, Hebrew and CJK languages - Chinese, Japanese and Korean.
|
36 |
-
* HTML Page Numbering
|
37 |
-
* Odd and even paging with mirrored margins (most commonly used in printing).
|
38 |
-
* Nested Tables
|
39 |
-
* Text-justification and hyphenation
|
40 |
-
* Table of Contents
|
41 |
-
* Index
|
42 |
-
* Bookmarks
|
43 |
-
* Watermarks
|
44 |
-
* Password protection
|
45 |
-
* UTF-8 encoded HTML
|
46 |
-
|
47 |
-
**Demos**
|
48 |
-
|
49 |
-
We put together five demos showcasing how powerful the PDF software can be. [Take a look](https://gravitypdf.com/#GFdemo).
|
50 |
-
|
51 |
-
**Server Requirements**
|
52 |
-
|
53 |
-
1. PHP 5.2+ (5.4+ recommended)
|
54 |
-
2. MB String with Regex enabled (--enable-mbregex)
|
55 |
-
3. GD Library
|
56 |
-
4. RAM: Recommended: 128MB. Minimum: 64MB.
|
57 |
-
|
58 |
-
**Software Requirements**
|
59 |
-
|
60 |
-
1. [Purchase and install Gravity Forms](https://www.e-junkie.com/ecom/gb.php?cl=54585&c=ib&aff=235154)
|
61 |
-
2. Wordpress 3.9+
|
62 |
-
3. Gravity Forms 1.8+
|
63 |
-
|
64 |
-
**Documentation and Support**
|
65 |
-
|
66 |
-
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).
|
67 |
-
|
68 |
-
== Installation ==
|
69 |
-
|
70 |
-
1. Upload this plugin to your website and activate it
|
71 |
-
2. Head to Forms -> Settings -> PDF to initialise the plugin.
|
72 |
-
3. Create a form in Gravity Forms and configure notifications
|
73 |
-
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/)
|
74 |
-
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.
|
75 |
-
|
76 |
-
|
77 |
-
== Frequently Asked Questions ==
|
78 |
-
|
79 |
-
All FAQs can be [viewed on the Gravity PDF website](https://gravitypdf.com/#faqs).
|
80 |
-
|
81 |
-
== Screenshots ==
|
82 |
-
|
83 |
-
1. The View PDF button is avaliable for each Gravity Form entry
|
84 |
-
2. Multiple PDFs can be assigned to a form and is also avaliable on the detailed entry view.
|
85 |
-
3. The configuration.php file allows you to easily assign PDFs to Gravity Forms
|
86 |
-
|
87 |
-
== Changelog ==
|
88 |
-
|
89 |
-
= 3.7.
|
90 |
-
*
|
91 |
-
*
|
92 |
-
|
93 |
-
= 3.7.
|
94 |
-
* Bug -
|
95 |
-
*
|
96 |
-
|
97 |
-
= 3.7.
|
98 |
-
*
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
*
|
112 |
-
|
113 |
-
|
114 |
-
*
|
115 |
-
|
116 |
-
|
117 |
-
*
|
118 |
-
*
|
119 |
-
|
120 |
-
|
121 |
-
*
|
122 |
-
*
|
123 |
-
* Housekeeping -
|
124 |
-
* Housekeeping -
|
125 |
-
* Housekeeping -
|
126 |
-
* Housekeeping -
|
127 |
-
*
|
128 |
-
*
|
129 |
-
*
|
130 |
-
*
|
131 |
-
* Bug -
|
132 |
-
* Bug - Fix
|
133 |
-
* Bug - Fix
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
*
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
* Feature -
|
142 |
-
*
|
143 |
-
*
|
144 |
-
*
|
145 |
-
*
|
146 |
-
* Housekeeping -
|
147 |
-
* Housekeeping -
|
148 |
-
* Housekeeping -
|
149 |
-
*
|
150 |
-
*
|
151 |
-
*
|
152 |
-
*
|
153 |
-
* Bug -
|
154 |
-
* Bug - Fixed
|
155 |
-
* Bug - Fixed
|
156 |
-
* Bug -
|
157 |
-
* Bug -
|
158 |
-
* Bug - Fixed
|
159 |
-
|
160 |
-
|
161 |
-
* Bug -
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
* Bug - Fix
|
169 |
-
|
170 |
-
= 3.5.
|
171 |
-
*
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
* Bug - Fixed
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
*
|
187 |
-
*
|
188 |
-
|
189 |
-
|
190 |
-
*
|
191 |
-
*
|
192 |
-
|
193 |
-
|
194 |
-
* Bug - Fixed
|
195 |
-
* Bug -
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
* Bug -
|
200 |
-
*
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
*
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
* Bug -
|
210 |
-
|
211 |
-
|
212 |
-
*
|
213 |
-
|
214 |
-
|
215 |
-
*
|
216 |
-
*
|
217 |
-
|
218 |
-
|
219 |
-
* Feature -
|
220 |
-
|
221 |
-
*
|
222 |
-
*
|
223 |
-
*
|
224 |
-
|
225 |
-
* Housekeeping -
|
226 |
-
* Housekeeping -
|
227 |
-
* Housekeeping -
|
228 |
-
* Housekeeping -
|
229 |
-
* Housekeeping -
|
230 |
-
|
231 |
-
*
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
* Bug -
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
*
|
246 |
-
*
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
*
|
251 |
-
*
|
252 |
-
|
253 |
-
|
254 |
-
* Feature -
|
255 |
-
* Feature -
|
256 |
-
* Feature -
|
257 |
-
* Feature - Added
|
258 |
-
* Feature -
|
259 |
-
* Feature -
|
260 |
-
* Feature -
|
261 |
-
* Feature - Added
|
262 |
-
* Feature -
|
263 |
-
* Feature - Added
|
264 |
-
* Feature - Added
|
265 |
-
* Feature - Added
|
266 |
-
* Feature -
|
267 |
-
* Feature - Added
|
268 |
-
* Feature - Added
|
269 |
-
* Feature - Added
|
270 |
-
* Feature
|
271 |
-
|
272 |
-
*
|
273 |
-
*
|
274 |
-
*
|
275 |
-
|
276 |
-
* Housekeeping -
|
277 |
-
* Housekeeping -
|
278 |
-
* Housekeeping -
|
279 |
-
* Housekeeping -
|
280 |
-
* Housekeeping -
|
281 |
-
* Housekeeping -
|
282 |
-
* Housekeeping -
|
283 |
-
* Housekeeping -
|
284 |
-
* Housekeeping -
|
285 |
-
* Housekeeping -
|
286 |
-
* Housekeeping -
|
287 |
-
* Housekeeping -
|
288 |
-
* Housekeeping -
|
289 |
-
* Housekeeping -
|
290 |
-
* Housekeeping -
|
291 |
-
* Housekeeping -
|
292 |
-
* Housekeeping -
|
293 |
-
* Housekeeping -
|
294 |
-
|
295 |
-
*
|
296 |
-
*
|
297 |
-
*
|
298 |
-
|
299 |
-
* Bug - Fixed
|
300 |
-
* Bug - Fixed
|
301 |
-
* Bug - Fixed
|
302 |
-
* Bug - Fixed
|
303 |
-
* Bug -
|
304 |
-
* Bug - Fixed
|
305 |
-
* Bug - Fixed
|
306 |
-
* Bug - Fixed
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
* Bug - Fixed
|
311 |
-
|
312 |
-
|
313 |
-
= 3.3.
|
314 |
-
* Bug -
|
315 |
-
*
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
* Bug -
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
*
|
324 |
-
|
325 |
-
= 3.3.
|
326 |
-
* Bug -
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
*
|
331 |
-
|
332 |
-
|
333 |
-
* Feature -
|
334 |
-
* Feature -
|
335 |
-
* Feature - Added
|
336 |
-
*
|
337 |
-
*
|
338 |
-
*
|
339 |
-
*
|
340 |
-
*
|
341 |
-
*
|
342 |
-
*
|
343 |
-
*
|
344 |
-
* Housekeeping -
|
345 |
-
* Housekeeping -
|
346 |
-
* Housekeeping - Updated
|
347 |
-
|
348 |
-
|
349 |
-
*
|
350 |
-
*
|
351 |
-
|
352 |
-
|
353 |
-
*
|
354 |
-
*
|
355 |
-
* Bug -
|
356 |
-
* Bug - Fixed
|
357 |
-
*
|
358 |
-
|
359 |
-
|
360 |
-
* Bug - Fixed
|
361 |
-
*
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
*
|
367 |
-
* Extension - Added
|
368 |
-
|
369 |
-
|
370 |
-
*
|
371 |
-
*
|
372 |
-
* Bug - Fixed
|
373 |
-
|
374 |
-
|
375 |
-
*
|
376 |
-
* Bug - Fixed initialisation prompt issue when
|
377 |
-
|
378 |
-
|
379 |
-
*
|
380 |
-
|
381 |
-
|
382 |
-
* Bug -
|
383 |
-
* Bug -
|
384 |
-
|
385 |
-
= 3.1.
|
386 |
-
*
|
387 |
-
*
|
388 |
-
|
389 |
-
|
390 |
-
*
|
391 |
-
*
|
392 |
-
*
|
393 |
-
*
|
394 |
-
* Compatability -
|
395 |
-
*
|
396 |
-
*
|
397 |
-
*
|
398 |
-
*
|
399 |
-
* Bug -
|
400 |
-
|
401 |
-
|
402 |
-
*
|
403 |
-
*
|
404 |
-
|
405 |
-
= 3.0.
|
406 |
-
*
|
407 |
-
* Bug -
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
*
|
420 |
-
*
|
421 |
-
*
|
422 |
-
*
|
423 |
-
*
|
424 |
-
*
|
425 |
-
*
|
426 |
-
*
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
*
|
444 |
-
|
445 |
-
= 2.2.
|
446 |
-
*
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
*
|
451 |
-
|
452 |
-
|
453 |
-
*
|
454 |
-
|
455 |
-
|
456 |
-
* Bug -
|
457 |
-
* Bug -
|
458 |
-
|
459 |
-
= 2.1.
|
460 |
-
|
461 |
-
*
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
*
|
466 |
-
*
|
467 |
-
*
|
468 |
-
*
|
469 |
-
*
|
470 |
-
*
|
471 |
-
* Bug -
|
472 |
-
* Bug -
|
473 |
-
* Bug -
|
474 |
-
*
|
475 |
-
*
|
476 |
-
*
|
477 |
-
*
|
478 |
-
|
479 |
-
|
480 |
-
*
|
481 |
-
*
|
482 |
-
|
483 |
-
= 2.0.
|
484 |
-
*
|
485 |
-
*
|
486 |
-
|
487 |
-
|
488 |
-
*
|
489 |
-
*
|
490 |
-
*
|
491 |
-
*
|
492 |
-
|
493 |
-
|
494 |
-
*
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
* Fixed
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
* Fixed
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
*
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
*
|
511 |
-
*
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
*
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
|
|
|
|
|
|
|
1 |
+
=== Plugin Name ===
|
2 |
+
Contributors: blueliquiddesigns
|
3 |
+
Donate link: https://gravitypdf.com
|
4 |
+
Tags: gravity, forms, pdf, automation, attachment
|
5 |
+
Requires at least: 3.9
|
6 |
+
Tested up to: 4.5
|
7 |
+
Stable tag: 3.7.8
|
8 |
+
License: GPLv2 or later
|
9 |
+
License URI: http://www.gnu.org/licenses/gpl.txt
|
10 |
+
|
11 |
+
Automatically generate, email and download PDF documents with Gravity Forms and Gravity PDF.
|
12 |
+
|
13 |
+
== Description ==
|
14 |
+
|
15 |
+
|
16 |
+
If you have ever used Gravity Forms you’ll know just how powerful it is to build forms and capture information with WordPress. But what it lacks is an easy way to display that information as a document. That’s where our plugin comes into the picture. The software allows you to generate a PDF document, that includes data captured through Gravity Forms, by using HTML/CSS templates. Use the tools you know and love to easily create PDFs.
|
17 |
+
|
18 |
+
Note: The software is a [developer toolkit](https://developer.gravitypdf.com/) with limited UX controls. To create custom PDF templates you need to be familiar with PHP, HTML and CSS. [Alternativly we offer development services](https://gravitypdf.com/) and can create and install the PDF templates for you.
|
19 |
+
|
20 |
+
**Benefits**
|
21 |
+
|
22 |
+
* Save Hours in Data Entry - You’ll never have to fill out documents by hand. The software automates the entire process for you.
|
23 |
+
* Completely Digitise Your Paperwork - Go completely paperless, saving on printing costs, reduce waste and help the environment at the same time.
|
24 |
+
* Never Lose a Document - As long as the original entry is available you will have access to the entry’s PDFs from your website.
|
25 |
+
* Better Client Management - Your clients can complete one form and have multiple documents automatically generated, which means you’ll never forget to complete a document.
|
26 |
+
* Password Protected Documents - Worried about security? You can easily password protect the PDFs with a 128-bit encryption and even let the user select a password when filling out a form.
|
27 |
+
* Automatic Email PDFs - Automatically email the PDF when a user completes the form. Have it emailed to people in your organisation, the user, or both.
|
28 |
+
* Paywall Your Document - Using Gravity Forms payment add-ons – like PayPal, Authorize.net or Stripe – you can restrict access to the PDF until after the payment is verified.
|
29 |
+
* Conditional Content - Gravity Forms allows you to show fields based on conditions you define in your form, and so does our software. You can even have completely different PDFs generated based on the user responses.
|
30 |
+
|
31 |
+
**PDF Features**
|
32 |
+
|
33 |
+
The PDF software includes powerful feature that allow you to control the look and feel of your document. It includes:
|
34 |
+
|
35 |
+
* Language Support - almost all languages are supported including RTL (right to left) languages like Arabic, Hebrew and CJK languages - Chinese, Japanese and Korean.
|
36 |
+
* HTML Page Numbering
|
37 |
+
* Odd and even paging with mirrored margins (most commonly used in printing).
|
38 |
+
* Nested Tables
|
39 |
+
* Text-justification and hyphenation
|
40 |
+
* Table of Contents
|
41 |
+
* Index
|
42 |
+
* Bookmarks
|
43 |
+
* Watermarks
|
44 |
+
* Password protection
|
45 |
+
* UTF-8 encoded HTML
|
46 |
+
|
47 |
+
**Demos**
|
48 |
+
|
49 |
+
We put together five demos showcasing how powerful the PDF software can be. [Take a look](https://gravitypdf.com/#GFdemo).
|
50 |
+
|
51 |
+
**Server Requirements**
|
52 |
+
|
53 |
+
1. PHP 5.2+ (5.4+ recommended)
|
54 |
+
2. MB String with Regex enabled (--enable-mbregex)
|
55 |
+
3. GD Library
|
56 |
+
4. RAM: Recommended: 128MB. Minimum: 64MB.
|
57 |
+
|
58 |
+
**Software Requirements**
|
59 |
+
|
60 |
+
1. [Purchase and install Gravity Forms](https://www.e-junkie.com/ecom/gb.php?cl=54585&c=ib&aff=235154)
|
61 |
+
2. Wordpress 3.9+
|
62 |
+
3. Gravity Forms 1.8+
|
63 |
+
|
64 |
+
**Documentation and Support**
|
65 |
+
|
66 |
+
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).
|
67 |
+
|
68 |
+
== Installation ==
|
69 |
+
|
70 |
+
1. Upload this plugin to your website and activate it
|
71 |
+
2. Head to Forms -> Settings -> PDF to initialise the plugin.
|
72 |
+
3. Create a form in Gravity Forms and configure notifications
|
73 |
+
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/)
|
74 |
+
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.
|
75 |
+
|
76 |
+
|
77 |
+
== Frequently Asked Questions ==
|
78 |
+
|
79 |
+
All FAQs can be [viewed on the Gravity PDF website](https://gravitypdf.com/#faqs).
|
80 |
+
|
81 |
+
== Screenshots ==
|
82 |
+
|
83 |
+
1. The View PDF button is avaliable for each Gravity Form entry
|
84 |
+
2. Multiple PDFs can be assigned to a form and is also avaliable on the detailed entry view.
|
85 |
+
3. The configuration.php file allows you to easily assign PDFs to Gravity Forms
|
86 |
+
|
87 |
+
== Changelog ==
|
88 |
+
|
89 |
+
= 3.7.8 =
|
90 |
+
* Feature - Add support for Gravity Forms 2.0 Rich Text Editor field
|
91 |
+
* Feature - Hide Gravity PDF major upgrade prompts when compatibility checks fail
|
92 |
+
|
93 |
+
= 3.7.7 =
|
94 |
+
* Bug - Ensure 'gfpdf_post_pdf_save' action gets triggered for all PDFs when resending notifications
|
95 |
+
* Housekeeping - Remove compress.php from mPDF package (unneeded)
|
96 |
+
|
97 |
+
= 3.7.6 =
|
98 |
+
* Bug - Added full support for all Gravity Forms notification events (includes Payment Complete, Payment Refund, Payment Failed, Payment Pending ect)
|
99 |
+
* Bug - Resolve mPDF PHP7 image parsing error due to a change in variable order parsing.
|
100 |
+
|
101 |
+
= 3.7.5 =
|
102 |
+
* Housekeeping - Tweak mPDF package to be PHP7 compatible.
|
103 |
+
|
104 |
+
= 3.7.4 =
|
105 |
+
* Housekeeping - Revert patch made in last update as Gravity Forms 1.9.9 fixes the issue internally.
|
106 |
+
|
107 |
+
= 3.7.3 =
|
108 |
+
* Bug - Gravity Forms 1.9 didn't automatically nl2br paragraph text mergetags. Fixed this issue in custom PDF templates.
|
109 |
+
|
110 |
+
= 3.7.2 =
|
111 |
+
* Bug - Updated $form_data['date_created'], $form_data['date_created_usa'], $form_data['misc']['date_time'], $form_data['misc']['time_24hr'] and $form_data['misc']['time_12hr'] to factor in the website's timezone settings.
|
112 |
+
|
113 |
+
= 3.7.1 =
|
114 |
+
* Housekeeping - Allow control over signature width in default template using the 'gfpdfe_signature_width' filter
|
115 |
+
* Housekeeping - Add better error checking when migrating PDF template folder
|
116 |
+
* Housekeeping - Add unit testing to the directory migration function
|
117 |
+
* Bug - Fixed backwards-compatiiblity PHP error when viewing custom PDF templates on Gravity Forms 1.8.3 or below.
|
118 |
+
* Bug - Ensure checkbox field names are included in the $form_data array
|
119 |
+
|
120 |
+
= 3.7.0 =
|
121 |
+
* Feature - Added 'default-show-section-content' configuration option. You can now display the section break content in the default template. Note: if this option is enabled and the section break is empty it will still be displayed on the PDF.
|
122 |
+
* Feature - Added hooks 'gfpdfe_template_location' and 'gfpdfe_template_location_uri' to change PDF template location
|
123 |
+
* Housekeeping - Migrate your template and configuration files. As of Gravity PDF 3.7 we'll be dropping the 'site_name' folder for single WordPress installs and changing the multisite install directory to the site ID.
|
124 |
+
* Housekeeping - Added $form_data['html_id'] key which has the HTML fields added by their ID (much like the signature_details_id key).
|
125 |
+
* Housekeeping - Add large number of unit tests
|
126 |
+
* Housekeeping - Derestrict certain pages software loads on.
|
127 |
+
* Housekeeping - Split up PDF viewing security components into smaller chunks (easier to unit test)
|
128 |
+
* Housekeeping - Remove CLI-checking override in RAM settings
|
129 |
+
* Housekeeping - Included directory paths by default on the system status page
|
130 |
+
* Housekeeping - Updated configuration.php examples to include new default config option and refined the copy
|
131 |
+
* Bug - Fixed issue initialising plugin when memory limit was set to -1 (unlimited)
|
132 |
+
* Bug - Fix Multisite migration problem where if an error was thrown for one of the sub sites it caused all of the sites to show an error (even if they were successful)
|
133 |
+
* Bug - Fix typo in example-template.php file
|
134 |
+
* Bug - Fix up notices in custom templates when using poll/survey/quiz add ons.
|
135 |
+
* Bug - Fix up notice in custom template when the form description is empty
|
136 |
+
* Bug - Fix up notices in mPDF template when using headers/footers
|
137 |
+
* Bug - Fix up error in PDF when signature field wasn't filled in
|
138 |
+
|
139 |
+
|
140 |
+
= 3.6.0 =
|
141 |
+
* Feature - Added support for Gravity Form's sub-field middle name (1.9Beta)
|
142 |
+
* Feature - Patch mPDF with full :nth-child support on TD and TR table cells
|
143 |
+
* Feature - Added $form_data[products_totals][subtotal] key (total price without shipping costs added)
|
144 |
+
* Feature - Added formated money to all product fields in the $form_data array
|
145 |
+
* Feature - Default templates: only show fields who's conditional logic is true. Perfect when used with default-show-html
|
146 |
+
* 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/)
|
147 |
+
* Housekeeping - Refined when admin resources are loaded
|
148 |
+
* Housekeeping - Fixed typo during initial initialisation
|
149 |
+
* Housekeeping - Switched icons back to FontAwesome which is shipped by default with Gravity Forms
|
150 |
+
* Housekeeping - Display full path to mPDF tmp directory when there are issues writing to it
|
151 |
+
* Housekeeping - Modified font installation message.
|
152 |
+
* Housekeeping - Update example-header-and-footer_06.php and example-advanced-headers_07.php to better reflect current mPDF features
|
153 |
+
* Bug - Fixed issue pulling the correct configuration when multiple nodes were assigned to multiple forms
|
154 |
+
* Bug - Fixed number field formatting issue which always rounded to two decimal places
|
155 |
+
* Bug - Fixed JS namespace issue with WordPress Leads plugin
|
156 |
+
* Bug - Fixed error initialising fonts / backing up PDF_EXTENDED_TEMPLATES directory when using the glob() function
|
157 |
+
* 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
|
158 |
+
* Bug - Fixed fatal error when logged in user attempts to view PDF they don't have access to
|
159 |
+
* Bug - Fixed issue in $form_data array where single-column list items where being returned as an array and not a HTML list.
|
160 |
+
* Bug - Prevent unauthorised users auto-initialising the software or migrating the templates folder
|
161 |
+
* Bug - Fixed up incorrect formatting issue when using custom font name
|
162 |
+
* Bug - Fixed issue displaying Times New Roman in PDF templates
|
163 |
+
|
164 |
+
= 3.5.11.1 =
|
165 |
+
* Bug - Fix issue saving and sending blank PDFs due to security fix
|
166 |
+
|
167 |
+
= 3.5.11 =
|
168 |
+
* Bug - Fix security issue which gave unauthorised users access to Gravity Form entires
|
169 |
+
|
170 |
+
= 3.5.10 =
|
171 |
+
* Housekeeping - Include individual scoring for Gravity Form Survey Likert field in the $form_data['survey'] array
|
172 |
+
* Bug - Fix fatal error when Gravity Forms isn't activated, but Gravity PDF is.
|
173 |
+
|
174 |
+
= 3.5.9 =
|
175 |
+
* 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.
|
176 |
+
|
177 |
+
= 3.5.8 =
|
178 |
+
* Bug - Fixed issue affected some users where a depreciated function was causing a fatal error
|
179 |
+
|
180 |
+
= 3.5.7 =
|
181 |
+
* Bug - Fixed issue where the PDF settings page was blank for some users
|
182 |
+
|
183 |
+
= 3.5.6 =
|
184 |
+
* Bug - Fixed issue with last release that affected checks to see if Gravity Forms has submitting
|
185 |
+
* Bug - Fixed fatal error with servers using PHP5.2 or lower
|
186 |
+
* Bug - Fixed E_NOTICE for replacement array_replace_recursive() function in PHP5.2 or lower
|
187 |
+
* Bug - Fixed issue with AJAX spinner showing when submitting support request
|
188 |
+
|
189 |
+
= 3.5.5 =
|
190 |
+
* Housekeeping - Include French translation (thanks to Marie-Aude Koiransky-Ballouk)
|
191 |
+
* Housekeeping - Wrap 'Initialise Fonts' text in translation ready _e() function
|
192 |
+
* Housekeeping - Tidy up System Status CSS styles to accomidate translation text lengths
|
193 |
+
* Housekeeping - Fix E_NOTICE when viewing entry details page when form has no PDF configuration
|
194 |
+
* Bug - Fixed load_plugin_textdomain which was incorrectly called.
|
195 |
+
* Bug - Correctly check if the plugin is loaded correctly before letting the PDF class fully load
|
196 |
+
|
197 |
+
= 3.5.4 =
|
198 |
+
* Bug - Fixed issue with incorrect PDF name showing on the entry details page
|
199 |
+
* Bug - Fixed issue with custom fonts being inaccessible without manually reinstalling after upgrading.
|
200 |
+
* 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).
|
201 |
+
|
202 |
+
= 3.5.3 =
|
203 |
+
* Bug - Mergetags braces ({}) were being encoded before conversion
|
204 |
+
* Bug - Fixed issue with empty string being passed to array filter
|
205 |
+
* Housekeeping - Enabled mergetag usage in the pdf_password and pdf_master_password configuration options
|
206 |
+
* Housekeeping - Correctly call $wpdb->prepare so the variables in are in the second argument
|
207 |
+
|
208 |
+
= 3.5.2 =
|
209 |
+
* Bug - Initialisation folder .htaccess file was preventing template.css from being loaded by the default templates.
|
210 |
+
|
211 |
+
= 3.5.1 =
|
212 |
+
* Bug - Fixed issue with core fonts Arial/Helvetica, Times/Times New Roman and Courier not displaying in the PDF.
|
213 |
+
* Bug - Fixed display issues for multiple PDFs on the details admin entry page
|
214 |
+
* Housekeeping - Made the details entry page PDF view consistent for single or multiple PDFs
|
215 |
+
* Housekeeping - Ensured all javascript files are minified and are correctly being used
|
216 |
+
* Housekeeping - Remove legacy notices from mPDF package
|
217 |
+
|
218 |
+
= 3.5.0 =
|
219 |
+
* Feature - No longer need to reinitialise every time the software is updated.
|
220 |
+
* Feature - Add auto-initialiser on initial installation for sites that have direct write access to their server files
|
221 |
+
* Feature - Add auto-initialiser on initial installation across entire multisite network for sites who have direct write access to their server files.
|
222 |
+
* Feature - Add auto-PDF_EXTENDED_TEMPLATES theme syncer for sites that have direct write access to their server files
|
223 |
+
* Feature - Correctly added language support. The .PO file is located in the /language/ folder if anyone would like to do a translation.
|
224 |
+
|
225 |
+
* Housekeeping - Restrict initialisation process to 64MB or greater to counter problems with users reporting a 'white screen' when running in a low-RAM environment.
|
226 |
+
* Housekeeping - Refractor the admin notices code
|
227 |
+
* Housekeeping - Create responsive PDF settings page
|
228 |
+
* Housekeeping - Minify CSS and Javascript files
|
229 |
+
* Housekeeping - Remove FontAwesome fonts from package and use Wordpress' build-in 'dashicons'
|
230 |
+
* Housekeeping - Refine action and error messages
|
231 |
+
* Housekeeping - Update initialisation tab copy for both pre- and post- initialisation
|
232 |
+
* Housekeeping - Use Gravity Forms get_ip() function instead of custom function
|
233 |
+
* Housekeeping - The in-built support form uses SSL once again (disabled in the past due to some servers being unable to verify the certificate).
|
234 |
+
|
235 |
+
* 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 '@'.
|
236 |
+
|
237 |
+
= 3.4.1 =
|
238 |
+
* Bug - Fix typo that effected sites running PHP5.2 or below.
|
239 |
+
|
240 |
+
= 3.4.0.3 =
|
241 |
+
* Bug - Define array_replace_recursive() if it doesn't exist, as it is PHP 5.3 only.
|
242 |
+
|
243 |
+
= 3.4.0.2 =
|
244 |
+
* Housekeeping - Wrapped the View PDF and Download buttons in correct language functions - _e()
|
245 |
+
* Bug - Fix problem displaying the signature field
|
246 |
+
* Bug - Fix notice errors with new 'save' PDF hook
|
247 |
+
|
248 |
+
= 3.4.0.1 =
|
249 |
+
* Housekeeping - Add commas on the last line of every config node in the configuration.php file
|
250 |
+
* Housekeeping - Fix up initialisation error messages
|
251 |
+
* Bug - Fix up mPDF bugs - soft hyphens, watermarks over SVG images, inline CSS bug
|
252 |
+
|
253 |
+
= 3.4.0 =
|
254 |
+
* 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)
|
255 |
+
* Feature - Added ability to rotate absolute positioned text 180 degrees (previously only 90 and -90). Note: feature in beta
|
256 |
+
* Feature - Backup all template files that are overridden when initialising to a folder inside PDF_EXTENDED_TEMPLATES
|
257 |
+
* Feature - Added SSH initialisation support
|
258 |
+
* Feature - Allow MERGETAGS to be used in all PDF templates, including default template (but only in the HTML field).
|
259 |
+
* Feature - Updated mPDF to 3.7.1
|
260 |
+
* 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/)
|
261 |
+
* 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/)
|
262 |
+
* Feature - Shortcodes will now be processed in all templates, including default template (but only in the HTML field).
|
263 |
+
* Feature - Added 'save' configuration option so PDFs are saved to the local disk when 'notifications' aren't enabled.
|
264 |
+
* Feature - Added 'dpi' configuration option to modify the PDF image DPI. Default 96dpi. Use 300dpi for printing.
|
265 |
+
* 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.
|
266 |
+
* 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.
|
267 |
+
* 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.
|
268 |
+
* Feature - Added a sleuth of new hooks and filters for developers. See https://developer.gravitypdf.com/documentation/filters-and-hooks/ for examples.
|
269 |
+
* Feature - Added $form_data['form_description'] key to $form_data array
|
270 |
+
* Feature - Update $form_data['products'] array key to field ID
|
271 |
+
* 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.
|
272 |
+
* Feature - Added field descriptions to the $form_data array under the $form_data['field_descriptions'] key.
|
273 |
+
* 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.
|
274 |
+
* Feature: $form_data['signature'] et al. keys now contain the signature width and height attributes
|
275 |
+
|
276 |
+
* Housekeeping - Ensure the form and lead IDs are correctly passed throughout the render functions.
|
277 |
+
* Housekeeping - Update settings page link to match new Gravity Forms URL structure
|
278 |
+
* Housekeeping - Check if $lead['gfsurvey_score'] exists before assigning to $form_data array
|
279 |
+
* Housekeeping - Removed table and font checksum debugging from mPDF when WP_DEBUG enabled as they produced inaccurate results.
|
280 |
+
* 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.
|
281 |
+
* Housekeeping - Removed API logging locally when WP_DEBUG is enabled.
|
282 |
+
* Housekeeping - Increase API timeout interval as some overseas users reported timeout issues
|
283 |
+
* 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.
|
284 |
+
* Housekeeping - Added ability to not re-deploy every update (not enabled this release as template files were all updated)
|
285 |
+
* Housekeeping - Additional checks on load to see if any of the required file/folder structure is missing. If so, re-initilise.
|
286 |
+
* Housekeeping - Save resources and turn off automatic rtl identification. Users must set the RTL option when configuring form
|
287 |
+
* Housekeeping - Turn off mPDFs packTableData setting, decreasing processing time when working with large tables.
|
288 |
+
* 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
|
289 |
+
* Housekeeping - Center aligned Survey Likery field results
|
290 |
+
* Housekeeping - Partially refactored the pdf-entry-detail.php code
|
291 |
+
* Housekeeping - All default and example templates have been tidied. This won't affect custom templates.
|
292 |
+
* 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.
|
293 |
+
* Housekeeping - Fix spelling mistake on initialising fonts
|
294 |
+
* Housekeeping - Remove wpautop() function from Gravity Form HTML output, which was applied before rendering and was messing up the HTML markup.
|
295 |
+
* Housekeeping - Remove empty list rows from the $form_data['list'] array in single and multi-column lists.
|
296 |
+
* Housekeeping - Apply same CSS styles (padding, border and line height) to HTML fields as done to form values in default templates
|
297 |
+
* Housekeeping - Replaced arbitrary wrapper IDs in the default templates with the actual field ID
|
298 |
+
|
299 |
+
* Bug - Fixed signature rendering issue when custom signature size was being used
|
300 |
+
* Bug - Fixed static error types in helper/install-update-manager.php file.
|
301 |
+
* Bug - Fixed redeployment error message which wasn't showing correctly
|
302 |
+
* Bug - Fixed issue with PDF not attaching to notification using Paypal's delayed notification feature
|
303 |
+
* Bug - Fixed strict standard warning about calling GFPDF_Settings::settings_page();
|
304 |
+
* Bug - Fixed strict standard warning about calling GFPDFEntryDetail::pdf_get_lead_field_display();
|
305 |
+
* Bug - Fixed issue with Gravity Form Post Category field causing fatal error generating PDF
|
306 |
+
* Bug - Fixed number field formatting issue when displaying on PDF.
|
307 |
+
* Bug - Do additional check for PHP's MB_String regex functions before initialising ti prevent errors after initialising
|
308 |
+
* Bug - Fixed problem with multiple nodes assigned to a form using the same template
|
309 |
+
* Bug - Fixed path to fallback templates when not found
|
310 |
+
* Bug - Fixed problem with master password setting to user password
|
311 |
+
|
312 |
+
|
313 |
+
= 3.3.4 =
|
314 |
+
* Bug - Fixed issue linking to PDF from front end
|
315 |
+
* Housekeeping - Removed autoredirect to initialisation page
|
316 |
+
|
317 |
+
= 3.3.3 =
|
318 |
+
* Bug - Correctly call javascript to control admin area 'View PDFs' drop down
|
319 |
+
* Bug - Some users still reported incorrect RAM. Convert MB/KB/GB values to M/K/G as per the PHP documentation.
|
320 |
+
* Housekeeping - Show initilisation prompt on all admin area pages instead of only on the Gravity Forms pages
|
321 |
+
|
322 |
+
= 3.3.2.1 =
|
323 |
+
* Bug - Incorrectly showing assigned RAM to website
|
324 |
+
|
325 |
+
= 3.3.2 =
|
326 |
+
* Bug - Some hosts reported SSL certificate errors when using the support API. Disabled HTTPS for further investigation. Using hash-based verification for authentication.
|
327 |
+
* Housekeeping - Forgot to disable API debug feature after completing beta
|
328 |
+
|
329 |
+
= 3.3.1 =
|
330 |
+
* Bug - $form_data['list'] was mapped using an incremental key instead of via the field ID
|
331 |
+
|
332 |
+
= 3.3.0 =
|
333 |
+
* 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.
|
334 |
+
* Feature - Overhauled the settings page to make it easier to access features of the software
|
335 |
+
* 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
|
336 |
+
* 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.
|
337 |
+
* Feature - $form_data now includes all miscellaneous lead information in the $form_data['misc'] array.
|
338 |
+
* Feature - $form_data now contains 24 and 12 hour time of entry submission.
|
339 |
+
* Feature - Added localisation support
|
340 |
+
* Compatibility - Added new multi-upload support which was added in Gravity Forms 1.8.
|
341 |
+
* Bug - Added 'aid' parametre to the PDF url when multiple configuration nodes present on a single form
|
342 |
+
* Bug - Fixed issue when Gravity Forms in No Conflict Mode
|
343 |
+
* Bug - Font config.php's array keys now in lower case
|
344 |
+
* Housekeeping - Moved all initialisation files to a folder called 'initialisation'.
|
345 |
+
* 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.
|
346 |
+
* Housekeeping - Updated the plugin file system to a more MVC-style approach, with model and view folders.
|
347 |
+
* Housekeeping - Removed ability to directly access default and example template files.
|
348 |
+
* Housekeeping - Fixed PHP notices in default templates related to the default template-only configuration options
|
349 |
+
* Housekeeping - Update core styles to match Wordpress 3.8/Gravity Forms 1.8.
|
350 |
+
* Housekeeping - Updated header/footer examples to use @page in example.
|
351 |
+
|
352 |
+
= 3.2.0 =
|
353 |
+
* 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.
|
354 |
+
* 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.
|
355 |
+
* Bug - Fixed issue viewing own PDF entry when logged in as anything lower than editor.
|
356 |
+
* Bug - Fixed data return bug in pdf-entry-details.php that was preventing all data returning correctly.
|
357 |
+
* Bug - Fixed PHP Warning when using products with no options
|
358 |
+
* Bug - Fixed issue with invalid characters being added to the PDF filename. Most notably the date mergetag.
|
359 |
+
* Bug - Limit filename length to 150 characters which should work on the majority of web servers.
|
360 |
+
* Bug - Fixed problem sending duplicate PDF when using mass resend notification feature
|
361 |
+
* 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.
|
362 |
+
|
363 |
+
= 3.1.4 =
|
364 |
+
* Bug - Fixed issue with plugin breaking website's when the Gravity Forms plugin wasn't activated.
|
365 |
+
* Housekeeping - The plugin now only supports Gravity Forms 1.7 or higher and Wordpress 3.5 or higher.
|
366 |
+
* Housekeeping - PDF template files can no longer be accessed directly. Instead, add &html=1 to the end of your URL when viewing a PDF.
|
367 |
+
* Extension - Added additional filters to allow the lead ID and notifications to be overridden.
|
368 |
+
|
369 |
+
= 3.1.3 =
|
370 |
+
* Feature - Added signature_details_id to $form_data array which maps a signatures field ID to the array.
|
371 |
+
* Extension - Added pre-PDF generator filter for use with extensions.
|
372 |
+
* Bug - Fixed issue with quotes in entry data breaking custom templates.
|
373 |
+
* Bug - Fixed issue with the plugin not correctly using the new default configuration template, if set.
|
374 |
+
* Bug - Fixed issue with signature not being removed correctly when only testing with file_exists(). Added second is_dir() test.
|
375 |
+
* Bug - Fixed issue with empty signature field not displaying when option 'default-show-empty' is set.
|
376 |
+
* Bug - Fixed initialisation prompt issue when the MPDF package wasn't unpacked.
|
377 |
+
|
378 |
+
= 3.1.2 =
|
379 |
+
* Feature - Added list array, file path, form ID and lead ID to $form_data array in custom templates
|
380 |
+
* Bug - Fixed initialisation prompt issue when updating plugin
|
381 |
+
* Bug - Fixed window.open issue which prevented a new window from opening when viewing a PDF in the admin area
|
382 |
+
* Bug - Fixed issue with product dropdown and radio button data showing the value instead of the name field.
|
383 |
+
* Bug - Fixed incorrect URL pointing to signature in $form_data
|
384 |
+
|
385 |
+
= 3.1.1 =
|
386 |
+
* Bug - Users whose server only supports FTP file manipulation using the WP_Filesystem API moved the files into the wrong directory due to FTP usually being rooted to the Wordpress home directory. To fix this the plugin attempts to determine the FTP directory, otherwise assumes it is the WP base directory.
|
387 |
+
* Bug - Initialisation error message was being called but the success message was also showing.
|
388 |
+
|
389 |
+
= 3.1.0 =
|
390 |
+
* 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.
|
391 |
+
* 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.
|
392 |
+
* 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.
|
393 |
+
* 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.
|
394 |
+
* 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
|
395 |
+
* Compatability - Changed depreciated functions get_themes() and get_theme() to wp_get_theme() (added in Wordpress v3.4).
|
396 |
+
* 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.
|
397 |
+
* 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.
|
398 |
+
* Compatability - Added Wordpress compatibility checker (minimum now 3.4 or higher).
|
399 |
+
* 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.
|
400 |
+
* Bug - Fixed Gravity Forms compatibility checker which wouldn't return the correct response.
|
401 |
+
* Bug - Fixed minor bug in pdf.php when using static call 'self' in add_filter hook. Changed to class name.
|
402 |
+
* Bug - Removed PHP notice about $even variable not being defined in pdf-entry-detail.php
|
403 |
+
* Bug - Prevent code from continuing to excecute after sending header redirect.
|
404 |
+
|
405 |
+
= 3.0.2 =
|
406 |
+
* Backwards Compatibility - While PHP 5.3 has was released a number of years ago it seems a number of hosts do not currently offer this version to their clients. In the interest of backwards compatibility we've re-written the plugin to again work with PHP 5+.
|
407 |
+
* Signature / Image Display Bug - All URLs have been converted to a path so images should now display correctly in PDF.
|
408 |
+
|
409 |
+
= 3.0.1 =
|
410 |
+
* Bug - Fixed issue that caused website to become unresponsive when Gravity Forms was disabled or upgraded
|
411 |
+
* Bug - New HTML fields weren't being displayed in $form_data array
|
412 |
+
* Feature - Options for default templates to disable HTML fields or empty fields (or both)
|
413 |
+
|
414 |
+
= 3.0.0 =
|
415 |
+
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.
|
416 |
+
|
417 |
+
New Features include:
|
418 |
+
|
419 |
+
* Language Support - almost all languages are supported including RTL (right to left) languages like Arabic and Hebrew and CJK languages - Chinese, Japanese and Korean.
|
420 |
+
* HTML Page Numbering
|
421 |
+
* Odd and even paging with mirrored margins (most commonly used in printing).
|
422 |
+
* Nested Tables
|
423 |
+
* Text-justification and hyphenation
|
424 |
+
* Table of Contents
|
425 |
+
* Index
|
426 |
+
* Bookmarks
|
427 |
+
* Watermarks
|
428 |
+
* Password protection
|
429 |
+
* UTF-8 encoded HTML
|
430 |
+
* Better system resource handling
|
431 |
+
|
432 |
+
A new HTML to PDF package wasn't the only change to this edition of the software. We have rewritten the entire configuration system and made it super easy to get the software up and running.
|
433 |
+
|
434 |
+
Users will no longer place code in their active theme's functions.php file. Instead, configuration will happen in a new file called configuration.php, inside the PDF_EXTENDED_TEMPLATES folder (in your active theme).
|
435 |
+
|
436 |
+
Other changes include
|
437 |
+
* Improved security - further restrictions were placed on non-administrators viewing template files.
|
438 |
+
* $form_data array tidied up - images won't be wrapped in anchor tags.
|
439 |
+
|
440 |
+
For more details [view the 3.x.x online documentation](https://developer.gravitypdf.com/).
|
441 |
+
|
442 |
+
= 2.2.3 =
|
443 |
+
* Bug - Fixed mb_string error in the updated DOMPDF package.
|
444 |
+
|
445 |
+
= 2.2.2 =
|
446 |
+
* DOMPDF - We updated to the latest version of DOMPDF - DOMPDF 0.6.0 beta 3.
|
447 |
+
* DOMPDF - We've enabled font subsetting by default which should help limit the increased PDF size when using DejaVu Sans (or any other font).
|
448 |
+
|
449 |
+
= 2.2.1 =
|
450 |
+
* Bug - Fixed HTML error which caused list items to distort on PDF
|
451 |
+
|
452 |
+
= 2.2.0 =
|
453 |
+
* Compatibility - Ensure compatibility with Gravity Forms 1.7. We've updated the functions.php code and remove gform_user_notification_attachments and gform_admin_notification_attachments hooks which are now depreciated. Functions gform_pdf_create and gform_add_attachment have been removed and replaced with gfpdfe_create_and_attach_pdf(). See upgrade documentation for details.
|
454 |
+
* Enhancement - Added deployment code switch so the template redeployment feature can be turned on and off. This release doesn't require redeployment.
|
455 |
+
* Enhancement - PDF_Generator() variables were getting long and complex so the third variable is now an array which will pass all the optional arguments. The new 1.7 compatible functions.php code includes this method by default. For backwards compatibility the function will still work with the variable structure prior to 2.2.0.
|
456 |
+
* Bug - Fixed error generated by legacy code in the function PDF_processing() which is located in render_to_pdf.php.
|
457 |
+
* Bug - Images and stylesheets will now try and be accessed with a local path instead of a URL. It fixes problem where some hosts were preventing read access from a URL. No template changes are required.
|
458 |
+
|
459 |
+
= 2.1.1 =
|
460 |
+
* Bug - Signatures stopped displaying after 2.1.0 update. Fixed issue.
|
461 |
+
* Bug - First time install code now won't execute if already have configuration variables in database
|
462 |
+
|
463 |
+
= 2.1.0 =
|
464 |
+
|
465 |
+
* Feature - Product table can now be accessed directly through custom templates by running GFPDFEntryDetail::product_table($form, $lead);. See documentation for more details.
|
466 |
+
* Feature - Update screen will ask you if you want to deploy new template files, instead of overriding your modified versions.
|
467 |
+
* 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.
|
468 |
+
* 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.
|
469 |
+
* 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.
|
470 |
+
* 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.
|
471 |
+
* Bug - Fixed problem with default template not showing and displaying a timeout error. Removed table tags and replaced with divs that are styled appropriately.
|
472 |
+
* Bug - The new plugin theme folder will successfully create when upgrading. You won't have to deactivate and reactivate to get it working.
|
473 |
+
* 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.
|
474 |
+
* Bug - Remove empty signature field from the default template.
|
475 |
+
* Bug - fixed problem with redirecting to login screen even when logged in while accessing template file through the browser window directly.
|
476 |
+
* Bug - fixed error where sample template would reimport itself automatically even after deleting it. Will now only reimport if any important changes to template need to be viewed straight after an update.
|
477 |
+
* Bug - Moved render_to_pdf.php constants to pdf.php so we can use the constants in the core files. Was previously generating an error.
|
478 |
+
* Housekeeping - Cleaned up core template files, moved functions into classes and added more in-file documentation.
|
479 |
+
* Housekeeping - moved install/upgrade code from pdf.php to installation-update-manager.php
|
480 |
+
* Housekeeping - changed pdf-entry-detail.php class name from GFEntryDetail to GFPDFEntryDetail to remove compatibility problems with Gravity Forms.
|
481 |
+
* Housekeeping - created pdf-settings.php file to house the settings page code.
|
482 |
+
|
483 |
+
= 2.0.1 =
|
484 |
+
* Fixed Signature bug when checking if image file exists using URL instead of filesystem path
|
485 |
+
* Fixed PHP Constants Notice
|
486 |
+
|
487 |
+
= 2.0.0 =
|
488 |
+
* Moved templates to active theme folder to prevent custom themes being removed on upgrade
|
489 |
+
* Allow PDFs to be saved using a custom name
|
490 |
+
* Fixed WP_Error bug when image/css file cannot be found
|
491 |
+
* Upgraded to latest version of DOMPDF
|
492 |
+
* Removed auto-load form bug which would see multiple instances of the example form loaded
|
493 |
+
* Created a number of constants to allow easier developer modification
|
494 |
+
* Plugin/Support moved to dedicated website.
|
495 |
+
* Pro/Business package offers the ability to write fields on an existing PDF.
|
496 |
+
|
497 |
+
= 1.2.3 =
|
498 |
+
* Fixed $wpdb->prepare error
|
499 |
+
|
500 |
+
= 1.2.2 =
|
501 |
+
* Fixed bug with tempalte shipping method MERGETAGS
|
502 |
+
* Fixed bug where attachment wasn't being sent
|
503 |
+
* Fixed problem when all_url_fopen was turned off on server and failed to retreive remote images. Now uses WP_HTTP class.
|
504 |
+
|
505 |
+
= 1.2.1 =
|
506 |
+
* Fixed path to custom css file included in PDF template
|
507 |
+
|
508 |
+
= 1.2.0 =
|
509 |
+
* Template files moved to the plugin's template folder
|
510 |
+
* Sample Form installed so developers have a working example to modify
|
511 |
+
* Fixed bug when using WordPress in another directory to the site
|
512 |
+
|
513 |
+
= 1.1.0 =
|
514 |
+
* Now compatible with Gravity Forms Signature Add-On
|
515 |
+
* Moved the field data functions out side of the Gravity Forms core so users can freely style their form information (located in pdf-entry-detail.php)
|
516 |
+
* Simplified the field data output
|
517 |
+
* Fixed bug when using product information
|
518 |
+
|
519 |
+
= 1.0.0 =
|
520 |
+
* First release.
|
521 |
+
|
522 |
+
== Upgrade Notice ==
|
523 |
+
|
524 |
+
= 3.7.8 =
|
525 |
+
This update adds support for Gravity Forms 2.0 Rich Text Editor field and does pre-upgrade checks for Gravity PDF 4.0.
|
depreciated.php
CHANGED
@@ -1,43 +1,43 @@
|
|
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 |
-
This file is part of Gravity PDF.
|
11 |
-
|
12 |
-
Gravity PDF Copyright (C) 2015 Blue Liquid Designs
|
13 |
-
|
14 |
-
This program is free software; you can redistribute it and/or modify
|
15 |
-
it under the terms of the GNU General Public License as published by
|
16 |
-
the Free Software Foundation; either version 2 of the License, or
|
17 |
-
(at your option) any later version.
|
18 |
-
|
19 |
-
This program is distributed in the hope that it will be useful,
|
20 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
21 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
22 |
-
GNU General Public License for more details.
|
23 |
-
|
24 |
-
You should have received a copy of the GNU General Public License
|
25 |
-
along with this program; if not, write to the Free Software
|
26 |
-
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
27 |
-
*/
|
28 |
-
|
29 |
-
/*
|
30 |
-
* Since v3.6
|
31 |
-
* Moved to the $gfpdfe_data class.
|
32 |
-
* Can now be accessed using the following:
|
33 |
-
*
|
34 |
-
* $gfpdfe_data->template_location
|
35 |
-
* $gfpdfe_data->template_site_location
|
36 |
-
* $gfpdfe_data->template_save_location
|
37 |
-
* $gfpdfe_data->template_font_location
|
38 |
-
*
|
39 |
-
*/
|
40 |
-
define('PDF_SAVE_LOCATION', $gfpdfe_data->template_save_location);
|
41 |
-
define('PDF_FONT_LOCATION', $gfpdfe_data->template_font_location);
|
42 |
-
define('PDF_TEMPLATE_LOCATION', $gfpdfe_data->template_site_location);
|
43 |
define('PDF_TEMPLATE_URL_LOCATION', $gfpdfe_data->template_site_location_url);
|
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 |
+
This file is part of Gravity PDF.
|
11 |
+
|
12 |
+
Gravity PDF Copyright (C) 2015 Blue Liquid Designs
|
13 |
+
|
14 |
+
This program is free software; you can redistribute it and/or modify
|
15 |
+
it under the terms of the GNU General Public License as published by
|
16 |
+
the Free Software Foundation; either version 2 of the License, or
|
17 |
+
(at your option) any later version.
|
18 |
+
|
19 |
+
This program is distributed in the hope that it will be useful,
|
20 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
21 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
22 |
+
GNU General Public License for more details.
|
23 |
+
|
24 |
+
You should have received a copy of the GNU General Public License
|
25 |
+
along with this program; if not, write to the Free Software
|
26 |
+
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
27 |
+
*/
|
28 |
+
|
29 |
+
/*
|
30 |
+
* Since v3.6
|
31 |
+
* Moved to the $gfpdfe_data class.
|
32 |
+
* Can now be accessed using the following:
|
33 |
+
*
|
34 |
+
* $gfpdfe_data->template_location
|
35 |
+
* $gfpdfe_data->template_site_location
|
36 |
+
* $gfpdfe_data->template_save_location
|
37 |
+
* $gfpdfe_data->template_font_location
|
38 |
+
*
|
39 |
+
*/
|
40 |
+
define('PDF_SAVE_LOCATION', $gfpdfe_data->template_save_location);
|
41 |
+
define('PDF_FONT_LOCATION', $gfpdfe_data->template_font_location);
|
42 |
+
define('PDF_TEMPLATE_LOCATION', $gfpdfe_data->template_site_location);
|
43 |
define('PDF_TEMPLATE_URL_LOCATION', $gfpdfe_data->template_site_location_url);
|
helper/data.php
CHANGED
@@ -1,125 +1,125 @@
|
|
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 |
-
/*
|
12 |
-
This file is part of Gravity PDF.
|
13 |
-
|
14 |
-
Gravity PDF Copyright (C) 2015 Blue Liquid Designs
|
15 |
-
|
16 |
-
This program is free software; you can redistribute it and/or modify
|
17 |
-
it under the terms of the GNU General Public License as published by
|
18 |
-
the Free Software Foundation; either version 2 of the License, or
|
19 |
-
(at your option) any later version.
|
20 |
-
|
21 |
-
This program is distributed in the hope that it will be useful,
|
22 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
23 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
24 |
-
GNU General Public License for more details.
|
25 |
-
|
26 |
-
You should have received a copy of the GNU General Public License
|
27 |
-
along with this program; if not, write to the Free Software
|
28 |
-
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
29 |
-
*/
|
30 |
-
|
31 |
-
class GFPDFE_DATA
|
32 |
-
{
|
33 |
-
/** Location for overloaded data. */
|
34 |
-
private $data = array();
|
35 |
-
|
36 |
-
public function __set($name, $value)
|
37 |
-
{
|
38 |
-
$this->data[$name] = $value;
|
39 |
-
}
|
40 |
-
|
41 |
-
public function __get($name)
|
42 |
-
{
|
43 |
-
if (array_key_exists($name, $this->data)) {
|
44 |
-
return $this->data[$name];
|
45 |
-
}
|
46 |
-
|
47 |
-
$trace = debug_backtrace();
|
48 |
-
trigger_error(
|
49 |
-
'Undefined property via __get(): ' . $name .
|
50 |
-
' in ' . $trace[0]['file'] .
|
51 |
-
' on line ' . $trace[0]['line'],
|
52 |
-
E_USER_NOTICE);
|
53 |
-
return null;
|
54 |
-
}
|
55 |
-
|
56 |
-
/** As of PHP 5.1.0 */
|
57 |
-
public function __isset($name)
|
58 |
-
{
|
59 |
-
return isset($this->data[$name]);
|
60 |
-
}
|
61 |
-
|
62 |
-
/** As of PHP 5.1.0 */
|
63 |
-
public function __unset($name)
|
64 |
-
{
|
65 |
-
unset($this->data[$name]);
|
66 |
-
}
|
67 |
-
|
68 |
-
/**
|
69 |
-
* Used to set up our PDF template folder,
|
70 |
-
* save folder and font folder
|
71 |
-
*/
|
72 |
-
public function set_directory_structure()
|
73 |
-
{
|
74 |
-
$upload_dir = PDF_Common::get_upload_dir();
|
75 |
-
$site_name = PDF_Common::get_site_name();
|
76 |
-
|
77 |
-
/*
|
78 |
-
* As of Gravity PDF 3.7 we'll be dropping the 'site_name' folder for single installs
|
79 |
-
* And changing multisite installs to their site ID
|
80 |
-
*/
|
81 |
-
|
82 |
-
$this->template_location = apply_filters('gfpdfe_template_location', $upload_dir['basedir'] . '/' . PDF_SAVE_FOLDER . '/', $upload_dir['basedir'], PDF_SAVE_FOLDER);
|
83 |
-
$this->template_site_location = $this->template_location;
|
84 |
-
$this->template_save_location = $this->template_location . 'output/';
|
85 |
-
$this->template_font_location = $this->template_location . 'fonts/';
|
86 |
-
|
87 |
-
$this->template_location_url = apply_filters('gfpdfe_template_location_uri', $upload_dir['baseurl'] . '/' . PDF_SAVE_FOLDER . '/', $upload_dir['baseurl'], PDF_SAVE_FOLDER);
|
88 |
-
$this->template_site_location_url = $this->template_location_url;
|
89 |
-
$this->template_save_location_url = $this->template_location_url . 'output/';
|
90 |
-
$this->template_font_location_url = $this->template_location_url . 'fonts/';
|
91 |
-
|
92 |
-
$this->old_3_6_template_site_location = $this->template_location . $site_name . '/';
|
93 |
-
|
94 |
-
/*
|
95 |
-
* Use the network ID for multisite installs
|
96 |
-
*/
|
97 |
-
if(is_multisite())
|
98 |
-
{
|
99 |
-
$blog_id = get_current_blog_id();
|
100 |
-
|
101 |
-
$this->template_site_location = $this->template_location . $blog_id . '/';
|
102 |
-
$this->template_save_location = $this->template_site_location . 'output/';
|
103 |
-
$this->template_font_location = $this->template_site_location . 'fonts/';
|
104 |
-
|
105 |
-
$this->template_site_location_url = $this->template_location_url . $blog_id . '/';
|
106 |
-
$this->template_save_location_url = $this->template_site_location_url . 'output/';
|
107 |
-
$this->template_font_location_url = $this->template_site_location_url . 'fonts/';
|
108 |
-
|
109 |
-
$this->old_3_6_template_site_location = $this->template_location . $site_name . '/';
|
110 |
-
}
|
111 |
-
|
112 |
-
/*
|
113 |
-
* Include old template locations to help with migrations
|
114 |
-
*/
|
115 |
-
$this->old_template_location = get_stylesheet_directory().'/'.PDF_SAVE_FOLDER.'/';
|
116 |
-
$this->upload_dir = $upload_dir['basedir'];
|
117 |
-
|
118 |
-
/*
|
119 |
-
* Include relative paths for display on the support pages
|
120 |
-
*/
|
121 |
-
$this->relative_output_location = str_replace(ABSPATH, '/', $this->template_save_location);
|
122 |
-
$this->relative_font_location = str_replace(ABSPATH, '/', $this->template_font_location);
|
123 |
-
$this->relative_mpdf_tmp = str_replace(ABSPATH, '/', PDF_PLUGIN_DIR) . 'mPDF/tmp/';
|
124 |
-
}
|
125 |
}
|
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 |
+
/*
|
12 |
+
This file is part of Gravity PDF.
|
13 |
+
|
14 |
+
Gravity PDF Copyright (C) 2015 Blue Liquid Designs
|
15 |
+
|
16 |
+
This program is free software; you can redistribute it and/or modify
|
17 |
+
it under the terms of the GNU General Public License as published by
|
18 |
+
the Free Software Foundation; either version 2 of the License, or
|
19 |
+
(at your option) any later version.
|
20 |
+
|
21 |
+
This program is distributed in the hope that it will be useful,
|
22 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
23 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
24 |
+
GNU General Public License for more details.
|
25 |
+
|
26 |
+
You should have received a copy of the GNU General Public License
|
27 |
+
along with this program; if not, write to the Free Software
|
28 |
+
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
29 |
+
*/
|
30 |
+
|
31 |
+
class GFPDFE_DATA
|
32 |
+
{
|
33 |
+
/** Location for overloaded data. */
|
34 |
+
private $data = array();
|
35 |
+
|
36 |
+
public function __set($name, $value)
|
37 |
+
{
|
38 |
+
$this->data[$name] = $value;
|
39 |
+
}
|
40 |
+
|
41 |
+
public function __get($name)
|
42 |
+
{
|
43 |
+
if (array_key_exists($name, $this->data)) {
|
44 |
+
return $this->data[$name];
|
45 |
+
}
|
46 |
+
|
47 |
+
$trace = debug_backtrace();
|
48 |
+
trigger_error(
|
49 |
+
'Undefined property via __get(): ' . $name .
|
50 |
+
' in ' . $trace[0]['file'] .
|
51 |
+
' on line ' . $trace[0]['line'],
|
52 |
+
E_USER_NOTICE);
|
53 |
+
return null;
|
54 |
+
}
|
55 |
+
|
56 |
+
/** As of PHP 5.1.0 */
|
57 |
+
public function __isset($name)
|
58 |
+
{
|
59 |
+
return isset($this->data[$name]);
|
60 |
+
}
|
61 |
+
|
62 |
+
/** As of PHP 5.1.0 */
|
63 |
+
public function __unset($name)
|
64 |
+
{
|
65 |
+
unset($this->data[$name]);
|
66 |
+
}
|
67 |
+
|
68 |
+
/**
|
69 |
+
* Used to set up our PDF template folder,
|
70 |
+
* save folder and font folder
|
71 |
+
*/
|
72 |
+
public function set_directory_structure()
|
73 |
+
{
|
74 |
+
$upload_dir = PDF_Common::get_upload_dir();
|
75 |
+
$site_name = PDF_Common::get_site_name();
|
76 |
+
|
77 |
+
/*
|
78 |
+
* As of Gravity PDF 3.7 we'll be dropping the 'site_name' folder for single installs
|
79 |
+
* And changing multisite installs to their site ID
|
80 |
+
*/
|
81 |
+
|
82 |
+
$this->template_location = apply_filters('gfpdfe_template_location', $upload_dir['basedir'] . '/' . PDF_SAVE_FOLDER . '/', $upload_dir['basedir'], PDF_SAVE_FOLDER);
|
83 |
+
$this->template_site_location = $this->template_location;
|
84 |
+
$this->template_save_location = $this->template_location . 'output/';
|
85 |
+
$this->template_font_location = $this->template_location . 'fonts/';
|
86 |
+
|
87 |
+
$this->template_location_url = apply_filters('gfpdfe_template_location_uri', $upload_dir['baseurl'] . '/' . PDF_SAVE_FOLDER . '/', $upload_dir['baseurl'], PDF_SAVE_FOLDER);
|
88 |
+
$this->template_site_location_url = $this->template_location_url;
|
89 |
+
$this->template_save_location_url = $this->template_location_url . 'output/';
|
90 |
+
$this->template_font_location_url = $this->template_location_url . 'fonts/';
|
91 |
+
|
92 |
+
$this->old_3_6_template_site_location = $this->template_location . $site_name . '/';
|
93 |
+
|
94 |
+
/*
|
95 |
+
* Use the network ID for multisite installs
|
96 |
+
*/
|
97 |
+
if(is_multisite())
|
98 |
+
{
|
99 |
+
$blog_id = get_current_blog_id();
|
100 |
+
|
101 |
+
$this->template_site_location = $this->template_location . $blog_id . '/';
|
102 |
+
$this->template_save_location = $this->template_site_location . 'output/';
|
103 |
+
$this->template_font_location = $this->template_site_location . 'fonts/';
|
104 |
+
|
105 |
+
$this->template_site_location_url = $this->template_location_url . $blog_id . '/';
|
106 |
+
$this->template_save_location_url = $this->template_site_location_url . 'output/';
|
107 |
+
$this->template_font_location_url = $this->template_site_location_url . 'fonts/';
|
108 |
+
|
109 |
+
$this->old_3_6_template_site_location = $this->template_location . $site_name . '/';
|
110 |
+
}
|
111 |
+
|
112 |
+
/*
|
113 |
+
* Include old template locations to help with migrations
|
114 |
+
*/
|
115 |
+
$this->old_template_location = get_stylesheet_directory().'/'.PDF_SAVE_FOLDER.'/';
|
116 |
+
$this->upload_dir = $upload_dir['basedir'];
|
117 |
+
|
118 |
+
/*
|
119 |
+
* Include relative paths for display on the support pages
|
120 |
+
*/
|
121 |
+
$this->relative_output_location = str_replace(ABSPATH, '/', $this->template_save_location);
|
122 |
+
$this->relative_font_location = str_replace(ABSPATH, '/', $this->template_font_location);
|
123 |
+
$this->relative_mpdf_tmp = str_replace(ABSPATH, '/', PDF_PLUGIN_DIR) . 'mPDF/tmp/';
|
124 |
+
}
|
125 |
}
|
helper/installation-update-manager.php
CHANGED
@@ -1,675 +1,675 @@
|
|
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.
|
8 |
-
*/
|
9 |
-
|
10 |
-
/*
|
11 |
-
This file is part of Gravity PDF.
|
12 |
-
|
13 |
-
Gravity PDF Copyright (C) 2015 Blue Liquid Designs
|
14 |
-
|
15 |
-
This program is free software; you can redistribute it and/or modify
|
16 |
-
it under the terms of the GNU General Public License as published by
|
17 |
-
the Free Software Foundation; either version 2 of the License, or
|
18 |
-
(at your option) any later version.
|
19 |
-
|
20 |
-
This program is distributed in the hope that it will be useful,
|
21 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
22 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
23 |
-
GNU General Public License for more details.
|
24 |
-
|
25 |
-
You should have received a copy of the GNU General Public License
|
26 |
-
along with this program; if not, write to the Free Software
|
27 |
-
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
28 |
-
*/
|
29 |
-
|
30 |
-
class GFPDF_InstallUpdater
|
31 |
-
{
|
32 |
-
|
33 |
-
public static function check_filesystem_api()
|
34 |
-
{
|
35 |
-
global $gfpdfe_data;
|
36 |
-
$access_type = get_filesystem_method();
|
37 |
-
|
38 |
-
$gfpdfe_data->automated = false;
|
39 |
-
if ($access_type === 'direct') {
|
40 |
-
$gfpdfe_data->automated = true;
|
41 |
-
}
|
42 |
-
}
|
43 |
-
|
44 |
-
/*
|
45 |
-
* Check if we can automatically deploy the software
|
46 |
-
* We use WP Filesystem API to initialise.
|
47 |
-
* Check if we have direct write control to the filesystem. If so, automatically deploy
|
48 |
-
* without asking the user. This will make upgrades much simplier.
|
49 |
-
*/
|
50 |
-
public static function maybe_deploy()
|
51 |
-
{
|
52 |
-
global $gfpdfe_data;
|
53 |
-
/*
|
54 |
-
* Check if we have a 'direct' method, that the software isn't fully installed and we aren't trying to manually initialise
|
55 |
-
*/
|
56 |
-
|
57 |
-
if ($gfpdfe_data->automated === true && $gfpdfe_data->is_initialised === false && !rgpost('upgrade') && get_option('gfpdfe_automated_install') != 'installing') {
|
58 |
-
/*
|
59 |
-
* Initialise all multisites if a super admin is logged in
|
60 |
-
*/
|
61 |
-
if (is_multisite() && is_super_admin()) {
|
62 |
-
$results = GFPDF_InstallUpdater::run_multisite_deployment(array('GFPDF_InstallUpdater', 'do_deploy'));
|
63 |
-
|
64 |
-
if ($results === true) {
|
65 |
-
add_action($gfpdfe_data->notice_type, array('GFPDF_Notices', 'gf_pdf_network_deploy_success'));
|
66 |
-
} elseif ($results === false) {
|
67 |
-
add_action($gfpdfe_data->notice_type, array('GFPDF_Notices', 'gf_pdf_auto_deploy_network_failure'));
|
68 |
-
}
|
69 |
-
|
70 |
-
return $results;
|
71 |
-
} else {
|
72 |
-
if (self::do_deploy()) {
|
73 |
-
/*
|
74 |
-
* Output successfull automated installation message
|
75 |
-
*/
|
76 |
-
add_action($gfpdfe_data->notice_type, array('GFPDF_Notices', 'gf_pdf_auto_deploy_success'));
|
77 |
-
}
|
78 |
-
}
|
79 |
-
}
|
80 |
-
}
|
81 |
-
|
82 |
-
/*
|
83 |
-
* Initialise all multsites in one fowl swoop
|
84 |
-
*/
|
85 |
-
public static function run_multisite_deployment($action)
|
86 |
-
{
|
87 |
-
global $gfpdfe_data;
|
88 |
-
|
89 |
-
/* add additional check incase someone doesn't call this correctly */
|
90 |
-
if (!is_multisite() || !is_super_admin()) {
|
91 |
-
return false;
|
92 |
-
}
|
93 |
-
|
94 |
-
/*
|
95 |
-
* Get multisites which aren't deleted
|
96 |
-
*/
|
97 |
-
$sites = wp_get_sites(array('deleted' => 0));
|
98 |
-
|
99 |
-
if (sizeof($sites) > 0) {
|
100 |
-
$problem = array();
|
101 |
-
foreach ($sites as $site) {
|
102 |
-
switch_to_blog((int) $site['blog_id']);
|
103 |
-
|
104 |
-
/*
|
105 |
-
* Reset the directory structure
|
106 |
-
*/
|
107 |
-
$gfpdfe_data->set_directory_structure();
|
108 |
-
|
109 |
-
/*
|
110 |
-
* Test if the blog has gravity forms and PDF Extended active
|
111 |
-
* If so, we can initialise
|
112 |
-
*/
|
113 |
-
$gravityforms = 'gravityforms/gravityforms.php'; /* have to hardcode the folder name as they don't set it in a constant or variable */
|
114 |
-
$pdfextended = GF_PDF_EXTENDED_PLUGIN_BASENAME; /* no need to hardcode the basename here */
|
115 |
-
|
116 |
-
if ((is_plugin_active_for_network($gravityforms) && is_plugin_active_for_network($pdfextended)) ||
|
117 |
-
(is_plugin_active($gravityforms) && is_plugin_active($pdfextended))
|
118 |
-
) {
|
119 |
-
/* run our deployment and output any problems */
|
120 |
-
$deploy = call_user_func($action);
|
121 |
-
if ($deploy === false) {
|
122 |
-
$problem[] = $site;
|
123 |
-
} elseif ($deploy === 'false') {
|
124 |
-
/*
|
125 |
-
* Asking for the access details so we can write to the server
|
126 |
-
* Exit early
|
127 |
-
*/
|
128 |
-
return $deploy;
|
129 |
-
}
|
130 |
-
}
|
131 |
-
restore_current_blog();
|
132 |
-
|
133 |
-
/*
|
134 |
-
* Reset the directory structure
|
135 |
-
*/
|
136 |
-
$gfpdfe_data->set_directory_structure();
|
137 |
-
}
|
138 |
-
|
139 |
-
if (sizeof($problem) > 0) {
|
140 |
-
$gfpdfe_data->network_error = $problem;
|
141 |
-
|
142 |
-
return false;
|
143 |
-
}
|
144 |
-
|
145 |
-
return true;
|
146 |
-
}
|
147 |
-
}
|
148 |
-
|
149 |
-
/*
|
150 |
-
* Used to automatically deploy the software
|
151 |
-
* Regular initialisation (via the settings page) will call pdf_extended_activate() directly.
|
152 |
-
*/
|
153 |
-
public static function do_deploy()
|
154 |
-
{
|
155 |
-
update_option('gfpdfe_automated_install', 'installing');
|
156 |
-
|
157 |
-
return self::pdf_extended_activate();
|
158 |
-
}
|
159 |
-
|
160 |
-
/*
|
161 |
-
* Different filesystems (FTP/SSH) might have a different ABSPATH than the 'direct' method
|
162 |
-
* due to being rooted to a specific folder.
|
163 |
-
* The $wp_filesystem->abspath() corrects this behaviour.
|
164 |
-
*/
|
165 |
-
private static function get_basedir($path)
|
166 |
-
{
|
167 |
-
global $wp_filesystem;
|
168 |
-
|
169 |
-
return str_replace(ABSPATH, $wp_filesystem->abspath(), $path);
|
170 |
-
}
|
171 |
-
|
172 |
-
/**
|
173 |
-
* Install everything required
|
174 |
-
*/
|
175 |
-
public static function pdf_extended_activate()
|
176 |
-
{
|
177 |
-
/*
|
178 |
-
* Initialise the Wordpress Filesystem API
|
179 |
-
*/
|
180 |
-
if (PDF_Common::initialise_WP_filesystem_API(array('gfpdf_deploy', 'overwrite'), 'pdf-extended-filesystem') === false) {
|
181 |
-
return 'false';
|
182 |
-
}
|
183 |
-
|
184 |
-
/*
|
185 |
-
* If we got here we should have $wp_filesystem available
|
186 |
-
*/
|
187 |
-
global $wp_filesystem, $gfpdfe_data;
|
188 |
-
|
189 |
-
/*
|
190 |
-
* Set the correct paths
|
191 |
-
* FTP and SSH could be rooted to the wordpress base directory
|
192 |
-
* use $wp_filesystem->abspath(); function to fix any issues
|
193 |
-
*/
|
194 |
-
$directory = self::get_basedir(PDF_PLUGIN_DIR);
|
195 |
-
$base_template_directory = self::get_basedir($gfpdfe_data->template_location);
|
196 |
-
$template_directory = self::get_basedir($gfpdfe_data->template_site_location);
|
197 |
-
$template_save_directory = self::get_basedir($gfpdfe_data->template_save_location);
|
198 |
-
$template_font_directory = self::get_basedir($gfpdfe_data->template_font_location);
|
199 |
-
|
200 |
-
/**
|
201 |
-
* If template directory already exists then we will remove the old template files so we can redeploy the new ones
|
202 |
-
*/
|
203 |
-
self::reinitialise_templates($template_directory);
|
204 |
-
|
205 |
-
/* create new directory in uploads folder*/
|
206 |
-
if (self::create_base_template_dir($base_template_directory) === false) {
|
207 |
-
return false;
|
208 |
-
}
|
209 |
-
|
210 |
-
/* create site directory in base template directory */
|
211 |
-
if (self::create_site_template_dir($template_directory) === false) {
|
212 |
-
return false;
|
213 |
-
}
|
214 |
-
|
215 |
-
/* create 'save' output folder */
|
216 |
-
if (self::create_save_dir($template_save_directory) === false) {
|
217 |
-
return false;
|
218 |
-
}
|
219 |
-
|
220 |
-
/* create 'font' folder */
|
221 |
-
if (self::create_font_dir($template_font_directory) === false) {
|
222 |
-
return false;
|
223 |
-
}
|
224 |
-
|
225 |
-
/* copy entire template folder over to the template directory */
|
226 |
-
if(!self::pdf_extended_copy_directory($directory . 'initialisation/templates/', $template_directory, false)) {
|
227 |
-
return false;
|
228 |
-
}
|
229 |
-
|
230 |
-
/* copy configuration file over to new directory */
|
231 |
-
if (self::create_configuration_file($directory, $template_directory) === false) {
|
232 |
-
return false;
|
233 |
-
}
|
234 |
-
|
235 |
-
/* create .htaccess file */
|
236 |
-
if (self::create_htaccess_file($template_save_directory) === false) {
|
237 |
-
return false;
|
238 |
-
}
|
239 |
-
|
240 |
-
/* initialise font directory */
|
241 |
-
if (self::install_fonts($directory, $template_directory, $template_font_directory) !== true) {
|
242 |
-
return false;
|
243 |
-
}
|
244 |
-
|
245 |
-
/* update db to ensure everything is installed correctly. */
|
246 |
-
self::db_init();
|
247 |
-
|
248 |
-
return true;
|
249 |
-
}
|
250 |
-
|
251 |
-
public static function reinitialise_templates($template_directory)
|
252 |
-
{
|
253 |
-
global $wp_filesystem, $gfpdfe_data;
|
254 |
-
|
255 |
-
if ($wp_filesystem->exists($template_directory) && isset($_POST['overwrite'])) {
|
256 |
-
/*
|
257 |
-
* Create a backup folder and move all the files there
|
258 |
-
*/
|
259 |
-
$backup_folder = 'INIT_BACKUP_'.date('Y-m-d_G-i').'/';
|
260 |
-
$do_backup = false;
|
261 |
-
if ($wp_filesystem->mkdir($template_directory.$backup_folder)) {
|
262 |
-
$do_backup = true;
|
263 |
-
}
|
264 |
-
|
265 |
-
/* read all file names into array and unlink from active theme template folder */
|
266 |
-
foreach (glob(PDF_PLUGIN_DIR.'initialisation/templates/*') as $file) {
|
267 |
-
$path_parts = pathinfo($file);
|
268 |
-
if ($wp_filesystem->exists($template_directory.$path_parts['basename'])) {
|
269 |
-
if (!$do_backup) {
|
270 |
-
$wp_filesystem->delete($template_directory.$path_parts['basename']);
|
271 |
-
continue;
|
272 |
-
}
|
273 |
-
$wp_filesystem->move($template_directory.$path_parts['basename'], $template_directory.$backup_folder.$path_parts['basename']);
|
274 |
-
}
|
275 |
-
}
|
276 |
-
}
|
277 |
-
}
|
278 |
-
|
279 |
-
public static function create_base_template_dir($base_template_directory)
|
280 |
-
{
|
281 |
-
global $wp_filesystem, $gfpdfe_data;
|
282 |
-
|
283 |
-
/* create new directory in uploads folder*/
|
284 |
-
if (!$wp_filesystem->is_dir($base_template_directory)) {
|
285 |
-
if ($wp_filesystem->mkdir($base_template_directory) === false) {
|
286 |
-
/*
|
287 |
-
* TODO: add correct notices
|
288 |
-
*/
|
289 |
-
add_action($gfpdfe_data->notice_type, array('GFPDF_Notices', 'gf_pdf_template_dir_err'));
|
290 |
-
|
291 |
-
return false;
|
292 |
-
}
|
293 |
-
}
|
294 |
-
|
295 |
-
return true;
|
296 |
-
}
|
297 |
-
|
298 |
-
public static function create_site_template_dir($template_directory)
|
299 |
-
{
|
300 |
-
global $wp_filesystem, $gfpdfe_data;
|
301 |
-
|
302 |
-
if (!$wp_filesystem->is_dir($template_directory)) {
|
303 |
-
if ($wp_filesystem->mkdir($template_directory) === false) {
|
304 |
-
add_action($gfpdfe_data->notice_type, array('GFPDF_Notices', 'gf_pdf_template_site_dir_err'));
|
305 |
-
|
306 |
-
return false;
|
307 |
-
}
|
308 |
-
}
|
309 |
-
|
310 |
-
return true;
|
311 |
-
}
|
312 |
-
|
313 |
-
public static function create_save_dir($template_save_directory)
|
314 |
-
{
|
315 |
-
global $wp_filesystem, $gfpdfe_data;
|
316 |
-
|
317 |
-
if (!$wp_filesystem->is_dir($template_save_directory)) {
|
318 |
-
/* create new directory in active themes folder*/
|
319 |
-
if ($wp_filesystem->mkdir($template_save_directory) === false) {
|
320 |
-
add_action($gfpdfe_data->notice_type, array('GFPDF_Notices', 'gf_pdf_template_dir_err'));
|
321 |
-
|
322 |
-
return false;
|
323 |
-
}
|
324 |
-
}
|
325 |
-
|
326 |
-
return true;
|
327 |
-
}
|
328 |
-
|
329 |
-
public static function create_font_dir($template_font_directory)
|
330 |
-
{
|
331 |
-
global $wp_filesystem, $gfpdfe_data;
|
332 |
-
|
333 |
-
if (!$wp_filesystem->is_dir($template_font_directory)) {
|
334 |
-
/* create new directory in active themes folder*/
|
335 |
-
if ($wp_filesystem->mkdir($template_font_directory) === false) {
|
336 |
-
add_action($gfpdfe_data->notice_type, array('GFPDF_Notices', 'gf_pdf_template_dir_err'));
|
337 |
-
|
338 |
-
return false;
|
339 |
-
}
|
340 |
-
}
|
341 |
-
|
342 |
-
return true;
|
343 |
-
}
|
344 |
-
|
345 |
-
/**
|
346 |
-
* Copy configuration file to template folder
|
347 |
-
* @param String $directory The $wp_filesystem path to the plugin folder
|
348 |
-
* @param String $template_directory The $wp_filesystem path to the template folder
|
349 |
-
* @return Boolean Success on true (or not run at all). false on fail
|
350 |
-
*/
|
351 |
-
public static function create_configuration_file($directory, $template_directory)
|
352 |
-
{
|
353 |
-
global $wp_filesystem, $gfpdfe_data;
|
354 |
-
|
355 |
-
if (!$wp_filesystem->exists($template_directory.'configuration.php')) {
|
356 |
-
/* copy template files to new directory */
|
357 |
-
if (!$wp_filesystem->copy($directory.'initialisation/configuration.php.example', $template_directory.'configuration.php')) {
|
358 |
-
add_action($gfpdfe_data->notice_type, array('GFPDF_Notices', 'gf_pdf_template_dir_err'));
|
359 |
-
|
360 |
-
return false;
|
361 |
-
}
|
362 |
-
}
|
363 |
-
|
364 |
-
return true;
|
365 |
-
}
|
366 |
-
|
367 |
-
/**
|
368 |
-
* Create htaccess file to prevent direct access to PDFs
|
369 |
-
* @param String $template_save_directory The $wp_filesystem path to the save directory
|
370 |
-
* @return Boolean success on true (or not run at all). false on fail
|
371 |
-
*/
|
372 |
-
public static function create_htaccess_file($template_save_directory)
|
373 |
-
{
|
374 |
-
global $wp_filesystem, $gfpdfe_data;
|
375 |
-
|
376 |
-
if (!$wp_filesystem->exists($template_save_directory.'.htaccess')) {
|
377 |
-
if (!$wp_filesystem->put_contents($template_save_directory.'.htaccess', 'deny from all')) {
|
378 |
-
add_action($gfpdfe_data->notice_type, array('GFPDF_Notices', 'gf_pdf_template_dir_err'));
|
379 |
-
|
380 |
-
return false;
|
381 |
-
}
|
382 |
-
}
|
383 |
-
|
384 |
-
return true;
|
385 |
-
}
|
386 |
-
|
387 |
-
/*
|
388 |
-
* Normalize the database options related to initialisation
|
389 |
-
*/
|
390 |
-
public static function db_init()
|
391 |
-
{
|
392 |
-
global $gfpdfe_data;
|
393 |
-
|
394 |
-
update_option('gf_pdf_extended_installed', 'installed');
|
395 |
-
delete_option('gfpdfe_automated_install');
|
396 |
-
GFPDF_Settings::$model->check_compatibility();
|
397 |
-
}
|
398 |
-
|
399 |
-
public static function initialise_fonts()
|
400 |
-
{
|
401 |
-
/*
|
402 |
-
* Initialise the Wordpress Filesystem API
|
403 |
-
*/
|
404 |
-
if (PDF_Common::initialise_WP_filesystem_API(array('gfpdf_deploy', 'font-initialise', 'gfpdf_deploy_nonce'), 'pdf-extended-fonts') === false) {
|
405 |
-
return false;
|
406 |
-
}
|
407 |
-
|
408 |
-
/*
|
409 |
-
* If we got here we should have $wp_filesystem available
|
410 |
-
*/
|
411 |
-
global $wp_filesystem, $gfpdfe_data;
|
412 |
-
|
413 |
-
/*
|
414 |
-
* We need to set up some filesystem compatibility checkes to work with the different server file management types
|
415 |
-
* Most notably is the FTP options, but SSH may be effected too
|
416 |
-
*/
|
417 |
-
$directory = self::get_basedir(PDF_PLUGIN_DIR);
|
418 |
-
$template_directory = self::get_basedir($gfpdfe_data->template_site_location);
|
419 |
-
$template_font_directory = self::get_basedir($gfpdfe_data->template_font_location);
|
420 |
-
|
421 |
-
if (self::install_fonts($directory, $template_directory, $template_font_directory) === true) {
|
422 |
-
add_action($gfpdfe_data->notice_type, array('GFPDF_Notices', 'gf_pdf_font_install_success'));
|
423 |
-
}
|
424 |
-
|
425 |
-
return true;
|
426 |
-
}
|
427 |
-
|
428 |
-
private static function install_fonts($directory, $template_directory, $fonts_location)
|
429 |
-
{
|
430 |
-
global $wp_filesystem, $gfpdfe_data;
|
431 |
-
$write_to_file = '<?php
|
432 |
-
|
433 |
-
if(!defined("PDF_EXTENDED_VERSION"))
|
434 |
-
{
|
435 |
-
return;
|
436 |
-
}
|
437 |
-
|
438 |
-
';
|
439 |
-
|
440 |
-
/*
|
441 |
-
* Search the font folder for .ttf files. If found, move them to the mPDF font folder
|
442 |
-
* and write the configuration file
|
443 |
-
*/
|
444 |
-
|
445 |
-
/* read all file names into array and unlink from active theme template folder */
|
446 |
-
foreach (glob($gfpdfe_data->template_font_location.'/*.[tT][tT][fF]') as $file) {
|
447 |
-
$path_parts = pathinfo($file);
|
448 |
-
|
449 |
-
/*
|
450 |
-
* Generate configuration information in preparation to write to file
|
451 |
-
*/
|
452 |
-
$write_to_file .= '
|
453 |
-
$this->fontdata[\''.mb_strtolower(str_replace(' ', '', $path_parts['filename']), 'UTF-8').'\'] = array(
|
454 |
-
\'R\' => \''.$path_parts['basename'].'\'
|
455 |
-
);';
|
456 |
-
}
|
457 |
-
|
458 |
-
/*
|
459 |
-
* Remove the old configuration file and put the contents of $write_to_file in a font configuration file
|
460 |
-
*/
|
461 |
-
$wp_filesystem->delete($template_directory.'fonts/config.php');
|
462 |
-
if ($wp_filesystem->put_contents($template_directory.'fonts/config.php', $write_to_file) === false) {
|
463 |
-
add_action($gfpdfe_data->notice_type, array('GFPDF_Notices', 'gf_pdf_font_config_err'));
|
464 |
-
|
465 |
-
return false;
|
466 |
-
}
|
467 |
-
|
468 |
-
return true;
|
469 |
-
}
|
470 |
-
|
471 |
-
public static function maybe_automigrate()
|
472 |
-
{
|
473 |
-
global $gfpdfe_data;
|
474 |
-
self::check_filesystem_api();
|
475 |
-
|
476 |
-
if ($gfpdfe_data->automated === true) {
|
477 |
-
update_option('gfpdfe_automated_install', 'installing');
|
478 |
-
self::run_template_migration();
|
479 |
-
|
480 |
-
return true;
|
481 |
-
}
|
482 |
-
|
483 |
-
return false;
|
484 |
-
}
|
485 |
-
|
486 |
-
/*
|
487 |
-
* Check if the new PDF_TEMPLATE_LOCATION (v.3.6 mod) has been made switched
|
488 |
-
* If it has then prompt the user to move the files
|
489 |
-
*/
|
490 |
-
public static function check_template_migration()
|
491 |
-
{
|
492 |
-
global $gfpdfe_data;
|
493 |
-
|
494 |
-
if (is_dir($gfpdfe_data->old_template_location) || is_dir($gfpdfe_data->old_3_6_template_site_location)) {/* add in 3.6 directory change */
|
495 |
-
if (!self::maybe_automigrate()) {
|
496 |
-
/*
|
497 |
-
* Add admin notification hook to move the files
|
498 |
-
*/
|
499 |
-
add_action($gfpdfe_data->notice_type, array('GFPDF_Notices', 'do_template_switch_notice'));
|
500 |
-
|
501 |
-
return true;
|
502 |
-
}
|
503 |
-
}
|
504 |
-
|
505 |
-
return false;
|
506 |
-
}
|
507 |
-
|
508 |
-
public static function run_template_migration()
|
509 |
-
{
|
510 |
-
global $gfpdfe_data;
|
511 |
-
|
512 |
-
if (is_multisite() && is_super_admin()) {
|
513 |
-
$return = self::run_multisite_deployment(array('GFPDF_InstallUpdater', 'do_template_migration'));
|
514 |
-
GFPDF_Settings::$model->check_compatibility();
|
515 |
-
|
516 |
-
/* multisite mode */
|
517 |
-
if ($return === true) {
|
518 |
-
add_action($gfpdfe_data->notice_type, array('GFPDF_Notices', 'gf_pdf_migration_success'));
|
519 |
-
} elseif ($return === false) {
|
520 |
-
add_action($gfpdfe_data->notice_type, array('GFPDF_Notices', 'gf_pdf_merge_network_failure'));
|
521 |
-
}
|
522 |
-
|
523 |
-
return $return;
|
524 |
-
} else {
|
525 |
-
$return = self::do_template_migration();
|
526 |
-
GFPDF_Settings::$model->check_compatibility();
|
527 |
-
|
528 |
-
/* single site mode */
|
529 |
-
if ($return === true) {
|
530 |
-
add_action($gfpdfe_data->notice_type, array('GFPDF_Notices', 'gf_pdf_migration_success'));
|
531 |
-
|
532 |
-
return $return;
|
533 |
-
}
|
534 |
-
|
535 |
-
return $return;
|
536 |
-
}
|
537 |
-
}
|
538 |
-
|
539 |
-
/*
|
540 |
-
* The after_switch_theme hook is too early in the initialisation to use request_filesystem_credentials()
|
541 |
-
* so we have to call this function at a later inteval
|
542 |
-
*/
|
543 |
-
public static function do_template_migration()
|
544 |
-
{
|
545 |
-
/*
|
546 |
-
* Initialise the Wordpress Filesystem API
|
547 |
-
*/
|
548 |
-
if (PDF_Common::initialise_WP_filesystem_API(array(), 'gfpdfe_migrate') === false) {
|
549 |
-
return 'false';
|
550 |
-
}
|
551 |
-
|
552 |
-
/*
|
553 |
-
* If we got here we should have $wp_filesystem available
|
554 |
-
*/
|
555 |
-
global $wp_filesystem, $gfpdfe_data;
|
556 |
-
|
557 |
-
/*
|
558 |
-
* Convert paths for SSH/FTP users who are rooted to a directory along the server absolute path
|
559 |
-
*/
|
560 |
-
$base_template_directory = self::get_basedir($gfpdfe_data->template_location);
|
561 |
-
$current_pdf_path = self::get_basedir($gfpdfe_data->template_site_location);
|
562 |
-
|
563 |
-
if (is_dir($gfpdfe_data->old_template_location)) {
|
564 |
-
$previous_pdf_path = self::get_basedir($gfpdfe_data->old_template_location);
|
565 |
-
} elseif (is_dir($gfpdfe_data->old_3_6_template_site_location)) {
|
566 |
-
$previous_pdf_path = self::get_basedir($gfpdfe_data->old_3_6_template_site_location);
|
567 |
-
}
|
568 |
-
|
569 |
-
/* create the base template directory */
|
570 |
-
if (self::create_base_template_dir($base_template_directory) === false) {
|
571 |
-
return false;
|
572 |
-
}
|
573 |
-
|
574 |
-
/* create the site template directory */
|
575 |
-
if (self::create_site_template_dir($current_pdf_path) === false) {
|
576 |
-
return false;
|
577 |
-
}
|
578 |
-
|
579 |
-
if ($wp_filesystem->is_dir($previous_pdf_path)) {
|
580 |
-
if (is_dir($gfpdfe_data->old_template_location)) {
|
581 |
-
/* swap back to TRUE to delete the theme folder */
|
582 |
-
if(!self::pdf_extended_copy_directory($previous_pdf_path, $current_pdf_path, true, true, true)) {
|
583 |
-
return false;
|
584 |
-
}
|
585 |
-
|
586 |
-
} elseif (is_dir($gfpdfe_data->old_3_6_template_site_location)) {
|
587 |
-
/* swap back to TRUE to delete the theme folder */
|
588 |
-
if(!self::pdf_extended_copy_directory($previous_pdf_path, $current_pdf_path, true, false, true)) {
|
589 |
-
return false;
|
590 |
-
}
|
591 |
-
}
|
592 |
-
|
593 |
-
/*
|
594 |
-
* Clean up the DB
|
595 |
-
*/
|
596 |
-
delete_option('gfpdfe_automated_install');
|
597 |
-
}
|
598 |
-
|
599 |
-
return true;
|
600 |
-
}
|
601 |
-
|
602 |
-
/**
|
603 |
-
* Allows you to copy entire folder structures to new location
|
604 |
-
* @param String $source The source path that should be copied
|
605 |
-
* @param String $destination The destination path where the files should be copied to
|
606 |
-
* @param boolean $copy_base Whether to create the base directory at the destination
|
607 |
-
* @param boolean $delete_destination Whether to want to remove the destination before copying the files
|
608 |
-
* @param boolean $delete_source Once finished copying should we remove the source folder
|
609 |
-
*/
|
610 |
-
public static function pdf_extended_copy_directory($source, $destination, $copy_base = true, $delete_destination = false, $delete_source = false)
|
611 |
-
{
|
612 |
-
global $wp_filesystem;
|
613 |
-
|
614 |
-
/* ensure source and destination end in a forward slash */
|
615 |
-
if(substr($source, -1) != '/') {
|
616 |
-
$source .= '/';
|
617 |
-
}
|
618 |
-
|
619 |
-
if(substr($destination, -1) != '/') {
|
620 |
-
$destination .= '/';
|
621 |
-
}
|
622 |
-
|
623 |
-
if($wp_filesystem->is_dir($destination) && $wp_filesystem->is_writable($destination) === false)
|
624 |
-
{
|
625 |
-
return false;
|
626 |
-
}
|
627 |
-
|
628 |
-
if ($wp_filesystem->is_dir($source)) {
|
629 |
-
if ($delete_destination === true && $wp_filesystem->exists($destination) === true) {
|
630 |
-
/*
|
631 |
-
* To ensure everything stays in sync we will remove the destination file structure
|
632 |
-
*/
|
633 |
-
$wp_filesystem->delete($destination, true);
|
634 |
-
}
|
635 |
-
|
636 |
-
if ($copy_base === true && $wp_filesystem->exists($destination) === false) {
|
637 |
-
if(!$wp_filesystem->mkdir($destination)) {
|
638 |
-
return false;
|
639 |
-
}
|
640 |
-
}
|
641 |
-
$directory = $wp_filesystem->dirlist($source);
|
642 |
-
|
643 |
-
foreach ($directory as $name => $data) {
|
644 |
-
$PathDir = $source.$name;
|
645 |
-
|
646 |
-
if ($wp_filesystem->is_dir($PathDir) === true) {
|
647 |
-
if(!self::pdf_extended_copy_directory($PathDir, $destination.$name)) {
|
648 |
-
return false;
|
649 |
-
}
|
650 |
-
continue;
|
651 |
-
}
|
652 |
-
$wp_filesystem->copy($PathDir, $destination.$name);
|
653 |
-
|
654 |
-
/* verify the file copied correctly */
|
655 |
-
if($wp_filesystem->is_file($destination.$name) === false || $wp_filesystem->size($PathDir) != $wp_filesystem->size($destination.$name)) {
|
656 |
-
return false;
|
657 |
-
}
|
658 |
-
}
|
659 |
-
} else {
|
660 |
-
$wp_filesystem->copy($source, $destination);
|
661 |
-
/* verify the file copied correctly */
|
662 |
-
if($wp_filesystem->is_file($destination) === false || $wp_filesystem->size($source) != $wp_filesystem->size($destination)) {
|
663 |
-
return false;
|
664 |
-
}
|
665 |
-
}
|
666 |
-
|
667 |
-
if ($delete_source) {
|
668 |
-
if($wp_filesystem->delete($source, true) === false) {
|
669 |
-
return false;
|
670 |
-
}
|
671 |
-
}
|
672 |
-
|
673 |
-
return true;
|
674 |
-
}
|
675 |
-
}
|
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.
|
8 |
+
*/
|
9 |
+
|
10 |
+
/*
|
11 |
+
This file is part of Gravity PDF.
|
12 |
+
|
13 |
+
Gravity PDF Copyright (C) 2015 Blue Liquid Designs
|
14 |
+
|
15 |
+
This program is free software; you can redistribute it and/or modify
|
16 |
+
it under the terms of the GNU General Public License as published by
|
17 |
+
the Free Software Foundation; either version 2 of the License, or
|
18 |
+
(at your option) any later version.
|
19 |
+
|
20 |
+
This program is distributed in the hope that it will be useful,
|
21 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
22 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
23 |
+
GNU General Public License for more details.
|
24 |
+
|
25 |
+
You should have received a copy of the GNU General Public License
|
26 |
+
along with this program; if not, write to the Free Software
|
27 |
+
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
28 |
+
*/
|
29 |
+
|
30 |
+
class GFPDF_InstallUpdater
|
31 |
+
{
|
32 |
+
|
33 |
+
public static function check_filesystem_api()
|
34 |
+
{
|
35 |
+
global $gfpdfe_data;
|
36 |
+
$access_type = get_filesystem_method();
|
37 |
+
|
38 |
+
$gfpdfe_data->automated = false;
|
39 |
+
if ($access_type === 'direct') {
|
40 |
+
$gfpdfe_data->automated = true;
|
41 |
+
}
|
42 |
+
}
|
43 |
+
|
44 |
+
/*
|
45 |
+
* Check if we can automatically deploy the software
|
46 |
+
* We use WP Filesystem API to initialise.
|
47 |
+
* Check if we have direct write control to the filesystem. If so, automatically deploy
|
48 |
+
* without asking the user. This will make upgrades much simplier.
|
49 |
+
*/
|
50 |
+
public static function maybe_deploy()
|
51 |
+
{
|
52 |
+
global $gfpdfe_data;
|
53 |
+
/*
|
54 |
+
* Check if we have a 'direct' method, that the software isn't fully installed and we aren't trying to manually initialise
|
55 |
+
*/
|
56 |
+
|
57 |
+
if ($gfpdfe_data->automated === true && $gfpdfe_data->is_initialised === false && !rgpost('upgrade') && get_option('gfpdfe_automated_install') != 'installing') {
|
58 |
+
/*
|
59 |
+
* Initialise all multisites if a super admin is logged in
|
60 |
+
*/
|
61 |
+
if (is_multisite() && is_super_admin()) {
|
62 |
+
$results = GFPDF_InstallUpdater::run_multisite_deployment(array('GFPDF_InstallUpdater', 'do_deploy'));
|
63 |
+
|
64 |
+
if ($results === true) {
|
65 |
+
add_action($gfpdfe_data->notice_type, array('GFPDF_Notices', 'gf_pdf_network_deploy_success'));
|
66 |
+
} elseif ($results === false) {
|
67 |
+
add_action($gfpdfe_data->notice_type, array('GFPDF_Notices', 'gf_pdf_auto_deploy_network_failure'));
|
68 |
+
}
|
69 |
+
|
70 |
+
return $results;
|
71 |
+
} else {
|
72 |
+
if (self::do_deploy()) {
|
73 |
+
/*
|
74 |
+
* Output successfull automated installation message
|
75 |
+
*/
|
76 |
+
add_action($gfpdfe_data->notice_type, array('GFPDF_Notices', 'gf_pdf_auto_deploy_success'));
|
77 |
+
}
|
78 |
+
}
|
79 |
+
}
|
80 |
+
}
|
81 |
+
|
82 |
+
/*
|
83 |
+
* Initialise all multsites in one fowl swoop
|
84 |
+
*/
|
85 |
+
public static function run_multisite_deployment($action)
|
86 |
+
{
|
87 |
+
global $gfpdfe_data;
|
88 |
+
|
89 |
+
/* add additional check incase someone doesn't call this correctly */
|
90 |
+
if (!is_multisite() || !is_super_admin()) {
|
91 |
+
return false;
|
92 |
+
}
|
93 |
+
|
94 |
+
/*
|
95 |
+
* Get multisites which aren't deleted
|
96 |
+
*/
|
97 |
+
$sites = wp_get_sites(array('deleted' => 0));
|
98 |
+
|
99 |
+
if (sizeof($sites) > 0) {
|
100 |
+
$problem = array();
|
101 |
+
foreach ($sites as $site) {
|
102 |
+
switch_to_blog((int) $site['blog_id']);
|
103 |
+
|
104 |
+
/*
|
105 |
+
* Reset the directory structure
|
106 |
+
*/
|
107 |
+
$gfpdfe_data->set_directory_structure();
|
108 |
+
|
109 |
+
/*
|
110 |
+
* Test if the blog has gravity forms and PDF Extended active
|
111 |
+
* If so, we can initialise
|
112 |
+
*/
|
113 |
+
$gravityforms = 'gravityforms/gravityforms.php'; /* have to hardcode the folder name as they don't set it in a constant or variable */
|
114 |
+
$pdfextended = GF_PDF_EXTENDED_PLUGIN_BASENAME; /* no need to hardcode the basename here */
|
115 |
+
|
116 |
+
if ((is_plugin_active_for_network($gravityforms) && is_plugin_active_for_network($pdfextended)) ||
|
117 |
+
(is_plugin_active($gravityforms) && is_plugin_active($pdfextended))
|
118 |
+
) {
|
119 |
+
/* run our deployment and output any problems */
|
120 |
+
$deploy = call_user_func($action);
|
121 |
+
if ($deploy === false) {
|
122 |
+
$problem[] = $site;
|
123 |
+
} elseif ($deploy === 'false') {
|
124 |
+
/*
|
125 |
+
* Asking for the access details so we can write to the server
|
126 |
+
* Exit early
|
127 |
+
*/
|
128 |
+
return $deploy;
|
129 |
+
}
|
130 |
+
}
|
131 |
+
restore_current_blog();
|
132 |
+
|
133 |
+
/*
|
134 |
+
* Reset the directory structure
|
135 |
+
*/
|
136 |
+
$gfpdfe_data->set_directory_structure();
|
137 |
+
}
|
138 |
+
|
139 |
+
if (sizeof($problem) > 0) {
|
140 |
+
$gfpdfe_data->network_error = $problem;
|
141 |
+
|
142 |
+
return false;
|
143 |
+
}
|
144 |
+
|
145 |
+
return true;
|
146 |
+
}
|
147 |
+
}
|
148 |
+
|
149 |
+
/*
|
150 |
+
* Used to automatically deploy the software
|
151 |
+
* Regular initialisation (via the settings page) will call pdf_extended_activate() directly.
|
152 |
+
*/
|
153 |
+
public static function do_deploy()
|
154 |
+
{
|
155 |
+
update_option('gfpdfe_automated_install', 'installing');
|
156 |
+
|
157 |
+
return self::pdf_extended_activate();
|
158 |
+
}
|
159 |
+
|
160 |
+
/*
|
161 |
+
* Different filesystems (FTP/SSH) might have a different ABSPATH than the 'direct' method
|
162 |
+
* due to being rooted to a specific folder.
|
163 |
+
* The $wp_filesystem->abspath() corrects this behaviour.
|
164 |
+
*/
|
165 |
+
private static function get_basedir($path)
|
166 |
+
{
|
167 |
+
global $wp_filesystem;
|
168 |
+
|
169 |
+
return str_replace(ABSPATH, $wp_filesystem->abspath(), $path);
|
170 |
+
}
|
171 |
+
|
172 |
+
/**
|
173 |
+
* Install everything required
|
174 |
+
*/
|
175 |
+
public static function pdf_extended_activate()
|
176 |
+
{
|
177 |
+
/*
|
178 |
+
* Initialise the Wordpress Filesystem API
|
179 |
+
*/
|
180 |
+
if (PDF_Common::initialise_WP_filesystem_API(array('gfpdf_deploy', 'overwrite'), 'pdf-extended-filesystem') === false) {
|
181 |
+
return 'false';
|
182 |
+
}
|
183 |
+
|
184 |
+
/*
|
185 |
+
* If we got here we should have $wp_filesystem available
|
186 |
+
*/
|
187 |
+
global $wp_filesystem, $gfpdfe_data;
|
188 |
+
|
189 |
+
/*
|
190 |
+
* Set the correct paths
|
191 |
+
* FTP and SSH could be rooted to the wordpress base directory
|
192 |
+
* use $wp_filesystem->abspath(); function to fix any issues
|
193 |
+
*/
|
194 |
+
$directory = self::get_basedir(PDF_PLUGIN_DIR);
|
195 |
+
$base_template_directory = self::get_basedir($gfpdfe_data->template_location);
|
196 |
+
$template_directory = self::get_basedir($gfpdfe_data->template_site_location);
|
197 |
+
$template_save_directory = self::get_basedir($gfpdfe_data->template_save_location);
|
198 |
+
$template_font_directory = self::get_basedir($gfpdfe_data->template_font_location);
|
199 |
+
|
200 |
+
/**
|
201 |
+
* If template directory already exists then we will remove the old template files so we can redeploy the new ones
|
202 |
+
*/
|
203 |
+
self::reinitialise_templates($template_directory);
|
204 |
+
|
205 |
+
/* create new directory in uploads folder*/
|
206 |
+
if (self::create_base_template_dir($base_template_directory) === false) {
|
207 |
+
return false;
|
208 |
+
}
|
209 |
+
|
210 |
+
/* create site directory in base template directory */
|
211 |
+
if (self::create_site_template_dir($template_directory) === false) {
|
212 |
+
return false;
|
213 |
+
}
|
214 |
+
|
215 |
+
/* create 'save' output folder */
|
216 |
+
if (self::create_save_dir($template_save_directory) === false) {
|
217 |
+
return false;
|
218 |
+
}
|
219 |
+
|
220 |
+
/* create 'font' folder */
|
221 |
+
if (self::create_font_dir($template_font_directory) === false) {
|
222 |
+
return false;
|
223 |
+
}
|
224 |
+
|
225 |
+
/* copy entire template folder over to the template directory */
|
226 |
+
if(!self::pdf_extended_copy_directory($directory . 'initialisation/templates/', $template_directory, false)) {
|
227 |
+
return false;
|
228 |
+
}
|
229 |
+
|
230 |
+
/* copy configuration file over to new directory */
|
231 |
+
if (self::create_configuration_file($directory, $template_directory) === false) {
|
232 |
+
return false;
|
233 |
+
}
|
234 |
+
|
235 |
+
/* create .htaccess file */
|
236 |
+
if (self::create_htaccess_file($template_save_directory) === false) {
|
237 |
+
return false;
|
238 |
+
}
|
239 |
+
|
240 |
+
/* initialise font directory */
|
241 |
+
if (self::install_fonts($directory, $template_directory, $template_font_directory) !== true) {
|
242 |
+
return false;
|
243 |
+
}
|
244 |
+
|
245 |
+
/* update db to ensure everything is installed correctly. */
|
246 |
+
self::db_init();
|
247 |
+
|
248 |
+
return true;
|
249 |
+
}
|
250 |
+
|
251 |
+
public static function reinitialise_templates($template_directory)
|
252 |
+
{
|
253 |
+
global $wp_filesystem, $gfpdfe_data;
|
254 |
+
|
255 |
+
if ($wp_filesystem->exists($template_directory) && isset($_POST['overwrite'])) {
|
256 |
+
/*
|
257 |
+
* Create a backup folder and move all the files there
|
258 |
+
*/
|
259 |
+
$backup_folder = 'INIT_BACKUP_'.date('Y-m-d_G-i').'/';
|
260 |
+
$do_backup = false;
|
261 |
+
if ($wp_filesystem->mkdir($template_directory.$backup_folder)) {
|
262 |
+
$do_backup = true;
|
263 |
+
}
|
264 |
+
|
265 |
+
/* read all file names into array and unlink from active theme template folder */
|
266 |
+
foreach (glob(PDF_PLUGIN_DIR.'initialisation/templates/*') as $file) {
|
267 |
+
$path_parts = pathinfo($file);
|
268 |
+
if ($wp_filesystem->exists($template_directory.$path_parts['basename'])) {
|
269 |
+
if (!$do_backup) {
|
270 |
+
$wp_filesystem->delete($template_directory.$path_parts['basename']);
|
271 |
+
continue;
|
272 |
+
}
|
273 |
+
$wp_filesystem->move($template_directory.$path_parts['basename'], $template_directory.$backup_folder.$path_parts['basename']);
|
274 |
+
}
|
275 |
+
}
|
276 |
+
}
|
277 |
+
}
|
278 |
+
|
279 |
+
public static function create_base_template_dir($base_template_directory)
|
280 |
+
{
|
281 |
+
global $wp_filesystem, $gfpdfe_data;
|
282 |
+
|
283 |
+
/* create new directory in uploads folder*/
|
284 |
+
if (!$wp_filesystem->is_dir($base_template_directory)) {
|
285 |
+
if ($wp_filesystem->mkdir($base_template_directory) === false) {
|
286 |
+
/*
|
287 |
+
* TODO: add correct notices
|
288 |
+
*/
|
289 |
+
add_action($gfpdfe_data->notice_type, array('GFPDF_Notices', 'gf_pdf_template_dir_err'));
|
290 |
+
|
291 |
+
return false;
|
292 |
+
}
|
293 |
+
}
|
294 |
+
|
295 |
+
return true;
|
296 |
+
}
|
297 |
+
|
298 |
+
public static function create_site_template_dir($template_directory)
|
299 |
+
{
|
300 |
+
global $wp_filesystem, $gfpdfe_data;
|
301 |
+
|
302 |
+
if (!$wp_filesystem->is_dir($template_directory)) {
|
303 |
+
if ($wp_filesystem->mkdir($template_directory) === false) {
|
304 |
+
add_action($gfpdfe_data->notice_type, array('GFPDF_Notices', 'gf_pdf_template_site_dir_err'));
|
305 |
+
|
306 |
+
return false;
|
307 |
+
}
|
308 |
+
}
|
309 |
+
|
310 |
+
return true;
|
311 |
+
}
|
312 |
+
|
313 |
+
public static function create_save_dir($template_save_directory)
|
314 |
+
{
|
315 |
+
global $wp_filesystem, $gfpdfe_data;
|
316 |
+
|
317 |
+
if (!$wp_filesystem->is_dir($template_save_directory)) {
|
318 |
+
/* create new directory in active themes folder*/
|
319 |
+
if ($wp_filesystem->mkdir($template_save_directory) === false) {
|
320 |
+
add_action($gfpdfe_data->notice_type, array('GFPDF_Notices', 'gf_pdf_template_dir_err'));
|
321 |
+
|
322 |
+
return false;
|
323 |
+
}
|
324 |
+
}
|
325 |
+
|
326 |
+
return true;
|
327 |
+
}
|
328 |
+
|
329 |
+
public static function create_font_dir($template_font_directory)
|
330 |
+
{
|
331 |
+
global $wp_filesystem, $gfpdfe_data;
|
332 |
+
|
333 |
+
if (!$wp_filesystem->is_dir($template_font_directory)) {
|
334 |
+
/* create new directory in active themes folder*/
|
335 |
+
if ($wp_filesystem->mkdir($template_font_directory) === false) {
|
336 |
+
add_action($gfpdfe_data->notice_type, array('GFPDF_Notices', 'gf_pdf_template_dir_err'));
|
337 |
+
|
338 |
+
return false;
|
339 |
+
}
|
340 |
+
}
|
341 |
+
|
342 |
+
return true;
|
343 |
+
}
|
344 |
+
|
345 |
+
/**
|
346 |
+
* Copy configuration file to template folder
|
347 |
+
* @param String $directory The $wp_filesystem path to the plugin folder
|
348 |
+
* @param String $template_directory The $wp_filesystem path to the template folder
|
349 |
+
* @return Boolean Success on true (or not run at all). false on fail
|
350 |
+
*/
|
351 |
+
public static function create_configuration_file($directory, $template_directory)
|
352 |
+
{
|
353 |
+
global $wp_filesystem, $gfpdfe_data;
|
354 |
+
|
355 |
+
if (!$wp_filesystem->exists($template_directory.'configuration.php')) {
|
356 |
+
/* copy template files to new directory */
|
357 |
+
if (!$wp_filesystem->copy($directory.'initialisation/configuration.php.example', $template_directory.'configuration.php')) {
|
358 |
+
add_action($gfpdfe_data->notice_type, array('GFPDF_Notices', 'gf_pdf_template_dir_err'));
|
359 |
+
|
360 |
+
return false;
|
361 |
+
}
|
362 |
+
}
|
363 |
+
|
364 |
+
return true;
|
365 |
+
}
|
366 |
+
|
367 |
+
/**
|
368 |
+
* Create htaccess file to prevent direct access to PDFs
|
369 |
+
* @param String $template_save_directory The $wp_filesystem path to the save directory
|
370 |
+
* @return Boolean success on true (or not run at all). false on fail
|
371 |
+
*/
|
372 |
+
public static function create_htaccess_file($template_save_directory)
|
373 |
+
{
|
374 |
+
global $wp_filesystem, $gfpdfe_data;
|
375 |
+
|
376 |
+
if (!$wp_filesystem->exists($template_save_directory.'.htaccess')) {
|
377 |
+
if (!$wp_filesystem->put_contents($template_save_directory.'.htaccess', 'deny from all')) {
|
378 |
+
add_action($gfpdfe_data->notice_type, array('GFPDF_Notices', 'gf_pdf_template_dir_err'));
|
379 |
+
|
380 |
+
return false;
|
381 |
+
}
|
382 |
+
}
|
383 |
+
|
384 |
+
return true;
|
385 |
+
}
|
386 |
+
|
387 |
+
/*
|
388 |
+
* Normalize the database options related to initialisation
|
389 |
+
*/
|
390 |
+
public static function db_init()
|
391 |
+
{
|
392 |
+
global $gfpdfe_data;
|
393 |
+
|
394 |
+
update_option('gf_pdf_extended_installed', 'installed');
|
395 |
+
delete_option('gfpdfe_automated_install');
|
396 |
+
GFPDF_Settings::$model->check_compatibility();
|
397 |
+
}
|
398 |
+
|
399 |
+
public static function initialise_fonts()
|
400 |
+
{
|
401 |
+
/*
|
402 |
+
* Initialise the Wordpress Filesystem API
|
403 |
+
*/
|
404 |
+
if (PDF_Common::initialise_WP_filesystem_API(array('gfpdf_deploy', 'font-initialise', 'gfpdf_deploy_nonce'), 'pdf-extended-fonts') === false) {
|
405 |
+
return false;
|
406 |
+
}
|
407 |
+
|
408 |
+
/*
|
409 |
+
* If we got here we should have $wp_filesystem available
|
410 |
+
*/
|
411 |
+
global $wp_filesystem, $gfpdfe_data;
|
412 |
+
|
413 |
+
/*
|
414 |
+
* We need to set up some filesystem compatibility checkes to work with the different server file management types
|
415 |
+
* Most notably is the FTP options, but SSH may be effected too
|
416 |
+
*/
|
417 |
+
$directory = self::get_basedir(PDF_PLUGIN_DIR);
|
418 |
+
$template_directory = self::get_basedir($gfpdfe_data->template_site_location);
|
419 |
+
$template_font_directory = self::get_basedir($gfpdfe_data->template_font_location);
|
420 |
+
|
421 |
+
if (self::install_fonts($directory, $template_directory, $template_font_directory) === true) {
|
422 |
+
add_action($gfpdfe_data->notice_type, array('GFPDF_Notices', 'gf_pdf_font_install_success'));
|
423 |
+
}
|
424 |
+
|
425 |
+
return true;
|
426 |
+
}
|
427 |
+
|
428 |
+
private static function install_fonts($directory, $template_directory, $fonts_location)
|
429 |
+
{
|
430 |
+
global $wp_filesystem, $gfpdfe_data;
|
431 |
+
$write_to_file = '<?php
|
432 |
+
|
433 |
+
if(!defined("PDF_EXTENDED_VERSION"))
|
434 |
+
{
|
435 |
+
return;
|
436 |
+
}
|
437 |
+
|
438 |
+
';
|
439 |
+
|
440 |
+
/*
|
441 |
+
* Search the font folder for .ttf files. If found, move them to the mPDF font folder
|
442 |
+
* and write the configuration file
|
443 |
+
*/
|
444 |
+
|
445 |
+
/* read all file names into array and unlink from active theme template folder */
|
446 |
+
foreach (glob($gfpdfe_data->template_font_location.'/*.[tT][tT][fF]') as $file) {
|
447 |
+
$path_parts = pathinfo($file);
|
448 |
+
|
449 |
+
/*
|
450 |
+
* Generate configuration information in preparation to write to file
|
451 |
+
*/
|
452 |
+
$write_to_file .= '
|
453 |
+
$this->fontdata[\''.mb_strtolower(str_replace(' ', '', $path_parts['filename']), 'UTF-8').'\'] = array(
|
454 |
+
\'R\' => \''.$path_parts['basename'].'\'
|
455 |
+
);';
|
456 |
+
}
|
457 |
+
|
458 |
+
/*
|
459 |
+
* Remove the old configuration file and put the contents of $write_to_file in a font configuration file
|
460 |
+
*/
|
461 |
+
$wp_filesystem->delete($template_directory.'fonts/config.php');
|
462 |
+
if ($wp_filesystem->put_contents($template_directory.'fonts/config.php', $write_to_file) === false) {
|
463 |
+
add_action($gfpdfe_data->notice_type, array('GFPDF_Notices', 'gf_pdf_font_config_err'));
|
464 |
+
|
465 |
+
return false;
|
466 |
+
}
|
467 |
+
|
468 |
+
return true;
|
469 |
+
}
|
470 |
+
|
471 |
+
public static function maybe_automigrate()
|
472 |
+
{
|
473 |
+
global $gfpdfe_data;
|
474 |
+
self::check_filesystem_api();
|
475 |
+
|
476 |
+
if ($gfpdfe_data->automated === true) {
|
477 |
+
update_option('gfpdfe_automated_install', 'installing');
|
478 |
+
self::run_template_migration();
|
479 |
+
|
480 |
+
return true;
|
481 |
+
}
|
482 |
+
|
483 |
+
return false;
|
484 |
+
}
|
485 |
+
|
486 |
+
/*
|
487 |
+
* Check if the new PDF_TEMPLATE_LOCATION (v.3.6 mod) has been made switched
|
488 |
+
* If it has then prompt the user to move the files
|
489 |
+
*/
|
490 |
+
public static function check_template_migration()
|
491 |
+
{
|
492 |
+
global $gfpdfe_data;
|
493 |
+
|
494 |
+
if (is_dir($gfpdfe_data->old_template_location) || is_dir($gfpdfe_data->old_3_6_template_site_location)) {/* add in 3.6 directory change */
|
495 |
+
if (!self::maybe_automigrate()) {
|
496 |
+
/*
|
497 |
+
* Add admin notification hook to move the files
|
498 |
+
*/
|
499 |
+
add_action($gfpdfe_data->notice_type, array('GFPDF_Notices', 'do_template_switch_notice'));
|
500 |
+
|
501 |
+
return true;
|
502 |
+
}
|
503 |
+
}
|
504 |
+
|
505 |
+
return false;
|
506 |
+
}
|
507 |
+
|
508 |
+
public static function run_template_migration()
|
509 |
+
{
|
510 |
+
global $gfpdfe_data;
|
511 |
+
|
512 |
+
if (is_multisite() && is_super_admin()) {
|
513 |
+
$return = self::run_multisite_deployment(array('GFPDF_InstallUpdater', 'do_template_migration'));
|
514 |
+
GFPDF_Settings::$model->check_compatibility();
|
515 |
+
|
516 |
+
/* multisite mode */
|
517 |
+
if ($return === true) {
|
518 |
+
add_action($gfpdfe_data->notice_type, array('GFPDF_Notices', 'gf_pdf_migration_success'));
|
519 |
+
} elseif ($return === false) {
|
520 |
+
add_action($gfpdfe_data->notice_type, array('GFPDF_Notices', 'gf_pdf_merge_network_failure'));
|
521 |
+
}
|
522 |
+
|
523 |
+
return $return;
|
524 |
+
} else {
|
525 |
+
$return = self::do_template_migration();
|
526 |
+
GFPDF_Settings::$model->check_compatibility();
|
527 |
+
|
528 |
+
/* single site mode */
|
529 |
+
if ($return === true) {
|
530 |
+
add_action($gfpdfe_data->notice_type, array('GFPDF_Notices', 'gf_pdf_migration_success'));
|
531 |
+
|
532 |
+
return $return;
|
533 |
+
}
|
534 |
+
|
535 |
+
return $return;
|
536 |
+
}
|
537 |
+
}
|
538 |
+
|
539 |
+
/*
|
540 |
+
* The after_switch_theme hook is too early in the initialisation to use request_filesystem_credentials()
|
541 |
+
* so we have to call this function at a later inteval
|
542 |
+
*/
|
543 |
+
public static function do_template_migration()
|
544 |
+
{
|
545 |
+
/*
|
546 |
+
* Initialise the Wordpress Filesystem API
|
547 |
+
*/
|
548 |
+
if (PDF_Common::initialise_WP_filesystem_API(array(), 'gfpdfe_migrate') === false) {
|
549 |
+
return 'false';
|
550 |
+
}
|
551 |
+
|
552 |
+
/*
|
553 |
+
* If we got here we should have $wp_filesystem available
|
554 |
+
*/
|
555 |
+
global $wp_filesystem, $gfpdfe_data;
|
556 |
+
|
557 |
+
/*
|
558 |
+
* Convert paths for SSH/FTP users who are rooted to a directory along the server absolute path
|
559 |
+
*/
|
560 |
+
$base_template_directory = self::get_basedir($gfpdfe_data->template_location);
|
561 |
+
$current_pdf_path = self::get_basedir($gfpdfe_data->template_site_location);
|
562 |
+
|
563 |
+
if (is_dir($gfpdfe_data->old_template_location)) {
|
564 |
+
$previous_pdf_path = self::get_basedir($gfpdfe_data->old_template_location);
|
565 |
+
} elseif (is_dir($gfpdfe_data->old_3_6_template_site_location)) {
|
566 |
+
$previous_pdf_path = self::get_basedir($gfpdfe_data->old_3_6_template_site_location);
|
567 |
+
}
|
568 |
+
|
569 |
+
/* create the base template directory */
|
570 |
+
if (self::create_base_template_dir($base_template_directory) === false) {
|
571 |
+
return false;
|
572 |
+
}
|
573 |
+
|
574 |
+
/* create the site template directory */
|
575 |
+
if (self::create_site_template_dir($current_pdf_path) === false) {
|
576 |
+
return false;
|
577 |
+
}
|
578 |
+
|
579 |
+
if ($wp_filesystem->is_dir($previous_pdf_path)) {
|
580 |
+
if (is_dir($gfpdfe_data->old_template_location)) {
|
581 |
+
/* swap back to TRUE to delete the theme folder */
|
582 |
+
if(!self::pdf_extended_copy_directory($previous_pdf_path, $current_pdf_path, true, true, true)) {
|
583 |
+
return false;
|
584 |
+
}
|
585 |
+
|
586 |
+
} elseif (is_dir($gfpdfe_data->old_3_6_template_site_location)) {
|
587 |
+
/* swap back to TRUE to delete the theme folder */
|
588 |
+
if(!self::pdf_extended_copy_directory($previous_pdf_path, $current_pdf_path, true, false, true)) {
|
589 |
+
return false;
|
590 |
+
}
|
591 |
+
}
|
592 |
+
|
593 |
+
/*
|
594 |
+
* Clean up the DB
|
595 |
+
*/
|
596 |
+
delete_option('gfpdfe_automated_install');
|
597 |
+
}
|
598 |
+
|
599 |
+
return true;
|
600 |
+
}
|
601 |
+
|
602 |
+
/**
|
603 |
+
* Allows you to copy entire folder structures to new location
|
604 |
+
* @param String $source The source path that should be copied
|
605 |
+
* @param String $destination The destination path where the files should be copied to
|
606 |
+
* @param boolean $copy_base Whether to create the base directory at the destination
|
607 |
+
* @param boolean $delete_destination Whether to want to remove the destination before copying the files
|
608 |
+
* @param boolean $delete_source Once finished copying should we remove the source folder
|
609 |
+
*/
|
610 |
+
public static function pdf_extended_copy_directory($source, $destination, $copy_base = true, $delete_destination = false, $delete_source = false)
|
611 |
+
{
|
612 |
+
global $wp_filesystem;
|
613 |
+
|
614 |
+
/* ensure source and destination end in a forward slash */
|
615 |
+
if(substr($source, -1) != '/') {
|
616 |
+
$source .= '/';
|
617 |
+
}
|
618 |
+
|
619 |
+
if(substr($destination, -1) != '/') {
|
620 |
+
$destination .= '/';
|
621 |
+
}
|
622 |
+
|
623 |
+
if($wp_filesystem->is_dir($destination) && $wp_filesystem->is_writable($destination) === false)
|
624 |
+
{
|
625 |
+
return false;
|
626 |
+
}
|
627 |
+
|
628 |
+
if ($wp_filesystem->is_dir($source)) {
|
629 |
+
if ($delete_destination === true && $wp_filesystem->exists($destination) === true) {
|
630 |
+
/*
|
631 |
+
* To ensure everything stays in sync we will remove the destination file structure
|
632 |
+
*/
|
633 |
+
$wp_filesystem->delete($destination, true);
|
634 |
+
}
|
635 |
+
|
636 |
+
if ($copy_base === true && $wp_filesystem->exists($destination) === false) {
|
637 |
+
if(!$wp_filesystem->mkdir($destination)) {
|
638 |
+
return false;
|
639 |
+
}
|
640 |
+
}
|
641 |
+
$directory = $wp_filesystem->dirlist($source);
|
642 |
+
|
643 |
+
foreach ($directory as $name => $data) {
|
644 |
+
$PathDir = $source.$name;
|
645 |
+
|
646 |
+
if ($wp_filesystem->is_dir($PathDir) === true) {
|
647 |
+
if(!self::pdf_extended_copy_directory($PathDir, $destination.$name)) {
|
648 |
+
return false;
|
649 |
+
}
|
650 |
+
continue;
|
651 |
+
}
|
652 |
+
$wp_filesystem->copy($PathDir, $destination.$name);
|
653 |
+
|
654 |
+
/* verify the file copied correctly */
|
655 |
+
if($wp_filesystem->is_file($destination.$name) === false || $wp_filesystem->size($PathDir) != $wp_filesystem->size($destination.$name)) {
|
656 |
+
return false;
|
657 |
+
}
|
658 |
+
}
|
659 |
+
} else {
|
660 |
+
$wp_filesystem->copy($source, $destination);
|
661 |
+
/* verify the file copied correctly */
|
662 |
+
if($wp_filesystem->is_file($destination) === false || $wp_filesystem->size($source) != $wp_filesystem->size($destination)) {
|
663 |
+
return false;
|
664 |
+
}
|
665 |
+
}
|
666 |
+
|
667 |
+
if ($delete_source) {
|
668 |
+
if($wp_filesystem->delete($source, true) === false) {
|
669 |
+
return false;
|
670 |
+
}
|
671 |
+
}
|
672 |
+
|
673 |
+
return true;
|
674 |
+
}
|
675 |
+
}
|
helper/notices.php
CHANGED
@@ -1,396 +1,396 @@
|
|
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 |
-
/*
|
11 |
-
This file is part of Gravity PDF.
|
12 |
-
|
13 |
-
Gravity PDF Copyright (C) 2015 Blue Liquid Designs
|
14 |
-
|
15 |
-
This program is free software; you can redistribute it and/or modify
|
16 |
-
it under the terms of the GNU General Public License as published by
|
17 |
-
the Free Software Foundation; either version 2 of the License, or
|
18 |
-
(at your option) any later version.
|
19 |
-
|
20 |
-
This program is distributed in the hope that it will be useful,
|
21 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
22 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
23 |
-
GNU General Public License for more details.
|
24 |
-
|
25 |
-
You should have received a copy of the GNU General Public License
|
26 |
-
along with this program; if not, write to the Free Software
|
27 |
-
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
28 |
-
*/
|
29 |
-
|
30 |
-
class GFPDF_Notices
|
31 |
-
{
|
32 |
-
/*
|
33 |
-
* Admin notice template
|
34 |
-
*/
|
35 |
-
private static function message($text, $type = 'updated')
|
36 |
-
{
|
37 |
-
?>
|
38 |
-
<div id="message" class="<?php echo $type; ?>">
|
39 |
-
<p>
|
40 |
-
<?php echo $text; ?>
|
41 |
-
</p>
|
42 |
-
</div>
|
43 |
-
<?php
|
44 |
-
}
|
45 |
-
|
46 |
-
/*
|
47 |
-
* Output the update notice
|
48 |
-
*/
|
49 |
-
private static function notice($text)
|
50 |
-
{
|
51 |
-
self::message($text);
|
52 |
-
}
|
53 |
-
|
54 |
-
/*
|
55 |
-
* Output the error notice
|
56 |
-
*/
|
57 |
-
private static function error($text)
|
58 |
-
{
|
59 |
-
self::message($text, 'error');
|
60 |
-
}
|
61 |
-
|
62 |
-
private static function display_plugin_message($message, $is_error = false){
|
63 |
-
|
64 |
-
$style = $is_error ? 'style="background-color: #ffebe8;"' : "";
|
65 |
-
|
66 |
-
echo '</tr><tr class="plugin-update-tr"><td colspan="5" class="plugin-update"><div class="update-message" ' . $style . '>' . $message . '</div></td>';
|
67 |
-
}
|
68 |
-
|
69 |
-
private static function autoprefix()
|
70 |
-
{
|
71 |
-
global $gfpdfe_data;
|
72 |
-
if($gfpdfe_data->automated === true && !rgpost('upgrade') && !rgpost('font-initialise'))
|
73 |
-
{
|
74 |
-
return sprintf(__('%sGravity PDF Automated Installer%s: ', 'pdfextended'), '<strong>', '</strong>');
|
75 |
-
}
|
76 |
-
return '';
|
77 |
-
}
|
78 |
-
|
79 |
-
private static function autosuffix()
|
80 |
-
{
|
81 |
-
global $gfpdfe_data;
|
82 |
-
if($gfpdfe_data->automated === true && !rgpost('upgrade') && !rgpost('font-initialise'))
|
83 |
-
{
|
84 |
-
return sprintf(__(' %sGo to installer%s.', 'pdfextended'), '<a href="'. PDF_SETTINGS_URL .'">', '</a>');
|
85 |
-
}
|
86 |
-
return '';
|
87 |
-
}
|
88 |
-
|
89 |
-
public static function gf_pdf_font_install_success()
|
90 |
-
{
|
91 |
-
$prefix = self::autoprefix();
|
92 |
-
$suffix = self::autosuffix();
|
93 |
-
|
94 |
-
$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;
|
95 |
-
|
96 |
-
self::notice($msg);
|
97 |
-
|
98 |
-
}
|
99 |
-
|
100 |
-
public static function gf_pdf_font_config_err()
|
101 |
-
{
|
102 |
-
$prefix = self::autoprefix();
|
103 |
-
$suffix = self::autosuffix();
|
104 |
-
|
105 |
-
$msg = $prefix . __('Could not create font configuration file. Try initialise again.', 'pdfextended') . $suffix;
|
106 |
-
|
107 |
-
self::error($msg);
|
108 |
-
|
109 |
-
}
|
110 |
-
|
111 |
-
/**
|
112 |
-
* The software has detected a problem (no configuration.php file or no PDF_EXTENDED_TEMPLATE folder
|
113 |
-
* The user will need to reinitialise
|
114 |
-
*/
|
115 |
-
public static function gf_pdf_problem_detected()
|
116 |
-
{
|
117 |
-
if( !rgpost('update') )
|
118 |
-
{
|
119 |
-
if(rgget("page") == 'gf_settings' && rgget('subview') == 'PDF')
|
120 |
-
{
|
121 |
-
$msg = __('Gravity PDF detected a configuration problem. Please reinitialise the plugin.', 'pdfextended');
|
122 |
-
}
|
123 |
-
else
|
124 |
-
{
|
125 |
-
$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>');
|
126 |
-
}
|
127 |
-
|
128 |
-
self::error($msg);
|
129 |
-
}
|
130 |
-
}
|
131 |
-
|
132 |
-
/*
|
133 |
-
* The $gfpdfe_data->allow_initilisation function is false
|
134 |
-
* meaning there is a server configuration problem detected
|
135 |
-
*/
|
136 |
-
public static function gf_pdf_server_problem_detected()
|
137 |
-
{
|
138 |
-
if( !rgpost('update') )
|
139 |
-
{
|
140 |
-
if(rgget("page") == 'gf_settings' && rgget('subview') == 'PDF')
|
141 |
-
{
|
142 |
-
$msg = __('Gravity PDF detected a server compatibility problem which prevented the software from running. See the System Status section below for details.', 'pdfextended');
|
143 |
-
}
|
144 |
-
else
|
145 |
-
{
|
146 |
-
$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>');
|
147 |
-
}
|
148 |
-
|
149 |
-
self::error($msg);
|
150 |
-
}
|
151 |
-
}
|
152 |
-
|
153 |
-
/**
|
154 |
-
* PDF Extended has been freshly installed
|
155 |
-
*/
|
156 |
-
public static function gf_pdf_not_deployed_fresh()
|
157 |
-
{
|
158 |
-
if( !rgpost('update') )
|
159 |
-
{
|
160 |
-
if(rgget("page") == 'gf_settings' && rgget('subview') == 'PDF')
|
161 |
-
{
|
162 |
-
$msg = __('Welcome to Gravity PDF. Before you can use the plugin correctly you need to initilise it.', 'pdfextended');
|
163 |
-
}
|
164 |
-
else
|
165 |
-
{
|
166 |
-
$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>');
|
167 |
-
}
|
168 |
-
|
169 |
-
self::notice($msg);
|
170 |
-
}
|
171 |
-
}
|
172 |
-
|
173 |
-
/**
|
174 |
-
* The Gravity Forms version isn't compatible. Prompt user to upgrade
|
175 |
-
*/
|
176 |
-
public static function gf_pdf_not_supported()
|
177 |
-
{
|
178 |
-
$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>');
|
179 |
-
|
180 |
-
self::error($msg);
|
181 |
-
}
|
182 |
-
|
183 |
-
|
184 |
-
/**
|
185 |
-
* Cannot create new template folder in active theme directory
|
186 |
-
*/
|
187 |
-
public static function gf_pdf_template_dir_err()
|
188 |
-
{
|
189 |
-
global $gfpdfe_data;
|
190 |
-
|
191 |
-
$prefix = self::autoprefix();
|
192 |
-
$suffix = self::autosuffix();
|
193 |
-
|
194 |
-
$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;
|
195 |
-
|
196 |
-
self::error($msg);
|
197 |
-
}
|
198 |
-
|
199 |
-
/**
|
200 |
-
* Cannot create site directory in template folder
|
201 |
-
*/
|
202 |
-
public static function gf_pdf_template_site_dir_err()
|
203 |
-
{
|
204 |
-
global $gfpdfe_data;
|
205 |
-
|
206 |
-
$prefix = self::autoprefix();
|
207 |
-
$suffix = self::autosuffix();
|
208 |
-
|
209 |
-
$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;
|
210 |
-
|
211 |
-
self::error($msg);
|
212 |
-
}
|
213 |
-
|
214 |
-
/**
|
215 |
-
* Cannot remove old default template files
|
216 |
-
*/
|
217 |
-
public static function gf_pdf_deployment_unlink_error()
|
218 |
-
{
|
219 |
-
$prefix = self::autoprefix();
|
220 |
-
$suffix = self::autosuffix();
|
221 |
-
|
222 |
-
$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;
|
223 |
-
|
224 |
-
self::error($msg);
|
225 |
-
}
|
226 |
-
|
227 |
-
/**
|
228 |
-
* Cannot create new template folder
|
229 |
-
*/
|
230 |
-
public static function gf_pdf_template_move_err()
|
231 |
-
{
|
232 |
-
$prefix = self::autoprefix();
|
233 |
-
$suffix = self::autosuffix();
|
234 |
-
|
235 |
-
$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;
|
236 |
-
|
237 |
-
self::error($msg);
|
238 |
-
}
|
239 |
-
|
240 |
-
/*
|
241 |
-
* Prompt user to keep the plugin working
|
242 |
-
*/
|
243 |
-
public static function do_template_switch_notice()
|
244 |
-
{
|
245 |
-
/*
|
246 |
-
* Check we aren't in the middle of doing the sync
|
247 |
-
*/
|
248 |
-
if(isset($_GET['_wpnonce']) && wp_verify_nonce($_GET['_wpnonce'], 'gfpdfe_migrate'))
|
249 |
-
{
|
250 |
-
return;
|
251 |
-
}
|
252 |
-
|
253 |
-
$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>' );
|
254 |
-
|
255 |
-
self::notice($msg);
|
256 |
-
|
257 |
-
}
|
258 |
-
|
259 |
-
public static function gf_pdf_migration_success()
|
260 |
-
{
|
261 |
-
global $gfpdfe_data;
|
262 |
-
$prefix = ($gfpdfe_data->automated === true && !rgpost('upgrade')) ? sprintf(__('%sGravity PDF Automated Template Migration:%s', 'pdfextended'), '<strong>', '</strong><br>') : '';
|
263 |
-
|
264 |
-
$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>');
|
265 |
-
|
266 |
-
self::notice($msg);
|
267 |
-
|
268 |
-
}
|
269 |
-
|
270 |
-
public static function gf_pdf_network_deploy_success()
|
271 |
-
{
|
272 |
-
global $gfpdfe_data;
|
273 |
-
|
274 |
-
if($gfpdfe_data->automated === true && !rgpost('upgrade') && !rgpost('font-initialise'))
|
275 |
-
{
|
276 |
-
$msg = __('Gravity PDF Auto Initialisation Complete across the entire network.', 'pdfextended');
|
277 |
-
}
|
278 |
-
else
|
279 |
-
{
|
280 |
-
$msg = __('Gravity PDF Initialisation Complete across the entire network.', 'pdfextended');
|
281 |
-
}
|
282 |
-
|
283 |
-
if($gfpdfe_data->fresh_install === true)
|
284 |
-
{
|
285 |
-
$msg .= ' ' . sprintf( __('%sLearn how to configuring the plugin%s.', 'pdfextended'), '<a href="'. PDF_SETTINGS_URL .'">', '</a>');
|
286 |
-
}
|
287 |
-
self::notice($msg);
|
288 |
-
}
|
289 |
-
|
290 |
-
public static function gf_pdf_auto_deploy_success()
|
291 |
-
{
|
292 |
-
global $gfpdfe_data;
|
293 |
-
$msg = __('Gravity PDF Auto Initialisation Complete.', 'pdfextended');
|
294 |
-
|
295 |
-
if($gfpdfe_data->fresh_install === true)
|
296 |
-
{
|
297 |
-
$msg .= ' ' . sprintf( __('%sLearn how to configuring the plugin%s.', 'pdfextended'), '<a href="'. PDF_SETTINGS_URL .'">', '</a>');
|
298 |
-
}
|
299 |
-
self::notice($msg);
|
300 |
-
}
|
301 |
-
|
302 |
-
public static function gf_pdf_merge_network_failure()
|
303 |
-
{
|
304 |
-
global $gfpdfe_data;
|
305 |
-
|
306 |
-
$prefix = self::autoprefix();
|
307 |
-
$errors = (array) $gfpdfe_data->network_error;
|
308 |
-
|
309 |
-
if(sizeof($errors) > 0)
|
310 |
-
{
|
311 |
-
$msg = $prefix . __('There was a problem merging the PDF templates folder on the following sites;', 'pdfextended');
|
312 |
-
$msg .= '<ul>';
|
313 |
-
|
314 |
-
$base_site_url = site_url();
|
315 |
-
foreach($errors as $site)
|
316 |
-
{
|
317 |
-
switch_to_blog( (int) $site['blog_id'] );
|
318 |
-
$url = str_replace($base_site_url, site_url(), PDF_SETTINGS_URL );
|
319 |
-
$msg .= "<li><a href='$url'>{$site['domain']}{$site['path']}</a></li>";
|
320 |
-
restore_current_blog();
|
321 |
-
}
|
322 |
-
$msg .= '</ul>';
|
323 |
-
|
324 |
-
$msg .= __('Follow the site links above and try run the PDF template merging function again, or reinitialise the software.', 'pdfextended');
|
325 |
-
}
|
326 |
-
else
|
327 |
-
{
|
328 |
-
$msg = $prefix . __('An unknown error occured while merging the PDF template folders. Please try again.', 'pdfextended');
|
329 |
-
}
|
330 |
-
|
331 |
-
self::error($msg);
|
332 |
-
}
|
333 |
-
|
334 |
-
public static function gf_pdf_auto_deploy_network_failure()
|
335 |
-
{
|
336 |
-
global $gfpdfe_data;
|
337 |
-
|
338 |
-
$prefix = self::autoprefix();
|
339 |
-
$errors = (array) $gfpdfe_data->network_error;
|
340 |
-
|
341 |
-
if(sizeof($errors) > 0)
|
342 |
-
{
|
343 |
-
$msg = $prefix . __('There was a network initialisation issue on the following sites;', 'pdfextended');
|
344 |
-
$msg .= '<ul>';
|
345 |
-
|
346 |
-
$base_site_url = site_url();
|
347 |
-
foreach($errors as $site)
|
348 |
-
{
|
349 |
-
switch_to_blog( (int) $site['blog_id'] );
|
350 |
-
$url = str_replace($base_site_url, site_url(), PDF_SETTINGS_URL );
|
351 |
-
$msg .= "<li><a href='$url'>{$site['domain']}{$site['path']}</a></li>";
|
352 |
-
restore_current_blog();
|
353 |
-
}
|
354 |
-
$msg .= '</ul>';
|
355 |
-
|
356 |
-
$msg .= __('Please try manually initialise the software', 'pdfextended');
|
357 |
-
}
|
358 |
-
else
|
359 |
-
{
|
360 |
-
$msg = $prefix . __('An unknown network initialisation error occured. Please try initialise again.', 'pdfextended');
|
361 |
-
}
|
362 |
-
|
363 |
-
self::error($msg);
|
364 |
-
}
|
365 |
-
|
366 |
-
public static function gf_pdf_deploy_success() {
|
367 |
-
$msg = __('You\'ve successfully initialised Gravity PDF.', 'pdfextended');
|
368 |
-
|
369 |
-
self::notice($msg);
|
370 |
-
}
|
371 |
-
|
372 |
-
public static function display_compatibility_error()
|
373 |
-
{
|
374 |
-
$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>");
|
375 |
-
self::display_plugin_message($message, true);
|
376 |
-
}
|
377 |
-
|
378 |
-
public static function display_wp_compatibility_error()
|
379 |
-
{
|
380 |
-
$message = __("Wordpress " . GF_PDF_EXTENDED_WP_SUPPORTED_VERSION . " or higher is required to use this plugin.", 'pdfextended');
|
381 |
-
self::display_plugin_message($message, true);
|
382 |
-
}
|
383 |
-
|
384 |
-
public static function display_pdf_compatibility_error()
|
385 |
-
{
|
386 |
-
$message = __("PHP " . GF_PDF_EXTENDED_PHP_SUPPORTED_VERSION . " or higher is required to use this plugin.", 'pdfextended');
|
387 |
-
self::display_plugin_message($message, true);
|
388 |
-
}
|
389 |
-
|
390 |
-
public static function add_tooltips($tooltips)
|
391 |
-
{
|
392 |
-
$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>');
|
393 |
-
|
394 |
-
return $tooltips;
|
395 |
-
}
|
396 |
}
|
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 |
+
/*
|
11 |
+
This file is part of Gravity PDF.
|
12 |
+
|
13 |
+
Gravity PDF Copyright (C) 2015 Blue Liquid Designs
|
14 |
+
|
15 |
+
This program is free software; you can redistribute it and/or modify
|
16 |
+
it under the terms of the GNU General Public License as published by
|
17 |
+
the Free Software Foundation; either version 2 of the License, or
|
18 |
+
(at your option) any later version.
|
19 |
+
|
20 |
+
This program is distributed in the hope that it will be useful,
|
21 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
22 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
23 |
+
GNU General Public License for more details.
|
24 |
+
|
25 |
+
You should have received a copy of the GNU General Public License
|
26 |
+
along with this program; if not, write to the Free Software
|
27 |
+
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
28 |
+
*/
|
29 |
+
|
30 |
+
class GFPDF_Notices
|
31 |
+
{
|
32 |
+
/*
|
33 |
+
* Admin notice template
|
34 |
+
*/
|
35 |
+
private static function message($text, $type = 'updated')
|
36 |
+
{
|
37 |
+
?>
|
38 |
+
<div id="message" class="<?php echo $type; ?>">
|
39 |
+
<p>
|
40 |
+
<?php echo $text; ?>
|
41 |
+
</p>
|
42 |
+
</div>
|
43 |
+
<?php
|
44 |
+
}
|
45 |
+
|
46 |
+
/*
|
47 |
+
* Output the update notice
|
48 |
+
*/
|
49 |
+
private static function notice($text)
|
50 |
+
{
|
51 |
+
self::message($text);
|
52 |
+
}
|
53 |
+
|
54 |
+
/*
|
55 |
+
* Output the error notice
|
56 |
+
*/
|
57 |
+
private static function error($text)
|
58 |
+
{
|
59 |
+
self::message($text, 'error');
|
60 |
+
}
|
61 |
+
|
62 |
+
private static function display_plugin_message($message, $is_error = false){
|
63 |
+
|
64 |
+
$style = $is_error ? 'style="background-color: #ffebe8;"' : "";
|
65 |
+
|
66 |
+
echo '</tr><tr class="plugin-update-tr"><td colspan="5" class="plugin-update"><div class="update-message" ' . $style . '>' . $message . '</div></td>';
|
67 |
+
}
|
68 |
+
|
69 |
+
private static function autoprefix()
|
70 |
+
{
|
71 |
+
global $gfpdfe_data;
|
72 |
+
if($gfpdfe_data->automated === true && !rgpost('upgrade') && !rgpost('font-initialise'))
|
73 |
+
{
|
74 |
+
return sprintf(__('%sGravity PDF Automated Installer%s: ', 'pdfextended'), '<strong>', '</strong>');
|
75 |
+
}
|
76 |
+
return '';
|
77 |
+
}
|
78 |
+
|
79 |
+
private static function autosuffix()
|
80 |
+
{
|
81 |
+
global $gfpdfe_data;
|
82 |
+
if($gfpdfe_data->automated === true && !rgpost('upgrade') && !rgpost('font-initialise'))
|
83 |
+
{
|
84 |
+
return sprintf(__(' %sGo to installer%s.', 'pdfextended'), '<a href="'. PDF_SETTINGS_URL .'">', '</a>');
|
85 |
+
}
|
86 |
+
return '';
|
87 |
+
}
|
88 |
+
|
89 |
+
public static function gf_pdf_font_install_success()
|
90 |
+
{
|
91 |
+
$prefix = self::autoprefix();
|
92 |
+
$suffix = self::autosuffix();
|
93 |
+
|
94 |
+
$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;
|
95 |
+
|
96 |
+
self::notice($msg);
|
97 |
+
|
98 |
+
}
|
99 |
+
|
100 |
+
public static function gf_pdf_font_config_err()
|
101 |
+
{
|
102 |
+
$prefix = self::autoprefix();
|
103 |
+
$suffix = self::autosuffix();
|
104 |
+
|
105 |
+
$msg = $prefix . __('Could not create font configuration file. Try initialise again.', 'pdfextended') . $suffix;
|
106 |
+
|
107 |
+
self::error($msg);
|
108 |
+
|
109 |
+
}
|
110 |
+
|
111 |
+
/**
|
112 |
+
* The software has detected a problem (no configuration.php file or no PDF_EXTENDED_TEMPLATE folder
|
113 |
+
* The user will need to reinitialise
|
114 |
+
*/
|
115 |
+
public static function gf_pdf_problem_detected()
|
116 |
+
{
|
117 |
+
if( !rgpost('update') )
|
118 |
+
{
|
119 |
+
if(rgget("page") == 'gf_settings' && rgget('subview') == 'PDF')
|
120 |
+
{
|
121 |
+
$msg = __('Gravity PDF detected a configuration problem. Please reinitialise the plugin.', 'pdfextended');
|
122 |
+
}
|
123 |
+
else
|
124 |
+
{
|
125 |
+
$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>');
|
126 |
+
}
|
127 |
+
|
128 |
+
self::error($msg);
|
129 |
+
}
|
130 |
+
}
|
131 |
+
|
132 |
+
/*
|
133 |
+
* The $gfpdfe_data->allow_initilisation function is false
|
134 |
+
* meaning there is a server configuration problem detected
|
135 |
+
*/
|
136 |
+
public static function gf_pdf_server_problem_detected()
|
137 |
+
{
|
138 |
+
if( !rgpost('update') )
|
139 |
+
{
|
140 |
+
if(rgget("page") == 'gf_settings' && rgget('subview') == 'PDF')
|
141 |
+
{
|
142 |
+
$msg = __('Gravity PDF detected a server compatibility problem which prevented the software from running. See the System Status section below for details.', 'pdfextended');
|
143 |
+
}
|
144 |
+
else
|
145 |
+
{
|
146 |
+
$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>');
|
147 |
+
}
|
148 |
+
|
149 |
+
self::error($msg);
|
150 |
+
}
|
151 |
+
}
|
152 |
+
|
153 |
+
/**
|
154 |
+
* PDF Extended has been freshly installed
|
155 |
+
*/
|
156 |
+
public static function gf_pdf_not_deployed_fresh()
|
157 |
+
{
|
158 |
+
if( !rgpost('update') )
|
159 |
+
{
|
160 |
+
if(rgget("page") == 'gf_settings' && rgget('subview') == 'PDF')
|
161 |
+
{
|
162 |
+
$msg = __('Welcome to Gravity PDF. Before you can use the plugin correctly you need to initilise it.', 'pdfextended');
|
163 |
+
}
|
164 |
+
else
|
165 |
+
{
|
166 |
+
$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>');
|
167 |
+
}
|
168 |
+
|
169 |
+
self::notice($msg);
|
170 |
+
}
|
171 |
+
}
|
172 |
+
|
173 |
+
/**
|
174 |
+
* The Gravity Forms version isn't compatible. Prompt user to upgrade
|
175 |
+
*/
|
176 |
+
public static function gf_pdf_not_supported()
|
177 |
+
{
|
178 |
+
$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>');
|
179 |
+
|
180 |
+
self::error($msg);
|
181 |
+
}
|
182 |
+
|
183 |
+
|
184 |
+
/**
|
185 |
+
* Cannot create new template folder in active theme directory
|
186 |
+
*/
|
187 |
+
public static function gf_pdf_template_dir_err()
|
188 |
+
{
|
189 |
+
global $gfpdfe_data;
|
190 |
+
|
191 |
+
$prefix = self::autoprefix();
|
192 |
+
$suffix = self::autosuffix();
|
193 |
+
|
194 |
+
$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;
|
195 |
+
|
196 |
+
self::error($msg);
|
197 |
+
}
|
198 |
+
|
199 |
+
/**
|
200 |
+
* Cannot create site directory in template folder
|
201 |
+
*/
|
202 |
+
public static function gf_pdf_template_site_dir_err()
|
203 |
+
{
|
204 |
+
global $gfpdfe_data;
|
205 |
+
|
206 |
+
$prefix = self::autoprefix();
|
207 |
+
$suffix = self::autosuffix();
|
208 |
+
|
209 |
+
$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;
|
210 |
+
|
211 |
+
self::error($msg);
|
212 |
+
}
|
213 |
+
|
214 |
+
/**
|
215 |
+
* Cannot remove old default template files
|
216 |
+
*/
|
217 |
+
public static function gf_pdf_deployment_unlink_error()
|
218 |
+
{
|
219 |
+
$prefix = self::autoprefix();
|
220 |
+
$suffix = self::autosuffix();
|
221 |
+
|
222 |
+
$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;
|
223 |
+
|
224 |
+
self::error($msg);
|
225 |
+
}
|
226 |
+
|
227 |
+
/**
|
228 |
+
* Cannot create new template folder
|
229 |
+
*/
|
230 |
+
public static function gf_pdf_template_move_err()
|
231 |
+
{
|
232 |
+
$prefix = self::autoprefix();
|
233 |
+
$suffix = self::autosuffix();
|
234 |
+
|
235 |
+
$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;
|
236 |
+
|
237 |
+
self::error($msg);
|
238 |
+
}
|
239 |
+
|
240 |
+
/*
|
241 |
+
* Prompt user to keep the plugin working
|
242 |
+
*/
|
243 |
+
public static function do_template_switch_notice()
|
244 |
+
{
|
245 |
+
/*
|
246 |
+
* Check we aren't in the middle of doing the sync
|
247 |
+
*/
|
248 |
+
if(isset($_GET['_wpnonce']) && wp_verify_nonce($_GET['_wpnonce'], 'gfpdfe_migrate'))
|
249 |
+
{
|
250 |
+
return;
|
251 |
+
}
|
252 |
+
|
253 |
+
$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>' );
|
254 |
+
|
255 |
+
self::notice($msg);
|
256 |
+
|
257 |
+
}
|
258 |
+
|
259 |
+
public static function gf_pdf_migration_success()
|
260 |
+
{
|
261 |
+
global $gfpdfe_data;
|
262 |
+
$prefix = ($gfpdfe_data->automated === true && !rgpost('upgrade')) ? sprintf(__('%sGravity PDF Automated Template Migration:%s', 'pdfextended'), '<strong>', '</strong><br>') : '';
|
263 |
+
|
264 |
+
$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>');
|
265 |
+
|
266 |
+
self::notice($msg);
|
267 |
+
|
268 |
+
}
|
269 |
+
|
270 |
+
public static function gf_pdf_network_deploy_success()
|
271 |
+
{
|
272 |
+
global $gfpdfe_data;
|
273 |
+
|
274 |
+
if($gfpdfe_data->automated === true && !rgpost('upgrade') && !rgpost('font-initialise'))
|
275 |
+
{
|
276 |
+
$msg = __('Gravity PDF Auto Initialisation Complete across the entire network.', 'pdfextended');
|
277 |
+
}
|
278 |
+
else
|
279 |
+
{
|
280 |
+
$msg = __('Gravity PDF Initialisation Complete across the entire network.', 'pdfextended');
|
281 |
+
}
|
282 |
+
|
283 |
+
if($gfpdfe_data->fresh_install === true)
|
284 |
+
{
|
285 |
+
$msg .= ' ' . sprintf( __('%sLearn how to configuring the plugin%s.', 'pdfextended'), '<a href="'. PDF_SETTINGS_URL .'">', '</a>');
|
286 |
+
}
|
287 |
+
self::notice($msg);
|
288 |
+
}
|
289 |
+
|
290 |
+
public static function gf_pdf_auto_deploy_success()
|
291 |
+
{
|
292 |
+
global $gfpdfe_data;
|
293 |
+
$msg = __('Gravity PDF Auto Initialisation Complete.', 'pdfextended');
|
294 |
+
|
295 |
+
if($gfpdfe_data->fresh_install === true)
|
296 |
+
{
|
297 |
+
$msg .= ' ' . sprintf( __('%sLearn how to configuring the plugin%s.', 'pdfextended'), '<a href="'. PDF_SETTINGS_URL .'">', '</a>');
|
298 |
+
}
|
299 |
+
self::notice($msg);
|
300 |
+
}
|
301 |
+
|
302 |
+
public static function gf_pdf_merge_network_failure()
|
303 |
+
{
|
304 |
+
global $gfpdfe_data;
|
305 |
+
|
306 |
+
$prefix = self::autoprefix();
|
307 |
+
$errors = (array) $gfpdfe_data->network_error;
|
308 |
+
|
309 |
+
if(sizeof($errors) > 0)
|
310 |
+
{
|
311 |
+
$msg = $prefix . __('There was a problem merging the PDF templates folder on the following sites;', 'pdfextended');
|
312 |
+
$msg .= '<ul>';
|
313 |
+
|
314 |
+
$base_site_url = site_url();
|
315 |
+
foreach($errors as $site)
|
316 |
+
{
|
317 |
+
switch_to_blog( (int) $site['blog_id'] );
|
318 |
+
$url = str_replace($base_site_url, site_url(), PDF_SETTINGS_URL );
|
319 |
+
$msg .= "<li><a href='$url'>{$site['domain']}{$site['path']}</a></li>";
|
320 |
+
restore_current_blog();
|
321 |
+
}
|
322 |
+
$msg .= '</ul>';
|
323 |
+
|
324 |
+
$msg .= __('Follow the site links above and try run the PDF template merging function again, or reinitialise the software.', 'pdfextended');
|
325 |
+
}
|
326 |
+
else
|
327 |
+
{
|
328 |
+
$msg = $prefix . __('An unknown error occured while merging the PDF template folders. Please try again.', 'pdfextended');
|
329 |
+
}
|
330 |
+
|
331 |
+
self::error($msg);
|
332 |
+
}
|
333 |
+
|
334 |
+
public static function gf_pdf_auto_deploy_network_failure()
|
335 |
+
{
|
336 |
+
global $gfpdfe_data;
|
337 |
+
|
338 |
+
$prefix = self::autoprefix();
|
339 |
+
$errors = (array) $gfpdfe_data->network_error;
|
340 |
+
|
341 |
+
if(sizeof($errors) > 0)
|
342 |
+
{
|
343 |
+
$msg = $prefix . __('There was a network initialisation issue on the following sites;', 'pdfextended');
|
344 |
+
$msg .= '<ul>';
|
345 |
+
|
346 |
+
$base_site_url = site_url();
|
347 |
+
foreach($errors as $site)
|
348 |
+
{
|
349 |
+
switch_to_blog( (int) $site['blog_id'] );
|
350 |
+
$url = str_replace($base_site_url, site_url(), PDF_SETTINGS_URL );
|
351 |
+
$msg .= "<li><a href='$url'>{$site['domain']}{$site['path']}</a></li>";
|
352 |
+
restore_current_blog();
|
353 |
+
}
|
354 |
+
$msg .= '</ul>';
|
355 |
+
|
356 |
+
$msg .= __('Please try manually initialise the software', 'pdfextended');
|
357 |
+
}
|
358 |
+
else
|
359 |
+
{
|
360 |
+
$msg = $prefix . __('An unknown network initialisation error occured. Please try initialise again.', 'pdfextended');
|
361 |
+
}
|
362 |
+
|
363 |
+
self::error($msg);
|
364 |
+
}
|
365 |
+
|
366 |
+
public static function gf_pdf_deploy_success() {
|
367 |
+
$msg = __('You\'ve successfully initialised Gravity PDF.', 'pdfextended');
|
368 |
+
|
369 |
+
self::notice($msg);
|
370 |
+
}
|
371 |
+
|
372 |
+
public static function display_compatibility_error()
|
373 |
+
{
|
374 |
+
$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>");
|
375 |
+
self::display_plugin_message($message, true);
|
376 |
+
}
|
377 |
+
|
378 |
+
public static function display_wp_compatibility_error()
|
379 |
+
{
|
380 |
+
$message = __("Wordpress " . GF_PDF_EXTENDED_WP_SUPPORTED_VERSION . " or higher is required to use this plugin.", 'pdfextended');
|
381 |
+
self::display_plugin_message($message, true);
|
382 |
+
}
|
383 |
+
|
384 |
+
public static function display_pdf_compatibility_error()
|
385 |
+
{
|
386 |
+
$message = __("PHP " . GF_PDF_EXTENDED_PHP_SUPPORTED_VERSION . " or higher is required to use this plugin.", 'pdfextended');
|
387 |
+
self::display_plugin_message($message, true);
|
388 |
+
}
|
389 |
+
|
390 |
+
public static function add_tooltips($tooltips)
|
391 |
+
{
|
392 |
+
$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>');
|
393 |
+
|
394 |
+
return $tooltips;
|
395 |
+
}
|
396 |
}
|
helper/pdf-common.php
CHANGED
@@ -1,319 +1,319 @@
|
|
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 |
-
/*
|
11 |
-
This file is part of Gravity PDF.
|
12 |
-
|
13 |
-
Gravity PDF Copyright (C) 2015 Blue Liquid Designs
|
14 |
-
|
15 |
-
This program is free software; you can redistribute it and/or modify
|
16 |
-
it under the terms of the GNU General Public License as published by
|
17 |
-
the Free Software Foundation; either version 2 of the License, or
|
18 |
-
(at your option) any later version.
|
19 |
-
|
20 |
-
This program is distributed in the hope that it will be useful,
|
21 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
22 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
23 |
-
GNU General Public License for more details.
|
24 |
-
|
25 |
-
You should have received a copy of the GNU General Public License
|
26 |
-
along with this program; if not, write to the Free Software
|
27 |
-
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
28 |
-
*/
|
29 |
-
|
30 |
-
class PDF_Common
|
31 |
-
{
|
32 |
-
|
33 |
-
/**
|
34 |
-
* Depreciated function
|
35 |
-
*/
|
36 |
-
public static function setup_ids() { }
|
37 |
-
|
38 |
-
/**
|
39 |
-
* Takes over for setup_ids() but is now called much earlier in the process
|
40 |
-
* @return Boolean whether settings the ids was successful or not
|
41 |
-
*/
|
42 |
-
public static function get_ids()
|
43 |
-
{
|
44 |
-
global $form_id, $lead_id, $lead_ids;
|
45 |
-
|
46 |
-
$form_id = ($form_id) ? $form_id : absint( rgget("fid") );
|
47 |
-
$lead_ids = ($lead_id) ? array($lead_id) : explode(',', rgget("lid"));
|
48 |
-
|
49 |
-
/**
|
50 |
-
* If form ID and lead ID hasn't been set stop the PDF from attempting to generate
|
51 |
-
*/
|
52 |
-
if(empty($form_id) || empty($lead_ids))
|
53 |
-
{
|
54 |
-
return false;
|
55 |
-
}
|
56 |
-
return true;
|
57 |
-
}
|
58 |
-
|
59 |
-
/*
|
60 |
-
* We will use the output buffer to get the HTML template
|
61 |
-
*/
|
62 |
-
public static function get_html_template($filename)
|
63 |
-
{
|
64 |
-
global $form_id, $lead_id, $lead_ids;
|
65 |
-
|
66 |
-
ob_start();
|
67 |
-
require($filename);
|
68 |
-
|
69 |
-
$page = ob_get_contents();
|
70 |
-
ob_end_clean();
|
71 |
-
|
72 |
-
return $page;
|
73 |
-
}
|
74 |
-
|
75 |
-
/**
|
76 |
-
* Get the name of the PDF based on the Form and the submission
|
77 |
-
*/
|
78 |
-
public static function get_pdf_filename($form_id, $lead_id)
|
79 |
-
{
|
80 |
-
return "form-$form_id-entry-$lead_id.pdf";
|
81 |
-
}
|
82 |
-
|
83 |
-
/*
|
84 |
-
* We need to validate the PDF name
|
85 |
-
* Check the size limit, if the file name's syntax is correct
|
86 |
-
* and strip any characters that aren't classed as valid file name characters.
|
87 |
-
*/
|
88 |
-
public static function validate_pdf_name($name, $form_id = false, $lead_id = false)
|
89 |
-
{
|
90 |
-
$pdf_name = $name;
|
91 |
-
|
92 |
-
if($form_id > 0)
|
93 |
-
{
|
94 |
-
$pdf_name = self::do_mergetags($pdf_name, $form_id, $lead_id);
|
95 |
-
}
|
96 |
-
|
97 |
-
/*
|
98 |
-
* Limit the size of the filename to 120 characters
|
99 |
-
*/
|
100 |
-
if(strlen($pdf_name) > 120)
|
101 |
-
{
|
102 |
-
$pdf_name = substr($pdf_name, 0, 120);
|
103 |
-
}
|
104 |
-
|
105 |
-
/*
|
106 |
-
* Remove extension from the end of the filename so we can replace all '.'
|
107 |
-
* Will add back before we are finished
|
108 |
-
*/
|
109 |
-
if(substr($pdf_name, -4) == '.pdf')
|
110 |
-
{
|
111 |
-
$pdf_name = substr($pdf_name, 0, -4);
|
112 |
-
}
|
113 |
-
|
114 |
-
/*
|
115 |
-
* Remove any invalid (mostly Windows) characters from filename
|
116 |
-
*/
|
117 |
-
$pdf_name = self::remove_invalid_characters($pdf_name);
|
118 |
-
$pdf_name = $pdf_name . '.pdf';
|
119 |
-
|
120 |
-
return $pdf_name;
|
121 |
-
}
|
122 |
-
|
123 |
-
public static function remove_invalid_characters($name)
|
124 |
-
{
|
125 |
-
/*
|
126 |
-
* Remove any invalid (mostly Windows) characters from filename
|
127 |
-
*/
|
128 |
-
$name = str_replace('/', '-', $name);
|
129 |
-
$name = str_replace('\\', '-', $name);
|
130 |
-
$name = str_replace('"', '-', $name);
|
131 |
-
$name = str_replace('*', '-', $name);
|
132 |
-
$name = str_replace('?', '-', $name);
|
133 |
-
$name = str_replace('|', '-', $name);
|
134 |
-
$name = str_replace(':', '-', $name);
|
135 |
-
$name = str_replace('<', '-', $name);
|
136 |
-
$name = str_replace('>', '-', $name);
|
137 |
-
$name = str_replace('.', '_', $name);
|
138 |
-
|
139 |
-
return $name;
|
140 |
-
}
|
141 |
-
|
142 |
-
/*
|
143 |
-
* Replace all the merge tag fields in the string
|
144 |
-
* We wll remove the {all_fields} mergetag is it is not needed
|
145 |
-
*/
|
146 |
-
public static function do_mergetags($string, $form_id, $lead_id)
|
147 |
-
{
|
148 |
-
/*
|
149 |
-
* Unconvert { and } symbols from HTML entities
|
150 |
-
*/
|
151 |
-
$string = str_replace('{', '{', $string);
|
152 |
-
$string = str_replace('}', '}', $string);
|
153 |
-
|
154 |
-
/* strip {all_fields} merge tag from $string */
|
155 |
-
$string = str_replace('{all_fields}', '', $string);
|
156 |
-
|
157 |
-
/*
|
158 |
-
* Get form and lead data
|
159 |
-
*/
|
160 |
-
$form = RGFormsModel::get_form_meta($form_id);
|
161 |
-
$lead = RGFormsModel::get_lead($lead_id);
|
162 |
-
|
163 |
-
$results = trim(GFCommon::replace_variables($string, $form, $lead, false, false, false));
|
164 |
-
|
165 |
-
/*
|
166 |
-
* Return results
|
167 |
-
*/
|
168 |
-
return $results;
|
169 |
-
|
170 |
-
}
|
171 |
-
|
172 |
-
/*
|
173 |
-
* Allow users to view the $form_data array, if it exists
|
174 |
-
*/
|
175 |
-
public static function view_data($form_data)
|
176 |
-
{
|
177 |
-
if(isset($_GET['data']) && $_GET['data'] === '1' && GFCommon::current_user_can_any("gravityforms_view_entries"))
|
178 |
-
{
|
179 |
-
print '<pre>';
|
180 |
-
print_r($form_data);
|
181 |
-
print '</pre>';
|
182 |
-
exit;
|
183 |
-
}
|
184 |
-
}
|
185 |
-
|
186 |
-
/*
|
187 |
-
* New to 3.0.2 we will use WP_Filesystem API to manipulate files instead of using in-built PHP functions
|
188 |
-
* $post Array the post data to include in the request_filesystem_credntials API
|
189 |
-
*/
|
190 |
-
public static function initialise_WP_filesystem_API($post, $nonce)
|
191 |
-
{
|
192 |
-
|
193 |
-
$url = wp_nonce_url(PDF_SETTINGS_URL, $nonce);
|
194 |
-
|
195 |
-
if (false === ($creds = request_filesystem_credentials($url, '', false, false, $post) ) ) {
|
196 |
-
/*
|
197 |
-
* If we get here, then we don't have correct permissions and we need to get the FTP details.
|
198 |
-
* request_filesystem_credentials will handle all that
|
199 |
-
*/
|
200 |
-
return false; // stop the normal page from displaying
|
201 |
-
}
|
202 |
-
|
203 |
-
/*
|
204 |
-
* Check if the credentials are no good and display an error
|
205 |
-
*/
|
206 |
-
if ( ! WP_Filesystem($creds) ) {
|
207 |
-
request_filesystem_credentials($url, '', true, false, $post);
|
208 |
-
return false;
|
209 |
-
}
|
210 |
-
|
211 |
-
return true;
|
212 |
-
|
213 |
-
}
|
214 |
-
|
215 |
-
/*
|
216 |
-
* Check if we are on the PDF settings page
|
217 |
-
*/
|
218 |
-
public static function is_settings()
|
219 |
-
{
|
220 |
-
if(isset($_GET['page']) && isset($_GET['subview']) && $_GET['page'] === 'gf_settings' && strtolower($_GET['subview']) === 'pdf')
|
221 |
-
{
|
222 |
-
return true;
|
223 |
-
}
|
224 |
-
return false;
|
225 |
-
}
|
226 |
-
|
227 |
-
public static function post($name)
|
228 |
-
{
|
229 |
-
if(isset($_POST[$name]))
|
230 |
-
return $_POST[$name];
|
231 |
-
|
232 |
-
return '';
|
233 |
-
}
|
234 |
-
|
235 |
-
|
236 |
-
public static function get($name)
|
237 |
-
{
|
238 |
-
if(isset($_GET[$name]))
|
239 |
-
return $_GET[$name];
|
240 |
-
|
241 |
-
return '';
|
242 |
-
}
|
243 |
-
|
244 |
-
/**
|
245 |
-
* Gets the site name for use as a directory name
|
246 |
-
* @return String Returns the current 'safe' directory site name
|
247 |
-
*/
|
248 |
-
public static function get_site_name()
|
249 |
-
{
|
250 |
-
$name = (is_ssl()) ? str_replace('https://', '', site_url()) : str_replace('http://', '', site_url());
|
251 |
-
return self::remove_invalid_characters($name);
|
252 |
-
}
|
253 |
-
|
254 |
-
/**
|
255 |
-
* Modified version of get_upload_dir() which just focuses on the base directory
|
256 |
-
* no matter if single or multisite installation
|
257 |
-
* We also only needed the basedir and baseurl so stripped out all the extras
|
258 |
-
* @return Array Base dir and url for the upload directory
|
259 |
-
*/
|
260 |
-
public static function get_upload_dir()
|
261 |
-
{
|
262 |
-
$siteurl = get_option( 'siteurl' );
|
263 |
-
$upload_path = trim( get_option( 'upload_path' ) );
|
264 |
-
|
265 |
-
if ( empty( $upload_path ) || 'wp-content/uploads' == $upload_path ) {
|
266 |
-
$dir = WP_CONTENT_DIR . '/uploads';
|
267 |
-
} elseif ( 0 !== strpos( $upload_path, ABSPATH ) ) {
|
268 |
-
// $dir is absolute, $upload_path is (maybe) relative to ABSPATH
|
269 |
-
$dir = path_join( ABSPATH, $upload_path );
|
270 |
-
} else {
|
271 |
-
$dir = $upload_path;
|
272 |
-
}
|
273 |
-
|
274 |
-
if ( !$url = get_option( 'upload_url_path' ) ) {
|
275 |
-
if ( empty($upload_path) || ( 'wp-content/uploads' == $upload_path ) || ( $upload_path == $dir ) )
|
276 |
-
$url = WP_CONTENT_URL . '/uploads';
|
277 |
-
else
|
278 |
-
$url = trailingslashit( $siteurl ) . $upload_path;
|
279 |
-
}
|
280 |
-
|
281 |
-
/*
|
282 |
-
* Honor the value of UPLOADS. This happens as long as ms-files rewriting is disabled.
|
283 |
-
* We also sometimes obey UPLOADS when rewriting is enabled -- see the next block.
|
284 |
-
*/
|
285 |
-
if ( defined( 'UPLOADS' ) && ! ( is_multisite() && get_site_option( 'ms_files_rewriting' ) ) ) {
|
286 |
-
$dir = ABSPATH . UPLOADS;
|
287 |
-
$url = trailingslashit( $siteurl ) . UPLOADS;
|
288 |
-
}
|
289 |
-
|
290 |
-
$basedir = $dir;
|
291 |
-
$baseurl = $url;
|
292 |
-
|
293 |
-
return array(
|
294 |
-
'basedir' => $basedir,
|
295 |
-
'baseurl' => $baseurl,
|
296 |
-
);
|
297 |
-
}
|
298 |
-
|
299 |
-
/**
|
300 |
-
* Add backwards compatibility to users running Gravity Forms 1.8.3 or below
|
301 |
-
* which don't have this function built in.
|
302 |
-
* Once support is dropped for Gravity Forms 1.8.x this function can be removed.
|
303 |
-
* Added in v3.7.1
|
304 |
-
* @param Array $currency A currency type
|
305 |
-
* @return String Whether currency should be displayed as 'decimal_dot' or 'decimal_comma'
|
306 |
-
*/
|
307 |
-
public static function is_currency_decimal_dot($currency = null) {
|
308 |
-
if($currency == null){
|
309 |
-
$code = GFCommon::get_currency();
|
310 |
-
if(empty($code))
|
311 |
-
$code = "USD";
|
312 |
-
|
313 |
-
$currency = RGCurrency::get_currency($code);
|
314 |
-
}
|
315 |
-
|
316 |
-
return rgar($currency, "decimal_separator") == ".";
|
317 |
-
}
|
318 |
-
}
|
319 |
-
|
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 |
+
/*
|
11 |
+
This file is part of Gravity PDF.
|
12 |
+
|
13 |
+
Gravity PDF Copyright (C) 2015 Blue Liquid Designs
|
14 |
+
|
15 |
+
This program is free software; you can redistribute it and/or modify
|
16 |
+
it under the terms of the GNU General Public License as published by
|
17 |
+
the Free Software Foundation; either version 2 of the License, or
|
18 |
+
(at your option) any later version.
|
19 |
+
|
20 |
+
This program is distributed in the hope that it will be useful,
|
21 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
22 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
23 |
+
GNU General Public License for more details.
|
24 |
+
|
25 |
+
You should have received a copy of the GNU General Public License
|
26 |
+
along with this program; if not, write to the Free Software
|
27 |
+
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
28 |
+
*/
|
29 |
+
|
30 |
+
class PDF_Common
|
31 |
+
{
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Depreciated function
|
35 |
+
*/
|
36 |
+
public static function setup_ids() { }
|
37 |
+
|
38 |
+
/**
|
39 |
+
* Takes over for setup_ids() but is now called much earlier in the process
|
40 |
+
* @return Boolean whether settings the ids was successful or not
|
41 |
+
*/
|
42 |
+
public static function get_ids()
|
43 |
+
{
|
44 |
+
global $form_id, $lead_id, $lead_ids;
|
45 |
+
|
46 |
+
$form_id = ($form_id) ? $form_id : absint( rgget("fid") );
|
47 |
+
$lead_ids = ($lead_id) ? array($lead_id) : explode(',', rgget("lid"));
|
48 |
+
|
49 |
+
/**
|
50 |
+
* If form ID and lead ID hasn't been set stop the PDF from attempting to generate
|
51 |
+
*/
|
52 |
+
if(empty($form_id) || empty($lead_ids))
|
53 |
+
{
|
54 |
+
return false;
|
55 |
+
}
|
56 |
+
return true;
|
57 |
+
}
|
58 |
+
|
59 |
+
/*
|
60 |
+
* We will use the output buffer to get the HTML template
|
61 |
+
*/
|
62 |
+
public static function get_html_template($filename)
|
63 |
+
{
|
64 |
+
global $form_id, $lead_id, $lead_ids;
|
65 |
+
|
66 |
+
ob_start();
|
67 |
+
require($filename);
|
68 |
+
|
69 |
+
$page = ob_get_contents();
|
70 |
+
ob_end_clean();
|
71 |
+
|
72 |
+
return $page;
|
73 |
+
}
|
74 |
+
|
75 |
+
/**
|
76 |
+
* Get the name of the PDF based on the Form and the submission
|
77 |
+
*/
|
78 |
+
public static function get_pdf_filename($form_id, $lead_id)
|
79 |
+
{
|
80 |
+
return "form-$form_id-entry-$lead_id.pdf";
|
81 |
+
}
|
82 |
+
|
83 |
+
/*
|
84 |
+
* We need to validate the PDF name
|
85 |
+
* Check the size limit, if the file name's syntax is correct
|
86 |
+
* and strip any characters that aren't classed as valid file name characters.
|
87 |
+
*/
|
88 |
+
public static function validate_pdf_name($name, $form_id = false, $lead_id = false)
|
89 |
+
{
|
90 |
+
$pdf_name = $name;
|
91 |
+
|
92 |
+
if($form_id > 0)
|
93 |
+
{
|
94 |
+
$pdf_name = self::do_mergetags($pdf_name, $form_id, $lead_id);
|
95 |
+
}
|
96 |
+
|
97 |
+
/*
|
98 |
+
* Limit the size of the filename to 120 characters
|
99 |
+
*/
|
100 |
+
if(strlen($pdf_name) > 120)
|
101 |
+
{
|
102 |
+
$pdf_name = substr($pdf_name, 0, 120);
|
103 |
+
}
|
104 |
+
|
105 |
+
/*
|
106 |
+
* Remove extension from the end of the filename so we can replace all '.'
|
107 |
+
* Will add back before we are finished
|
108 |
+
*/
|
109 |
+
if(substr($pdf_name, -4) == '.pdf')
|
110 |
+
{
|
111 |
+
$pdf_name = substr($pdf_name, 0, -4);
|
112 |
+
}
|
113 |
+
|
114 |
+
/*
|
115 |
+
* Remove any invalid (mostly Windows) characters from filename
|
116 |
+
*/
|
117 |
+
$pdf_name = self::remove_invalid_characters($pdf_name);
|
118 |
+
$pdf_name = $pdf_name . '.pdf';
|
119 |
+
|
120 |
+
return $pdf_name;
|
121 |
+
}
|
122 |
+
|
123 |
+
public static function remove_invalid_characters($name)
|
124 |
+
{
|
125 |
+
/*
|
126 |
+
* Remove any invalid (mostly Windows) characters from filename
|
127 |
+
*/
|
128 |
+
$name = str_replace('/', '-', $name);
|
129 |
+
$name = str_replace('\\', '-', $name);
|
130 |
+
$name = str_replace('"', '-', $name);
|
131 |
+
$name = str_replace('*', '-', $name);
|
132 |
+
$name = str_replace('?', '-', $name);
|
133 |
+
$name = str_replace('|', '-', $name);
|
134 |
+
$name = str_replace(':', '-', $name);
|
135 |
+
$name = str_replace('<', '-', $name);
|
136 |
+
$name = str_replace('>', '-', $name);
|
137 |
+
$name = str_replace('.', '_', $name);
|
138 |
+
|
139 |
+
return $name;
|
140 |
+
}
|
141 |
+
|
142 |
+
/*
|
143 |
+
* Replace all the merge tag fields in the string
|
144 |
+
* We wll remove the {all_fields} mergetag is it is not needed
|
145 |
+
*/
|
146 |
+
public static function do_mergetags($string, $form_id, $lead_id)
|
147 |
+
{
|
148 |
+
/*
|
149 |
+
* Unconvert { and } symbols from HTML entities
|
150 |
+
*/
|
151 |
+
$string = str_replace('{', '{', $string);
|
152 |
+
$string = str_replace('}', '}', $string);
|
153 |
+
|
154 |
+
/* strip {all_fields} merge tag from $string */
|
155 |
+
$string = str_replace('{all_fields}', '', $string);
|
156 |
+
|
157 |
+
/*
|
158 |
+
* Get form and lead data
|
159 |
+
*/
|
160 |
+
$form = RGFormsModel::get_form_meta($form_id);
|
161 |
+
$lead = RGFormsModel::get_lead($lead_id);
|
162 |
+
|
163 |
+
$results = trim(GFCommon::replace_variables($string, $form, $lead, false, false, false));
|
164 |
+
|
165 |
+
/*
|
166 |
+
* Return results
|
167 |
+
*/
|
168 |
+
return $results;
|
169 |
+
|
170 |
+
}
|
171 |
+
|
172 |
+
/*
|
173 |
+
* Allow users to view the $form_data array, if it exists
|
174 |
+
*/
|
175 |
+
public static function view_data($form_data)
|
176 |
+
{
|
177 |
+
if(isset($_GET['data']) && $_GET['data'] === '1' && GFCommon::current_user_can_any("gravityforms_view_entries"))
|
178 |
+
{
|
179 |
+
print '<pre>';
|
180 |
+
print_r($form_data);
|
181 |
+
print '</pre>';
|
182 |
+
exit;
|
183 |
+
}
|
184 |
+
}
|
185 |
+
|
186 |
+
/*
|
187 |
+
* New to 3.0.2 we will use WP_Filesystem API to manipulate files instead of using in-built PHP functions
|
188 |
+
* $post Array the post data to include in the request_filesystem_credntials API
|
189 |
+
*/
|
190 |
+
public static function initialise_WP_filesystem_API($post, $nonce)
|
191 |
+
{
|
192 |
+
|
193 |
+
$url = wp_nonce_url(PDF_SETTINGS_URL, $nonce);
|
194 |
+
|
195 |
+
if (false === ($creds = request_filesystem_credentials($url, '', false, false, $post) ) ) {
|
196 |
+
/*
|
197 |
+
* If we get here, then we don't have correct permissions and we need to get the FTP details.
|
198 |
+
* request_filesystem_credentials will handle all that
|
199 |
+
*/
|
200 |
+
return false; // stop the normal page from displaying
|
201 |
+
}
|
202 |
+
|
203 |
+
/*
|
204 |
+
* Check if the credentials are no good and display an error
|
205 |
+
*/
|
206 |
+
if ( ! WP_Filesystem($creds) ) {
|
207 |
+
request_filesystem_credentials($url, '', true, false, $post);
|
208 |
+
return false;
|
209 |
+
}
|
210 |
+
|
211 |
+
return true;
|
212 |
+
|
213 |
+
}
|
214 |
+
|
215 |
+
/*
|
216 |
+
* Check if we are on the PDF settings page
|
217 |
+
*/
|
218 |
+
public static function is_settings()
|
219 |
+
{
|
220 |
+
if(isset($_GET['page']) && isset($_GET['subview']) && $_GET['page'] === 'gf_settings' && strtolower($_GET['subview']) === 'pdf')
|
221 |
+
{
|
222 |
+
return true;
|
223 |
+
}
|
224 |
+
return false;
|
225 |
+
}
|
226 |
+
|
227 |
+
public static function post($name)
|
228 |
+
{
|
229 |
+
if(isset($_POST[$name]))
|
230 |
+
return $_POST[$name];
|
231 |
+
|
232 |
+
return '';
|
233 |
+
}
|
234 |
+
|
235 |
+
|
236 |
+
public static function get($name)
|
237 |
+
{
|
238 |
+
if(isset($_GET[$name]))
|
239 |
+
return $_GET[$name];
|
240 |
+
|
241 |
+
return '';
|
242 |
+
}
|
243 |
+
|
244 |
+
/**
|
245 |
+
* Gets the site name for use as a directory name
|
246 |
+
* @return String Returns the current 'safe' directory site name
|
247 |
+
*/
|
248 |
+
public static function get_site_name()
|
249 |
+
{
|
250 |
+
$name = (is_ssl()) ? str_replace('https://', '', site_url()) : str_replace('http://', '', site_url());
|
251 |
+
return self::remove_invalid_characters($name);
|
252 |
+
}
|
253 |
+
|
254 |
+
/**
|
255 |
+
* Modified version of get_upload_dir() which just focuses on the base directory
|
256 |
+
* no matter if single or multisite installation
|
257 |
+
* We also only needed the basedir and baseurl so stripped out all the extras
|
258 |
+
* @return Array Base dir and url for the upload directory
|
259 |
+
*/
|
260 |
+
public static function get_upload_dir()
|
261 |
+
{
|
262 |
+
$siteurl = get_option( 'siteurl' );
|
263 |
+
$upload_path = trim( get_option( 'upload_path' ) );
|
264 |
+
|
265 |
+
if ( empty( $upload_path ) || 'wp-content/uploads' == $upload_path ) {
|
266 |
+
$dir = WP_CONTENT_DIR . '/uploads';
|
267 |
+
} elseif ( 0 !== strpos( $upload_path, ABSPATH ) ) {
|
268 |
+
// $dir is absolute, $upload_path is (maybe) relative to ABSPATH
|
269 |
+
$dir = path_join( ABSPATH, $upload_path );
|
270 |
+
} else {
|
271 |
+
$dir = $upload_path;
|
272 |
+
}
|
273 |
+
|
274 |
+
if ( !$url = get_option( 'upload_url_path' ) ) {
|
275 |
+
if ( empty($upload_path) || ( 'wp-content/uploads' == $upload_path ) || ( $upload_path == $dir ) )
|
276 |
+
$url = WP_CONTENT_URL . '/uploads';
|
277 |
+
else
|
278 |
+
$url = trailingslashit( $siteurl ) . $upload_path;
|
279 |
+
}
|
280 |
+
|
281 |
+
/*
|
282 |
+
* Honor the value of UPLOADS. This happens as long as ms-files rewriting is disabled.
|
283 |
+
* We also sometimes obey UPLOADS when rewriting is enabled -- see the next block.
|
284 |
+
*/
|
285 |
+
if ( defined( 'UPLOADS' ) && ! ( is_multisite() && get_site_option( 'ms_files_rewriting' ) ) ) {
|
286 |
+
$dir = ABSPATH . UPLOADS;
|
287 |
+
$url = trailingslashit( $siteurl ) . UPLOADS;
|
288 |
+
}
|
289 |
+
|
290 |
+
$basedir = $dir;
|
291 |
+
$baseurl = $url;
|
292 |
+
|
293 |
+
return array(
|
294 |
+
'basedir' => $basedir,
|
295 |
+
'baseurl' => $baseurl,
|
296 |
+
);
|
297 |
+
}
|
298 |
+
|
299 |
+
/**
|
300 |
+
* Add backwards compatibility to users running Gravity Forms 1.8.3 or below
|
301 |
+
* which don't have this function built in.
|
302 |
+
* Once support is dropped for Gravity Forms 1.8.x this function can be removed.
|
303 |
+
* Added in v3.7.1
|
304 |
+
* @param Array $currency A currency type
|
305 |
+
* @return String Whether currency should be displayed as 'decimal_dot' or 'decimal_comma'
|
306 |
+
*/
|
307 |
+
public static function is_currency_decimal_dot($currency = null) {
|
308 |
+
if($currency == null){
|
309 |
+
$code = GFCommon::get_currency();
|
310 |
+
if(empty($code))
|
311 |
+
$code = "USD";
|
312 |
+
|
313 |
+
$currency = RGCurrency::get_currency($code);
|
314 |
+
}
|
315 |
+
|
316 |
+
return rgar($currency, "decimal_separator") == ".";
|
317 |
+
}
|
318 |
+
}
|
319 |
+
|
helper/pdf-configuration-indexer.php
CHANGED
@@ -1,440 +1,440 @@
|
|
1 |
-
<?php
|
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 |
-
|
9 |
-
/*
|
10 |
-
This file is part of Gravity PDF.
|
11 |
-
|
12 |
-
Gravity PDF Copyright (C) 2015 Blue Liquid Designs
|
13 |
-
|
14 |
-
This program is free software; you can redistribute it and/or modify
|
15 |
-
it under the terms of the GNU General Public License as published by
|
16 |
-
the Free Software Foundation; either version 2 of the License, or
|
17 |
-
(at your option) any later version.
|
18 |
-
|
19 |
-
This program is distributed in the hope that it will be useful,
|
20 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
21 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
22 |
-
GNU General Public License for more details.
|
23 |
-
|
24 |
-
You should have received a copy of the GNU General Public License
|
25 |
-
along with this program; if not, write to the Free Software
|
26 |
-
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
27 |
-
*/
|
28 |
-
|
29 |
-
class PDFGenerator
|
30 |
-
{
|
31 |
-
|
32 |
-
/*
|
33 |
-
* Set default values for forms not assigned a PDF
|
34 |
-
*/
|
35 |
-
public static $default = array(
|
36 |
-
'template' => 'default-template.php',
|
37 |
-
'pdf_size' => 'a4',
|
38 |
-
'orientation' => 'portrait',
|
39 |
-
'rtf' => false,
|
40 |
-
'security' => false
|
41 |
-
);
|
42 |
-
|
43 |
-
public static $allowed_privileges = array('copy', 'print', 'modify', 'annot-forms', 'fill-forms', 'extract', 'assemble', 'print-highres');
|
44 |
-
|
45 |
-
public $configuration = array();
|
46 |
-
|
47 |
-
/*
|
48 |
-
* Switch to verify if configuration file exists.
|
49 |
-
* If not, user is using old functions.php method and we
|
50 |
-
* don't want to interfere with it.
|
51 |
-
*/
|
52 |
-
public $disabled = false;
|
53 |
-
|
54 |
-
/*
|
55 |
-
* The index holds the form_id and configuration key in $this->configuration
|
56 |
-
* so each form knows
|
57 |
-
*/
|
58 |
-
public $index = array();
|
59 |
-
|
60 |
-
public function __construct()
|
61 |
-
{
|
62 |
-
global $gfpdfe_data;
|
63 |
-
|
64 |
-
/*
|
65 |
-
* Do configuration pre-processing
|
66 |
-
*/
|
67 |
-
|
68 |
-
/*
|
69 |
-
* Check if user configuration file exists
|
70 |
-
* If not disable $configuration and $index.
|
71 |
-
*/
|
72 |
-
if(!file_exists( $gfpdfe_data->template_site_location . 'configuration.php') )
|
73 |
-
{
|
74 |
-
$this->disabled = true;
|
75 |
-
return;
|
76 |
-
}
|
77 |
-
else
|
78 |
-
{
|
79 |
-
/*
|
80 |
-
* Include the configuration file and set up the configuration variable.
|
81 |
-
*/
|
82 |
-
require_once( $gfpdfe_data->template_site_location . 'configuration.php' );
|
83 |
-
/*
|
84 |
-
* $gf_pdf_config included from configuration.php file
|
85 |
-
*/
|
86 |
-
$this->configuration = (isset($gf_pdf_config)) ? $gf_pdf_config : array();
|
87 |
-
|
88 |
-
/*
|
89 |
-
* Merge down the default configuration options
|
90 |
-
*/
|
91 |
-
foreach($this->configuration as &$node)
|
92 |
-
{
|
93 |
-
$node = $this->merge_defaults($node);
|
94 |
-
}
|
95 |
-
}
|
96 |
-
|
97 |
-
$this->pdf_config();
|
98 |
-
}
|
99 |
-
|
100 |
-
/**
|
101 |
-
* Merge the configuration node with the default options, ensuring the config node takes precendent
|
102 |
-
* @param array $config the configuration node from $gfpdf->configuration()
|
103 |
-
* @return array Merged default/node configuration options
|
104 |
-
*/
|
105 |
-
private function merge_defaults($config)
|
106 |
-
{
|
107 |
-
global $gf_pdf_default_configuration;
|
108 |
-
|
109 |
-
/*
|
110 |
-
* If the default settings are set we'll merge them into the configuration index
|
111 |
-
*/
|
112 |
-
if(is_array($gf_pdf_default_configuration) && sizeof($gf_pdf_default_configuration) > 0)
|
113 |
-
{
|
114 |
-
$config = array_replace_recursive($gf_pdf_default_configuration, $config);
|
115 |
-
}
|
116 |
-
|
117 |
-
return $config;
|
118 |
-
}
|
119 |
-
|
120 |
-
/*
|
121 |
-
* Run through user configuration and set PDF options
|
122 |
-
*/
|
123 |
-
private function pdf_config()
|
124 |
-
{
|
125 |
-
if(sizeof($this->configuration) == 0)
|
126 |
-
{
|
127 |
-
return;
|
128 |
-
}
|
129 |
-
|
130 |
-
$this->set_form_pdfs();
|
131 |
-
}
|
132 |
-
|
133 |
-
|
134 |
-
/*
|
135 |
-
* Set the configuration index so it's faster to access template configuration information
|
136 |
-
*/
|
137 |
-
private function set_form_pdfs()
|
138 |
-
{
|
139 |
-
foreach($this->configuration as $key => $config)
|
140 |
-
{
|
141 |
-
if(!is_array($config['form_id']))
|
142 |
-
{
|
143 |
-
$this->assign_index($config['form_id'], $key);
|
144 |
-
}
|
145 |
-
else
|
146 |
-
{
|
147 |
-
foreach($config['form_id'] as $id)
|
148 |
-
{
|
149 |
-
$this->assign_index($id, $key);
|
150 |
-
}
|
151 |
-
}
|
152 |
-
|
153 |
-
}
|
154 |
-
}
|
155 |
-
|
156 |
-
/*
|
157 |
-
* Check to see if ID is valid
|
158 |
-
* If so, assign ID => key to index
|
159 |
-
*/
|
160 |
-
public function assign_index($id, $key)
|
161 |
-
{
|
162 |
-
$id = (int) $id;
|
163 |
-
if($id !== 0)
|
164 |
-
{
|
165 |
-
/*
|
166 |
-
* Assign the outter array with the form ID and the value as the configuration key
|
167 |
-
*/
|
168 |
-
$this->index[$id][] = $key;
|
169 |
-
}
|
170 |
-
}
|
171 |
-
|
172 |
-
/*
|
173 |
-
* Searches the index for the configuration key
|
174 |
-
* Return: form PDF configuration
|
175 |
-
*/
|
176 |
-
public function get_config($id)
|
177 |
-
{
|
178 |
-
return (isset($this->index[$id])) ? $this->index[$id] : false;
|
179 |
-
}
|
180 |
-
|
181 |
-
/**
|
182 |
-
* Pull all config nodes for a single form
|
183 |
-
* @param Integer $form_id The form ID a user is looking for
|
184 |
-
* @return Array The configuration nodes for a particular form
|
185 |
-
*/
|
186 |
-
public function get_form_configuration($form_id)
|
187 |
-
{
|
188 |
-
if(!isset($this->index[$form_id]))
|
189 |
-
{
|
190 |
-
return false;
|
191 |
-
}
|
192 |
-
|
193 |
-
$indexes = $this->index[$form_id];
|
194 |
-
|
195 |
-
$config_nodes = array();
|
196 |
-
|
197 |
-
foreach($indexes as $index)
|
198 |
-
{
|
199 |
-
$config_nodes[$index] = $this->configuration[$index];
|
200 |
-
}
|
201 |
-
|
202 |
-
return $config_nodes;
|
203 |
-
}
|
204 |
-
|
205 |
-
/**
|
206 |
-
* Depreciated
|
207 |
-
* See get_default_config_data()
|
208 |
-
*/
|
209 |
-
public function get_config_data($form_id)
|
210 |
-
{
|
211 |
-
return $this->get_default_config_data($form_id);
|
212 |
-
}
|
213 |
-
|
214 |
-
/**
|
215 |
-
* Replaced get_config_data in default tempaltes to only return the default-only configuration options
|
216 |
-
* @param integer $form_id form ID
|
217 |
-
* @return array Default template configuration options
|
218 |
-
*/
|
219 |
-
public function get_default_config_data($form_id)
|
220 |
-
{
|
221 |
-
$config = $this->pull_config_data($form_id);
|
222 |
-
|
223 |
-
/* get the default template values and return in array */
|
224 |
-
$show_html_fields = (isset($config['default-show-html']) && $config['default-show-html'] == 1) ? true : false;
|
225 |
-
$show_empty_fields = (isset($config['default-show-empty']) && $config['default-show-empty'] == 1) ? true : false;
|
226 |
-
$show_page_names = (isset($config['default-show-page-names']) && $config['default-show-page-names'] == 1) ? true : false;
|
227 |
-
$show_section_content = (isset($config['default-show-section-content']) && $config['default-show-section-content'] == 1) ? true : false;
|
228 |
-
|
229 |
-
return array(
|
230 |
-
'html_field' => $show_html_fields,
|
231 |
-
'empty_field' => $show_empty_fields,
|
232 |
-
'page_names' => $show_page_names,
|
233 |
-
'section_content' => $show_section_content,
|
234 |
-
);
|
235 |
-
}
|
236 |
-
|
237 |
-
/**
|
238 |
-
* Get the configuration information based on the form ID
|
239 |
-
* If multiple nodes assigned to form look for $_GET['aid']
|
240 |
-
* @param integer $form_id ID of the form
|
241 |
-
* @return array configuration node
|
242 |
-
*/
|
243 |
-
public function pull_config_data($form_id)
|
244 |
-
{
|
245 |
-
if(!isset($this->index[$form_id]))
|
246 |
-
{
|
247 |
-
return false;
|
248 |
-
}
|
249 |
-
|
250 |
-
$index = $this->index[$form_id];
|
251 |
-
|
252 |
-
/*
|
253 |
-
* Because we now allow multiple PDF templates per form we need a way to get the correct PDF settings
|
254 |
-
* To do this we use the $_GET variable 'aid'
|
255 |
-
* If 'aid' is not found we will pull the first entry
|
256 |
-
* Note: 'aid' has been incremented by 1 so 'aid' === 0 is never found
|
257 |
-
*/
|
258 |
-
if(isset($_GET['aid']) && (int) $_GET['aid'] > 0)
|
259 |
-
{
|
260 |
-
$aid = (int) $_GET['aid'] - 1;
|
261 |
-
return $this->configuration[$index[$aid]];
|
262 |
-
}
|
263 |
-
|
264 |
-
/*
|
265 |
-
* No valid configuration file found so pull the default
|
266 |
-
*/
|
267 |
-
return $this->configuration[$index[0]];
|
268 |
-
}
|
269 |
-
|
270 |
-
/**
|
271 |
-
* Gets the aid (a temporary ID assigned to config node clusters on a single form ) from the $config ID
|
272 |
-
* @param Integer $config_id The $this->configuration ID of the node
|
273 |
-
* @param Integer $form_id The Gravity Form ID
|
274 |
-
* @return Integer The configuration nodes aid (a temporary ID assigned to config node clusters on a single form )
|
275 |
-
*/
|
276 |
-
public function get_aid($config_id, $form_id)
|
277 |
-
{
|
278 |
-
$index = self::index_lookup($config_id, $form_id);
|
279 |
-
|
280 |
-
if($index !== false)
|
281 |
-
{
|
282 |
-
return $index + 1;
|
283 |
-
}
|
284 |
-
}
|
285 |
-
|
286 |
-
/**
|
287 |
-
* Does a reverse look up on the $this->index using the $this->configuration ID
|
288 |
-
* @param Integer $config_id The $this->configuration ID of the node
|
289 |
-
* @return Integer The index ID
|
290 |
-
* @return Array If $form_id isn't passed an array of index IDs will always be returns
|
291 |
-
*/
|
292 |
-
public function index_lookup($config_id, $form_id = false)
|
293 |
-
{
|
294 |
-
$config = $this->configuration[$config_id];
|
295 |
-
|
296 |
-
/*
|
297 |
-
* Check the configuration node actually exists
|
298 |
-
*/
|
299 |
-
if(!is_array($config))
|
300 |
-
{
|
301 |
-
return false;
|
302 |
-
}
|
303 |
-
|
304 |
-
/* get the form ID */
|
305 |
-
$config_form_id = (!is_array($config['form_id'])) ? array($config['form_id']) : $config['form_id'];
|
306 |
-
|
307 |
-
|
308 |
-
/*
|
309 |
-
* If $form_id is set and inside the config node array we will do a search on it
|
310 |
-
*/
|
311 |
-
if($form_id && in_array($form_id, $config_form_id) && isset($this->index[$form_id]))
|
312 |
-
{
|
313 |
-
/* return the array key, or false */
|
314 |
-
return array_search($config_id, $this->index[$form_id]);
|
315 |
-
}
|
316 |
-
|
317 |
-
/*
|
318 |
-
* Loop through the form IDs and return all indexes associated with it
|
319 |
-
*/
|
320 |
-
$index_keys = array();
|
321 |
-
foreach($config_form_id as $f_id)
|
322 |
-
{
|
323 |
-
if(isset($this->index[$f_id]))
|
324 |
-
{
|
325 |
-
/*
|
326 |
-
* Search for the config ID in each form's index
|
327 |
-
*/
|
328 |
-
$index_search = array_search($config_id, $this->index[$f_id]);
|
329 |
-
if($index_search !== false)
|
330 |
-
{
|
331 |
-
$index_keys[] = $index_search;
|
332 |
-
}
|
333 |
-
}
|
334 |
-
}
|
335 |
-
|
336 |
-
/*
|
337 |
-
* We have results so return them
|
338 |
-
*/
|
339 |
-
if(sizeof($index_keys) > 0)
|
340 |
-
{
|
341 |
-
return $index_keys;
|
342 |
-
}
|
343 |
-
|
344 |
-
return false;
|
345 |
-
}
|
346 |
-
|
347 |
-
/*
|
348 |
-
* Search for the template from a given form id
|
349 |
-
* Return: the first template found for the form
|
350 |
-
*/
|
351 |
-
public function get_template($form_id)
|
352 |
-
{
|
353 |
-
global $gf_pdf_default_configuration;
|
354 |
-
|
355 |
-
$template = '';
|
356 |
-
|
357 |
-
/* Set the default template based on if the default is set */
|
358 |
-
$default_template = self::$default['template'];
|
359 |
-
|
360 |
-
if(is_array($gf_pdf_default_configuration) && sizeof($gf_pdf_default_configuration) > 0 && isset($gf_pdf_default_configuration['template']) )
|
361 |
-
{
|
362 |
-
$default_template = $gf_pdf_default_configuration['template'];
|
363 |
-
}
|
364 |
-
|
365 |
-
if(isset($this->index[$form_id]))
|
366 |
-
{
|
367 |
-
/*
|
368 |
-
* Check if PDF template is avaliable
|
369 |
-
*/
|
370 |
-
if(isset($this->configuration[$this->index[$form_id][0]]['template']))
|
371 |
-
{
|
372 |
-
$user_template = (isset($_GET['template'])) ? $_GET['template'] : '';
|
373 |
-
$match = false;
|
374 |
-
|
375 |
-
foreach($this->index[$form_id] as $index)
|
376 |
-
{
|
377 |
-
if($this->configuration[$index]['template'] === $user_template)
|
378 |
-
{
|
379 |
-
$match = true;
|
380 |
-
}
|
381 |
-
}
|
382 |
-
|
383 |
-
$template = ($match === true) ? $user_template : $this->configuration[$this->index[$form_id][0]]['template'];
|
384 |
-
}
|
385 |
-
|
386 |
-
if(strlen($template) == 0)
|
387 |
-
{
|
388 |
-
$template = $default_template;
|
389 |
-
}
|
390 |
-
return $template;
|
391 |
-
}
|
392 |
-
|
393 |
-
if( (strlen($template) == 0) && (GFPDF_SET_DEFAULT_TEMPLATE === true))
|
394 |
-
{
|
395 |
-
/*
|
396 |
-
* Check if a default configuration is defined
|
397 |
-
*/
|
398 |
-
return $default_template;
|
399 |
-
}
|
400 |
-
else
|
401 |
-
{
|
402 |
-
return false;
|
403 |
-
}
|
404 |
-
|
405 |
-
}
|
406 |
-
|
407 |
-
public function get_pdf_name($id, $form_id = false, $lead_id = false)
|
408 |
-
{
|
409 |
-
if(isset($this->configuration[$id]['filename']))
|
410 |
-
{
|
411 |
-
return PDF_Common::validate_pdf_name($this->configuration[$id]['filename'], $form_id, $lead_id);
|
412 |
-
}
|
413 |
-
else
|
414 |
-
{
|
415 |
-
return PDF_Common::validate_pdf_name(PDF_Common::get_pdf_filename($form_id, $lead_id), $form_id, $lead_id);
|
416 |
-
}
|
417 |
-
}
|
418 |
-
|
419 |
-
public function validate_privileges($privs)
|
420 |
-
{
|
421 |
-
if(!is_array($privs))
|
422 |
-
{
|
423 |
-
return array();
|
424 |
-
}
|
425 |
-
|
426 |
-
$new_privs = array_filter($privs, array($this, 'array_filter_privilages'));
|
427 |
-
|
428 |
-
return $new_privs;
|
429 |
-
}
|
430 |
-
|
431 |
-
private function array_filter_privilages($i)
|
432 |
-
{
|
433 |
-
if(in_array($i, PDFGenerator::$allowed_privileges))
|
434 |
-
{
|
435 |
-
return true;
|
436 |
-
}
|
437 |
-
return false;
|
438 |
-
}
|
439 |
-
|
440 |
-
}
|
1 |
+
<?php
|
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 |
+
|
9 |
+
/*
|
10 |
+
This file is part of Gravity PDF.
|
11 |
+
|
12 |
+
Gravity PDF Copyright (C) 2015 Blue Liquid Designs
|
13 |
+
|
14 |
+
This program is free software; you can redistribute it and/or modify
|
15 |
+
it under the terms of the GNU General Public License as published by
|
16 |
+
the Free Software Foundation; either version 2 of the License, or
|
17 |
+
(at your option) any later version.
|
18 |
+
|
19 |
+
This program is distributed in the hope that it will be useful,
|
20 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
21 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
22 |
+
GNU General Public License for more details.
|
23 |
+
|
24 |
+
You should have received a copy of the GNU General Public License
|
25 |
+
along with this program; if not, write to the Free Software
|
26 |
+
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
27 |
+
*/
|
28 |
+
|
29 |
+
class PDFGenerator
|
30 |
+
{
|
31 |
+
|
32 |
+
/*
|
33 |
+
* Set default values for forms not assigned a PDF
|
34 |
+
*/
|
35 |
+
public static $default = array(
|
36 |
+
'template' => 'default-template.php',
|
37 |
+
'pdf_size' => 'a4',
|
38 |
+
'orientation' => 'portrait',
|
39 |
+
'rtf' => false,
|
40 |
+
'security' => false
|
41 |
+
);
|
42 |
+
|
43 |
+
public static $allowed_privileges = array('copy', 'print', 'modify', 'annot-forms', 'fill-forms', 'extract', 'assemble', 'print-highres');
|
44 |
+
|
45 |
+
public $configuration = array();
|
46 |
+
|
47 |
+
/*
|
48 |
+
* Switch to verify if configuration file exists.
|
49 |
+
* If not, user is using old functions.php method and we
|
50 |
+
* don't want to interfere with it.
|
51 |
+
*/
|
52 |
+
public $disabled = false;
|
53 |
+
|
54 |
+
/*
|
55 |
+
* The index holds the form_id and configuration key in $this->configuration
|
56 |
+
* so each form knows
|
57 |
+
*/
|
58 |
+
public $index = array();
|
59 |
+
|
60 |
+
public function __construct()
|
61 |
+
{
|
62 |
+
global $gfpdfe_data;
|
63 |
+
|
64 |
+
/*
|
65 |
+
* Do configuration pre-processing
|
66 |
+
*/
|
67 |
+
|
68 |
+
/*
|
69 |
+
* Check if user configuration file exists
|
70 |
+
* If not disable $configuration and $index.
|
71 |
+
*/
|
72 |
+
if(!file_exists( $gfpdfe_data->template_site_location . 'configuration.php') )
|
73 |
+
{
|
74 |
+
$this->disabled = true;
|
75 |
+
return;
|
76 |
+
}
|
77 |
+
else
|
78 |
+
{
|
79 |
+
/*
|
80 |
+
* Include the configuration file and set up the configuration variable.
|
81 |
+
*/
|
82 |
+
require_once( $gfpdfe_data->template_site_location . 'configuration.php' );
|
83 |
+
/*
|
84 |
+
* $gf_pdf_config included from configuration.php file
|
85 |
+
*/
|
86 |
+
$this->configuration = (isset($gf_pdf_config)) ? $gf_pdf_config : array();
|
87 |
+
|
88 |
+
/*
|
89 |
+
* Merge down the default configuration options
|
90 |
+
*/
|
91 |
+
foreach($this->configuration as &$node)
|
92 |
+
{
|
93 |
+
$node = $this->merge_defaults($node);
|
94 |
+
}
|
95 |
+
}
|
96 |
+
|
97 |
+
$this->pdf_config();
|
98 |
+
}
|
99 |
+
|
100 |
+
/**
|
101 |
+
* Merge the configuration node with the default options, ensuring the config node takes precendent
|
102 |
+
* @param array $config the configuration node from $gfpdf->configuration()
|
103 |
+
* @return array Merged default/node configuration options
|
104 |
+
*/
|
105 |
+
private function merge_defaults($config)
|
106 |
+
{
|
107 |
+
global $gf_pdf_default_configuration;
|
108 |
+
|
109 |
+
/*
|
110 |
+
* If the default settings are set we'll merge them into the configuration index
|
111 |
+
*/
|
112 |
+
if(is_array($gf_pdf_default_configuration) && sizeof($gf_pdf_default_configuration) > 0)
|
113 |
+
{
|
114 |
+
$config = array_replace_recursive($gf_pdf_default_configuration, $config);
|
115 |
+
}
|
116 |
+
|
117 |
+
return $config;
|
118 |
+
}
|
119 |
+
|
120 |
+
/*
|
121 |
+
* Run through user configuration and set PDF options
|
122 |
+
*/
|
123 |
+
private function pdf_config()
|
124 |
+
{
|
125 |
+
if(sizeof($this->configuration) == 0)
|
126 |
+
{
|
127 |
+
return;
|
128 |
+
}
|
129 |
+
|
130 |
+
$this->set_form_pdfs();
|
131 |
+
}
|
132 |
+
|
133 |
+
|
134 |
+
/*
|
135 |
+
* Set the configuration index so it's faster to access template configuration information
|
136 |
+
*/
|
137 |
+
private function set_form_pdfs()
|
138 |
+
{
|
139 |
+
foreach($this->configuration as $key => $config)
|
140 |
+
{
|
141 |
+
if(!is_array($config['form_id']))
|
142 |
+
{
|
143 |
+
$this->assign_index($config['form_id'], $key);
|
144 |
+
}
|
145 |
+
else
|
146 |
+
{
|
147 |
+
foreach($config['form_id'] as $id)
|
148 |
+
{
|
149 |
+
$this->assign_index($id, $key);
|
150 |
+
}
|
151 |
+
}
|
152 |
+
|
153 |
+
}
|
154 |
+
}
|
155 |
+
|
156 |
+
/*
|
157 |
+
* Check to see if ID is valid
|
158 |
+
* If so, assign ID => key to index
|
159 |
+
*/
|
160 |
+
public function assign_index($id, $key)
|
161 |
+
{
|
162 |
+
$id = (int) $id;
|
163 |
+
if($id !== 0)
|
164 |
+
{
|
165 |
+
/*
|
166 |
+
* Assign the outter array with the form ID and the value as the configuration key
|
167 |
+
*/
|
168 |
+
$this->index[$id][] = $key;
|
169 |
+
}
|
170 |
+
}
|
171 |
+
|
172 |
+
/*
|
173 |
+
* Searches the index for the configuration key
|
174 |
+
* Return: form PDF configuration
|
175 |
+
*/
|
176 |
+
public function get_config($id)
|
177 |
+
{
|
178 |
+
return (isset($this->index[$id])) ? $this->index[$id] : false;
|
179 |
+
}
|
180 |
+
|
181 |
+
/**
|
182 |
+
* Pull all config nodes for a single form
|
183 |
+
* @param Integer $form_id The form ID a user is looking for
|
184 |
+
* @return Array The configuration nodes for a particular form
|
185 |
+
*/
|
186 |
+
public function get_form_configuration($form_id)
|
187 |
+
{
|
188 |
+
if(!isset($this->index[$form_id]))
|
189 |
+
{
|
190 |
+
return false;
|
191 |
+
}
|
192 |
+
|
193 |
+
$indexes = $this->index[$form_id];
|
194 |
+
|
195 |
+
$config_nodes = array();
|
196 |
+
|
197 |
+
foreach($indexes as $index)
|
198 |
+
{
|
199 |
+
$config_nodes[$index] = $this->configuration[$index];
|
200 |
+
}
|
201 |
+
|
202 |
+
return $config_nodes;
|
203 |
+
}
|
204 |
+
|
205 |
+
/**
|
206 |
+
* Depreciated
|
207 |
+
* See get_default_config_data()
|
208 |
+
*/
|
209 |
+
public function get_config_data($form_id)
|
210 |
+
{
|
211 |
+
return $this->get_default_config_data($form_id);
|
212 |
+
}
|
213 |
+
|
214 |
+
/**
|
215 |
+
* Replaced get_config_data in default tempaltes to only return the default-only configuration options
|
216 |
+
* @param integer $form_id form ID
|
217 |
+
* @return array Default template configuration options
|
218 |
+
*/
|
219 |
+
public function get_default_config_data($form_id)
|
220 |
+
{
|
221 |
+
$config = $this->pull_config_data($form_id);
|
222 |
+
|
223 |
+
/* get the default template values and return in array */
|
224 |
+
$show_html_fields = (isset($config['default-show-html']) && $config['default-show-html'] == 1) ? true : false;
|
225 |
+
$show_empty_fields = (isset($config['default-show-empty']) && $config['default-show-empty'] == 1) ? true : false;
|
226 |
+
$show_page_names = (isset($config['default-show-page-names']) && $config['default-show-page-names'] == 1) ? true : false;
|
227 |
+
$show_section_content = (isset($config['default-show-section-content']) && $config['default-show-section-content'] == 1) ? true : false;
|
228 |
+
|
229 |
+
return array(
|
230 |
+
'html_field' => $show_html_fields,
|
231 |
+
'empty_field' => $show_empty_fields,
|
232 |
+
'page_names' => $show_page_names,
|
233 |
+
'section_content' => $show_section_content,
|
234 |
+
);
|
235 |
+
}
|
236 |
+
|
237 |
+
/**
|
238 |
+
* Get the configuration information based on the form ID
|
239 |
+
* If multiple nodes assigned to form look for $_GET['aid']
|
240 |
+
* @param integer $form_id ID of the form
|
241 |
+
* @return array configuration node
|
242 |
+
*/
|
243 |
+
public function pull_config_data($form_id)
|
244 |
+
{
|
245 |
+
if(!isset($this->index[$form_id]))
|
246 |
+
{
|
247 |
+
return false;
|
248 |
+
}
|
249 |
+
|
250 |
+
$index = $this->index[$form_id];
|
251 |
+
|
252 |
+
/*
|
253 |
+
* Because we now allow multiple PDF templates per form we need a way to get the correct PDF settings
|
254 |
+
* To do this we use the $_GET variable 'aid'
|
255 |
+
* If 'aid' is not found we will pull the first entry
|
256 |
+
* Note: 'aid' has been incremented by 1 so 'aid' === 0 is never found
|
257 |
+
*/
|
258 |
+
if(isset($_GET['aid']) && (int) $_GET['aid'] > 0)
|
259 |
+
{
|
260 |
+
$aid = (int) $_GET['aid'] - 1;
|
261 |
+
return $this->configuration[$index[$aid]];
|
262 |
+
}
|
263 |
+
|
264 |
+
/*
|
265 |
+
* No valid configuration file found so pull the default
|
266 |
+
*/
|
267 |
+
return $this->configuration[$index[0]];
|
268 |
+
}
|
269 |
+
|
270 |
+
/**
|
271 |
+
* Gets the aid (a temporary ID assigned to config node clusters on a single form ) from the $config ID
|
272 |
+
* @param Integer $config_id The $this->configuration ID of the node
|
273 |
+
* @param Integer $form_id The Gravity Form ID
|
274 |
+
* @return Integer The configuration nodes aid (a temporary ID assigned to config node clusters on a single form )
|
275 |
+
*/
|
276 |
+
public function get_aid($config_id, $form_id)
|
277 |
+
{
|
278 |
+
$index = self::index_lookup($config_id, $form_id);
|
279 |
+
|
280 |
+
if($index !== false)
|
281 |
+
{
|
282 |
+
return $index + 1;
|
283 |
+
}
|
284 |
+
}
|
285 |
+
|
286 |
+
/**
|
287 |
+
* Does a reverse look up on the $this->index using the $this->configuration ID
|
288 |
+
* @param Integer $config_id The $this->configuration ID of the node
|
289 |
+
* @return Integer The index ID
|
290 |
+
* @return Array If $form_id isn't passed an array of index IDs will always be returns
|
291 |
+
*/
|
292 |
+
public function index_lookup($config_id, $form_id = false)
|
293 |
+
{
|
294 |
+
$config = $this->configuration[$config_id];
|
295 |
+
|
296 |
+
/*
|
297 |
+
* Check the configuration node actually exists
|
298 |
+
*/
|
299 |
+
if(!is_array($config))
|
300 |
+
{
|
301 |
+
return false;
|
302 |
+
}
|
303 |
+
|
304 |
+
/* get the form ID */
|
305 |
+
$config_form_id = (!is_array($config['form_id'])) ? array($config['form_id']) : $config['form_id'];
|
306 |
+
|
307 |
+
|
308 |
+
/*
|
309 |
+
* If $form_id is set and inside the config node array we will do a search on it
|
310 |
+
*/
|
311 |
+
if($form_id && in_array($form_id, $config_form_id) && isset($this->index[$form_id]))
|
312 |
+
{
|
313 |
+
/* return the array key, or false */
|
314 |
+
return array_search($config_id, $this->index[$form_id]);
|
315 |
+
}
|
316 |
+
|
317 |
+
/*
|
318 |
+
* Loop through the form IDs and return all indexes associated with it
|
319 |
+
*/
|
320 |
+
$index_keys = array();
|
321 |
+
foreach($config_form_id as $f_id)
|
322 |
+
{
|
323 |
+
if(isset($this->index[$f_id]))
|
324 |
+
{
|
325 |
+
/*
|
326 |
+
* Search for the config ID in each form's index
|
327 |
+
*/
|
328 |
+
$index_search = array_search($config_id, $this->index[$f_id]);
|
329 |
+
if($index_search !== false)
|
330 |
+
{
|
331 |
+
$index_keys[] = $index_search;
|
332 |
+
}
|
333 |
+
}
|
334 |
+
}
|
335 |
+
|
336 |
+
/*
|
337 |
+
* We have results so return them
|
338 |
+
*/
|
339 |
+
if(sizeof($index_keys) > 0)
|
340 |
+
{
|
341 |
+
return $index_keys;
|
342 |
+
}
|
343 |
+
|
344 |
+
return false;
|
345 |
+
}
|
346 |
+
|
347 |
+
/*
|
348 |
+
* Search for the template from a given form id
|
349 |
+
* Return: the first template found for the form
|
350 |
+
*/
|
351 |
+
public function get_template($form_id)
|
352 |
+
{
|
353 |
+
global $gf_pdf_default_configuration;
|
354 |
+
|
355 |
+
$template = '';
|
356 |
+
|
357 |
+
/* Set the default template based on if the default is set */
|
358 |
+
$default_template = self::$default['template'];
|
359 |
+
|
360 |
+
if(is_array($gf_pdf_default_configuration) && sizeof($gf_pdf_default_configuration) > 0 && isset($gf_pdf_default_configuration['template']) )
|
361 |
+
{
|
362 |
+
$default_template = $gf_pdf_default_configuration['template'];
|
363 |
+
}
|
364 |
+
|
365 |
+
if(isset($this->index[$form_id]))
|
366 |
+
{
|
367 |
+
/*
|
368 |
+
* Check if PDF template is avaliable
|
369 |
+
*/
|
370 |
+
if(isset($this->configuration[$this->index[$form_id][0]]['template']))
|
371 |
+
{
|
372 |
+
$user_template = (isset($_GET['template'])) ? $_GET['template'] : '';
|
373 |
+
$match = false;
|
374 |
+
|
375 |
+
foreach($this->index[$form_id] as $index)
|
376 |
+
{
|
377 |
+
if($this->configuration[$index]['template'] === $user_template)
|
378 |
+
{
|
379 |
+
$match = true;
|
380 |
+
}
|
381 |
+
}
|
382 |
+
|
383 |
+
$template = ($match === true) ? $user_template : $this->configuration[$this->index[$form_id][0]]['template'];
|
384 |
+
}
|
385 |
+
|
386 |
+
if(strlen($template) == 0)
|
387 |
+
{
|
388 |
+
$template = $default_template;
|
389 |
+
}
|
390 |
+
return $template;
|
391 |
+
}
|
392 |
+
|
393 |
+
if( (strlen($template) == 0) && (GFPDF_SET_DEFAULT_TEMPLATE === true))
|
394 |
+
{
|
395 |
+
/*
|
396 |
+
* Check if a default configuration is defined
|
397 |
+
*/
|
398 |
+
return $default_template;
|
399 |
+
}
|
400 |
+
else
|
401 |
+
{
|
402 |
+
return false;
|
403 |
+
}
|
404 |
+
|
405 |
+
}
|
406 |
+
|
407 |
+
public function get_pdf_name($id, $form_id = false, $lead_id = false)
|
408 |
+
{
|
409 |
+
if(isset($this->configuration[$id]['filename']))
|
410 |
+
{
|
411 |
+
return PDF_Common::validate_pdf_name($this->configuration[$id]['filename'], $form_id, $lead_id);
|
412 |
+
}
|
413 |
+
else
|
414 |
+
{
|
415 |
+
return PDF_Common::validate_pdf_name(PDF_Common::get_pdf_filename($form_id, $lead_id), $form_id, $lead_id);
|
416 |
+
}
|
417 |
+
}
|
418 |
+
|
419 |
+
public function validate_privileges($privs)
|
420 |
+
{
|
421 |
+
if(!is_array($privs))
|
422 |
+
{
|
423 |
+
return array();
|
424 |
+
}
|
425 |
+
|
426 |
+
$new_privs = array_filter($privs, array($this, 'array_filter_privilages'));
|
427 |
+
|
428 |
+
return $new_privs;
|
429 |
+
}
|
430 |
+
|
431 |
+
private function array_filter_privilages($i)
|
432 |
+
{
|
433 |
+
if(in_array($i, PDFGenerator::$allowed_privileges))
|
434 |
+
{
|
435 |
+
return true;
|
436 |
+
}
|
437 |
+
return false;
|
438 |
+
}
|
439 |
+
|
440 |
+
}
|
helper/pdf-entry-detail.php
CHANGED
@@ -1,2038 +1,2054 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
This file is part of Gravity PDF.
|
5 |
-
|
6 |
-
Gravity PDF Copyright (C) 2015 Blue Liquid Designs
|
7 |
-
|
8 |
-
This program is free software; you can redistribute it and/or modify
|
9 |
-
it under the terms of the GNU General Public License as published by
|
10 |
-
the Free Software Foundation; either version 2 of the License, or
|
11 |
-
(at your option) any later version.
|
12 |
-
|
13 |
-
This program is distributed in the hope that it will be useful,
|
14 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
16 |
-
GNU General Public License for more details.
|
17 |
-
|
18 |
-
You should have received a copy of the GNU General Public License
|
19 |
-
along with this program; if not, write to the Free Software
|
20 |
-
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
21 |
-
*/
|
22 |
-
|
23 |
-
if(!class_exists('GFPDFEntryDetail'))
|
24 |
-
{
|
25 |
-
|
26 |
-
/*
|
27 |
-
* Include Gravity Forms Currency class (it not already included)
|
28 |
-
*/
|
29 |
-
if ( false === class_exists( 'RGCurrency' ) && class_exists('GFCommon') ) {
|
30 |
-
require_once( GFCommon::get_base_path() . '/currency.php' );
|
31 |
-
}
|
32 |
-
|
33 |
-
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 */
|
34 |
-
class GFPDFEntryDetail {
|
35 |
-
|
36 |
-
/* holds the form fields, stored by field ID */
|
37 |
-
static $fields;
|
38 |
-
|
39 |
-
/* depreciated function which we will replace with a better config passing method */
|
40 |
-
public static function lead_detail_grid($form, $lead, $allow_display_empty_fields=false, $show_html=false, $show_page_name=false, $return=false) {
|
41 |
-
|
42 |
-
$config = array(
|
43 |
-
'empty_field' => $allow_display_empty_fields,
|
44 |
-
'html_field' => $show_html,
|
45 |
-
'page_names' => $show_page_name,
|
46 |
-
'return' => $return,
|
47 |
-
);
|
48 |
-
|
49 |
-
return self::do_lead_detail_grid($form, $lead, $config);
|
50 |
-
}
|
51 |
-
|
52 |
-
|
53 |
-
public static function do_lead_detail_grid($form, $lead, $config) {
|
54 |
-
$form_id = $form['id'];
|
55 |
-
$results = array();
|
56 |
-
|
57 |
-
/*
|
58 |
-
* Set up our defaults and merge down the user config
|
59 |
-
*/
|
60 |
-
$defaults = array(
|
61 |
-
'empty_field' => false,
|
62 |
-
'html_field' => false,
|
63 |
-
'page_names' => false,
|
64 |
-
'return' => false,
|
65 |
-
'section_content' => false,
|
66 |
-
);
|
67 |
-
|
68 |
-
$config = array_merge($defaults, $config);
|
69 |
-
|
70 |
-
if($config['return'] === true)
|
71 |
-
{
|
72 |
-
$results['title'] = '<h2 id="details" class="default">'. $form['title'] .'</h2>';
|
73 |
-
}
|
74 |
-
else
|
75 |
-
{
|
76 |
-
?>
|
77 |
-
<div id='container'>
|
78 |
-
<h2 id='details' class='default'><?php echo $form['title']?></h2>
|
79 |
-
<?php
|
80 |
-
}
|
81 |
-
|
82 |
-
|
83 |
-
$count = 0;
|
84 |
-
$field_count = sizeof($form['fields']);
|
85 |
-
|
86 |
-
$has_product_fields = false;
|
87 |
-
|
88 |
-
$page_number = 0;
|
89 |
-
foreach($form['fields'] as $field) {
|
90 |
-
|
91 |
-
|
92 |
-
/*
|
93 |
-
* Check if this field has been excluded from the list
|
94 |
-
*/
|
95 |
-
if(isset($field['cssClass']) && strpos($field['cssClass'], 'exclude') !== false)
|
96 |
-
{
|
97 |
-
/* skip this field */
|
98 |
-
continue;
|
99 |
-
}
|
100 |
-
|
101 |
-
/*
|
102 |
-
* Skip over hidden fields
|
103 |
-
*/
|
104 |
-
if(GFFormsModel::is_field_hidden( $form, $field, array(), $lead ))
|
105 |
-
{
|
106 |
-
continue;
|
107 |
-
}
|
108 |
-
|
109 |
-
/*
|
110 |
-
* Check if we are to show the page names
|
111 |
-
*/
|
112 |
-
if($config['page_names'] === true)
|
113 |
-
{
|
114 |
-
if((int) $field['pageNumber'] !== $page_number && isset($form['pagination']['pages'][$page_number]))
|
115 |
-
{
|
116 |
-
/*
|
117 |
-
* Display the page number
|
118 |
-
*/
|
119 |
-
if($config['return'] === true)
|
120 |
-
{
|
121 |
-
$results['field'][] = '<h2 id="field-'. $field['id'].'" class="default entry-view-page-break">'. $form['pagination']['pages'][$page_number] .'</h2>';
|
122 |
-
}
|
123 |
-
else
|
124 |
-
{
|
125 |
-
?>
|
126 |
-
<h2 id='field-<?php echo $field['id']; ?>' class='default entry-view-page-break'><?php echo $form['pagination']['pages'][$page_number]; ?></h2>
|
127 |
-
<?php
|
128 |
-
}
|
129 |
-
/*
|
130 |
-
* Increment the page number
|
131 |
-
*/
|
132 |
-
$page_number++;
|
133 |
-
}
|
134 |
-
}
|
135 |
-
|
136 |
-
$even = $odd = '';
|
137 |
-
|
138 |
-
switch(RGFormsModel::get_input_type($field)){
|
139 |
-
case 'section' :
|
140 |
-
|
141 |
-
if(!GFCommon::is_section_empty($field, $form, $lead) || $config['empty_field'] || $config['section_content']){
|
142 |
-
$count++;
|
143 |
-
|
144 |
-
if($config['return'] === true)
|
145 |
-
{
|
146 |
-
$results['field'][] = '<h2 id="field-'.$field['id'].'" class="default entry-view-section-break">'. esc_html(GFCommon::get_label($field)) .'</h2>';
|
147 |
-
|
148 |
-
if($config['section_content'])
|
149 |
-
{
|
150 |
-
$results['field'][] = '<div class="default entry-view-section-break entry-view-section-break-content">' . $field['description'] . '</div>';
|
151 |
-
}
|
152 |
-
|
153 |
-
}
|
154 |
-
else
|
155 |
-
{
|
156 |
-
?>
|
157 |
-
<h2 id="field-<?php echo $field['id']; ?>" class="default entry-view-section-break"><?php echo esc_html(GFCommon::get_label($field))?></h2>
|
158 |
-
|
159 |
-
<?php if($config['section_content']): ?>
|
160 |
-
<div class="default entry-view-section-break entry-view-section-break-content"><?php echo $field['description']; ?></div>
|
161 |
-
<?php endif; ?>
|
162 |
-
<?php
|
163 |
-
}
|
164 |
-
}
|
165 |
-
break;
|
166 |
-
|
167 |
-
case 'captcha':
|
168 |
-
case 'password':
|
169 |
-
case 'page':
|
170 |
-
//ignore captcha, html, password, page field
|
171 |
-
break;
|
172 |
-
case 'html':
|
173 |
-
if($config['html_field'] == true)
|
174 |
-
{
|
175 |
-
|
176 |
-
$count++;
|
177 |
-
$is_last = $count >= $field_count && !$has_product_fields ? true : false;
|
178 |
-
$last_row = $is_last ? ' lastrow' : '';
|
179 |
-
$even = ($count%2) ? ' odd' : ' even';
|
180 |
-
|
181 |
-
$display_value = $field['content'];
|
182 |
-
$value = '';
|
183 |
-
|
184 |
-
$content = '<div id="field-'. $field['id'] .'" class="entry-view-html-value' . $last_row . $even . '"><div class="value">' . $display_value . '</div></div>';
|
185 |
-
$content = apply_filters('gfpdf_field_content', $content, $field, $value, $lead['id'], $form['id']);
|
186 |
-
|
187 |
-
if($config['return'] === true)
|
188 |
-
{
|
189 |
-
$results['field'][] = $content;
|
190 |
-
}
|
191 |
-
else
|
192 |
-
{
|
193 |
-
echo $content;
|
194 |
-
}
|
195 |
-
}
|
196 |
-
break;
|
197 |
-
case 'signature':
|
198 |
-
$value = RGFormsModel::get_lead_field_value($lead, $field);
|
199 |
-
$public_folder = RGFormsModel::get_upload_url_root() . 'signatures/';
|
200 |
-
$server_folder = RGFormsModel::get_upload_root() . 'signatures/';
|
201 |
-
$file = $server_folder.$value;
|
202 |
-
$display_value = false;
|
203 |
-
|
204 |
-
$is_last = $count >= $field_count ? true : false;
|
205 |
-
$last_row = $is_last ? ' lastrow' : '';
|
206 |
-
|
207 |
-
if(file_exists($file) && !is_dir($file))
|
208 |
-
{
|
209 |
-
$image_size = getimagesize($file);
|
210 |
-
$width = apply_filters('gfpdfe_signature_width', $image_size[0] / 4, $image_size[0]);
|
211 |
-
|
212 |
-
$display_value = '<img src="'. $file .'" alt="Signature" width=" '. $width .'" />';
|
213 |
-
}
|
214 |
-
|
215 |
-
if($display_value)
|
216 |
-
{
|
217 |
-
$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> ';
|
218 |
-
|
219 |
-
if($config['return'] === true)
|
220 |
-
{
|
221 |
-
$results['field'][] = $content;
|
222 |
-
}
|
223 |
-
else
|
224 |
-
{
|
225 |
-
echo $content;
|
226 |
-
}
|
227 |
-
}
|
228 |
-
elseif($config['empty_field'])
|
229 |
-
{
|
230 |
-
if($config['return'] === true)
|
231 |
-
{
|
232 |
-
$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 class="value"> </div></div>';
|
233 |
-
}
|
234 |
-
else
|
235 |
-
{
|
236 |
-
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 class="value"> </div></div>';
|
237 |
-
}
|
238 |
-
|
239 |
-
}
|
240 |
-
break;
|
241 |
-
|
242 |
-
default:
|
243 |
-
|
244 |
-
//ignore product fields as they will be grouped together at the end of the grid
|
245 |
-
if(GFCommon::is_product_field($field['type'])){
|
246 |
-
$has_product_fields = true;
|
247 |
-
continue;
|
248 |
-
}
|
249 |
-
|
250 |
-
$value = RGFormsModel::get_lead_field_value($lead, $field);
|
251 |
-
$display_value = self::pdf_get_lead_field_display($field, $value, $lead['currency']);
|
252 |
-
|
253 |
-
|
254 |
-
$display_value = apply_filters('gform_entry_field_value', $display_value, $field, $lead, $form);
|
255 |
-
|
256 |
-
if( !empty($display_value) || $display_value === '0' || $config['empty_field']){
|
257 |
-
$count++;
|
258 |
-
$is_last = $count >= $field_count && !$has_product_fields ? true : false;
|
259 |
-
$last_row = $is_last ? ' lastrow' : '';
|
260 |
-
$even = ($count%2) ? ' odd' : ' even';
|
261 |
-
|
262 |
-
$display_value = empty($display_value) && $display_value !== '0' ? ' ' : $display_value;
|
263 |
-
|
264 |
-
$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>';
|
265 |
-
|
266 |
-
$content = apply_filters('gfpdf_field_content', $content, $field, $value, $lead['id'], $form['id']);
|
267 |
-
|
268 |
-
if($config['return'] === true)
|
269 |
-
{
|
270 |
-
$results['field'][] = $content;
|
271 |
-
}
|
272 |
-
else
|
273 |
-
{
|
274 |
-
echo $content;
|
275 |
-
}
|
276 |
-
|
277 |
-
}
|
278 |
-
break;
|
279 |
-
}
|
280 |
-
|
281 |
-
}
|
282 |
-
$products = array();
|
283 |
-
if($has_product_fields){
|
284 |
-
if($config['return'] === true)
|
285 |
-
{
|
286 |
-
ob_start();
|
287 |
-
self::product_table($form, $lead);
|
288 |
-
$results['field'][] = ob_get_contents();
|
289 |
-
ob_end_clean();
|
290 |
-
}
|
291 |
-
else
|
292 |
-
{
|
293 |
-
self::product_table($form, $lead);
|
294 |
-
}
|
295 |
-
|
296 |
-
}
|
297 |
-
|
298 |
-
if($config['return'] === true)
|
299 |
-
{
|
300 |
-
return $results;
|
301 |
-
}
|
302 |
-
?>
|
303 |
-
</div>
|
304 |
-
<?php
|
305 |
-
}
|
306 |
-
|
307 |
-
public static function product_table($form, $lead)
|
308 |
-
{
|
309 |
-
$products = GFCommon::get_product_fields($form, $lead, true);
|
310 |
-
|
311 |
-
$form_id = $form['id'];
|
312 |
-
if(!empty($products['products'])){
|
313 |
-
?>
|
314 |
-
|
315 |
-
<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>
|
316 |
-
|
317 |
-
<table class='entry-products' autosize='1' cellspacing='0' width='97%'>
|
318 |
-
<colgroup>
|
319 |
-
<col class='entry-products-col1' />
|
320 |
-
<col class='entry-products-col2' />
|
321 |
-
<col class='entry-products-col3' />
|
322 |
-
<col class='entry-products-col4' />
|
323 |
-
</colgroup>
|
324 |
-
<thead>
|
325 |
-
<tr>
|
326 |
-
<th scope='col'><?php echo apply_filters('gform_product_{$form_id}', apply_filters('gform_product', __('Product', 'gravityforms'), $form_id), $form_id) ?></th>
|
327 |
-
<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>
|
328 |
-
<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>
|
329 |
-
<th scope='col'><?php echo apply_filters('gform_product_price_{$form_id}', apply_filters('gform_product_price', __('Price', 'gravityforms'), $form_id), $form_id) ?></th>
|
330 |
-
</tr>
|
331 |
-
</thead>
|
332 |
-
<tbody>
|
333 |
-
<?php
|
334 |
-
|
335 |
-
$total = 0;
|
336 |
-
foreach($products['products'] as $product){
|
337 |
-
?>
|
338 |
-
<tr>
|
339 |
-
<td>
|
340 |
-
<div class='product_name'><?php echo esc_html($product['name'])?></div>
|
341 |
-
|
342 |
-
<?php
|
343 |
-
$price = GFCommon::to_number($product['price']);
|
344 |
-
if(is_array(rgar($product,'options'))){
|
345 |
-
echo '<ul class="product_options">';
|
346 |
-
$count = sizeof($product['options']);
|
347 |
-
$index = 1;
|
348 |
-
foreach($product['options'] as $option){
|
349 |
-
$price += GFCommon::to_number($option['price']);
|
350 |
-
$class = $index == $count ? ' class="lastitem"' : '';
|
351 |
-
$index++;
|
352 |
-
?>
|
353 |
-
<li<?php echo $class?>><?php echo $option['option_label']?></li>
|
354 |
-
<?php
|
355 |
-
}
|
356 |
-
echo '</ul>';
|
357 |
-
}
|
358 |
-
$subtotal = floatval($product['quantity']) * $price;
|
359 |
-
$total += $subtotal;
|
360 |
-
?>
|
361 |
-
|
362 |
-
</td>
|
363 |
-
<td class='textcenter'><?php echo $product['quantity'] ?></td>
|
364 |
-
<td><?php echo GFCommon::to_money($price, $lead['currency']) ?></td>
|
365 |
-
<td><?php echo GFCommon::to_money($subtotal, $lead['currency']) ?></td>
|
366 |
-
</tr>
|
367 |
-
<?php
|
368 |
-
}
|
369 |
-
$total += floatval($products['shipping']['price']);
|
370 |
-
?>
|
371 |
-
|
372 |
-
|
373 |
-
<?php
|
374 |
-
if(!empty($products['shipping']['name'])){
|
375 |
-
?>
|
376 |
-
<tr>
|
377 |
-
<td colspan='2' rowspan='2' class='emptycell'> </td>
|
378 |
-
<td class='textright shipping'><?php echo $products['shipping']['name'] ?></td>
|
379 |
-
<td class='shipping_amount'><?php echo GFCommon::to_money($products['shipping']['price'], $lead['currency'])?> </td>
|
380 |
-
</tr>
|
381 |
-
<?php
|
382 |
-
}
|
383 |
-
?>
|
384 |
-
<tr>
|
385 |
-
<?php
|
386 |
-
if(empty($products['shipping']['name'])){
|
387 |
-
?>
|
388 |
-
<td colspan='2' class='emptycell'> </td>
|
389 |
-
<?php
|
390 |
-
}
|
391 |
-
?>
|
392 |
-
<td class='textright grandtotal'><?php _e('Total', 'gravityforms') ?></td>
|
393 |
-
<td class='grandtotal_amount'><?php echo GFCommon::to_money($total, $lead['currency'])?></td>
|
394 |
-
</tr>
|
395 |
-
</tbody>
|
396 |
-
|
397 |
-
</table>
|
398 |
-
|
399 |
-
<?php
|
400 |
-
}
|
401 |
-
}
|
402 |
-
|
403 |
-
/*
|
404 |
-
* Public method for outputting likert (survey addon field)
|
405 |
-
*/
|
406 |
-
public static function get_likert($form, $lead, $field_id)
|
407 |
-
{
|
408 |
-
$fields = self::$fields;
|
409 |
-
$field = $fields[$field_id];
|
410 |
-
$value = RGFormsModel::get_lead_field_value($lead, $field);
|
411 |
-
|
412 |
-
$display_value = apply_filters('gform_entry_field_value', self::pdf_get_lead_field_display($field, $value, ''), $field, $lead, $form);
|
413 |
-
$content = $display_value;
|
414 |
-
|
415 |
-
$results = apply_filters('gfpdf_field_content', $content, $field, $value, $lead['id'], $form['id']);
|
416 |
-
|
417 |
-
return $results;
|
418 |
-
}
|
419 |
-
|
420 |
-
/* returns the form values as an array instead of pre-formated html */
|
421 |
-
public static function lead_detail_grid_array($form, $lead){
|
422 |
-
|
423 |
-
$form_id = $form['id'];
|
424 |
-
$form_array = self::set_form_array_common($form, $lead, $form_id);
|
425 |
-
|
426 |
-
$has_product_fields = false;
|
427 |
-
|
428 |
-
foreach($form['fields'] as $field) {
|
429 |
-
|
430 |
-
|
431 |
-
/*
|
432 |
-
* Add field descriptions to the $form_data array
|
433 |
-
*/
|
434 |
-
if(isset($field['description']))
|
435 |
-
{
|
436 |
-
$form_array['field_descriptions'][$field['id']] = $field['description'];
|
437 |
-
}
|
438 |
-
|
439 |
-
switch(RGFormsModel::get_input_type($field)) {
|
440 |
-
case 'section' :
|
441 |
-
case 'html':
|
442 |
-
$form_array = self::get_html($field, $form_array);
|
443 |
-
break;
|
444 |
-
|
445 |
-
case 'captcha':
|
446 |
-
case 'password':
|
447 |
-
case 'page':
|
448 |
-
//ignore captcha, password and page
|
449 |
-
break;
|
450 |
-
case 'signature':
|
451 |
-
$form_array = self::get_signature($form, $lead, $field, $form_array);
|
452 |
-
|
453 |
-
break;
|
454 |
-
case 'fileupload':
|
455 |
-
$form_array = self::get_fileupload($form, $lead, $field, $form_array);
|
456 |
-
break;
|
457 |
-
case 'list':
|
458 |
-
/*
|
459 |
-
* We want list to run both this and the deafult so don't call break.
|
460 |
-
* Get the list array and store it outside of [field] in a new key called ['list']
|
461 |
-
*/
|
462 |
-
$form_array = self::get_default_list($lead, $field, $form_array);
|
463 |
-
|
464 |
-
case 'select':
|
465 |
-
case 'multiselect':
|
466 |
-
case 'radio':
|
467 |
-
|
468 |
-
if($field['type'] == 'quiz')
|
469 |
-
{
|
470 |
-
$form_array = self::get_quiz_radios($form, $lead, $field, $form_array);
|
471 |
-
}
|
472 |
-
elseif($field['type'] == 'poll' || $field['type'] == 'survey')
|
473 |
-
{
|
474 |
-
$form_array = self::get_poll_radios($form, $lead, $field, $form_array);
|
475 |
-
}
|
476 |
-
else
|
477 |
-
{
|
478 |
-
/* store values in regular [field] array */
|
479 |
-
$form_array = self::get_the_list($lead, $field, $form_array);
|
480 |
-
}
|
481 |
-
break;
|
482 |
-
|
483 |
-
case 'likert':
|
484 |
-
$form_array['survey']['likert'][$field['id']] = self::get_the_likert($form, $lead, $field, $form_array);
|
485 |
-
break;
|
486 |
-
|
487 |
-
case 'rank':
|
488 |
-
$form_array['survey']['rank'][$field['id']] = self::get_the_rank($form, $lead, $field, $form_array);
|
489 |
-
break;
|
490 |
-
|
491 |
-
case 'rating':
|
492 |
-
$form_array['survey']['rating'][$field['id']] = self::get_the_rank($form, $lead, $field, $form_array);
|
493 |
-
break;
|
494 |
-
|
495 |
-
case 'checkbox':
|
496 |
-
/* Only process non-survey checkbox fields */
|
497 |
-
if($field['type'] == 'checkbox') {
|
498 |
-
$form_array = self::get_the_list($lead, $field, $form_array);
|
499 |
-
break;
|
500 |
-
}
|
501 |
-
|
502 |
-
default:
|
503 |
-
|
504 |
-
|
505 |
-
//ignore product fields as they will be grouped together at the end of the grid
|
506 |
-
if(GFCommon::is_product_field($field['type'])){
|
507 |
-
$has_product_fields = true;
|
508 |
-
continue;
|
509 |
-
}
|
510 |
-
|
511 |
-
$form_array = self::get_defaults($lead, $field, $form_array);
|
512 |
-
|
513 |
-
break;
|
514 |
-
}
|
515 |
-
|
516 |
-
}
|
517 |
-
|
518 |
-
$form_array = self::get_product_array($form, $lead, $has_product_fields, $form_array);
|
519 |
-
|
520 |
-
return $form_array;
|
521 |
-
}
|
522 |
-
|
523 |
-
private static function get_quiz_radios($form, $lead, $field, $form_array)
|
524 |
-
{
|
525 |
-
$id = $field['id'];
|
526 |
-
$results = $lead[$id];
|
527 |
-
$return = array();
|
528 |
-
|
529 |
-
foreach($field['choices'] as $choice)
|
530 |
-
{
|
531 |
-
if(trim($choice['value']) == trim($results))
|
532 |
-
{
|
533 |
-
$return = array('text' => $choice['text'], 'isCorrect' => $choice['gquizIsCorrect']);
|
534 |
-
break;
|
535 |
-
}
|
536 |
-
}
|
537 |
-
|
538 |
-
/* add data to field tag correctly */
|
539 |
-
$form_array['field'][$field['id'].'.'.$field['label'].'_name'] = $return;
|
540 |
-
|
541 |
-
/* add ID incase want to use template on multiple duplicate forms with different field names */
|
542 |
-
$form_array['field'][$field['id']] = $return;
|
543 |
-
|
544 |
-
return $form_array;
|
545 |
-
|
546 |
-
}
|
547 |
-
|
548 |
-
private static function get_poll_radios($form, $lead, $field, $form_array)
|
549 |
-
{
|
550 |
-
|
551 |
-
$id = $field['id'];
|
552 |
-
$results = $lead[$id];
|
553 |
-
$return = array();
|
554 |
-
|
555 |
-
$return = self::get_poll_data($results, $field['choices']);
|
556 |
-
|
557 |
-
/* add data to field tag correctly */
|
558 |
-
$form_array['field'][$field['id'].'.'.$field['label'].'_name'] = $return;
|
559 |
-
|
560 |
-
/* add ID incase want to use template on multiple duplicate forms with different field names */
|
561 |
-
$form_array['field'][$field['id']] = $return;
|
562 |
-
|
563 |
-
return $form_array;
|
564 |
-
|
565 |
-
}
|
566 |
-
|
567 |
-
private static function get_poll_checkbox($field, $values)
|
568 |
-
{
|
569 |
-
foreach($values as $id => $item)
|
570 |
-
{
|
571 |
-
$values[$id] = self::get_poll_data($item, $field['choices']);
|
572 |
-
}
|
573 |
-
return $values;
|
574 |
-
}
|
575 |
-
|
576 |
-
private static function get_poll_data($lookup, $options)
|
577 |
-
{
|
578 |
-
$return = '';
|
579 |
-
|
580 |
-
foreach($options as $choice)
|
581 |
-
{
|
582 |
-
if(trim($choice['value']) == trim($lookup))
|
583 |
-
{
|
584 |
-
$return = $choice['text'];
|
585 |
-
break;
|
586 |
-
}
|
587 |
-
}
|
588 |
-
|
589 |
-
return $return;
|
590 |
-
}
|
591 |
-
|
592 |
-
private static function get_the_rank($form, $lead, $field, $form_array)
|
593 |
-
{
|
594 |
-
$id = $field['id'];
|
595 |
-
$results = explode(',', $lead[$id]);
|
596 |
-
$return = array();
|
597 |
-
|
598 |
-
foreach($results as $rank)
|
599 |
-
{
|
600 |
-
foreach($field['choices'] as $choice)
|
601 |
-
{
|
602 |
-
if(trim($choice['value']) == trim($rank))
|
603 |
-
{
|
604 |
-
$return[] = $choice['text'];
|
605 |
-
break;
|
606 |
-
}
|
607 |
-
}
|
608 |
-
}
|
609 |
-
|
610 |
-
return $return;
|
611 |
-
}
|
612 |
-
|
613 |
-
private static function get_the_likert($form, $lead, $field, $form_array)
|
614 |
-
{
|
615 |
-
$id = $field['id'];
|
616 |
-
$multiple_rows = rgar($field, "gsurveyLikertEnableMultipleRows");
|
617 |
-
|
618 |
-
if(!$multiple_rows)
|
619 |
-
{
|
620 |
-
$results = $lead[$id];
|
621 |
-
}
|
622 |
-
|
623 |
-
$likert = array();
|
624 |
-
|
625 |
-
/* store the column names */
|
626 |
-
foreach($field['choices'] as $col)
|
627 |
-
{
|
628 |
-
$likert['col'][$col['value']] = $col['text'];
|
629 |
-
}
|
630 |
-
|
631 |
-
if(is_array($field['inputs']) && sizeof($field['inputs']) > 0)
|
632 |
-
{
|
633 |
-
/* do our multi-row likert */
|
634 |
-
foreach($field['inputs'] as $row)
|
635 |
-
{
|
636 |
-
/* pad the array with the number of columns */
|
637 |
-
|
638 |
-
foreach($likert['col'] as $col_id => $text)
|
639 |
-
{
|
640 |
-
/*
|
641 |
-
* Results for multi row is stored with ID.ROW# (eg $lead['1.2'])
|
642 |
-
* The number is stored in $row['id']
|
643 |
-
*/
|
644 |
-
$results = $lead[$row['id']];
|
645 |
-
|
646 |
-
/* user data in the $lead comes in as ROW ID:COL ID */
|
647 |
-
$comparison = $row['name'] . ':' . $col_id;
|
648 |
-
|
649 |
-
/* do our comparison and update the output */
|
650 |
-
$output = ($comparison == $results) ? 'selected' : '';
|
651 |
-
|
652 |
-
/* assign our results to the array */
|
653 |
-
$likert['rows'][$row['label']][$text] = $output;
|
654 |
-
|
655 |
-
}
|
656 |
-
}
|
657 |
-
}
|
658 |
-
else
|
659 |
-
{
|
660 |
-
/* do our single row likert */
|
661 |
-
foreach($likert['col'] as $col_id => $text)
|
662 |
-
{
|
663 |
-
/* single row data comes in with col value */
|
664 |
-
/* do our comparison and update the output */
|
665 |
-
$output = ($col_id == $results) ? 'selected' : '';
|
666 |
-
|
667 |
-
$likert['row'][$text] = $output;
|
668 |
-
|
669 |
-
}
|
670 |
-
}
|
671 |
-
|
672 |
-
/*
|
673 |
-
* Check if scoring is enabled and calculate
|
674 |
-
*/
|
675 |
-
if($field['gsurveyLikertEnableScoring'] && class_exists('GFSurvey'))
|
676 |
-
{
|
677 |
-
$survey = GFSurvey::get_instance();
|
678 |
-
$likert['score'] = $survey->get_field_score($field, $lead);
|
679 |
-
}
|
680 |
-
|
681 |
-
return $likert;
|
682 |
-
|
683 |
-
}
|
684 |
-
|
685 |
-
private static function get_form_fields($form)
|
686 |
-
{
|
687 |
-
$fields = array();
|
688 |
-
foreach($form['fields'] as $field)
|
689 |
-
{
|
690 |
-
$fields[$field['id']] = $field;
|
691 |
-
}
|
692 |
-
|
693 |
-
self::$fields = $fields;
|
694 |
-
}
|
695 |
-
|
696 |
-
private static function set_form_array_common($form, $lead, $form_id)
|
697 |
-
{
|
698 |
-
/*
|
699 |
-
* Reorder the $form array as we can access the info by Field ID
|
700 |
-
*/
|
701 |
-
self::get_form_fields($form);
|
702 |
-
|
703 |
-
$form_array = array();
|
704 |
-
|
705 |
-
/*
|
706 |
-
* Add form_id and lead_id
|
707 |
-
*/
|
708 |
-
$form_array['form_id'] = $form_id;
|
709 |
-
$form_array['entry_id'] = $lead['id'];
|
710 |
-
|
711 |
-
/*
|
712 |
-
* Set title and dates (both US and international)
|
713 |
-
*/
|
714 |
-
$form_array['form_title'] = $form['title'];
|
715 |
-
$form_array['form_description'] = (isset($form['description'])) ? $form['description'] : '';
|
716 |
-
$form_array['date_created'] = GFCommon::format_date( $lead['date_created'], false, 'j/n/Y', false);
|
717 |
-
$form_array['date_created_usa'] = GFCommon::format_date( $lead['date_created'], false, 'n/j/Y', false);
|
718 |
-
|
719 |
-
/*
|
720 |
-
* Include page names
|
721 |
-
*/
|
722 |
-
$form_array['pages'] = $form['pagination']['pages'];
|
723 |
-
|
724 |
-
/*
|
725 |
-
* Add misc fields
|
726 |
-
*/
|
727 |
-
$form_array['misc']['date_time'] = GFCommon::format_date( $lead['date_created'], false, 'Y-m-d H:i:s', false);
|
728 |
-
$form_array['misc']['time_24hr'] = GFCommon::format_date( $lead['date_created'], false, 'H:i', false);
|
729 |
-
$form_array['misc']['time_12hr'] = GFCommon::format_date( $lead['date_created'], false, 'g:ia', false);
|
730 |
-
$form_array['misc']['is_starred'] = $lead['is_starred'];
|
731 |
-
$form_array['misc']['is_read'] = $lead['is_read'];
|
732 |
-
$form_array['misc']['ip'] = $lead['ip'];
|
733 |
-
$form_array['misc']['source_url'] = $lead['source_url'];
|
734 |
-
$form_array['misc']['post_id'] = $lead['post_id'];
|
735 |
-
$form_array['misc']['currency'] = $lead['currency'];
|
736 |
-
$form_array['misc']['payment_status'] = $lead['payment_status'];
|
737 |
-
$form_array['misc']['payment_date'] = $lead['payment_date'];
|
738 |
-
$form_array['misc']['transaction_id'] = $lead['transaction_id'];
|
739 |
-
$form_array['misc']['payment_amount'] = $lead['payment_amount'];
|
740 |
-
$form_array['misc']['is_fulfilled'] = $lead['is_fulfilled'];
|
741 |
-
$form_array['misc']['created_by'] = $lead['created_by'];
|
742 |
-
$form_array['misc']['transaction_type'] = $lead['transaction_type'];
|
743 |
-
$form_array['misc']['user_agent'] = $lead['user_agent'];
|
744 |
-
$form_array['misc']['status'] = $lead['status'];
|
745 |
-
|
746 |
-
|
747 |
-
|
748 |
-
/*
|
749 |
-
* Add quiz/survey/poll results
|
750 |
-
*/
|
751 |
-
|
752 |
-
if(class_exists('GFQuiz'))
|
753 |
-
{
|
754 |
-
$form_array = self::get_quiz_results($form_array, $form, $lead);
|
755 |
-
}
|
756 |
-
|
757 |
-
if(class_exists('GFSurvey'))
|
758 |
-
{
|
759 |
-
$form_array = self::get_survey_results($form_array, $form, $lead);
|
760 |
-
}
|
761 |
-
|
762 |
-
if(class_exists('GFPolls'))
|
763 |
-
{
|
764 |
-
$form_array = self::get_poll_results($form_array, $form, $lead);
|
765 |
-
}
|
766 |
-
|
767 |
-
return $form_array;
|
768 |
-
}
|
769 |
-
|
770 |
-
/**
|
771 |
-
* Sniff the form fields and determine if there are any of the $type avaluable
|
772 |
-
* @param string $type the field type we are looking for
|
773 |
-
* @param array $form the form array
|
774 |
-
* @return boolean Whether there is a match or not
|
775 |
-
*/
|
776 |
-
private static function check_for_fields($type, $form)
|
777 |
-
{
|
778 |
-
foreach($form['fields'] as $field)
|
779 |
-
{
|
780 |
-
if($field['type'] == $type)
|
781 |
-
{
|
782 |
-
return true;
|
783 |
-
}
|
784 |
-
}
|
785 |
-
return false;
|
786 |
-
}
|
787 |
-
|
788 |
-
private static function get_poll_results($form_array, $form, $lead)
|
789 |
-
{
|
790 |
-
if(self::check_for_fields('poll', $form) === false)
|
791 |
-
{
|
792 |
-
return $form_array;
|
793 |
-
}
|
794 |
-
|
795 |
-
$fields = self::get_related_fields($form["fields"], 'poll');
|
796 |
-
$poll_results = self::get_addon_global_data($form, array(), $fields);
|
797 |
-
|
798 |
-
$form_fields = self::$fields;
|
799 |
-
|
800 |
-
/*
|
801 |
-
* Convert the array keys into their text counterparts
|
802 |
-
* Loop through the global poll data
|
803 |
-
*/
|
804 |
-
foreach($poll_results['field_data'] as $id => &$choices)
|
805 |
-
{
|
806 |
-
/* get the $field */
|
807 |
-
$field = $form_fields[$id];
|
808 |
-
|
809 |
-
/* add the field name to the ['misc'] key */
|
810 |
-
$choices['misc']['label'] = $field['label'];
|
811 |
-
|
812 |
-
/* loop through the field choices */
|
813 |
-
foreach($field['choices'] as $choice)
|
814 |
-
{
|
815 |
-
$choices = self::replace_key($choices, $choice['value'], $choice['text']);
|
816 |
-
}
|
817 |
-
}
|
818 |
-
|
819 |
-
$form_array['poll']['global'] = $poll_results;
|
820 |
-
|
821 |
-
return $form_array;
|
822 |
-
}
|
823 |
-
|
824 |
-
private static function get_survey_results($form_array, $form, $lead)
|
825 |
-
{
|
826 |
-
if(self::check_for_fields('survey', $form) === false)
|
827 |
-
{
|
828 |
-
return $form_array;
|
829 |
-
}
|
830 |
-
|
831 |
-
/*
|
832 |
-
* If there are any survey results
|
833 |
-
* add them to the 'survey' key
|
834 |
-
*/
|
835 |
-
$fields = GFCommon::get_fields_by_type($form, array('survey'));
|
836 |
-
$count_survey_fields = count($fields);
|
837 |
-
|
838 |
-
if ($count_survey_fields > 0 && isset($lead['gsurvey_score']))
|
839 |
-
{
|
840 |
-
$form_array['survey']['score'] = $lead['gsurvey_score'];
|
841 |
-
}
|
842 |
-
|
843 |
-
$fields = self::get_related_fields($form["fields"], 'survey');
|
844 |
-
$form_array['survey']['global'] = self::get_addon_global_data($form, array(), $fields);
|
845 |
-
$form_fields = self::$fields;
|
846 |
-
|
847 |
-
/*
|
848 |
-
* Convert the array keys into their text counterparts
|
849 |
-
* Loop through the global survey data
|
850 |
-
*/
|
851 |
-
foreach($form_array['survey']['global']['field_data'] as $id => &$choices)
|
852 |
-
{
|
853 |
-
/* get the $field */
|
854 |
-
$field = $form_fields[$id];
|
855 |
-
|
856 |
-
/*
|
857 |
-
* Check if we have a multifield likert and replace the row key
|
858 |
-
*/
|
859 |
-
if(isset($field['gsurveyLikertEnableMultipleRows']) && $field['gsurveyLikertEnableMultipleRows'] == 1)
|
860 |
-
{
|
861 |
-
foreach($field['gsurveyLikertRows'] as $row)
|
862 |
-
{
|
863 |
-
$choices = self::replace_key($choices, $row['value'], $row['text']);
|
864 |
-
}
|
865 |
-
|
866 |
-
foreach($choices as $multi_id => &$multi_choices)
|
867 |
-
{
|
868 |
-
foreach($field['choices'] as $choice)
|
869 |
-
{
|
870 |
-
$multi_choices = self::replace_key($multi_choices, $choice['value'], $choice['text']);
|
871 |
-
}
|
872 |
-
}
|
873 |
-
}
|
874 |
-
|
875 |
-
|
876 |
-
/* replace the standard row data */
|
877 |
-
if(isset($field['choices']) && is_array($field['choices']))
|
878 |
-
{
|
879 |
-
foreach($field['choices'] as $choice)
|
880 |
-
{
|
881 |
-
$choices = self::replace_key($choices, $choice['value'], $choice['text']);
|
882 |
-
}
|
883 |
-
}
|
884 |
-
}
|
885 |
-
|
886 |
-
return $form_array;
|
887 |
-
|
888 |
-
}
|
889 |
-
|
890 |
-
private static function replace_key($array, $key, $text)
|
891 |
-
{
|
892 |
-
if($key != $text && isset($array[$key]))
|
893 |
-
{
|
894 |
-
/* replace the array key with the actual field name */
|
895 |
-
$array[$text] = $array[$key];
|
896 |
-
unset($array[$key]);
|
897 |
-
}
|
898 |
-
return $array;
|
899 |
-
}
|
900 |
-
|
901 |
-
private static function get_quiz_results($form_array, $form, $lead)
|
902 |
-
{
|
903 |
-
|
904 |
-
if(self::check_for_fields('quiz', $form) === false)
|
905 |
-
{
|
906 |
-
return $form_array;
|
907 |
-
}
|
908 |
-
|
909 |
-
/*
|
910 |
-
* If there are any quiz results
|
911 |
-
* add them to the 'quiz' key
|
912 |
-
*/
|
913 |
-
$fields = GFCommon::get_fields_by_type($form, array('quiz'));
|
914 |
-
$count_quiz_fields = count($fields);
|
915 |
-
|
916 |
-
if ($count_quiz_fields > 0)
|
917 |
-
{
|
918 |
-
$form_array['quiz']['config']['grading'] = (isset($form['gravityformsquiz']['grading'])) ? $form['gravityformsquiz']['grading'] : '';
|
919 |
-
$form_array['quiz']['config']['passPercent'] = (isset($form['gravityformsquiz']['passPercent'])) ? $form['gravityformsquiz']['passPercent'] : '';
|
920 |
-
$form_array['quiz']['config']['grades'] = (isset($form['gravityformsquiz']['grades'])) ? $form['gravityformsquiz']['grades'] : '';
|
921 |
-
|
922 |
-
$form_array['quiz']['results']['score'] = rgar($lead, 'gquiz_score');
|
923 |
-
$form_array['quiz']['results']['percent'] = rgar($lead, 'gquiz_percent');
|
924 |
-
$form_array['quiz']['results']['is_pass'] = rgar($lead, 'gquiz_is_pass');
|
925 |
-
$form_array['quiz']['results']['grade'] = rgar($lead, 'gquiz_grade');
|
926 |
-
|
927 |
-
/*
|
928 |
-
* Get the overall results
|
929 |
-
*/
|
930 |
-
|
931 |
-
$quiz_global = self::get_quiz_overalls($form);
|
932 |
-
|
933 |
-
$form_fields = self::$fields;
|
934 |
-
/*
|
935 |
-
* Convert the array keys into their text counterparts
|
936 |
-
* Loop through the global quiz data
|
937 |
-
*/
|
938 |
-
if(empty($quiz_global['field_data']))
|
939 |
-
{
|
940 |
-
$quiz_global['field_data'] = array();
|
941 |
-
}
|
942 |
-
|
943 |
-
foreach($quiz_global['field_data'] as $id => &$choices)
|
944 |
-
{
|
945 |
-
/* get the $field */
|
946 |
-
$field = $form_fields[$id];
|
947 |
-
|
948 |
-
/* replace ['totals'] key with ['misc'] key */
|
949 |
-
$choices = self::replace_key($choices, 'totals', 'misc');
|
950 |
-
|
951 |
-
/* add the field name to the ['misc'] key */
|
952 |
-
$choices['misc']['label'] = $field['label'];
|
953 |
-
|
954 |
-
/* loop through the field choices */
|
955 |
-
foreach($field['choices'] as $choice)
|
956 |
-
{
|
957 |
-
$choices = self::replace_key($choices, $choice['value'], $choice['text']);
|
958 |
-
|
959 |
-
/* check if this is the correct field */
|
960 |
-
if(isset($choice['gquizIsCorrect']) && $choice['gquizIsCorrect'] == 1)
|
961 |
-
{
|
962 |
-
$choices['misc']['correct_option_name'][] = $choice['text'];
|
963 |
-
}
|
964 |
-
|
965 |
-
}
|
966 |
-
}
|
967 |
-
|
968 |
-
$form_array['quiz']['global'] = $quiz_global;
|
969 |
-
//$form_array['quiz']['global'] = self::get_quiz_overalls($form);
|
970 |
-
|
971 |
-
}
|
972 |
-
|
973 |
-
return $form_array;
|
974 |
-
}
|
975 |
-
|
976 |
-
private static function get_addon_global_data($form, $options, $fields)
|
977 |
-
{
|
978 |
-
/* if the results class isn't loaded, load it */
|
979 |
-
if (!class_exists("GFResults"))
|
980 |
-
{
|
981 |
-
require_once(GFCommon::get_base_path() . "/includes/addon/class-gf-results.php");
|
982 |
-
}
|
983 |
-
|
984 |
-
$form_id = $form['id'];
|
985 |
-
|
986 |
-
/* add form filter to keep in line with GF standard */
|
987 |
-
$form = apply_filters( "gform_form_pre_results_$form_id", apply_filters( 'gform_form_pre_results', $form ) );
|
988 |
-
|
989 |
-
/* initiat the results class */
|
990 |
-
$gf_results = new GFResults('', $options);
|
991 |
-
|
992 |
-
/* ensure that only active leads are queried */
|
993 |
-
$search = array(
|
994 |
-
'field_filters' => array('mode' => ''),
|
995 |
-
'status' => 'active'
|
996 |
-
);
|
997 |
-
|
998 |
-
/* get the results */
|
999 |
-
$data = $gf_results->get_results_data($form, $fields, $search);
|
1000 |
-
|
1001 |
-
/* unset some array keys we don't need */
|
1002 |
-
unset($data['status']);
|
1003 |
-
unset($data['timestamp']);
|
1004 |
-
|
1005 |
-
return $data;
|
1006 |
-
|
1007 |
-
}
|
1008 |
-
|
1009 |
-
/**
|
1010 |
-
* Gravity Forms is throwing notices when accessing get_results_data()
|
1011 |
-
* due to poor validation. To fix this we'll unset the 'choices' array key
|
1012 |
-
* if it is not an array (the expected input for this function)
|
1013 |
-
* @param Array $fields The fields array
|
1014 |
-
* @return Array The processed fields array
|
1015 |
-
*/
|
1016 |
-
private static function get_related_fields($fields, $type)
|
1017 |
-
{
|
1018 |
-
foreach($fields as $id => $field)
|
1019 |
-
{
|
1020 |
-
if($field['type'] !== $type)
|
1021 |
-
{
|
1022 |
-
unset($fields[$id]);
|
1023 |
-
continue;
|
1024 |
-
}
|
1025 |
-
}
|
1026 |
-
|
1027 |
-
return $fields;
|
1028 |
-
}
|
1029 |
-
|
1030 |
-
private static function get_quiz_overalls($form)
|
1031 |
-
{
|
1032 |
-
/* we need to tap into functions GF Quiz has so only run if it is active */
|
1033 |
-
if(class_exists('GFQuiz'))
|
1034 |
-
{
|
1035 |
-
/* GFQuiz is a singleton. Get the instance */
|
1036 |
-
$quiz = GFQuiz::get_instance();
|
1037 |
-
|
1038 |
-
/* create our callback to add additional data to the array specific to the quiz plugin */
|
1039 |
-
$options['callbacks']['calculation'] = array(
|
1040 |
-
$quiz,
|
1041 |
-
'results_calculation'
|
1042 |
-
);
|
1043 |
-
|
1044 |
-
$fields = self::get_related_fields($form["fields"], 'quiz');
|
1045 |
-
|
1046 |
-
$quiz_results = self::get_addon_global_data($form, $options, $fields);
|
1047 |
-
|
1048 |
-
return $quiz_results;
|
1049 |
-
}
|
1050 |
-
|
1051 |
-
return array(__('Activate Gravity Forms Quiz Add On to see global quiz statistics for this form', 'pdfextended'));
|
1052 |
-
}
|
1053 |
-
|
1054 |
-
private static function get_html($field, $form_array)
|
1055 |
-
{
|
1056 |
-
if(isset($field['content']))
|
1057 |
-
{
|
1058 |
-
$form_array['html'][] = wpautop($field['content']);
|
1059 |
-
$form_array['html_id'][$field['id']] = wpautop($field['content']);
|
1060 |
-
}
|
1061 |
-
|
1062 |
-
return $form_array;
|
1063 |
-
}
|
1064 |
-
|
1065 |
-
private static function get_signature($form, $lead, $field, $form_array)
|
1066 |
-
{
|
1067 |
-
$value = RGFormsModel::get_lead_field_value($lead, $field);
|
1068 |
-
$http_folder = RGFormsModel::get_upload_url_root(). 'signatures/';
|
1069 |
-
$server_folder = RGFormsModel::get_upload_root() . 'signatures/';
|
1070 |
-
$file = $server_folder.$value;
|
1071 |
-
$sig_html = '';
|
1072 |
-
|
1073 |
-
/*
|
1074 |
-
* Set defaults is we cannot find the images
|
1075 |
-
*/
|
1076 |
-
$width = 75;
|
1077 |
-
$height = 45;
|
1078 |
-
|
1079 |
-
/*
|
1080 |
-
* Only get sane defaults specific to the image if we can find it.
|
1081 |
-
*/
|
1082 |
-
if(file_exists($file) !== false && is_dir($file) !== true)
|
1083 |
-
{
|
1084 |
-
$image_size = getimagesize($file);
|
1085 |
-
$width = $image_size[0] / 4;
|
1086 |
-
$height = $image_size[1] / 4;
|
1087 |
-
$sig_html = '<img src="'. $server_folder.$value .'" alt="Signature" width="'. $width .'" height="'. $height .'" />';
|
1088 |
-
}
|
1089 |
-
|
1090 |
-
/*
|
1091 |
-
* Include the image details
|
1092 |
-
*/
|
1093 |
-
|
1094 |
-
|
1095 |
-
$form_array['signature'][] = $sig_html;
|
1096 |
-
$form_array['signature_details'][] = array(
|
1097 |
-
'img' => $sig_html,
|
1098 |
-
'path' => $file,
|
1099 |
-
'url' => $http_folder.$value,
|
1100 |
-
'width' => $width,
|
1101 |
-
'height' => $height,
|
1102 |
-
);
|
1103 |
-
|
1104 |
-
$form_array['signature_details_id'][$field['id']] = array(
|
1105 |
-
'img' => $sig_html,
|
1106 |
-
'path' => $file,
|
1107 |
-
'url' => $http_folder.$value,
|
1108 |
-
'width' => $width,
|
1109 |
-
'height' => $height,
|
1110 |
-
);
|
1111 |
-
|
1112 |
-
|
1113 |
-
return $form_array;
|
1114 |
-
}
|
1115 |
-
|
1116 |
-
private static function get_fileupload($form, $lead, $field, $form_array)
|
1117 |
-
{
|
1118 |
-
$value = RGFormsModel::get_lead_field_value($lead, $field);
|
1119 |
-
$display = self::get_lead_field_display($field, $value, $lead['currency']);
|
1120 |
-
|
1121 |
-
/*
|
1122 |
-
* Get the absolute path to the upload
|
1123 |
-
*/
|
1124 |
-
$path = str_replace(home_url().'/', ABSPATH, $display);
|
1125 |
-
|
1126 |
-
/* add path */
|
1127 |
-
$form_array['field'][$field['id'].'_path'] = $path;
|
1128 |
-
$form_array['field'][$field['id'].'.'.$field['label'].'_path'] = $path;
|
1129 |
-
|
1130 |
-
return self::assign_form($field, $display, $form_array);
|
1131 |
-
}
|
1132 |
-
|
1133 |
-
private static function get_default_list($lead, $field, $form_array)
|
1134 |
-
{
|
1135 |
-
$value = self::remove_empty_list_rows(unserialize(RGFormsModel::get_lead_field_value($lead, $field)));
|
1136 |
-
$form_array['list'][$field['id']] = $value;
|
1137 |
-
|
1138 |
-
return $form_array;
|
1139 |
-
}
|
1140 |
-
|
1141 |
-
private static function remove_empty_list_rows($list)
|
1142 |
-
{
|
1143 |
-
/*
|
1144 |
-
* Check if there are any values in the list
|
1145 |
-
*/
|
1146 |
-
if(!is_array($list) || sizeof($list) == 0)
|
1147 |
-
{
|
1148 |
-
return $list;
|
1149 |
-
}
|
1150 |
-
|
1151 |
-
/*
|
1152 |
-
* Check if it's a multi column list
|
1153 |
-
*/
|
1154 |
-
if(!is_array($list[0]))
|
1155 |
-
{
|
1156 |
-
$list = array_filter($list);
|
1157 |
-
}
|
1158 |
-
else
|
1159 |
-
{
|
1160 |
-
$list = self::remove_empty_multi_col_list($list);
|
1161 |
-
}
|
1162 |
-
|
1163 |
-
return $list;
|
1164 |
-
}
|
1165 |
-
|
1166 |
-
private static function remove_empty_multi_col_list($list)
|
1167 |
-
{
|
1168 |
-
foreach($list as $id => $row)
|
1169 |
-
{
|
1170 |
-
|
1171 |
-
$empty = true;
|
1172 |
-
foreach($row as &$col)
|
1173 |
-
{
|
1174 |
-
/* check if there is data and if so break the loop */
|
1175 |
-
if(trim(strlen($col) > 0))
|
1176 |
-
{
|
1177 |
-
$empty = false;
|
1178 |
-
break;
|
1179 |
-
}
|
1180 |
-
}
|
1181 |
-
|
1182 |
-
/* remove row from list */
|
1183 |
-
if($empty)
|
1184 |
-
{
|
1185 |
-
unset($list[$id]);
|
1186 |
-
}
|
1187 |
-
}
|
1188 |
-
|
1189 |
-
return $list;
|
1190 |
-
}
|
1191 |
-
|
1192 |
-
private static function get_the_list($lead, $field, $form_array)
|
1193 |
-
{
|
1194 |
-
$value = RGFormsModel::get_lead_field_value($lead, $field);
|
1195 |
-
$display = self::get_lead_field_display($field, $value, $lead['currency']);
|
1196 |
-
|
1197 |
-
$form_array = self::assign_form($field, $display, $form_array);
|
1198 |
-
|
1199 |
-
/*
|
1200 |
-
* Include these items correct names
|
1201 |
-
*/
|
1202 |
-
$display = self::get_lead_field_display($field, $value, $lead['currency'], true);
|
1203 |
-
/* add data to field tag correctly */
|
1204 |
-
$form_array['field'][$field['id'].'.'.$field['label'].'_name'] = $display;
|
1205 |
-
|
1206 |
-
/* add ID incase want to use template on multiple duplicate forms with different field names */
|
1207 |
-
$form_array['field'][$field['id'].'_name'] = $display;
|
1208 |
-
|
1209 |
-
/* keep backwards compatibility */
|
1210 |
-
$form_array['field'][$field['label'].'_name'] = $display;
|
1211 |
-
|
1212 |
-
return $form_array;
|
1213 |
-
}
|
1214 |
-
|
1215 |
-
private static function get_defaults($lead, $field, $form_array)
|
1216 |
-
{
|
1217 |
-
$value = RGFormsModel::get_lead_field_value($lead, $field);
|
1218 |
-
$display = self::get_lead_field_display($field, $value, $lead['currency']);
|
1219 |
-
|
1220 |
-
return self::assign_form($field, $display, $form_array);
|
1221 |
-
}
|
1222 |
-
|
1223 |
-
private static function assign_form($field, $display, $form_array)
|
1224 |
-
{
|
1225 |
-
/* add data to field tag correctly */
|
1226 |
-
$form_array['field'][$field['id'].'.'.$field['label']] = $display;
|
1227 |
-
|
1228 |
-
/* add ID incase want to use template on multiple duplicate forms with different field names */
|
1229 |
-
$form_array['field'][$field['id']] = $display;
|
1230 |
-
|
1231 |
-
/* keep backwards compatibility */
|
1232 |
-
$form_array['field'][$field['label']] = $display;
|
1233 |
-
|
1234 |
-
return $form_array;
|
1235 |
-
}
|
1236 |
-
|
1237 |
-
private static function get_product_array($form, $lead, $has_product_fields, $form_array)
|
1238 |
-
{
|
1239 |
-
$currency_type = (method_exists('GFCommon', 'is_currency_decimal_dot')) ? GFCommon::is_currency_decimal_dot() : PDF_Common::is_currency_decimal_dot();
|
1240 |
-
$currency_format = $currency_type ? 'decimal_dot' : 'decimal_comma';
|
1241 |
-
|
1242 |
-
if($has_product_fields) {
|
1243 |
-
$products = GFCommon::get_product_fields($form, $lead, true);
|
1244 |
-
|
1245 |
-
/* check that there are actual product fields */
|
1246 |
-
if(sizeof($products['products']) > 0 )
|
1247 |
-
{
|
1248 |
-
|
1249 |
-
/*
|
1250 |
-
* Set up our variables
|
1251 |
-
*/
|
1252 |
-
$total = 0;
|
1253 |
-
$subtotal = 0;
|
1254 |
-
|
1255 |
-
foreach($products['products'] as $id => $product) {
|
1256 |
-
$price = GFCommon::to_number($product['price']);
|
1257 |
-
|
1258 |
-
/* add all options to total price */
|
1259 |
-
if(is_array(rgar($product,'options')))
|
1260 |
-
{
|
1261 |
-
foreach($product['options'] as $option){
|
1262 |
-
$price += GFCommon::to_number($option['price']);
|
1263 |
-
}
|
1264 |
-
}
|
1265 |
-
|
1266 |
-
/* calculate subtotal */
|
1267 |
-
$subtotal = floatval($product['quantity']) * $price;
|
1268 |
-
$total += $subtotal;
|
1269 |
-
|
1270 |
-
/*
|
1271 |
-
* Check if we should include options
|
1272 |
-
*/
|
1273 |
-
$options = isset($product['options']) ? $product['options'] : array();
|
1274 |
-
|
1275 |
-
/*
|
1276 |
-
* Add formated price for each product option
|
1277 |
-
*/
|
1278 |
-
foreach($options as &$o)
|
1279 |
-
{
|
1280 |
-
if(is_numeric($o['price']))
|
1281 |
-
{
|
1282 |
-
$o['price_formatted'] = GFCommon::format_number($o['price'], 'currency');
|
1283 |
-
}
|
1284 |
-
}
|
1285 |
-
|
1286 |
-
/*
|
1287 |
-
* Store product in $form_array array
|
1288 |
-
*/
|
1289 |
-
$form_array['products'][$id] = array(
|
1290 |
-
'name' => esc_html($product['name']),
|
1291 |
-
'price' => esc_html($product['price']),
|
1292 |
-
'price_unformatted' => GFCommon::clean_number($product['price'], $currency_format),
|
1293 |
-
'options' => $options,
|
1294 |
-
'quantity' => $product['quantity'],
|
1295 |
-
'subtotal' => $subtotal,
|
1296 |
-
'subtotal_formatted' => GFCommon::format_number($subtotal, 'currency'));
|
1297 |
-
}
|
1298 |
-
|
1299 |
-
/* Increment total */
|
1300 |
-
$total += floatval($products['shipping']['price']);
|
1301 |
-
$subtotal = $total - floatval($products['shipping']['price']);
|
1302 |
-
|
1303 |
-
/* add totals to form data */
|
1304 |
-
$form_array['products_totals'] = array(
|
1305 |
-
'subtotal' => $subtotal,
|
1306 |
-
'shipping' => $products['shipping']['price'],
|
1307 |
-
'total' => $total,
|
1308 |
-
'shipping_formatted' => GFCommon::format_number($products['shipping']['price'], 'currency'),
|
1309 |
-
'subtotal_formatted' => GFCommon::format_number($subtotal, 'currency'),
|
1310 |
-
'total_formatted' => GFCommon::format_number($total, 'currency'),
|
1311 |
-
);
|
1312 |
-
}
|
1313 |
-
}
|
1314 |
-
|
1315 |
-
return $form_array;
|
1316 |
-
}
|
1317 |
-
|
1318 |
-
public static function get_lead_field_display($field, $value, $currency='', $use_text=false, $format='html', $media='screen'){
|
1319 |
-
|
1320 |
-
if($field['type'] == 'post_category')
|
1321 |
-
$value = GFCommon::prepare_post_category_value($value, $field);
|
1322 |
-
|
1323 |
-
switch(RGFormsModel::get_input_type($field)){
|
1324 |
-
case 'name' :
|
1325 |
-
if(is_array($value)){
|
1326 |
-
$prefix = trim(rgget($field['id'] . '.2', $value));
|
1327 |
-
$first = trim(rgget($field['id'] . '.3', $value));
|
1328 |
-
$middle = trim(rgget($field['id'] . '.4', $value));
|
1329 |
-
$last = trim(rgget($field['id'] . '.6', $value));
|
1330 |
-
$suffix = trim(rgget($field['id'] . '.8', $value));
|
1331 |
-
|
1332 |
-
return array('prefix' => $prefix, 'first' => $first, 'middle' => $middle, 'last' => $last, 'suffix' => $suffix);
|
1333 |
-
}
|
1334 |
-
else{
|
1335 |
-
return $value;
|
1336 |
-
}
|
1337 |
-
|
1338 |
-
break;
|
1339 |
-
case 'creditcard' :
|
1340 |
-
if(is_array($value)){
|
1341 |
-
$card_number = trim(rgget($field['id'] . '.1', $value));
|
1342 |
-
$card_type = trim(rgget($field['id'] . '.4', $value));
|
1343 |
-
return array('card_number' => $card_number, 'card_type' => $card_type);
|
1344 |
-
}
|
1345 |
-
else{
|
1346 |
-
return '';
|
1347 |
-
}
|
1348 |
-
break;
|
1349 |
-
|
1350 |
-
case 'address' :
|
1351 |
-
if(is_array($value)){
|
1352 |
-
$street_value = trim(rgget($field['id'] . '.1', $value));
|
1353 |
-
$street2_value = trim(rgget($field['id'] . '.2', $value));
|
1354 |
-
$city_value = trim(rgget($field['id'] . '.3', $value));
|
1355 |
-
$state_value = trim(rgget($field['id'] . '.4', $value));
|
1356 |
-
$zip_value = trim(rgget($field['id'] . '.5', $value));
|
1357 |
-
$country_value = trim(rgget($field['id'] . '.6', $value));
|
1358 |
-
|
1359 |
-
$line_break = $format == 'html' ? '<br />' : '\n';
|
1360 |
-
|
1361 |
-
$address_display_format = apply_filters('gform_address_display_format', 'default');
|
1362 |
-
|
1363 |
-
$address['street'] = $street_value;
|
1364 |
-
$address['street2'] = $street2_value;
|
1365 |
-
$address['city'] = $city_value;
|
1366 |
-
$address['state'] = $state_value;
|
1367 |
-
$address['zip'] = $zip_value;
|
1368 |
-
$address['country'] = $country_value;
|
1369 |
-
|
1370 |
-
return $address;
|
1371 |
-
}
|
1372 |
-
else{
|
1373 |
-
return '';
|
1374 |
-
}
|
1375 |
-
break;
|
1376 |
-
|
1377 |
-
case 'email' :
|
1378 |
-
return GFCommon::is_valid_email($value) && $format == 'html' ? $value : $value;
|
1379 |
-
break;
|
1380 |
-
|
1381 |
-
case 'website' :
|
1382 |
-
return GFCommon::is_valid_url($value) && $format == 'html' ? $value : $value;
|
1383 |
-
break;
|
1384 |
-
|
1385 |
-
case 'checkbox' :
|
1386 |
-
if(is_array($value)){
|
1387 |
-
|
1388 |
-
$items = array();
|
1389 |
-
|
1390 |
-
foreach($value as $key => $item){
|
1391 |
-
if(!empty($item)) {
|
1392 |
-
if($field['type'] == 'poll' || $field['type'] == 'survey')
|
1393 |
-
{
|
1394 |
-
/*
|
1395 |
-
* Convert our poll type
|
1396 |
-
*/
|
1397 |
-
$items[] = self::get_poll_checkbox($field, $value);
|
1398 |
-
return $items;
|
1399 |
-
}
|
1400 |
-
|
1401 |
-
switch($format){
|
1402 |
-
case 'text' :
|
1403 |
-
$items[] = GFCommon::selection_display($item, $field, $currency, $use_text);
|
1404 |
-
break;
|
1405 |
-
|
1406 |
-
default:
|
1407 |
-
$items[] = GFCommon::selection_display($item, $field, $currency, $use_text);
|
1408 |
-
break;
|
1409 |
-
}
|
1410 |
-
}
|
1411 |
-
}
|
1412 |
-
if(empty($items)){
|
1413 |
-
return '';
|
1414 |
-
}
|
1415 |
-
else if($format == 'text'){
|
1416 |
-
/*return substr($items, 0, strlen($items)-2); //removing last comma*/
|
1417 |
-
}
|
1418 |
-
else{
|
1419 |
-
return $items;
|
1420 |
-
}
|
1421 |
-
}
|
1422 |
-
else{
|
1423 |
-
return $value;
|
1424 |
-
}
|
1425 |
-
break;
|
1426 |
-
|
1427 |
-
case 'post_image' :
|
1428 |
-
$ary = explode('|:|', $value);
|
1429 |
-
$url = count($ary) > 0 ? $ary[0] : '';
|
1430 |
-
$title = count($ary) > 1 ? $ary[1] : '';
|
1431 |
-
$caption = count($ary) > 2 ? $ary[2] : '';
|
1432 |
-
$description = count($ary) > 3 ? $ary[3] : '';
|
1433 |
-
|
1434 |
-
if(!empty($url)){
|
1435 |
-
$url = str_replace(' ', '%20', $url);
|
1436 |
-
|
1437 |
-
$value = array('url' => $url,
|
1438 |
-
'path' => str_replace(site_url().'/', ABSPATH, $url),
|
1439 |
-
'title' => $title,
|
1440 |
-
'caption' => $caption,
|
1441 |
-
'description' => $description);
|
1442 |
-
}
|
1443 |
-
return $value;
|
1444 |
-
|
1445 |
-
case 'fileupload' :
|
1446 |
-
$output_arr = array();
|
1447 |
-
if(!empty($value)){
|
1448 |
-
$file_paths = rgar($field,'multipleFiles') ? json_decode($value) : array($value);
|
1449 |
-
foreach($file_paths as $file_path){
|
1450 |
-
$info = pathinfo($file_path);
|
1451 |
-
$file_path = esc_attr(str_replace(' ', '%20', $file_path));
|
1452 |
-
$output_arr[] = $file_path;
|
1453 |
-
}
|
1454 |
-
$output = join(PHP_EOL, $output_arr);
|
1455 |
-
}
|
1456 |
-
return $output_arr;
|
1457 |
-
break;
|
1458 |
-
|
1459 |
-
case 'date' :
|
1460 |
-
return GFCommon::date_display($value, rgar($field, 'dateFormat'));
|
1461 |
-
break;
|
1462 |
-
|
1463 |
-
case 'radio' :
|
1464 |
-
case 'select' :
|
1465 |
-
return GFCommon::selection_display($value, $field, $currency, $use_text);
|
1466 |
-
break;
|
1467 |
-
|
1468 |
-
case 'multiselect' :
|
1469 |
-
if(empty($value) || $format == 'text')
|
1470 |
-
return $value;
|
1471 |
-
|
1472 |
-
if(!is_array($value))
|
1473 |
-
{
|
1474 |
-
$value = explode(',', $value);
|
1475 |
-
}
|
1476 |
-
|
1477 |
-
$items = '';
|
1478 |
-
foreach($value as $item){
|
1479 |
-
$items[] = GFCommon::selection_display($item, $field, $currency, $use_text);
|
1480 |
-
}
|
1481 |
-
|
1482 |
-
if(sizeof($items) == 1)
|
1483 |
-
{
|
1484 |
-
return $items[0];
|
1485 |
-
}
|
1486 |
-
return $items;
|
1487 |
-
|
1488 |
-
|
1489 |
-
break;
|
1490 |
-
|
1491 |
-
case 'calculation' :
|
1492 |
-
case 'singleproduct' :
|
1493 |
-
if(is_array($value)){
|
1494 |
-
$product_name = trim($value[$field['id'] . '.1']);
|
1495 |
-
$price = trim($value[$field['id'] . '.2']);
|
1496 |
-
$quantity = trim($value[$field['id'] . '.3']);
|
1497 |
-
|
1498 |
-
$product = $product_name . ', ' . __('Qty: ', 'gravityforms') . $quantity . ', ' . __('Price: ', 'gravityforms') . $price;
|
1499 |
-
|
1500 |
-
return $product;
|
1501 |
-
}
|
1502 |
-
else{
|
1503 |
-
return '';
|
1504 |
-
}
|
1505 |
-
break;
|
1506 |
-
|
1507 |
-
case 'number' :
|
1508 |
-
return GFCommon::format_number($value, rgar($field, 'numberFormat'));
|
1509 |
-
break;
|
1510 |
-
|
1511 |
-
case 'singleshipping' :
|
1512 |
-
case 'donation' :
|
1513 |
-
case 'total' :
|
1514 |
-
case 'price' :
|
1515 |
-
return GFCommon::to_money($value, $currency);
|
1516 |
-
|
1517 |
-
case 'list' :
|
1518 |
-
if(empty($value))
|
1519 |
-
return '';
|
1520 |
-
$value = unserialize($value);
|
1521 |
-
|
1522 |
-
$has_columns = is_array($value[0]);
|
1523 |
-
|
1524 |
-
if(!$has_columns){
|
1525 |
-
$items = array();
|
1526 |
-
foreach($value as $key => $item){
|
1527 |
-
if(!empty($item)){
|
1528 |
-
switch($format){
|
1529 |
-
case 'text' :
|
1530 |
-
$items[] = $item;
|
1531 |
-
break;
|
1532 |
-
case 'url' :
|
1533 |
-
$items[] = $item;
|
1534 |
-
break;
|
1535 |
-
default :
|
1536 |
-
if($media == 'email'){
|
1537 |
-
$items[] = $item;
|
1538 |
-
}
|
1539 |
-
else{
|
1540 |
-
$items[] = $item;
|
1541 |
-
}
|
1542 |
-
break;
|
1543 |
-
}
|
1544 |
-
}
|
1545 |
-
}
|
1546 |
-
|
1547 |
-
if(empty($items)){
|
1548 |
-
return '';
|
1549 |
-
}
|
1550 |
-
else if($format == 'text'){
|
1551 |
-
/* return substr($items, 0, strlen($items)-2); //removing last comma*/
|
1552 |
-
return $items;
|
1553 |
-
}
|
1554 |
-
else if($format == 'url'){
|
1555 |
-
/*return substr($items, 0, strlen($items)-1); //removing last comma*/
|
1556 |
-
return $items;
|
1557 |
-
}
|
1558 |
-
else if($media == 'email'){
|
1559 |
-
return $items;
|
1560 |
-
}
|
1561 |
-
else {
|
1562 |
-
$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%">';
|
1563 |
-
foreach($items as $i)
|
1564 |
-
{
|
1565 |
-
$list .= '<tr><td>' . $i .'</td></tr>';
|
1566 |
-
}
|
1567 |
-
$list .= '</table>';
|
1568 |
-
|
1569 |
-
return $list;
|
1570 |
-
}
|
1571 |
-
}
|
1572 |
-
else if(is_array($value)){
|
1573 |
-
$columns = array_keys($value[0]);
|
1574 |
-
|
1575 |
-
$list = '';
|
1576 |
-
|
1577 |
-
switch($format){
|
1578 |
-
case 'text' :
|
1579 |
-
$is_first_row = true;
|
1580 |
-
foreach($value as $item){
|
1581 |
-
if(!$is_first_row)
|
1582 |
-
$list .= '\n\n' . $field['label'] . ': ';
|
1583 |
-
$list .= implode(',', array_values($item));
|
1584 |
-
|
1585 |
-
$is_first_row = false;
|
1586 |
-
}
|
1587 |
-
break;
|
1588 |
-
|
1589 |
-
case 'url' :
|
1590 |
-
foreach($value as $item){
|
1591 |
-
$list .= implode('|', array_values($item)) . ',';
|
1592 |
-
}
|
1593 |
-
if(!empty($list))
|
1594 |
-
$list = substr($list, 0, strlen($list)-1);
|
1595 |
-
break;
|
1596 |
-
|
1597 |
-
default :
|
1598 |
-
|
1599 |
-
if($media == 'email'){
|
1600 |
-
$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>';
|
1601 |
-
|
1602 |
-
//reading columns from entry data
|
1603 |
-
foreach($columns as $column){
|
1604 |
-
$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>';
|
1605 |
-
}
|
1606 |
-
$list .= '</tr></thead>';
|
1607 |
-
|
1608 |
-
$list .= '<tbody style="background-color: #F9F9F9">';
|
1609 |
-
foreach($value as $item){
|
1610 |
-
$list .= '<tr>';
|
1611 |
-
foreach($columns as $column){
|
1612 |
-
$val = rgar($item, $column);
|
1613 |
-
$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>';
|
1614 |
-
}
|
1615 |
-
|
1616 |
-
$list .='</tr>';
|
1617 |
-
}
|
1618 |
-
|
1619 |
-
$list .='</tbody></table>';
|
1620 |
-
}
|
1621 |
-
else{
|
1622 |
-
$list = '<table class="gfield_list" autosize="1"><thead><tr>';
|
1623 |
-
|
1624 |
-
//reading columns from entry data
|
1625 |
-
foreach($columns as $column){
|
1626 |
-
$list .= '<th>' . esc_html($column) . '</th>';
|
1627 |
-
}
|
1628 |
-
$list .= '</tr></thead>';
|
1629 |
-
|
1630 |
-
$list .= '<tbody>';
|
1631 |
-
foreach($value as $item){
|
1632 |
-
$list .= '<tr>';
|
1633 |
-
foreach($columns as $column){
|
1634 |
-
$val = rgar($item, $column);
|
1635 |
-
$list .= '<td>'.htmlspecialchars($val).'</td>';
|
1636 |
-
}
|
1637 |
-
|
1638 |
-
$list .='</tr>';
|
1639 |
-
}
|
1640 |
-
|
1641 |
-
$list .='</tbody></table>';
|
1642 |
-
}
|
1643 |
-
break;
|
1644 |
-
}
|
1645 |
-
|
1646 |
-
return $list;
|
1647 |
-
}
|
1648 |
-
return '';
|
1649 |
-
break;
|
1650 |
-
|
1651 |
-
default :
|
1652 |
-
if (!is_array($value))
|
1653 |
-
{
|
1654 |
-
|
1655 |
-
|
1656 |
-
|
1657 |
-
|
1658 |
-
|
1659 |
-
|
1660 |
-
|
1661 |
-
|
1662 |
-
|
1663 |
-
|
1664 |
-
|
1665 |
-
|
1666 |
-
|
1667 |
-
|
1668 |
-
|
1669 |
-
|
1670 |
-
|
1671 |
-
|
1672 |
-
|
1673 |
-
|
1674 |
-
|
1675 |
-
|
1676 |
-
$
|
1677 |
-
$
|
1678 |
-
$
|
1679 |
-
|
1680 |
-
|
1681 |
-
|
1682 |
-
|
1683 |
-
|
1684 |
-
|
1685 |
-
|
1686 |
-
|
1687 |
-
|
1688 |
-
|
1689 |
-
|
1690 |
-
|
1691 |
-
|
1692 |
-
|
1693 |
-
|
1694 |
-
|
1695 |
-
|
1696 |
-
|
1697 |
-
|
1698 |
-
|
1699 |
-
|
1700 |
-
|
1701 |
-
|
1702 |
-
|
1703 |
-
|
1704 |
-
|
1705 |
-
|
1706 |
-
|
1707 |
-
|
1708 |
-
|
1709 |
-
|
1710 |
-
$
|
1711 |
-
|
1712 |
-
|
1713 |
-
|
1714 |
-
|
1715 |
-
|
1716 |
-
|
1717 |
-
|
1718 |
-
|
1719 |
-
|
1720 |
-
|
1721 |
-
|
1722 |
-
|
1723 |
-
|
1724 |
-
|
1725 |
-
|
1726 |
-
|
1727 |
-
|
1728 |
-
$
|
1729 |
-
|
1730 |
-
|
1731 |
-
|
1732 |
-
|
1733 |
-
|
1734 |
-
|
1735 |
-
$
|
1736 |
-
|
1737 |
-
|
1738 |
-
|
1739 |
-
|
1740 |
-
|
1741 |
-
|
1742 |
-
|
1743 |
-
$address
|
1744 |
-
|
1745 |
-
}
|
1746 |
-
|
1747 |
-
|
1748 |
-
|
1749 |
-
|
1750 |
-
|
1751 |
-
|
1752 |
-
|
1753 |
-
|
1754 |
-
|
1755 |
-
|
1756 |
-
|
1757 |
-
|
1758 |
-
|
1759 |
-
|
1760 |
-
break;
|
1761 |
-
|
1762 |
-
case '
|
1763 |
-
|
1764 |
-
|
1765 |
-
|
1766 |
-
|
1767 |
-
|
1768 |
-
|
1769 |
-
|
1770 |
-
|
1771 |
-
|
1772 |
-
|
1773 |
-
|
1774 |
-
|
1775 |
-
|
1776 |
-
|
1777 |
-
|
1778 |
-
|
1779 |
-
|
1780 |
-
|
1781 |
-
|
1782 |
-
|
1783 |
-
|
1784 |
-
|
1785 |
-
|
1786 |
-
|
1787 |
-
|
1788 |
-
|
1789 |
-
|
1790 |
-
|
1791 |
-
|
1792 |
-
|
1793 |
-
|
1794 |
-
|
1795 |
-
|
1796 |
-
|
1797 |
-
|
1798 |
-
|
1799 |
-
|
1800 |
-
|
1801 |
-
|
1802 |
-
|
1803 |
-
|
1804 |
-
|
1805 |
-
|
1806 |
-
|
1807 |
-
|
1808 |
-
|
1809 |
-
|
1810 |
-
|
1811 |
-
|
1812 |
-
|
1813 |
-
|
1814 |
-
$value =
|
1815 |
-
$value .= !empty($title) ?
|
1816 |
-
$value .= !empty($caption) ?
|
1817 |
-
$value .= !empty($description) ?
|
1818 |
-
|
1819 |
-
|
1820 |
-
|
1821 |
-
|
1822 |
-
|
1823 |
-
|
1824 |
-
|
1825 |
-
|
1826 |
-
|
1827 |
-
|
1828 |
-
|
1829 |
-
|
1830 |
-
|
1831 |
-
|
1832 |
-
|
1833 |
-
|
1834 |
-
|
1835 |
-
|
1836 |
-
$output .= '
|
1837 |
-
|
1838 |
-
|
1839 |
-
|
1840 |
-
|
1841 |
-
|
1842 |
-
|
1843 |
-
|
1844 |
-
|
1845 |
-
|
1846 |
-
|
1847 |
-
|
1848 |
-
|
1849 |
-
|
1850 |
-
|
1851 |
-
|
1852 |
-
|
1853 |
-
|
1854 |
-
|
1855 |
-
|
1856 |
-
|
1857 |
-
|
1858 |
-
|
1859 |
-
|
1860 |
-
$
|
1861 |
-
|
1862 |
-
|
1863 |
-
|
1864 |
-
|
1865 |
-
|
1866 |
-
|
1867 |
-
|
1868 |
-
|
1869 |
-
|
1870 |
-
|
1871 |
-
|
1872 |
-
|
1873 |
-
|
1874 |
-
|
1875 |
-
|
1876 |
-
|
1877 |
-
|
1878 |
-
|
1879 |
-
|
1880 |
-
|
1881 |
-
|
1882 |
-
|
1883 |
-
|
1884 |
-
|
1885 |
-
|
1886 |
-
|
1887 |
-
|
1888 |
-
|
1889 |
-
|
1890 |
-
|
1891 |
-
|
1892 |
-
|
1893 |
-
|
1894 |
-
|
1895 |
-
|
1896 |
-
|
1897 |
-
|
1898 |
-
|
1899 |
-
|
1900 |
-
|
1901 |
-
|
1902 |
-
|
1903 |
-
|
1904 |
-
|
1905 |
-
|
1906 |
-
|
1907 |
-
|
1908 |
-
|
1909 |
-
|
1910 |
-
|
1911 |
-
|
1912 |
-
|
1913 |
-
|
1914 |
-
|
1915 |
-
|
1916 |
-
|
1917 |
-
|
1918 |
-
|
1919 |
-
break;
|
1920 |
-
|
1921 |
-
|
1922 |
-
|
1923 |
-
|
1924 |
-
|
1925 |
-
|
1926 |
-
|
1927 |
-
|
1928 |
-
|
1929 |
-
|
1930 |
-
|
1931 |
-
|
1932 |
-
|
1933 |
-
|
1934 |
-
|
1935 |
-
|
1936 |
-
|
1937 |
-
|
1938 |
-
$
|
1939 |
-
|
1940 |
-
|
1941 |
-
|
1942 |
-
|
1943 |
-
|
1944 |
-
|
1945 |
-
|
1946 |
-
|
1947 |
-
|
1948 |
-
|
1949 |
-
|
1950 |
-
|
1951 |
-
|
1952 |
-
|
1953 |
-
|
1954 |
-
|
1955 |
-
|
1956 |
-
$list .= implode('
|
1957 |
-
|
1958 |
-
|
1959 |
-
|
1960 |
-
break;
|
1961 |
-
|
1962 |
-
|
1963 |
-
|
1964 |
-
$list
|
1965 |
-
|
1966 |
-
|
1967 |
-
|
1968 |
-
|
1969 |
-
|
1970 |
-
|
1971 |
-
|
1972 |
-
$list
|
1973 |
-
|
1974 |
-
|
1975 |
-
|
1976 |
-
|
1977 |
-
|
1978 |
-
|
1979 |
-
|
1980 |
-
|
1981 |
-
|
1982 |
-
|
1983 |
-
|
1984 |
-
|
1985 |
-
|
1986 |
-
|
1987 |
-
|
1988 |
-
|
1989 |
-
|
1990 |
-
|
1991 |
-
|
1992 |
-
|
1993 |
-
|
1994 |
-
$list
|
1995 |
-
|
1996 |
-
|
1997 |
-
|
1998 |
-
|
1999 |
-
|
2000 |
-
|
2001 |
-
|
2002 |
-
|
2003 |
-
|
2004 |
-
|
2005 |
-
|
2006 |
-
|
2007 |
-
|
2008 |
-
|
2009 |
-
|
2010 |
-
|
2011 |
-
|
2012 |
-
|
2013 |
-
|
2014 |
-
|
2015 |
-
|
2016 |
-
|
2017 |
-
|
2018 |
-
return
|
2019 |
-
}
|
2020 |
-
|
2021 |
-
|
2022 |
-
|
2023 |
-
|
2024 |
-
|
2025 |
-
|
2026 |
-
|
2027 |
-
|
2028 |
-
|
2029 |
-
|
2030 |
-
|
2031 |
-
|
2032 |
-
|
2033 |
-
|
2034 |
-
|
2035 |
-
|
2036 |
-
|
2037 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2038 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
This file is part of Gravity PDF.
|
5 |
+
|
6 |
+
Gravity PDF Copyright (C) 2015 Blue Liquid Designs
|
7 |
+
|
8 |
+
This program is free software; you can redistribute it and/or modify
|
9 |
+
it under the terms of the GNU General Public License as published by
|
10 |
+
the Free Software Foundation; either version 2 of the License, or
|
11 |
+
(at your option) any later version.
|
12 |
+
|
13 |
+
This program is distributed in the hope that it will be useful,
|
14 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
16 |
+
GNU General Public License for more details.
|
17 |
+
|
18 |
+
You should have received a copy of the GNU General Public License
|
19 |
+
along with this program; if not, write to the Free Software
|
20 |
+
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
21 |
+
*/
|
22 |
+
|
23 |
+
if(!class_exists('GFPDFEntryDetail'))
|
24 |
+
{
|
25 |
+
|
26 |
+
/*
|
27 |
+
* Include Gravity Forms Currency class (it not already included)
|
28 |
+
*/
|
29 |
+
if ( false === class_exists( 'RGCurrency' ) && class_exists('GFCommon') ) {
|
30 |
+
require_once( GFCommon::get_base_path() . '/currency.php' );
|
31 |
+
}
|
32 |
+
|
33 |
+
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 */
|
34 |
+
class GFPDFEntryDetail {
|
35 |
+
|
36 |
+
/* holds the form fields, stored by field ID */
|
37 |
+
static $fields;
|
38 |
+
|
39 |
+
/* depreciated function which we will replace with a better config passing method */
|
40 |
+
public static function lead_detail_grid($form, $lead, $allow_display_empty_fields=false, $show_html=false, $show_page_name=false, $return=false) {
|
41 |
+
|
42 |
+
$config = array(
|
43 |
+
'empty_field' => $allow_display_empty_fields,
|
44 |
+
'html_field' => $show_html,
|
45 |
+
'page_names' => $show_page_name,
|
46 |
+
'return' => $return,
|
47 |
+
);
|
48 |
+
|
49 |
+
return self::do_lead_detail_grid($form, $lead, $config);
|
50 |
+
}
|
51 |
+
|
52 |
+
|
53 |
+
public static function do_lead_detail_grid($form, $lead, $config) {
|
54 |
+
$form_id = $form['id'];
|
55 |
+
$results = array();
|
56 |
+
|
57 |
+
/*
|
58 |
+
* Set up our defaults and merge down the user config
|
59 |
+
*/
|
60 |
+
$defaults = array(
|
61 |
+
'empty_field' => false,
|
62 |
+
'html_field' => false,
|
63 |
+
'page_names' => false,
|
64 |
+
'return' => false,
|
65 |
+
'section_content' => false,
|
66 |
+
);
|
67 |
+
|
68 |
+
$config = array_merge($defaults, $config);
|
69 |
+
|
70 |
+
if($config['return'] === true)
|
71 |
+
{
|
72 |
+
$results['title'] = '<h2 id="details" class="default">'. $form['title'] .'</h2>';
|
73 |
+
}
|
74 |
+
else
|
75 |
+
{
|
76 |
+
?>
|
77 |
+
<div id='container'>
|
78 |
+
<h2 id='details' class='default'><?php echo $form['title']?></h2>
|
79 |
+
<?php
|
80 |
+
}
|
81 |
+
|
82 |
+
|
83 |
+
$count = 0;
|
84 |
+
$field_count = sizeof($form['fields']);
|
85 |
+
|
86 |
+
$has_product_fields = false;
|
87 |
+
|
88 |
+
$page_number = 0;
|
89 |
+
foreach($form['fields'] as $field) {
|
90 |
+
|
91 |
+
|
92 |
+
/*
|
93 |
+
* Check if this field has been excluded from the list
|
94 |
+
*/
|
95 |
+
if(isset($field['cssClass']) && strpos($field['cssClass'], 'exclude') !== false)
|
96 |
+
{
|
97 |
+
/* skip this field */
|
98 |
+
continue;
|
99 |
+
}
|
100 |
+
|
101 |
+
/*
|
102 |
+
* Skip over hidden fields
|
103 |
+
*/
|
104 |
+
if(GFFormsModel::is_field_hidden( $form, $field, array(), $lead ))
|
105 |
+
{
|
106 |
+
continue;
|
107 |
+
}
|
108 |
+
|
109 |
+
/*
|
110 |
+
* Check if we are to show the page names
|
111 |
+
*/
|
112 |
+
if($config['page_names'] === true)
|
113 |
+
{
|
114 |
+
if((int) $field['pageNumber'] !== $page_number && isset($form['pagination']['pages'][$page_number]))
|
115 |
+
{
|
116 |
+
/*
|
117 |
+
* Display the page number
|
118 |
+
*/
|
119 |
+
if($config['return'] === true)
|
120 |
+
{
|
121 |
+
$results['field'][] = '<h2 id="field-'. $field['id'].'" class="default entry-view-page-break">'. $form['pagination']['pages'][$page_number] .'</h2>';
|
122 |
+
}
|
123 |
+
else
|
124 |
+
{
|
125 |
+
?>
|
126 |
+
<h2 id='field-<?php echo $field['id']; ?>' class='default entry-view-page-break'><?php echo $form['pagination']['pages'][$page_number]; ?></h2>
|
127 |
+
<?php
|
128 |
+
}
|
129 |
+
/*
|
130 |
+
* Increment the page number
|
131 |
+
*/
|
132 |
+
$page_number++;
|
133 |
+
}
|
134 |
+
}
|
135 |
+
|
136 |
+
$even = $odd = '';
|
137 |
+
|
138 |
+
switch(RGFormsModel::get_input_type($field)){
|
139 |
+
case 'section' :
|
140 |
+
|
141 |
+
if(!GFCommon::is_section_empty($field, $form, $lead) || $config['empty_field'] || $config['section_content']){
|
142 |
+
$count++;
|
143 |
+
|
144 |
+
if($config['return'] === true)
|
145 |
+
{
|
146 |
+
$results['field'][] = '<h2 id="field-'.$field['id'].'" class="default entry-view-section-break">'. esc_html(GFCommon::get_label($field)) .'</h2>';
|
147 |
+
|
148 |
+
if($config['section_content'])
|
149 |
+
{
|
150 |
+
$results['field'][] = '<div class="default entry-view-section-break entry-view-section-break-content">' . $field['description'] . '</div>';
|
151 |
+
}
|
152 |
+
|
153 |
+
}
|
154 |
+
else
|
155 |
+
{
|
156 |
+
?>
|
157 |
+
<h2 id="field-<?php echo $field['id']; ?>" class="default entry-view-section-break"><?php echo esc_html(GFCommon::get_label($field))?></h2>
|
158 |
+
|
159 |
+
<?php if($config['section_content']): ?>
|
160 |
+
<div class="default entry-view-section-break entry-view-section-break-content"><?php echo $field['description']; ?></div>
|
161 |
+
<?php endif; ?>
|
162 |
+
<?php
|
163 |
+
}
|
164 |
+
}
|
165 |
+
break;
|
166 |
+
|
167 |
+
case 'captcha':
|
168 |
+
case 'password':
|
169 |
+
case 'page':
|
170 |
+
//ignore captcha, html, password, page field
|
171 |
+
break;
|
172 |
+
case 'html':
|
173 |
+
if($config['html_field'] == true)
|
174 |
+
{
|
175 |
+
|
176 |
+
$count++;
|
177 |
+
$is_last = $count >= $field_count && !$has_product_fields ? true : false;
|
178 |
+
$last_row = $is_last ? ' lastrow' : '';
|
179 |
+
$even = ($count%2) ? ' odd' : ' even';
|
180 |
+
|
181 |
+
$display_value = $field['content'];
|
182 |
+
$value = '';
|
183 |
+
|
184 |
+
$content = '<div id="field-'. $field['id'] .'" class="entry-view-html-value' . $last_row . $even . '"><div class="value">' . $display_value . '</div></div>';
|
185 |
+
$content = apply_filters('gfpdf_field_content', $content, $field, $value, $lead['id'], $form['id']);
|
186 |
+
|
187 |
+
if($config['return'] === true)
|
188 |
+
{
|
189 |
+
$results['field'][] = $content;
|
190 |
+
}
|
191 |
+
else
|
192 |
+
{
|
193 |
+
echo $content;
|
194 |
+
}
|
195 |
+
}
|
196 |
+
break;
|
197 |
+
case 'signature':
|
198 |
+
$value = RGFormsModel::get_lead_field_value($lead, $field);
|
199 |
+
$public_folder = RGFormsModel::get_upload_url_root() . 'signatures/';
|
200 |
+
$server_folder = RGFormsModel::get_upload_root() . 'signatures/';
|
201 |
+
$file = $server_folder.$value;
|
202 |
+
$display_value = false;
|
203 |
+
|
204 |
+
$is_last = $count >= $field_count ? true : false;
|
205 |
+
$last_row = $is_last ? ' lastrow' : '';
|
206 |
+
|
207 |
+
if(file_exists($file) && !is_dir($file))
|
208 |
+
{
|
209 |
+
$image_size = getimagesize($file);
|
210 |
+
$width = apply_filters('gfpdfe_signature_width', $image_size[0] / 4, $image_size[0]);
|
211 |
+
|
212 |
+
$display_value = '<img src="'. $file .'" alt="Signature" width=" '. $width .'" />';
|
213 |
+
}
|
214 |
+
|
215 |
+
if($display_value)
|
216 |
+
{
|
217 |
+
$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> ';
|
218 |
+
|
219 |
+
if($config['return'] === true)
|
220 |
+
{
|
221 |
+
$results['field'][] = $content;
|
222 |
+
}
|
223 |
+
else
|
224 |
+
{
|
225 |
+
echo $content;
|
226 |
+
}
|
227 |
+
}
|
228 |
+
elseif($config['empty_field'])
|
229 |
+
{
|
230 |
+
if($config['return'] === true)
|
231 |
+
{
|
232 |
+
$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 class="value"> </div></div>';
|
233 |
+
}
|
234 |
+
else
|
235 |
+
{
|
236 |
+
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 class="value"> </div></div>';
|
237 |
+
}
|
238 |
+
|
239 |
+
}
|
240 |
+
break;
|
241 |
+
|
242 |
+
default:
|
243 |
+
|
244 |
+
//ignore product fields as they will be grouped together at the end of the grid
|
245 |
+
if(GFCommon::is_product_field($field['type'])){
|
246 |
+
$has_product_fields = true;
|
247 |
+
continue;
|
248 |
+
}
|
249 |
+
|
250 |
+
$value = RGFormsModel::get_lead_field_value($lead, $field);
|
251 |
+
$display_value = self::pdf_get_lead_field_display($field, $value, $lead['currency']);
|
252 |
+
|
253 |
+
|
254 |
+
$display_value = apply_filters('gform_entry_field_value', $display_value, $field, $lead, $form);
|
255 |
+
|
256 |
+
if( !empty($display_value) || $display_value === '0' || $config['empty_field']){
|
257 |
+
$count++;
|
258 |
+
$is_last = $count >= $field_count && !$has_product_fields ? true : false;
|
259 |
+
$last_row = $is_last ? ' lastrow' : '';
|
260 |
+
$even = ($count%2) ? ' odd' : ' even';
|
261 |
+
|
262 |
+
$display_value = empty($display_value) && $display_value !== '0' ? ' ' : $display_value;
|
263 |
+
|
264 |
+
$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>';
|
265 |
+
|
266 |
+
$content = apply_filters('gfpdf_field_content', $content, $field, $value, $lead['id'], $form['id']);
|
267 |
+
|
268 |
+
if($config['return'] === true)
|
269 |
+
{
|
270 |
+
$results['field'][] = $content;
|
271 |
+
}
|
272 |
+
else
|
273 |
+
{
|
274 |
+
echo $content;
|
275 |
+
}
|
276 |
+
|
277 |
+
}
|
278 |
+
break;
|
279 |
+
}
|
280 |
+
|
281 |
+
}
|
282 |
+
$products = array();
|
283 |
+
if($has_product_fields){
|
284 |
+
if($config['return'] === true)
|
285 |
+
{
|
286 |
+
ob_start();
|
287 |
+
self::product_table($form, $lead);
|
288 |
+
$results['field'][] = ob_get_contents();
|
289 |
+
ob_end_clean();
|
290 |
+
}
|
291 |
+
else
|
292 |
+
{
|
293 |
+
self::product_table($form, $lead);
|
294 |
+
}
|
295 |
+
|
296 |
+
}
|
297 |
+
|
298 |
+
if($config['return'] === true)
|
299 |
+
{
|
300 |
+
return $results;
|
301 |
+
}
|
302 |
+
?>
|
303 |
+
</div>
|
304 |
+
<?php
|
305 |
+
}
|
306 |
+
|
307 |
+
public static function product_table($form, $lead)
|
308 |
+
{
|
309 |
+
$products = GFCommon::get_product_fields($form, $lead, true);
|
310 |
+
|
311 |
+
$form_id = $form['id'];
|
312 |
+
if(!empty($products['products'])){
|
313 |
+
?>
|
314 |
+
|
315 |
+
<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>
|
316 |
+
|
317 |
+
<table class='entry-products' autosize='1' cellspacing='0' width='97%'>
|
318 |
+
<colgroup>
|
319 |
+
<col class='entry-products-col1' />
|
320 |
+
<col class='entry-products-col2' />
|
321 |
+
<col class='entry-products-col3' />
|
322 |
+
<col class='entry-products-col4' />
|
323 |
+
</colgroup>
|
324 |
+
<thead>
|
325 |
+
<tr>
|
326 |
+
<th scope='col'><?php echo apply_filters('gform_product_{$form_id}', apply_filters('gform_product', __('Product', 'gravityforms'), $form_id), $form_id) ?></th>
|
327 |
+
<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>
|
328 |
+
<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>
|
329 |
+
<th scope='col'><?php echo apply_filters('gform_product_price_{$form_id}', apply_filters('gform_product_price', __('Price', 'gravityforms'), $form_id), $form_id) ?></th>
|
330 |
+
</tr>
|
331 |
+
</thead>
|
332 |
+
<tbody>
|
333 |
+
<?php
|
334 |
+
|
335 |
+
$total = 0;
|
336 |
+
foreach($products['products'] as $product){
|
337 |
+
?>
|
338 |
+
<tr>
|
339 |
+
<td>
|
340 |
+
<div class='product_name'><?php echo esc_html($product['name'])?></div>
|
341 |
+
|
342 |
+
<?php
|
343 |
+
$price = GFCommon::to_number($product['price']);
|
344 |
+
if(is_array(rgar($product,'options'))){
|
345 |
+
echo '<ul class="product_options">';
|
346 |
+
$count = sizeof($product['options']);
|
347 |
+
$index = 1;
|
348 |
+
foreach($product['options'] as $option){
|
349 |
+
$price += GFCommon::to_number($option['price']);
|
350 |
+
$class = $index == $count ? ' class="lastitem"' : '';
|
351 |
+
$index++;
|
352 |
+
?>
|
353 |
+
<li<?php echo $class?>><?php echo $option['option_label']?></li>
|
354 |
+
<?php
|
355 |
+
}
|
356 |
+
echo '</ul>';
|
357 |
+
}
|
358 |
+
$subtotal = floatval($product['quantity']) * $price;
|
359 |
+
$total += $subtotal;
|
360 |
+
?>
|
361 |
+
|
362 |
+
</td>
|
363 |
+
<td class='textcenter'><?php echo $product['quantity'] ?></td>
|
364 |
+
<td><?php echo GFCommon::to_money($price, $lead['currency']) ?></td>
|
365 |
+
<td><?php echo GFCommon::to_money($subtotal, $lead['currency']) ?></td>
|
366 |
+
</tr>
|
367 |
+
<?php
|
368 |
+
}
|
369 |
+
$total += floatval($products['shipping']['price']);
|
370 |
+
?>
|
371 |
+
|
372 |
+
|
373 |
+
<?php
|
374 |
+
if(!empty($products['shipping']['name'])){
|
375 |
+
?>
|
376 |
+
<tr>
|
377 |
+
<td colspan='2' rowspan='2' class='emptycell'> </td>
|
378 |
+
<td class='textright shipping'><?php echo $products['shipping']['name'] ?></td>
|
379 |
+
<td class='shipping_amount'><?php echo GFCommon::to_money($products['shipping']['price'], $lead['currency'])?> </td>
|
380 |
+
</tr>
|
381 |
+
<?php
|
382 |
+
}
|
383 |
+
?>
|
384 |
+
<tr>
|
385 |
+
<?php
|
386 |
+
if(empty($products['shipping']['name'])){
|
387 |
+
?>
|
388 |
+
<td colspan='2' class='emptycell'> </td>
|
389 |
+
<?php
|
390 |
+
}
|
391 |
+
?>
|
392 |
+
<td class='textright grandtotal'><?php _e('Total', 'gravityforms') ?></td>
|
393 |
+
<td class='grandtotal_amount'><?php echo GFCommon::to_money($total, $lead['currency'])?></td>
|
394 |
+
</tr>
|
395 |
+
</tbody>
|
396 |
+
|
397 |
+
</table>
|
398 |
+
|
399 |
+
<?php
|
400 |
+
}
|
401 |
+
}
|
402 |
+
|
403 |
+
/*
|
404 |
+
* Public method for outputting likert (survey addon field)
|
405 |
+
*/
|
406 |
+
public static function get_likert($form, $lead, $field_id)
|
407 |
+
{
|
408 |
+
$fields = self::$fields;
|
409 |
+
$field = $fields[$field_id];
|
410 |
+
$value = RGFormsModel::get_lead_field_value($lead, $field);
|
411 |
+
|
412 |
+
$display_value = apply_filters('gform_entry_field_value', self::pdf_get_lead_field_display($field, $value, ''), $field, $lead, $form);
|
413 |
+
$content = $display_value;
|
414 |
+
|
415 |
+
$results = apply_filters('gfpdf_field_content', $content, $field, $value, $lead['id'], $form['id']);
|
416 |
+
|
417 |
+
return $results;
|
418 |
+
}
|
419 |
+
|
420 |
+
/* returns the form values as an array instead of pre-formated html */
|
421 |
+
public static function lead_detail_grid_array($form, $lead){
|
422 |
+
|
423 |
+
$form_id = $form['id'];
|
424 |
+
$form_array = self::set_form_array_common($form, $lead, $form_id);
|
425 |
+
|
426 |
+
$has_product_fields = false;
|
427 |
+
|
428 |
+
foreach($form['fields'] as $field) {
|
429 |
+
|
430 |
+
|
431 |
+
/*
|
432 |
+
* Add field descriptions to the $form_data array
|
433 |
+
*/
|
434 |
+
if(isset($field['description']))
|
435 |
+
{
|
436 |
+
$form_array['field_descriptions'][$field['id']] = $field['description'];
|
437 |
+
}
|
438 |
+
|
439 |
+
switch(RGFormsModel::get_input_type($field)) {
|
440 |
+
case 'section' :
|
441 |
+
case 'html':
|
442 |
+
$form_array = self::get_html($field, $form_array);
|
443 |
+
break;
|
444 |
+
|
445 |
+
case 'captcha':
|
446 |
+
case 'password':
|
447 |
+
case 'page':
|
448 |
+
//ignore captcha, password and page
|
449 |
+
break;
|
450 |
+
case 'signature':
|
451 |
+
$form_array = self::get_signature($form, $lead, $field, $form_array);
|
452 |
+
|
453 |
+
break;
|
454 |
+
case 'fileupload':
|
455 |
+
$form_array = self::get_fileupload($form, $lead, $field, $form_array);
|
456 |
+
break;
|
457 |
+
case 'list':
|
458 |
+
/*
|
459 |
+
* We want list to run both this and the deafult so don't call break.
|
460 |
+
* Get the list array and store it outside of [field] in a new key called ['list']
|
461 |
+
*/
|
462 |
+
$form_array = self::get_default_list($lead, $field, $form_array);
|
463 |
+
|
464 |
+
case 'select':
|
465 |
+
case 'multiselect':
|
466 |
+
case 'radio':
|
467 |
+
|
468 |
+
if($field['type'] == 'quiz')
|
469 |
+
{
|
470 |
+
$form_array = self::get_quiz_radios($form, $lead, $field, $form_array);
|
471 |
+
}
|
472 |
+
elseif($field['type'] == 'poll' || $field['type'] == 'survey')
|
473 |
+
{
|
474 |
+
$form_array = self::get_poll_radios($form, $lead, $field, $form_array);
|
475 |
+
}
|
476 |
+
else
|
477 |
+
{
|
478 |
+
/* store values in regular [field] array */
|
479 |
+
$form_array = self::get_the_list($lead, $field, $form_array);
|
480 |
+
}
|
481 |
+
break;
|
482 |
+
|
483 |
+
case 'likert':
|
484 |
+
$form_array['survey']['likert'][$field['id']] = self::get_the_likert($form, $lead, $field, $form_array);
|
485 |
+
break;
|
486 |
+
|
487 |
+
case 'rank':
|
488 |
+
$form_array['survey']['rank'][$field['id']] = self::get_the_rank($form, $lead, $field, $form_array);
|
489 |
+
break;
|
490 |
+
|
491 |
+
case 'rating':
|
492 |
+
$form_array['survey']['rating'][$field['id']] = self::get_the_rank($form, $lead, $field, $form_array);
|
493 |
+
break;
|
494 |
+
|
495 |
+
case 'checkbox':
|
496 |
+
/* Only process non-survey checkbox fields */
|
497 |
+
if($field['type'] == 'checkbox') {
|
498 |
+
$form_array = self::get_the_list($lead, $field, $form_array);
|
499 |
+
break;
|
500 |
+
}
|
501 |
+
|
502 |
+
default:
|
503 |
+
|
504 |
+
|
505 |
+
//ignore product fields as they will be grouped together at the end of the grid
|
506 |
+
if(GFCommon::is_product_field($field['type'])){
|
507 |
+
$has_product_fields = true;
|
508 |
+
continue;
|
509 |
+
}
|
510 |
+
|
511 |
+
$form_array = self::get_defaults($lead, $field, $form_array);
|
512 |
+
|
513 |
+
break;
|
514 |
+
}
|
515 |
+
|
516 |
+
}
|
517 |
+
|
518 |
+
$form_array = self::get_product_array($form, $lead, $has_product_fields, $form_array);
|
519 |
+
|
520 |
+
return $form_array;
|
521 |
+
}
|
522 |
+
|
523 |
+
private static function get_quiz_radios($form, $lead, $field, $form_array)
|
524 |
+
{
|
525 |
+
$id = $field['id'];
|
526 |
+
$results = $lead[$id];
|
527 |
+
$return = array();
|
528 |
+
|
529 |
+
foreach($field['choices'] as $choice)
|
530 |
+
{
|
531 |
+
if(trim($choice['value']) == trim($results))
|
532 |
+
{
|
533 |
+
$return = array('text' => $choice['text'], 'isCorrect' => $choice['gquizIsCorrect']);
|
534 |
+
break;
|
535 |
+
}
|
536 |
+
}
|
537 |
+
|
538 |
+
/* add data to field tag correctly */
|
539 |
+
$form_array['field'][$field['id'].'.'.$field['label'].'_name'] = $return;
|
540 |
+
|
541 |
+
/* add ID incase want to use template on multiple duplicate forms with different field names */
|
542 |
+
$form_array['field'][$field['id']] = $return;
|
543 |
+
|
544 |
+
return $form_array;
|
545 |
+
|
546 |
+
}
|
547 |
+
|
548 |
+
private static function get_poll_radios($form, $lead, $field, $form_array)
|
549 |
+
{
|
550 |
+
|
551 |
+
$id = $field['id'];
|
552 |
+
$results = $lead[$id];
|
553 |
+
$return = array();
|
554 |
+
|
555 |
+
$return = self::get_poll_data($results, $field['choices']);
|
556 |
+
|
557 |
+
/* add data to field tag correctly */
|
558 |
+
$form_array['field'][$field['id'].'.'.$field['label'].'_name'] = $return;
|
559 |
+
|
560 |
+
/* add ID incase want to use template on multiple duplicate forms with different field names */
|
561 |
+
$form_array['field'][$field['id']] = $return;
|
562 |
+
|
563 |
+
return $form_array;
|
564 |
+
|
565 |
+
}
|
566 |
+
|
567 |
+
private static function get_poll_checkbox($field, $values)
|
568 |
+
{
|
569 |
+
foreach($values as $id => $item)
|
570 |
+
{
|
571 |
+
$values[$id] = self::get_poll_data($item, $field['choices']);
|
572 |
+
}
|
573 |
+
return $values;
|
574 |
+
}
|
575 |
+
|
576 |
+
private static function get_poll_data($lookup, $options)
|
577 |
+
{
|
578 |
+
$return = '';
|
579 |
+
|
580 |
+
foreach($options as $choice)
|
581 |
+
{
|
582 |
+
if(trim($choice['value']) == trim($lookup))
|
583 |
+
{
|
584 |
+
$return = $choice['text'];
|
585 |
+
break;
|
586 |
+
}
|
587 |
+
}
|
588 |
+
|
589 |
+
return $return;
|
590 |
+
}
|
591 |
+
|
592 |
+
private static function get_the_rank($form, $lead, $field, $form_array)
|
593 |
+
{
|
594 |
+
$id = $field['id'];
|
595 |
+
$results = explode(',', $lead[$id]);
|
596 |
+
$return = array();
|
597 |
+
|
598 |
+
foreach($results as $rank)
|
599 |
+
{
|
600 |
+
foreach($field['choices'] as $choice)
|
601 |
+
{
|
602 |
+
if(trim($choice['value']) == trim($rank))
|
603 |
+
{
|
604 |
+
$return[] = $choice['text'];
|
605 |
+
break;
|
606 |
+
}
|
607 |
+
}
|
608 |
+
}
|
609 |
+
|
610 |
+
return $return;
|
611 |
+
}
|
612 |
+
|
613 |
+
private static function get_the_likert($form, $lead, $field, $form_array)
|
614 |
+
{
|
615 |
+
$id = $field['id'];
|
616 |
+
$multiple_rows = rgar($field, "gsurveyLikertEnableMultipleRows");
|
617 |
+
|
618 |
+
if(!$multiple_rows)
|
619 |
+
{
|
620 |
+
$results = $lead[$id];
|
621 |
+
}
|
622 |
+
|
623 |
+
$likert = array();
|
624 |
+
|
625 |
+
/* store the column names */
|
626 |
+
foreach($field['choices'] as $col)
|
627 |
+
{
|
628 |
+
$likert['col'][$col['value']] = $col['text'];
|
629 |
+
}
|
630 |
+
|
631 |
+
if(is_array($field['inputs']) && sizeof($field['inputs']) > 0)
|
632 |
+
{
|
633 |
+
/* do our multi-row likert */
|
634 |
+
foreach($field['inputs'] as $row)
|
635 |
+
{
|
636 |
+
/* pad the array with the number of columns */
|
637 |
+
|
638 |
+
foreach($likert['col'] as $col_id => $text)
|
639 |
+
{
|
640 |
+
/*
|
641 |
+
* Results for multi row is stored with ID.ROW# (eg $lead['1.2'])
|
642 |
+
* The number is stored in $row['id']
|
643 |
+
*/
|
644 |
+
$results = $lead[$row['id']];
|
645 |
+
|
646 |
+
/* user data in the $lead comes in as ROW ID:COL ID */
|
647 |
+
$comparison = $row['name'] . ':' . $col_id;
|
648 |
+
|
649 |
+
/* do our comparison and update the output */
|
650 |
+
$output = ($comparison == $results) ? 'selected' : '';
|
651 |
+
|
652 |
+
/* assign our results to the array */
|
653 |
+
$likert['rows'][$row['label']][$text] = $output;
|
654 |
+
|
655 |
+
}
|
656 |
+
}
|
657 |
+
}
|
658 |
+
else
|
659 |
+
{
|
660 |
+
/* do our single row likert */
|
661 |
+
foreach($likert['col'] as $col_id => $text)
|
662 |
+
{
|
663 |
+
/* single row data comes in with col value */
|
664 |
+
/* do our comparison and update the output */
|
665 |
+
$output = ($col_id == $results) ? 'selected' : '';
|
666 |
+
|
667 |
+
$likert['row'][$text] = $output;
|
668 |
+
|
669 |
+
}
|
670 |
+
}
|
671 |
+
|
672 |
+
/*
|
673 |
+
* Check if scoring is enabled and calculate
|
674 |
+
*/
|
675 |
+
if($field['gsurveyLikertEnableScoring'] && class_exists('GFSurvey'))
|
676 |
+
{
|
677 |
+
$survey = GFSurvey::get_instance();
|
678 |
+
$likert['score'] = $survey->get_field_score($field, $lead);
|
679 |
+
}
|
680 |
+
|
681 |
+
return $likert;
|
682 |
+
|
683 |
+
}
|
684 |
+
|
685 |
+
private static function get_form_fields($form)
|
686 |
+
{
|
687 |
+
$fields = array();
|
688 |
+
foreach($form['fields'] as $field)
|
689 |
+
{
|
690 |
+
$fields[$field['id']] = $field;
|
691 |
+
}
|
692 |
+
|
693 |
+
self::$fields = $fields;
|
694 |
+
}
|
695 |
+
|
696 |
+
private static function set_form_array_common($form, $lead, $form_id)
|
697 |
+
{
|
698 |
+
/*
|
699 |
+
* Reorder the $form array as we can access the info by Field ID
|
700 |
+
*/
|
701 |
+
self::get_form_fields($form);
|
702 |
+
|
703 |
+
$form_array = array();
|
704 |
+
|
705 |
+
/*
|
706 |
+
* Add form_id and lead_id
|
707 |
+
*/
|
708 |
+
$form_array['form_id'] = $form_id;
|
709 |
+
$form_array['entry_id'] = $lead['id'];
|
710 |
+
|
711 |
+
/*
|
712 |
+
* Set title and dates (both US and international)
|
713 |
+
*/
|
714 |
+
$form_array['form_title'] = $form['title'];
|
715 |
+
$form_array['form_description'] = (isset($form['description'])) ? $form['description'] : '';
|
716 |
+
$form_array['date_created'] = GFCommon::format_date( $lead['date_created'], false, 'j/n/Y', false);
|
717 |
+
$form_array['date_created_usa'] = GFCommon::format_date( $lead['date_created'], false, 'n/j/Y', false);
|
718 |
+
|
719 |
+
/*
|
720 |
+
* Include page names
|
721 |
+
*/
|
722 |
+
$form_array['pages'] = $form['pagination']['pages'];
|
723 |
+
|
724 |
+
/*
|
725 |
+
* Add misc fields
|
726 |
+
*/
|
727 |
+
$form_array['misc']['date_time'] = GFCommon::format_date( $lead['date_created'], false, 'Y-m-d H:i:s', false);
|
728 |
+
$form_array['misc']['time_24hr'] = GFCommon::format_date( $lead['date_created'], false, 'H:i', false);
|
729 |
+
$form_array['misc']['time_12hr'] = GFCommon::format_date( $lead['date_created'], false, 'g:ia', false);
|
730 |
+
$form_array['misc']['is_starred'] = $lead['is_starred'];
|
731 |
+
$form_array['misc']['is_read'] = $lead['is_read'];
|
732 |
+
$form_array['misc']['ip'] = $lead['ip'];
|
733 |
+
$form_array['misc']['source_url'] = $lead['source_url'];
|
734 |
+
$form_array['misc']['post_id'] = $lead['post_id'];
|
735 |
+
$form_array['misc']['currency'] = $lead['currency'];
|
736 |
+
$form_array['misc']['payment_status'] = $lead['payment_status'];
|
737 |
+
$form_array['misc']['payment_date'] = $lead['payment_date'];
|
738 |
+
$form_array['misc']['transaction_id'] = $lead['transaction_id'];
|
739 |
+
$form_array['misc']['payment_amount'] = $lead['payment_amount'];
|
740 |
+
$form_array['misc']['is_fulfilled'] = $lead['is_fulfilled'];
|
741 |
+
$form_array['misc']['created_by'] = $lead['created_by'];
|
742 |
+
$form_array['misc']['transaction_type'] = $lead['transaction_type'];
|
743 |
+
$form_array['misc']['user_agent'] = $lead['user_agent'];
|
744 |
+
$form_array['misc']['status'] = $lead['status'];
|
745 |
+
|
746 |
+
|
747 |
+
|
748 |
+
/*
|
749 |
+
* Add quiz/survey/poll results
|
750 |
+
*/
|
751 |
+
|
752 |
+
if(class_exists('GFQuiz'))
|
753 |
+
{
|
754 |
+
$form_array = self::get_quiz_results($form_array, $form, $lead);
|
755 |
+
}
|
756 |
+
|
757 |
+
if(class_exists('GFSurvey'))
|
758 |
+
{
|
759 |
+
$form_array = self::get_survey_results($form_array, $form, $lead);
|
760 |
+
}
|
761 |
+
|
762 |
+
if(class_exists('GFPolls'))
|
763 |
+
{
|
764 |
+
$form_array = self::get_poll_results($form_array, $form, $lead);
|
765 |
+
}
|
766 |
+
|
767 |
+
return $form_array;
|
768 |
+
}
|
769 |
+
|
770 |
+
/**
|
771 |
+
* Sniff the form fields and determine if there are any of the $type avaluable
|
772 |
+
* @param string $type the field type we are looking for
|
773 |
+
* @param array $form the form array
|
774 |
+
* @return boolean Whether there is a match or not
|
775 |
+
*/
|
776 |
+
private static function check_for_fields($type, $form)
|
777 |
+
{
|
778 |
+
foreach($form['fields'] as $field)
|
779 |
+
{
|
780 |
+
if($field['type'] == $type)
|
781 |
+
{
|
782 |
+
return true;
|
783 |
+
}
|
784 |
+
}
|
785 |
+
return false;
|
786 |
+
}
|
787 |
+
|
788 |
+
private static function get_poll_results($form_array, $form, $lead)
|
789 |
+
{
|
790 |
+
if(self::check_for_fields('poll', $form) === false)
|
791 |
+
{
|
792 |
+
return $form_array;
|
793 |
+
}
|
794 |
+
|
795 |
+
$fields = self::get_related_fields($form["fields"], 'poll');
|
796 |
+
$poll_results = self::get_addon_global_data($form, array(), $fields);
|
797 |
+
|
798 |
+
$form_fields = self::$fields;
|
799 |
+
|
800 |
+
/*
|
801 |
+
* Convert the array keys into their text counterparts
|
802 |
+
* Loop through the global poll data
|
803 |
+
*/
|
804 |
+
foreach($poll_results['field_data'] as $id => &$choices)
|
805 |
+
{
|
806 |
+
/* get the $field */
|
807 |
+
$field = $form_fields[$id];
|
808 |
+
|
809 |
+
/* add the field name to the ['misc'] key */
|
810 |
+
$choices['misc']['label'] = $field['label'];
|
811 |
+
|
812 |
+
/* loop through the field choices */
|
813 |
+
foreach($field['choices'] as $choice)
|
814 |
+
{
|
815 |
+
$choices = self::replace_key($choices, $choice['value'], $choice['text']);
|
816 |
+
}
|
817 |
+
}
|
818 |
+
|
819 |
+
$form_array['poll']['global'] = $poll_results;
|
820 |
+
|
821 |
+
return $form_array;
|
822 |
+
}
|
823 |
+
|
824 |
+
private static function get_survey_results($form_array, $form, $lead)
|
825 |
+
{
|
826 |
+
if(self::check_for_fields('survey', $form) === false)
|
827 |
+
{
|
828 |
+
return $form_array;
|
829 |
+
}
|
830 |
+
|
831 |
+
/*
|
832 |
+
* If there are any survey results
|
833 |
+
* add them to the 'survey' key
|
834 |
+
*/
|
835 |
+
$fields = GFCommon::get_fields_by_type($form, array('survey'));
|
836 |
+
$count_survey_fields = count($fields);
|
837 |
+
|
838 |
+
if ($count_survey_fields > 0 && isset($lead['gsurvey_score']))
|
839 |
+
{
|
840 |
+
$form_array['survey']['score'] = $lead['gsurvey_score'];
|
841 |
+
}
|
842 |
+
|
843 |
+
$fields = self::get_related_fields($form["fields"], 'survey');
|
844 |
+
$form_array['survey']['global'] = self::get_addon_global_data($form, array(), $fields);
|
845 |
+
$form_fields = self::$fields;
|
846 |
+
|
847 |
+
/*
|
848 |
+
* Convert the array keys into their text counterparts
|
849 |
+
* Loop through the global survey data
|
850 |
+
*/
|
851 |
+
foreach($form_array['survey']['global']['field_data'] as $id => &$choices)
|
852 |
+
{
|
853 |
+
/* get the $field */
|
854 |
+
$field = $form_fields[$id];
|
855 |
+
|
856 |
+
/*
|
857 |
+
* Check if we have a multifield likert and replace the row key
|
858 |
+
*/
|
859 |
+
if(isset($field['gsurveyLikertEnableMultipleRows']) && $field['gsurveyLikertEnableMultipleRows'] == 1)
|
860 |
+
{
|
861 |
+
foreach($field['gsurveyLikertRows'] as $row)
|
862 |
+
{
|
863 |
+
$choices = self::replace_key($choices, $row['value'], $row['text']);
|
864 |
+
}
|
865 |
+
|
866 |
+
foreach($choices as $multi_id => &$multi_choices)
|
867 |
+
{
|
868 |
+
foreach($field['choices'] as $choice)
|
869 |
+
{
|
870 |
+
$multi_choices = self::replace_key($multi_choices, $choice['value'], $choice['text']);
|
871 |
+
}
|
872 |
+
}
|
873 |
+
}
|
874 |
+
|
875 |
+
|
876 |
+
/* replace the standard row data */
|
877 |
+
if(isset($field['choices']) && is_array($field['choices']))
|
878 |
+
{
|
879 |
+
foreach($field['choices'] as $choice)
|
880 |
+
{
|
881 |
+
$choices = self::replace_key($choices, $choice['value'], $choice['text']);
|
882 |
+
}
|
883 |
+
}
|
884 |
+
}
|
885 |
+
|
886 |
+
return $form_array;
|
887 |
+
|
888 |
+
}
|
889 |
+
|
890 |
+
private static function replace_key($array, $key, $text)
|
891 |
+
{
|
892 |
+
if($key != $text && isset($array[$key]))
|
893 |
+
{
|
894 |
+
/* replace the array key with the actual field name */
|
895 |
+
$array[$text] = $array[$key];
|
896 |
+
unset($array[$key]);
|
897 |
+
}
|
898 |
+
return $array;
|
899 |
+
}
|
900 |
+
|
901 |
+
private static function get_quiz_results($form_array, $form, $lead)
|
902 |
+
{
|
903 |
+
|
904 |
+
if(self::check_for_fields('quiz', $form) === false)
|
905 |
+
{
|
906 |
+
return $form_array;
|
907 |
+
}
|
908 |
+
|
909 |
+
/*
|
910 |
+
* If there are any quiz results
|
911 |
+
* add them to the 'quiz' key
|
912 |
+
*/
|
913 |
+
$fields = GFCommon::get_fields_by_type($form, array('quiz'));
|
914 |
+
$count_quiz_fields = count($fields);
|
915 |
+
|
916 |
+
if ($count_quiz_fields > 0)
|
917 |
+
{
|
918 |
+
$form_array['quiz']['config']['grading'] = (isset($form['gravityformsquiz']['grading'])) ? $form['gravityformsquiz']['grading'] : '';
|
919 |
+
$form_array['quiz']['config']['passPercent'] = (isset($form['gravityformsquiz']['passPercent'])) ? $form['gravityformsquiz']['passPercent'] : '';
|
920 |
+
$form_array['quiz']['config']['grades'] = (isset($form['gravityformsquiz']['grades'])) ? $form['gravityformsquiz']['grades'] : '';
|
921 |
+
|
922 |
+
$form_array['quiz']['results']['score'] = rgar($lead, 'gquiz_score');
|
923 |
+
$form_array['quiz']['results']['percent'] = rgar($lead, 'gquiz_percent');
|
924 |
+
$form_array['quiz']['results']['is_pass'] = rgar($lead, 'gquiz_is_pass');
|
925 |
+
$form_array['quiz']['results']['grade'] = rgar($lead, 'gquiz_grade');
|
926 |
+
|
927 |
+
/*
|
928 |
+
* Get the overall results
|
929 |
+
*/
|
930 |
+
|
931 |
+
$quiz_global = self::get_quiz_overalls($form);
|
932 |
+
|
933 |
+
$form_fields = self::$fields;
|
934 |
+
/*
|
935 |
+
* Convert the array keys into their text counterparts
|
936 |
+
* Loop through the global quiz data
|
937 |
+
*/
|
938 |
+
if(empty($quiz_global['field_data']))
|
939 |
+
{
|
940 |
+
$quiz_global['field_data'] = array();
|
941 |
+
}
|
942 |
+
|
943 |
+
foreach($quiz_global['field_data'] as $id => &$choices)
|
944 |
+
{
|
945 |
+
/* get the $field */
|
946 |
+
$field = $form_fields[$id];
|
947 |
+
|
948 |
+
/* replace ['totals'] key with ['misc'] key */
|
949 |
+
$choices = self::replace_key($choices, 'totals', 'misc');
|
950 |
+
|
951 |
+
/* add the field name to the ['misc'] key */
|
952 |
+
$choices['misc']['label'] = $field['label'];
|
953 |
+
|
954 |
+
/* loop through the field choices */
|
955 |
+
foreach($field['choices'] as $choice)
|
956 |
+
{
|
957 |
+
$choices = self::replace_key($choices, $choice['value'], $choice['text']);
|
958 |
+
|
959 |
+
/* check if this is the correct field */
|
960 |
+
if(isset($choice['gquizIsCorrect']) && $choice['gquizIsCorrect'] == 1)
|
961 |
+
{
|
962 |
+
$choices['misc']['correct_option_name'][] = $choice['text'];
|
963 |
+
}
|
964 |
+
|
965 |
+
}
|
966 |
+
}
|
967 |
+
|
968 |
+
$form_array['quiz']['global'] = $quiz_global;
|
969 |
+
//$form_array['quiz']['global'] = self::get_quiz_overalls($form);
|
970 |
+
|
971 |
+
}
|
972 |
+
|
973 |
+
return $form_array;
|
974 |
+
}
|
975 |
+
|
976 |
+
private static function get_addon_global_data($form, $options, $fields)
|
977 |
+
{
|
978 |
+
/* if the results class isn't loaded, load it */
|
979 |
+
if (!class_exists("GFResults"))
|
980 |
+
{
|
981 |
+
require_once(GFCommon::get_base_path() . "/includes/addon/class-gf-results.php");
|
982 |
+
}
|
983 |
+
|
984 |
+
$form_id = $form['id'];
|
985 |
+
|
986 |
+
/* add form filter to keep in line with GF standard */
|
987 |
+
$form = apply_filters( "gform_form_pre_results_$form_id", apply_filters( 'gform_form_pre_results', $form ) );
|
988 |
+
|
989 |
+
/* initiat the results class */
|
990 |
+
$gf_results = new GFResults('', $options);
|
991 |
+
|
992 |
+
/* ensure that only active leads are queried */
|
993 |
+
$search = array(
|
994 |
+
'field_filters' => array('mode' => ''),
|
995 |
+
'status' => 'active'
|
996 |
+
);
|
997 |
+
|
998 |
+
/* get the results */
|
999 |
+
$data = $gf_results->get_results_data($form, $fields, $search);
|
1000 |
+
|
1001 |
+
/* unset some array keys we don't need */
|
1002 |
+
unset($data['status']);
|
1003 |
+
unset($data['timestamp']);
|
1004 |
+
|
1005 |
+
return $data;
|
1006 |
+
|
1007 |
+
}
|
1008 |
+
|
1009 |
+
/**
|
1010 |
+
* Gravity Forms is throwing notices when accessing get_results_data()
|
1011 |
+
* due to poor validation. To fix this we'll unset the 'choices' array key
|
1012 |
+
* if it is not an array (the expected input for this function)
|
1013 |
+
* @param Array $fields The fields array
|
1014 |
+
* @return Array The processed fields array
|
1015 |
+
*/
|
1016 |
+
private static function get_related_fields($fields, $type)
|
1017 |
+
{
|
1018 |
+
foreach($fields as $id => $field)
|
1019 |
+
{
|
1020 |
+
if($field['type'] !== $type)
|
1021 |
+
{
|
1022 |
+
unset($fields[$id]);
|
1023 |
+
continue;
|
1024 |
+
}
|
1025 |
+
}
|
1026 |
+
|
1027 |
+
return $fields;
|
1028 |
+
}
|
1029 |
+
|
1030 |
+
private static function get_quiz_overalls($form)
|
1031 |
+
{
|
1032 |
+
/* we need to tap into functions GF Quiz has so only run if it is active */
|
1033 |
+
if(class_exists('GFQuiz'))
|
1034 |
+
{
|
1035 |
+
/* GFQuiz is a singleton. Get the instance */
|
1036 |
+
$quiz = GFQuiz::get_instance();
|
1037 |
+
|
1038 |
+
/* create our callback to add additional data to the array specific to the quiz plugin */
|
1039 |
+
$options['callbacks']['calculation'] = array(
|
1040 |
+
$quiz,
|
1041 |
+
'results_calculation'
|
1042 |
+
);
|
1043 |
+
|
1044 |
+
$fields = self::get_related_fields($form["fields"], 'quiz');
|
1045 |
+
|
1046 |
+
$quiz_results = self::get_addon_global_data($form, $options, $fields);
|
1047 |
+
|
1048 |
+
return $quiz_results;
|
1049 |
+
}
|
1050 |
+
|
1051 |
+
return array(__('Activate Gravity Forms Quiz Add On to see global quiz statistics for this form', 'pdfextended'));
|
1052 |
+
}
|
1053 |
+
|
1054 |
+
private static function get_html($field, $form_array)
|
1055 |
+
{
|
1056 |
+
if(isset($field['content']))
|
1057 |
+
{
|
1058 |
+
$form_array['html'][] = wpautop($field['content']);
|
1059 |
+
$form_array['html_id'][$field['id']] = wpautop($field['content']);
|
1060 |
+
}
|
1061 |
+
|
1062 |
+
return $form_array;
|
1063 |
+
}
|
1064 |
+
|
1065 |
+
private static function get_signature($form, $lead, $field, $form_array)
|
1066 |
+
{
|
1067 |
+
$value = RGFormsModel::get_lead_field_value($lead, $field);
|
1068 |
+
$http_folder = RGFormsModel::get_upload_url_root(). 'signatures/';
|
1069 |
+
$server_folder = RGFormsModel::get_upload_root() . 'signatures/';
|
1070 |
+
$file = $server_folder.$value;
|
1071 |
+
$sig_html = '';
|
1072 |
+
|
1073 |
+
/*
|
1074 |
+
* Set defaults is we cannot find the images
|
1075 |
+
*/
|
1076 |
+
$width = 75;
|
1077 |
+
$height = 45;
|
1078 |
+
|
1079 |
+
/*
|
1080 |
+
* Only get sane defaults specific to the image if we can find it.
|
1081 |
+
*/
|
1082 |
+
if(file_exists($file) !== false && is_dir($file) !== true)
|
1083 |
+
{
|
1084 |
+
$image_size = getimagesize($file);
|
1085 |
+
$width = $image_size[0] / 4;
|
1086 |
+
$height = $image_size[1] / 4;
|
1087 |
+
$sig_html = '<img src="'. $server_folder.$value .'" alt="Signature" width="'. $width .'" height="'. $height .'" />';
|
1088 |
+
}
|
1089 |
+
|
1090 |
+
/*
|
1091 |
+
* Include the image details
|
1092 |
+
*/
|
1093 |
+
|
1094 |
+
|
1095 |
+
$form_array['signature'][] = $sig_html;
|
1096 |
+
$form_array['signature_details'][] = array(
|
1097 |
+
'img' => $sig_html,
|
1098 |
+
'path' => $file,
|
1099 |
+
'url' => $http_folder.$value,
|
1100 |
+
'width' => $width,
|
1101 |
+
'height' => $height,
|
1102 |
+
);
|
1103 |
+
|
1104 |
+
$form_array['signature_details_id'][$field['id']] = array(
|
1105 |
+
'img' => $sig_html,
|
1106 |
+
'path' => $file,
|
1107 |
+
'url' => $http_folder.$value,
|
1108 |
+
'width' => $width,
|
1109 |
+
'height' => $height,
|
1110 |
+
);
|
1111 |
+
|
1112 |
+
|
1113 |
+
return $form_array;
|
1114 |
+
}
|
1115 |
+
|
1116 |
+
private static function get_fileupload($form, $lead, $field, $form_array)
|
1117 |
+
{
|
1118 |
+
$value = RGFormsModel::get_lead_field_value($lead, $field);
|
1119 |
+
$display = self::get_lead_field_display($field, $value, $lead['currency']);
|
1120 |
+
|
1121 |
+
/*
|
1122 |
+
* Get the absolute path to the upload
|
1123 |
+
*/
|
1124 |
+
$path = str_replace(home_url().'/', ABSPATH, $display);
|
1125 |
+
|
1126 |
+
/* add path */
|
1127 |
+
$form_array['field'][$field['id'].'_path'] = $path;
|
1128 |
+
$form_array['field'][$field['id'].'.'.$field['label'].'_path'] = $path;
|
1129 |
+
|
1130 |
+
return self::assign_form($field, $display, $form_array);
|
1131 |
+
}
|
1132 |
+
|
1133 |
+
private static function get_default_list($lead, $field, $form_array)
|
1134 |
+
{
|
1135 |
+
$value = self::remove_empty_list_rows(unserialize(RGFormsModel::get_lead_field_value($lead, $field)));
|
1136 |
+
$form_array['list'][$field['id']] = $value;
|
1137 |
+
|
1138 |
+
return $form_array;
|
1139 |
+
}
|
1140 |
+
|
1141 |
+
private static function remove_empty_list_rows($list)
|
1142 |
+
{
|
1143 |
+
/*
|
1144 |
+
* Check if there are any values in the list
|
1145 |
+
*/
|
1146 |
+
if(!is_array($list) || sizeof($list) == 0)
|
1147 |
+
{
|
1148 |
+
return $list;
|
1149 |
+
}
|
1150 |
+
|
1151 |
+
/*
|
1152 |
+
* Check if it's a multi column list
|
1153 |
+
*/
|
1154 |
+
if(!is_array($list[0]))
|
1155 |
+
{
|
1156 |
+
$list = array_filter($list);
|
1157 |
+
}
|
1158 |
+
else
|
1159 |
+
{
|
1160 |
+
$list = self::remove_empty_multi_col_list($list);
|
1161 |
+
}
|
1162 |
+
|
1163 |
+
return $list;
|
1164 |
+
}
|
1165 |
+
|
1166 |
+
private static function remove_empty_multi_col_list($list)
|
1167 |
+
{
|
1168 |
+
foreach($list as $id => $row)
|
1169 |
+
{
|
1170 |
+
|
1171 |
+
$empty = true;
|
1172 |
+
foreach($row as &$col)
|
1173 |
+
{
|
1174 |
+
/* check if there is data and if so break the loop */
|
1175 |
+
if(trim(strlen($col) > 0))
|
1176 |
+
{
|
1177 |
+
$empty = false;
|
1178 |
+
break;
|
1179 |
+
}
|
1180 |
+
}
|
1181 |
+
|
1182 |
+
/* remove row from list */
|
1183 |
+
if($empty)
|
1184 |
+
{
|
1185 |
+
unset($list[$id]);
|
1186 |
+
}
|
1187 |
+
}
|
1188 |
+
|
1189 |
+
return $list;
|
1190 |
+
}
|
1191 |
+
|
1192 |
+
private static function get_the_list($lead, $field, $form_array)
|
1193 |
+
{
|
1194 |
+
$value = RGFormsModel::get_lead_field_value($lead, $field);
|
1195 |
+
$display = self::get_lead_field_display($field, $value, $lead['currency']);
|
1196 |
+
|
1197 |
+
$form_array = self::assign_form($field, $display, $form_array);
|
1198 |
+
|
1199 |
+
/*
|
1200 |
+
* Include these items correct names
|
1201 |
+
*/
|
1202 |
+
$display = self::get_lead_field_display($field, $value, $lead['currency'], true);
|
1203 |
+
/* add data to field tag correctly */
|
1204 |
+
$form_array['field'][$field['id'].'.'.$field['label'].'_name'] = $display;
|
1205 |
+
|
1206 |
+
/* add ID incase want to use template on multiple duplicate forms with different field names */
|
1207 |
+
$form_array['field'][$field['id'].'_name'] = $display;
|
1208 |
+
|
1209 |
+
/* keep backwards compatibility */
|
1210 |
+
$form_array['field'][$field['label'].'_name'] = $display;
|
1211 |
+
|
1212 |
+
return $form_array;
|
1213 |
+
}
|
1214 |
+
|
1215 |
+
private static function get_defaults($lead, $field, $form_array)
|
1216 |
+
{
|
1217 |
+
$value = RGFormsModel::get_lead_field_value($lead, $field);
|
1218 |
+
$display = self::get_lead_field_display($field, $value, $lead['currency']);
|
1219 |
+
|
1220 |
+
return self::assign_form($field, $display, $form_array);
|
1221 |
+
}
|
1222 |
+
|
1223 |
+
private static function assign_form($field, $display, $form_array)
|
1224 |
+
{
|
1225 |
+
/* add data to field tag correctly */
|
1226 |
+
$form_array['field'][$field['id'].'.'.$field['label']] = $display;
|
1227 |
+
|
1228 |
+
/* add ID incase want to use template on multiple duplicate forms with different field names */
|
1229 |
+
$form_array['field'][$field['id']] = $display;
|
1230 |
+
|
1231 |
+
/* keep backwards compatibility */
|
1232 |
+
$form_array['field'][$field['label']] = $display;
|
1233 |
+
|
1234 |
+
return $form_array;
|
1235 |
+
}
|
1236 |
+
|
1237 |
+
private static function get_product_array($form, $lead, $has_product_fields, $form_array)
|
1238 |
+
{
|
1239 |
+
$currency_type = (method_exists('GFCommon', 'is_currency_decimal_dot')) ? GFCommon::is_currency_decimal_dot() : PDF_Common::is_currency_decimal_dot();
|
1240 |
+
$currency_format = $currency_type ? 'decimal_dot' : 'decimal_comma';
|
1241 |
+
|
1242 |
+
if($has_product_fields) {
|
1243 |
+
$products = GFCommon::get_product_fields($form, $lead, true);
|
1244 |
+
|
1245 |
+
/* check that there are actual product fields */
|
1246 |
+
if(sizeof($products['products']) > 0 )
|
1247 |
+
{
|
1248 |
+
|
1249 |
+
/*
|
1250 |
+
* Set up our variables
|
1251 |
+
*/
|
1252 |
+
$total = 0;
|
1253 |
+
$subtotal = 0;
|
1254 |
+
|
1255 |
+
foreach($products['products'] as $id => $product) {
|
1256 |
+
$price = GFCommon::to_number($product['price']);
|
1257 |
+
|
1258 |
+
/* add all options to total price */
|
1259 |
+
if(is_array(rgar($product,'options')))
|
1260 |
+
{
|
1261 |
+
foreach($product['options'] as $option){
|
1262 |
+
$price += GFCommon::to_number($option['price']);
|
1263 |
+
}
|
1264 |
+
}
|
1265 |
+
|
1266 |
+
/* calculate subtotal */
|
1267 |
+
$subtotal = floatval($product['quantity']) * $price;
|
1268 |
+
$total += $subtotal;
|
1269 |
+
|
1270 |
+
/*
|
1271 |
+
* Check if we should include options
|
1272 |
+
*/
|
1273 |
+
$options = isset($product['options']) ? $product['options'] : array();
|
1274 |
+
|
1275 |
+
/*
|
1276 |
+
* Add formated price for each product option
|
1277 |
+
*/
|
1278 |
+
foreach($options as &$o)
|
1279 |
+
{
|
1280 |
+
if(is_numeric($o['price']))
|
1281 |
+
{
|
1282 |
+
$o['price_formatted'] = GFCommon::format_number($o['price'], 'currency');
|
1283 |
+
}
|
1284 |
+
}
|
1285 |
+
|
1286 |
+
/*
|
1287 |
+
* Store product in $form_array array
|
1288 |
+
*/
|
1289 |
+
$form_array['products'][$id] = array(
|
1290 |
+
'name' => esc_html($product['name']),
|
1291 |
+
'price' => esc_html($product['price']),
|
1292 |
+
'price_unformatted' => GFCommon::clean_number($product['price'], $currency_format),
|
1293 |
+
'options' => $options,
|
1294 |
+
'quantity' => $product['quantity'],
|
1295 |
+
'subtotal' => $subtotal,
|
1296 |
+
'subtotal_formatted' => GFCommon::format_number($subtotal, 'currency'));
|
1297 |
+
}
|
1298 |
+
|
1299 |
+
/* Increment total */
|
1300 |
+
$total += floatval($products['shipping']['price']);
|
1301 |
+
$subtotal = $total - floatval($products['shipping']['price']);
|
1302 |
+
|
1303 |
+
/* add totals to form data */
|
1304 |
+
$form_array['products_totals'] = array(
|
1305 |
+
'subtotal' => $subtotal,
|
1306 |
+
'shipping' => $products['shipping']['price'],
|
1307 |
+
'total' => $total,
|
1308 |
+
'shipping_formatted' => GFCommon::format_number($products['shipping']['price'], 'currency'),
|
1309 |
+
'subtotal_formatted' => GFCommon::format_number($subtotal, 'currency'),
|
1310 |
+
'total_formatted' => GFCommon::format_number($total, 'currency'),
|
1311 |
+
);
|
1312 |
+
}
|
1313 |
+
}
|
1314 |
+
|
1315 |
+
return $form_array;
|
1316 |
+
}
|
1317 |
+
|
1318 |
+
public static function get_lead_field_display($field, $value, $currency='', $use_text=false, $format='html', $media='screen'){
|
1319 |
+
|
1320 |
+
if($field['type'] == 'post_category')
|
1321 |
+
$value = GFCommon::prepare_post_category_value($value, $field);
|
1322 |
+
|
1323 |
+
switch(RGFormsModel::get_input_type($field)){
|
1324 |
+
case 'name' :
|
1325 |
+
if(is_array($value)){
|
1326 |
+
$prefix = trim(rgget($field['id'] . '.2', $value));
|
1327 |
+
$first = trim(rgget($field['id'] . '.3', $value));
|
1328 |
+
$middle = trim(rgget($field['id'] . '.4', $value));
|
1329 |
+
$last = trim(rgget($field['id'] . '.6', $value));
|
1330 |
+
$suffix = trim(rgget($field['id'] . '.8', $value));
|
1331 |
+
|
1332 |
+
return array('prefix' => $prefix, 'first' => $first, 'middle' => $middle, 'last' => $last, 'suffix' => $suffix);
|
1333 |
+
}
|
1334 |
+
else{
|
1335 |
+
return $value;
|
1336 |
+
}
|
1337 |
+
|
1338 |
+
break;
|
1339 |
+
case 'creditcard' :
|
1340 |
+
if(is_array($value)){
|
1341 |
+
$card_number = trim(rgget($field['id'] . '.1', $value));
|
1342 |
+
$card_type = trim(rgget($field['id'] . '.4', $value));
|
1343 |
+
return array('card_number' => $card_number, 'card_type' => $card_type);
|
1344 |
+
}
|
1345 |
+
else{
|
1346 |
+
return '';
|
1347 |
+
}
|
1348 |
+
break;
|
1349 |
+
|
1350 |
+
case 'address' :
|
1351 |
+
if(is_array($value)){
|
1352 |
+
$street_value = trim(rgget($field['id'] . '.1', $value));
|
1353 |
+
$street2_value = trim(rgget($field['id'] . '.2', $value));
|
1354 |
+
$city_value = trim(rgget($field['id'] . '.3', $value));
|
1355 |
+
$state_value = trim(rgget($field['id'] . '.4', $value));
|
1356 |
+
$zip_value = trim(rgget($field['id'] . '.5', $value));
|
1357 |
+
$country_value = trim(rgget($field['id'] . '.6', $value));
|
1358 |
+
|
1359 |
+
$line_break = $format == 'html' ? '<br />' : '\n';
|
1360 |
+
|
1361 |
+
$address_display_format = apply_filters('gform_address_display_format', 'default');
|
1362 |
+
|
1363 |
+
$address['street'] = $street_value;
|
1364 |
+
$address['street2'] = $street2_value;
|
1365 |
+
$address['city'] = $city_value;
|
1366 |
+
$address['state'] = $state_value;
|
1367 |
+
$address['zip'] = $zip_value;
|
1368 |
+
$address['country'] = $country_value;
|
1369 |
+
|
1370 |
+
return $address;
|
1371 |
+
}
|
1372 |
+
else{
|
1373 |
+
return '';
|
1374 |
+
}
|
1375 |
+
break;
|
1376 |
+
|
1377 |
+
case 'email' :
|
1378 |
+
return GFCommon::is_valid_email($value) && $format == 'html' ? $value : $value;
|
1379 |
+
break;
|
1380 |
+
|
1381 |
+
case 'website' :
|
1382 |
+
return GFCommon::is_valid_url($value) && $format == 'html' ? $value : $value;
|
1383 |
+
break;
|
1384 |
+
|
1385 |
+
case 'checkbox' :
|
1386 |
+
if(is_array($value)){
|
1387 |
+
|
1388 |
+
$items = array();
|
1389 |
+
|
1390 |
+
foreach($value as $key => $item){
|
1391 |
+
if(!empty($item)) {
|
1392 |
+
if($field['type'] == 'poll' || $field['type'] == 'survey')
|
1393 |
+
{
|
1394 |
+
/*
|
1395 |
+
* Convert our poll type
|
1396 |
+
*/
|
1397 |
+
$items[] = self::get_poll_checkbox($field, $value);
|
1398 |
+
return $items;
|
1399 |
+
}
|
1400 |
+
|
1401 |
+
switch($format){
|
1402 |
+
case 'text' :
|
1403 |
+
$items[] = GFCommon::selection_display($item, $field, $currency, $use_text);
|
1404 |
+
break;
|
1405 |
+
|
1406 |
+
default:
|
1407 |
+
$items[] = GFCommon::selection_display($item, $field, $currency, $use_text);
|
1408 |
+
break;
|
1409 |
+
}
|
1410 |
+
}
|
1411 |
+
}
|
1412 |
+
if(empty($items)){
|
1413 |
+
return '';
|
1414 |
+
}
|
1415 |
+
else if($format == 'text'){
|
1416 |
+
/*return substr($items, 0, strlen($items)-2); //removing last comma*/
|
1417 |
+
}
|
1418 |
+
else{
|
1419 |
+
return $items;
|
1420 |
+
}
|
1421 |
+
}
|
1422 |
+
else{
|
1423 |
+
return $value;
|
1424 |
+
}
|
1425 |
+
break;
|
1426 |
+
|
1427 |
+
case 'post_image' :
|
1428 |
+
$ary = explode('|:|', $value);
|
1429 |
+
$url = count($ary) > 0 ? $ary[0] : '';
|
1430 |
+
$title = count($ary) > 1 ? $ary[1] : '';
|
1431 |
+
$caption = count($ary) > 2 ? $ary[2] : '';
|
1432 |
+
$description = count($ary) > 3 ? $ary[3] : '';
|
1433 |
+
|
1434 |
+
if(!empty($url)){
|
1435 |
+
$url = str_replace(' ', '%20', $url);
|
1436 |
+
|
1437 |
+
$value = array('url' => $url,
|
1438 |
+
'path' => str_replace(site_url().'/', ABSPATH, $url),
|
1439 |
+
'title' => $title,
|
1440 |
+
'caption' => $caption,
|
1441 |
+
'description' => $description);
|
1442 |
+
}
|
1443 |
+
return $value;
|
1444 |
+
|
1445 |
+
case 'fileupload' :
|
1446 |
+
$output_arr = array();
|
1447 |
+
if(!empty($value)){
|
1448 |
+
$file_paths = rgar($field,'multipleFiles') ? json_decode($value) : array($value);
|
1449 |
+
foreach($file_paths as $file_path){
|
1450 |
+
$info = pathinfo($file_path);
|
1451 |
+
$file_path = esc_attr(str_replace(' ', '%20', $file_path));
|
1452 |
+
$output_arr[] = $file_path;
|
1453 |
+
}
|
1454 |
+
$output = join(PHP_EOL, $output_arr);
|
1455 |
+
}
|
1456 |
+
return $output_arr;
|
1457 |
+
break;
|
1458 |
+
|
1459 |
+
case 'date' :
|
1460 |
+
return GFCommon::date_display($value, rgar($field, 'dateFormat'));
|
1461 |
+
break;
|
1462 |
+
|
1463 |
+
case 'radio' :
|
1464 |
+
case 'select' :
|
1465 |
+
return GFCommon::selection_display($value, $field, $currency, $use_text);
|
1466 |
+
break;
|
1467 |
+
|
1468 |
+
case 'multiselect' :
|
1469 |
+
if(empty($value) || $format == 'text')
|
1470 |
+
return $value;
|
1471 |
+
|
1472 |
+
if(!is_array($value))
|
1473 |
+
{
|
1474 |
+
$value = explode(',', $value);
|
1475 |
+
}
|
1476 |
+
|
1477 |
+
$items = '';
|
1478 |
+
foreach($value as $item){
|
1479 |
+
$items[] = GFCommon::selection_display($item, $field, $currency, $use_text);
|
1480 |
+
}
|
1481 |
+
|
1482 |
+
if(sizeof($items) == 1)
|
1483 |
+
{
|
1484 |
+
return $items[0];
|
1485 |
+
}
|
1486 |
+
return $items;
|
1487 |
+
|
1488 |
+
|
1489 |
+
break;
|
1490 |
+
|
1491 |
+
case 'calculation' :
|
1492 |
+
case 'singleproduct' :
|
1493 |
+
if(is_array($value)){
|
1494 |
+
$product_name = trim($value[$field['id'] . '.1']);
|
1495 |
+
$price = trim($value[$field['id'] . '.2']);
|
1496 |
+
$quantity = trim($value[$field['id'] . '.3']);
|
1497 |
+
|
1498 |
+
$product = $product_name . ', ' . __('Qty: ', 'gravityforms') . $quantity . ', ' . __('Price: ', 'gravityforms') . $price;
|
1499 |
+
|
1500 |
+
return $product;
|
1501 |
+
}
|
1502 |
+
else{
|
1503 |
+
return '';
|
1504 |
+
}
|
1505 |
+
break;
|
1506 |
+
|
1507 |
+
case 'number' :
|
1508 |
+
return GFCommon::format_number($value, rgar($field, 'numberFormat'));
|
1509 |
+
break;
|
1510 |
+
|
1511 |
+
case 'singleshipping' :
|
1512 |
+
case 'donation' :
|
1513 |
+
case 'total' :
|
1514 |
+
case 'price' :
|
1515 |
+
return GFCommon::to_money($value, $currency);
|
1516 |
+
|
1517 |
+
case 'list' :
|
1518 |
+
if(empty($value))
|
1519 |
+
return '';
|
1520 |
+
$value = unserialize($value);
|
1521 |
+
|
1522 |
+
$has_columns = is_array($value[0]);
|
1523 |
+
|
1524 |
+
if(!$has_columns){
|
1525 |
+
$items = array();
|
1526 |
+
foreach($value as $key => $item){
|
1527 |
+
if(!empty($item)){
|
1528 |
+
switch($format){
|
1529 |
+
case 'text' :
|
1530 |
+
$items[] = $item;
|
1531 |
+
break;
|
1532 |
+
case 'url' :
|
1533 |
+
$items[] = $item;
|
1534 |
+
break;
|
1535 |
+
default :
|
1536 |
+
if($media == 'email'){
|
1537 |
+
$items[] = $item;
|
1538 |
+
}
|
1539 |
+
else{
|
1540 |
+
$items[] = $item;
|
1541 |
+
}
|
1542 |
+
break;
|
1543 |
+
}
|
1544 |
+
}
|
1545 |
+
}
|
1546 |
+
|
1547 |
+
if(empty($items)){
|
1548 |
+
return '';
|
1549 |
+
}
|
1550 |
+
else if($format == 'text'){
|
1551 |
+
/* return substr($items, 0, strlen($items)-2); //removing last comma*/
|
1552 |
+
return $items;
|
1553 |
+
}
|
1554 |
+
else if($format == 'url'){
|
1555 |
+
/*return substr($items, 0, strlen($items)-1); //removing last comma*/
|
1556 |
+
return $items;
|
1557 |
+
}
|
1558 |
+
else if($media == 'email'){
|
1559 |
+
return $items;
|
1560 |
+
}
|
1561 |
+
else {
|
1562 |
+
$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%">';
|
1563 |
+
foreach($items as $i)
|
1564 |
+
{
|
1565 |
+
$list .= '<tr><td>' . $i .'</td></tr>';
|
1566 |
+
}
|
1567 |
+
$list .= '</table>';
|
1568 |
+
|
1569 |
+
return $list;
|
1570 |
+
}
|
1571 |
+
}
|
1572 |
+
else if(is_array($value)){
|
1573 |
+
$columns = array_keys($value[0]);
|
1574 |
+
|
1575 |
+
$list = '';
|
1576 |
+
|
1577 |
+
switch($format){
|
1578 |
+
case 'text' :
|
1579 |
+
$is_first_row = true;
|
1580 |
+
foreach($value as $item){
|
1581 |
+
if(!$is_first_row)
|
1582 |
+
$list .= '\n\n' . $field['label'] . ': ';
|
1583 |
+
$list .= implode(',', array_values($item));
|
1584 |
+
|
1585 |
+
$is_first_row = false;
|
1586 |
+
}
|
1587 |
+
break;
|
1588 |
+
|
1589 |
+
case 'url' :
|
1590 |
+
foreach($value as $item){
|
1591 |
+
$list .= implode('|', array_values($item)) . ',';
|
1592 |
+
}
|
1593 |
+
if(!empty($list))
|
1594 |
+
$list = substr($list, 0, strlen($list)-1);
|
1595 |
+
break;
|
1596 |
+
|
1597 |
+
default :
|
1598 |
+
|
1599 |
+
if($media == 'email'){
|
1600 |
+
$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>';
|
1601 |
+
|
1602 |
+
//reading columns from entry data
|
1603 |
+
foreach($columns as $column){
|
1604 |
+
$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>';
|
1605 |
+
}
|
1606 |
+
$list .= '</tr></thead>';
|
1607 |
+
|
1608 |
+
$list .= '<tbody style="background-color: #F9F9F9">';
|
1609 |
+
foreach($value as $item){
|
1610 |
+
$list .= '<tr>';
|
1611 |
+
foreach($columns as $column){
|
1612 |
+
$val = rgar($item, $column);
|
1613 |
+
$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>';
|
1614 |
+
}
|
1615 |
+
|
1616 |
+
$list .='</tr>';
|
1617 |
+
}
|
1618 |
+
|
1619 |
+
$list .='</tbody></table>';
|
1620 |
+
}
|
1621 |
+
else{
|
1622 |
+
$list = '<table class="gfield_list" autosize="1"><thead><tr>';
|
1623 |
+
|
1624 |
+
//reading columns from entry data
|
1625 |
+
foreach($columns as $column){
|
1626 |
+
$list .= '<th>' . esc_html($column) . '</th>';
|
1627 |
+
}
|
1628 |
+
$list .= '</tr></thead>';
|
1629 |
+
|
1630 |
+
$list .= '<tbody>';
|
1631 |
+
foreach($value as $item){
|
1632 |
+
$list .= '<tr>';
|
1633 |
+
foreach($columns as $column){
|
1634 |
+
$val = rgar($item, $column);
|
1635 |
+
$list .= '<td>'.htmlspecialchars($val).'</td>';
|
1636 |
+
}
|
1637 |
+
|
1638 |
+
$list .='</tr>';
|
1639 |
+
}
|
1640 |
+
|
1641 |
+
$list .='</tbody></table>';
|
1642 |
+
}
|
1643 |
+
break;
|
1644 |
+
}
|
1645 |
+
|
1646 |
+
return $list;
|
1647 |
+
}
|
1648 |
+
return '';
|
1649 |
+
break;
|
1650 |
+
|
1651 |
+
default :
|
1652 |
+
if (!is_array($value))
|
1653 |
+
{
|
1654 |
+
/* Add support for Gravity Forms Rich Text Editor feature in 2.0 */
|
1655 |
+
if ( isset( $field['useRichTextEditor'] ) && true === $field['useRichTextEditor'] ) {
|
1656 |
+
return wp_kses_post( $value );
|
1657 |
+
} else {
|
1658 |
+
return nl2br( $value );
|
1659 |
+
}
|
1660 |
+
}
|
1661 |
+
|
1662 |
+
/* If it is an array we'll just return it as is */
|
1663 |
+
return $value;
|
1664 |
+
break;
|
1665 |
+
}
|
1666 |
+
}
|
1667 |
+
|
1668 |
+
public static function pdf_get_lead_field_display($field, $value, $currency='', $use_text=false, $format='html', $media='screen'){
|
1669 |
+
|
1670 |
+
if($field['type'] == 'post_category')
|
1671 |
+
$value = GFCommon::prepare_post_category_value($value, $field);
|
1672 |
+
|
1673 |
+
switch(RGFormsModel::get_input_type($field)){
|
1674 |
+
case 'name' :
|
1675 |
+
if(is_array($value)){
|
1676 |
+
$prefix = trim(rgget($field['id'] . '.2', $value));
|
1677 |
+
$first = trim(rgget($field['id'] . '.3', $value));
|
1678 |
+
$middle = trim(rgget($field['id'] . '.4', $value));
|
1679 |
+
$last = trim(rgget($field['id'] . '.6', $value));
|
1680 |
+
$suffix = trim(rgget($field['id'] . '.8', $value));
|
1681 |
+
|
1682 |
+
$name = $prefix;
|
1683 |
+
$name .= !empty($name) && !empty($first) ? " $first" : $first;
|
1684 |
+
$name .= !empty($name) && !empty($middle) ? " $middle" : $middle;
|
1685 |
+
$name .= !empty($name) && !empty($last) ? " $last" : $last;
|
1686 |
+
$name .= !empty($name) && !empty($suffix) ? " $suffix" : $suffix;
|
1687 |
+
|
1688 |
+
return $name;
|
1689 |
+
}
|
1690 |
+
else{
|
1691 |
+
return $value;
|
1692 |
+
}
|
1693 |
+
|
1694 |
+
break;
|
1695 |
+
case 'creditcard' :
|
1696 |
+
if(is_array($value)){
|
1697 |
+
$card_number = trim(rgget($field['id'] . '.1', $value));
|
1698 |
+
$card_type = trim(rgget($field['id'] . '.4', $value));
|
1699 |
+
$separator = $format == 'html' ? '<br/>' : '\n';
|
1700 |
+
return empty($card_number) ? '' : $card_type . $separator . $card_number;
|
1701 |
+
}
|
1702 |
+
else{
|
1703 |
+
return '';
|
1704 |
+
}
|
1705 |
+
break;
|
1706 |
+
|
1707 |
+
case 'address' :
|
1708 |
+
if(is_array($value)){
|
1709 |
+
$street_value = trim(rgget($field['id'] . '.1', $value));
|
1710 |
+
$street2_value = trim(rgget($field['id'] . '.2', $value));
|
1711 |
+
$city_value = trim(rgget($field['id'] . '.3', $value));
|
1712 |
+
$state_value = trim(rgget($field['id'] . '.4', $value));
|
1713 |
+
$zip_value = trim(rgget($field['id'] . '.5', $value));
|
1714 |
+
$country_value = trim(rgget($field['id'] . '.6', $value));
|
1715 |
+
|
1716 |
+
$line_break = $format == 'html' ? '<br />' : '\n';
|
1717 |
+
|
1718 |
+
$address_display_format = apply_filters('gform_address_display_format', 'default');
|
1719 |
+
if($address_display_format == 'zip_before_city'){
|
1720 |
+
/*
|
1721 |
+
Sample:
|
1722 |
+
3333 Some Street
|
1723 |
+
suite 16
|
1724 |
+
2344 City, State
|
1725 |
+
Country
|
1726 |
+
*/
|
1727 |
+
|
1728 |
+
$addr_ary = array();
|
1729 |
+
$addr_ary[] = $street_value;
|
1730 |
+
|
1731 |
+
if(!empty($street2_value))
|
1732 |
+
$addr_ary[] = $street2_value;
|
1733 |
+
|
1734 |
+
$zip_line = trim($zip_value . ' ' . $city_value);
|
1735 |
+
$zip_line .= !empty($zip_line) && !empty($state_value) ? ", {$state_value}" : $state_value;
|
1736 |
+
$zip_line = trim($zip_line);
|
1737 |
+
if(!empty($zip_line))
|
1738 |
+
$addr_ary[] = $zip_line;
|
1739 |
+
|
1740 |
+
if(!empty($country_value))
|
1741 |
+
$addr_ary[] = $country_value;
|
1742 |
+
|
1743 |
+
$address = implode('<br />', $addr_ary);
|
1744 |
+
|
1745 |
+
}
|
1746 |
+
else{
|
1747 |
+
$address = $street_value;
|
1748 |
+
$address .= !empty($address) && !empty($street2_value) ? $line_break . $street2_value : $street2_value;
|
1749 |
+
$address .= !empty($address) && (!empty($city_value) || !empty($state_value)) ? $line_break. $city_value : $city_value;
|
1750 |
+
$address .= !empty($address) && !empty($city_value) && !empty($state_value) ? ", $state_value" : $state_value;
|
1751 |
+
$address .= !empty($address) && !empty($zip_value) ? " $zip_value" : $zip_value;
|
1752 |
+
$address .= !empty($address) && !empty($country_value) ? $line_break . $country_value : $country_value;
|
1753 |
+
}
|
1754 |
+
|
1755 |
+
return $address;
|
1756 |
+
}
|
1757 |
+
else{
|
1758 |
+
return '';
|
1759 |
+
}
|
1760 |
+
break;
|
1761 |
+
|
1762 |
+
case 'email' :
|
1763 |
+
return GFCommon::is_valid_email($value) && $format == 'html' ? '<a href="mailto:'. $value .'">'. $value .'</a>' : $value;
|
1764 |
+
break;
|
1765 |
+
|
1766 |
+
case 'website' :
|
1767 |
+
return GFCommon::is_valid_url($value) && $format == 'html' ? '<a href="'. $value .'" target="_blank">'. $value .'</a>' : $value;
|
1768 |
+
break;
|
1769 |
+
|
1770 |
+
case 'checkbox' :
|
1771 |
+
if(is_array($value)){
|
1772 |
+
|
1773 |
+
$items = '';
|
1774 |
+
|
1775 |
+
foreach($value as $key => $item){
|
1776 |
+
if(!empty($item)){
|
1777 |
+
switch($format){
|
1778 |
+
case 'text' :
|
1779 |
+
$items .= GFCommon::selection_display($item, $field, $currency, true) . ', ';
|
1780 |
+
break;
|
1781 |
+
|
1782 |
+
default:
|
1783 |
+
$items .= '<li>' . GFCommon::selection_display($item, $field, $currency, true) . '</li>';
|
1784 |
+
break;
|
1785 |
+
}
|
1786 |
+
}
|
1787 |
+
}
|
1788 |
+
if(empty($items)){
|
1789 |
+
return '';
|
1790 |
+
}
|
1791 |
+
else if($format == 'text'){
|
1792 |
+
return substr($items, 0, strlen($items)-2); //removing last comma
|
1793 |
+
}
|
1794 |
+
else{
|
1795 |
+
return '<ul class="bulleted">' . $items . '</ul>';
|
1796 |
+
}
|
1797 |
+
}
|
1798 |
+
else{
|
1799 |
+
return $value;
|
1800 |
+
}
|
1801 |
+
break;
|
1802 |
+
|
1803 |
+
case 'post_image' :
|
1804 |
+
$ary = explode('|:|', $value);
|
1805 |
+
$url = count($ary) > 0 ? $ary[0] : '';
|
1806 |
+
$title = count($ary) > 1 ? $ary[1] : '';
|
1807 |
+
$caption = count($ary) > 2 ? $ary[2] : '';
|
1808 |
+
$description = count($ary) > 3 ? $ary[3] : '';
|
1809 |
+
|
1810 |
+
if(!empty($url)){
|
1811 |
+
$url = str_replace(' ', '%20', $url);
|
1812 |
+
switch($format){
|
1813 |
+
case 'text' :
|
1814 |
+
$value = $url;
|
1815 |
+
$value .= !empty($title) ? '\n\n' . $field['label'] . ' (' . __('Title', 'gravityforms') . '): ' . $title : '';
|
1816 |
+
$value .= !empty($caption) ? '\n\n' . $field['label'] . ' (' . __('Caption', 'gravityforms') . '): ' . $caption : '';
|
1817 |
+
$value .= !empty($description) ? '\n\n' . $field['label'] . ' (' . __('Description', 'gravityforms') . '): ' . $description : '';
|
1818 |
+
break;
|
1819 |
+
|
1820 |
+
default :
|
1821 |
+
$path = str_replace(site_url().'/', ABSPATH, $url);
|
1822 |
+
$value = "<a href='$url' target='_blank' title='" . __("Click to view", "gravityforms") . "'><img src='$path' width='100' /></a>";
|
1823 |
+
$value .= !empty($title) ? "<div>Title: $title</div>" : "";
|
1824 |
+
$value .= !empty($caption) ? "<div>Caption: $caption</div>" : "";
|
1825 |
+
$value .= !empty($description) ? "<div>Description: $description</div>": "";
|
1826 |
+
|
1827 |
+
break;
|
1828 |
+
}
|
1829 |
+
}
|
1830 |
+
return $value;
|
1831 |
+
|
1832 |
+
case 'fileupload' :
|
1833 |
+
$output = '';
|
1834 |
+
$output_arr = array();
|
1835 |
+
if(!empty($value)){
|
1836 |
+
$output .= '<ul>';
|
1837 |
+
$file_paths = rgar($field,'multipleFiles') ? json_decode($value) : array($value);
|
1838 |
+
foreach($file_paths as $file_path){
|
1839 |
+
$info = pathinfo($file_path);
|
1840 |
+
$file_path = esc_attr(str_replace(' ', '%20', $file_path));
|
1841 |
+
$output_arr[] = '<li><a href="'. $file_path .'" target="_blank" title="' . __('Click to view', 'gravityforms') . '">' . $info['basename'] . '</a></li>';
|
1842 |
+
}
|
1843 |
+
$output .= join(PHP_EOL, $output_arr);
|
1844 |
+
$output .= '</ul>';
|
1845 |
+
}
|
1846 |
+
|
1847 |
+
return $output;
|
1848 |
+
break;
|
1849 |
+
|
1850 |
+
case 'date' :
|
1851 |
+
return GFCommon::date_display($value, rgar($field, 'dateFormat'));
|
1852 |
+
break;
|
1853 |
+
|
1854 |
+
case 'radio' :
|
1855 |
+
case 'select' :
|
1856 |
+
return GFCommon::selection_display($value, $field, $currency, true);
|
1857 |
+
break;
|
1858 |
+
|
1859 |
+
case 'multiselect' :
|
1860 |
+
if(empty($value) || $format == 'text')
|
1861 |
+
return $value;
|
1862 |
+
|
1863 |
+
if(!is_array($value))
|
1864 |
+
{
|
1865 |
+
$value = explode(',', $value);
|
1866 |
+
}
|
1867 |
+
|
1868 |
+
$items = '';
|
1869 |
+
foreach($value as $item){
|
1870 |
+
$items .= '<li>' . GFCommon::selection_display($item, $field, $currency, true) . '</li>';
|
1871 |
+
}
|
1872 |
+
|
1873 |
+
return '<ul class="bulleted">' . $items . '</ul>';
|
1874 |
+
|
1875 |
+
break;
|
1876 |
+
|
1877 |
+
case 'calculation' :
|
1878 |
+
case 'singleproduct' :
|
1879 |
+
if(is_array($value)){
|
1880 |
+
$product_name = trim($value[$field['id'] . '.1']);
|
1881 |
+
$price = trim($value[$field['id'] . '.2']);
|
1882 |
+
$quantity = trim($value[$field['id'] . '.3']);
|
1883 |
+
|
1884 |
+
$product = $product_name . ', ' . __('Qty: ', 'gravityforms') . $quantity . ', ' . __('Price: ', 'gravityforms') . $price;
|
1885 |
+
return $product;
|
1886 |
+
}
|
1887 |
+
else{
|
1888 |
+
return '';
|
1889 |
+
}
|
1890 |
+
break;
|
1891 |
+
|
1892 |
+
case 'number' :
|
1893 |
+
return GFCommon::format_number($value, rgar($field, 'numberFormat'));
|
1894 |
+
break;
|
1895 |
+
|
1896 |
+
case 'singleshipping' :
|
1897 |
+
case 'donation' :
|
1898 |
+
case 'total' :
|
1899 |
+
case 'price' :
|
1900 |
+
return GFCommon::to_money($value, $currency);
|
1901 |
+
|
1902 |
+
case 'list' :
|
1903 |
+
if(empty($value))
|
1904 |
+
return '';
|
1905 |
+
$value = unserialize($value);
|
1906 |
+
|
1907 |
+
$has_columns = is_array($value[0]);
|
1908 |
+
|
1909 |
+
if(!$has_columns){
|
1910 |
+
$items = '';
|
1911 |
+
foreach($value as $key => $item){
|
1912 |
+
if(!empty($item)){
|
1913 |
+
switch($format){
|
1914 |
+
case 'text' :
|
1915 |
+
$items .= $item . ', ';
|
1916 |
+
break;
|
1917 |
+
case 'url' :
|
1918 |
+
$items .= $item . ',';
|
1919 |
+
break;
|
1920 |
+
default :
|
1921 |
+
if($media == 'email'){
|
1922 |
+
$items .= '<li>'.htmlspecialchars($item).'</li>';
|
1923 |
+
}
|
1924 |
+
else{
|
1925 |
+
$items .= '<li>'.htmlspecialchars($item).'</li>';
|
1926 |
+
}
|
1927 |
+
break;
|
1928 |
+
}
|
1929 |
+
}
|
1930 |
+
}
|
1931 |
+
|
1932 |
+
if(empty($items)){
|
1933 |
+
return '';
|
1934 |
+
}
|
1935 |
+
else if($format == 'text'){
|
1936 |
+
return substr($items, 0, strlen($items)-2); //removing last comma
|
1937 |
+
}
|
1938 |
+
else if($format == 'url'){
|
1939 |
+
return substr($items, 0, strlen($items)-1); //removing last comma
|
1940 |
+
}
|
1941 |
+
else{
|
1942 |
+
return '<ul class="bulleted">' . $items . '</ul>';
|
1943 |
+
}
|
1944 |
+
}
|
1945 |
+
else if(is_array($value)){
|
1946 |
+
$columns = array_keys($value[0]);
|
1947 |
+
|
1948 |
+
$list = '';
|
1949 |
+
|
1950 |
+
switch($format){
|
1951 |
+
case 'text' :
|
1952 |
+
$is_first_row = true;
|
1953 |
+
foreach($value as $item){
|
1954 |
+
if(!$is_first_row)
|
1955 |
+
$list .= '\n\n' . $field['label'] . ': ';
|
1956 |
+
$list .= implode(',', array_values($item));
|
1957 |
+
|
1958 |
+
$is_first_row = false;
|
1959 |
+
}
|
1960 |
+
break;
|
1961 |
+
|
1962 |
+
case 'url' :
|
1963 |
+
foreach($value as $item){
|
1964 |
+
$list .= implode('|', array_values($item)) . ',';
|
1965 |
+
}
|
1966 |
+
if(!empty($list))
|
1967 |
+
$list = substr($list, 0, strlen($list)-1);
|
1968 |
+
break;
|
1969 |
+
|
1970 |
+
default :
|
1971 |
+
if($media == 'email'){
|
1972 |
+
$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>';
|
1973 |
+
|
1974 |
+
//reading columns from entry data
|
1975 |
+
foreach($columns as $column){
|
1976 |
+
$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>';
|
1977 |
+
}
|
1978 |
+
$list .= '</tr></thead>';
|
1979 |
+
|
1980 |
+
$list .= '<tbody style="background-color: #F9F9F9">';
|
1981 |
+
foreach($value as $item){
|
1982 |
+
$list .= '<tr>';
|
1983 |
+
foreach($columns as $column){
|
1984 |
+
$val = rgar($item, $column);
|
1985 |
+
$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>';
|
1986 |
+
}
|
1987 |
+
|
1988 |
+
$list .='</tr>';
|
1989 |
+
}
|
1990 |
+
|
1991 |
+
$list .='</tbody></table>';
|
1992 |
+
}
|
1993 |
+
else{
|
1994 |
+
$list = '<table autosize="1" class="gfield_list"><thead><tr>';
|
1995 |
+
|
1996 |
+
//reading columns from entry data
|
1997 |
+
foreach($columns as $column){
|
1998 |
+
$list .= '<th>' . esc_html($column) . '</th>';
|
1999 |
+
}
|
2000 |
+
$list .= '</tr></thead>';
|
2001 |
+
|
2002 |
+
$list .= '<tbody>';
|
2003 |
+
foreach($value as $item){
|
2004 |
+
$list .= '<tr>';
|
2005 |
+
foreach($columns as $column){
|
2006 |
+
$val = rgar($item, $column);
|
2007 |
+
$list .= '<td>'.htmlspecialchars($val).'</td>';
|
2008 |
+
}
|
2009 |
+
|
2010 |
+
$list .='</tr>';
|
2011 |
+
}
|
2012 |
+
|
2013 |
+
$list .='</tbody></table>';
|
2014 |
+
}
|
2015 |
+
break;
|
2016 |
+
}
|
2017 |
+
|
2018 |
+
return $list;
|
2019 |
+
}
|
2020 |
+
return '';
|
2021 |
+
break;
|
2022 |
+
|
2023 |
+
default :
|
2024 |
+
if (!is_array($value))
|
2025 |
+
{
|
2026 |
+
/* Add support for Gravity Forms Rich Text Editor feature in 2.0 */
|
2027 |
+
if ( isset( $field['useRichTextEditor'] ) && true === $field['useRichTextEditor'] ) {
|
2028 |
+
return wp_kses_post( $value );
|
2029 |
+
} else {
|
2030 |
+
return nl2br( $value );
|
2031 |
+
}
|
2032 |
+
}
|
2033 |
+
|
2034 |
+
/* If it is an array we'll just return it as is */
|
2035 |
+
return $value;
|
2036 |
+
break;
|
2037 |
+
}
|
2038 |
+
}
|
2039 |
+
|
2040 |
+
|
2041 |
+
public static function encode_tags($content, $field)
|
2042 |
+
{
|
2043 |
+
if(RGFormsModel::get_input_type($field) != 'html' || RGFormsModel::get_input_type($field) != 'signature')
|
2044 |
+
{
|
2045 |
+
$content = str_replace('[', '[', $content);
|
2046 |
+
$content = str_replace(']', ']', $content);
|
2047 |
+
$content = str_replace('{', '{', $content);
|
2048 |
+
$content = str_replace('}', '}', $content);
|
2049 |
+
}
|
2050 |
+
|
2051 |
+
return $content;
|
2052 |
+
}
|
2053 |
+
}
|
2054 |
}
|
helper/pdf-render.php
CHANGED
@@ -1,320 +1,320 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
This file is part of Gravity PDF.
|
5 |
-
|
6 |
-
Gravity PDF Copyright (C) 2015 Blue Liquid Designs
|
7 |
-
|
8 |
-
This program is free software; you can redistribute it and/or modify
|
9 |
-
it under the terms of the GNU General Public License as published by
|
10 |
-
the Free Software Foundation; either version 2 of the License, or
|
11 |
-
(at your option) any later version.
|
12 |
-
|
13 |
-
This program is distributed in the hope that it will be useful,
|
14 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
16 |
-
GNU General Public License for more details.
|
17 |
-
|
18 |
-
You should have received a copy of the GNU General Public License
|
19 |
-
along with this program; if not, write to the Free Software
|
20 |
-
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
21 |
-
*/
|
22 |
-
|
23 |
-
class PDFRender
|
24 |
-
{
|
25 |
-
/**
|
26 |
-
* Outputs a PDF entry from a Gravity Form
|
27 |
-
* var $form_id integer: The form id
|
28 |
-
* var $lead_id integer: The entry id
|
29 |
-
* var $output string: either view, save or download
|
30 |
-
* save will save a copy of the PDF to the server using the $gfpdfe_data->template_save_location variable
|
31 |
-
* var $return boolean: if set to true
|
32 |
-
* it will return the path of the saved PDF
|
33 |
-
* var $template string: if you want to use multiple PDF templates - name of the template file
|
34 |
-
* 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)
|
35 |
-
* var $fpdf boolean: custom hook to allow the FPDF engine to generate PDFs instead of DOMPDF. Premium Paid Feature.
|
36 |
-
*/
|
37 |
-
public function PDF_Generator($form_id, $lead_id, $arguments = array())
|
38 |
-
{
|
39 |
-
global $gfpdfe_data;
|
40 |
-
|
41 |
-
/*
|
42 |
-
* Set user-variable to output HTML instead of PDF
|
43 |
-
*/
|
44 |
-
$html = (isset($_GET['html'])) ? (int) $_GET['html'] : 0;
|
45 |
-
|
46 |
-
/*
|
47 |
-
* Join the form and lead IDs together to get the real ID
|
48 |
-
*/
|
49 |
-
$id = $form_id . $lead_id;
|
50 |
-
|
51 |
-
/*
|
52 |
-
* PDF_Generator was becoming too cluttered so store all the variables in an array
|
53 |
-
*/
|
54 |
-
$filename = $arguments['pdfname'];
|
55 |
-
$template = $arguments['template'];
|
56 |
-
$output = (isset($arguments['output']) && strlen($arguments['output']) > 0) ? $arguments['output'] : 'save';
|
57 |
-
|
58 |
-
/*
|
59 |
-
* Add filter before we load the template file so we can stop the main process
|
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
|
76 |
-
*/
|
77 |
-
if($html === 1)
|
78 |
-
{
|
79 |
-
echo $entry;
|
80 |
-
exit;
|
81 |
-
}
|
82 |
-
|
83 |
-
/*
|
84 |
-
* If successfully got the entry then run the processor
|
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;
|
92 |
-
}
|
93 |
-
/*
|
94 |
-
* Used in extensions to return the name of the PDF file when attaching to notifications
|
95 |
-
*/
|
96 |
-
return apply_filters('gfpdfe_return_pdf_path', $form_id, $lead_id);
|
97 |
-
}
|
98 |
-
|
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 |
-
}
|
129 |
-
|
130 |
-
|
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
|
138 |
-
* Check which version of mpdf we are calling
|
139 |
-
* Full, Lite or Tiny
|
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 |
-
}
|
151 |
-
else
|
152 |
-
{
|
153 |
-
include PDF_PLUGIN_DIR .'/mPDF/mpdf.php';
|
154 |
-
}
|
155 |
-
}
|
156 |
-
|
157 |
-
/*
|
158 |
-
* Initialise class and set the paper size and orientation
|
159 |
-
*/
|
160 |
-
$paper_size = $arguments['pdf_size'];
|
161 |
-
|
162 |
-
if(!is_array($paper_size))
|
163 |
-
{
|
164 |
-
$orientation = ($arguments['orientation'] == 'landscape') ? '-L' : '';
|
165 |
-
$paper_size = $paper_size.$orientation;
|
166 |
-
}
|
167 |
-
else
|
168 |
-
{
|
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
|
182 |
-
* Normally PDF is zoomed right in.
|
183 |
-
*/
|
184 |
-
$mpdf->SetDisplayMode('fullpage');
|
185 |
-
|
186 |
-
/*
|
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
|
209 |
-
*/
|
210 |
-
if($arguments['rtl'] === true)
|
211 |
-
{
|
212 |
-
$mpdf->SetDirectionality('rtl');
|
213 |
-
}
|
214 |
-
|
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 |
-
{
|
265 |
-
case 'download':
|
266 |
-
$mpdf->Output($filename, 'D');
|
267 |
-
exit;
|
268 |
-
break;
|
269 |
-
|
270 |
-
case 'view':
|
271 |
-
$mpdf->Output($filename, 'I');
|
272 |
-
exit;
|
273 |
-
break;
|
274 |
-
|
275 |
-
case 'save':
|
276 |
-
/*
|
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 |
-
}
|
289 |
-
|
290 |
-
|
291 |
-
/**
|
292 |
-
* Creates the PDF and does a specific output (see PDF_Generator function above for $output variable types)
|
293 |
-
* var $dompdf Object
|
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 |
-
}
|
320 |
-
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
This file is part of Gravity PDF.
|
5 |
+
|
6 |
+
Gravity PDF Copyright (C) 2015 Blue Liquid Designs
|
7 |
+
|
8 |
+
This program is free software; you can redistribute it and/or modify
|
9 |
+
it under the terms of the GNU General Public License as published by
|
10 |
+
the Free Software Foundation; either version 2 of the License, or
|
11 |
+
(at your option) any later version.
|
12 |
+
|
13 |
+
This program is distributed in the hope that it will be useful,
|
14 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
16 |
+
GNU General Public License for more details.
|
17 |
+
|
18 |
+
You should have received a copy of the GNU General Public License
|
19 |
+
along with this program; if not, write to the Free Software
|
20 |
+
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
21 |
+
*/
|
22 |
+
|
23 |
+
class PDFRender
|
24 |
+
{
|
25 |
+
/**
|
26 |
+
* Outputs a PDF entry from a Gravity Form
|
27 |
+
* var $form_id integer: The form id
|
28 |
+
* var $lead_id integer: The entry id
|
29 |
+
* var $output string: either view, save or download
|
30 |
+
* save will save a copy of the PDF to the server using the $gfpdfe_data->template_save_location variable
|
31 |
+
* var $return boolean: if set to true
|
32 |
+
* it will return the path of the saved PDF
|
33 |
+
* var $template string: if you want to use multiple PDF templates - name of the template file
|
34 |
+
* 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)
|
35 |
+
* var $fpdf boolean: custom hook to allow the FPDF engine to generate PDFs instead of DOMPDF. Premium Paid Feature.
|
36 |
+
*/
|
37 |
+
public function PDF_Generator($form_id, $lead_id, $arguments = array())
|
38 |
+
{
|
39 |
+
global $gfpdfe_data;
|
40 |
+
|
41 |
+
/*
|
42 |
+
* Set user-variable to output HTML instead of PDF
|
43 |
+
*/
|
44 |
+
$html = (isset($_GET['html'])) ? (int) $_GET['html'] : 0;
|
45 |
+
|
46 |
+
/*
|
47 |
+
* Join the form and lead IDs together to get the real ID
|
48 |
+
*/
|
49 |
+
$id = $form_id . $lead_id;
|
50 |
+
|
51 |
+
/*
|
52 |
+
* PDF_Generator was becoming too cluttered so store all the variables in an array
|
53 |
+
*/
|
54 |
+
$filename = $arguments['pdfname'];
|
55 |
+
$template = $arguments['template'];
|
56 |
+
$output = (isset($arguments['output']) && strlen($arguments['output']) > 0) ? $arguments['output'] : 'save';
|
57 |
+
|
58 |
+
/*
|
59 |
+
* Add filter before we load the template file so we can stop the main process
|
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
|
76 |
+
*/
|
77 |
+
if($html === 1)
|
78 |
+
{
|
79 |
+
echo $entry;
|
80 |
+
exit;
|
81 |
+
}
|
82 |
+
|
83 |
+
/*
|
84 |
+
* If successfully got the entry then run the processor
|
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;
|
92 |
+
}
|
93 |
+
/*
|
94 |
+
* Used in extensions to return the name of the PDF file when attaching to notifications
|
95 |
+
*/
|
96 |
+
return apply_filters('gfpdfe_return_pdf_path', $form_id, $lead_id);
|
97 |
+
}
|
98 |
+
|
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 |
+
}
|
129 |
+
|
130 |
+
|
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
|
138 |
+
* Check which version of mpdf we are calling
|
139 |
+
* Full, Lite or Tiny
|
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 |
+
}
|
151 |
+
else
|
152 |
+
{
|
153 |
+
include PDF_PLUGIN_DIR .'/mPDF/mpdf.php';
|
154 |
+
}
|
155 |
+
}
|
156 |
+
|
157 |
+
/*
|
158 |
+
* Initialise class and set the paper size and orientation
|
159 |
+
*/
|
160 |
+
$paper_size = $arguments['pdf_size'];
|
161 |
+
|
162 |
+
if(!is_array($paper_size))
|
163 |
+
{
|
164 |
+
$orientation = ($arguments['orientation'] == 'landscape') ? '-L' : '';
|
165 |
+
$paper_size = $paper_size.$orientation;
|
166 |
+
}
|
167 |
+
else
|
168 |
+
{
|
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
|
182 |
+
* Normally PDF is zoomed right in.
|
183 |
+
*/
|
184 |
+
$mpdf->SetDisplayMode('fullpage');
|
185 |
+
|
186 |
+
/*
|
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
|
209 |
+
*/
|
210 |
+
if($arguments['rtl'] === true)
|
211 |
+
{
|
212 |
+
$mpdf->SetDirectionality('rtl');
|
213 |
+
}
|
214 |
+
|
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 |
+
{
|
265 |
+
case 'download':
|
266 |
+
$mpdf->Output($filename, 'D');
|
267 |
+
exit;
|
268 |
+
break;
|
269 |
+
|
270 |
+
case 'view':
|
271 |
+
$mpdf->Output($filename, 'I');
|
272 |
+
exit;
|
273 |
+
break;
|
274 |
+
|
275 |
+
case 'save':
|
276 |
+
/*
|
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 |
+
}
|
289 |
+
|
290 |
+
|
291 |
+
/**
|
292 |
+
* Creates the PDF and does a specific output (see PDF_Generator function above for $output variable types)
|
293 |
+
* var $dompdf Object
|
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 |
+
}
|
320 |
+
|
initialisation/configuration.php.example
CHANGED
@@ -1,396 +1,396 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* Gravity PDF Configuration
|
5 |
-
* Each option is explained in detail in this file but you can also find a more user-friendly option online:
|
6 |
-
* https://developer.gravitypdf.com/documentation/configuration-options-examples/
|
7 |
-
*/
|
8 |
-
|
9 |
-
/*
|
10 |
-
* Added in v3.1.0
|
11 |
-
* Users can now assign defaults to forms that aren't configured below.
|
12 |
-
* Note: this will only work if the configuration option GFPDF_SET_DEFAULT_TEMPLATE is set to true (located at the bottom of this file).
|
13 |
-
*
|
14 |
-
* Users can use any configuration option like you would for a singular form, including:
|
15 |
-
* notifications, template, filename, pdf_size, orientation, security and rtl
|
16 |
-
*/
|
17 |
-
global $gf_pdf_default_configuration;
|
18 |
-
|
19 |
-
$gf_pdf_default_configuration = array(
|
20 |
-
'template' => 'default-template.php',
|
21 |
-
'pdf_size' => 'A4'
|
22 |
-
);
|
23 |
-
|
24 |
-
/*
|
25 |
-
* ------------------------------------------------------------
|
26 |
-
* Bare minimum configuration code
|
27 |
-
* Usage: Will generate PDF and send to all notifications
|
28 |
-
* Remove the comments around the code blocks below to use (/*)
|
29 |
-
* form_id Mixed - Integer or Array. Required. The Gravity Form ID you are assigning the PDF to.
|
30 |
-
* notifications Mixed - String, Boolean or Array.
|
31 |
-
*/
|
32 |
-
/*$gf_pdf_config[] = array(
|
33 |
-
'form_id' => 1,
|
34 |
-
'notifications' => true,
|
35 |
-
);*/
|
36 |
-
|
37 |
-
/*
|
38 |
-
* ------------------------------------------------------------
|
39 |
-
* Default template specific configuration code
|
40 |
-
* These options only work on templates prepended with 'default-' in their name
|
41 |
-
*
|
42 |
-
* Usage:
|
43 |
-
* 'default-show-html' - This option will display HTMl blocks in your default tempalte.
|
44 |
-
* 'default-show-empty' - All form fields will be displayed in the PDF, regardless of what the user input is.
|
45 |
-
* 'default-show-page-names' - If you are using page breaks you can display the page names in the PDF.
|
46 |
-
* 'default-show-section-content' - By default only the section break title is displayed in the PDF. Enabling this option will also show the section break content.
|
47 |
-
*
|
48 |
-
* Remove the comments around the code blocks below to use (/*)
|
49 |
-
*/
|
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-section-content' => true,
|
73 |
-
);*/
|
74 |
-
|
75 |
-
/*$gf_pdf_config[] = array(
|
76 |
-
'form_id' => 1,
|
77 |
-
'template' => 'default-template.php',
|
78 |
-
'default-show-html' => true,
|
79 |
-
'default-show-empty' => true,
|
80 |
-
'default-show-page-names' => true,
|
81 |
-
'default-show-section-content' => true,
|
82 |
-
);*/
|
83 |
-
|
84 |
-
/*
|
85 |
-
* ------------------------------------------------------------
|
86 |
-
* Notification Options
|
87 |
-
* notifications Mixed - String, Boolean or Array.
|
88 |
-
* Notifications can be a string like 'Admin Notifications', an array with multiple notification names or true to send to all.
|
89 |
-
*/
|
90 |
-
/*$gf_pdf_config[] = array(
|
91 |
-
'form_id' => 1,
|
92 |
-
'notifications' => 'Admin Notification',
|
93 |
-
);*/
|
94 |
-
|
95 |
-
/*$gf_pdf_config[] = array(
|
96 |
-
'form_id' => '1',
|
97 |
-
'notifications' => array('Admin Notification', 'User Notification'),
|
98 |
-
);*/
|
99 |
-
|
100 |
-
/*
|
101 |
-
* ------------------------------------------------------------
|
102 |
-
* Custom Template
|
103 |
-
* Don't want to use a custom template? Just pass the custom template name to the configuration.
|
104 |
-
* template String. Default default-template.php. The name of your custom template that's placed in your active theme's PDF_EXTENDED_TEMPLATES folder.
|
105 |
-
* For more information about creating custom templates please see https://developer.gravitypdf.com/documentation/custom-templates-introduction/
|
106 |
-
*/
|
107 |
-
/*$gf_pdf_config[] = array(
|
108 |
-
'form_id' => 1,
|
109 |
-
'notifications' => 'User Notification',
|
110 |
-
'template' => 'example-float-and-positioning05.php',
|
111 |
-
);*/
|
112 |
-
|
113 |
-
/*$gf_pdf_config[] = array(
|
114 |
-
'form_id' => 2,
|
115 |
-
'notifications' => 'User Notification',
|
116 |
-
'template' => 'example-basic-html01.php',
|
117 |
-
);*/
|
118 |
-
|
119 |
-
/*
|
120 |
-
* ------------------------------------------------------------
|
121 |
-
* Custom File Name
|
122 |
-
* Will change the filename of the PDF which is attached
|
123 |
-
* As of v3.0.0 merge tags can be used in the file name
|
124 |
-
* filename String. Default form-{form_id}-entry-{entry_id}.pdf
|
125 |
-
*/
|
126 |
-
/*$gf_pdf_config[] = array(
|
127 |
-
'form_id' => 1,
|
128 |
-
'notifications' => true,
|
129 |
-
'filename' => 'New PDF Name.pdf',
|
130 |
-
);*/
|
131 |
-
|
132 |
-
/*$gf_pdf_config[] = array(
|
133 |
-
'form_id' => '1',
|
134 |
-
'notifications' => true,
|
135 |
-
'filename' => 'User {Name:1}.pdf',
|
136 |
-
);*/
|
137 |
-
|
138 |
-
/*
|
139 |
-
* ------------------------------------------------------------
|
140 |
-
* Custom PDF Size / Orientation
|
141 |
-
* PDF Size can be set to the following:
|
142 |
-
*
|
143 |
-
* A0 - A10, B0 - B10, C0 - C10
|
144 |
-
* 4A0, 2A0, RA0 - RA4, SRA0 - SRA4
|
145 |
-
* Letter, Legal, Executive, Folio
|
146 |
-
* Demy, Royal
|
147 |
-
*
|
148 |
-
* Default: A4
|
149 |
-
* You can also pass the PDF size as an array, represented in millimetres - array(width, height).
|
150 |
-
*
|
151 |
-
* NOTE: By default the orientation is portrait so you only need to add it for landscape PDFs
|
152 |
-
*/
|
153 |
-
|
154 |
-
/* Letter-sized Document */
|
155 |
-
/*$gf_pdf_config[] = array(
|
156 |
-
'form_id' => 1,
|
157 |
-
'notifications' => true,
|
158 |
-
|
159 |
-
'pdf_size' => 'letter',
|
160 |
-
);*/
|
161 |
-
|
162 |
-
/* Custom PDF Size */
|
163 |
-
/* $gf_pdf_config[] = array(
|
164 |
-
'form_id' => 1,
|
165 |
-
'notifications' => true,
|
166 |
-
|
167 |
-
'pdf_size' => array(50, 200),
|
168 |
-
);*/
|
169 |
-
|
170 |
-
/* Change orientation */
|
171 |
-
/* $gf_pdf_config[] = array(
|
172 |
-
'form_id' => 1,
|
173 |
-
'notifications' => true,
|
174 |
-
|
175 |
-
'pdf_size' => 'letter',
|
176 |
-
'orientation' => 'landscape',
|
177 |
-
);*/
|
178 |
-
|
179 |
-
/*
|
180 |
-
* ------------------------------------------------------------
|
181 |
-
* PDF Security
|
182 |
-
* Allows you to password protect your PDF document, place a master password on the document which prevents document tampering and restricts user behaviour.
|
183 |
-
*
|
184 |
-
* security Boolean. Default false. If true the security settings will be applied.
|
185 |
-
* pdf_password String. Default blank.
|
186 |
-
* pdf_privileges Array
|
187 |
-
* Assign user privileges to the document. Valid privileges include: copy, print, modify, annot-forms, fill-forms, extract, assemble, print-highres
|
188 |
-
* pdf_master_password String. Default random generated. Set a master password on the PDF which stops the PDF from being modified.
|
189 |
-
* NOTE: As the document is encrypted in 128-bit print will only allow users to print a low resolution copy.
|
190 |
-
* Use print-highres to print full resolution image.
|
191 |
-
* NOTE: The use of print will only allow low-resolution printing from the document; you must specify print-highres to allow full resolution printing.
|
192 |
-
* NOTE: If pdf_master_password is omitted a random one will be generated
|
193 |
-
* NOTE: Passing a blank array or not passing anything to pdf_privileges will deny all permissions to the user
|
194 |
-
*/
|
195 |
-
|
196 |
-
/*
|
197 |
-
* Setting security settings with all values
|
198 |
-
*/
|
199 |
-
/*$gf_pdf_config[] = array(
|
200 |
-
'form_id' => 1,
|
201 |
-
'notifications' => true,
|
202 |
-
|
203 |
-
'security' => true,
|
204 |
-
'pdf_password' => 'myPDFpass',
|
205 |
-
'pdf_privileges' => array('copy', 'print', 'modify', 'annot-forms', 'fill-forms', 'extract', 'assemble', 'print-highres'),
|
206 |
-
'pdf_master_password' => 'admin password',
|
207 |
-
);*/
|
208 |
-
|
209 |
-
/*
|
210 |
-
* Set password to PDF.
|
211 |
-
* Deny all permissions to user
|
212 |
-
* Random master password will be generated
|
213 |
-
*/
|
214 |
-
/*$gf_pdf_config[] = array(
|
215 |
-
'form_id' => 1,
|
216 |
-
'notifications' => true,
|
217 |
-
|
218 |
-
'security' => true,
|
219 |
-
'pdf_password' => 'myPDFpass',
|
220 |
-
);*/
|
221 |
-
|
222 |
-
/*
|
223 |
-
* No password required to open PDF document.
|
224 |
-
* Deny all permissions to user
|
225 |
-
* Master password set
|
226 |
-
*/
|
227 |
-
/*$gf_pdf_config[] = array(
|
228 |
-
'form_id' => 1,
|
229 |
-
'notifications' => true,
|
230 |
-
|
231 |
-
'security' => true,
|
232 |
-
'pdf_master_password' => 'admin password',
|
233 |
-
);*/
|
234 |
-
|
235 |
-
/*
|
236 |
-
* No password required to open PDF document.
|
237 |
-
* User can copy, print and modify PDF
|
238 |
-
* Random master password will be generated
|
239 |
-
*
|
240 |
-
*/
|
241 |
-
/*$gf_pdf_config[] = array(
|
242 |
-
'form_id' => 1,
|
243 |
-
'notifications' => true,
|
244 |
-
|
245 |
-
'security' => true,
|
246 |
-
'pdf_privileges' => array('copy', 'print', 'modify', 'print-highres'),
|
247 |
-
);*/
|
248 |
-
|
249 |
-
/*
|
250 |
-
* ------------------------------------------------------------
|
251 |
-
* Right to Left Language Support
|
252 |
-
* We now support RTL languages.
|
253 |
-
* rtl Boolean. Default false.
|
254 |
-
*/
|
255 |
-
/*$gf_pdf_config[] = array(
|
256 |
-
'form_id' => 1,
|
257 |
-
'notifications' => true,
|
258 |
-
|
259 |
-
'rtl' => true,
|
260 |
-
);*/
|
261 |
-
|
262 |
-
|
263 |
-
/*
|
264 |
-
* ------------------------------------------------------------
|
265 |
-
* Multiple Forms
|
266 |
-
* If you have multiple forms that use the same PDF template then you can pass the form_id through as an array.
|
267 |
-
* 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
|
268 |
-
* otherwise the custom template won't show correctly.
|
269 |
-
* WARNING: The previous warning also applies to custom PDF names with MERGETAGS
|
270 |
-
*/
|
271 |
-
/*$gf_pdf_config[] = array(
|
272 |
-
'form_id' => array(1,5,6),
|
273 |
-
'notifications' => true,
|
274 |
-
);*/
|
275 |
-
|
276 |
-
/*
|
277 |
-
* ------------------------------------------------------------
|
278 |
-
* Disable Notifications
|
279 |
-
* If you don't need to send notifications and just want a custom PDF generated
|
280 |
-
* via the admin area you can forgo the notifications class
|
281 |
-
*/
|
282 |
-
/*$gf_pdf_config[] = array(
|
283 |
-
'form_id' => 1,
|
284 |
-
'template' => 'example-template.php',
|
285 |
-
);*/
|
286 |
-
|
287 |
-
/*
|
288 |
-
* ------------------------------------------------------------
|
289 |
-
* Save PDF to disk
|
290 |
-
* Added in v3.4.0
|
291 |
-
*
|
292 |
-
* Use this option if you want to save the PDF to your server when an entry is submitted.
|
293 |
-
* This is useful if you aren’t sending PDF notifications (which need to save the PDFs so they can be attached to emails) and would still like the PDFs generated.
|
294 |
-
*/
|
295 |
-
/*$gf_pdf_config[] = array(
|
296 |
-
'form_id' => 1,
|
297 |
-
'template' => 'example-template.php',
|
298 |
-
'save' => true,
|
299 |
-
);*/
|
300 |
-
|
301 |
-
/*
|
302 |
-
* ------------------------------------------------------------
|
303 |
-
* Set the PDF DPI
|
304 |
-
* Added in v3.4.0
|
305 |
-
*
|
306 |
-
* For when you need to change the document's DPI. Usually set to 300 when used in professional printing.
|
307 |
-
* The default DPI used in the PDFs are 96.
|
308 |
-
* Use the 'dpi' option
|
309 |
-
*/
|
310 |
-
|
311 |
-
/*$gf_pdf_config[] = array(
|
312 |
-
'form_id' => 1,
|
313 |
-
'template' => 'example-template.php',
|
314 |
-
'dpi' => 300,
|
315 |
-
);*/
|
316 |
-
|
317 |
-
/*
|
318 |
-
* ------------------------------------------------------------
|
319 |
-
* Set PDF to PDF/A-1b format
|
320 |
-
* Added in v3.4.0
|
321 |
-
*
|
322 |
-
* PDF/A1-b is a file format for the long-term archiving of electronic documents.
|
323 |
-
* A key element to this reproducibility is the requirement for PDF/A documents to be 100% self-contained.
|
324 |
-
*
|
325 |
-
* 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.
|
326 |
-
*
|
327 |
-
* Usage:
|
328 |
-
* We've added the configuration options 'pdfa1b'.
|
329 |
-
*
|
330 |
-
* 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:
|
331 |
-
*
|
332 |
-
* 1. Watermarks - text or image - are not permitted (transparency is disallowed so will make text unreadable)
|
333 |
-
* 2. PNG images with alpha channel transparency ('masks' not allowed)
|
334 |
-
* 3. Encryption is enabled (the system will automatically remove any security settings)
|
335 |
-
*
|
336 |
-
* For more details about generating a PDF/X-1a document see http://mpdf1.com/manual/index.php?tid=420
|
337 |
-
*/
|
338 |
-
|
339 |
-
/*$gf_pdf_config[] = array(
|
340 |
-
'form_id' => 1,
|
341 |
-
'template' => 'example-template.php',
|
342 |
-
'pdfa1b' => true,
|
343 |
-
);*/
|
344 |
-
|
345 |
-
/*
|
346 |
-
* ------------------------------------------------------------
|
347 |
-
* Set PDF to PDF/X-1a format
|
348 |
-
* Added in v3.4.0
|
349 |
-
*
|
350 |
-
* PDF/X-1a is a file format to facilitate printing of electronic documents.
|
351 |
-
* 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.
|
352 |
-
*
|
353 |
-
* 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.
|
354 |
-
*
|
355 |
-
* Usage:
|
356 |
-
* We've added a new configuration options: 'pdfx1a' to turn documents into PDF/X-1a format.
|
357 |
-
*
|
358 |
-
* 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:
|
359 |
-
*
|
360 |
-
* 1. Watermarks - text or image - are not permitted (transparency is disallowed so will make text unreadable)
|
361 |
-
* 2. PNG images with alpha channel transparency ('masks' not allowed)
|
362 |
-
* 3. Encryption is enabled (the system will automatically remove any security settings)
|
363 |
-
*
|
364 |
-
* For more details about generating a PDF/X-1a document see http://mpdf1.com/manual/index.php?tid=481
|
365 |
-
*
|
366 |
-
*/
|
367 |
-
|
368 |
-
/*$gf_pdf_config[] = array(
|
369 |
-
'form_id' => 1,
|
370 |
-
'template' => 'example-template.php',
|
371 |
-
'pdfx1a' => true,
|
372 |
-
);*/
|
373 |
-
|
374 |
-
|
375 |
-
/* ---------------------------------------------------------------
|
376 |
-
* CUSTOM PDF SETUP BELOW.
|
377 |
-
* See https://developer.gravitypdf.com/documentation/configuration-options-examples/#constants for more details
|
378 |
-
*/
|
379 |
-
|
380 |
-
/*
|
381 |
-
* By default, forms that don't have PDFs assigned through the above configuration
|
382 |
-
* will automatically use the settings applied in the $gf_pdf_default_configuration node.
|
383 |
-
* Set to false to disable this feature.
|
384 |
-
*/
|
385 |
-
define('GFPDF_SET_DEFAULT_TEMPLATE', true);
|
386 |
-
|
387 |
-
/*
|
388 |
-
* MEMORY ISSUES?
|
389 |
-
* Try setting the options below to true to help reduce the memory footprint of the package.
|
390 |
-
*/
|
391 |
-
define('PDF_ENABLE_MPDF_LITE', false); /* strip out advanced features like advanced table borders, terms and conditions, index, bookmarks and barcodes. */
|
392 |
-
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 */
|
393 |
-
define('PDF_DISABLE_FONT_SUBSTITUTION', false); /* reduced memory by stopping font substitution */
|
394 |
-
define('PDF_ENABLE_SIMPLE_TABLES', false); /* disable the advanced table feature and forces all cells to have the same border, background etc. */
|
395 |
-
|
396 |
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 PDF Configuration
|
5 |
+
* Each option is explained in detail in this file but you can also find a more user-friendly option online:
|
6 |
+
* https://developer.gravitypdf.com/documentation/configuration-options-examples/
|
7 |
+
*/
|
8 |
+
|
9 |
+
/*
|
10 |
+
* Added in v3.1.0
|
11 |
+
* Users can now assign defaults to forms that aren't configured below.
|
12 |
+
* Note: this will only work if the configuration option GFPDF_SET_DEFAULT_TEMPLATE is set to true (located at the bottom of this file).
|
13 |
+
*
|
14 |
+
* Users can use any configuration option like you would for a singular form, including:
|
15 |
+
* notifications, template, filename, pdf_size, orientation, security and rtl
|
16 |
+
*/
|
17 |
+
global $gf_pdf_default_configuration;
|
18 |
+
|
19 |
+
$gf_pdf_default_configuration = array(
|
20 |
+
'template' => 'default-template.php',
|
21 |
+
'pdf_size' => 'A4'
|
22 |
+
);
|
23 |
+
|
24 |
+
/*
|
25 |
+
* ------------------------------------------------------------
|
26 |
+
* Bare minimum configuration code
|
27 |
+
* Usage: Will generate PDF and send to all notifications
|
28 |
+
* Remove the comments around the code blocks below to use (/*)
|
29 |
+
* form_id Mixed - Integer or Array. Required. The Gravity Form ID you are assigning the PDF to.
|
30 |
+
* notifications Mixed - String, Boolean or Array.
|
31 |
+
*/
|
32 |
+
/*$gf_pdf_config[] = array(
|
33 |
+
'form_id' => 1,
|
34 |
+
'notifications' => true,
|
35 |
+
);*/
|
36 |
+
|
37 |
+
/*
|
38 |
+
* ------------------------------------------------------------
|
39 |
+
* Default template specific configuration code
|
40 |
+
* These options only work on templates prepended with 'default-' in their name
|
41 |
+
*
|
42 |
+
* Usage:
|
43 |
+
* 'default-show-html' - This option will display HTMl blocks in your default tempalte.
|
44 |
+
* 'default-show-empty' - All form fields will be displayed in the PDF, regardless of what the user input is.
|
45 |
+
* 'default-show-page-names' - If you are using page breaks you can display the page names in the PDF.
|
46 |
+
* 'default-show-section-content' - By default only the section break title is displayed in the PDF. Enabling this option will also show the section break content.
|
47 |
+
*
|
48 |
+
* Remove the comments around the code blocks below to use (/*)
|
49 |
+
*/
|
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-section-content' => true,
|
73 |
+
);*/
|
74 |
+
|
75 |
+
/*$gf_pdf_config[] = array(
|
76 |
+
'form_id' => 1,
|
77 |
+
'template' => 'default-template.php',
|
78 |
+
'default-show-html' => true,
|
79 |
+
'default-show-empty' => true,
|
80 |
+
'default-show-page-names' => true,
|
81 |
+
'default-show-section-content' => true,
|
82 |
+
);*/
|
83 |
+
|
84 |
+
/*
|
85 |
+
* ------------------------------------------------------------
|
86 |
+
* Notification Options
|
87 |
+
* notifications Mixed - String, Boolean or Array.
|
88 |
+
* Notifications can be a string like 'Admin Notifications', an array with multiple notification names or true to send to all.
|
89 |
+
*/
|
90 |
+
/*$gf_pdf_config[] = array(
|
91 |
+
'form_id' => 1,
|
92 |
+
'notifications' => 'Admin Notification',
|
93 |
+
);*/
|
94 |
+
|
95 |
+
/*$gf_pdf_config[] = array(
|
96 |
+
'form_id' => '1',
|
97 |
+
'notifications' => array('Admin Notification', 'User Notification'),
|
98 |
+
);*/
|
99 |
+
|
100 |
+
/*
|
101 |
+
* ------------------------------------------------------------
|
102 |
+
* Custom Template
|
103 |
+
* Don't want to use a custom template? Just pass the custom template name to the configuration.
|
104 |
+
* template String. Default default-template.php. The name of your custom template that's placed in your active theme's PDF_EXTENDED_TEMPLATES folder.
|
105 |
+
* For more information about creating custom templates please see https://developer.gravitypdf.com/documentation/custom-templates-introduction/
|
106 |
+
*/
|
107 |
+
/*$gf_pdf_config[] = array(
|
108 |
+
'form_id' => 1,
|
109 |
+
'notifications' => 'User Notification',
|
110 |
+
'template' => 'example-float-and-positioning05.php',
|
111 |
+
);*/
|
112 |
+
|
113 |
+
/*$gf_pdf_config[] = array(
|
114 |
+
'form_id' => 2,
|
115 |
+
'notifications' => 'User Notification',
|
116 |
+
'template' => 'example-basic-html01.php',
|
117 |
+
);*/
|
118 |
+
|
119 |
+
/*
|
120 |
+
* ------------------------------------------------------------
|
121 |
+
* Custom File Name
|
122 |
+
* Will change the filename of the PDF which is attached
|
123 |
+
* As of v3.0.0 merge tags can be used in the file name
|
124 |
+
* filename String. Default form-{form_id}-entry-{entry_id}.pdf
|
125 |
+
*/
|
126 |
+
/*$gf_pdf_config[] = array(
|
127 |
+
'form_id' => 1,
|
128 |
+
'notifications' => true,
|
129 |
+
'filename' => 'New PDF Name.pdf',
|
130 |
+
);*/
|
131 |
+
|
132 |
+
/*$gf_pdf_config[] = array(
|
133 |
+
'form_id' => '1',
|
134 |
+
'notifications' => true,
|
135 |
+
'filename' => 'User {Name:1}.pdf',
|
136 |
+
);*/
|
137 |
+
|
138 |
+
/*
|
139 |
+
* ------------------------------------------------------------
|
140 |
+
* Custom PDF Size / Orientation
|
141 |
+
* PDF Size can be set to the following:
|
142 |
+
*
|
143 |
+
* A0 - A10, B0 - B10, C0 - C10
|
144 |
+
* 4A0, 2A0, RA0 - RA4, SRA0 - SRA4
|
145 |
+
* Letter, Legal, Executive, Folio
|
146 |
+
* Demy, Royal
|
147 |
+
*
|
148 |
+
* Default: A4
|
149 |
+
* You can also pass the PDF size as an array, represented in millimetres - array(width, height).
|
150 |
+
*
|
151 |
+
* NOTE: By default the orientation is portrait so you only need to add it for landscape PDFs
|
152 |
+
*/
|
153 |
+
|
154 |
+
/* Letter-sized Document */
|
155 |
+
/*$gf_pdf_config[] = array(
|
156 |
+
'form_id' => 1,
|
157 |
+
'notifications' => true,
|
158 |
+
|
159 |
+
'pdf_size' => 'letter',
|
160 |
+
);*/
|
161 |
+
|
162 |
+
/* Custom PDF Size */
|
163 |
+
/* $gf_pdf_config[] = array(
|
164 |
+
'form_id' => 1,
|
165 |
+
'notifications' => true,
|
166 |
+
|
167 |
+
'pdf_size' => array(50, 200),
|
168 |
+
);*/
|
169 |
+
|
170 |
+
/* Change orientation */
|
171 |
+
/* $gf_pdf_config[] = array(
|
172 |
+
'form_id' => 1,
|
173 |
+
'notifications' => true,
|
174 |
+
|
175 |
+
'pdf_size' => 'letter',
|
176 |
+
'orientation' => 'landscape',
|
177 |
+
);*/
|
178 |
+
|
179 |
+
/*
|
180 |
+
* ------------------------------------------------------------
|
181 |
+
* PDF Security
|
182 |
+
* Allows you to password protect your PDF document, place a master password on the document which prevents document tampering and restricts user behaviour.
|
183 |
+
*
|
184 |
+
* security Boolean. Default false. If true the security settings will be applied.
|
185 |
+
* pdf_password String. Default blank.
|
186 |
+
* pdf_privileges Array
|
187 |
+
* Assign user privileges to the document. Valid privileges include: copy, print, modify, annot-forms, fill-forms, extract, assemble, print-highres
|
188 |
+
* pdf_master_password String. Default random generated. Set a master password on the PDF which stops the PDF from being modified.
|
189 |
+
* NOTE: As the document is encrypted in 128-bit print will only allow users to print a low resolution copy.
|
190 |
+
* Use print-highres to print full resolution image.
|
191 |
+
* NOTE: The use of print will only allow low-resolution printing from the document; you must specify print-highres to allow full resolution printing.
|
192 |
+
* NOTE: If pdf_master_password is omitted a random one will be generated
|
193 |
+
* NOTE: Passing a blank array or not passing anything to pdf_privileges will deny all permissions to the user
|
194 |
+
*/
|
195 |
+
|
196 |
+
/*
|
197 |
+
* Setting security settings with all values
|
198 |
+
*/
|
199 |
+
/*$gf_pdf_config[] = array(
|
200 |
+
'form_id' => 1,
|
201 |
+
'notifications' => true,
|
202 |
+
|
203 |
+
'security' => true,
|
204 |
+
'pdf_password' => 'myPDFpass',
|
205 |
+
'pdf_privileges' => array('copy', 'print', 'modify', 'annot-forms', 'fill-forms', 'extract', 'assemble', 'print-highres'),
|
206 |
+
'pdf_master_password' => 'admin password',
|
207 |
+
);*/
|
208 |
+
|
209 |
+
/*
|
210 |
+
* Set password to PDF.
|
211 |
+
* Deny all permissions to user
|
212 |
+
* Random master password will be generated
|
213 |
+
*/
|
214 |
+
/*$gf_pdf_config[] = array(
|
215 |
+
'form_id' => 1,
|
216 |
+
'notifications' => true,
|
217 |
+
|
218 |
+
'security' => true,
|
219 |
+
'pdf_password' => 'myPDFpass',
|
220 |
+
);*/
|
221 |
+
|
222 |
+
/*
|
223 |
+
* No password required to open PDF document.
|
224 |
+
* Deny all permissions to user
|
225 |
+
* Master password set
|
226 |
+
*/
|
227 |
+
/*$gf_pdf_config[] = array(
|
228 |
+
'form_id' => 1,
|
229 |
+
'notifications' => true,
|
230 |
+
|
231 |
+
'security' => true,
|
232 |
+
'pdf_master_password' => 'admin password',
|
233 |
+
);*/
|
234 |
+
|
235 |
+
/*
|
236 |
+
* No password required to open PDF document.
|
237 |
+
* User can copy, print and modify PDF
|
238 |
+
* Random master password will be generated
|
239 |
+
*
|
240 |
+
*/
|
241 |
+
/*$gf_pdf_config[] = array(
|
242 |
+
'form_id' => 1,
|
243 |
+
'notifications' => true,
|
244 |
+
|
245 |
+
'security' => true,
|
246 |
+
'pdf_privileges' => array('copy', 'print', 'modify', 'print-highres'),
|
247 |
+
);*/
|
248 |
+
|
249 |
+
/*
|
250 |
+
* ------------------------------------------------------------
|
251 |
+
* Right to Left Language Support
|
252 |
+
* We now support RTL languages.
|
253 |
+
* rtl Boolean. Default false.
|
254 |
+
*/
|
255 |
+
/*$gf_pdf_config[] = array(
|
256 |
+
'form_id' => 1,
|
257 |
+
'notifications' => true,
|
258 |
+
|
259 |
+
'rtl' => true,
|
260 |
+
);*/
|
261 |
+
|
262 |
+
|
263 |
+
/*
|
264 |
+
* ------------------------------------------------------------
|
265 |
+
* Multiple Forms
|
266 |
+
* If you have multiple forms that use the same PDF template then you can pass the form_id through as an array.
|
267 |
+
* 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
|
268 |
+
* otherwise the custom template won't show correctly.
|
269 |
+
* WARNING: The previous warning also applies to custom PDF names with MERGETAGS
|
270 |
+
*/
|
271 |
+
/*$gf_pdf_config[] = array(
|
272 |
+
'form_id' => array(1,5,6),
|
273 |
+
'notifications' => true,
|
274 |
+
);*/
|
275 |
+
|
276 |
+
/*
|
277 |
+
* ------------------------------------------------------------
|
278 |
+
* Disable Notifications
|
279 |
+
* If you don't need to send notifications and just want a custom PDF generated
|
280 |
+
* via the admin area you can forgo the notifications class
|
281 |
+
*/
|
282 |
+
/*$gf_pdf_config[] = array(
|
283 |
+
'form_id' => 1,
|
284 |
+
'template' => 'example-template.php',
|
285 |
+
);*/
|
286 |
+
|
287 |
+
/*
|
288 |
+
* ------------------------------------------------------------
|
289 |
+
* Save PDF to disk
|
290 |
+
* Added in v3.4.0
|
291 |
+
*
|
292 |
+
* Use this option if you want to save the PDF to your server when an entry is submitted.
|
293 |
+
* This is useful if you aren’t sending PDF notifications (which need to save the PDFs so they can be attached to emails) and would still like the PDFs generated.
|
294 |
+
*/
|
295 |
+
/*$gf_pdf_config[] = array(
|
296 |
+
'form_id' => 1,
|
297 |
+
'template' => 'example-template.php',
|
298 |
+
'save' => true,
|
299 |
+
);*/
|
300 |
+
|
301 |
+
/*
|
302 |
+
* ------------------------------------------------------------
|
303 |
+
* Set the PDF DPI
|
304 |
+
* Added in v3.4.0
|
305 |
+
*
|
306 |
+
* For when you need to change the document's DPI. Usually set to 300 when used in professional printing.
|
307 |
+
* The default DPI used in the PDFs are 96.
|
308 |
+
* Use the 'dpi' option
|
309 |
+
*/
|
310 |
+
|
311 |
+
/*$gf_pdf_config[] = array(
|
312 |
+
'form_id' => 1,
|
313 |
+
'template' => 'example-template.php',
|
314 |
+
'dpi' => 300,
|
315 |
+
);*/
|
316 |
+
|
317 |
+
/*
|
318 |
+
* ------------------------------------------------------------
|
319 |
+
* Set PDF to PDF/A-1b format
|
320 |
+
* Added in v3.4.0
|
321 |
+
*
|
322 |
+
* PDF/A1-b is a file format for the long-term archiving of electronic documents.
|
323 |
+
* A key element to this reproducibility is the requirement for PDF/A documents to be 100% self-contained.
|
324 |
+
*
|
325 |
+
* 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.
|
326 |
+
*
|
327 |
+
* Usage:
|
328 |
+
* We've added the configuration options 'pdfa1b'.
|
329 |
+
*
|
330 |
+
* 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:
|
331 |
+
*
|
332 |
+
* 1. Watermarks - text or image - are not permitted (transparency is disallowed so will make text unreadable)
|
333 |
+
* 2. PNG images with alpha channel transparency ('masks' not allowed)
|
334 |
+
* 3. Encryption is enabled (the system will automatically remove any security settings)
|
335 |
+
*
|
336 |
+
* For more details about generating a PDF/X-1a document see http://mpdf1.com/manual/index.php?tid=420
|
337 |
+
*/
|
338 |
+
|
339 |
+
/*$gf_pdf_config[] = array(
|
340 |
+
'form_id' => 1,
|
341 |
+
'template' => 'example-template.php',
|
342 |
+
'pdfa1b' => true,
|
343 |
+
);*/
|
344 |
+
|
345 |
+
/*
|
346 |
+
* ------------------------------------------------------------
|
347 |
+
* Set PDF to PDF/X-1a format
|
348 |
+
* Added in v3.4.0
|
349 |
+
*
|
350 |
+
* PDF/X-1a is a file format to facilitate printing of electronic documents.
|
351 |
+
* 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.
|
352 |
+
*
|
353 |
+
* 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.
|
354 |
+
*
|
355 |
+
* Usage:
|
356 |
+
* We've added a new configuration options: 'pdfx1a' to turn documents into PDF/X-1a format.
|
357 |
+
*
|
358 |
+
* 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:
|
359 |
+
*
|
360 |
+
* 1. Watermarks - text or image - are not permitted (transparency is disallowed so will make text unreadable)
|
361 |
+
* 2. PNG images with alpha channel transparency ('masks' not allowed)
|
362 |
+
* 3. Encryption is enabled (the system will automatically remove any security settings)
|
363 |
+
*
|
364 |
+
* For more details about generating a PDF/X-1a document see http://mpdf1.com/manual/index.php?tid=481
|
365 |
+
*
|
366 |
+
*/
|
367 |
+
|
368 |
+
/*$gf_pdf_config[] = array(
|
369 |
+
'form_id' => 1,
|
370 |
+
'template' => 'example-template.php',
|
371 |
+
'pdfx1a' => true,
|
372 |
+
);*/
|
373 |
+
|
374 |
+
|
375 |
+
/* ---------------------------------------------------------------
|
376 |
+
* CUSTOM PDF SETUP BELOW.
|
377 |
+
* See https://developer.gravitypdf.com/documentation/configuration-options-examples/#constants for more details
|
378 |
+
*/
|
379 |
+
|
380 |
+
/*
|
381 |
+
* By default, forms that don't have PDFs assigned through the above configuration
|
382 |
+
* will automatically use the settings applied in the $gf_pdf_default_configuration node.
|
383 |
+
* Set to false to disable this feature.
|
384 |
+
*/
|
385 |
+
define('GFPDF_SET_DEFAULT_TEMPLATE', true);
|
386 |
+
|
387 |
+
/*
|
388 |
+
* MEMORY ISSUES?
|
389 |
+
* Try setting the options below to true to help reduce the memory footprint of the package.
|
390 |
+
*/
|
391 |
+
define('PDF_ENABLE_MPDF_LITE', false); /* strip out advanced features like advanced table borders, terms and conditions, index, bookmarks and barcodes. */
|
392 |
+
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 */
|
393 |
+
define('PDF_DISABLE_FONT_SUBSTITUTION', false); /* reduced memory by stopping font substitution */
|
394 |
+
define('PDF_ENABLE_SIMPLE_TABLES', false); /* disable the advanced table feature and forces all cells to have the same border, background etc. */
|
395 |
+
|
396 |
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) */
|
initialisation/template.css
CHANGED
@@ -1,132 +1,132 @@
|
|
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, .entry-view-section-break-content {
|
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, .no-style .entry-view-section-break-content {
|
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 */
|
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, .entry-view-section-break-content {
|
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, .no-style .entry-view-section-break-content {
|
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,47 @@
|
|
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::do_lead_detail_grid($form, $lead, $config_data);
|
43 |
-
}
|
44 |
-
?>
|
45 |
-
</div>
|
46 |
-
</body>
|
47 |
</html>
|
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::do_lead_detail_grid($form, $lead, $config_data);
|
43 |
+
}
|
44 |
+
?>
|
45 |
+
</div>
|
46 |
+
</body>
|
47 |
</html>
|
initialisation/templates/default-template-two-rows.php
CHANGED
@@ -1,47 +1,47 @@
|
|
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::do_lead_detail_grid($form, $lead, $config_data);
|
43 |
-
}
|
44 |
-
?>
|
45 |
-
</div>
|
46 |
-
</body>
|
47 |
</html>
|
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::do_lead_detail_grid($form, $lead, $config_data);
|
43 |
+
}
|
44 |
+
?>
|
45 |
+
</div>
|
46 |
+
</body>
|
47 |
</html>
|
initialisation/templates/default-template.php
CHANGED
@@ -1,45 +1,45 @@
|
|
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::do_lead_detail_grid($form, $lead, $config_data);
|
42 |
-
}
|
43 |
-
?>
|
44 |
-
</body>
|
45 |
</html>
|
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::do_lead_detail_grid($form, $lead, $config_data);
|
42 |
+
}
|
43 |
+
?>
|
44 |
+
</body>
|
45 |
</html>
|
initialisation/templates/example-advanced-headers_07.php
CHANGED
@@ -1,110 +1,110 @@
|
|
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 |
+
* 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>
|
initialisation/templates/example-backgrounds-and-borders02.php
CHANGED
@@ -1,164 +1,164 @@
|
|
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 |
-
background: linear-gradient(bottom, #0b91c2, #FFFFFF 65%);
|
35 |
-
}
|
36 |
-
.gradient {
|
37 |
-
border:0.1mm solid #220044;
|
38 |
-
background: #f0f2ff linear-gradient(top, #e1e1e1 65%, #c7c7c7);
|
39 |
-
}
|
40 |
-
.radialgradient {
|
41 |
-
border:0.1mm solid #220044;
|
42 |
-
background: #f0f2ff radial-gradient(center circle, #00FFFF, #FFFF00)
|
43 |
-
margin: auto;
|
44 |
-
}
|
45 |
-
.rounded {
|
46 |
-
border:0.1mm solid #220044;
|
47 |
-
background: #f0f2ff linear-gradient(top, #c7cdde 65%, #f0f2ff);
|
48 |
-
border-radius: 2mm;
|
49 |
-
background-clip: border-box;
|
50 |
-
}
|
51 |
-
h4 {
|
52 |
-
font-family: sans;
|
53 |
-
font-weight: bold;
|
54 |
-
margin-top: 1em;
|
55 |
-
margin-bottom: 0.5em;
|
56 |
-
}
|
57 |
-
div {
|
58 |
-
padding:1em;
|
59 |
-
margin-bottom: 1em;
|
60 |
-
text-align:left;
|
61 |
-
}
|
62 |
-
.example pre {
|
63 |
-
background-color: #d5d5d5;
|
64 |
-
margin: 1em 1cm;
|
65 |
-
padding: 0 0.3cm;
|
66 |
-
}
|
67 |
-
|
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 <body> 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 <div> 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 <div> 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 <div> 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 |
+
* 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 |
+
background: linear-gradient(bottom, #0b91c2, #FFFFFF 65%);
|
35 |
+
}
|
36 |
+
.gradient {
|
37 |
+
border:0.1mm solid #220044;
|
38 |
+
background: #f0f2ff linear-gradient(top, #e1e1e1 65%, #c7c7c7);
|
39 |
+
}
|
40 |
+
.radialgradient {
|
41 |
+
border:0.1mm solid #220044;
|
42 |
+
background: #f0f2ff radial-gradient(center circle, #00FFFF, #FFFF00)
|
43 |
+
margin: auto;
|
44 |
+
}
|
45 |
+
.rounded {
|
46 |
+
border:0.1mm solid #220044;
|
47 |
+
background: #f0f2ff linear-gradient(top, #c7cdde 65%, #f0f2ff);
|
48 |
+
border-radius: 2mm;
|
49 |
+
background-clip: border-box;
|
50 |
+
}
|
51 |
+
h4 {
|
52 |
+
font-family: sans;
|
53 |
+
font-weight: bold;
|
54 |
+
margin-top: 1em;
|
55 |
+
margin-bottom: 0.5em;
|
56 |
+
}
|
57 |
+
div {
|
58 |
+
padding:1em;
|
59 |
+
margin-bottom: 1em;
|
60 |
+
text-align:left;
|
61 |
+
}
|
62 |
+
.example pre {
|
63 |
+
background-color: #d5d5d5;
|
64 |
+
margin: 1em 1cm;
|
65 |
+
padding: 0 0.3cm;
|
66 |
+
}
|
67 |
+
|
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 <body> 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 <div> 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 <div> 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 <div> 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>
|
initialisation/templates/example-basic-html01.php
CHANGED
@@ -1,157 +1,157 @@
|
|
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 (<a>)</a></div>
|
78 |
-
<div><a href="https://gravitypdf.com">Hyperlink (<a>)</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 |
-
|
155 |
-
?>
|
156 |
-
</body>
|
157 |
</html>
|
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 (<a>)</a></div>
|
78 |
+
<div><a href="https://gravitypdf.com">Hyperlink (<a>)</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 |
+
|
155 |
+
?>
|
156 |
+
</body>
|
157 |
</html>
|
initialisation/templates/example-different-page-size_08.php
CHANGED
@@ -1,82 +1,82 @@
|
|
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 |
+
* 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>
|
initialisation/templates/example-float-and-positioning05.php
CHANGED
@@ -1,157 +1,157 @@
|
|
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 & 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 <div> 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 <div> 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 <div> 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 |
+
* 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 & 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 <div> 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 <div> 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 <div> 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>
|
initialisation/templates/example-header-and-footer_06.php
CHANGED
@@ -1,109 +1,109 @@
|
|
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 |
+
* 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>
|
initialisation/templates/example-images03.php
CHANGED
@@ -1,240 +1,240 @@
|
|
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" />
|
226 |
-
<img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger2.wmf" rotate="90" width="80" />
|
227 |
-
<img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger2.wmf" rotate="180" width="80" />
|
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" />
|
232 |
-
<img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.svg" rotate="90" width="85" />
|
233 |
-
<img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.svg" rotate="180" width="100" />
|
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 |
+
* 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" />
|
226 |
+
<img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger2.wmf" rotate="90" width="80" />
|
227 |
+
<img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger2.wmf" rotate="180" width="80" />
|
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" />
|
232 |
+
<img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.svg" rotate="90" width="85" />
|
233 |
+
<img src="<?php echo PDF_PLUGIN_DIR; ?>resources/images/tiger.svg" rotate="180" width="100" />
|
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>
|
initialisation/templates/example-tables04.php
CHANGED
@@ -1,1732 +1,1732 @@
|
|
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 <td> 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 <td> 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 <thead> 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 <td> 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> </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><th> 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> </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 <td> 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> </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><th> 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> </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> </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> </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> </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 <table autosize="1.8">.</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> </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> </p>
|
1727 |
-
|
1728 |
-
|
1729 |
-
|
1730 |
-
<?php } ?>
|
1731 |
-
</body>
|
1732 |
</html>
|
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 <td> 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 <td> 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 <thead> 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 <td> 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> </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><th> 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> </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 <td> 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> </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><th> 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> </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> </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> </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> </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 <table autosize="1.8">.</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> </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> </p>
|
1727 |
+
|
1728 |
+
|
1729 |
+
|
1730 |
+
<?php } ?>
|
1731 |
+
</body>
|
1732 |
</html>
|
initialisation/templates/example-template.php
CHANGED
@@ -1,95 +1,95 @@
|
|
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 |
-
<!-- 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 &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&fid=2&lid=6&template=new-example-template.php&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 |
+
* 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 |
+
<!-- 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 &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&fid=2&lid=6&template=new-example-template.php&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>
|
initialisation/templates/example-watermark09.php
CHANGED
@@ -1,136 +1,136 @@
|
|
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: < = < > = > & = & ' = ' or " = "
|
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>
|
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: < = < > = > & = & ' = ' or " = "
|
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
CHANGED
@@ -1,856 +1,856 @@
|
|
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 ""
|
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.po
CHANGED
@@ -1,1024 +1,1024 @@
|
|
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 ?"
|
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/CHANGELOG.txt
CHANGED
@@ -1,25 +1,25 @@
|
|
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
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.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
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 |
+
-----------------------------
|
mPDF/CREDITS.txt
CHANGED
@@ -1,92 +1,92 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
/*******************************************************************************
|
4 |
-
* Software: FPDF *
|
5 |
-
* Version: 1.53 *
|
6 |
-
* Date: 2004-12-31 *
|
7 |
-
* Author: Olivier PLATHEY *
|
8 |
-
* License: Freeware *
|
9 |
-
* *
|
10 |
-
* You may use and modify this software as you wish. *
|
11 |
-
*******************************************************************************/
|
12 |
-
|
13 |
-
/*******************************************************************************
|
14 |
-
* HTML2FPDF is a php script to read a HTML text and generate a PDF file. *
|
15 |
-
* Copyright (C) 2004-2005 Renato Coelho *
|
16 |
-
* *
|
17 |
-
* html2fpdf.php, htmltoolkit.php *
|
18 |
-
*******************************************************************************/
|
19 |
-
|
20 |
-
CREDITS From HTML2FPDF:
|
21 |
-
|
22 |
-
-Olivier Plathey for the fpdf.php class [http://www.fpdf.org]
|
23 |
-
-Damon Kohler for the Flowing Block script [mailto:damonkohler@yahoo.com]
|
24 |
-
-Cl�ment Lavoillotte for HTML-oriented FPDF idea
|
25 |
-
-Yamasoft for the gif.php class [http://www.yamasoft.com/]
|
26 |
-
-J�r�me Fenal for the _parsegif() function
|
27 |
-
-"VIETCOM" for the PDFTable code [http://www.freepgs.com/vietcom/tool/pdftable/] [mailto:vncommando@yahoo.com]
|
28 |
-
-Yukihiro O. for the SetDash() function [mailto:yukihiro_o@infoseek.jp]
|
29 |
-
-Ron Korving for the WordWrap() function
|
30 |
-
-Michel Poulain for the DisplayPreferences() function
|
31 |
-
-Patrick Benny for the MultiCellBlt() function idea [no longer in use]
|
32 |
-
-Seb for the _SetTextRendering() and SetTextOutline() functions [mailto:captainseb@wanadoo.fr]
|
33 |
-
-MorphSoft for the colornames list idea
|
34 |
-
-W3SCHOOLS for HTML-related reference info [http://www.w3schools.com/]
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
/****************************************************************************
|
39 |
-
* Software: FPDF_Protection *
|
40 |
-
* Version: 1.02 *
|
41 |
-
* Date: 2005/05/08 *
|
42 |
-
* Author: Klemen VODOPIVEC *
|
43 |
-
* License: Freeware *
|
44 |
-
* *
|
45 |
-
* You may use and modify this software as you wish as stated in original *
|
46 |
-
* FPDF package. *
|
47 |
-
****************************************************************************/
|
48 |
-
|
49 |
-
/****************************************************************************
|
50 |
-
// FPDI - Version 1.2
|
51 |
-
//
|
52 |
-
// Copyright 2004-2007 Setasign - Jan Slabon
|
53 |
-
//
|
54 |
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
55 |
-
// you may not use this file except in compliance with the License.
|
56 |
-
// You may obtain a copy of the License at
|
57 |
-
//
|
58 |
-
// http://www.apache.org/licenses/LICENSE-2.0
|
59 |
-
//
|
60 |
-
// Unless required by applicable law or agreed to in writing, software
|
61 |
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
62 |
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
63 |
-
// See the License for the specific language governing permissions and
|
64 |
-
// limitations under the License.
|
65 |
-
****************************************************************************/
|
66 |
-
|
67 |
-
/****************************************************************************
|
68 |
-
* @copyright Khaled Al-Shamaa 2008
|
69 |
-
* @link http://www.ar-php.org
|
70 |
-
* @author Khaled Al-Shamaa <khaled@ar-php.org>
|
71 |
-
* @desc Set of PHP5 / UTF-8 Classes developed to enhance Arabic web
|
72 |
-
* applications by providing set of tools includes stem-based searching,
|
73 |
-
* translitiration, soundex, Hijri calendar, charset detection and
|
74 |
-
* converter, spell numbers, keyboard language, Muslim prayer time,
|
75 |
-
* auto-summarization, and more...
|
76 |
-
* @package Arabic
|
77 |
-
*
|
78 |
-
* @version 1.8 released in Feb 15, 2009
|
79 |
-
*
|
80 |
-
* @license LGPL
|
81 |
-
****************************************************************************/
|
82 |
-
|
83 |
-
|
84 |
-
This library is free software; you can redistribute it and/or
|
85 |
-
modify it under the terms of the GNU Lesser General Public
|
86 |
-
License as published by the Free Software Foundation;
|
87 |
-
This library is distributed in the hope that it will be useful,
|
88 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
89 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
90 |
-
Lesser General Public License for more details.
|
91 |
-
[http://www.opensource.org/licenses/lgpl-license.php]
|
92 |
-
|
1 |
+
|
2 |
+
|
3 |
+
/*******************************************************************************
|
4 |
+
* Software: FPDF *
|
5 |
+
* Version: 1.53 *
|
6 |
+
* Date: 2004-12-31 *
|
7 |
+
* Author: Olivier PLATHEY *
|
8 |
+
* License: Freeware *
|
9 |
+
* *
|
10 |
+
* You may use and modify this software as you wish. *
|
11 |
+
*******************************************************************************/
|
12 |
+
|
13 |
+
/*******************************************************************************
|
14 |
+
* HTML2FPDF is a php script to read a HTML text and generate a PDF file. *
|
15 |
+
* Copyright (C) 2004-2005 Renato Coelho *
|
16 |
+
* *
|
17 |
+
* html2fpdf.php, htmltoolkit.php *
|
18 |
+
*******************************************************************************/
|
19 |
+
|
20 |
+
CREDITS From HTML2FPDF:
|
21 |
+
|
22 |
+
-Olivier Plathey for the fpdf.php class [http://www.fpdf.org]
|
23 |
+
-Damon Kohler for the Flowing Block script [mailto:damonkohler@yahoo.com]
|
24 |
+
-Cl�ment Lavoillotte for HTML-oriented FPDF idea
|
25 |
+
-Yamasoft for the gif.php class [http://www.yamasoft.com/]
|
26 |
+
-J�r�me Fenal for the _parsegif() function
|
27 |
+
-"VIETCOM" for the PDFTable code [http://www.freepgs.com/vietcom/tool/pdftable/] [mailto:vncommando@yahoo.com]
|
28 |
+
-Yukihiro O. for the SetDash() function [mailto:yukihiro_o@infoseek.jp]
|
29 |
+
-Ron Korving for the WordWrap() function
|
30 |
+
-Michel Poulain for the DisplayPreferences() function
|
31 |
+
-Patrick Benny for the MultiCellBlt() function idea [no longer in use]
|
32 |
+
-Seb for the _SetTextRendering() and SetTextOutline() functions [mailto:captainseb@wanadoo.fr]
|
33 |
+
-MorphSoft for the colornames list idea
|
34 |
+
-W3SCHOOLS for HTML-related reference info [http://www.w3schools.com/]
|
35 |
+
|
36 |
+
|
37 |
+
|
38 |
+
/****************************************************************************
|
39 |
+
* Software: FPDF_Protection *
|
40 |
+
* Version: 1.02 *
|
41 |
+
* Date: 2005/05/08 *
|
42 |
+
* Author: Klemen VODOPIVEC *
|
43 |
+
* License: Freeware *
|
44 |
+
* *
|
45 |
+
* You may use and modify this software as you wish as stated in original *
|
46 |
+
* FPDF package. *
|
47 |
+
****************************************************************************/
|
48 |
+
|
49 |
+
/****************************************************************************
|
50 |
+
// FPDI - Version 1.2
|
51 |
+
//
|
52 |
+
// Copyright 2004-2007 Setasign - Jan Slabon
|
53 |
+
//
|
54 |
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
55 |
+
// you may not use this file except in compliance with the License.
|
56 |
+
// You may obtain a copy of the License at
|
57 |
+
//
|
58 |
+
// http://www.apache.org/licenses/LICENSE-2.0
|
59 |
+
//
|
60 |
+
// Unless required by applicable law or agreed to in writing, software
|
61 |
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
62 |
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
63 |
+
// See the License for the specific language governing permissions and
|
64 |
+
// limitations under the License.
|
65 |
+
****************************************************************************/
|
66 |
+
|
67 |
+
/****************************************************************************
|
68 |
+
* @copyright Khaled Al-Shamaa 2008
|
69 |
+
* @link http://www.ar-php.org
|
70 |
+
* @author Khaled Al-Shamaa <khaled@ar-php.org>
|
71 |
+
* @desc Set of PHP5 / UTF-8 Classes developed to enhance Arabic web
|
72 |
+
* applications by providing set of tools includes stem-based searching,
|
73 |
+
* translitiration, soundex, Hijri calendar, charset detection and
|
74 |
+
* converter, spell numbers, keyboard language, Muslim prayer time,
|
75 |
+
* auto-summarization, and more...
|
76 |
+
* @package Arabic
|
77 |
+
*
|
78 |
+
* @version 1.8 released in Feb 15, 2009
|
79 |
+
*
|
80 |
+
* @license LGPL
|
81 |
+
****************************************************************************/
|
82 |
+
|
83 |
+
|
84 |
+
This library is free software; you can redistribute it and/or
|
85 |
+
modify it under the terms of the GNU Lesser General Public
|
86 |
+
License as published by the Free Software Foundation;
|
87 |
+
This library is distributed in the hope that it will be useful,
|
88 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
89 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
90 |
+
Lesser General Public License for more details.
|
91 |
+
[http://www.opensource.org/licenses/lgpl-license.php]
|
92 |
+
|
mPDF/FONT INFO.txt
CHANGED
@@ -1,164 +1,164 @@
|
|
1 |
-
|
2 |
-
=================
|
3 |
-
Open Source Fonts
|
4 |
-
=================
|
5 |
-
mPDF should be able to read most TrueType Unicode font files with a .ttf extension
|
6 |
-
Truetype fonts with .ttf or .otf extension and .ttc TrueType collections should also work OK.
|
7 |
-
|
8 |
-
You will probably therefore have access to any number of fonts, but here are some useful sources for
|
9 |
-
open-source or free-use fonts. Many of these were included with earlier versions of mPDF:
|
10 |
-
|
11 |
-
General collections
|
12 |
-
-------------------
|
13 |
-
- DejaVu font collection from: http://dejavu-fonts.org/wiki/Main_Page (included in the release)
|
14 |
-
- GNU FreeFont from: http://www.gnu.org/software/freefont/
|
15 |
-
- Linux Libertine from: http://www.linuxlibertine.org (use the .ttf files - not the .otf)
|
16 |
-
- Liberation Fonts from: https://fedorahosted.org/liberation-fonts/ or directly https://fedorahosted.org/releases/l/i/liberation-fonts/
|
17 |
-
|
18 |
-
Thai fonts
|
19 |
-
----------
|
20 |
-
- Collection of Thai fonts from: ftp://linux.thai.net/pub/thailinux/software/thai-ttf/
|
21 |
-
|
22 |
-
|
23 |
-
OCR-B
|
24 |
-
-----
|
25 |
-
OCRB (ocrb10) font: http://ansuz.sooke.bc.ca/software/ocrb.php
|
26 |
-
Useful for barcodes (included in the release)
|
27 |
-
|
28 |
-
Pan-Unicode fonts (fonts containing most characters defined in Unicode)
|
29 |
-
-----------------------------------------------------------------------
|
30 |
-
- BitStream Cyberbit from: http://aol-4.vo.llnwd.net/pub/communicator/extras/fonts/windows/
|
31 |
-
Cyberbit.ZIP (or just Google it)
|
32 |
-
(NB if run with $debug_fonts gives warning of invalid table checksum - just turn it off!)
|
33 |
-
- Code2000 (NB shareware) from: http://www.code2000.net/code2000_page.htm
|
34 |
-
- Quivira from: http://www.quivira-font.com/ (combining diacritics are not placed correctly, but has a very full set of glyphs)
|
35 |
-
|
36 |
-
|
37 |
-
CJK (Chinese-Japanese-Korean)
|
38 |
-
-----------------------------
|
39 |
-
HanNomA and B from: http://vietunicode.sourceforge.net/fonts/fonts_hannom.html
|
40 |
-
unBatang_0613 from: http://people.ktug.or.kr/~nomos/mine/UnBatang_0613.ttf
|
41 |
-
Sun-ExtA and Sun-ExtB from: http://www.alanwood.net/unicode/fonts-east-asian.html
|
42 |
-
(http://www.alanwood.net/downloads/index.html)
|
43 |
-
Fonts which contain both Unicode BMP and SIP (Supplementary Ideographic Plane)
|
44 |
-
characters in one file e.g. "AR PL UMing" and "AR PL UKai"
|
45 |
-
from: http://www.freedesktop.org
|
46 |
-
http://www.freedesktop.org/wiki/Software/CJKUnifonts/Download
|
47 |
-
[MS Windows fonts such as MS Mincho and MingLiU also work]
|
48 |
-
Japanese IPA fonts: http://ossipedia.ipa.go.jp/ipafont/index.html
|
49 |
-
|
50 |
-
Arabic/Eastern fonts
|
51 |
-
--------------------
|
52 |
-
- XW Zar fonts can be downloaded from: http://www.redlers.com/downloadfont.html
|
53 |
-
(2 of these fonts are included in the release)
|
54 |
-
(original site in Farsi: http://wiki.irmug.org/index.php/XWZar)
|
55 |
-
- See below for more details and font names of the fonts used in mPDF 4.x
|
56 |
-
|
57 |
-
|
58 |
-
Other sources
|
59 |
-
-------------
|
60 |
-
http://www.unifont.org/fontguide/
|
61 |
-
http://www.alanwood.net/unicode/fonts.html
|
62 |
-
http://cooltext.com (e.g. http://cooltext.com/Fonts-Unicode+Arabic)
|
63 |
-
ApparatusSIL, DoulosSIL, Padauk from SIL: http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&cat_id=FontDownloads
|
64 |
-
DaiBanna (Tai Le)
|
65 |
-
|
66 |
-
Mediaeval & Ancient Scripts
|
67 |
-
---------------------------
|
68 |
-
Junicode: http://junicode.sourceforge.net/
|
69 |
-
Cardo: http://scholarsfonts.net/cardofnt.html
|
70 |
-
|
71 |
-
Syriac fonts
|
72 |
-
------------
|
73 |
-
http://www.bethmardutho.org/meltho/
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
============
|
79 |
-
ARABIC FONTS
|
80 |
-
============
|
81 |
-
You can use any appropriate Unicode-encoded .ttf or .ttc font file for arabic text, but
|
82 |
-
the font file must include the Arabic Presentation Forms-B (U+FE70�U+FEFF).
|
83 |
-
2 of the XW Zar fonts are included in the release.
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
===========
|
88 |
-
INDIC FONTS
|
89 |
-
===========
|
90 |
-
Indic scripts e.g. Hindi, Bengali etc. use conjuct forms which have no Unicode assignment. You
|
91 |
-
cannot therefore use any standard .ttf font files with mPDF.
|
92 |
-
|
93 |
-
A set of fonts has been adapted to use specifically with mPDF. They are based on a set of fonts from:
|
94 |
-
|
95 |
-
http://www.cdacmumbai.in/projects/indix/e_introduction.shtml
|
96 |
-
|
97 |
-
NB These fonts are released under GNU GPL Version 2 license
|
98 |
-
|
99 |
-
You need these adapted fonts (ind_bn_1_001.ttf etc.) to work with mPDF, as the glyphs have been
|
100 |
-
assigned to Unicode values in the Private Use area (U+E000 ->). These are included in the
|
101 |
-
mPDF download.
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
Users of mPDF v4.x
|
106 |
-
------------------
|
107 |
-
The original indic font files do not contain a full set of even basic ASCII
|
108 |
-
characters. The fonts supplied have been "fixed" to include those extra
|
109 |
-
characters. This now works whether the font is subset or not.
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
=========
|
114 |
-
CJK Fonts
|
115 |
-
=========
|
116 |
-
|
117 |
-
|
118 |
-
Supplemental Ideographic Plane
|
119 |
-
==============================
|
120 |
-
SIP = Supplemental Ideographic Plane ( = Plane 2) = U+20000 - U+2FFFF (131072 - 196607)
|
121 |
-
These characters are required for the HKSCS Hong Kong Supplementary Character Set. Fonts with
|
122 |
-
SIP characters are commonly divided into a second file e.g. MingLiU and MingLiU-ExtB
|
123 |
-
|
124 |
-
mPDF requires 2 fonts and they should be cross-referenced in config_fonts.php e.g.
|
125 |
-
"sun-exta" => array(
|
126 |
-
'R' => "Sun-ExtA.ttf",
|
127 |
-
'sip-ext' => 'sun-extb',
|
128 |
-
),
|
129 |
-
"sun-extb" => array(
|
130 |
-
'R' => "Sun-ExtB.ttf",
|
131 |
-
),
|
132 |
-
|
133 |
-
--OR--
|
134 |
-
(NB these ones also define the font number within the TTC Collection as TTCfontID)
|
135 |
-
'mingliu' => array (
|
136 |
-
'R' => 'mingliu.ttc',
|
137 |
-
'TTCfontID' => array (
|
138 |
-
'R' => 1,
|
139 |
-
),
|
140 |
-
'sip-ext' => 'mingliu-extb',
|
141 |
-
),
|
142 |
-
'mingliu-extb' => array (
|
143 |
-
'R' => 'mingliub.ttc',
|
144 |
-
'TTCfontID' => array (
|
145 |
-
'R' => 1,
|
146 |
-
),
|
147 |
-
),
|
148 |
-
'mingliu_hkscs' => array (
|
149 |
-
'R' => 'mingliu.ttc',
|
150 |
-
'TTCfontID' => array (
|
151 |
-
'R' => 3,
|
152 |
-
),
|
153 |
-
'sip-ext' => 'mingliu_hkscs-extb',
|
154 |
-
),
|
155 |
-
'mingliu_hkscs-extb' => array (
|
156 |
-
'R' => 'mingliub.ttc',
|
157 |
-
'TTCfontID' => array (
|
158 |
-
'R' => 3,
|
159 |
-
),
|
160 |
-
),
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
1 |
+
|
2 |
+
=================
|
3 |
+
Open Source Fonts
|
4 |
+
=================
|
5 |
+
mPDF should be able to read most TrueType Unicode font files with a .ttf extension
|
6 |
+
Truetype fonts with .ttf or .otf extension and .ttc TrueType collections should also work OK.
|
7 |
+
|
8 |
+
You will probably therefore have access to any number of fonts, but here are some useful sources for
|
9 |
+
open-source or free-use fonts. Many of these were included with earlier versions of mPDF:
|
10 |
+
|
11 |
+
General collections
|
12 |
+
-------------------
|
13 |
+
- DejaVu font collection from: http://dejavu-fonts.org/wiki/Main_Page (included in the release)
|
14 |
+
- GNU FreeFont from: http://www.gnu.org/software/freefont/
|
15 |
+
- Linux Libertine from: http://www.linuxlibertine.org (use the .ttf files - not the .otf)
|
16 |
+
- Liberation Fonts from: https://fedorahosted.org/liberation-fonts/ or directly https://fedorahosted.org/releases/l/i/liberation-fonts/
|
17 |
+
|
18 |
+
Thai fonts
|
19 |
+
----------
|
20 |
+
- Collection of Thai fonts from: ftp://linux.thai.net/pub/thailinux/software/thai-ttf/
|
21 |
+
|
22 |
+
|
23 |
+
OCR-B
|
24 |
+
-----
|
25 |
+
OCRB (ocrb10) font: http://ansuz.sooke.bc.ca/software/ocrb.php
|
26 |
+
Useful for barcodes (included in the release)
|
27 |
+
|
28 |
+
Pan-Unicode fonts (fonts containing most characters defined in Unicode)
|
29 |
+
-----------------------------------------------------------------------
|
30 |
+
- BitStream Cyberbit from: http://aol-4.vo.llnwd.net/pub/communicator/extras/fonts/windows/
|
31 |
+
Cyberbit.ZIP (or just Google it)
|
32 |
+
(NB if run with $debug_fonts gives warning of invalid table checksum - just turn it off!)
|
33 |
+
- Code2000 (NB shareware) from: http://www.code2000.net/code2000_page.htm
|
34 |
+
- Quivira from: http://www.quivira-font.com/ (combining diacritics are not placed correctly, but has a very full set of glyphs)
|
35 |
+
|
36 |
+
|
37 |
+
CJK (Chinese-Japanese-Korean)
|
38 |
+
-----------------------------
|
39 |
+
HanNomA and B from: http://vietunicode.sourceforge.net/fonts/fonts_hannom.html
|
40 |
+
unBatang_0613 from: http://people.ktug.or.kr/~nomos/mine/UnBatang_0613.ttf
|
41 |
+
Sun-ExtA and Sun-ExtB from: http://www.alanwood.net/unicode/fonts-east-asian.html
|
42 |
+
(http://www.alanwood.net/downloads/index.html)
|
43 |
+
Fonts which contain both Unicode BMP and SIP (Supplementary Ideographic Plane)
|
44 |
+
characters in one file e.g. "AR PL UMing" and "AR PL UKai"
|
45 |
+
from: http://www.freedesktop.org
|
46 |
+
http://www.freedesktop.org/wiki/Software/CJKUnifonts/Download
|
47 |
+
[MS Windows fonts such as MS Mincho and MingLiU also work]
|
48 |
+
Japanese IPA fonts: http://ossipedia.ipa.go.jp/ipafont/index.html
|
49 |
+
|
50 |
+
Arabic/Eastern fonts
|
51 |
+
--------------------
|
52 |
+
- XW Zar fonts can be downloaded from: http://www.redlers.com/downloadfont.html
|
53 |
+
(2 of these fonts are included in the release)
|
54 |
+
(original site in Farsi: http://wiki.irmug.org/index.php/XWZar)
|
55 |
+
- See below for more details and font names of the fonts used in mPDF 4.x
|
56 |
+
|
57 |
+
|
58 |
+
Other sources
|
59 |
+
-------------
|
60 |
+
http://www.unifont.org/fontguide/
|
61 |
+
http://www.alanwood.net/unicode/fonts.html
|
62 |
+
http://cooltext.com (e.g. http://cooltext.com/Fonts-Unicode+Arabic)
|
63 |
+
ApparatusSIL, DoulosSIL, Padauk from SIL: http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&cat_id=FontDownloads
|
64 |
+
DaiBanna (Tai Le)
|
65 |
+
|
66 |
+
Mediaeval & Ancient Scripts
|
67 |
+
---------------------------
|
68 |
+
Junicode: http://junicode.sourceforge.net/
|
69 |
+
Cardo: http://scholarsfonts.net/cardofnt.html
|
70 |
+
|
71 |
+
Syriac fonts
|
72 |
+
------------
|
73 |
+
http://www.bethmardutho.org/meltho/
|
74 |
+
|
75 |
+
|
76 |
+
|
77 |
+
|
78 |
+
============
|
79 |
+
ARABIC FONTS
|
80 |
+
============
|
81 |
+
You can use any appropriate Unicode-encoded .ttf or .ttc font file for arabic text, but
|
82 |
+
the font file must include the Arabic Presentation Forms-B (U+FE70�U+FEFF).
|
83 |
+
2 of the XW Zar fonts are included in the release.
|
84 |
+
|
85 |
+
|
86 |
+
|
87 |
+
===========
|
88 |
+
INDIC FONTS
|
89 |
+
===========
|
90 |
+
Indic scripts e.g. Hindi, Bengali etc. use conjuct forms which have no Unicode assignment. You
|
91 |
+
cannot therefore use any standard .ttf font files with mPDF.
|
92 |
+
|
93 |
+
A set of fonts has been adapted to use specifically with mPDF. They are based on a set of fonts from:
|
94 |
+
|
95 |
+
http://www.cdacmumbai.in/projects/indix/e_introduction.shtml
|
96 |
+
|
97 |
+
NB These fonts are released under GNU GPL Version 2 license
|
98 |
+
|
99 |
+
You need these adapted fonts (ind_bn_1_001.ttf etc.) to work with mPDF, as the glyphs have been
|
100 |
+
assigned to Unicode values in the Private Use area (U+E000 ->). These are included in the
|
101 |
+
mPDF download.
|
102 |
+
|
103 |
+
|
104 |
+
|
105 |
+
Users of mPDF v4.x
|
106 |
+
------------------
|
107 |
+
The original indic font files do not contain a full set of even basic ASCII
|
108 |
+
characters. The fonts supplied have been "fixed" to include those extra
|
109 |
+
characters. This now works whether the font is subset or not.
|
110 |
+
|
111 |
+
|
112 |
+
|
113 |
+
=========
|
114 |
+
CJK Fonts
|
115 |
+
=========
|
116 |
+
|
117 |
+
|
118 |
+
Supplemental Ideographic Plane
|
119 |
+
==============================
|
120 |
+
SIP = Supplemental Ideographic Plane ( = Plane 2) = U+20000 - U+2FFFF (131072 - 196607)
|
121 |
+
These characters are required for the HKSCS Hong Kong Supplementary Character Set. Fonts with
|
122 |
+
SIP characters are commonly divided into a second file e.g. MingLiU and MingLiU-ExtB
|
123 |
+
|
124 |
+
mPDF requires 2 fonts and they should be cross-referenced in config_fonts.php e.g.
|
125 |
+
"sun-exta" => array(
|
126 |
+
'R' => "Sun-ExtA.ttf",
|
127 |
+
'sip-ext' => 'sun-extb',
|
128 |
+
),
|
129 |
+
"sun-extb" => array(
|
130 |
+
'R' => "Sun-ExtB.ttf",
|
131 |
+
),
|
132 |
+
|
133 |
+
--OR--
|
134 |
+
(NB these ones also define the font number within the TTC Collection as TTCfontID)
|
135 |
+
'mingliu' => array (
|
136 |
+
'R' => 'mingliu.ttc',
|
137 |
+
'TTCfontID' => array (
|
138 |
+
'R' => 1,
|
139 |
+
),
|
140 |
+
'sip-ext' => 'mingliu-extb',
|
141 |
+
),
|
142 |
+
'mingliu-extb' => array (
|
143 |
+
'R' => 'mingliub.ttc',
|
144 |
+
'TTCfontID' => array (
|
145 |
+
'R' => 1,
|
146 |
+
),
|
147 |
+
),
|
148 |
+
'mingliu_hkscs' => array (
|
149 |
+
'R' => 'mingliu.ttc',
|
150 |
+
'TTCfontID' => array (
|
151 |
+
'R' => 3,
|
152 |
+
),
|
153 |
+
'sip-ext' => 'mingliu_hkscs-extb',
|
154 |
+
),
|
155 |
+
'mingliu_hkscs-extb' => array (
|
156 |
+
'R' => 'mingliub.ttc',
|
157 |
+
'TTCfontID' => array (
|
158 |
+
'R' => 3,
|
159 |
+
),
|
160 |
+
),
|
161 |
+
|
162 |
+
|
163 |
+
|
164 |
+
|
mPDF/LICENSE.txt
CHANGED
@@ -1,340 +1,340 @@
|
|
1 |
-
GNU GENERAL PUBLIC LICENSE
|
2 |
-
Version 2, June 1991
|
3 |
-
|
4 |
-
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
5 |
-
59 Temple Place, Suite 330, Boston, MA 02111-1307 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 Library 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 |
-
<one line to give the program's name and a brief idea of what it does.>
|
294 |
-
Copyright (C) <year> <name of author>
|
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
|
307 |
-
along with this program; if not, write to the Free Software
|
308 |
-
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
309 |
-
|
310 |
-
|
311 |
-
Also add information on how to contact you by electronic and paper mail.
|
312 |
-
|
313 |
-
If the program is interactive, make it output a short notice like this
|
314 |
-
when it starts in an interactive mode:
|
315 |
-
|
316 |
-
Gnomovision version 69, Copyright (C) year name of author
|
317 |
-
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
318 |
-
This is free software, and you are welcome to redistribute it
|
319 |
-
under certain conditions; type `show c' for details.
|
320 |
-
|
321 |
-
The hypothetical commands `show w' and `show c' should show the appropriate
|
322 |
-
parts of the General Public License. Of course, the commands you use may
|
323 |
-
be called something other than `show w' and `show c'; they could even be
|
324 |
-
mouse-clicks or menu items--whatever suits your program.
|
325 |
-
|
326 |
-
You should also get your employer (if you work as a programmer) or your
|
327 |
-
school, if any, to sign a "copyright disclaimer" for the program, if
|
328 |
-
necessary. Here is a sample; alter the names:
|
329 |
-
|
330 |
-
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
331 |
-
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
332 |
-
|
333 |
-
<signature of Ty Coon>, 1 April 1989
|
334 |
-
Ty Coon, President of Vice
|
335 |
-
|
336 |
-
This General Public License does not permit incorporating your program into
|
337 |
-
proprietary programs. If your program is a subroutine library, you may
|
338 |
-
consider it more useful to permit linking proprietary applications with the
|
339 |
-
library. If this is what you want to do, use the GNU Library General
|
340 |
-
Public License instead of this License.
|
1 |
+
GNU GENERAL PUBLIC LICENSE
|
2 |
+
Version 2, June 1991
|
3 |
+
|
4 |
+
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
5 |
+
59 Temple Place, Suite 330, Boston, MA 02111-1307 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 Library 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 |
+
<one line to give the program's name and a brief idea of what it does.>
|
294 |
+
Copyright (C) <year> <name of author>
|
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
|
307 |
+
along with this program; if not, write to the Free Software
|
308 |
+
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
309 |
+
|
310 |
+
|
311 |
+
Also add information on how to contact you by electronic and paper mail.
|
312 |
+
|
313 |
+
If the program is interactive, make it output a short notice like this
|
314 |
+
when it starts in an interactive mode:
|
315 |
+
|
316 |
+
Gnomovision version 69, Copyright (C) year name of author
|
317 |
+
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
318 |
+
This is free software, and you are welcome to redistribute it
|
319 |
+
under certain conditions; type `show c' for details.
|
320 |
+
|
321 |
+
The hypothetical commands `show w' and `show c' should show the appropriate
|
322 |
+
parts of the General Public License. Of course, the commands you use may
|
323 |
+
be called something other than `show w' and `show c'; they could even be
|
324 |
+
mouse-clicks or menu items--whatever suits your program.
|
325 |
+
|
326 |
+
You should also get your employer (if you work as a programmer) or your
|
327 |
+
school, if any, to sign a "copyright disclaimer" for the program, if
|
328 |
+
necessary. Here is a sample; alter the names:
|
329 |
+
|
330 |
+
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
331 |
+
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
332 |
+
|
333 |
+
<signature of Ty Coon>, 1 April 1989
|
334 |
+
Ty Coon, President of Vice
|
335 |
+
|
336 |
+
This General Public License does not permit incorporating your program into
|
337 |
+
proprietary programs. If your program is a subroutine library, you may
|
338 |
+
consider it more useful to permit linking proprietary applications with the
|
339 |
+
library. If this is what you want to do, use the GNU Library General
|
340 |
+
Public License instead of this License.
|
mPDF/README.txt
CHANGED
@@ -1,5 +1,5 @@
|
|
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 |
+
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 |
+
|
mPDF/classes/barcode.php
CHANGED
@@ -1,1965 +1,1965 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
// Adapted for mPDF from TCPDF barcode. Original Details left below.
|
4 |
-
|
5 |
-
//============================================================+
|
6 |
-
// File name : barcodes.php
|
7 |
-
// Begin : 2008-06-09
|
8 |
-
// Last Update : 2009-04-15
|
9 |
-
// Version : 1.0.008
|
10 |
-
// License : GNU LGPL (http://www.gnu.org/copyleft/lesser.html)
|
11 |
-
// ----------------------------------------------------------------------------
|
12 |
-
// Copyright (C) 2008-2009 Nicola Asuni - Tecnick.com S.r.l.
|
13 |
-
//
|
14 |
-
// This program is free software: you can redistribute it and/or modify
|
15 |
-
// it under the terms of the GNU Lesser General Public License as published by
|
16 |
-
// the Free Software Foundation, either version 2.1 of the License, or
|
17 |
-
// (at your option) any later version.
|
18 |
-
//
|
19 |
-
// This program is distributed in the hope that it will be useful,
|
20 |
-
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
21 |
-
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
22 |
-
// GNU Lesser General Public License for more details.
|
23 |
-
//
|
24 |
-
// You should have received a copy of the GNU Lesser General Public License
|
25 |
-
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
26 |
-
//
|
27 |
-
// See LICENSE.TXT file for more information.
|
28 |
-
// ----------------------------------------------------------------------------
|
29 |
-
//
|
30 |
-
// Description : PHP class to creates array representations for
|
31 |
-
// common 1D barcodes to be used with TCPDF.
|
32 |
-
//
|
33 |
-
// Author: Nicola Asuni
|
34 |
-
//
|
35 |
-
// (c) Copyright:
|
36 |
-
// Nicola Asuni
|
37 |
-
// Tecnick.com S.r.l.
|
38 |
-
// Via della Pace, 11
|
39 |
-
// 09044 Quartucciu (CA)
|
40 |
-
// ITALY
|
41 |
-
// www.tecnick.com
|
42 |
-
// info@tecnick.com
|
43 |
-
//============================================================+
|
44 |
-
|
45 |
-
class PDFBarcode {
|
46 |
-
|
47 |
-
protected $barcode_array;
|
48 |
-
protected $gapwidth;
|
49 |
-
protected $print_ratio;
|
50 |
-
protected $daft;
|
51 |
-
|
52 |
-
public function __construct() {
|
53 |
-
|
54 |
-
}
|
55 |
-
|
56 |
-
public function getBarcodeArray($code, $type, $pr='') {
|
57 |
-
$this->setBarcode($code, $type, $pr);
|
58 |
-
return $this->barcode_array;
|
59 |
-
}
|
60 |
-
public function getChecksum($code, $type) {
|
61 |
-
$this->setBarcode($code, $type);
|
62 |
-
if (!$this->barcode_array) { return ''; }
|
63 |
-
else { return $this->barcode_array['checkdigit']; }
|
64 |
-
}
|
65 |
-
|
66 |
-
public function setBarcode($code, $type, $pr='') {
|
67 |
-
$this->print_ratio = 1;
|
68 |
-
switch (strtoupper($type)) {
|
69 |
-
case 'ISBN':
|
70 |
-
case 'ISSN':
|
71 |
-
case 'EAN13': { // EAN 13
|
72 |
-
$arrcode = $this->barcode_eanupc($code, 13);
|
73 |
-
$arrcode['lightmL'] = 11; // LEFT light margin = x X-dim (http://www.gs1uk.org)
|
74 |
-
$arrcode['lightmR'] = 7; // RIGHT light margin = x X-dim (http://www.gs1uk.org)
|
75 |
-
$arrcode['nom-X'] = 0.33; // Nominal value for X-dim in mm (http://www.gs1uk.org)
|
76 |
-
$arrcode['nom-H'] = 25.93; // Nominal bar height in mm incl. numerals (http://www.gs1uk.org)
|
77 |
-
break;
|
78 |
-
}
|
79 |
-
case 'UPCA': { // UPC-A
|
80 |
-
$arrcode = $this->barcode_eanupc($code, 12);
|
81 |
-
$arrcode['lightmL'] = 9; // LEFT light margin = x X-dim (http://www.gs1uk.org)
|
82 |
-
$arrcode['lightmR'] = 9; // RIGHT light margin = x X-dim (http://www.gs1uk.org)
|
83 |
-
$arrcode['nom-X'] = 0.33; // Nominal value for X-dim in mm (http://www.gs1uk.org)
|
84 |
-
$arrcode['nom-H'] = 25.91; // Nominal bar height in mm incl. numerals (http://www.gs1uk.org)
|
85 |
-
break;
|
86 |
-
}
|
87 |
-
case 'UPCE': { // UPC-E
|
88 |
-
$arrcode = $this->barcode_eanupc($code, 6);
|
89 |
-
$arrcode['lightmL'] = 9; // LEFT light margin = x X-dim (http://www.gs1uk.org)
|
90 |
-
$arrcode['lightmR'] = 7; // RIGHT light margin = x X-dim (http://www.gs1uk.org)
|
91 |
-
$arrcode['nom-X'] = 0.33; // Nominal value for X-dim in mm (http://www.gs1uk.org)
|
92 |
-
$arrcode['nom-H'] = 25.93; // Nominal bar height in mm incl. numerals (http://www.gs1uk.org)
|
93 |
-
break;
|
94 |
-
}
|
95 |
-
case 'EAN8': { // EAN 8
|
96 |
-
$arrcode = $this->barcode_eanupc($code, 8);
|
97 |
-
$arrcode['lightmL'] = 7; // LEFT light margin = x X-dim (http://www.gs1uk.org)
|
98 |
-
$arrcode['lightmR'] = 7; // RIGHT light margin = x X-dim (http://www.gs1uk.org)
|
99 |
-
$arrcode['nom-X'] = 0.33; // Nominal value for X-dim in mm (http://www.gs1uk.org)
|
100 |
-
$arrcode['nom-H'] = 21.64; // Nominal bar height in mm incl. numerals (http://www.gs1uk.org)
|
101 |
-
break;
|
102 |
-
}
|
103 |
-
case 'EAN2': { // 2-Digits UPC-Based Extention
|
104 |
-
$arrcode = $this->barcode_eanext($code, 2);
|
105 |
-
$arrcode['lightmL'] = 7; // LEFT light margin = x X-dim (estimated)
|
106 |
-
$arrcode['lightmR'] = 7; // RIGHT light margin = x X-dim (estimated)
|
107 |
-
$arrcode['sepM'] = 9; // SEPARATION margin = x X-dim (http://web.archive.org/web/19990501035133/http://www.uc-council.org/d36-d.htm)
|
108 |
-
$arrcode['nom-X'] = 0.33; // Nominal value for X-dim in mm (http://www.gs1uk.org)
|
109 |
-
$arrcode['nom-H'] = 20; // Nominal bar height in mm incl. numerals (estimated) not used when combined
|
110 |
-
break;
|
111 |
-
}
|
112 |
-
case 'EAN5': { // 5-Digits UPC-Based Extention
|
113 |
-
$arrcode = $this->barcode_eanext($code, 5);
|
114 |
-
$arrcode['lightmL'] = 7; // LEFT light margin = x X-dim (estimated)
|
115 |
-
$arrcode['lightmR'] = 7; // RIGHT light margin = x X-dim (estimated)
|
116 |
-
$arrcode['sepM'] = 9; // SEPARATION margin = x X-dim (http://web.archive.org/web/19990501035133/http://www.uc-council.org/d36-d.htm)
|
117 |
-
$arrcode['nom-X'] = 0.33; // Nominal value for X-dim in mm (http://www.gs1uk.org)
|
118 |
-
$arrcode['nom-H'] = 20; // Nominal bar height in mm incl. numerals (estimated) not used when combined
|
119 |
-
break;
|
120 |
-
}
|
121 |
-
|
122 |
-
case 'IMB': { // IMB - Intelligent Mail Barcode - Onecode - USPS-B-3200
|
123 |
-
$xdim = 0.508; // Nominal value for X-dim (bar width) in mm (spec.)
|
124 |
-
$bpi = 22; // Bars per inch
|
125 |
-
// Ratio of Nominal value for width of spaces in mm / Nominal value for X-dim (bar width) in mm based on bars per inch
|
126 |
-
$this->gapwidth = ((25.4/$bpi) - $xdim)/$xdim;
|
127 |
-
$this->daft = array('D'=>2, 'A'=>2, 'F'=>3, 'T'=>1); // Descender; Ascender; Full; Tracker bar heights
|
128 |
-
$arrcode = $this->barcode_imb($code);
|
129 |
-
$arrcode['nom-X'] = $xdim ;
|
130 |
-
$arrcode['nom-H'] = 3.68; // Nominal value for Height of Full bar in mm (spec.)
|
131 |
-
// USPS-B-3200 Revision C = 4.623
|
132 |
-
// USPS-B-3200 Revision E = 3.68
|
133 |
-
$arrcode['quietL'] = 3.175; // LEFT Quiet margin = mm (spec.)
|
134 |
-
$arrcode['quietR'] = 3.175; // RIGHT Quiet margin = mm (spec.)
|
135 |
-
$arrcode['quietTB'] = 0.711; // TOP/BOTTOM Quiet margin = mm (spec.)
|
136 |
-
break;
|
137 |
-
}
|
138 |
-
case 'RM4SCC': { // RM4SCC (Royal Mail 4-state Customer Code) - CBC (Customer Bar Code)
|
139 |
-
$xdim = 0.508; // Nominal value for X-dim (bar width) in mm (spec.)
|
140 |
-
$bpi = 22; // Bars per inch
|
141 |
-
// Ratio of Nominal value for width of spaces in mm / Nominal value for X-dim (bar width) in mm based on bars per inch
|
142 |
-
$this->gapwidth = ((25.4/$bpi) - $xdim)/$xdim;
|
143 |
-
$this->daft = array('D'=>5, 'A'=>5, 'F'=>8, 'T'=>2); // Descender; Ascender; Full; Tracker bar heights
|
144 |
-
$arrcode = $this->barcode_rm4scc($code, false);
|
145 |
-
$arrcode['nom-X'] = $xdim ;
|
146 |
-
$arrcode['nom-H'] = 5.0; // Nominal value for Height of Full bar in mm (spec.)
|
147 |
-
$arrcode['quietL'] = 2; // LEFT Quiet margin = mm (spec.)
|
148 |
-
$arrcode['quietR'] = 2; // RIGHT Quiet margin = mm (spec.)
|
149 |
-
$arrcode['quietTB'] = 2; // TOP/BOTTOM Quiet margin = mm (spec?)
|
150 |
-
break;
|
151 |
-
}
|
152 |
-
case 'KIX': { // KIX (Klant index - Customer index)
|
153 |
-
$xdim = 0.508; // Nominal value for X-dim (bar width) in mm (spec.)
|
154 |
-
$bpi = 22; // Bars per inch
|
155 |
-
// Ratio of Nominal value for width of spaces in mm / Nominal value for X-dim (bar width) in mm based on bars per inch
|
156 |
-
$this->gapwidth = ((25.4/$bpi) - $xdim)/$xdim;
|
157 |
-
$this->daft = array('D'=>5, 'A'=>5, 'F'=>8, 'T'=>2); // Descender; Ascender; Full; Tracker bar heights
|
158 |
-
$arrcode = $this->barcode_rm4scc($code, true);
|
159 |
-
$arrcode['nom-X'] = $xdim ;
|
160 |
-
$arrcode['nom-H'] = 5.0; // Nominal value for Height of Full bar in mm (? spec.)
|
161 |
-
$arrcode['quietL'] = 2; // LEFT Quiet margin = mm (spec.)
|
162 |
-
$arrcode['quietR'] = 2; // RIGHT Quiet margin = mm (spec.)
|
163 |
-
$arrcode['quietTB'] = 2; // TOP/BOTTOM Quiet margin = mm (spec.)
|
164 |
-
break;
|
165 |
-
}
|
166 |
-
case 'POSTNET': { // POSTNET
|
167 |
-
$xdim = 0.508; // Nominal value for X-dim (bar width) in mm (spec.)
|
168 |
-
$bpi = 22; // Bars per inch
|
169 |
-
// Ratio of Nominal value for width of spaces in mm / Nominal value for X-dim (bar width) in mm based on bars per inch
|
170 |
-
$this->gapwidth = ((25.4/$bpi) - $xdim)/$xdim;
|
171 |
-
$arrcode = $this->barcode_postnet($code, false);
|
172 |
-
$arrcode['nom-X'] = $xdim ;
|
173 |
-
$arrcode['nom-H'] = 3.175; // Nominal value for Height of Full bar in mm (spec.)
|
174 |
-
$arrcode['quietL'] = 3.175; // LEFT Quiet margin = mm (?spec.)
|
175 |
-
$arrcode['quietR'] = 3.175; // RIGHT Quiet margin = mm (?spec.)
|
176 |
-
$arrcode['quietTB'] = 1.016; // TOP/BOTTOM Quiet margin = mm (?spec.)
|
177 |
-
break;
|
178 |
-
}
|
179 |
-
case 'PLANET': { // PLANET
|
180 |
-
$xdim = 0.508; // Nominal value for X-dim (bar width) in mm (spec.)
|
181 |
-
$bpi = 22; // Bars per inch
|
182 |
-
// Ratio of Nominal value for width of spaces in mm / Nominal value for X-dim (bar width) in mm based on bars per inch
|
183 |
-
$this->gapwidth = ((25.4/$bpi) - $xdim)/$xdim;
|
184 |
-
$arrcode = $this->barcode_postnet($code, true);
|
185 |
-
$arrcode['nom-X'] = $xdim ;
|
186 |
-
$arrcode['nom-H'] = 3.175; // Nominal value for Height of Full bar in mm (spec.)
|
187 |
-
$arrcode['quietL'] = 3.175; // LEFT Quiet margin = mm (?spec.)
|
188 |
-
$arrcode['quietR'] = 3.175; // RIGHT Quiet margin = mm (?spec.)
|
189 |
-
$arrcode['quietTB'] = 1.016; // TOP/BOTTOM Quiet margin = mm (?spec.)
|
190 |
-
break;
|
191 |
-
}
|
192 |
-
|
193 |
-
case 'C93': { // CODE 93 - USS-93
|
194 |
-
$arrcode = $this->barcode_code93($code);
|
195 |
-
if ($arrcode == false) { break; }
|
196 |
-
$arrcode['nom-X'] = 0.381; // Nominal value for X-dim (bar width) in mm (2 X min. spec.)
|
197 |
-
$arrcode['nom-H'] = 10; // Nominal value for Height of Full bar in mm (non-spec.)
|
198 |
-
$arrcode['lightmL'] = 10; // LEFT light margin = x X-dim (spec.)
|
199 |
-
$arrcode['lightmR'] = 10; // RIGHT light margin = x X-dim (spec.)
|
200 |
-
$arrcode['lightTB'] = 0; // TOP/BOTTOM light margin = x X-dim (non-spec.)
|
201 |
-
break;
|
202 |
-
}
|
203 |
-
case 'CODE11': { // CODE 11
|
204 |
-
if ($pr > 0) { $this->print_ratio = $pr; }
|
205 |
-
else { $this->print_ratio = 3; } // spec: Pr= 1:2.24 - 1:3.5
|
206 |
-
$arrcode = $this->barcode_code11($code);
|
207 |
-
if ($arrcode == false) { break; }
|
208 |
-
$arrcode['nom-X'] = 0.381; // Nominal value for X-dim (bar width) in mm (2 X min. spec.)
|
209 |
-
$arrcode['nom-H'] = 10; // Nominal value for Height of Full bar in mm (non-spec.)
|
210 |
-
$arrcode['lightmL'] = 10; // LEFT light margin = x X-dim (spec.)
|
211 |
-
$arrcode['lightmR'] = 10; // RIGHT light margin = x X-dim (spec.)
|
212 |
-
$arrcode['lightTB'] = 0; // TOP/BOTTOM light margin = x X-dim (non-spec.)
|
213 |
-
break;
|
214 |
-
}
|
215 |
-
case 'MSI': // MSI (Variation of Plessey code)
|
216 |
-
case 'MSI+': { // MSI + CHECKSUM (modulo 11)
|
217 |
-
if (strtoupper($type)=='MSI') { $arrcode = $this->barcode_msi($code, false); }
|
218 |
-
if (strtoupper($type)=='MSI+') { $arrcode = $this->barcode_msi($code, true); }
|
219 |
-
if ($arrcode == false) { break; }
|
220 |
-
$arrcode['nom-X'] = 0.381; // Nominal value for X-dim (bar width) in mm (2 X min. spec.)
|
221 |
-
$arrcode['nom-H'] = 10; // Nominal value for Height of Full bar in mm (non-spec.)
|
222 |
-
$arrcode['lightmL'] = 12; // LEFT light margin = x X-dim (spec.)
|
223 |
-
$arrcode['lightmR'] = 12; // RIGHT light margin = x X-dim (spec.)
|
224 |
-
$arrcode['lightTB'] = 0; // TOP/BOTTOM light margin = x X-dim (non-spec.)
|
225 |
-
break;
|
226 |
-
}
|
227 |
-
case 'CODABAR': { // CODABAR
|
228 |
-
if ($pr > 0) { $this->print_ratio = $pr; }
|
229 |
-
else { $this->print_ratio = 2.5; } // spec: Pr= 1:2 - 1:3 (>2.2 if X<0.50)
|
230 |
-
if (strtoupper($type)=='CODABAR') { $arrcode = $this->barcode_codabar($code); }
|
231 |
-
if ($arrcode == false) { break; }
|
232 |
-
$arrcode['nom-X'] = 0.381; // Nominal value for X-dim (bar width) in mm (2 X min. spec.)
|
233 |
-
$arrcode['nom-H'] = 10; // Nominal value for Height of Full bar in mm (non-spec.)
|
234 |
-
$arrcode['lightmL'] = 10; // LEFT light margin = x X-dim (spec.)
|
235 |
-
$arrcode['lightmR'] = 10; // RIGHT light margin = x X-dim (spec.)
|
236 |
-
$arrcode['lightTB'] = 0; // TOP/BOTTOM light margin = x X-dim (non-spec.)
|
237 |
-
break;
|
238 |
-
}
|
239 |
-
case 'C128A': // CODE 128 A
|
240 |
-
case 'C128B': // CODE 128 B
|
241 |
-
case 'C128C': // CODE 128 C
|
242 |
-
case 'EAN128A': // EAN 128 A
|
243 |
-
case 'EAN128B': // EAN 128 B
|
244 |
-
case 'EAN128C': { // EAN 128 C
|
245 |
-
if (strtoupper($type)=='C128A') { $arrcode = $this->barcode_c128($code, 'A'); }
|
246 |
-
if (strtoupper($type)=='C128B') { $arrcode = $this->barcode_c128($code, 'B'); }
|
247 |
-
if (strtoupper($type)=='C128C') { $arrcode = $this->barcode_c128($code, 'C'); }
|
248 |
-
if (strtoupper($type)=='EAN128A') { $arrcode = $this->barcode_c128($code, 'A', true); }
|
249 |
-
if (strtoupper($type)=='EAN128B') { $arrcode = $this->barcode_c128($code, 'B', true); }
|
250 |
-
if (strtoupper($type)=='EAN128C') { $arrcode = $this->barcode_c128($code, 'C', true); }
|
251 |
-
if ($arrcode == false) { break; }
|
252 |
-
$arrcode['nom-X'] = 0.381; // Nominal value for X-dim (bar width) in mm (2 X min. spec.)
|
253 |
-
$arrcode['nom-H'] = 10; // Nominal value for Height of Full bar in mm (non-spec.)
|
254 |
-
$arrcode['lightmL'] = 10; // LEFT light margin = x X-dim (spec.)
|
255 |
-
$arrcode['lightmR'] = 10; // RIGHT light margin = x X-dim (spec.)
|
256 |
-
$arrcode['lightTB'] = 0; // TOP/BOTTOM light margin = x X-dim (non-spec.)
|
257 |
-
break;
|
258 |
-
}
|
259 |
-
case 'C39': // CODE 39 - ANSI MH10.8M-1983 - USD-3 - 3 of 9.
|
260 |
-
case 'C39+': // CODE 39 with checksum
|
261 |
-
case 'C39E': // CODE 39 EXTENDED
|
262 |
-
case 'C39E+': { // CODE 39 EXTENDED + CHECKSUM
|
263 |
-
if ($pr > 0) { $this->print_ratio = $pr; }
|
264 |
-
else { $this->print_ratio = 2.5; } // spec: Pr= 1:2 - 1:3 (>2.2 if X<0.50)
|
265 |
-
$code = str_replace(chr(194).chr(160), ' ', $code); // mPDF 5.3.95 (for utf-8 encoded)
|
266 |
-
$code = str_replace(chr(160), ' ', $code); // mPDF 5.3.95 (for win-1252)
|
267 |
-
if (strtoupper($type)=='C39') { $arrcode = $this->barcode_code39($code, false, false); }
|
268 |
-
if (strtoupper($type)=='C39+') { $arrcode = $this->barcode_code39($code, false, true); }
|
269 |
-
if (strtoupper($type)=='C39E') { $arrcode = $this->barcode_code39($code, true, false); }
|
270 |
-
if (strtoupper($type)=='C39E+') { $arrcode = $this->barcode_code39($code, true, true); }
|
271 |
-
if ($arrcode == false) { break; }
|
272 |
-
$arrcode['nom-X'] = 0.381; // Nominal value for X-dim (bar width) in mm (2 X min. spec.)
|
273 |
-
$arrcode['nom-H'] = 10; // Nominal value for Height of Full bar in mm (non-spec.)
|
274 |
-
$arrcode['lightmL'] = 10; // LEFT light margin = x X-dim (spec.)
|
275 |
-
$arrcode['lightmR'] = 10; // RIGHT light margin = x X-dim (spec.)
|
276 |
-
$arrcode['lightTB'] = 0; // TOP/BOTTOM light margin = x X-dim (non-spec.)
|
277 |
-
break;
|
278 |
-
}
|
279 |
-
case 'S25': // Standard 2 of 5
|
280 |
-
case 'S25+': { // Standard 2 of 5 + CHECKSUM
|
281 |
-
if ($pr > 0) { $this->print_ratio = $pr; }
|
282 |
-
else { $this->print_ratio = 3; } // spec: Pr=1:3/1:4.5
|
283 |
-
if (strtoupper($type)=='S25') { $arrcode = $this->barcode_s25($code, false); }
|
284 |
-
if (strtoupper($type)=='S25+') { $arrcode = $this->barcode_s25($code, true); }
|
285 |
-
if ($arrcode == false) { break; }
|
286 |
-
$arrcode['nom-X'] = 0.381; // Nominal value for X-dim (bar width) in mm (2 X min. spec.)
|
287 |
-
$arrcode['nom-H'] = 10; // Nominal value for Height of Full bar in mm (non-spec.)
|
288 |
-
$arrcode['lightmL'] = 10; // LEFT light margin = x X-dim (spec.)
|
289 |
-
$arrcode['lightmR'] = 10; // RIGHT light margin = x X-dim (spec.)
|
290 |
-
$arrcode['lightTB'] = 0; // TOP/BOTTOM light margin = x X-dim (non-spec.)
|
291 |
-
break;
|
292 |
-
}
|
293 |
-
case 'I25': // Interleaved 2 of 5
|
294 |
-
case 'I25+': { // Interleaved 2 of 5 + CHECKSUM
|
295 |
-
if ($pr > 0) { $this->print_ratio = $pr; }
|
296 |
-
else { $this->print_ratio = 2.5; } // spec: Pr= 1:2 - 1:3 (>2.2 if X<0.50)
|
297 |
-
if (strtoupper($type)=='I25') { $arrcode = $this->barcode_i25($code, false); }
|
298 |
-
if (strtoupper($type)=='I25+') { $arrcode = $this->barcode_i25($code, true); }
|
299 |
-
if ($arrcode == false) { break; }
|
300 |
-
$arrcode['nom-X'] = 0.381; // Nominal value for X-dim (bar width) in mm (2 X min. spec.)
|
301 |
-
$arrcode['nom-H'] = 10; // Nominal value for Height of Full bar in mm (non-spec.)
|
302 |
-
$arrcode['lightmL'] = 10; // LEFT light margin = x X-dim (spec.)
|
303 |
-
$arrcode['lightmR'] = 10; // RIGHT light margin = x X-dim (spec.)
|
304 |
-
$arrcode['lightTB'] = 0; // TOP/BOTTOM light margin = x X-dim (non-spec.)
|
305 |
-
break;
|
306 |
-
}
|
307 |
-
case 'I25B': // Interleaved 2 of 5 + Bearer bars
|
308 |
-
case 'I25B+': { // Interleaved 2 of 5 + CHECKSUM + Bearer bars
|
309 |
-
if ($pr > 0) { $this->print_ratio = $pr; }
|
310 |
-
else { $this->print_ratio = 2.5; } // spec: Pr= 1:2 - 1:3 (>2.2 if X<0.50)
|
311 |
-
if (strtoupper($type)=='I25B') { $arrcode = $this->barcode_i25($code, false); }
|
312 |
-
if (strtoupper($type)=='I25B+') { $arrcode = $this->barcode_i25($code, true); }
|
313 |
-
if ($arrcode == false) { break; }
|
314 |
-
$arrcode['nom-X'] = 0.381; // Nominal value for X-dim (bar width) in mm (2 X min. spec.)
|
315 |
-
$arrcode['nom-H'] = 10; // Nominal value for Height of Full bar in mm (non-spec.)
|
316 |
-
$arrcode['lightmL'] = 10; // LEFT light margin = x X-dim (spec.)
|
317 |
-
$arrcode['lightmR'] = 10; // RIGHT light margin = x X-dim (spec.)
|
318 |
-
$arrcode['lightTB'] = 2; // TOP/BOTTOM light margin = x X-dim (non-spec.) - used for bearer bars
|
319 |
-
break;
|
320 |
-
}
|
321 |
-
default: {
|
322 |
-
$this->barcode_array = false;
|
323 |
-
}
|
324 |
-
}
|
325 |
-
$this->barcode_array = $arrcode;
|
326 |
-
}
|
327 |
-
|
328 |
-
/**
|
329 |
-
* CODE 39 - ANSI MH10.8M-1983 - USD-3 - 3 of 9.
|
330 |
-
*/
|
331 |
-
protected function barcode_code39($code, $extended=false, $checksum=false) {
|
332 |
-
$chr['0'] = '111221211';
|
333 |
-
$chr['1'] = '211211112';
|
334 |
-
$chr['2'] = '112211112';
|
335 |
-
$chr['3'] = '212211111';
|
336 |
-
$chr['4'] = '111221112';
|
337 |
-
$chr['5'] = '211221111';
|
338 |
-
$chr['6'] = '112221111';
|
339 |
-
$chr['7'] = '111211212';
|
340 |
-
$chr['8'] = '211211211';
|
341 |
-
$chr['9'] = '112211211';
|
342 |
-
$chr['A'] = '211112112';
|
343 |
-
$chr['B'] = '112112112';
|
344 |
-
$chr['C'] = '212112111';
|
345 |
-
$chr['D'] = '111122112';
|
346 |
-
$chr['E'] = '211122111';
|
347 |
-
$chr['F'] = '112122111';
|
348 |
-
$chr['G'] = '111112212';
|
349 |
-
$chr['H'] = '211112211';
|
350 |
-
$chr['I'] = '112112211';
|
351 |
-
$chr['J'] = '111122211';
|
352 |
-
$chr['K'] = '211111122';
|
353 |
-
$chr['L'] = '112111122';
|
354 |
-
$chr['M'] = '212111121';
|
355 |
-
$chr['N'] = '111121122';
|
356 |
-
$chr['O'] = '211121121';
|
357 |
-
$chr['P'] = '112121121';
|
358 |
-
$chr['Q'] = '111111222';
|
359 |
-
$chr['R'] = '211111221';
|
360 |
-
$chr['S'] = '112111221';
|
361 |
-
$chr['T'] = '111121221';
|
362 |
-
$chr['U'] = '221111112';
|
363 |
-
$chr['V'] = '122111112';
|
364 |
-
$chr['W'] = '222111111';
|
365 |
-
$chr['X'] = '121121112';
|
366 |
-
$chr['Y'] = '221121111';
|
367 |
-
$chr['Z'] = '122121111';
|
368 |
-
$chr['-'] = '121111212';
|
369 |
-
$chr['.'] = '221111211';
|
370 |
-
$chr[' '] = '122111211';
|
371 |
-
$chr['$'] = '121212111';
|
372 |
-
$chr['/'] = '121211121';
|
373 |
-
$chr['+'] = '121112121';
|
374 |
-
$chr['%'] = '111212121';
|
375 |
-
$chr['*'] = '121121211';
|
376 |
-
|
377 |
-
$code = strtoupper($code);
|
378 |
-
if ($extended) {
|
379 |
-
// extended mode
|
380 |
-
$code = $this->encode_code39_ext($code);
|
381 |
-
}
|
382 |
-
if ($code === false) {
|
383 |
-
return false;
|
384 |
-
}
|
385 |
-
if ($checksum) {
|
386 |
-
// checksum
|
387 |
-
$checkdigit = $this->checksum_code39($code);
|
388 |
-
$code .= $checkdigit ;
|
389 |
-
}
|
390 |
-
// add start and stop codes
|
391 |
-
$code = '*'.$code.'*';
|
392 |
-
|
393 |
-
$bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array());
|
394 |
-
$k = 0;
|
395 |
-
$clen = strlen($code);
|
396 |
-
for ($i = 0; $i < $clen; ++$i) {
|
397 |
-
$char = $code[$i];
|
398 |
-
if(!isset($chr[$char])) {
|
399 |
-
// invalid character
|
400 |
-
return false;
|
401 |
-
}
|
402 |
-
for ($j = 0; $j < 9; ++$j) {
|
403 |
-
if (($j % 2) == 0) {
|
404 |
-
$t = true; // bar
|
405 |
-
} else {
|
406 |
-
$t = false; // space
|
407 |
-
}
|
408 |
-
$x = $chr[$char][$j];
|
409 |
-
if ($x == 2) { $w = $this->print_ratio; }
|
410 |
-
else { $w = 1; }
|
411 |
-
|
412 |
-
$bararray['bcode'][$k] = array('t' => $t, 'w' => $w, 'h' => 1, 'p' => 0);
|
413 |
-
$bararray['maxw'] += $w;
|
414 |
-
++$k;
|
415 |
-
}
|
416 |
-
$bararray['bcode'][$k] = array('t' => false, 'w' => 1, 'h' => 1, 'p' => 0);
|
417 |
-
$bararray['maxw'] += 1;
|
418 |
-
++$k;
|
419 |
-
}
|
420 |
-
$bararray['checkdigit'] = $checkdigit;
|
421 |
-
return $bararray;
|
422 |
-
}
|
423 |
-
|
424 |
-
/**
|
425 |
-
* Encode a string to be used for CODE 39 Extended mode.
|
426 |
-
*/
|
427 |
-
protected function encode_code39_ext($code) {
|
428 |
-
$encode = array(
|
429 |
-
chr(0) => '%U', chr(1) => '$A', chr(2) => '$B', chr(3) => '$C',
|
430 |
-
chr(4) => '$D', chr(5) => '$E', chr(6) => '$F', chr(7) => '$G',
|
431 |
-
chr(8) => '$H', chr(9) => '$I', chr(10) => '$J', chr(11) => '£K',
|
432 |
-
chr(12) => '$L', chr(13) => '$M', chr(14) => '$N', chr(15) => '$O',
|
433 |
-
chr(16) => '$P', chr(17) => '$Q', chr(18) => '$R', chr(19) => '$S',
|
434 |
-
chr(20) => '$T', chr(21) => '$U', chr(22) => '$V', chr(23) => '$W',
|
435 |
-
chr(24) => '$X', chr(25) => '$Y', chr(26) => '$Z', chr(27) => '%A',
|
436 |
-
chr(28) => '%B', chr(29) => '%C', chr(30) => '%D', chr(31) => '%E',
|
437 |
-
chr(32) => ' ', chr(33) => '/A', chr(34) => '/B', chr(35) => '/C',
|
438 |
-
chr(36) => '/D', chr(37) => '/E', chr(38) => '/F', chr(39) => '/G',
|
439 |
-
chr(40) => '/H', chr(41) => '/I', chr(42) => '/J', chr(43) => '/K',
|
440 |
-
chr(44) => '/L', chr(45) => '-', chr(46) => '.', chr(47) => '/O',
|
441 |
-
chr(48) => '0', chr(49) => '1', chr(50) => '2', chr(51) => '3',
|
442 |
-
chr(52) => '4', chr(53) => '5', chr(54) => '6', chr(55) => '7',
|
443 |
-
chr(56) => '8', chr(57) => '9', chr(58) => '/Z', chr(59) => '%F',
|
444 |
-
chr(60) => '%G', chr(61) => '%H', chr(62) => '%I', chr(63) => '%J',
|
445 |
-
chr(64) => '%V', chr(65) => 'A', chr(66) => 'B', chr(67) => 'C',
|
446 |
-
chr(68) => 'D', chr(69) => 'E', chr(70) => 'F', chr(71) => 'G',
|
447 |
-
chr(72) => 'H', chr(73) => 'I', chr(74) => 'J', chr(75) => 'K',
|
448 |
-
chr(76) => 'L', chr(77) => 'M', chr(78) => 'N', chr(79) => 'O',
|
449 |
-
chr(80) => 'P', chr(81) => 'Q', chr(82) => 'R', chr(83) => 'S',
|
450 |
-
chr(84) => 'T', chr(85) => 'U', chr(86) => 'V', chr(87) => 'W',
|
451 |
-
chr(88) => 'X', chr(89) => 'Y', chr(90) => 'Z', chr(91) => '%K',
|
452 |
-
chr(92) => '%L', chr(93) => '%M', chr(94) => '%N', chr(95) => '%O',
|
453 |
-
chr(96) => '%W', chr(97) => '+A', chr(98) => '+B', chr(99) => '+C',
|
454 |
-
chr(100) => '+D', chr(101) => '+E', chr(102) => '+F', chr(103) => '+G',
|
455 |
-
chr(104) => '+H', chr(105) => '+I', chr(106) => '+J', chr(107) => '+K',
|
456 |
-
chr(108) => '+L', chr(109) => '+M', chr(110) => '+N', chr(111) => '+O',
|
457 |
-
chr(112) => '+P', chr(113) => '+Q', chr(114) => '+R', chr(115) => '+S',
|
458 |
-
chr(116) => '+T', chr(117) => '+U', chr(118) => '+V', chr(119) => '+W',
|
459 |
-
chr(120) => '+X', chr(121) => '+Y', chr(122) => '+Z', chr(123) => '%P',
|
460 |
-
chr(124) => '%Q', chr(125) => '%R', chr(126) => '%S', chr(127) => '%T');
|
461 |
-
$code_ext = '';
|
462 |
-
$clen = strlen($code);
|
463 |
-
for ($i = 0 ; $i < $clen; ++$i) {
|
464 |
-
if (ord($code[$i]) > 127) {
|
465 |
-
return false;
|
466 |
-
}
|
467 |
-
$code_ext .= $encode[$code[$i]];
|
468 |
-
}
|
469 |
-
return $code_ext;
|
470 |
-
}
|
471 |
-
|
472 |
-
/**
|
473 |
-
* Calculate CODE 39 checksum (modulo 43).
|
474 |
-
*/
|
475 |
-
protected function checksum_code39($code) {
|
476 |
-
$chars = array(
|
477 |
-
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
|
478 |
-
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K',
|
479 |
-
'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V',
|
480 |
-
'W', 'X', 'Y', 'Z', '-', '.', ' ', '$', '/', '+', '%');
|
481 |
-
$sum = 0;
|
482 |
-
$clen = strlen($code);
|
483 |
-
for ($i = 0 ; $i < $clen; ++$i) {
|
484 |
-
$k = array_keys($chars, $code[$i]);
|
485 |
-
$sum += $k[0];
|
486 |
-
}
|
487 |
-
$j = ($sum % 43);
|
488 |
-
return $chars[$j];
|
489 |
-
}
|
490 |
-
|
491 |
-
/**
|
492 |
-
* CODE 93 - USS-93
|
493 |
-
* Compact code similar to Code 39
|
494 |
-
*/
|
495 |
-
protected function barcode_code93($code) {
|
496 |
-
$chr['0'] = '131112';
|
497 |
-
$chr['1'] = '111213';
|
498 |
-
$chr['2'] = '111312';
|
499 |
-
$chr['3'] = '111411';
|
500 |
-
$chr['4'] = '121113';
|
501 |
-
$chr['5'] = '121212';
|
502 |
-
$chr['6'] = '121311';
|
503 |
-
$chr['7'] = '111114';
|
504 |
-
$chr['8'] = '131211';
|
505 |
-
$chr['9'] = '141111';
|
506 |
-
$chr['A'] = '211113';
|
507 |
-
$chr['B'] = '211212';
|
508 |
-
$chr['C'] = '211311';
|
509 |
-
$chr['D'] = '221112';
|
510 |
-
$chr['E'] = '221211';
|
511 |
-
$chr['F'] = '231111';
|
512 |
-
$chr['G'] = '112113';
|
513 |
-
$chr['H'] = '112212';
|
514 |
-
$chr['I'] = '112311';
|
515 |
-
$chr['J'] = '122112';
|
516 |
-
$chr['K'] = '132111';
|
517 |
-
$chr['L'] = '111123';
|
518 |
-
$chr['M'] = '111222';
|
519 |
-
$chr['N'] = '111321';
|
520 |
-
$chr['O'] = '121122';
|
521 |
-
$chr['P'] = '131121';
|
522 |
-
$chr['Q'] = '212112';
|
523 |
-
$chr['R'] = '212211';
|
524 |
-
$chr['S'] = '211122';
|
525 |
-
$chr['T'] = '211221';
|
526 |
-
$chr['U'] = '221121';
|
527 |
-
$chr['V'] = '222111';
|
528 |
-
$chr['W'] = '112122';
|
529 |
-
$chr['X'] = '112221';
|
530 |
-
$chr['Y'] = '122121';
|
531 |
-
$chr['Z'] = '123111';
|
532 |
-
$chr['-'] = '121131';
|
533 |
-
$chr['.'] = '311112';
|
534 |
-
$chr[' '] = '311211';
|
535 |
-
$chr['$'] = '321111';
|
536 |
-
$chr['/'] = '112131';
|
537 |
-
$chr['+'] = '113121';
|
538 |
-
$chr['%'] = '211131';
|
539 |
-
$chr[128] = '121221'; // ($)
|
540 |
-
$chr[129] = '311121'; // (/)
|
541 |
-
$chr[130] = '122211'; // (+)
|
542 |
-
$chr[131] = '312111'; // (%)
|
543 |
-
$chr['*'] = '111141';
|
544 |
-
$code = strtoupper($code);
|
545 |
-
$encode = array(
|
546 |
-
chr(0) => chr(131).'U', chr(1) => chr(128).'A', chr(2) => chr(128).'B', chr(3) => chr(128).'C',
|
547 |
-
chr(4) => chr(128).'D', chr(5) => chr(128).'E', chr(6) => chr(128).'F', chr(7) => chr(128).'G',
|
548 |
-
chr(8) => chr(128).'H', chr(9) => chr(128).'I', chr(10) => chr(128).'J', chr(11) => '£K',
|
549 |
-
chr(12) => chr(128).'L', chr(13) => chr(128).'M', chr(14) => chr(128).'N', chr(15) => chr(128).'O',
|
550 |
-
chr(16) => chr(128).'P', chr(17) => chr(128).'Q', chr(18) => chr(128).'R', chr(19) => chr(128).'S',
|
551 |
-
chr(20) => chr(128).'T', chr(21) => chr(128).'U', chr(22) => chr(128).'V', chr(23) => chr(128).'W',
|
552 |
-
chr(24) => chr(128).'X', chr(25) => chr(128).'Y', chr(26) => chr(128).'Z', chr(27) => chr(131).'A',
|
553 |
-
chr(28) => chr(131).'B', chr(29) => chr(131).'C', chr(30) => chr(131).'D', chr(31) => chr(131).'E',
|
554 |
-
chr(32) => ' ', chr(33) => chr(129).'A', chr(34) => chr(129).'B', chr(35) => chr(129).'C',
|
555 |
-
chr(36) => chr(129).'D', chr(37) => chr(129).'E', chr(38) => chr(129).'F', chr(39) => chr(129).'G',
|
556 |
-
chr(40) => chr(129).'H', chr(41) => chr(129).'I', chr(42) => chr(129).'J', chr(43) => chr(129).'K',
|
557 |
-
chr(44) => chr(129).'L', chr(45) => '-', chr(46) => '.', chr(47) => chr(129).'O',
|
558 |
-
chr(48) => '0', chr(49) => '1', chr(50) => '2', chr(51) => '3',
|
559 |
-
chr(52) => '4', chr(53) => '5', chr(54) => '6', chr(55) => '7',
|
560 |
-
chr(56) => '8', chr(57) => '9', chr(58) => chr(129).'Z', chr(59) => chr(131).'F',
|
561 |
-
chr(60) => chr(131).'G', chr(61) => chr(131).'H', chr(62) => chr(131).'I', chr(63) => chr(131).'J',
|
562 |
-
chr(64) => chr(131).'V', chr(65) => 'A', chr(66) => 'B', chr(67) => 'C',
|
563 |
-
chr(68) => 'D', chr(69) => 'E', chr(70) => 'F', chr(71) => 'G',
|
564 |
-
chr(72) => 'H', chr(73) => 'I', chr(74) => 'J', chr(75) => 'K',
|
565 |
-
chr(76) => 'L', chr(77) => 'M', chr(78) => 'N', chr(79) => 'O',
|
566 |
-
chr(80) => 'P', chr(81) => 'Q', chr(82) => 'R', chr(83) => 'S',
|
567 |
-
chr(84) => 'T', chr(85) => 'U', chr(86) => 'V', chr(87) => 'W',
|
568 |
-
chr(88) => 'X', chr(89) => 'Y', chr(90) => 'Z', chr(91) => chr(131).'K',
|
569 |
-
chr(92) => chr(131).'L', chr(93) => chr(131).'M', chr(94) => chr(131).'N', chr(95) => chr(131).'O',
|
570 |
-
chr(96) => chr(131).'W', chr(97) => chr(130).'A', chr(98) => chr(130).'B', chr(99) => chr(130).'C',
|
571 |
-
chr(100) => chr(130).'D', chr(101) => chr(130).'E', chr(102) => chr(130).'F', chr(103) => chr(130).'G',
|
572 |
-
chr(104) => chr(130).'H', chr(105) => chr(130).'I', chr(106) => chr(130).'J', chr(107) => chr(130).'K',
|
573 |
-
chr(108) => chr(130).'L', chr(109) => chr(130).'M', chr(110) => chr(130).'N', chr(111) => chr(130).'O',
|
574 |
-
chr(112) => chr(130).'P', chr(113) => chr(130).'Q', chr(114) => chr(130).'R', chr(115) => chr(130).'S',
|
575 |
-
chr(116) => chr(130).'T', chr(117) => chr(130).'U', chr(118) => chr(130).'V', chr(119) => chr(130).'W',
|
576 |
-
chr(120) => chr(130).'X', chr(121) => chr(130).'Y', chr(122) => chr(130).'Z', chr(123) => chr(131).'P',
|
577 |
-
chr(124) => chr(131).'Q', chr(125) => chr(131).'R', chr(126) => chr(131).'S', chr(127) => chr(131).'T');
|
578 |
-
$code_ext = '';
|
579 |
-
$clen = strlen($code);
|
580 |
-
for ($i = 0 ; $i < $clen; ++$i) {
|
581 |
-
if (ord($code[$i]) > 127) {
|
582 |
-
return false;
|
583 |
-
}
|
584 |
-
$code_ext .= $encode[$code[$i]];
|
585 |
-
}
|
586 |
-
// checksum
|
587 |
-
$checkdigit = $this->checksum_code93($code);
|
588 |
-
$code .= $checkdigit ;
|
589 |
-
// add start and stop codes
|
590 |
-
$code = '*'.$code.'*';
|
591 |
-
$bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array());
|
592 |
-
$k = 0;
|
593 |
-
$clen = strlen($code);
|
594 |
-
for ($i = 0; $i < $clen; ++$i) {
|
595 |
-
$char = $code[$i];
|
596 |
-
if(!isset($chr[$char])) {
|
597 |
-
// invalid character
|
598 |
-
return false;
|
599 |
-
}
|
600 |
-
for ($j = 0; $j < 6; ++$j) {
|
601 |
-
if (($j % 2) == 0) {
|
602 |
-
$t = true; // bar
|
603 |
-
} else {
|
604 |
-
$t = false; // space
|
605 |
-
}
|
606 |
-
$w = $chr[$char][$j];
|
607 |
-
$bararray['bcode'][$k] = array('t' => $t, 'w' => $w, 'h' => 1, 'p' => 0);
|
608 |
-
$bararray['maxw'] += $w;
|
609 |
-
++$k;
|
610 |
-
}
|
611 |
-
}
|
612 |
-
$bararray['bcode'][$k] = array('t' => true, 'w' => 1, 'h' => 1, 'p' => 0);
|
613 |
-
$bararray['maxw'] += 1;
|
614 |
-
++$k;
|
615 |
-
$bararray['checkdigit'] = $checkdigit;
|
616 |
-
return $bararray;
|
617 |
-
}
|
618 |
-
|
619 |
-
/**
|
620 |
-
* Calculate CODE 93 checksum (modulo 47).
|
621 |
-
*/
|
622 |
-
protected function checksum_code93($code) {
|
623 |
-
$chars = array(
|
624 |
-
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
|
625 |
-
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K',
|
626 |
-
'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V',
|
627 |
-
'W', 'X', 'Y', 'Z', '-', '.', ' ', '$', '/', '+', '%');
|
628 |
-
// translate special characters
|
629 |
-
$code = strtr($code, chr(128).chr(129).chr(130).chr(131), '$/+%');
|
630 |
-
$len = strlen($code);
|
631 |
-
// calculate check digit C
|
632 |
-
$p = 1;
|
633 |
-
$check = 0;
|
634 |
-
for ($i = ($len - 1); $i >= 0; --$i) {
|
635 |
-
$k = array_keys($chars, $code[$i]);
|
636 |
-
$check += ($k[0] * $p);
|
637 |
-
++$p;
|
638 |
-
if ($p > 20) {
|
639 |
-
$p = 1;
|
640 |
-
}
|
641 |
-
}
|
642 |
-
$check %= 47;
|
643 |
-
$c = $chars[$check];
|
644 |
-
$code .= $c;
|
645 |
-
// calculate check digit K
|
646 |
-
$p = 1;
|
647 |
-
$check = 0;
|
648 |
-
for ($i = $len; $i >= 0; --$i) {
|
649 |
-
$k = array_keys($chars, $code[$i]);
|
650 |
-
$check += ($k[0] * $p);
|
651 |
-
++$p;
|
652 |
-
if ($p > 15) {
|
653 |
-
$p = 1;
|
654 |
-
}
|
655 |
-
}
|
656 |
-
$check %= 47;
|
657 |
-
$k = $chars[$check];
|
658 |
-
return $c.$k;
|
659 |
-
}
|
660 |
-
|
661 |
-
/**
|
662 |
-
* Checksum for standard 2 of 5 barcodes.
|
663 |
-
*/
|
664 |
-
protected function checksum_s25($code) {
|
665 |
-
$len = strlen($code);
|
666 |
-
$sum = 0;
|
667 |
-
for ($i = 0; $i < $len; $i+=2) {
|
668 |
-
$sum += $code[$i];
|
669 |
-
}
|
670 |
-
$sum *= 3;
|
671 |
-
for ($i = 1; $i < $len; $i+=2) {
|
672 |
-
$sum += ($code[$i]);
|
673 |
-
}
|
674 |
-
$r = $sum % 10;
|
675 |
-
if($r > 0) {
|
676 |
-
$r = (10 - $r);
|
677 |
-
}
|
678 |
-
return $r;
|
679 |
-
}
|
680 |
-
|
681 |
-
/**
|
682 |
-
* MSI.
|
683 |
-
* Variation of Plessey code, with similar applications
|
684 |
-
* Contains digits (0 to 9) and encodes the data only in the width of bars.
|
685 |
-
*/
|
686 |
-
protected function barcode_msi($code, $checksum=false) {
|
687 |
-
$chr['0'] = '100100100100';
|
688 |
-
$chr['1'] = '100100100110';
|
689 |
-
$chr['2'] = '100100110100';
|
690 |
-
$chr['3'] = '100100110110';
|
691 |
-
$chr['4'] = '100110100100';
|
692 |
-
$chr['5'] = '100110100110';
|
693 |
-
$chr['6'] = '100110110100';
|
694 |
-
$chr['7'] = '100110110110';
|
695 |
-
$chr['8'] = '110100100100';
|
696 |
-
$chr['9'] = '110100100110';
|
697 |
-
$chr['A'] = '110100110100';
|
698 |
-
$chr['B'] = '110100110110';
|
699 |
-
$chr['C'] = '110110100100';
|
700 |
-
$chr['D'] = '110110100110';
|
701 |
-
$chr['E'] = '110110110100';
|
702 |
-
$chr['F'] = '110110110110';
|
703 |
-
if ($checksum) {
|
704 |
-
// add checksum
|
705 |
-
$clen = strlen($code);
|
706 |
-
$p = 2;
|
707 |
-
$check = 0;
|
708 |
-
for ($i = ($clen - 1); $i >= 0; --$i) {
|
709 |
-
$check += (hexdec($code[$i]) * $p);
|
710 |
-
++$p;
|
711 |
-
if ($p > 7) {
|
712 |
-
$p = 2;
|
713 |
-
}
|
714 |
-
}
|
715 |
-
$check %= 11;
|
716 |
-
if ($check > 0) {
|
717 |
-
$check = 11 - $check;
|
718 |
-
}
|
719 |
-
$code .= $check;
|
720 |
-
$checkdigit = $check;
|
721 |
-
}
|
722 |
-
$seq = '110'; // left guard
|
723 |
-
$clen = strlen($code);
|
724 |
-
for ($i = 0; $i < $clen; ++$i) {
|
725 |
-
$digit = $code[$i];
|
726 |
-
if (!isset($chr[$digit])) {
|
727 |
-
// invalid character
|
728 |
-
return false;
|
729 |
-
}
|
730 |
-
$seq .= $chr[$digit];
|
731 |
-
}
|
732 |
-
$seq .= '1001'; // right guard
|
733 |
-
$bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array());
|
734 |
-
$bararray['checkdigit'] = $checkdigit;
|
735 |
-
return $this->binseq_to_array($seq, $bararray);
|
736 |
-
}
|
737 |
-
|
738 |
-
/**
|
739 |
-
* Standard 2 of 5 barcodes.
|
740 |
-
* Used in airline ticket marking, photofinishing
|
741 |
-
* Contains digits (0 to 9) and encodes the data only in the width of bars.
|
742 |
-
*/
|
743 |
-
protected function barcode_s25($code, $checksum=false) {
|
744 |
-
$chr['0'] = '10101110111010';
|
745 |
-
$chr['1'] = '11101010101110';
|
746 |
-
$chr['2'] = '10111010101110';
|
747 |
-
$chr['3'] = '11101110101010';
|
748 |
-
$chr['4'] = '10101110101110';
|
749 |
-
$chr['5'] = '11101011101010';
|
750 |
-
$chr['6'] = '10111011101010';
|
751 |
-
$chr['7'] = '10101011101110';
|
752 |
-
$chr['8'] = '10101110111010';
|
753 |
-
$chr['9'] = '10111010111010';
|
754 |
-
if ($checksum) {
|
755 |
-
// add checksum
|
756 |
-
$checkdigit = $this->checksum_s25($code);
|
757 |
-
$code .= $checkdigit ;
|
758 |
-
}
|
759 |
-
if((strlen($code) % 2) != 0) {
|
760 |
-
// add leading zero if code-length is odd
|
761 |
-
$code = '0'.$code;
|
762 |
-
}
|
763 |
-
$seq = '11011010';
|
764 |
-
$clen = strlen($code);
|
765 |
-
for ($i = 0; $i < $clen; ++$i) {
|
766 |
-
$digit = $code[$i];
|
767 |
-
if (!isset($chr[$digit])) {
|
768 |
-
// invalid character
|
769 |
-
return false;
|
770 |
-
}
|
771 |
-
$seq .= $chr[$digit];
|
772 |
-
}
|
773 |
-
$seq .= '1101011';
|
774 |
-
$bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array());
|
775 |
-
$bararray['checkdigit'] = $checkdigit;
|
776 |
-
return $this->binseq_to_array($seq, $bararray);
|
777 |
-
}
|
778 |
-
|
779 |
-
/**
|
780 |
-
* Convert binary barcode sequence to barcode array
|
781 |
-
*/
|
782 |
-
protected function binseq_to_array($seq, $bararray) {
|
783 |
-
$len = strlen($seq);
|
784 |
-
$w = 0;
|
785 |
-
$k = 0;
|
786 |
-
for ($i = 0; $i < $len; ++$i) {
|
787 |
-
$w += 1;
|
788 |
-
if (($i == ($len - 1)) OR (($i < ($len - 1)) AND ($seq[$i] != $seq[($i+1)]))) {
|
789 |
-
if ($seq[$i] == '1') {
|
790 |
-
$t = true; // bar
|
791 |
-
} else {
|
792 |
-
$t = false; // space
|
793 |
-
}
|
794 |
-
$bararray['bcode'][$k] = array('t' => $t, 'w' => $w, 'h' => 1, 'p' => 0);
|
795 |
-
$bararray['maxw'] += $w;
|
796 |
-
++$k;
|
797 |
-
$w = 0;
|
798 |
-
}
|
799 |
-
}
|
800 |
-
return $bararray;
|
801 |
-
}
|
802 |
-
|
803 |
-
/**
|
804 |
-
* Interleaved 2 of 5 barcodes.
|
805 |
-
* Compact numeric code, widely used in industry, air cargo
|
806 |
-
* Contains digits (0 to 9) and encodes the data in the width of both bars and spaces.
|
807 |
-
*/
|
808 |
-
protected function barcode_i25($code, $checksum=false) {
|
809 |
-
$chr['0'] = '11221';
|
810 |
-
$chr['1'] = '21112';
|
811 |
-
$chr['2'] = '12112';
|
812 |
-
$chr['3'] = '22111';
|
813 |
-
$chr['4'] = '11212';
|
814 |
-
$chr['5'] = '21211';
|
815 |
-
$chr['6'] = '12211';
|
816 |
-
$chr['7'] = '11122';
|
817 |
-
$chr['8'] = '21121';
|
818 |
-
$chr['9'] = '12121';
|
819 |
-
$chr['A'] = '11';
|
820 |
-
$chr['Z'] = '21';
|
821 |
-
if ($checksum) {
|
822 |
-
// add checksum
|
823 |
-
$checkdigit = $this->checksum_s25($code);
|
824 |
-
$code .= $checkdigit ;
|
825 |
-
}
|
826 |
-
if((strlen($code) % 2) != 0) {
|
827 |
-
// add leading zero if code-length is odd
|
828 |
-
$code = '0'.$code;
|
829 |
-
}
|
830 |
-
// add start and stop codes
|
831 |
-
$code = 'AA'.strtolower($code).'ZA';
|
832 |
-
|
833 |
-
$bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array());
|
834 |
-
$k = 0;
|
835 |
-
$clen = strlen($code);
|
836 |
-
for ($i = 0; $i < $clen; $i = ($i + 2)) {
|
837 |
-
$char_bar = $code[$i];
|
838 |
-
$char_space = $code[$i+1];
|
839 |
-
if((!isset($chr[$char_bar])) OR (!isset($chr[$char_space]))) {
|
840 |
-
// invalid character
|
841 |
-
return false;
|
842 |
-
}
|
843 |
-
// create a bar-space sequence
|
844 |
-
$seq = '';
|
845 |
-
$chrlen = strlen($chr[$char_bar]);
|
846 |
-
for ($s = 0; $s < $chrlen; $s++){
|
847 |
-
$seq .= $chr[$char_bar][$s] . $chr[$char_space][$s];
|
848 |
-
}
|
849 |
-
$seqlen = strlen($seq);
|
850 |
-
for ($j = 0; $j < $seqlen; ++$j) {
|
851 |
-
if (($j % 2) == 0) {
|
852 |
-
$t = true; // bar
|
853 |
-
} else {
|
854 |
-
$t = false; // space
|
855 |
-
}
|
856 |
-
$x = $seq[$j];
|
857 |
-
if ($x == 2) { $w = $this->print_ratio; }
|
858 |
-
else { $w = 1; }
|
859 |
-
|
860 |
-
$bararray['bcode'][$k] = array('t' => $t, 'w' => $w, 'h' => 1, 'p' => 0);
|
861 |
-
$bararray['maxw'] += $w;
|
862 |
-
++$k;
|
863 |
-
}
|
864 |
-
}
|
865 |
-
$bararray['checkdigit'] = $checkdigit;
|
866 |
-
return $bararray;
|
867 |
-
}
|
868 |
-
|
869 |
-
/**
|
870 |
-
* C128 barcodes.
|
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
1068" type="C128A" />
|
875 |
-
$chr = array(
|
876 |
-
'212222', /* 00 */
|
877 |
-
'222122', /* 01 */
|
878 |
-
'222221', /* 02 */
|
879 |
-
'121223', /* 03 */
|
880 |
-
'121322', /* 04 */
|
881 |
-
'131222', /* 05 */
|
882 |
-
'122213', /* 06 */
|
883 |
-
'122312', /* 07 */
|
884 |
-
'132212', /* 08 */
|
885 |
-
'221213', /* 09 */
|
886 |
-
'221312', /* 10 */
|
887 |
-
'231212', /* 11 */
|
888 |
-
'112232', /* 12 */
|
889 |
-
'122132', /* 13 */
|
890 |
-
'122231', /* 14 */
|
891 |
-
'113222', /* 15 */
|
892 |
-
'123122', /* 16 */
|
893 |
-
'123221', /* 17 */
|
894 |
-
'223211', /* 18 */
|
895 |
-
'221132', /* 19 */
|
896 |
-
'221231', /* 20 */
|
897 |
-
'213212', /* 21 */
|
898 |
-
'223112', /* 22 */
|
899 |
-
'312131', /* 23 */
|
900 |
-
'311222', /* 24 */
|
901 |
-
'321122', /* 25 */
|
902 |
-
'321221', /* 26 */
|
903 |
-
'312212', /* 27 */
|
904 |
-
'322112', /* 28 */
|
905 |
-
'322211', /* 29 */
|
906 |
-
'212123', /* 30 */
|
907 |
-
'212321', /* 31 */
|
908 |
-
'232121', /* 32 */
|
909 |
-
'111323', /* 33 */
|
910 |
-
'131123', /* 34 */
|
911 |
-
'131321', /* 35 */
|
912 |
-
'112313', /* 36 */
|
913 |
-
'132113', /* 37 */
|
914 |
-
'132311', /* 38 */
|
915 |
-
'211313', /* 39 */
|
916 |
-
'231113', /* 40 */
|
917 |
-
'231311', /* 41 */
|
918 |
-
'112133', /* 42 */
|
919 |
-
'112331', /* 43 */
|
920 |
-
'132131', /* 44 */
|
921 |
-
'113123', /* 45 */
|
922 |
-
'113321', /* 46 */
|
923 |
-
'133121', /* 47 */
|
924 |
-
'313121', /* 48 */
|
925 |
-
'211331', /* 49 */
|
926 |
-
'231131', /* 50 */
|
927 |
-
'213113', /* 51 */
|
928 |
-
'213311', /* 52 */
|
929 |
-
'213131', /* 53 */
|
930 |
-
'311123', /* 54 */
|
931 |
-
'311321', /* 55 */
|
932 |
-
'331121', /* 56 */
|
933 |
-
'312113', /* 57 */
|
934 |
-
'312311', /* 58 */
|
935 |
-
'332111', /* 59 */
|
936 |
-
'314111', /* 60 */
|
937 |
-
'221411', /* 61 */
|
938 |
-
'431111', /* 62 */
|
939 |
-
'111224', /* 63 */
|
940 |
-
'111422', /* 64 */
|
941 |
-
'121124', /* 65 */
|
942 |
-
'121421', /* 66 */
|
943 |
-
'141122', /* 67 */
|
944 |
-
'141221', /* 68 */
|
945 |
-
'112214', /* 69 */
|
946 |
-
'112412', /* 70 */
|
947 |
-
'122114', /* 71 */
|
948 |
-
'122411', /* 72 */
|
949 |
-
'142112', /* 73 */
|
950 |
-
'142211', /* 74 */
|
951 |
-
'241211', /* 75 */
|
952 |
-
'221114', /* 76 */
|
953 |
-
'413111', /* 77 */
|
954 |
-
'241112', /* 78 */
|
955 |
-
'134111', /* 79 */
|
956 |
-
'111242', /* 80 */
|
957 |
-
'121142', /* 81 */
|
958 |
-
'121241', /* 82 */
|
959 |
-
'114212', /* 83 */
|
960 |
-
'124112', /* 84 */
|
961 |
-
'124211', /* 85 */
|
962 |
-
'411212', /* 86 */
|
963 |
-
'421112', /* 87 */
|
964 |
-
'421211', /* 88 */
|
965 |
-
'212141', /* 89 */
|
966 |
-
'214121', /* 90 */
|
967 |
-
'412121', /* 91 */
|
968 |
-
'111143', /* 92 */
|
969 |
-
'111341', /* 93 */
|
970 |
-
'131141', /* 94 */
|
971 |
-
'114113', /* 95 */
|
972 |
-
'114311', /* 96 */
|
973 |
-
'411113', /* 97 */
|
974 |
-
'411311', /* 98 */
|
975 |
-
'113141', /* 99 */
|
976 |
-
'114131', /* 100 */
|
977 |
-
'311141', /* 101 */
|
978 |
-
'411131', /* 102 */
|
979 |
-
'211412', /* 103 START A */
|
980 |
-
'211214', /* 104 START B */
|
981 |
-
'211232', /* 105 START C */
|
982 |
-
'233111', /* STOP */
|
983 |
-
'200000' /* END */
|
984 |
-
);
|
985 |
-
$keys = '';
|
986 |
-
switch(strtoupper($type)) {
|
987 |
-
case 'A': {
|
988 |
-
$startid = 103;
|
989 |
-
$keys = ' !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_';
|
990 |
-
for ($i = 0; $i < 32; ++$i) {
|
991 |
-
$keys .= chr($i);
|
992 |
-
}
|
993 |
-
break;
|
994 |
-
}
|
995 |
-
case 'B': {
|
996 |
-
$startid = 104;
|
997 |
-
$keys = ' !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~'.chr(127);
|
998 |
-
break;
|
999 |
-
}
|
1000 |
-
case 'C': {
|
1001 |
-
$startid = 105;
|
1002 |
-
$keys = '';
|
1003 |
-
if ((strlen($code) % 2) != 0) {
|
1004 |
-
// The length of barcode value must be even ($code). You must pad the number with zeros
|
1005 |
-
return false;
|
1006 |
-
}
|
1007 |
-
for ($i = 0; $i <= 99; ++$i) {
|
1008 |
-
$keys .= chr($i);
|
1009 |
-
}
|
1010 |
-
$new_code = '';
|
1011 |
-
$hclen = (strlen($code) / 2);
|
1012 |
-
for ($i = 0; $i < $hclen; ++$i) {
|
1013 |
-
$new_code .= chr(intval($code{(2 * $i)}.$code{(2 * $i + 1)}));
|
1014 |
-
}
|
1015 |
-
$code = $new_code;
|
1016 |
-
break;
|
1017 |
-
}
|
1018 |
-
default: {
|
1019 |
-
return false;
|
1020 |
-
}
|
1021 |
-
}
|
1022 |
-
|
1023 |
-
// calculate check character
|
1024 |
-
$sum = $startid;
|
1025 |
-
if ($ean) { $code = chr(102) . $code; } // Add FNC 1 - which identifies it as EAN-128
|
1026 |
-
$clen = strlen($code);
|
1027 |
-
for ($i = 0; $i < $clen; ++$i) {
|
1028 |
-
if ($ean && $i==0) { $sum += 102; }
|
1029 |
-
else { $sum += (strpos($keys, $code[$i]) * ($i+1)); }
|
1030 |
-
}
|
1031 |
-
$check = ($sum % 103);
|
1032 |
-
$checkdigit = $check ;
|
1033 |
-
// add start, check and stop codes
|
1034 |
-
$code = chr($startid).$code.chr($check).chr(106).chr(107);
|
1035 |
-
$bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array());
|
1036 |
-
$k = 0;
|
1037 |
-
$len = strlen($code);
|
1038 |
-
for ($i = 0; $i < $len; ++$i) {
|
1039 |
-
$ck = strpos($keys, $code[$i]);
|
1040 |
-
if (($i == 0) || ($ean && $i==1) | ($i > ($len-4))) {
|
1041 |
-
$char_num = ord($code[$i]);
|
1042 |
-
$seq = $chr[$char_num];
|
1043 |
-
} elseif(($ck >= 0) AND isset($chr[$ck])) {
|
1044 |
-
$seq = $chr[$ck];
|
1045 |
-
} else {
|
1046 |
-
// invalid character
|
1047 |
-
return false;
|
1048 |
-
}
|
1049 |
-
for ($j = 0; $j < 6; ++$j) {
|
1050 |
-
if (($j % 2) == 0) {
|
1051 |
-
$t = true; // bar
|
1052 |
-
} else {
|
1053 |
-
$t = false; // space
|
1054 |
-
}
|
1055 |
-
$w = $seq[$j];
|
1056 |
-
$bararray['bcode'][$k] = array('t' => $t, 'w' => $w, 'h' => 1, 'p' => 0);
|
1057 |
-
$bararray['maxw'] += $w;
|
1058 |
-
++$k;
|
1059 |
-
}
|
1060 |
-
}
|
1061 |
-
$bararray['checkdigit'] = $checkdigit;
|
1062 |
-
return $bararray;
|
1063 |
-
}
|
1064 |
-
|
1065 |
-
/**
|
1066 |
-
* EAN13 and UPC-A barcodes.
|
1067 |
-
* EAN13: European Article Numbering international retail product code
|
1068 |
-
* UPC-A: Universal product code seen on almost all retail products in the USA and Canada
|
1069 |
-
* UPC-E: Short version of UPC symbol
|
1070 |
-
*/
|
1071 |
-
protected function barcode_eanupc($code, $len=13) {
|
1072 |
-
$upce = false;
|
1073 |
-
$checkdigit = false;
|
1074 |
-
if ($len == 6) {
|
1075 |
-
$len = 12; // UPC-A
|
1076 |
-
$upce = true; // UPC-E mode
|
1077 |
-
}
|
1078 |
-
$data_len = $len - 1;
|
1079 |
-
//Padding
|
1080 |
-
$code = str_pad($code, $data_len, '0', STR_PAD_LEFT);
|
1081 |
-
$code_len = strlen($code);
|
1082 |
-
// calculate check digit
|
1083 |
-
$sum_a = 0;
|
1084 |
-
for ($i = 1; $i < $data_len; $i+=2) {
|
1085 |
-
$sum_a += $code[$i];
|
1086 |
-
}
|
1087 |
-
if ($len > 12) {
|
1088 |
-
$sum_a *= 3;
|
1089 |
-
}
|
1090 |
-
$sum_b = 0;
|
1091 |
-
for ($i = 0; $i < $data_len; $i+=2) {
|
1092 |
-
$sum_b += ($code[$i]);
|
1093 |
-
}
|
1094 |
-
if ($len < 13) {
|
1095 |
-
$sum_b *= 3;
|
1096 |
-
}
|
1097 |
-
$r = ($sum_a + $sum_b) % 10;
|
1098 |
-
if($r > 0) {
|
1099 |
-
$r = (10 - $r);
|
1100 |
-
}
|
1101 |
-
if ($code_len == $data_len) {
|
1102 |
-
// add check digit
|
1103 |
-
$code .= $r;
|
1104 |
-
$checkdigit = $r;
|
1105 |
-
} elseif ($r !== intval($code[$data_len])) {
|
1106 |
-
// wrong checkdigit
|
1107 |
-
return false;
|
1108 |
-
}
|
1109 |
-
if ($len == 12) {
|
1110 |
-
// UPC-A
|
1111 |
-
$code = '0'.$code;
|
1112 |
-
++$len;
|
1113 |
-
}
|
1114 |
-
if ($upce) {
|
1115 |
-
// convert UPC-A to UPC-E
|
1116 |
-
$tmp = substr($code, 4, 3);
|
1117 |
-
$prod_code = intval(substr($code,7,5)); // product code
|
1118 |
-
$invalid_upce = false;
|
1119 |
-
if (($tmp == '000') OR ($tmp == '100') OR ($tmp == '200')) {
|
1120 |
-
// manufacturer code ends in 000, 100, or 200
|
1121 |
-
$upce_code = substr($code, 2, 2).substr($code, 9, 3).substr($code, 4, 1);
|
1122 |
-
if ($prod_code > 999) { $invalid_upce = true; }
|
1123 |
-
} else {
|
1124 |
-
$tmp = substr($code, 5, 2);
|
1125 |
-
if ($tmp == '00') {
|
1126 |
-
// manufacturer code ends in 00
|
1127 |
-
$upce_code = substr($code, 2, 3).substr($code, 10, 2).'3';
|
1128 |
-
if ($prod_code > 99) { $invalid_upce = true; }
|
1129 |
-
} else {
|
1130 |
-
$tmp = substr($code, 6, 1);
|
1131 |
-
if ($tmp == '0') {
|
1132 |
-
// manufacturer code ends in 0
|
1133 |
-
$upce_code = substr($code, 2, 4).substr($code, 11, 1).'4';
|
1134 |
-
if ($prod_code > 9) { $invalid_upce = true; }
|
1135 |
-
} else {
|
1136 |
-
// manufacturer code does not end in zero
|
1137 |
-
$upce_code = substr($code, 2, 5).substr($code, 11, 1);
|
1138 |
-
if ($prod_code > 9) { $invalid_upce = true; }
|
1139 |
-
}
|
1140 |
-
}
|
1141 |
-
}
|
1142 |
-
if ($invalid_upce) { die("Error - UPC-A cannot produce a valid UPC-E barcode"); } // Error generating a UPCE code
|
1143 |
-
}
|
1144 |
-
//Convert digits to bars
|
1145 |
-
$codes = array(
|
1146 |
-
'A'=>array( // left odd parity
|
1147 |
-
'0'=>'0001101',
|
1148 |
-
'1'=>'0011001',
|
1149 |
-
'2'=>'0010011',
|
1150 |
-
'3'=>'0111101',
|
1151 |
-
'4'=>'0100011',
|
1152 |
-
'5'=>'0110001',
|
1153 |
-
'6'=>'0101111',
|
1154 |
-
'7'=>'0111011',
|
1155 |
-
'8'=>'0110111',
|
1156 |
-
'9'=>'0001011'),
|
1157 |
-
'B'=>array( // left even parity
|
1158 |
-
'0'=>'0100111',
|
1159 |
-
'1'=>'0110011',
|
1160 |
-
'2'=>'0011011',
|
1161 |
-
'3'=>'0100001',
|
1162 |
-
'4'=>'0011101',
|
1163 |
-
'5'=>'0111001',
|
1164 |
-
'6'=>'0000101',
|
1165 |
-
'7'=>'0010001',
|
1166 |
-
'8'=>'0001001',
|
1167 |
-
'9'=>'0010111'),
|
1168 |
-
'C'=>array( // right
|
1169 |
-
'0'=>'1110010',
|
1170 |
-
'1'=>'1100110',
|
1171 |
-
'2'=>'1101100',
|
1172 |
-
'3'=>'1000010',
|
1173 |
-
'4'=>'1011100',
|
1174 |
-
'5'=>'1001110',
|
1175 |
-
'6'=>'1010000',
|
1176 |
-
'7'=>'1000100',
|
1177 |
-
'8'=>'1001000',
|
1178 |
-
'9'=>'1110100')
|
1179 |
-
);
|
1180 |
-
$parities = array(
|
1181 |
-
'0'=>array('A','A','A','A','A','A'),
|
1182 |
-
'1'=>array('A','A','B','A','B','B'),
|
1183 |
-
'2'=>array('A','A','B','B','A','B'),
|
1184 |
-
'3'=>array('A','A','B','B','B','A'),
|
1185 |
-
'4'=>array('A','B','A','A','B','B'),
|
1186 |
-
'5'=>array('A','B','B','A','A','B'),
|
1187 |
-
'6'=>array('A','B','B','B','A','A'),
|
1188 |
-
'7'=>array('A','B','A','B','A','B'),
|
1189 |
-
'8'=>array('A','B','A','B','B','A'),
|
1190 |
-
'9'=>array('A','B','B','A','B','A')
|
1191 |
-
);
|
1192 |
-
$upce_parities = array();
|
1193 |
-
$upce_parities[0] = array(
|
1194 |
-
'0'=>array('B','B','B','A','A','A'),
|
1195 |
-
'1'=>array('B','B','A','B','A','A'),
|
1196 |
-
'2'=>array('B','B','A','A','B','A'),
|
1197 |
-
'3'=>array('B','B','A','A','A','B'),
|
1198 |
-
'4'=>array('B','A','B','B','A','A'),
|
1199 |
-
'5'=>array('B','A','A','B','B','A'),
|
1200 |
-
'6'=>array('B','A','A','A','B','B'),
|
1201 |
-
'7'=>array('B','A','B','A','B','A'),
|
1202 |
-
'8'=>array('B','A','B','A','A','B'),
|
1203 |
-
'9'=>array('B','A','A','B','A','B')
|
1204 |
-
);
|
1205 |
-
$upce_parities[1] = array(
|
1206 |
-
'0'=>array('A','A','A','B','B','B'),
|
1207 |
-
'1'=>array('A','A','B','A','B','B'),
|
1208 |
-
'2'=>array('A','A','B','B','A','B'),
|
1209 |
-
'3'=>array('A','A','B','B','B','A'),
|
1210 |
-
'4'=>array('A','B','A','A','B','B'),
|
1211 |
-
'5'=>array('A','B','B','A','A','B'),
|
1212 |
-
'6'=>array('A','B','B','B','A','A'),
|
1213 |
-
'7'=>array('A','B','A','B','A','B'),
|
1214 |
-
'8'=>array('A','B','A','B','B','A'),
|
1215 |
-
'9'=>array('A','B','B','A','B','A')
|
1216 |
-
);
|
1217 |
-
$k = 0;
|
1218 |
-
$seq = '101'; // left guard bar
|
1219 |
-
if ($upce) {
|
1220 |
-
$bararray = array('code' => $upce_code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array());
|
1221 |
-
$p = $upce_parities[$code{1}][$r];
|
1222 |
-
for ($i = 0; $i < 6; ++$i) {
|
1223 |
-
$seq .= $codes[$p[$i]][$upce_code[$i]];
|
1224 |
-
}
|
1225 |
-
$seq .= '010101'; // right guard bar
|
1226 |
-
} else {
|
1227 |
-
$bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array());
|
1228 |
-
$half_len = ceil($len / 2);
|
1229 |
-
if ($len == 8) {
|
1230 |
-
for ($i = 0; $i < $half_len; ++$i) {
|
1231 |
-
$seq .= $codes['A'][$code[$i]];
|
1232 |
-
}
|
1233 |
-
} else {
|
1234 |
-
$p = $parities[$code{0}];
|
1235 |
-
for ($i = 1; $i < $half_len; ++$i) {
|
1236 |
-
$seq .= $codes[$p[$i-1]][$code[$i]];
|
1237 |
-
}
|
1238 |
-
}
|
1239 |
-
$seq .= '01010'; // center guard bar
|
1240 |
-
for ($i = $half_len; $i < $len; ++$i) {
|
1241 |
-
$seq .= $codes['C'][$code[$i]];
|
1242 |
-
}
|
1243 |
-
$seq .= '101'; // right guard bar
|
1244 |
-
}
|
1245 |
-
$clen = strlen($seq);
|
1246 |
-
$w = 0;
|
1247 |
-
for ($i = 0; $i < $clen; ++$i) {
|
1248 |
-
$w += 1;
|
1249 |
-
if (($i == ($clen - 1)) OR (($i < ($clen - 1)) AND ($seq[$i] != $seq[($i+1)]))) {
|
1250 |
-
if ($seq[$i] == '1') {
|
1251 |
-
$t = true; // bar
|
1252 |
-
} else {
|
1253 |
-
$t = false; // space
|
1254 |
-
}
|
1255 |
-
$bararray['bcode'][$k] = array('t' => $t, 'w' => $w, 'h' => 1, 'p' => 0);
|
1256 |
-
$bararray['maxw'] += $w;
|
1257 |
-
++$k;
|
1258 |
-
$w = 0;
|
1259 |
-
}
|
1260 |
-
}
|
1261 |
-
$bararray['checkdigit'] = $checkdigit;
|
1262 |
-
return $bararray;
|
1263 |
-
}
|
1264 |
-
|
1265 |
-
/**
|
1266 |
-
* UPC-Based Extentions
|
1267 |
-
* 2-Digit Ext.: Used to indicate magazines and newspaper issue numbers
|
1268 |
-
* 5-Digit Ext.: Used to mark suggested retail price of books
|
1269 |
-
*/
|
1270 |
-
protected function barcode_eanext($code, $len=5) {
|
1271 |
-
//Padding
|
1272 |
-
$code = str_pad($code, $len, '0', STR_PAD_LEFT);
|
1273 |
-
// calculate check digit
|
1274 |
-
if ($len == 2) {
|
1275 |
-
$r = $code % 4;
|
1276 |
-
} elseif ($len == 5) {
|
1277 |
-
$r = (3 * ($code{0} + $code{2} + $code{4})) + (9 * ($code{1} + $code{3}));
|
1278 |
-
$r %= 10;
|
1279 |
-
} else {
|
1280 |
-
return false;
|
1281 |
-
}
|
1282 |
-
//Convert digits to bars
|
1283 |
-
$codes = array(
|
1284 |
-
'A'=>array( // left odd parity
|
1285 |
-
'0'=>'0001101',
|
1286 |
-
'1'=>'0011001',
|
1287 |
-
'2'=>'0010011',
|
1288 |
-
'3'=>'0111101',
|
1289 |
-
'4'=>'0100011',
|
1290 |
-
'5'=>'0110001',
|
1291 |
-
'6'=>'0101111',
|
1292 |
-
'7'=>'0111011',
|
1293 |
-
'8'=>'0110111',
|
1294 |
-
'9'=>'0001011'),
|
1295 |
-
'B'=>array( // left even parity
|
1296 |
-
'0'=>'0100111',
|
1297 |
-
'1'=>'0110011',
|
1298 |
-
'2'=>'0011011',
|
1299 |
-
'3'=>'0100001',
|
1300 |
-
'4'=>'0011101',
|
1301 |
-
'5'=>'0111001',
|
1302 |
-
'6'=>'0000101',
|
1303 |
-
'7'=>'0010001',
|
1304 |
-
'8'=>'0001001',
|
1305 |
-
'9'=>'0010111')
|
1306 |
-
);
|
1307 |
-
$parities = array();
|
1308 |
-
$parities[2] = array(
|
1309 |
-
'0'=>array('A','A'),
|
1310 |
-
'1'=>array('A','B'),
|
1311 |
-
'2'=>array('B','A'),
|
1312 |
-
'3'=>array('B','B')
|
1313 |
-
);
|
1314 |
-
$parities[5] = array(
|
1315 |
-
'0'=>array('B','B','A','A','A'),
|
1316 |
-
'1'=>array('B','A','B','A','A'),
|
1317 |
-
'2'=>array('B','A','A','B','A'),
|
1318 |
-
'3'=>array('B','A','A','A','B'),
|
1319 |
-
'4'=>array('A','B','B','A','A'),
|
1320 |
-
'5'=>array('A','A','B','B','A'),
|
1321 |
-
'6'=>array('A','A','A','B','B'),
|
1322 |
-
'7'=>array('A','B','A','B','A'),
|
1323 |
-
'8'=>array('A','B','A','A','B'),
|
1324 |
-
'9'=>array('A','A','B','A','B')
|
1325 |
-
);
|
1326 |
-
$p = $parities[$len][$r];
|
1327 |
-
$seq = '1011'; // left guard bar
|
1328 |
-
$seq .= $codes[$p[0]][$code{0}];
|
1329 |
-
for ($i = 1; $i < $len; ++$i) {
|
1330 |
-
$seq .= '01'; // separator
|
1331 |
-
$seq .= $codes[$p[$i]][$code[$i]];
|
1332 |
-
}
|
1333 |
-
$bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array());
|
1334 |
-
return $this->binseq_to_array($seq, $bararray);
|
1335 |
-
}
|
1336 |
-
|
1337 |
-
/**
|
1338 |
-
* POSTNET and PLANET barcodes.
|
1339 |
-
* Used by U.S. Postal Service for automated mail sorting
|
1340 |
-
*/
|
1341 |
-
protected function barcode_postnet($code, $planet=false) {
|
1342 |
-
// bar lenght
|
1343 |
-
if ($planet) {
|
1344 |
-
$barlen = Array(
|
1345 |
-
0 => Array(1,1,2,2,2),
|
1346 |
-
1 => Array(2,2,2,1,1),
|
1347 |
-
2 => Array(2,2,1,2,1),
|
1348 |
-
3 => Array(2,2,1,1,2),
|
1349 |
-
4 => Array(2,1,2,2,1),
|
1350 |
-
5 => Array(2,1,2,1,2),
|
1351 |
-
6 => Array(2,1,1,2,2),
|
1352 |
-
7 => Array(1,2,2,2,1),
|
1353 |
-
8 => Array(1,2,2,1,2),
|
1354 |
-
9 => Array(1,2,1,2,2)
|
1355 |
-
);
|
1356 |
-
} else {
|
1357 |
-
$barlen = Array(
|
1358 |
-
0 => Array(2,2,1,1,1),
|
1359 |
-
1 => Array(1,1,1,2,2),
|
1360 |
-
2 => Array(1,1,2,1,2),
|
1361 |
-
3 => Array(1,1,2,2,1),
|
1362 |
-
4 => Array(1,2,1,1,2),
|
1363 |
-
5 => Array(1,2,1,2,1),
|
1364 |
-
6 => Array(1,2,2,1,1),
|
1365 |
-
7 => Array(2,1,1,1,2),
|
1366 |
-
8 => Array(2,1,1,2,1),
|
1367 |
-
9 => Array(2,1,2,1,1)
|
1368 |
-
);
|
1369 |
-
}
|
1370 |
-
$bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 5, 'bcode' => array());
|
1371 |
-
$k = 0;
|
1372 |
-
$code = str_replace('-', '', $code);
|
1373 |
-
$code = str_replace(' ', '', $code);
|
1374 |
-
$len = strlen($code);
|
1375 |
-
// calculate checksum
|
1376 |
-
$sum = 0;
|
1377 |
-
for ($i = 0; $i < $len; ++$i) {
|
1378 |
-
$sum += intval($code[$i]);
|
1379 |
-
}
|
1380 |
-
$chkd = ($sum % 10);
|
1381 |
-
if($chkd > 0) {
|
1382 |
-
$chkd = (10 - $chkd);
|
1383 |
-
}
|
1384 |
-
$code .= $chkd;
|
1385 |
-
$checkdigit = $chkd;
|
1386 |
-
$len = strlen($code);
|
1387 |
-
// start bar
|
1388 |
-
$bararray['bcode'][$k++] = array('t' => 1, 'w' => 1, 'h' => 5, 'p' => 0);
|
1389 |
-
$bararray['bcode'][$k++] = array('t' => 0, 'w' => $this->gapwidth , 'h' => 5, 'p' => 0);
|
1390 |
-
$bararray['maxw'] += (1 + $this->gapwidth );
|
1391 |
-
for ($i = 0; $i < $len; ++$i) {
|
1392 |
-
for ($j = 0; $j < 5; ++$j) {
|
1393 |
-
$bh = $barlen[$code[$i]][$j];
|
1394 |
-
if ($bh == 2) {
|
1395 |
-
$h = 5;
|
1396 |
-
$p = 0;
|
1397 |
-
}
|
1398 |
-
else {
|
1399 |
-
$h = 2;
|
1400 |
-
$p = 3;
|
1401 |
-
}
|
1402 |
-
$bararray['bcode'][$k++] = array('t' => 1, 'w' => 1, 'h' => $h, 'p' => $p);
|
1403 |
-
$bararray['bcode'][$k++] = array('t' => 0, 'w' => $this->gapwidth , 'h' => 2, 'p' => 0);
|
1404 |
-
$bararray['maxw'] += (1 + $this->gapwidth );
|
1405 |
-
}
|
1406 |
-
}
|
1407 |
-
// end bar
|
1408 |
-
$bararray['bcode'][$k++] = array('t' => 1, 'w' => 1, 'h' => 5, 'p' => 0);
|
1409 |
-
$bararray['maxw'] += 1;
|
1410 |
-
$bararray['checkdigit'] = $checkdigit;
|
1411 |
-
return $bararray;
|
1412 |
-
}
|
1413 |
-
|
1414 |
-
/**
|
1415 |
-
* RM4SCC - CBC - KIX
|
1416 |
-
* RM4SCC (Royal Mail 4-state Customer Code) - CBC (Customer Bar Code) - KIX (Klant index - Customer index)
|
1417 |
-
* RM4SCC is the name of the barcode symbology used by the Royal Mail for its Cleanmail service.
|
1418 |
-
*/
|
1419 |
-
protected function barcode_rm4scc($code, $kix=false) {
|
1420 |
-
$notkix = !$kix;
|
1421 |
-
// bar mode
|
1422 |
-
// 1 = pos 1, length 2
|
1423 |
-
// 2 = pos 1, length 3
|
1424 |
-
// 3 = pos 2, length 1
|
1425 |
-
// 4 = pos 2, length 2
|
1426 |
-
$barmode = array(
|
1427 |
-
'0' => array(3,3,2,2),
|
1428 |
-
'1' => array(3,4,1,2),
|
1429 |
-
'2' => array(3,4,2,1),
|
1430 |
-
'3' => array(4,3,1,2),
|
1431 |
-
'4' => array(4,3,2,1),
|
1432 |
-
'5' => array(4,4,1,1),
|
1433 |
-
'6' => array(3,1,4,2),
|
1434 |
-
'7' => array(3,2,3,2),
|
1435 |
-
'8' => array(3,2,4,1),
|
1436 |
-
'9' => array(4,1,3,2),
|
1437 |
-
'A' => array(4,1,4,1),
|
1438 |
-
'B' => array(4,2,3,1),
|
1439 |
-
'C' => array(3,1,2,4),
|
1440 |
-
'D' => array(3,2,1,4),
|
1441 |
-
'E' => array(3,2,2,3),
|
1442 |
-
'F' => array(4,1,1,4),
|
1443 |
-
'G' => array(4,1,2,3),
|
1444 |
-
'H' => array(4,2,1,3),
|
1445 |
-
'I' => array(1,3,4,2),
|
1446 |
-
'J' => array(1,4,3,2),
|
1447 |
-
'K' => array(1,4,4,1),
|
1448 |
-
'L' => array(2,3,3,2),
|
1449 |
-
'M' => array(2,3,4,1),
|
1450 |
-
'N' => array(2,4,3,1),
|
1451 |
-
'O' => array(1,3,2,4),
|
1452 |
-
'P' => array(1,4,1,4),
|
1453 |
-
'Q' => array(1,4,2,3),
|
1454 |
-
'R' => array(2,3,1,4),
|
1455 |
-
'S' => array(2,3,2,3),
|
1456 |
-
'T' => array(2,4,1,3),
|
1457 |
-
'U' => array(1,1,4,4),
|
1458 |
-
'V' => array(1,2,3,4),
|
1459 |
-
'W' => array(1,2,4,3),
|
1460 |
-
'X' => array(2,1,3,4),
|
1461 |
-
'Y' => array(2,1,4,3),
|
1462 |
-
'Z' => array(2,2,3,3)
|
1463 |
-
);
|
1464 |
-
$code = strtoupper($code);
|
1465 |
-
$len = strlen($code);
|
1466 |
-
$bararray = array('code' => $code, 'maxw' => 0, 'maxh' => $this->daft['F'], 'bcode' => array());
|
1467 |
-
if ($notkix) {
|
1468 |
-
// table for checksum calculation (row,col)
|
1469 |
-
$checktable = array(
|
1470 |
-
'0' => array(1,1),
|
1471 |
-
'1' => array(1,2),
|
1472 |
-
'2' => array(1,3),
|
1473 |
-
'3' => array(1,4),
|
1474 |
-
'4' => array(1,5),
|
1475 |
-
'5' => array(1,0),
|
1476 |
-
'6' => array(2,1),
|
1477 |
-
'7' => array(2,2),
|
1478 |
-
'8' => array(2,3),
|
1479 |
-
'9' => array(2,4),
|
1480 |
-
'A' => array(2,5),
|
1481 |
-
'B' => array(2,0),
|
1482 |
-
'C' => array(3,1),
|
1483 |
-
'D' => array(3,2),
|
1484 |
-
'E' => array(3,3),
|
1485 |
-
'F' => array(3,4),
|
1486 |
-
'G' => array(3,5),
|
1487 |
-
'H' => array(3,0),
|
1488 |
-
'I' => array(4,1),
|
1489 |
-
'J' => array(4,2),
|
1490 |
-
'K' => array(4,3),
|
1491 |
-
'L' => array(4,4),
|
1492 |
-
'M' => array(4,5),
|
1493 |
-
'N' => array(4,0),
|
1494 |
-
'O' => array(5,1),
|
1495 |
-
'P' => array(5,2),
|
1496 |
-
'Q' => array(5,3),
|
1497 |
-
'R' => array(5,4),
|
1498 |
-
'S' => array(5,5),
|
1499 |
-
'T' => array(5,0),
|
1500 |
-
'U' => array(0,1),
|
1501 |
-
'V' => array(0,2),
|
1502 |
-
'W' => array(0,3),
|
1503 |
-
'X' => array(0,4),
|
1504 |
-
'Y' => array(0,5),
|
1505 |
-
'Z' => array(0,0)
|
1506 |
-
);
|
1507 |
-
$row = 0;
|
1508 |
-
$col = 0;
|
1509 |
-
for ($i = 0; $i < $len; ++$i) {
|
1510 |
-
$row += $checktable[$code[$i]][0];
|
1511 |
-
$col += $checktable[$code[$i]][1];
|
1512 |
-
}
|
1513 |
-
$row %= 6;
|
1514 |
-
$col %= 6;
|
1515 |
-
$chk = array_keys($checktable, array($row,$col));
|
1516 |
-
$code .= $chk[0];
|
1517 |
-
$bararray['checkdigit'] = $chk[0];
|
1518 |
-
++$len;
|
1519 |
-
}
|
1520 |
-
$k = 0;
|
1521 |
-
if ($notkix) {
|
1522 |
-
// start bar
|
1523 |
-
$bararray['bcode'][$k++] = array('t' => 1, 'w' => 1, 'h' => $this->daft['A'] , 'p' => 0);
|
1524 |
-
$bararray['bcode'][$k++] = array('t' => 0, 'w' => $this->gapwidth , 'h' => $this->daft['A'] , 'p' => 0);
|
1525 |
-
$bararray['maxw'] += (1 + $this->gapwidth) ;
|
1526 |
-
}
|
1527 |
-
for ($i = 0; $i < $len; ++$i) {
|
1528 |
-
for ($j = 0; $j < 4; ++$j) {
|
1529 |
-
switch ($barmode[$code[$i]][$j]) {
|
1530 |
-
case 1: {
|
1531 |
-
// ascender (A)
|
1532 |
-
$p = 0;
|
1533 |
-
$h = $this->daft['A'];
|
1534 |
-
break;
|
1535 |
-
}
|
1536 |
-
case 2: {
|
1537 |
-
// full bar (F)
|
1538 |
-
$p = 0;
|
1539 |
-
$h = $this->daft['F'];
|
1540 |
-
break;
|
1541 |
-
}
|
1542 |
-
case 3: {
|
1543 |
-
// tracker (T)
|
1544 |
-
$p = ($this->daft['F'] - $this->daft['T'])/2;
|
1545 |
-
$h = $this->daft['T'];
|
1546 |
-
break;
|
1547 |
-
}
|
1548 |
-
case 4: {
|
1549 |
-
// descender (D)
|
1550 |
-
$p = $this->daft['F'] - $this->daft['D'];
|
1551 |
-
$h = $this->daft['D'];
|
1552 |
-
break;
|
1553 |
-
}
|
1554 |
-
}
|
1555 |
-
|
1556 |
-
$bararray['bcode'][$k++] = array('t' => 1, 'w' => 1, 'h' => $h, 'p' => $p);
|
1557 |
-
$bararray['bcode'][$k++] = array('t' => 0, 'w' => $this->gapwidth, 'h' => 2, 'p' => 0);
|
1558 |
-
$bararray['maxw'] += (1 + $this->gapwidth) ;
|
1559 |
-
}
|
1560 |
-
}
|
1561 |
-
if ($notkix) {
|
1562 |
-
// stop bar
|
1563 |
-
$bararray['bcode'][$k++] = array('t' => 1, 'w' => 1, 'h' => $this->daft['F'], 'p' => 0);
|
1564 |
-
$bararray['maxw'] += 1;
|
1565 |
-
}
|
1566 |
-
return $bararray;
|
1567 |
-
}
|
1568 |
-
|
1569 |
-
/**
|
1570 |
-
* CODABAR barcodes.
|
1571 |
-
* Older code often used in library systems, sometimes in blood banks
|
1572 |
-
*/
|
1573 |
-
protected function barcode_codabar($code) {
|
1574 |
-
$chr = array(
|
1575 |
-
'0' => '11111221',
|
1576 |
-
'1' => '11112211',
|
1577 |
-
'2' => '11121121',
|
1578 |
-
'3' => '22111111',
|
1579 |
-
'4' => '11211211',
|
1580 |
-
'5' => '21111211',
|
1581 |
-
'6' => '12111121',
|
1582 |
-
'7' => '12112111',
|
1583 |
-
'8' => '12211111',
|
1584 |
-
'9' => '21121111',
|
1585 |
-
'-' => '11122111',
|
1586 |
-
'$' => '11221111',
|
1587 |
-
':' => '21112121',
|
1588 |
-
'/' => '21211121',
|
1589 |
-
'.' => '21212111',
|
1590 |
-
'+' => '11222221',
|
1591 |
-
'A' => '11221211',
|
1592 |
-
'B' => '12121121',
|
1593 |
-
'C' => '11121221',
|
1594 |
-
'D' => '11122211'
|
1595 |
-
);
|
1596 |
-
$bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array());
|
1597 |
-
$k = 0;
|
1598 |
-
$w = 0;
|
1599 |
-
$seq = '';
|
1600 |
-
$code = strtoupper($code);
|
1601 |
-
$len = strlen($code);
|
1602 |
-
for ($i = 0; $i < $len; ++$i) {
|
1603 |
-
if (!isset($chr[$code[$i]])) {
|
1604 |
-
return false;
|
1605 |
-
}
|
1606 |
-
$seq = $chr[$code[$i]];
|
1607 |
-
for ($j = 0; $j < 8; ++$j) {
|
1608 |
-
if (($j % 2) == 0) {
|
1609 |
-
$t = true; // bar
|
1610 |
-
} else {
|
1611 |
-
$t = false; // space
|
1612 |
-
}
|
1613 |
-
$x = $seq[$j];
|
1614 |
-
if ($x == 2) { $w = $this->print_ratio; }
|
1615 |
-
else { $w = 1; }
|
1616 |
-
$bararray['bcode'][$k] = array('t' => $t, 'w' => $w, 'h' => 1, 'p' => 0);
|
1617 |
-
$bararray['maxw'] += $w;
|
1618 |
-
++$k;
|
1619 |
-
}
|
1620 |
-
}
|
1621 |
-
return $bararray;
|
1622 |
-
}
|
1623 |
-
|
1624 |
-
/**
|
1625 |
-
* CODE11 barcodes.
|
1626 |
-
* Used primarily for labeling telecommunications equipment
|
1627 |
-
*/
|
1628 |
-
protected function barcode_code11($code) {
|
1629 |
-
$chr = array(
|
1630 |
-
'0' => '111121',
|
1631 |
-
'1' => '211121',
|
1632 |
-
'2' => '121121',
|
1633 |
-
'3' => '221111',
|
1634 |
-
'4' => '112121',
|
1635 |
-
'5' => '212111',
|
1636 |
-
'6' => '122111',
|
1637 |
-
'7' => '111221',
|
1638 |
-
'8' => '211211',
|
1639 |
-
'9' => '211111',
|
1640 |
-
'-' => '112111',
|
1641 |
-
'S' => '112211'
|
1642 |
-
);
|
1643 |
-
|
1644 |
-
$bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array());
|
1645 |
-
$k = 0;
|
1646 |
-
$w = 0;
|
1647 |
-
$seq = '';
|
1648 |
-
$len = strlen($code);
|
1649 |
-
// calculate check digit C
|
1650 |
-
$p = 1;
|
1651 |
-
$check = 0;
|
1652 |
-
for ($i = ($len - 1); $i >= 0; --$i) {
|
1653 |
-
$digit = $code[$i];
|
1654 |
-
if ($digit == '-') {
|
1655 |
-
$dval = 10;
|
1656 |
-
} else {
|
1657 |
-
$dval = intval($digit);
|
1658 |
-
}
|
1659 |
-
$check += ($dval * $p);
|
1660 |
-
++$p;
|
1661 |
-
if ($p > 10) {
|
1662 |
-
$p = 1;
|
1663 |
-
}
|
1664 |
-
}
|
1665 |
-
$check %= 11;
|
1666 |
-
if ($check == 10) {
|
1667 |
-
$check = '-';
|
1668 |
-
}
|
1669 |
-
$code .= $check;
|
1670 |
-
$checkdigit = $check;
|
1671 |
-
if ($len > 10) {
|
1672 |
-
// calculate check digit K
|
1673 |
-
$p = 1;
|
1674 |
-
$check = 0;
|
1675 |
-
for ($i = $len; $i >= 0; --$i) {
|
1676 |
-
$digit = $code[$i];
|
1677 |
-
if ($digit == '-') {
|
1678 |
-
$dval = 10;
|
1679 |
-
} else {
|
1680 |
-
$dval = intval($digit);
|
1681 |
-
}
|
1682 |
-
$check += ($dval * $p);
|
1683 |
-
++$p;
|
1684 |
-
if ($p > 9) {
|
1685 |
-
$p = 1;
|
1686 |
-
}
|
1687 |
-
}
|
1688 |
-
$check %= 11;
|
1689 |
-
$code .= $check;
|
1690 |
-
$checkdigit .= $check;
|
1691 |
-
++$len;
|
1692 |
-
}
|
1693 |
-
$code = 'S'.$code.'S';
|
1694 |
-
$len += 3;
|
1695 |
-
for ($i = 0; $i < $len; ++$i) {
|
1696 |
-
if (!isset($chr[$code[$i]])) {
|
1697 |
-
return false;
|
1698 |
-
}
|
1699 |
-
$seq = $chr[$code[$i]];
|
1700 |
-
for ($j = 0; $j < 6; ++$j) {
|
1701 |
-
if (($j % 2) == 0) {
|
1702 |
-
$t = true; // bar
|
1703 |
-
} else {
|
1704 |
-
$t = false; // space
|
1705 |
-
}
|
1706 |
-
$x = $seq[$j];
|
1707 |
-
if ($x == 2) { $w = $this->print_ratio; }
|
1708 |
-
else { $w = 1; }
|
1709 |
-
$bararray['bcode'][$k] = array('t' => $t, 'w' => $w, 'h' => 1, 'p' => 0);
|
1710 |
-
$bararray['maxw'] += $w;
|
1711 |
-
++$k;
|
1712 |
-
}
|
1713 |
-
}
|
1714 |
-
$bararray['checkdigit'] = $checkdigit;
|
1715 |
-
return $bararray;
|
1716 |
-
}
|
1717 |
-
|
1718 |
-
|
1719 |
-
/**
|
1720 |
-
* IMB - Intelligent Mail Barcode - Onecode - USPS-B-3200
|
1721 |
-
* (requires PHP bcmath extension)
|
1722 |
-
* Intelligent Mail barcode is a 65-bar code for use on mail in the United States.
|
1723 |
-
* The fields are described as follows:<ul><li>The Barcode Identifier shall be assigned by USPS to encode the presort identification that is currently printed in human readable form on the optional endorsement line (OEL) as well as for future USPS use. This shall be two digits, with the second digit in the range of 0-4. The allowable encoding ranges shall be 00-04, 10-14, 20-24, 30-34, 40-44, 50-54, 60-64, 70-74, 80-84, and 90-94.</li><li>The Service Type Identifier shall be assigned by USPS for any combination of services requested on the mailpiece. The allowable encoding range shall be 000-999. Each 3-digit value shall correspond to a particular mail class with a particular combination of service(s). Each service program, such as OneCode Confirm and OneCode ACS, shall provide the list of Service Type Identifier values.</li><li>The Mailer or Customer Identifier shall be assigned by USPS as a unique, 6 or 9 digit number that identifies a business entity. The allowable encoding range for the 6 digit Mailer ID shall be 000000- 899999, while the allowable encoding range for the 9 digit Mailer ID shall be 900000000-999999999.</li><li>The Serial or Sequence Number shall be assigned by the mailer for uniquely identifying and tracking mailpieces. The allowable encoding range shall be 000000000-999999999 when used with a 6 digit Mailer ID and 000000-999999 when used with a 9 digit Mailer ID. e. The Delivery Point ZIP Code shall be assigned by the mailer for routing the mailpiece. This shall replace POSTNET for routing the mailpiece to its final delivery point. The length may be 0, 5, 9, or 11 digits. The allowable encoding ranges shall be no ZIP Code, 00000-99999, 000000000-999999999, and 00000000000-99999999999.</li></ul>
|
1724 |
-
*/
|
1725 |
-
protected function barcode_imb($code) {
|
1726 |
-
$asc_chr = array(4,0,2,6,3,5,1,9,8,7,1,2,0,6,4,8,2,9,5,3,0,1,3,7,4,6,8,9,2,0,5,1,9,4,3,8,6,7,1,2,4,3,9,5,7,8,3,0,2,1,4,0,9,1,7,0,2,4,6,3,7,1,9,5,8);
|
1727 |
-
$dsc_chr = array(7,1,9,5,8,0,2,4,6,3,5,8,9,7,3,0,6,1,7,4,6,8,9,2,5,1,7,5,4,3,8,7,6,0,2,5,4,9,3,0,1,6,8,2,0,4,5,9,6,7,5,2,6,3,8,5,1,9,8,7,4,0,2,6,3);
|
1728 |
-
$asc_pos = array(3,0,8,11,1,12,8,11,10,6,4,12,2,7,9,6,7,9,2,8,4,0,12,7,10,9,0,7,10,5,7,9,6,8,2,12,1,4,2,0,1,5,4,6,12,1,0,9,4,7,5,10,2,6,9,11,2,12,6,7,5,11,0,3,2);
|
1729 |
-
$dsc_pos = array(2,10,12,5,9,1,5,4,3,9,11,5,10,1,6,3,4,1,10,0,2,11,8,6,1,12,3,8,6,4,4,11,0,6,1,9,11,5,3,7,3,10,7,11,8,2,10,3,5,8,0,3,12,11,8,4,5,1,3,0,7,12,9,8,10);
|
1730 |
-
$code_arr = explode('-', $code);
|
1731 |
-
$tracking_number = $code_arr[0];
|
1732 |
-
if (isset($code_arr[1])) {
|
1733 |
-
$routing_code = $code_arr[1];
|
1734 |
-
} else {
|
1735 |
-
$routing_code = '';
|
1736 |
-
}
|
1737 |
-
// Conversion of Routing Code
|
1738 |
-
switch (strlen($routing_code)) {
|
1739 |
-
case 0: {
|
1740 |
-
$binary_code = 0;
|
1741 |
-
break;
|
1742 |
-
}
|
1743 |
-
case 5: {
|
1744 |
-
$binary_code = bcadd($routing_code, '1');
|
1745 |
-
break;
|
1746 |
-
}
|
1747 |
-
case 9: {
|
1748 |
-
$binary_code = bcadd($routing_code, '100001');
|
1749 |
-
break;
|
1750 |
-
}
|
1751 |
-
case 11: {
|
1752 |
-
$binary_code = bcadd($routing_code, '1000100001');
|
1753 |
-
break;
|
1754 |
-
}
|
1755 |
-
default: {
|
1756 |
-
return false;
|
1757 |
-
break;
|
1758 |
-
}
|
1759 |
-
}
|
1760 |
-
$binary_code = bcmul($binary_code, 10);
|
1761 |
-
$binary_code = bcadd($binary_code, $tracking_number{0});
|
1762 |
-
$binary_code = bcmul($binary_code, 5);
|
1763 |
-
$binary_code = bcadd($binary_code, $tracking_number{1});
|
1764 |
-
$binary_code .= substr($tracking_number, 2, 18);
|
1765 |
-
// convert to hexadecimal
|
1766 |
-
$binary_code = $this->dec_to_hex($binary_code);
|
1767 |
-
// pad to get 13 bytes
|
1768 |
-
$binary_code = str_pad($binary_code, 26, '0', STR_PAD_LEFT);
|
1769 |
-
// convert string to array of bytes
|
1770 |
-
$binary_code_arr = chunk_split($binary_code, 2, "\r");
|
1771 |
-
$binary_code_arr = substr($binary_code_arr, 0, -1);
|
1772 |
-
$binary_code_arr = explode("\r", $binary_code_arr);
|
1773 |
-
// calculate frame check sequence
|
1774 |
-
$fcs = $this->imb_crc11fcs($binary_code_arr);
|
1775 |
-
// exclude first 2 bits from first byte
|
1776 |
-
$first_byte = sprintf('%2s', dechex((hexdec($binary_code_arr[0]) << 2) >> 2));
|
1777 |
-
$binary_code_102bit = $first_byte.substr($binary_code, 2);
|
1778 |
-
// convert binary data to codewords
|
1779 |
-
$codewords = array();
|
1780 |
-
$data = $this->hex_to_dec($binary_code_102bit);
|
1781 |
-
$codewords[0] = bcmod($data, 636) * 2;
|
1782 |
-
$data = bcdiv($data, 636);
|
1783 |
-
for ($i = 1; $i < 9; ++$i) {
|
1784 |
-
$codewords[$i] = bcmod($data, 1365);
|
1785 |
-
$data = bcdiv($data, 1365);
|
1786 |
-
}
|
1787 |
-
$codewords[9] = $data;
|
1788 |
-
if (($fcs >> 10) == 1) {
|
1789 |
-
$codewords[9] += 659;
|
1790 |
-
}
|
1791 |
-
// generate lookup tables
|
1792 |
-
$table2of13 = $this->imb_tables(2, 78);
|
1793 |
-
$table5of13 = $this->imb_tables(5, 1287);
|
1794 |
-
// convert codewords to characters
|
1795 |
-
$characters = array();
|
1796 |
-
$bitmask = 512;
|
1797 |
-
foreach($codewords as $k => $val) {
|
1798 |
-
if ($val <= 1286) {
|
1799 |
-
$chrcode = $table5of13[$val];
|
1800 |
-
} else {
|
1801 |
-
$chrcode = $table2of13[($val - 1287)];
|
1802 |
-
}
|
1803 |
-
if (($fcs & $bitmask) > 0) {
|
1804 |
-
// bitwise invert
|
1805 |
-
$chrcode = ((~$chrcode) & 8191);
|
1806 |
-
}
|
1807 |
-
$characters[] = $chrcode;
|
1808 |
-
$bitmask /= 2;
|
1809 |
-
}
|
1810 |
-
$characters = array_reverse($characters);
|
1811 |
-
// build bars
|
1812 |
-
$k = 0;
|
1813 |
-
$bararray = array('code' => $code, 'maxw' => 0, 'maxh' => $this->daft['F'], 'bcode' => array());
|
1814 |
-
for ($i = 0; $i < 65; ++$i) {
|
1815 |
-
$asc = (($characters[$asc_chr[$i]] & pow(2, $asc_pos[$i])) > 0);
|
1816 |
-
$dsc = (($characters[$dsc_chr[$i]] & pow(2, $dsc_pos[$i])) > 0);
|
1817 |
-
if ($asc AND $dsc) {
|
1818 |
-
// full bar (F)
|
1819 |
-
$p = 0;
|
1820 |
-
$h = $this->daft['F'];
|
1821 |
-
} elseif ($asc) {
|
1822 |
-
// ascender (A)
|
1823 |
-
$p = 0;
|
1824 |
-
$h = $this->daft['A'];
|
1825 |
-
} elseif ($dsc) {
|
1826 |
-
// descender (D)
|
1827 |
-
$p = $this->daft['F'] - $this->daft['D'];
|
1828 |
-
$h = $this->daft['D'];
|
1829 |
-
} else {
|
1830 |
-
// tracker (T)
|
1831 |
-
$p = ($this->daft['F'] - $this->daft['T'])/2;
|
1832 |
-
$h = $this->daft['T'];
|
1833 |
-
}
|
1834 |
-
$bararray['bcode'][$k++] = array('t' => 1, 'w' => 1, 'h' => $h, 'p' => $p);
|
1835 |
-
// Gap
|
1836 |
-
$bararray['bcode'][$k++] = array('t' => 0, 'w' => $this->gapwidth , 'h' => 1, 'p' => 0);
|
1837 |
-
$bararray['maxw'] += (1 + $this->gapwidth );
|
1838 |
-
}
|
1839 |
-
unset($bararray['bcode'][($k - 1)]);
|
1840 |
-
$bararray['maxw'] -= $this->gapwidth ;
|
1841 |
-
return $bararray;
|
1842 |
-
}
|
1843 |
-
|
1844 |
-
/**
|
1845 |
-
* Convert large integer number to hexadecimal representation.
|
1846 |
-
* (requires PHP bcmath extension)
|
1847 |
-
*/
|
1848 |
-
public function dec_to_hex($number) {
|
1849 |
-
$i = 0;
|
1850 |
-
$hex = array();
|
1851 |
-
if($number == 0) {
|
1852 |
-
return '00';
|
1853 |
-
}
|
1854 |
-
while($number > 0) {
|
1855 |
-
if($number == 0) {
|
1856 |
-
array_push($hex, '0');
|
1857 |
-
} else {
|
1858 |
-
array_push($hex, strtoupper(dechex(bcmod($number, '16'))));
|
1859 |
-
$number = bcdiv($number, '16', 0);
|
1860 |
-
}
|
1861 |
-
}
|
1862 |
-
$hex = array_reverse($hex);
|
1863 |
-
return implode($hex);
|
1864 |
-
}
|
1865 |
-
|
1866 |
-
/**
|
1867 |
-
* Convert large hexadecimal number to decimal representation (string).
|
1868 |
-
* (requires PHP bcmath extension)
|
1869 |
-
*/
|
1870 |
-
public function hex_to_dec($hex) {
|
1871 |
-
$dec = 0;
|
1872 |
-
$bitval = 1;
|
1873 |
-
$len = strlen($hex);
|
1874 |
-
for($pos = ($len - 1); $pos >= 0; --$pos) {
|
1875 |
-
$dec = bcadd($dec, bcmul(hexdec($hex[$pos]), $bitval));
|
1876 |
-
$bitval = bcmul($bitval, 16);
|
1877 |
-
}
|
1878 |
-
return $dec;
|
1879 |
-
}
|
1880 |
-
|
1881 |
-
/**
|
1882 |
-
* Intelligent Mail Barcode calculation of Frame Check Sequence
|
1883 |
-
*/
|
1884 |
-
protected function imb_crc11fcs($code_arr) {
|
1885 |
-
$genpoly = 0x0F35; // generator polynomial
|
1886 |
-
$fcs = 0x07FF; // Frame Check Sequence
|
1887 |
-
// do most significant byte skipping the 2 most significant bits
|
1888 |
-
$data = hexdec($code_arr[0]) << 5;
|
1889 |
-
for ($bit = 2; $bit < 8; ++$bit) {
|
1890 |
-
if (($fcs ^ $data) & 0x400) {
|
1891 |
-
$fcs = ($fcs << 1) ^ $genpoly;
|
1892 |
-
} else {
|
1893 |
-
$fcs = ($fcs << 1);
|
1894 |
-
}
|
1895 |
-
$fcs &= 0x7FF;
|
1896 |
-
$data <<= 1;
|
1897 |
-
}
|
1898 |
-
// do rest of bytes
|
1899 |
-
for ($byte = 1; $byte < 13; ++$byte) {
|
1900 |
-
$data = hexdec($code_arr[$byte]) << 3;
|
1901 |
-
for ($bit = 0; $bit < 8; ++$bit) {
|
1902 |
-
if (($fcs ^ $data) & 0x400) {
|
1903 |
-
$fcs = ($fcs << 1) ^ $genpoly;
|
1904 |
-
} else {
|
1905 |
-
$fcs = ($fcs << 1);
|
1906 |
-
}
|
1907 |
-
$fcs &= 0x7FF;
|
1908 |
-
$data <<= 1;
|
1909 |
-
}
|
1910 |
-
}
|
1911 |
-
return $fcs;
|
1912 |
-
}
|
1913 |
-
|
1914 |
-
/**
|
1915 |
-
* Reverse unsigned short value
|
1916 |
-
*/
|
1917 |
-
protected function imb_reverse_us($num) {
|
1918 |
-
$rev = 0;
|
1919 |
-
for ($i = 0; $i < 16; ++$i) {
|
1920 |
-
$rev <<= 1;
|
1921 |
-
$rev |= ($num & 1);
|
1922 |
-
$num >>= 1;
|
1923 |
-
}
|
1924 |
-
return $rev;
|
1925 |
-
}
|
1926 |
-
|
1927 |
-
/**
|
1928 |
-
* generate Nof13 tables used for Intelligent Mail Barcode
|
1929 |
-
*/
|
1930 |
-
protected function imb_tables($n, $size) {
|
1931 |
-
$table = array();
|
1932 |
-
$lli = 0; // LUT lower index
|
1933 |
-
$lui = $size - 1; // LUT upper index
|
1934 |
-
for ($count = 0; $count < 8192; ++$count) {
|
1935 |
-
$bit_count = 0;
|
1936 |
-
for ($bit_index = 0; $bit_index < 13; ++$bit_index) {
|
1937 |
-
$bit_count += intval(($count & (1 << $bit_index)) != 0);
|
1938 |
-
}
|
1939 |
-
// if we don't have the right number of bits on, go on to the next value
|
1940 |
-
if ($bit_count == $n) {
|
1941 |
-
$reverse = ($this->imb_reverse_us($count) >> 3);
|
1942 |
-
// if the reverse is less than count, we have already visited this pair before
|
1943 |
-
if ($reverse >= $count) {
|
1944 |
-
// If count is symmetric, place it at the first free slot from the end of the list.
|
1945 |
-
// Otherwise, place it at the first free slot from the beginning of the list AND place $reverse ath the next free slot from the beginning of the list
|
1946 |
-
if ($reverse == $count) {
|
1947 |
-
$table[$lui] = $count;
|
1948 |
-
--$lui;
|
1949 |
-
} else {
|
1950 |
-
$table[$lli] = $count;
|
1951 |
-
++$lli;
|
1952 |
-
$table[$lli] = $reverse;
|
1953 |
-
++$lli;
|
1954 |
-
}
|
1955 |
-
}
|
1956 |
-
}
|
1957 |
-
}
|
1958 |
-
return $table;
|
1959 |
-
}
|
1960 |
-
|
1961 |
-
} // end of class
|
1962 |
-
|
1963 |
-
//============================================================+
|
1964 |
-
// END OF FILE
|
1965 |
-
//============================================================+
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// Adapted for mPDF from TCPDF barcode. Original Details left below.
|
4 |
+
|
5 |
+
//============================================================+
|
6 |
+
// File name : barcodes.php
|
7 |
+
// Begin : 2008-06-09
|
8 |
+
// Last Update : 2009-04-15
|
9 |
+
// Version : 1.0.008
|
10 |
+
// License : GNU LGPL (http://www.gnu.org/copyleft/lesser.html)
|
11 |
+
// ----------------------------------------------------------------------------
|
12 |
+
// Copyright (C) 2008-2009 Nicola Asuni - Tecnick.com S.r.l.
|
13 |
+
//
|
14 |
+
// This program is free software: you can redistribute it and/or modify
|
15 |
+
// it under the terms of the GNU Lesser General Public License as published by
|
16 |
+
// the Free Software Foundation, either version 2.1 of the License, or
|
17 |
+
// (at your option) any later version.
|
18 |
+
//
|
19 |
+
// This program is distributed in the hope that it will be useful,
|
20 |
+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
21 |
+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
22 |
+
// GNU Lesser General Public License for more details.
|
23 |
+
//
|
24 |
+
// You should have received a copy of the GNU Lesser General Public License
|
25 |
+
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
26 |
+
//
|
27 |
+
// See LICENSE.TXT file for more information.
|
28 |
+
// ----------------------------------------------------------------------------
|
29 |
+
//
|
30 |
+
// Description : PHP class to creates array representations for
|
31 |
+
// common 1D barcodes to be used with TCPDF.
|
32 |
+
//
|
33 |
+
// Author: Nicola Asuni
|
34 |
+
//
|
35 |
+
// (c) Copyright:
|
36 |
+
// Nicola Asuni
|
37 |
+
// Tecnick.com S.r.l.
|
38 |
+
// Via della Pace, 11
|
39 |
+
// 09044 Quartucciu (CA)
|
40 |
+
// ITALY
|
41 |
+
// www.tecnick.com
|
42 |
+
// info@tecnick.com
|
43 |
+
//============================================================+
|
44 |
+
|
45 |
+
class PDFBarcode {
|
46 |
+
|
47 |
+
protected $barcode_array;
|
48 |
+
protected $gapwidth;
|
49 |
+
protected $print_ratio;
|
50 |
+
protected $daft;
|
51 |
+
|
52 |
+
public function __construct() {
|
53 |
+
|
54 |
+
}
|
55 |
+
|
56 |
+
public function getBarcodeArray($code, $type, $pr='') {
|
57 |
+
$this->setBarcode($code, $type, $pr);
|
58 |
+
return $this->barcode_array;
|
59 |
+
}
|
60 |
+
public function getChecksum($code, $type) {
|
61 |
+
$this->setBarcode($code, $type);
|
62 |
+
if (!$this->barcode_array) { return ''; }
|
63 |
+
else { return $this->barcode_array['checkdigit']; }
|
64 |
+
}
|
65 |
+
|
66 |
+
public function setBarcode($code, $type, $pr='') {
|
67 |
+
$this->print_ratio = 1;
|
68 |
+
switch (strtoupper($type)) {
|
69 |
+
case 'ISBN':
|
70 |
+
case 'ISSN':
|
71 |
+
case 'EAN13': { // EAN 13
|
72 |
+
$arrcode = $this->barcode_eanupc($code, 13);
|
73 |
+
$arrcode['lightmL'] = 11; // LEFT light margin = x X-dim (http://www.gs1uk.org)
|
74 |
+
$arrcode['lightmR'] = 7; // RIGHT light margin = x X-dim (http://www.gs1uk.org)
|
75 |
+
$arrcode['nom-X'] = 0.33; // Nominal value for X-dim in mm (http://www.gs1uk.org)
|
76 |
+
$arrcode['nom-H'] = 25.93; // Nominal bar height in mm incl. numerals (http://www.gs1uk.org)
|
77 |
+
break;
|
78 |
+
}
|
79 |
+
case 'UPCA': { // UPC-A
|
80 |
+
$arrcode = $this->barcode_eanupc($code, 12);
|
81 |
+
$arrcode['lightmL'] = 9; // LEFT light margin = x X-dim (http://www.gs1uk.org)
|
82 |
+
$arrcode['lightmR'] = 9; // RIGHT light margin = x X-dim (http://www.gs1uk.org)
|
83 |
+
$arrcode['nom-X'] = 0.33; // Nominal value for X-dim in mm (http://www.gs1uk.org)
|
84 |
+
$arrcode['nom-H'] = 25.91; // Nominal bar height in mm incl. numerals (http://www.gs1uk.org)
|
85 |
+
break;
|
86 |
+
}
|
87 |
+
case 'UPCE': { // UPC-E
|
88 |
+
$arrcode = $this->barcode_eanupc($code, 6);
|
89 |
+
$arrcode['lightmL'] = 9; // LEFT light margin = x X-dim (http://www.gs1uk.org)
|
90 |
+
$arrcode['lightmR'] = 7; // RIGHT light margin = x X-dim (http://www.gs1uk.org)
|
91 |
+
$arrcode['nom-X'] = 0.33; // Nominal value for X-dim in mm (http://www.gs1uk.org)
|
92 |
+
$arrcode['nom-H'] = 25.93; // Nominal bar height in mm incl. numerals (http://www.gs1uk.org)
|
93 |
+
break;
|
94 |
+
}
|
95 |
+
case 'EAN8': { // EAN 8
|
96 |
+
$arrcode = $this->barcode_eanupc($code, 8);
|
97 |
+
$arrcode['lightmL'] = 7; // LEFT light margin = x X-dim (http://www.gs1uk.org)
|
98 |
+
$arrcode['lightmR'] = 7; // RIGHT light margin = x X-dim (http://www.gs1uk.org)
|
99 |
+
$arrcode['nom-X'] = 0.33; // Nominal value for X-dim in mm (http://www.gs1uk.org)
|
100 |
+
$arrcode['nom-H'] = 21.64; // Nominal bar height in mm incl. numerals (http://www.gs1uk.org)
|
101 |
+
break;
|
102 |
+
}
|
103 |
+
case 'EAN2': { // 2-Digits UPC-Based Extention
|
104 |
+
$arrcode = $this->barcode_eanext($code, 2);
|
105 |
+
$arrcode['lightmL'] = 7; // LEFT light margin = x X-dim (estimated)
|
106 |
+
$arrcode['lightmR'] = 7; // RIGHT light margin = x X-dim (estimated)
|
107 |
+
$arrcode['sepM'] = 9; // SEPARATION margin = x X-dim (http://web.archive.org/web/19990501035133/http://www.uc-council.org/d36-d.htm)
|
108 |
+
$arrcode['nom-X'] = 0.33; // Nominal value for X-dim in mm (http://www.gs1uk.org)
|
109 |
+
$arrcode['nom-H'] = 20; // Nominal bar height in mm incl. numerals (estimated) not used when combined
|
110 |
+
break;
|
111 |
+
}
|
112 |
+
case 'EAN5': { // 5-Digits UPC-Based Extention
|
113 |
+
$arrcode = $this->barcode_eanext($code, 5);
|
114 |
+
$arrcode['lightmL'] = 7; // LEFT light margin = x X-dim (estimated)
|
115 |
+
$arrcode['lightmR'] = 7; // RIGHT light margin = x X-dim (estimated)
|
116 |
+
$arrcode['sepM'] = 9; // SEPARATION margin = x X-dim (http://web.archive.org/web/19990501035133/http://www.uc-council.org/d36-d.htm)
|
117 |
+
$arrcode['nom-X'] = 0.33; // Nominal value for X-dim in mm (http://www.gs1uk.org)
|
118 |
+
$arrcode['nom-H'] = 20; // Nominal bar height in mm incl. numerals (estimated) not used when combined
|
119 |
+
break;
|
120 |
+
}
|
121 |
+
|
122 |
+
case 'IMB': { // IMB - Intelligent Mail Barcode - Onecode - USPS-B-3200
|
123 |
+
$xdim = 0.508; // Nominal value for X-dim (bar width) in mm (spec.)
|
124 |
+
$bpi = 22; // Bars per inch
|
125 |
+
// Ratio of Nominal value for width of spaces in mm / Nominal value for X-dim (bar width) in mm based on bars per inch
|
126 |
+
$this->gapwidth = ((25.4/$bpi) - $xdim)/$xdim;
|
127 |
+
$this->daft = array('D'=>2, 'A'=>2, 'F'=>3, 'T'=>1); // Descender; Ascender; Full; Tracker bar heights
|
128 |
+
$arrcode = $this->barcode_imb($code);
|
129 |
+
$arrcode['nom-X'] = $xdim ;
|
130 |
+
$arrcode['nom-H'] = 3.68; // Nominal value for Height of Full bar in mm (spec.)
|
131 |
+
// USPS-B-3200 Revision C = 4.623
|
132 |
+
// USPS-B-3200 Revision E = 3.68
|
133 |
+
$arrcode['quietL'] = 3.175; // LEFT Quiet margin = mm (spec.)
|
134 |
+
$arrcode['quietR'] = 3.175; // RIGHT Quiet margin = mm (spec.)
|
135 |
+
$arrcode['quietTB'] = 0.711; // TOP/BOTTOM Quiet margin = mm (spec.)
|
136 |
+
break;
|
137 |
+
}
|
138 |
+
case 'RM4SCC': { // RM4SCC (Royal Mail 4-state Customer Code) - CBC (Customer Bar Code)
|
139 |
+
$xdim = 0.508; // Nominal value for X-dim (bar width) in mm (spec.)
|
140 |
+
$bpi = 22; // Bars per inch
|
141 |
+
// Ratio of Nominal value for width of spaces in mm / Nominal value for X-dim (bar width) in mm based on bars per inch
|
142 |
+
$this->gapwidth = ((25.4/$bpi) - $xdim)/$xdim;
|
143 |
+
$this->daft = array('D'=>5, 'A'=>5, 'F'=>8, 'T'=>2); // Descender; Ascender; Full; Tracker bar heights
|
144 |
+
$arrcode = $this->barcode_rm4scc($code, false);
|
145 |
+
$arrcode['nom-X'] = $xdim ;
|
146 |
+
$arrcode['nom-H'] = 5.0; // Nominal value for Height of Full bar in mm (spec.)
|
147 |
+
$arrcode['quietL'] = 2; // LEFT Quiet margin = mm (spec.)
|
148 |
+
$arrcode['quietR'] = 2; // RIGHT Quiet margin = mm (spec.)
|
149 |
+
$arrcode['quietTB'] = 2; // TOP/BOTTOM Quiet margin = mm (spec?)
|
150 |
+
break;
|
151 |
+
}
|
152 |
+
case 'KIX': { // KIX (Klant index - Customer index)
|
153 |
+
$xdim = 0.508; // Nominal value for X-dim (bar width) in mm (spec.)
|
154 |
+
$bpi = 22; // Bars per inch
|
155 |
+
// Ratio of Nominal value for width of spaces in mm / Nominal value for X-dim (bar width) in mm based on bars per inch
|
156 |
+
$this->gapwidth = ((25.4/$bpi) - $xdim)/$xdim;
|
157 |
+
$this->daft = array('D'=>5, 'A'=>5, 'F'=>8, 'T'=>2); // Descender; Ascender; Full; Tracker bar heights
|
158 |
+
$arrcode = $this->barcode_rm4scc($code, true);
|
159 |
+
$arrcode['nom-X'] = $xdim ;
|
160 |
+
$arrcode['nom-H'] = 5.0; // Nominal value for Height of Full bar in mm (? spec.)
|
161 |
+
$arrcode['quietL'] = 2; // LEFT Quiet margin = mm (spec.)
|
162 |
+
$arrcode['quietR'] = 2; // RIGHT Quiet margin = mm (spec.)
|
163 |
+
$arrcode['quietTB'] = 2; // TOP/BOTTOM Quiet margin = mm (spec.)
|
164 |
+
break;
|
165 |
+
}
|
166 |
+
case 'POSTNET': { // POSTNET
|
167 |
+
$xdim = 0.508; // Nominal value for X-dim (bar width) in mm (spec.)
|
168 |
+
$bpi = 22; // Bars per inch
|
169 |
+
// Ratio of Nominal value for width of spaces in mm / Nominal value for X-dim (bar width) in mm based on bars per inch
|
170 |
+
$this->gapwidth = ((25.4/$bpi) - $xdim)/$xdim;
|
171 |
+
$arrcode = $this->barcode_postnet($code, false);
|
172 |
+
$arrcode['nom-X'] = $xdim ;
|
173 |
+
$arrcode['nom-H'] = 3.175; // Nominal value for Height of Full bar in mm (spec.)
|
174 |
+
$arrcode['quietL'] = 3.175; // LEFT Quiet margin = mm (?spec.)
|
175 |
+
$arrcode['quietR'] = 3.175; // RIGHT Quiet margin = mm (?spec.)
|
176 |
+
$arrcode['quietTB'] = 1.016; // TOP/BOTTOM Quiet margin = mm (?spec.)
|
177 |
+
break;
|
178 |
+
}
|
179 |
+
case 'PLANET': { // PLANET
|
180 |
+
$xdim = 0.508; // Nominal value for X-dim (bar width) in mm (spec.)
|
181 |
+
$bpi = 22; // Bars per inch
|
182 |
+
// Ratio of Nominal value for width of spaces in mm / Nominal value for X-dim (bar width) in mm based on bars per inch
|
183 |
+
$this->gapwidth = ((25.4/$bpi) - $xdim)/$xdim;
|
184 |
+
$arrcode = $this->barcode_postnet($code, true);
|
185 |
+
$arrcode['nom-X'] = $xdim ;
|
186 |
+
$arrcode['nom-H'] = 3.175; // Nominal value for Height of Full bar in mm (spec.)
|
187 |
+
$arrcode['quietL'] = 3.175; // LEFT Quiet margin = mm (?spec.)
|
188 |
+
$arrcode['quietR'] = 3.175; // RIGHT Quiet margin = mm (?spec.)
|
189 |
+
$arrcode['quietTB'] = 1.016; // TOP/BOTTOM Quiet margin = mm (?spec.)
|
190 |
+
break;
|
191 |
+
}
|
192 |
+
|
193 |
+
case 'C93': { // CODE 93 - USS-93
|
194 |
+
$arrcode = $this->barcode_code93($code);
|
195 |
+
if ($arrcode == false) { break; }
|
196 |
+
$arrcode['nom-X'] = 0.381; // Nominal value for X-dim (bar width) in mm (2 X min. spec.)
|
197 |
+
$arrcode['nom-H'] = 10; // Nominal value for Height of Full bar in mm (non-spec.)
|
198 |
+
$arrcode['lightmL'] = 10; // LEFT light margin = x X-dim (spec.)
|
199 |
+
$arrcode['lightmR'] = 10; // RIGHT light margin = x X-dim (spec.)
|
200 |
+
$arrcode['lightTB'] = 0; // TOP/BOTTOM light margin = x X-dim (non-spec.)
|
201 |
+
break;
|
202 |
+
}
|
203 |
+
case 'CODE11': { // CODE 11
|
204 |
+
if ($pr > 0) { $this->print_ratio = $pr; }
|
205 |
+
else { $this->print_ratio = 3; } // spec: Pr= 1:2.24 - 1:3.5
|
206 |
+
$arrcode = $this->barcode_code11($code);
|
207 |
+
if ($arrcode == false) { break; }
|
208 |
+
$arrcode['nom-X'] = 0.381; // Nominal value for X-dim (bar width) in mm (2 X min. spec.)
|
209 |
+
$arrcode['nom-H'] = 10; // Nominal value for Height of Full bar in mm (non-spec.)
|
210 |
+
$arrcode['lightmL'] = 10; // LEFT light margin = x X-dim (spec.)
|
211 |
+
$arrcode['lightmR'] = 10; // RIGHT light margin = x X-dim (spec.)
|
212 |
+
$arrcode['lightTB'] = 0; // TOP/BOTTOM light margin = x X-dim (non-spec.)
|
213 |
+
break;
|
214 |
+
}
|
215 |
+
case 'MSI': // MSI (Variation of Plessey code)
|
216 |
+
case 'MSI+': { // MSI + CHECKSUM (modulo 11)
|
217 |
+
if (strtoupper($type)=='MSI') { $arrcode = $this->barcode_msi($code, false); }
|
218 |
+
if (strtoupper($type)=='MSI+') { $arrcode = $this->barcode_msi($code, true); }
|
219 |
+
if ($arrcode == false) { break; }
|
220 |
+
$arrcode['nom-X'] = 0.381; // Nominal value for X-dim (bar width) in mm (2 X min. spec.)
|
221 |
+
$arrcode['nom-H'] = 10; // Nominal value for Height of Full bar in mm (non-spec.)
|
222 |
+
$arrcode['lightmL'] = 12; // LEFT light margin = x X-dim (spec.)
|
223 |
+
$arrcode['lightmR'] = 12; // RIGHT light margin = x X-dim (spec.)
|
224 |
+
$arrcode['lightTB'] = 0; // TOP/BOTTOM light margin = x X-dim (non-spec.)
|
225 |
+
break;
|
226 |
+
}
|
227 |
+
case 'CODABAR': { // CODABAR
|
228 |
+
if ($pr > 0) { $this->print_ratio = $pr; }
|
229 |
+
else { $this->print_ratio = 2.5; } // spec: Pr= 1:2 - 1:3 (>2.2 if X<0.50)
|
230 |
+
if (strtoupper($type)=='CODABAR') { $arrcode = $this->barcode_codabar($code); }
|
231 |
+
if ($arrcode == false) { break; }
|
232 |
+
$arrcode['nom-X'] = 0.381; // Nominal value for X-dim (bar width) in mm (2 X min. spec.)
|
233 |
+
$arrcode['nom-H'] = 10; // Nominal value for Height of Full bar in mm (non-spec.)
|
234 |
+
$arrcode['lightmL'] = 10; // LEFT light margin = x X-dim (spec.)
|
235 |
+
$arrcode['lightmR'] = 10; // RIGHT light margin = x X-dim (spec.)
|
236 |
+
$arrcode['lightTB'] = 0; // TOP/BOTTOM light margin = x X-dim (non-spec.)
|
237 |
+
break;
|
238 |
+
}
|
239 |
+
case 'C128A': // CODE 128 A
|
240 |
+
case 'C128B': // CODE 128 B
|
241 |
+
case 'C128C': // CODE 128 C
|
242 |
+
case 'EAN128A': // EAN 128 A
|
243 |
+
case 'EAN128B': // EAN 128 B
|
244 |
+
case 'EAN128C': { // EAN 128 C
|
245 |
+
if (strtoupper($type)=='C128A') { $arrcode = $this->barcode_c128($code, 'A'); }
|
246 |
+
if (strtoupper($type)=='C128B') { $arrcode = $this->barcode_c128($code, 'B'); }
|
247 |
+
if (strtoupper($type)=='C128C') { $arrcode = $this->barcode_c128($code, 'C'); }
|
248 |
+
if (strtoupper($type)=='EAN128A') { $arrcode = $this->barcode_c128($code, 'A', true); }
|
249 |
+
if (strtoupper($type)=='EAN128B') { $arrcode = $this->barcode_c128($code, 'B', true); }
|
250 |
+
if (strtoupper($type)=='EAN128C') { $arrcode = $this->barcode_c128($code, 'C', true); }
|
251 |
+
if ($arrcode == false) { break; }
|
252 |
+
$arrcode['nom-X'] = 0.381; // Nominal value for X-dim (bar width) in mm (2 X min. spec.)
|
253 |
+
$arrcode['nom-H'] = 10; // Nominal value for Height of Full bar in mm (non-spec.)
|
254 |
+
$arrcode['lightmL'] = 10; // LEFT light margin = x X-dim (spec.)
|
255 |
+
$arrcode['lightmR'] = 10; // RIGHT light margin = x X-dim (spec.)
|
256 |
+
$arrcode['lightTB'] = 0; // TOP/BOTTOM light margin = x X-dim (non-spec.)
|
257 |
+
break;
|
258 |
+
}
|
259 |
+
case 'C39': // CODE 39 - ANSI MH10.8M-1983 - USD-3 - 3 of 9.
|
260 |
+
case 'C39+': // CODE 39 with checksum
|
261 |
+
case 'C39E': // CODE 39 EXTENDED
|
262 |
+
case 'C39E+': { // CODE 39 EXTENDED + CHECKSUM
|
263 |
+
if ($pr > 0) { $this->print_ratio = $pr; }
|
264 |
+
else { $this->print_ratio = 2.5; } // spec: Pr= 1:2 - 1:3 (>2.2 if X<0.50)
|
265 |
+
$code = str_replace(chr(194).chr(160), ' ', $code); // mPDF 5.3.95 (for utf-8 encoded)
|
266 |
+
$code = str_replace(chr(160), ' ', $code); // mPDF 5.3.95 (for win-1252)
|
267 |
+
if (strtoupper($type)=='C39') { $arrcode = $this->barcode_code39($code, false, false); }
|
268 |
+
if (strtoupper($type)=='C39+') { $arrcode = $this->barcode_code39($code, false, true); }
|
269 |
+
if (strtoupper($type)=='C39E') { $arrcode = $this->barcode_code39($code, true, false); }
|
270 |
+
if (strtoupper($type)=='C39E+') { $arrcode = $this->barcode_code39($code, true, true); }
|
271 |
+
if ($arrcode == false) { break; }
|
272 |
+
$arrcode['nom-X'] = 0.381; // Nominal value for X-dim (bar width) in mm (2 X min. spec.)
|
273 |
+
$arrcode['nom-H'] = 10; // Nominal value for Height of Full bar in mm (non-spec.)
|
274 |
+
$arrcode['lightmL'] = 10; // LEFT light margin = x X-dim (spec.)
|
275 |
+
$arrcode['lightmR'] = 10; // RIGHT light margin = x X-dim (spec.)
|
276 |
+
$arrcode['lightTB'] = 0; // TOP/BOTTOM light margin = x X-dim (non-spec.)
|
277 |
+
break;
|
278 |
+
}
|
279 |
+
case 'S25': // Standard 2 of 5
|
280 |
+
case 'S25+': { // Standard 2 of 5 + CHECKSUM
|
281 |
+
if ($pr > 0) { $this->print_ratio = $pr; }
|
282 |
+
else { $this->print_ratio = 3; } // spec: Pr=1:3/1:4.5
|
283 |
+
if (strtoupper($type)=='S25') { $arrcode = $this->barcode_s25($code, false); }
|
284 |
+
if (strtoupper($type)=='S25+') { $arrcode = $this->barcode_s25($code, true); }
|
285 |
+
if ($arrcode == false) { break; }
|
286 |
+
$arrcode['nom-X'] = 0.381; // Nominal value for X-dim (bar width) in mm (2 X min. spec.)
|
287 |
+
$arrcode['nom-H'] = 10; // Nominal value for Height of Full bar in mm (non-spec.)
|
288 |
+
$arrcode['lightmL'] = 10; // LEFT light margin = x X-dim (spec.)
|
289 |
+
$arrcode['lightmR'] = 10; // RIGHT light margin = x X-dim (spec.)
|
290 |
+
$arrcode['lightTB'] = 0; // TOP/BOTTOM light margin = x X-dim (non-spec.)
|
291 |
+
break;
|
292 |
+
}
|
293 |
+
case 'I25': // Interleaved 2 of 5
|
294 |
+
case 'I25+': { // Interleaved 2 of 5 + CHECKSUM
|
295 |
+
if ($pr > 0) { $this->print_ratio = $pr; }
|
296 |
+
else { $this->print_ratio = 2.5; } // spec: Pr= 1:2 - 1:3 (>2.2 if X<0.50)
|
297 |
+
if (strtoupper($type)=='I25') { $arrcode = $this->barcode_i25($code, false); }
|
298 |
+
if (strtoupper($type)=='I25+') { $arrcode = $this->barcode_i25($code, true); }
|
299 |
+
if ($arrcode == false) { break; }
|
300 |
+
$arrcode['nom-X'] = 0.381; // Nominal value for X-dim (bar width) in mm (2 X min. spec.)
|
301 |
+
$arrcode['nom-H'] = 10; // Nominal value for Height of Full bar in mm (non-spec.)
|
302 |
+
$arrcode['lightmL'] = 10; // LEFT light margin = x X-dim (spec.)
|
303 |
+
$arrcode['lightmR'] = 10; // RIGHT light margin = x X-dim (spec.)
|
304 |
+
$arrcode['lightTB'] = 0; // TOP/BOTTOM light margin = x X-dim (non-spec.)
|
305 |
+
break;
|
306 |
+
}
|
307 |
+
case 'I25B': // Interleaved 2 of 5 + Bearer bars
|
308 |
+
case 'I25B+': { // Interleaved 2 of 5 + CHECKSUM + Bearer bars
|
309 |
+
if ($pr > 0) { $this->print_ratio = $pr; }
|
310 |
+
else { $this->print_ratio = 2.5; } // spec: Pr= 1:2 - 1:3 (>2.2 if X<0.50)
|
311 |
+
if (strtoupper($type)=='I25B') { $arrcode = $this->barcode_i25($code, false); }
|
312 |
+
if (strtoupper($type)=='I25B+') { $arrcode = $this->barcode_i25($code, true); }
|
313 |
+
if ($arrcode == false) { break; }
|
314 |
+
$arrcode['nom-X'] = 0.381; // Nominal value for X-dim (bar width) in mm (2 X min. spec.)
|
315 |
+
$arrcode['nom-H'] = 10; // Nominal value for Height of Full bar in mm (non-spec.)
|
316 |
+
$arrcode['lightmL'] = 10; // LEFT light margin = x X-dim (spec.)
|
317 |
+
$arrcode['lightmR'] = 10; // RIGHT light margin = x X-dim (spec.)
|
318 |
+
$arrcode['lightTB'] = 2; // TOP/BOTTOM light margin = x X-dim (non-spec.) - used for bearer bars
|
319 |
+
break;
|
320 |
+
}
|
321 |
+
default: {
|
322 |
+
$this->barcode_array = false;
|
323 |
+
}
|
324 |
+
}
|
325 |
+
$this->barcode_array = $arrcode;
|
326 |
+
}
|
327 |
+
|
328 |
+
/**
|
329 |
+
* CODE 39 - ANSI MH10.8M-1983 - USD-3 - 3 of 9.
|
330 |
+
*/
|
331 |
+
protected function barcode_code39($code, $extended=false, $checksum=false) {
|
332 |
+
$chr['0'] = '111221211';
|
333 |
+
$chr['1'] = '211211112';
|
334 |
+
$chr['2'] = '112211112';
|
335 |
+
$chr['3'] = '212211111';
|
336 |
+
$chr['4'] = '111221112';
|
337 |
+
$chr['5'] = '211221111';
|
338 |
+
$chr['6'] = '112221111';
|
339 |
+
$chr['7'] = '111211212';
|
340 |
+
$chr['8'] = '211211211';
|
341 |
+
$chr['9'] = '112211211';
|
342 |
+
$chr['A'] = '211112112';
|
343 |
+
$chr['B'] = '112112112';
|
344 |
+
$chr['C'] = '212112111';
|
345 |
+
$chr['D'] = '111122112';
|
346 |
+
$chr['E'] = '211122111';
|
347 |
+
$chr['F'] = '112122111';
|
348 |
+
$chr['G'] = '111112212';
|
349 |
+
$chr['H'] = '211112211';
|
350 |
+
$chr['I'] = '112112211';
|
351 |
+
$chr['J'] = '111122211';
|
352 |
+
$chr['K'] = '211111122';
|
353 |
+
$chr['L'] = '112111122';
|
354 |
+
$chr['M'] = '212111121';
|
355 |
+
$chr['N'] = '111121122';
|
356 |
+
$chr['O'] = '211121121';
|
357 |
+
$chr['P'] = '112121121';
|
358 |
+
$chr['Q'] = '111111222';
|
359 |
+
$chr['R'] = '211111221';
|
360 |
+
$chr['S'] = '112111221';
|
361 |
+
$chr['T'] = '111121221';
|
362 |
+
$chr['U'] = '221111112';
|
363 |
+
$chr['V'] = '122111112';
|
364 |
+
$chr['W'] = '222111111';
|
365 |
+
$chr['X'] = '121121112';
|
366 |
+
$chr['Y'] = '221121111';
|
367 |
+
$chr['Z'] = '122121111';
|
368 |
+
$chr['-'] = '121111212';
|
369 |
+
$chr['.'] = '221111211';
|
370 |
+
$chr[' '] = '122111211';
|
371 |
+
$chr['$'] = '121212111';
|
372 |
+
$chr['/'] = '121211121';
|
373 |
+
$chr['+'] = '121112121';
|
374 |
+
$chr['%'] = '111212121';
|
375 |
+
$chr['*'] = '121121211';
|
376 |
+
|
377 |
+
$code = strtoupper($code);
|
378 |
+
if ($extended) {
|
379 |
+
// extended mode
|
380 |
+
$code = $this->encode_code39_ext($code);
|
381 |
+
}
|
382 |
+
if ($code === false) {
|
383 |
+
return false;
|
384 |
+
}
|
385 |
+
if ($checksum) {
|
386 |
+
// checksum
|
387 |
+
$checkdigit = $this->checksum_code39($code);
|
388 |
+
$code .= $checkdigit ;
|
389 |
+
}
|
390 |
+
// add start and stop codes
|
391 |
+
$code = '*'.$code.'*';
|
392 |
+
|
393 |
+
$bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array());
|
394 |
+
$k = 0;
|
395 |
+
$clen = strlen($code);
|
396 |
+
for ($i = 0; $i < $clen; ++$i) {
|
397 |
+
$char = $code[$i];
|
398 |
+
if(!isset($chr[$char])) {
|
399 |
+
// invalid character
|
400 |
+
return false;
|
401 |
+
}
|
402 |
+
for ($j = 0; $j < 9; ++$j) {
|
403 |
+
if (($j % 2) == 0) {
|
404 |
+
$t = true; // bar
|
405 |
+
} else {
|
406 |
+
$t = false; // space
|
407 |
+
}
|
408 |
+
$x = $chr[$char][$j];
|
409 |
+
if ($x == 2) { $w = $this->print_ratio; }
|
410 |
+
else { $w = 1; }
|
411 |
+
|
412 |
+
$bararray['bcode'][$k] = array('t' => $t, 'w' => $w, 'h' => 1, 'p' => 0);
|
413 |
+
$bararray['maxw'] += $w;
|
414 |
+
++$k;
|
415 |
+
}
|
416 |
+
$bararray['bcode'][$k] = array('t' => false, 'w' => 1, 'h' => 1, 'p' => 0);
|
417 |
+
$bararray['maxw'] += 1;
|
418 |
+
++$k;
|
419 |
+
}
|
420 |
+
$bararray['checkdigit'] = $checkdigit;
|
421 |
+
return $bararray;
|
422 |
+
}
|
423 |
+
|
424 |
+
/**
|
425 |
+
* Encode a string to be used for CODE 39 Extended mode.
|
426 |
+
*/
|
427 |
+
protected function encode_code39_ext($code) {
|
428 |
+
$encode = array(
|
429 |
+
chr(0) => '%U', chr(1) => '$A', chr(2) => '$B', chr(3) => '$C',
|
430 |
+
chr(4) => '$D', chr(5) => '$E', chr(6) => '$F', chr(7) => '$G',
|
431 |
+
chr(8) => '$H', chr(9) => '$I', chr(10) => '$J', chr(11) => '£K',
|
432 |
+
chr(12) => '$L', chr(13) => '$M', chr(14) => '$N', chr(15) => '$O',
|
433 |
+
chr(16) => '$P', chr(17) => '$Q', chr(18) => '$R', chr(19) => '$S',
|
434 |
+
chr(20) => '$T', chr(21) => '$U', chr(22) => '$V', chr(23) => '$W',
|
435 |
+
chr(24) => '$X', chr(25) => '$Y', chr(26) => '$Z', chr(27) => '%A',
|
436 |
+
chr(28) => '%B', chr(29) => '%C', chr(30) => '%D', chr(31) => '%E',
|
437 |
+
chr(32) => ' ', chr(33) => '/A', chr(34) => '/B', chr(35) => '/C',
|
438 |
+
chr(36) => '/D', chr(37) => '/E', chr(38) => '/F', chr(39) => '/G',
|
439 |
+
chr(40) => '/H', chr(41) => '/I', chr(42) => '/J', chr(43) => '/K',
|
440 |
+
chr(44) => '/L', chr(45) => '-', chr(46) => '.', chr(47) => '/O',
|
441 |
+
chr(48) => '0', chr(49) => '1', chr(50) => '2', chr(51) => '3',
|
442 |
+
chr(52) => '4', chr(53) => '5', chr(54) => '6', chr(55) => '7',
|
443 |
+
chr(56) => '8', chr(57) => '9', chr(58) => '/Z', chr(59) => '%F',
|
444 |
+
chr(60) => '%G', chr(61) => '%H', chr(62) => '%I', chr(63) => '%J',
|
445 |
+
chr(64) => '%V', chr(65) => 'A', chr(66) => 'B', chr(67) => 'C',
|
446 |
+
chr(68) => 'D', chr(69) => 'E', chr(70) => 'F', chr(71) => 'G',
|
447 |
+
chr(72) => 'H', chr(73) => 'I', chr(74) => 'J', chr(75) => 'K',
|
448 |
+
chr(76) => 'L', chr(77) => 'M', chr(78) => 'N', chr(79) => 'O',
|
449 |
+
chr(80) => 'P', chr(81) => 'Q', chr(82) => 'R', chr(83) => 'S',
|
450 |
+
chr(84) => 'T', chr(85) => 'U', chr(86) => 'V', chr(87) => 'W',
|
451 |
+
chr(88) => 'X', chr(89) => 'Y', chr(90) => 'Z', chr(91) => '%K',
|
452 |
+
chr(92) => '%L', chr(93) => '%M', chr(94) => '%N', chr(95) => '%O',
|
453 |
+
chr(96) => '%W', chr(97) => '+A', chr(98) => '+B', chr(99) => '+C',
|
454 |
+
chr(100) => '+D', chr(101) => '+E', chr(102) => '+F', chr(103) => '+G',
|
455 |
+
chr(104) => '+H', chr(105) => '+I', chr(106) => '+J', chr(107) => '+K',
|
456 |
+
chr(108) => '+L', chr(109) => '+M', chr(110) => '+N', chr(111) => '+O',
|
457 |
+
chr(112) => '+P', chr(113) => '+Q', chr(114) => '+R', chr(115) => '+S',
|
458 |
+
chr(116) => '+T', chr(117) => '+U', chr(118) => '+V', chr(119) => '+W',
|
459 |
+
chr(120) => '+X', chr(121) => '+Y', chr(122) => '+Z', chr(123) => '%P',
|
460 |
+
chr(124) => '%Q', chr(125) => '%R', chr(126) => '%S', chr(127) => '%T');
|
461 |
+
$code_ext = '';
|
462 |
+
$clen = strlen($code);
|
463 |
+
for ($i = 0 ; $i < $clen; ++$i) {
|
464 |
+
if (ord($code[$i]) > 127) {
|
465 |
+
return false;
|
466 |
+
}
|
467 |
+
$code_ext .= $encode[$code[$i]];
|
468 |
+
}
|
469 |
+
return $code_ext;
|
470 |
+
}
|
471 |
+
|
472 |
+
/**
|
473 |
+
* Calculate CODE 39 checksum (modulo 43).
|
474 |
+
*/
|
475 |
+
protected function checksum_code39($code) {
|
476 |
+
$chars = array(
|
477 |
+
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
|
478 |
+
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K',
|
479 |
+
'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V',
|
480 |
+
'W', 'X', 'Y', 'Z', '-', '.', ' ', '$', '/', '+', '%');
|
481 |
+
$sum = 0;
|
482 |
+
$clen = strlen($code);
|
483 |
+
for ($i = 0 ; $i < $clen; ++$i) {
|
484 |
+
$k = array_keys($chars, $code[$i]);
|
485 |
+
$sum += $k[0];
|
486 |
+
}
|
487 |
+
$j = ($sum % 43);
|
488 |
+
return $chars[$j];
|
489 |
+
}
|
490 |
+
|
491 |
+
/**
|
492 |
+
* CODE 93 - USS-93
|
493 |
+
* Compact code similar to Code 39
|
494 |
+
*/
|
495 |
+
protected function barcode_code93($code) {
|
496 |
+
$chr['0'] = '131112';
|
497 |
+
$chr['1'] = '111213';
|
498 |
+
$chr['2'] = '111312';
|
499 |
+
$chr['3'] = '111411';
|
500 |
+
$chr['4'] = '121113';
|
501 |
+
$chr['5'] = '121212';
|
502 |
+
$chr['6'] = '121311';
|
503 |
+
$chr['7'] = '111114';
|
504 |
+
$chr['8'] = '131211';
|
505 |
+
$chr['9'] = '141111';
|
506 |
+
$chr['A'] = '211113';
|
507 |
+
$chr['B'] = '211212';
|
508 |
+
$chr['C'] = '211311';
|
509 |
+
$chr['D'] = '221112';
|
510 |
+
$chr['E'] = '221211';
|
511 |
+
$chr['F'] = '231111';
|
512 |
+
$chr['G'] = '112113';
|
513 |
+
$chr['H'] = '112212';
|
514 |
+
$chr['I'] = '112311';
|
515 |
+
$chr['J'] = '122112';
|
516 |
+
$chr['K'] = '132111';
|
517 |
+
$chr['L'] = '111123';
|
518 |
+
$chr['M'] = '111222';
|
519 |
+
$chr['N'] = '111321';
|
520 |
+
$chr['O'] = '121122';
|
521 |
+
$chr['P'] = '131121';
|
522 |
+
$chr['Q'] = '212112';
|
523 |
+
$chr['R'] = '212211';
|
524 |
+
$chr['S'] = '211122';
|
525 |
+
$chr['T'] = '211221';
|
526 |
+
$chr['U'] = '221121';
|
527 |
+
$chr['V'] = '222111';
|
528 |
+
$chr['W'] = '112122';
|
529 |
+
$chr['X'] = '112221';
|
530 |
+
$chr['Y'] = '122121';
|
531 |
+
$chr['Z'] = '123111';
|
532 |
+
$chr['-'] = '121131';
|
533 |
+
$chr['.'] = '311112';
|
534 |
+
$chr[' '] = '311211';
|
535 |
+
$chr['$'] = '321111';
|
536 |
+
$chr['/'] = '112131';
|
537 |
+
$chr['+'] = '113121';
|
538 |
+
$chr['%'] = '211131';
|
539 |
+
$chr[128] = '121221'; // ($)
|
540 |
+
$chr[129] = '311121'; // (/)
|
541 |
+
$chr[130] = '122211'; // (+)
|
542 |
+
$chr[131] = '312111'; // (%)
|
543 |
+
$chr['*'] = '111141';
|
544 |
+
$code = strtoupper($code);
|
545 |
+
$encode = array(
|
546 |
+
chr(0) => chr(131).'U', chr(1) => chr(128).'A', chr(2) => chr(128).'B', chr(3) => chr(128).'C',
|
547 |
+
chr(4) => chr(128).'D', chr(5) => chr(128).'E', chr(6) => chr(128).'F', chr(7) => chr(128).'G',
|
548 |
+
chr(8) => chr(128).'H', chr(9) => chr(128).'I', chr(10) => chr(128).'J', chr(11) => '£K',
|
549 |
+
chr(12) => chr(128).'L', chr(13) => chr(128).'M', chr(14) => chr(128).'N', chr(15) => chr(128).'O',
|
550 |
+
chr(16) => chr(128).'P', chr(17) => chr(128).'Q', chr(18) => chr(128).'R', chr(19) => chr(128).'S',
|
551 |
+
chr(20) => chr(128).'T', chr(21) => chr(128).'U', chr(22) => chr(128).'V', chr(23) => chr(128).'W',
|
552 |
+
chr(24) => chr(128).'X', chr(25) => chr(128).'Y', chr(26) => chr(128).'Z', chr(27) => chr(131).'A',
|
553 |
+
chr(28) => chr(131).'B', chr(29) => chr(131).'C', chr(30) => chr(131).'D', chr(31) => chr(131).'E',
|
554 |
+
chr(32) => ' ', chr(33) => chr(129).'A', chr(34) => chr(129).'B', chr(35) => chr(129).'C',
|
555 |
+
chr(36) => chr(129).'D', chr(37) => chr(129).'E', chr(38) => chr(129).'F', chr(39) => chr(129).'G',
|
556 |
+
chr(40) => chr(129).'H', chr(41) => chr(129).'I', chr(42) => chr(129).'J', chr(43) => chr(129).'K',
|
557 |
+
chr(44) => chr(129).'L', chr(45) => '-', chr(46) => '.', chr(47) => chr(129).'O',
|
558 |
+
chr(48) => '0', chr(49) => '1', chr(50) => '2', chr(51) => '3',
|
559 |
+
chr(52) => '4', chr(53) => '5', chr(54) => '6', chr(55) => '7',
|
560 |
+
chr(56) => '8', chr(57) => '9', chr(58) => chr(129).'Z', chr(59) => chr(131).'F',
|
561 |
+
chr(60) => chr(131).'G', chr(61) => chr(131).'H', chr(62) => chr(131).'I', chr(63) => chr(131).'J',
|
562 |
+
chr(64) => chr(131).'V', chr(65) => 'A', chr(66) => 'B', chr(67) => 'C',
|
563 |
+
chr(68) => 'D', chr(69) => 'E', chr(70) => 'F', chr(71) => 'G',
|
564 |
+
chr(72) => 'H', chr(73) => 'I', chr(74) => 'J', chr(75) => 'K',
|
565 |
+
chr(76) => 'L', chr(77) => 'M', chr(78) => 'N', chr(79) => 'O',
|
566 |
+
chr(80) => 'P', chr(81) => 'Q', chr(82) => 'R', chr(83) => 'S',
|
567 |
+
chr(84) => 'T', chr(85) => 'U', chr(86) => 'V', chr(87) => 'W',
|
568 |
+
chr(88) => 'X', chr(89) => 'Y', chr(90) => 'Z', chr(91) => chr(131).'K',
|
569 |
+
chr(92) => chr(131).'L', chr(93) => chr(131).'M', chr(94) => chr(131).'N', chr(95) => chr(131).'O',
|
570 |
+
chr(96) => chr(131).'W', chr(97) => chr(130).'A', chr(98) => chr(130).'B', chr(99) => chr(130).'C',
|
571 |
+
chr(100) => chr(130).'D', chr(101) => chr(130).'E', chr(102) => chr(130).'F', chr(103) => chr(130).'G',
|
572 |
+
chr(104) => chr(130).'H', chr(105) => chr(130).'I', chr(106) => chr(130).'J', chr(107) => chr(130).'K',
|
573 |
+
chr(108) => chr(130).'L', chr(109) => chr(130).'M', chr(110) => chr(130).'N', chr(111) => chr(130).'O',
|
574 |
+
chr(112) => chr(130).'P', chr(113) => chr(130).'Q', chr(114) => chr(130).'R', chr(115) => chr(130).'S',
|
575 |
+
chr(116) => chr(130).'T', chr(117) => chr(130).'U', chr(118) => chr(130).'V', chr(119) => chr(130).'W',
|
576 |
+
chr(120) => chr(130).'X', chr(121) => chr(130).'Y', chr(122) => chr(130).'Z', chr(123) => chr(131).'P',
|
577 |
+
chr(124) => chr(131).'Q', chr(125) => chr(131).'R', chr(126) => chr(131).'S', chr(127) => chr(131).'T');
|
578 |
+
$code_ext = '';
|
579 |
+
$clen = strlen($code);
|
580 |
+
for ($i = 0 ; $i < $clen; ++$i) {
|
581 |
+
if (ord($code[$i]) > 127) {
|
582 |
+
return false;
|
583 |
+
}
|
584 |
+
$code_ext .= $encode[$code[$i]];
|
585 |
+
}
|
586 |
+
// checksum
|
587 |
+
$checkdigit = $this->checksum_code93($code);
|
588 |
+
$code .= $checkdigit ;
|
589 |
+
// add start and stop codes
|
590 |
+
$code = '*'.$code.'*';
|
591 |
+
$bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array());
|
592 |
+
$k = 0;
|
593 |
+
$clen = strlen($code);
|
594 |
+
for ($i = 0; $i < $clen; ++$i) {
|
595 |
+
$char = $code[$i];
|
596 |
+
if(!isset($chr[$char])) {
|
597 |
+
// invalid character
|
598 |
+
return false;
|
599 |
+
}
|
600 |
+
for ($j = 0; $j < 6; ++$j) {
|
601 |
+
if (($j % 2) == 0) {
|
602 |
+
$t = true; // bar
|
603 |
+
} else {
|
604 |
+
$t = false; // space
|
605 |
+
}
|
606 |
+
$w = $chr[$char][$j];
|
607 |
+
$bararray['bcode'][$k] = array('t' => $t, 'w' => $w, 'h' => 1, 'p' => 0);
|
608 |
+
$bararray['maxw'] += $w;
|
609 |
+
++$k;
|
610 |
+
}
|
611 |
+
}
|
612 |
+
$bararray['bcode'][$k] = array('t' => true, 'w' => 1, 'h' => 1, 'p' => 0);
|
613 |
+
$bararray['maxw'] += 1;
|
614 |
+
++$k;
|
615 |
+
$bararray['checkdigit'] = $checkdigit;
|
616 |
+
return $bararray;
|
617 |
+
}
|
618 |
+
|
619 |
+
/**
|
620 |
+
* Calculate CODE 93 checksum (modulo 47).
|
621 |
+
*/
|
622 |
+
protected function checksum_code93($code) {
|
623 |
+
$chars = array(
|
624 |
+
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
|
625 |
+
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K',
|
626 |
+
'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V',
|
627 |
+
'W', 'X', 'Y', 'Z', '-', '.', ' ', '$', '/', '+', '%');
|
628 |
+
// translate special characters
|
629 |
+
$code = strtr($code, chr(128).chr(129).chr(130).chr(131), '$/+%');
|
630 |
+
$len = strlen($code);
|
631 |
+
// calculate check digit C
|
632 |
+
$p = 1;
|
633 |
+
$check = 0;
|
634 |
+
for ($i = ($len - 1); $i >= 0; --$i) {
|
635 |
+
$k = array_keys($chars, $code[$i]);
|
636 |
+
$check += ($k[0] * $p);
|
637 |
+
++$p;
|
638 |
+
if ($p > 20) {
|
639 |
+
$p = 1;
|
640 |
+
}
|
641 |
+
}
|
642 |
+
$check %= 47;
|
643 |
+
$c = $chars[$check];
|
644 |
+
$code .= $c;
|
645 |
+
// calculate check digit K
|
646 |
+
$p = 1;
|
647 |
+
$check = 0;
|
648 |
+
for ($i = $len; $i >= 0; --$i) {
|
649 |
+
$k = array_keys($chars, $code[$i]);
|
650 |
+
$check += ($k[0] * $p);
|
651 |
+
++$p;
|
652 |
+
if ($p > 15) {
|
653 |
+
$p = 1;
|
654 |
+
}
|
655 |
+
}
|
656 |
+
$check %= 47;
|
657 |
+
$k = $chars[$check];
|
658 |
+
return $c.$k;
|
659 |
+
}
|
660 |
+
|
661 |
+
/**
|
662 |
+
* Checksum for standard 2 of 5 barcodes.
|
663 |
+
*/
|
664 |
+
protected function checksum_s25($code) {
|
665 |
+
$len = strlen($code);
|
666 |
+
$sum = 0;
|
667 |
+
for ($i = 0; $i < $len; $i+=2) {
|
668 |
+
$sum += $code[$i];
|
669 |
+
}
|
670 |
+
$sum *= 3;
|
671 |
+
for ($i = 1; $i < $len; $i+=2) {
|
672 |
+
$sum += ($code[$i]);
|
673 |
+
}
|
674 |
+
$r = $sum % 10;
|
675 |
+
if($r > 0) {
|
676 |
+
$r = (10 - $r);
|
677 |
+
}
|
678 |
+
return $r;
|
679 |
+
}
|
680 |
+
|
681 |
+
/**
|
682 |
+
* MSI.
|
683 |
+
* Variation of Plessey code, with similar applications
|
684 |
+
* Contains digits (0 to 9) and encodes the data only in the width of bars.
|
685 |
+
*/
|
686 |
+
protected function barcode_msi($code, $checksum=false) {
|
687 |
+
$chr['0'] = '100100100100';
|
688 |
+
$chr['1'] = '100100100110';
|
689 |
+
$chr['2'] = '100100110100';
|
690 |
+
$chr['3'] = '100100110110';
|
691 |
+
$chr['4'] = '100110100100';
|
692 |
+
$chr['5'] = '100110100110';
|
693 |
+
$chr['6'] = '100110110100';
|
694 |
+
$chr['7'] = '100110110110';
|
695 |
+
$chr['8'] = '110100100100';
|
696 |
+
$chr['9'] = '110100100110';
|
697 |
+
$chr['A'] = '110100110100';
|
698 |
+
$chr['B'] = '110100110110';
|
699 |
+
$chr['C'] = '110110100100';
|
700 |
+
$chr['D'] = '110110100110';
|
701 |
+
$chr['E'] = '110110110100';
|
702 |
+
$chr['F'] = '110110110110';
|
703 |
+
if ($checksum) {
|
704 |
+
// add checksum
|
705 |
+
$clen = strlen($code);
|
706 |
+
$p = 2;
|
707 |
+
$check = 0;
|
708 |
+
for ($i = ($clen - 1); $i >= 0; --$i) {
|
709 |
+
$check += (hexdec($code[$i]) * $p);
|
710 |
+
++$p;
|
711 |
+
if ($p > 7) {
|
712 |
+
$p = 2;
|
713 |
+
}
|
714 |
+
}
|
715 |
+
$check %= 11;
|
716 |
+
if ($check > 0) {
|
717 |
+
$check = 11 - $check;
|
718 |
+
}
|
719 |
+
$code .= $check;
|
720 |
+
$checkdigit = $check;
|
721 |
+
}
|
722 |
+
$seq = '110'; // left guard
|
723 |
+
$clen = strlen($code);
|
724 |
+
for ($i = 0; $i < $clen; ++$i) {
|
725 |
+
$digit = $code[$i];
|
726 |
+
if (!isset($chr[$digit])) {
|
727 |
+
// invalid character
|
728 |
+
return false;
|
729 |
+
}
|
730 |
+
$seq .= $chr[$digit];
|
731 |
+
}
|
732 |
+
$seq .= '1001'; // right guard
|
733 |
+
$bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array());
|
734 |
+
$bararray['checkdigit'] = $checkdigit;
|
735 |
+
return $this->binseq_to_array($seq, $bararray);
|
736 |
+
}
|
737 |
+
|
738 |
+
/**
|
739 |
+
* Standard 2 of 5 barcodes.
|
740 |
+
* Used in airline ticket marking, photofinishing
|
741 |
+
* Contains digits (0 to 9) and encodes the data only in the width of bars.
|
742 |
+
*/
|
743 |
+
protected function barcode_s25($code, $checksum=false) {
|
744 |
+
$chr['0'] = '10101110111010';
|
745 |
+
$chr['1'] = '11101010101110';
|
746 |
+
$chr['2'] = '10111010101110';
|
747 |
+
$chr['3'] = '11101110101010';
|
748 |
+
$chr['4'] = '10101110101110';
|
749 |
+
$chr['5'] = '11101011101010';
|
750 |
+
$chr['6'] = '10111011101010';
|
751 |
+
$chr['7'] = '10101011101110';
|
752 |
+
$chr['8'] = '10101110111010';
|
753 |
+
$chr['9'] = '10111010111010';
|
754 |
+
if ($checksum) {
|
755 |
+
// add checksum
|
756 |
+
$checkdigit = $this->checksum_s25($code);
|
757 |
+
$code .= $checkdigit ;
|
758 |
+
}
|
759 |
+
if((strlen($code) % 2) != 0) {
|
760 |
+
// add leading zero if code-length is odd
|
761 |
+
$code = '0'.$code;
|
762 |
+
}
|
763 |
+
$seq = '11011010';
|
764 |
+
$clen = strlen($code);
|
765 |
+
for ($i = 0; $i < $clen; ++$i) {
|
766 |
+
$digit = $code[$i];
|
767 |
+
if (!isset($chr[$digit])) {
|
768 |
+
// invalid character
|
769 |
+
return false;
|
770 |
+
}
|
771 |
+
$seq .= $chr[$digit];
|
772 |
+
}
|
773 |
+
$seq .= '1101011';
|
774 |
+
$bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array());
|
775 |
+
$bararray['checkdigit'] = $checkdigit;
|
776 |
+
return $this->binseq_to_array($seq, $bararray);
|
777 |
+
}
|
778 |
+
|
779 |
+
/**
|
780 |
+
* Convert binary barcode sequence to barcode array
|
781 |
+
*/
|
782 |
+
protected function binseq_to_array($seq, $bararray) {
|
783 |
+
$len = strlen($seq);
|
784 |
+
$w = 0;
|
785 |
+
$k = 0;
|
786 |
+
for ($i = 0; $i < $len; ++$i) {
|
787 |
+
$w += 1;
|
788 |
+
if (($i == ($len - 1)) OR (($i < ($len - 1)) AND ($seq[$i] != $seq[($i+1)]))) {
|
789 |
+
if ($seq[$i] == '1') {
|
790 |
+
$t = true; // bar
|
791 |
+
} else {
|
792 |
+
$t = false; // space
|
793 |
+
}
|
794 |
+
$bararray['bcode'][$k] = array('t' => $t, 'w' => $w, 'h' => 1, 'p' => 0);
|
795 |
+
$bararray['maxw'] += $w;
|
796 |
+
++$k;
|
797 |
+
$w = 0;
|
798 |
+
}
|
799 |
+
}
|
800 |
+
return $bararray;
|
801 |
+
}
|
802 |
+
|
803 |
+
/**
|
804 |
+
* Interleaved 2 of 5 barcodes.
|
805 |
+
* Compact numeric code, widely used in industry, air cargo
|
806 |
+
* Contains digits (0 to 9) and encodes the data in the width of both bars and spaces.
|
807 |
+
*/
|
808 |
+
protected function barcode_i25($code, $checksum=false) {
|
809 |
+
$chr['0'] = '11221';
|
810 |
+
$chr['1'] = '21112';
|
811 |
+
$chr['2'] = '12112';
|
812 |
+
$chr['3'] = '22111';
|
813 |
+
$chr['4'] = '11212';
|
814 |
+
$chr['5'] = '21211';
|
815 |
+
$chr['6'] = '12211';
|
816 |
+
$chr['7'] = '11122';
|
817 |
+
$chr['8'] = '21121';
|
818 |
+
$chr['9'] = '12121';
|
819 |
+
$chr['A'] = '11';
|
820 |
+
$chr['Z'] = '21';
|
821 |
+
if ($checksum) {
|
822 |
+
// add checksum
|
823 |
+
$checkdigit = $this->checksum_s25($code);
|
824 |
+
$code .= $checkdigit ;
|
825 |
+
}
|
826 |
+
if((strlen($code) % 2) != 0) {
|
827 |
+
// add leading zero if code-length is odd
|
828 |
+
$code = '0'.$code;
|
829 |
+
}
|
830 |
+
// add start and stop codes
|
831 |
+
$code = 'AA'.strtolower($code).'ZA';
|
832 |
+
|
833 |
+
$bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array());
|
834 |
+
$k = 0;
|
835 |
+
$clen = strlen($code);
|
836 |
+
for ($i = 0; $i < $clen; $i = ($i + 2)) {
|
837 |
+
$char_bar = $code[$i];
|
838 |
+
$char_space = $code[$i+1];
|
839 |
+
if((!isset($chr[$char_bar])) OR (!isset($chr[$char_space]))) {
|
840 |
+
// invalid character
|
841 |
+
return false;
|
842 |
+
}
|
843 |
+
// create a bar-space sequence
|
844 |
+
$seq = '';
|
845 |
+
$chrlen = strlen($chr[$char_bar]);
|
846 |
+
for ($s = 0; $s < $chrlen; $s++){
|
847 |
+
$seq .= $chr[$char_bar][$s] . $chr[$char_space][$s];
|
848 |
+
}
|
849 |
+
$seqlen = strlen($seq);
|
850 |
+
for ($j = 0; $j < $seqlen; ++$j) {
|
851 |
+
if (($j % 2) == 0) {
|
852 |
+
$t = true; // bar
|
853 |
+
} else {
|
854 |
+
$t = false; // space
|
855 |
+
}
|
856 |
+
$x = $seq[$j];
|
857 |
+
if ($x == 2) { $w = $this->print_ratio; }
|
858 |
+
else { $w = 1; }
|
859 |
+
|
860 |
+
$bararray['bcode'][$k] = array('t' => $t, 'w' => $w, 'h' => 1, 'p' => 0);
|
861 |
+
$bararray['maxw'] += $w;
|
862 |
+
++$k;
|
863 |
+
}
|
864 |
+
}
|
865 |
+
$bararray['checkdigit'] = $checkdigit;
|
866 |
+
return $bararray;
|
867 |
+
}
|
868 |
+
|
869 |
+
/**
|
870 |
+
* C128 barcodes.
|
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
1068" type="C128A" />
|
875 |
+
$chr = array(
|
876 |
+
'212222', /* 00 */
|
877 |
+
'222122', /* 01 */
|
878 |
+
'222221', /* 02 */
|
879 |
+
'121223', /* 03 */
|
880 |
+
'121322', /* 04 */
|
881 |
+
'131222', /* 05 */
|
882 |
+
'122213', /* 06 */
|
883 |
+
'122312', /* 07 */
|
884 |
+
'132212', /* 08 */
|
885 |
+
'221213', /* 09 */
|
886 |
+
'221312', /* 10 */
|
887 |
+
'231212', /* 11 */
|
888 |
+
'112232', /* 12 */
|
889 |
+
'122132', /* 13 */
|
890 |
+
'122231', /* 14 */
|
891 |
+
'113222', /* 15 */
|
892 |
+
'123122', /* 16 */
|
893 |
+
'123221', /* 17 */
|
894 |
+
'223211', /* 18 */
|
895 |
+
'221132', /* 19 */
|
896 |
+
'221231', /* 20 */
|
897 |
+
'213212', /* 21 */
|
898 |
+
'223112', /* 22 */
|
899 |
+
'312131', /* 23 */
|
900 |
+
'311222', /* 24 */
|
901 |
+
'321122', /* 25 */
|
902 |
+
'321221', /* 26 */
|
903 |
+
'312212', /* 27 */
|
904 |
+
'322112', /* 28 */
|
905 |
+
'322211', /* 29 */
|
906 |
+
'212123', /* 30 */
|
907 |
+
'212321', /* 31 */
|
908 |
+
'232121', /* 32 */
|
909 |
+
'111323', /* 33 */
|
910 |
+
'131123', /* 34 */
|
911 |
+
'131321', /* 35 */
|
912 |
+
'112313', /* 36 */
|
913 |
+
'132113', /* 37 */
|
914 |
+
'132311', /* 38 */
|
915 |
+
'211313', /* 39 */
|
916 |
+
'231113', /* 40 */
|
917 |
+
'231311', /* 41 */
|
918 |
+
'112133', /* 42 */
|
919 |
+
'112331', /* 43 */
|
920 |
+
'132131', /* 44 */
|
921 |
+
'113123', /* 45 */
|
922 |
+
'113321', /* 46 */
|
923 |
+
'133121', /* 47 */
|
924 |
+
'313121', /* 48 */
|
925 |
+
'211331', /* 49 */
|
926 |
+
'231131', /* 50 */
|
927 |
+
'213113', /* 51 */
|
928 |
+
'213311', /* 52 */
|
929 |
+
'213131', /* 53 */
|
930 |
+
'311123', /* 54 */
|
931 |
+
'311321', /* 55 */
|
932 |
+
'331121', /* 56 */
|
933 |
+
'312113', /* 57 */
|
934 |
+
'312311', /* 58 */
|
935 |
+
'332111', /* 59 */
|
936 |
+
'314111', /* 60 */
|
937 |
+
'221411', /* 61 */
|
938 |
+
'431111', /* 62 */
|
939 |
+
'111224', /* 63 */
|
940 |
+
'111422', /* 64 */
|
941 |
+
'121124', /* 65 */
|
942 |
+
'121421', /* 66 */
|
943 |
+
'141122', /* 67 */
|
944 |
+
'141221', /* 68 */
|
945 |
+
'112214', /* 69 */
|
946 |
+
'112412', /* 70 */
|
947 |
+
'122114', /* 71 */
|
948 |
+
'122411', /* 72 */
|
949 |
+
'142112', /* 73 */
|
950 |
+
'142211', /* 74 */
|
951 |
+
'241211', /* 75 */
|
952 |
+
'221114', /* 76 */
|
953 |
+
'413111', /* 77 */
|
954 |
+
'241112', /* 78 */
|
955 |
+
'134111', /* 79 */
|
956 |
+
'111242', /* 80 */
|
957 |
+
'121142', /* 81 */
|
958 |
+
'121241', /* 82 */
|
959 |
+
'114212', /* 83 */
|
960 |
+
'124112', /* 84 */
|
961 |
+
'124211', /* 85 */
|
962 |
+
'411212', /* 86 */
|
963 |
+
'421112', /* 87 */
|
964 |
+
'421211', /* 88 */
|
965 |
+
'212141', /* 89 */
|
966 |
+
'214121', /* 90 */
|
967 |
+
'412121', /* 91 */
|
968 |
+
'111143', /* 92 */
|
969 |
+
'111341', /* 93 */
|
970 |
+
'131141', /* 94 */
|
971 |
+
'114113', /* 95 */
|
972 |
+
'114311', /* 96 */
|
973 |
+
'411113', /* 97 */
|
974 |
+
'411311', /* 98 */
|
975 |
+
'113141', /* 99 */
|
976 |
+
'114131', /* 100 */
|
977 |
+
'311141', /* 101 */
|
978 |
+
'411131', /* 102 */
|
979 |
+
'211412', /* 103 START A */
|
980 |
+
'211214', /* 104 START B */
|
981 |
+
'211232', /* 105 START C */
|
982 |
+
'233111', /* STOP */
|
983 |
+
'200000' /* END */
|
984 |
+
);
|
985 |
+
$keys = '';
|
986 |
+
switch(strtoupper($type)) {
|
987 |
+
case 'A': {
|
988 |
+
$startid = 103;
|
989 |
+
$keys = ' !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_';
|
990 |
+
for ($i = 0; $i < 32; ++$i) {
|
991 |
+
$keys .= chr($i);
|
992 |
+
}
|
993 |
+
break;
|
994 |
+
}
|
995 |
+
case 'B': {
|
996 |
+
$startid = 104;
|
997 |
+
$keys = ' !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~'.chr(127);
|
998 |
+
break;
|
999 |
+
}
|
1000 |
+
case 'C': {
|
1001 |
+
$startid = 105;
|
1002 |
+
$keys = '';
|
1003 |
+
if ((strlen($code) % 2) != 0) {
|
1004 |
+
// The length of barcode value must be even ($code). You must pad the number with zeros
|
1005 |
+
return false;
|
1006 |
+
}
|
1007 |
+
for ($i = 0; $i <= 99; ++$i) {
|
1008 |
+
$keys .= chr($i);
|
1009 |
+
}
|
1010 |
+
$new_code = '';
|
1011 |
+
$hclen = (strlen($code) / 2);
|
1012 |
+
for ($i = 0; $i < $hclen; ++$i) {
|
1013 |
+
$new_code .= chr(intval($code{(2 * $i)}.$code{(2 * $i + 1)}));
|
1014 |
+
}
|
1015 |
+
$code = $new_code;
|
1016 |
+
break;
|
1017 |
+
}
|
1018 |
+
default: {
|
1019 |
+
return false;
|
1020 |
+
}
|
1021 |
+
}
|
1022 |
+
|
1023 |
+
// calculate check character
|
1024 |
+
$sum = $startid;
|
1025 |
+
if ($ean) { $code = chr(102) . $code; } // Add FNC 1 - which identifies it as EAN-128
|
1026 |
+
$clen = strlen($code);
|
1027 |
+
for ($i = 0; $i < $clen; ++$i) {
|
1028 |
+
if ($ean && $i==0) { $sum += 102; }
|
1029 |
+
else { $sum += (strpos($keys, $code[$i]) * ($i+1)); }
|
1030 |
+
}
|
1031 |
+
$check = ($sum % 103);
|
1032 |
+
$checkdigit = $check ;
|
1033 |
+
// add start, check and stop codes
|
1034 |
+
$code = chr($startid).$code.chr($check).chr(106).chr(107);
|
1035 |
+
$bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array());
|
1036 |
+
$k = 0;
|
1037 |
+
$len = strlen($code);
|
1038 |
+
for ($i = 0; $i < $len; ++$i) {
|
1039 |
+
$ck = strpos($keys, $code[$i]);
|
1040 |
+
if (($i == 0) || ($ean && $i==1) | ($i > ($len-4))) {
|
1041 |
+
$char_num = ord($code[$i]);
|
1042 |
+
$seq = $chr[$char_num];
|
1043 |
+
} elseif(($ck >= 0) AND isset($chr[$ck])) {
|
1044 |
+
$seq = $chr[$ck];
|
1045 |
+
} else {
|
1046 |
+
// invalid character
|
1047 |
+
return false;
|
1048 |
+
}
|
1049 |
+
for ($j = 0; $j < 6; ++$j) {
|
1050 |
+
if (($j % 2) == 0) {
|
1051 |
+
$t = true; // bar
|
1052 |
+
} else {
|
1053 |
+
$t = false; // space
|
1054 |
+
}
|
1055 |
+
$w = $seq[$j];
|
1056 |
+
$bararray['bcode'][$k] = array('t' => $t, 'w' => $w, 'h' => 1, 'p' => 0);
|
1057 |
+
$bararray['maxw'] += $w;
|
1058 |
+
++$k;
|
1059 |
+
}
|
1060 |
+
}
|
1061 |
+
$bararray['checkdigit'] = $checkdigit;
|
1062 |
+
return $bararray;
|
1063 |
+
}
|
1064 |
+
|
1065 |
+
/**
|
1066 |
+
* EAN13 and UPC-A barcodes.
|
1067 |
+
* EAN13: European Article Numbering international retail product code
|
1068 |
+
* UPC-A: Universal product code seen on almost all retail products in the USA and Canada
|
1069 |
+
* UPC-E: Short version of UPC symbol
|
1070 |
+
*/
|
1071 |
+
protected function barcode_eanupc($code, $len=13) {
|
1072 |
+
$upce = false;
|
1073 |
+
$checkdigit = false;
|
1074 |
+
if ($len == 6) {
|
1075 |
+
$len = 12; // UPC-A
|
1076 |
+
$upce = true; // UPC-E mode
|
1077 |
+
}
|
1078 |
+
$data_len = $len - 1;
|
1079 |
+
//Padding
|
1080 |
+
$code = str_pad($code, $data_len, '0', STR_PAD_LEFT);
|
1081 |
+
$code_len = strlen($code);
|
1082 |
+
// calculate check digit
|
1083 |
+
$sum_a = 0;
|
1084 |
+
for ($i = 1; $i < $data_len; $i+=2) {
|
1085 |
+
$sum_a += $code[$i];
|
1086 |
+
}
|
1087 |
+
if ($len > 12) {
|
1088 |
+
$sum_a *= 3;
|
1089 |
+
}
|
1090 |
+
$sum_b = 0;
|
1091 |
+
for ($i = 0; $i < $data_len; $i+=2) {
|
1092 |
+
$sum_b += ($code[$i]);
|
1093 |
+
}
|
1094 |
+
if ($len < 13) {
|
1095 |
+
$sum_b *= 3;
|
1096 |
+
}
|
1097 |
+
$r = ($sum_a + $sum_b) % 10;
|
1098 |
+
if($r > 0) {
|
1099 |
+
$r = (10 - $r);
|
1100 |
+
}
|
1101 |
+
if ($code_len == $data_len) {
|
1102 |
+
// add check digit
|
1103 |
+
$code .= $r;
|
1104 |
+
$checkdigit = $r;
|
1105 |
+
} elseif ($r !== intval($code[$data_len])) {
|
1106 |
+
// wrong checkdigit
|
1107 |
+
return false;
|
1108 |
+
}
|
1109 |
+
if ($len == 12) {
|
1110 |
+
// UPC-A
|
1111 |
+
$code = '0'.$code;
|
1112 |
+
++$len;
|
1113 |
+
}
|
1114 |
+
if ($upce) {
|
1115 |
+
// convert UPC-A to UPC-E
|
1116 |
+
$tmp = substr($code, 4, 3);
|
1117 |
+
$prod_code = intval(substr($code,7,5)); // product code
|
1118 |
+
$invalid_upce = false;
|
1119 |
+
if (($tmp == '000') OR ($tmp == '100') OR ($tmp == '200')) {
|
1120 |
+
// manufacturer code ends in 000, 100, or 200
|
1121 |
+
$upce_code = substr($code, 2, 2).substr($code, 9, 3).substr($code, 4, 1);
|
1122 |
+
if ($prod_code > 999) { $invalid_upce = true; }
|
1123 |
+
} else {
|
1124 |
+
$tmp = substr($code, 5, 2);
|
1125 |
+
if ($tmp == '00') {
|
1126 |
+
// manufacturer code ends in 00
|
1127 |
+
$upce_code = substr($code, 2, 3).substr($code, 10, 2).'3';
|
1128 |
+
if ($prod_code > 99) { $invalid_upce = true; }
|
1129 |
+
} else {
|
1130 |
+
$tmp = substr($code, 6, 1);
|
1131 |
+
if ($tmp == '0') {
|
1132 |
+
// manufacturer code ends in 0
|
1133 |
+
$upce_code = substr($code, 2, 4).substr($code, 11, 1).'4';
|
1134 |
+
if ($prod_code > 9) { $invalid_upce = true; }
|
1135 |
+
} else {
|
1136 |
+
// manufacturer code does not end in zero
|
1137 |
+
$upce_code = substr($code, 2, 5).substr($code, 11, 1);
|
1138 |
+
if ($prod_code > 9) { $invalid_upce = true; }
|
1139 |
+
}
|
1140 |
+
}
|
1141 |
+
}
|
1142 |
+
if ($invalid_upce) { die("Error - UPC-A cannot produce a valid UPC-E barcode"); } // Error generating a UPCE code
|
1143 |
+
}
|
1144 |
+
//Convert digits to bars
|
1145 |
+
$codes = array(
|
1146 |
+
'A'=>array( // left odd parity
|
1147 |
+
'0'=>'0001101',
|
1148 |
+
'1'=>'0011001',
|
1149 |
+
'2'=>'0010011',
|
1150 |
+
'3'=>'0111101',
|
1151 |
+
'4'=>'0100011',
|
1152 |
+
'5'=>'0110001',
|
1153 |
+
'6'=>'0101111',
|
1154 |
+
'7'=>'0111011',
|
1155 |
+
'8'=>'0110111',
|
1156 |
+
'9'=>'0001011'),
|
1157 |
+
'B'=>array( // left even parity
|
1158 |
+
'0'=>'0100111',
|
1159 |
+
'1'=>'0110011',
|
1160 |
+
'2'=>'0011011',
|
1161 |
+
'3'=>'0100001',
|
1162 |
+
'4'=>'0011101',
|
1163 |
+
'5'=>'0111001',
|
1164 |
+
'6'=>'0000101',
|
1165 |
+
'7'=>'0010001',
|
1166 |
+
'8'=>'0001001',
|
1167 |
+
'9'=>'0010111'),
|
1168 |
+
'C'=>array( // right
|
1169 |
+
'0'=>'1110010',
|
1170 |
+
'1'=>'1100110',
|
1171 |
+
'2'=>'1101100',
|
1172 |
+
'3'=>'1000010',
|
1173 |
+
'4'=>'1011100',
|
1174 |
+
'5'=>'1001110',
|
1175 |
+
'6'=>'1010000',
|
1176 |
+
'7'=>'1000100',
|
1177 |
+
'8'=>'1001000',
|
1178 |
+
'9'=>'1110100')
|
1179 |
+
);
|
1180 |
+
$parities = array(
|
1181 |
+
'0'=>array('A','A','A','A','A','A'),
|
1182 |
+
'1'=>array('A','A','B','A','B','B'),
|
1183 |
+
'2'=>array('A','A','B','B','A','B'),
|
1184 |
+
'3'=>array('A','A','B','B','B','A'),
|
1185 |
+
'4'=>array('A','B','A','A','B','B'),
|
1186 |
+
'5'=>array('A','B','B','A','A','B'),
|
1187 |
+
'6'=>array('A','B','B','B','A','A'),
|
1188 |
+
'7'=>array('A','B','A','B','A','B'),
|
1189 |
+
'8'=>array('A','B','A','B','B','A'),
|
1190 |
+
'9'=>array('A','B','B','A','B','A')
|
1191 |
+
);
|
1192 |
+
$upce_parities = array();
|
1193 |
+
$upce_parities[0] = array(
|
1194 |
+
'0'=>array('B','B','B','A','A','A'),
|
1195 |
+
'1'=>array('B','B','A','B','A','A'),
|
1196 |
+
'2'=>array('B','B','A','A','B','A'),
|
1197 |
+
'3'=>array('B','B','A','A','A','B'),
|
1198 |
+
'4'=>array('B','A','B','B','A','A'),
|
1199 |
+
'5'=>array('B','A','A','B','B','A'),
|
1200 |
+
'6'=>array('B','A','A','A','B','B'),
|
1201 |
+
'7'=>array('B','A','B','A','B','A'),
|
1202 |
+
'8'=>array('B','A','B','A','A','B'),
|
1203 |
+
'9'=>array('B','A','A','B','A','B')
|
1204 |
+
);
|
1205 |
+
$upce_parities[1] = array(
|
1206 |
+
'0'=>array('A','A','A','B','B','B'),
|
1207 |
+
'1'=>array('A','A','B','A','B','B'),
|
1208 |
+
'2'=>array('A','A','B','B','A','B'),
|
1209 |
+
'3'=>array('A','A','B','B','B','A'),
|
1210 |
+
'4'=>array('A','B','A','A','B','B'),
|
1211 |
+
'5'=>array('A','B','B','A','A','B'),
|
1212 |
+
'6'=>array('A','B','B','B','A','A'),
|
1213 |
+
'7'=>array('A','B','A','B','A','B'),
|
1214 |
+
'8'=>array('A','B','A','B','B','A'),
|
1215 |
+
'9'=>array('A','B','B','A','B','A')
|
1216 |
+
);
|
1217 |
+
$k = 0;
|
1218 |
+
$seq = '101'; // left guard bar
|
1219 |
+
if ($upce) {
|
1220 |
+
$bararray = array('code' => $upce_code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array());
|
1221 |
+
$p = $upce_parities[$code{1}][$r];
|
1222 |
+
for ($i = 0; $i < 6; ++$i) {
|
1223 |
+
$seq .= $codes[$p[$i]][$upce_code[$i]];
|
1224 |
+
}
|
1225 |
+
$seq .= '010101'; // right guard bar
|
1226 |
+
} else {
|
1227 |
+
$bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array());
|
1228 |
+
$half_len = ceil($len / 2);
|
1229 |
+
if ($len == 8) {
|
1230 |
+
for ($i = 0; $i < $half_len; ++$i) {
|
1231 |
+
$seq .= $codes['A'][$code[$i]];
|
1232 |
+
}
|
1233 |
+
} else {
|
1234 |
+
$p = $parities[$code{0}];
|
1235 |
+
for ($i = 1; $i < $half_len; ++$i) {
|
1236 |
+
$seq .= $codes[$p[$i-1]][$code[$i]];
|
1237 |
+
}
|
1238 |
+
}
|
1239 |
+
$seq .= '01010'; // center guard bar
|
1240 |
+
for ($i = $half_len; $i < $len; ++$i) {
|
1241 |
+
$seq .= $codes['C'][$code[$i]];
|
1242 |
+
}
|
1243 |
+
$seq .= '101'; // right guard bar
|
1244 |
+
}
|
1245 |
+
$clen = strlen($seq);
|
1246 |
+
$w = 0;
|
1247 |
+
for ($i = 0; $i < $clen; ++$i) {
|
1248 |
+
$w += 1;
|
1249 |
+
if (($i == ($clen - 1)) OR (($i < ($clen - 1)) AND ($seq[$i] != $seq[($i+1)]))) {
|
1250 |
+
if ($seq[$i] == '1') {
|
1251 |
+
$t = true; // bar
|
1252 |
+
} else {
|
1253 |
+
$t = false; // space
|
1254 |
+
}
|
1255 |
+
$bararray['bcode'][$k] = array('t' => $t, 'w' => $w, 'h' => 1, 'p' => 0);
|
1256 |
+
$bararray['maxw'] += $w;
|
1257 |
+
++$k;
|
1258 |
+
$w = 0;
|
1259 |
+
}
|
1260 |
+
}
|
1261 |
+
$bararray['checkdigit'] = $checkdigit;
|
1262 |
+
return $bararray;
|
1263 |
+
}
|
1264 |
+
|
1265 |
+
/**
|
1266 |
+
* UPC-Based Extentions
|
1267 |
+
* 2-Digit Ext.: Used to indicate magazines and newspaper issue numbers
|
1268 |
+
* 5-Digit Ext.: Used to mark suggested retail price of books
|
1269 |
+
*/
|
1270 |
+
protected function barcode_eanext($code, $len=5) {
|
1271 |
+
//Padding
|
1272 |
+
$code = str_pad($code, $len, '0', STR_PAD_LEFT);
|
1273 |
+
// calculate check digit
|
1274 |
+
if ($len == 2) {
|
1275 |
+
$r = $code % 4;
|
1276 |
+
} elseif ($len == 5) {
|
1277 |
+
$r = (3 * ($code{0} + $code{2} + $code{4})) + (9 * ($code{1} + $code{3}));
|
1278 |
+
$r %= 10;
|
1279 |
+
} else {
|
1280 |
+
return false;
|
1281 |
+
}
|
1282 |
+
//Convert digits to bars
|
1283 |
+
$codes = array(
|
1284 |
+
'A'=>array( // left odd parity
|
1285 |
+
'0'=>'0001101',
|
1286 |
+
'1'=>'0011001',
|
1287 |
+
'2'=>'0010011',
|
1288 |
+
'3'=>'0111101',
|
1289 |
+
'4'=>'0100011',
|
1290 |
+
'5'=>'0110001',
|
1291 |
+
'6'=>'0101111',
|
1292 |
+
'7'=>'0111011',
|
1293 |
+
'8'=>'0110111',
|
1294 |
+
'9'=>'0001011'),
|
1295 |
+
'B'=>array( // left even parity
|
1296 |
+
'0'=>'0100111',
|
1297 |
+
'1'=>'0110011',
|
1298 |
+
'2'=>'0011011',
|
1299 |
+
'3'=>'0100001',
|
1300 |
+
'4'=>'0011101',
|
1301 |
+
'5'=>'0111001',
|
1302 |
+
'6'=>'0000101',
|
1303 |
+
'7'=>'0010001',
|
1304 |
+
'8'=>'0001001',
|
1305 |
+
'9'=>'0010111')
|
1306 |
+
);
|
1307 |
+
$parities = array();
|
1308 |
+
$parities[2] = array(
|
1309 |
+
'0'=>array('A','A'),
|
1310 |
+
'1'=>array('A','B'),
|
1311 |
+
'2'=>array('B','A'),
|
1312 |
+
'3'=>array('B','B')
|
1313 |
+
);
|
1314 |
+
$parities[5] = array(
|
1315 |
+
'0'=>array('B','B','A','A','A'),
|
1316 |
+
'1'=>array('B','A','B','A','A'),
|
1317 |
+
'2'=>array('B','A','A','B','A'),
|
1318 |
+
'3'=>array('B','A','A','A','B'),
|
1319 |
+
'4'=>array('A','B','B','A','A'),
|
1320 |
+
'5'=>array('A','A','B','B','A'),
|
1321 |
+
'6'=>array('A','A','A','B','B'),
|
1322 |
+
'7'=>array('A','B','A','B','A'),
|
1323 |
+
'8'=>array('A','B','A','A','B'),
|
1324 |
+
'9'=>array('A','A','B','A','B')
|
1325 |
+
);
|
1326 |
+
$p = $parities[$len][$r];
|
1327 |
+
$seq = '1011'; // left guard bar
|
1328 |
+
$seq .= $codes[$p[0]][$code{0}];
|
1329 |
+
for ($i = 1; $i < $len; ++$i) {
|
1330 |
+
$seq .= '01'; // separator
|
1331 |
+
$seq .= $codes[$p[$i]][$code[$i]];
|
1332 |
+
}
|
1333 |
+
$bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array());
|
1334 |
+
return $this->binseq_to_array($seq, $bararray);
|
1335 |
+
}
|
1336 |
+
|
1337 |
+
/**
|
1338 |
+
* POSTNET and PLANET barcodes.
|
1339 |
+
* Used by U.S. Postal Service for automated mail sorting
|
1340 |
+
*/
|
1341 |
+
protected function barcode_postnet($code, $planet=false) {
|
1342 |
+
// bar lenght
|
1343 |
+
if ($planet) {
|
1344 |
+
$barlen = Array(
|
1345 |
+
0 => Array(1,1,2,2,2),
|
1346 |
+
1 => Array(2,2,2,1,1),
|
1347 |
+
2 => Array(2,2,1,2,1),
|
1348 |
+
3 => Array(2,2,1,1,2),
|
1349 |
+
4 => Array(2,1,2,2,1),
|
1350 |
+
5 => Array(2,1,2,1,2),
|
1351 |
+
6 => Array(2,1,1,2,2),
|
1352 |
+
7 => Array(1,2,2,2,1),
|
1353 |
+
8 => Array(1,2,2,1,2),
|
1354 |
+
9 => Array(1,2,1,2,2)
|
1355 |
+
);
|
1356 |
+
} else {
|
1357 |
+
$barlen = Array(
|
1358 |
+
0 => Array(2,2,1,1,1),
|
1359 |
+
1 => Array(1,1,1,2,2),
|
1360 |
+
2 => Array(1,1,2,1,2),
|
1361 |
+
3 => Array(1,1,2,2,1),
|
1362 |
+
4 => Array(1,2,1,1,2),
|
1363 |
+
5 => Array(1,2,1,2,1),
|
1364 |
+
6 => Array(1,2,2,1,1),
|
1365 |
+
7 => Array(2,1,1,1,2),
|
1366 |
+
8 => Array(2,1,1,2,1),
|
1367 |
+
9 => Array(2,1,2,1,1)
|
1368 |
+
);
|
1369 |
+
}
|
1370 |
+
$bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 5, 'bcode' => array());
|
1371 |
+
$k = 0;
|
1372 |
+
$code = str_replace('-', '', $code);
|
1373 |
+
$code = str_replace(' ', '', $code);
|
1374 |
+
$len = strlen($code);
|
1375 |
+
// calculate checksum
|
1376 |
+
$sum = 0;
|
1377 |
+
for ($i = 0; $i < $len; ++$i) {
|
1378 |
+
$sum += intval($code[$i]);
|
1379 |
+
}
|
1380 |
+
$chkd = ($sum % 10);
|
1381 |
+
if($chkd > 0) {
|
1382 |
+
$chkd = (10 - $chkd);
|
1383 |
+
}
|
1384 |
+
$code .= $chkd;
|
1385 |
+
$checkdigit = $chkd;
|
1386 |
+
$len = strlen($code);
|
1387 |
+
// start bar
|
1388 |
+
$bararray['bcode'][$k++] = array('t' => 1, 'w' => 1, 'h' => 5, 'p' => 0);
|
1389 |
+
$bararray['bcode'][$k++] = array('t' => 0, 'w' => $this->gapwidth , 'h' => 5, 'p' => 0);
|
1390 |
+
$bararray['maxw'] += (1 + $this->gapwidth );
|
1391 |
+
for ($i = 0; $i < $len; ++$i) {
|
1392 |
+
for ($j = 0; $j < 5; ++$j) {
|
1393 |
+
$bh = $barlen[$code[$i]][$j];
|
1394 |
+
if ($bh == 2) {
|
1395 |
+
$h = 5;
|
1396 |
+
$p = 0;
|
1397 |
+
}
|
1398 |
+
else {
|
1399 |
+
$h = 2;
|
1400 |
+
$p = 3;
|
1401 |
+
}
|
1402 |
+
$bararray['bcode'][$k++] = array('t' => 1, 'w' => 1, 'h' => $h, 'p' => $p);
|
1403 |
+
$bararray['bcode'][$k++] = array('t' => 0, 'w' => $this->gapwidth , 'h' => 2, 'p' => 0);
|
1404 |
+
$bararray['maxw'] += (1 + $this->gapwidth );
|
1405 |
+
}
|
1406 |
+
}
|
1407 |
+
// end bar
|
1408 |
+
$bararray['bcode'][$k++] = array('t' => 1, 'w' => 1, 'h' => 5, 'p' => 0);
|
1409 |
+
$bararray['maxw'] += 1;
|
1410 |
+
$bararray['checkdigit'] = $checkdigit;
|
1411 |
+
return $bararray;
|
1412 |
+
}
|
1413 |
+
|
1414 |
+
/**
|
1415 |
+
* RM4SCC - CBC - KIX
|
1416 |
+
* RM4SCC (Royal Mail 4-state Customer Code) - CBC (Customer Bar Code) - KIX (Klant index - Customer index)
|
1417 |
+
* RM4SCC is the name of the barcode symbology used by the Royal Mail for its Cleanmail service.
|
1418 |
+
*/
|
1419 |
+
protected function barcode_rm4scc($code, $kix=false) {
|
1420 |
+
$notkix = !$kix;
|
1421 |
+
// bar mode
|
1422 |
+
// 1 = pos 1, length 2
|
1423 |
+
// 2 = pos 1, length 3
|
1424 |
+
// 3 = pos 2, length 1
|
1425 |
+
// 4 = pos 2, length 2
|
1426 |
+
$barmode = array(
|
1427 |
+
'0' => array(3,3,2,2),
|
1428 |
+
'1' => array(3,4,1,2),
|
1429 |
+
'2' => array(3,4,2,1),
|
1430 |
+
'3' => array(4,3,1,2),
|
1431 |
+
'4' => array(4,3,2,1),
|
1432 |
+
'5' => array(4,4,1,1),
|
1433 |
+
'6' => array(3,1,4,2),
|
1434 |
+
'7' => array(3,2,3,2),
|
1435 |
+
'8' => array(3,2,4,1),
|
1436 |
+
'9' => array(4,1,3,2),
|
1437 |
+
'A' => array(4,1,4,1),
|
1438 |
+
'B' => array(4,2,3,1),
|
1439 |
+
'C' => array(3,1,2,4),
|
1440 |
+
'D' => array(3,2,1,4),
|
1441 |
+
'E' => array(3,2,2,3),
|
1442 |
+
'F' => array(4,1,1,4),
|
1443 |
+
'G' => array(4,1,2,3),
|
1444 |
+
'H' => array(4,2,1,3),
|
1445 |
+
'I' => array(1,3,4,2),
|
1446 |
+
'J' => array(1,4,3,2),
|
1447 |
+
'K' => array(1,4,4,1),
|
1448 |
+
'L' => array(2,3,3,2),
|
1449 |
+
'M' => array(2,3,4,1),
|
1450 |
+
'N' => array(2,4,3,1),
|
1451 |
+
'O' => array(1,3,2,4),
|
1452 |
+
'P' => array(1,4,1,4),
|
1453 |
+
'Q' => array(1,4,2,3),
|
1454 |
+
'R' => array(2,3,1,4),
|
1455 |
+
'S' => array(2,3,2,3),
|
1456 |
+
'T' => array(2,4,1,3),
|
1457 |
+
'U' => array(1,1,4,4),
|
1458 |
+
'V' => array(1,2,3,4),
|
1459 |
+
'W' => array(1,2,4,3),
|
1460 |
+
'X' => array(2,1,3,4),
|
1461 |
+
'Y' => array(2,1,4,3),
|
1462 |
+
'Z' => array(2,2,3,3)
|
1463 |
+
);
|
1464 |
+
$code = strtoupper($code);
|
1465 |
+
$len = strlen($code);
|
1466 |
+
$bararray = array('code' => $code, 'maxw' => 0, 'maxh' => $this->daft['F'], 'bcode' => array());
|
1467 |
+
if ($notkix) {
|
1468 |
+
// table for checksum calculation (row,col)
|
1469 |
+
$checktable = array(
|
1470 |
+
'0' => array(1,1),
|
1471 |
+
'1' => array(1,2),
|
1472 |
+
'2' => array(1,3),
|
1473 |
+
'3' => array(1,4),
|
1474 |
+
'4' => array(1,5),
|
1475 |
+
'5' => array(1,0),
|
1476 |
+
'6' => array(2,1),
|
1477 |
+
'7' => array(2,2),
|
1478 |
+
'8' => array(2,3),
|
1479 |
+
'9' => array(2,4),
|
1480 |
+
'A' => array(2,5),
|
1481 |
+
'B' => array(2,0),
|
1482 |
+
'C' => array(3,1),
|
1483 |
+
'D' => array(3,2),
|
1484 |
+
'E' => array(3,3),
|
1485 |
+
'F' => array(3,4),
|
1486 |
+
'G' => array(3,5),
|
1487 |
+
'H' => array(3,0),
|
1488 |
+
'I' => array(4,1),
|
1489 |
+
'J' => array(4,2),
|
1490 |
+
'K' => array(4,3),
|
1491 |
+
'L' => array(4,4),
|
1492 |
+
'M' => array(4,5),
|
1493 |
+
'N' => array(4,0),
|
1494 |
+
'O' => array(5,1),
|
1495 |
+
'P' => array(5,2),
|
1496 |
+
'Q' => array(5,3),
|
1497 |
+
'R' => array(5,4),
|
1498 |
+
'S' => array(5,5),
|
1499 |
+
'T' => array(5,0),
|
1500 |
+
'U' => array(0,1),
|
1501 |
+
'V' => array(0,2),
|
1502 |
+
'W' => array(0,3),
|
1503 |
+
'X' => array(0,4),
|
1504 |
+
'Y' => array(0,5),
|
1505 |
+
'Z' => array(0,0)
|
1506 |
+
);
|
1507 |
+
$row = 0;
|
1508 |
+
$col = 0;
|
1509 |
+
for ($i = 0; $i < $len; ++$i) {
|
1510 |
+
$row += $checktable[$code[$i]][0];
|
1511 |
+
$col += $checktable[$code[$i]][1];
|
1512 |
+
}
|
1513 |
+
$row %= 6;
|
1514 |
+
$col %= 6;
|
1515 |
+
$chk = array_keys($checktable, array($row,$col));
|
1516 |
+
$code .= $chk[0];
|
1517 |
+
$bararray['checkdigit'] = $chk[0];
|
1518 |
+
++$len;
|
1519 |
+
}
|
1520 |
+
$k = 0;
|
1521 |
+
if ($notkix) {
|
1522 |
+
// start bar
|
1523 |
+
$bararray['bcode'][$k++] = array('t' => 1, 'w' => 1, 'h' => $this->daft['A'] , 'p' => 0);
|
1524 |
+
$bararray['bcode'][$k++] = array('t' => 0, 'w' => $this->gapwidth , 'h' => $this->daft['A'] , 'p' => 0);
|
1525 |
+
$bararray['maxw'] += (1 + $this->gapwidth) ;
|
1526 |
+
}
|
1527 |
+
for ($i = 0; $i < $len; ++$i) {
|
1528 |
+
for ($j = 0; $j < 4; ++$j) {
|
1529 |
+
switch ($barmode[$code[$i]][$j]) {
|
1530 |
+
case 1: {
|
1531 |
+
// ascender (A)
|
1532 |
+
$p = 0;
|
1533 |
+
$h = $this->daft['A'];
|
1534 |
+
break;
|
1535 |
+
}
|
1536 |
+
case 2: {
|
1537 |
+
// full bar (F)
|
1538 |
+
$p = 0;
|
1539 |
+
$h = $this->daft['F'];
|
1540 |
+
break;
|
1541 |
+
}
|
1542 |
+
case 3: {
|
1543 |
+
// tracker (T)
|
1544 |
+
$p = ($this->daft['F'] - $this->daft['T'])/2;
|
1545 |
+
$h = $this->daft['T'];
|
1546 |
+
break;
|
1547 |
+
}
|
1548 |
+
case 4: {
|
1549 |
+
// descender (D)
|
1550 |
+
$p = $this->daft['F'] - $this->daft['D'];
|
1551 |
+
$h = $this->daft['D'];
|
1552 |
+
break;
|
1553 |
+
}
|
1554 |
+
}
|
1555 |
+
|
1556 |
+
$bararray['bcode'][$k++] = array('t' => 1, 'w' => 1, 'h' => $h, 'p' => $p);
|
1557 |
+
$bararray['bcode'][$k++] = array('t' => 0, 'w' => $this->gapwidth, 'h' => 2, 'p' => 0);
|
1558 |
+
$bararray['maxw'] += (1 + $this->gapwidth) ;
|
1559 |
+
}
|
1560 |
+
}
|
1561 |
+
if ($notkix) {
|
1562 |
+
// stop bar
|
1563 |
+
$bararray['bcode'][$k++] = array('t' => 1, 'w' => 1, 'h' => $this->daft['F'], 'p' => 0);
|
1564 |
+
$bararray['maxw'] += 1;
|
1565 |
+
}
|
1566 |
+
return $bararray;
|
1567 |
+
}
|
1568 |
+
|
1569 |
+
/**
|
1570 |
+
* CODABAR barcodes.
|
1571 |
+
* Older code often used in library systems, sometimes in blood banks
|
1572 |
+
*/
|
1573 |
+
protected function barcode_codabar($code) {
|
1574 |
+
$chr = array(
|
1575 |
+
'0' => '11111221',
|
1576 |
+
'1' => '11112211',
|
1577 |
+
'2' => '11121121',
|
1578 |
+
'3' => '22111111',
|
1579 |
+
'4' => '11211211',
|
1580 |
+
'5' => '21111211',
|
1581 |
+
'6' => '12111121',
|
1582 |
+
'7' => '12112111',
|
1583 |
+
'8' => '12211111',
|
1584 |
+
'9' => '21121111',
|
1585 |
+
'-' => '11122111',
|
1586 |
+
'$' => '11221111',
|
1587 |
+
':' => '21112121',
|
1588 |
+
'/' => '21211121',
|
1589 |
+
'.' => '21212111',
|
1590 |
+
'+' => '11222221',
|
1591 |
+
'A' => '11221211',
|
1592 |
+
'B' => '12121121',
|
1593 |
+
'C' => '11121221',
|
1594 |
+
'D' => '11122211'
|
1595 |
+
);
|
1596 |
+
$bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array());
|
1597 |
+
$k = 0;
|
1598 |
+
$w = 0;
|
1599 |
+
$seq = '';
|
1600 |
+
$code = strtoupper($code);
|
1601 |
+
$len = strlen($code);
|
1602 |
+
for ($i = 0; $i < $len; ++$i) {
|
1603 |
+
if (!isset($chr[$code[$i]])) {
|
1604 |
+
return false;
|
1605 |
+
}
|
1606 |
+
$seq = $chr[$code[$i]];
|
1607 |
+
for ($j = 0; $j < 8; ++$j) {
|
1608 |
+
if (($j % 2) == 0) {
|
1609 |
+
$t = true; // bar
|
1610 |
+
} else {
|
1611 |
+
$t = false; // space
|
1612 |
+
}
|
1613 |
+
$x = $seq[$j];
|
1614 |
+
if ($x == 2) { $w = $this->print_ratio; }
|
1615 |
+
else { $w = 1; }
|
1616 |
+
$bararray['bcode'][$k] = array('t' => $t, 'w' => $w, 'h' => 1, 'p' => 0);
|
1617 |
+
$bararray['maxw'] += $w;
|
1618 |
+
++$k;
|
1619 |
+
}
|
1620 |
+
}
|
1621 |
+
return $bararray;
|
1622 |
+
}
|
1623 |
+
|
1624 |
+
/**
|
1625 |
+
* CODE11 barcodes.
|
1626 |
+
* Used primarily for labeling telecommunications equipment
|
1627 |
+
*/
|
1628 |
+
protected function barcode_code11($code) {
|
1629 |
+
$chr = array(
|
1630 |
+
'0' => '111121',
|
1631 |
+
'1' => '211121',
|
1632 |
+
'2' => '121121',
|
1633 |
+
'3' => '221111',
|
1634 |
+
'4' => '112121',
|
1635 |
+
'5' => '212111',
|
1636 |
+
'6' => '122111',
|
1637 |
+
'7' => '111221',
|
1638 |
+
'8' => '211211',
|
1639 |
+
'9' => '211111',
|
1640 |
+
'-' => '112111',
|
1641 |
+
'S' => '112211'
|
1642 |
+
);
|
1643 |
+
|
1644 |
+
$bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array());
|
1645 |
+
$k = 0;
|
1646 |
+
$w = 0;
|
1647 |
+
$seq = '';
|
1648 |
+
$len = strlen($code);
|
1649 |
+
// calculate check digit C
|
1650 |
+
$p = 1;
|
1651 |
+
$check = 0;
|
1652 |
+
for ($i = ($len - 1); $i >= 0; --$i) {
|
1653 |
+
$digit = $code[$i];
|
1654 |
+
if ($digit == '-') {
|
1655 |
+
$dval = 10;
|
1656 |
+
} else {
|
1657 |
+
$dval = intval($digit);
|
1658 |
+
}
|
1659 |
+
$check += ($dval * $p);
|
1660 |
+
++$p;
|
1661 |
+
if ($p > 10) {
|
1662 |
+
$p = 1;
|
1663 |
+
}
|
1664 |
+
}
|
1665 |
+
$check %= 11;
|
1666 |
+
if ($check == 10) {
|
1667 |
+
$check = '-';
|
1668 |
+
}
|
1669 |
+
$code .= $check;
|
1670 |
+
$checkdigit = $check;
|
1671 |
+
if ($len > 10) {
|
1672 |
+
// calculate check digit K
|
1673 |
+
$p = 1;
|
1674 |
+
$check = 0;
|
1675 |
+
for ($i = $len; $i >= 0; --$i) {
|
1676 |
+
$digit = $code[$i];
|
1677 |
+
if ($digit == '-') {
|
1678 |
+
$dval = 10;
|
1679 |
+
} else {
|
1680 |
+
$dval = intval($digit);
|
1681 |
+
}
|
1682 |
+
$check += ($dval * $p);
|
1683 |
+
++$p;
|
1684 |
+
if ($p > 9) {
|
1685 |
+
$p = 1;
|
1686 |
+
}
|
1687 |
+
}
|
1688 |
+
$check %= 11;
|
1689 |
+
$code .= $check;
|
1690 |
+
$checkdigit .= $check;
|
1691 |
+
++$len;
|
1692 |
+
}
|
1693 |
+
$code = 'S'.$code.'S';
|
1694 |
+
$len += 3;
|
1695 |
+
for ($i = 0; $i < $len; ++$i) {
|
1696 |
+
if (!isset($chr[$code[$i]])) {
|
1697 |
+
return false;
|
1698 |
+
}
|
1699 |
+
$seq = $chr[$code[$i]];
|
1700 |
+
for ($j = 0; $j < 6; ++$j) {
|
1701 |
+
if (($j % 2) == 0) {
|
1702 |
+
$t = true; // bar
|
1703 |
+
} else {
|
1704 |
+
$t = false; // space
|
1705 |
+
}
|
1706 |
+
$x = $seq[$j];
|
1707 |
+
if ($x == 2) { $w = $this->print_ratio; }
|
1708 |
+
else { $w = 1; }
|
1709 |
+
$bararray['bcode'][$k] = array('t' => $t, 'w' => $w, 'h' => 1, 'p' => 0);
|
1710 |
+
$bararray['maxw'] += $w;
|
1711 |
+
++$k;
|
1712 |
+
}
|
1713 |
+
}
|
1714 |
+
$bararray['checkdigit'] = $checkdigit;
|
1715 |
+
return $bararray;
|
1716 |
+
}
|
1717 |
+
|
1718 |
+
|
1719 |
+
/**
|
1720 |
+
* IMB - Intelligent Mail Barcode - Onecode - USPS-B-3200
|
1721 |
+
* (requires PHP bcmath extension)
|
1722 |
+
* Intelligent Mail barcode is a 65-bar code for use on mail in the United States.
|
1723 |
+
* The fields are described as follows:<ul><li>The Barcode Identifier shall be assigned by USPS to encode the presort identification that is currently printed in human readable form on the optional endorsement line (OEL) as well as for future USPS use. This shall be two digits, with the second digit in the range of 0-4. The allowable encoding ranges shall be 00-04, 10-14, 20-24, 30-34, 40-44, 50-54, 60-64, 70-74, 80-84, and 90-94.</li><li>The Service Type Identifier shall be assigned by USPS for any combination of services requested on the mailpiece. The allowable encoding range shall be 000-999. Each 3-digit value shall correspond to a particular mail class with a particular combination of service(s). Each service program, such as OneCode Confirm and OneCode ACS, shall provide the list of Service Type Identifier values.</li><li>The Mailer or Customer Identifier shall be assigned by USPS as a unique, 6 or 9 digit number that identifies a business entity. The allowable encoding range for the 6 digit Mailer ID shall be 000000- 899999, while the allowable encoding range for the 9 digit Mailer ID shall be 900000000-999999999.</li><li>The Serial or Sequence Number shall be assigned by the mailer for uniquely identifying and tracking mailpieces. The allowable encoding range shall be 000000000-999999999 when used with a 6 digit Mailer ID and 000000-999999 when used with a 9 digit Mailer ID. e. The Delivery Point ZIP Code shall be assigned by the mailer for routing the mailpiece. This shall replace POSTNET for routing the mailpiece to its final delivery point. The length may be 0, 5, 9, or 11 digits. The allowable encoding ranges shall be no ZIP Code, 00000-99999, 000000000-999999999, and 00000000000-99999999999.</li></ul>
|
1724 |
+
*/
|
1725 |
+
protected function barcode_imb($code) {
|
1726 |
+
$asc_chr = array(4,0,2,6,3,5,1,9,8,7,1,2,0,6,4,8,2,9,5,3,0,1,3,7,4,6,8,9,2,0,5,1,9,4,3,8,6,7,1,2,4,3,9,5,7,8,3,0,2,1,4,0,9,1,7,0,2,4,6,3,7,1,9,5,8);
|
1727 |
+
$dsc_chr = array(7,1,9,5,8,0,2,4,6,3,5,8,9,7,3,0,6,1,7,4,6,8,9,2,5,1,7,5,4,3,8,7,6,0,2,5,4,9,3,0,1,6,8,2,0,4,5,9,6,7,5,2,6,3,8,5,1,9,8,7,4,0,2,6,3);
|
1728 |
+
$asc_pos = array(3,0,8,11,1,12,8,11,10,6,4,12,2,7,9,6,7,9,2,8,4,0,12,7,10,9,0,7,10,5,7,9,6,8,2,12,1,4,2,0,1,5,4,6,12,1,0,9,4,7,5,10,2,6,9,11,2,12,6,7,5,11,0,3,2);
|
1729 |
+
$dsc_pos = array(2,10,12,5,9,1,5,4,3,9,11,5,10,1,6,3,4,1,10,0,2,11,8,6,1,12,3,8,6,4,4,11,0,6,1,9,11,5,3,7,3,10,7,11,8,2,10,3,5,8,0,3,12,11,8,4,5,1,3,0,7,12,9,8,10);
|
1730 |
+
$code_arr = explode('-', $code);
|
1731 |
+
$tracking_number = $code_arr[0];
|
1732 |
+
if (isset($code_arr[1])) {
|
1733 |
+
$routing_code = $code_arr[1];
|
1734 |
+
} else {
|
1735 |
+
$routing_code = '';
|
1736 |
+
}
|
1737 |
+
// Conversion of Routing Code
|
1738 |
+
switch (strlen($routing_code)) {
|
1739 |
+
case 0: {
|
1740 |
+
$binary_code = 0;
|
1741 |
+
break;
|
1742 |
+
}
|
1743 |
+
case 5: {
|
1744 |
+
$binary_code = bcadd($routing_code, '1');
|
1745 |
+
break;
|
1746 |
+
}
|
1747 |
+
case 9: {
|
1748 |
+
$binary_code = bcadd($routing_code, '100001');
|
1749 |
+
break;
|
1750 |
+
}
|
1751 |
+
case 11: {
|
1752 |
+
$binary_code = bcadd($routing_code, '1000100001');
|
1753 |
+
break;
|
1754 |
+
}
|
1755 |
+
default: {
|
1756 |
+
return false;
|
1757 |
+
break;
|
1758 |
+
}
|
1759 |
+
}
|
1760 |
+
$binary_code = bcmul($binary_code, 10);
|
1761 |
+
$binary_code = bcadd($binary_code, $tracking_number{0});
|
1762 |
+
$binary_code = bcmul($binary_code, 5);
|
1763 |
+
$binary_code = bcadd($binary_code, $tracking_number{1});
|
1764 |
+
$binary_code .= substr($tracking_number, 2, 18);
|
1765 |
+
// convert to hexadecimal
|
1766 |
+
$binary_code = $this->dec_to_hex($binary_code);
|
1767 |
+
// pad to get 13 bytes
|
1768 |
+
$binary_code = str_pad($binary_code, 26, '0', STR_PAD_LEFT);
|
1769 |
+
// convert string to array of bytes
|
1770 |
+
$binary_code_arr = chunk_split($binary_code, 2, "\r");
|
1771 |
+
$binary_code_arr = substr($binary_code_arr, 0, -1);
|
1772 |
+
$binary_code_arr = explode("\r", $binary_code_arr);
|
1773 |
+
// calculate frame check sequence
|
1774 |
+
$fcs = $this->imb_crc11fcs($binary_code_arr);
|
1775 |
+
// exclude first 2 bits from first byte
|
1776 |
+
$first_byte = sprintf('%2s', dechex((hexdec($binary_code_arr[0]) << 2) >> 2));
|
1777 |
+
$binary_code_102bit = $first_byte.substr($binary_code, 2);
|
1778 |
+
// convert binary data to codewords
|
1779 |
+
$codewords = array();
|
1780 |
+
$data = $this->hex_to_dec($binary_code_102bit);
|
1781 |
+
$codewords[0] = bcmod($data, 636) * 2;
|
1782 |
+
$data = bcdiv($data, 636);
|
1783 |
+
for ($i = 1; $i < 9; ++$i) {
|
1784 |
+
$codewords[$i] = bcmod($data, 1365);
|
1785 |
+
$data = bcdiv($data, 1365);
|
1786 |
+
}
|
1787 |
+
$codewords[9] = $data;
|
1788 |
+
if (($fcs >> 10) == 1) {
|
1789 |
+
$codewords[9] += 659;
|
1790 |
+
}
|
1791 |
+
// generate lookup tables
|
1792 |
+
$table2of13 = $this->imb_tables(2, 78);
|
1793 |
+
$table5of13 = $this->imb_tables(5, 1287);
|
1794 |
+
// convert codewords to characters
|
1795 |
+
$characters = array();
|
1796 |
+
$bitmask = 512;
|
1797 |
+
foreach($codewords as $k => $val) {
|
1798 |
+
if ($val <= 1286) {
|
1799 |
+
$chrcode = $table5of13[$val];
|
1800 |
+
} else {
|
1801 |
+
$chrcode = $table2of13[($val - 1287)];
|
1802 |
+
}
|
1803 |
+
if (($fcs & $bitmask) > 0) {
|
1804 |
+
// bitwise invert
|
1805 |
+
$chrcode = ((~$chrcode) & 8191);
|
1806 |
+
}
|
1807 |
+
$characters[] = $chrcode;
|
1808 |
+
$bitmask /= 2;
|
1809 |
+
}
|
1810 |
+
$characters = array_reverse($characters);
|
1811 |
+
// build bars
|
1812 |
+
$k = 0;
|
1813 |
+
$bararray = array('code' => $code, 'maxw' => 0, 'maxh' => $this->daft['F'], 'bcode' => array());
|
1814 |
+
for ($i = 0; $i < 65; ++$i) {
|
1815 |
+
$asc = (($characters[$asc_chr[$i]] & pow(2, $asc_pos[$i])) > 0);
|
1816 |
+
$dsc = (($characters[$dsc_chr[$i]] & pow(2, $dsc_pos[$i])) > 0);
|
1817 |
+
if ($asc AND $dsc) {
|
1818 |
+
// full bar (F)
|
1819 |
+
$p = 0;
|
1820 |
+
$h = $this->daft['F'];
|
1821 |
+
} elseif ($asc) {
|
1822 |
+
// ascender (A)
|
1823 |
+
$p = 0;
|
1824 |
+
$h = $this->daft['A'];
|
1825 |
+
} elseif ($dsc) {
|
1826 |
+
// descender (D)
|
1827 |
+
$p = $this->daft['F'] - $this->daft['D'];
|
1828 |
+
$h = $this->daft['D'];
|
1829 |
+
} else {
|
1830 |
+
// tracker (T)
|
1831 |
+
$p = ($this->daft['F'] - $this->daft['T'])/2;
|
1832 |
+
$h = $this->daft['T'];
|
1833 |
+
}
|
1834 |
+
$bararray['bcode'][$k++] = array('t' => 1, 'w' => 1, 'h' => $h, 'p' => $p);
|
1835 |
+
// Gap
|
1836 |
+
$bararray['bcode'][$k++] = array('t' => 0, 'w' => $this->gapwidth , 'h' => 1, 'p' => 0);
|
1837 |
+
$bararray['maxw'] += (1 + $this->gapwidth );
|
1838 |
+
}
|
1839 |
+
unset($bararray['bcode'][($k - 1)]);
|
1840 |
+
$bararray['maxw'] -= $this->gapwidth ;
|
1841 |
+
return $bararray;
|
1842 |
+
}
|
1843 |
+
|
1844 |
+
/**
|
1845 |
+
* Convert large integer number to hexadecimal representation.
|
1846 |
+
* (requires PHP bcmath extension)
|
1847 |
+
*/
|
1848 |
+
public function dec_to_hex($number) {
|
1849 |
+
$i = 0;
|
1850 |
+
$hex = array();
|
1851 |
+
if($number == 0) {
|
1852 |
+
return '00';
|
1853 |
+
}
|
1854 |
+
while($number > 0) {
|
1855 |
+
if($number == 0) {
|
1856 |
+
array_push($hex, '0');
|
1857 |
+
} else {
|
1858 |
+
array_push($hex, strtoupper(dechex(bcmod($number, '16'))));
|
1859 |
+
$number = bcdiv($number, '16', 0);
|
1860 |
+
}
|
1861 |
+
}
|
1862 |
+
$hex = array_reverse($hex);
|
1863 |
+
return implode($hex);
|
1864 |
+
}
|
1865 |
+
|
1866 |
+
/**
|
1867 |
+
* Convert large hexadecimal number to decimal representation (string).
|
1868 |
+
* (requires PHP bcmath extension)
|
1869 |
+
*/
|
1870 |
+
public function hex_to_dec($hex) {
|
1871 |
+
$dec = 0;
|
1872 |
+
$bitval = 1;
|
1873 |
+
$len = strlen($hex);
|
1874 |
+
for($pos = ($len - 1); $pos >= 0; --$pos) {
|
1875 |
+
$dec = bcadd($dec, bcmul(hexdec($hex[$pos]), $bitval));
|
1876 |
+
$bitval = bcmul($bitval, 16);
|
1877 |
+
}
|
1878 |
+
return $dec;
|
1879 |
+
}
|
1880 |
+
|
1881 |
+
/**
|
1882 |
+
* Intelligent Mail Barcode calculation of Frame Check Sequence
|
1883 |
+
*/
|
1884 |
+
protected function imb_crc11fcs($code_arr) {
|
1885 |
+
$genpoly = 0x0F35; // generator polynomial
|
1886 |
+
$fcs = 0x07FF; // Frame Check Sequence
|
1887 |
+
// do most significant byte skipping the 2 most significant bits
|
1888 |
+
$data = hexdec($code_arr[0]) << 5;
|
1889 |
+
for ($bit = 2; $bit < 8; ++$bit) {
|
1890 |
+
if (($fcs ^ $data) & 0x400) {
|
1891 |
+
$fcs = ($fcs << 1) ^ $genpoly;
|
1892 |
+
} else {
|
1893 |
+
$fcs = ($fcs << 1);
|
1894 |
+
}
|
1895 |
+
$fcs &= 0x7FF;
|
1896 |
+
$data <<= 1;
|
1897 |
+
}
|
1898 |
+
// do rest of bytes
|
1899 |
+
for ($byte = 1; $byte < 13; ++$byte) {
|
1900 |
+
$data = hexdec($code_arr[$byte]) << 3;
|
1901 |
+
for ($bit = 0; $bit < 8; ++$bit) {
|
1902 |
+
if (($fcs ^ $data) & 0x400) {
|
1903 |
+
$fcs = ($fcs << 1) ^ $genpoly;
|
1904 |
+
} else {
|
1905 |
+
$fcs = ($fcs << 1);
|
1906 |
+
}
|
1907 |
+
$fcs &= 0x7FF;
|
1908 |
+
$data <<= 1;
|
1909 |
+
}
|
1910 |
+
}
|
1911 |
+
return $fcs;
|
1912 |
+
}
|
1913 |
+
|
1914 |
+
/**
|
1915 |
+
* Reverse unsigned short value
|
1916 |
+
*/
|
1917 |
+
protected function imb_reverse_us($num) {
|
1918 |
+
$rev = 0;
|
1919 |
+
for ($i = 0; $i < 16; ++$i) {
|
1920 |
+
$rev <<= 1;
|
1921 |
+
$rev |= ($num & 1);
|
1922 |
+
$num >>= 1;
|
1923 |
+
}
|
1924 |
+
return $rev;
|
1925 |
+
}
|
1926 |
+
|
1927 |
+
/**
|
1928 |
+
* generate Nof13 tables used for Intelligent Mail Barcode
|
1929 |
+
*/
|
1930 |
+
protected function imb_tables($n, $size) {
|
1931 |
+
$table = array();
|
1932 |
+
$lli = 0; // LUT lower index
|
1933 |
+
$lui = $size - 1; // LUT upper index
|
1934 |
+
for ($count = 0; $count < 8192; ++$count) {
|
1935 |
+
$bit_count = 0;
|
1936 |
+
for ($bit_index = 0; $bit_index < 13; ++$bit_index) {
|
1937 |
+
$bit_count += intval(($count & (1 << $bit_index)) != 0);
|
1938 |
+
}
|
1939 |
+
// if we don't have the right number of bits on, go on to the next value
|
1940 |
+
if ($bit_count == $n) {
|
1941 |
+
$reverse = ($this->imb_reverse_us($count) >> 3);
|
1942 |
+
// if the reverse is less than count, we have already visited this pair before
|
1943 |
+
if ($reverse >= $count) {
|
1944 |
+
// If count is symmetric, place it at the first free slot from the end of the list.
|
1945 |
+
// Otherwise, place it at the first free slot from the beginning of the list AND place $reverse ath the next free slot from the beginning of the list
|
1946 |
+
if ($reverse == $count) {
|
1947 |
+
$table[$lui] = $count;
|
1948 |
+
--$lui;
|
1949 |
+
} else {
|
1950 |
+
$table[$lli] = $count;
|
1951 |
+
++$lli;
|
1952 |
+
$table[$lli] = $reverse;
|
1953 |
+
++$lli;
|
1954 |
+
}
|
1955 |
+
}
|
1956 |
+
}
|
1957 |
+
}
|
1958 |
+
return $table;
|
1959 |
+
}
|
1960 |
+
|
1961 |
+
} // end of class
|
1962 |
+
|
1963 |
+
//============================================================+
|
1964 |
+
// END OF FILE
|
1965 |
+
//============================================================+
|
mPDF/classes/bmp.php
CHANGED
@@ -1,246 +1,246 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class bmp {
|
4 |
-
|
5 |
-
var $mpdf = null;
|
6 |
-
|
7 |
-
function __construct(&$mpdf) {
|
8 |
-
$this->mpdf = $mpdf;
|
9 |
-
}
|
10 |
-
|
11 |
-
|
12 |
-
function _getBMPimage($data, $file) {
|
13 |
-
$info = array();
|
14 |
-
// Adapted from script by Valentin Schmidt
|
15 |
-
// http://staff.dasdeck.de/valentin/fpdf/fpdf_bmp/
|
16 |
-
$bfOffBits=$this->_fourbytes2int_le(substr($data,10,4));
|
17 |
-
$width=$this->_fourbytes2int_le(substr($data,18,4));
|
18 |
-
$height=$this->_fourbytes2int_le(substr($data,22,4));
|
19 |
-
$flip = ($height<0);
|
20 |
-
if ($flip) $height =-$height;
|
21 |
-
$biBitCount=$this->_twobytes2int_le(substr($data,28,2));
|
22 |
-
$biCompression=$this->_fourbytes2int_le(substr($data,30,4));
|
23 |
-
$info = array('w'=>$width, 'h'=>$height);
|
24 |
-
if ($biBitCount<16){
|
25 |
-
$info['cs'] = 'Indexed';
|
26 |
-
$info['bpc'] = $biBitCount;
|
27 |
-
$palStr = substr($data,54,($bfOffBits-54));
|
28 |
-
$pal = '';
|
29 |
-
$cnt = strlen($palStr)/4;
|
30 |
-
for ($i=0;$i<$cnt;$i++){
|
31 |
-
$n = 4*$i;
|
32 |
-
$pal .= $palStr[$n+2].$palStr[$n+1].$palStr[$n];
|
33 |
-
}
|
34 |
-
$info['pal'] = $pal;
|
35 |
-
}
|
36 |
-
else{
|
37 |
-
$info['cs'] = 'DeviceRGB';
|
38 |
-
$info['bpc'] = 8;
|
39 |
-
}
|
40 |
-
|
41 |
-
if ($this->mpdf->restrictColorSpace==1 || $this->mpdf->PDFX || $this->mpdf->restrictColorSpace==3) {
|
42 |
-
if (($this->mpdf->PDFA && !$this->mpdf->PDFAauto) || ($this->mpdf->PDFX && !$this->mpdf->PDFXauto)) { $this->mpdf->PDFAXwarnings[] = "Image cannot be converted to suitable colour space for PDFA or PDFX file - ".$file." - (Image replaced by 'no-image'.)"; }
|
43 |
-
return array('error' => "BMP Image cannot be converted to suitable colour space - ".$file." - (Image replaced by 'no-image'.)");
|
44 |
-
}
|
45 |
-
|
46 |
-
$biXPelsPerMeter=$this->_fourbytes2int_le(substr($data,38,4)); // horizontal pixels per meter, usually set to zero
|
47 |
-
//$biYPelsPerMeter=$this->_fourbytes2int_le(substr($data,42,4)); // vertical pixels per meter, usually set to zero
|
48 |
-
$biXPelsPerMeter=round($biXPelsPerMeter/1000 *25.4);
|
49 |
-
//$biYPelsPerMeter=round($biYPelsPerMeter/1000 *25.4);
|
50 |
-
$info['set-dpi'] = $biXPelsPerMeter;
|
51 |
-
|
52 |
-
switch ($biCompression){
|
53 |
-
case 0:
|
54 |
-
$str = substr($data,$bfOffBits);
|
55 |
-
break;
|
56 |
-
case 1: # BI_RLE8
|
57 |
-
$str = $this->rle8_decode(substr($data,$bfOffBits), $width);
|
58 |
-
break;
|
59 |
-
case 2: # BI_RLE4
|
60 |
-
$str = $this->rle4_decode(substr($data,$bfOffBits), $width);
|
61 |
-
break;
|
62 |
-
}
|
63 |
-
$bmpdata = '';
|
64 |
-
$padCnt = (4-ceil(($width/(8/$biBitCount)))%4)%4;
|
65 |
-
switch ($biBitCount){
|
66 |
-
case 1:
|
67 |
-
case 4:
|
68 |
-
case 8:
|
69 |
-
$w = floor($width/(8/$biBitCount)) + ($width%(8/$biBitCount)?1:0);
|
70 |
-
$w_row = $w + $padCnt;
|
71 |
-
if ($flip){
|
72 |
-
for ($y=0;$y<$height;$y++){
|
73 |
-
$y0 = $y*$w_row;
|
74 |
-
for ($x=0;$x<$w;$x++)
|
75 |
-
$bmpdata .= $str[$y0+$x];
|
76 |
-
}
|
77 |
-
}else{
|
78 |
-
for ($y=$height-1;$y>=0;$y--){
|
79 |
-
$y0 = $y*$w_row;
|
80 |
-
for ($x=0;$x<$w;$x++)
|
81 |
-
$bmpdata .= $str[$y0+$x];
|
82 |
-
}
|
83 |
-
}
|
84 |
-
break;
|
85 |
-
|
86 |
-
case 16:
|
87 |
-
$w_row = $width*2 + $padCnt;
|
88 |
-
if ($flip){
|
89 |
-
for ($y=0;$y<$height;$y++){
|
90 |
-
$y0 = $y*$w_row;
|
91 |
-
for ($x=0;$x<$width;$x++){
|
92 |
-
$n = (ord( $str[$y0 + 2*$x + 1])*256 + ord( $str[$y0 + 2*$x]));
|
93 |
-
$b = ($n & 31)<<3; $g = ($n & 992)>>2; $r = ($n & 31744)>>7128;
|
94 |
-
$bmpdata .= chr($r) . chr($g) . chr($b);
|
95 |
-
}
|
96 |
-
}
|
97 |
-
}else{
|
98 |
-
for ($y=$height-1;$y>=0;$y--){
|
99 |
-
$y0 = $y*$w_row;
|
100 |
-
for ($x=0;$x<$width;$x++){
|
101 |
-
$n = (ord( $str[$y0 + 2*$x + 1])*256 + ord( $str[$y0 + 2*$x]));
|
102 |
-
$b = ($n & 31)<<3; $g = ($n & 992)>>2; $r = ($n & 31744)>>7;
|
103 |
-
$bmpdata .= chr($r) . chr($g) . chr($b);
|
104 |
-
}
|
105 |
-
}
|
106 |
-
}
|
107 |
-
break;
|
108 |
-
|
109 |
-
case 24:
|
110 |
-
case 32:
|
111 |
-
$byteCnt = $biBitCount/8;
|
112 |
-
$w_row = $width*$byteCnt + $padCnt;
|
113 |
-
|
114 |
-
if ($flip){
|
115 |
-
for ($y=0;$y<$height;$y++){
|
116 |
-
$y0 = $y*$w_row;
|
117 |
-
for ($x=0;$x<$width;$x++){
|
118 |
-
$i = $y0 + $x*$byteCnt ; # + 1
|
119 |
-
$bmpdata .= $str[$i+2].$str[$i+1].$str[$i];
|
120 |
-
}
|
121 |
-
}
|
122 |
-
}else{
|
123 |
-
for ($y=$height-1;$y>=0;$y--){
|
124 |
-
$y0 = $y*$w_row;
|
125 |
-
for ($x=0;$x<$width;$x++){
|
126 |
-
$i = $y0 + $x*$byteCnt ; # + 1
|
127 |
-
$bmpdata .= $str[$i+2].$str[$i+1].$str[$i];
|
128 |
-
}
|
129 |
-
}
|
130 |
-
}
|
131 |
-
break;
|
132 |
-
|
133 |
-
default:
|
134 |
-
return array('error' => 'Error parsing BMP image - Unsupported image biBitCount');
|
135 |
-
}
|
136 |
-
if ($this->mpdf->compress) {
|
137 |
-
$bmpdata=gzcompress($bmpdata);
|
138 |
-
$info['f']='FlateDecode';
|
139 |
-
}
|
140 |
-
$info['data']=$bmpdata;
|
141 |
-
$info['type']='bmp';
|
142 |
-
return $info;
|
143 |
-
}
|
144 |
-
|
145 |
-
function _fourbytes2int_le($s) {
|
146 |
-
//Read a 4-byte integer from string
|
147 |
-
return (ord($s[3])<<24) + (ord($s[2])<<16) + (ord($s[1])<<8) + ord($s[0]);
|
148 |
-
}
|
149 |
-
|
150 |
-
function _twobytes2int_le($s) {
|
151 |
-
//Read a 2-byte integer from string
|
152 |
-
return (ord(substr($s, 1, 1))<<8) + ord(substr($s, 0, 1));
|
153 |
-
}
|
154 |
-
|
155 |
-
|
156 |
-
# Decoder for RLE8 compression in windows bitmaps
|
157 |
-
# see http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/bitmaps_6x0u.asp
|
158 |
-
function rle8_decode ($str, $width){
|
159 |
-
$lineWidth = $width + (3 - ($width-1) % 4);
|
160 |
-
$out = '';
|
161 |
-
$cnt = strlen($str);
|
162 |
-
for ($i=0;$i<$cnt;$i++){
|
163 |
-
$o = ord($str[$i]);
|
164 |
-
switch ($o){
|
165 |
-
case 0: # ESCAPE
|
166 |
-
$i++;
|
167 |
-
switch (ord($str[$i])){
|
168 |
-
case 0: # NEW LINE
|
169 |
-
$padCnt = $lineWidth - strlen($out)%$lineWidth;
|
170 |
-
if ($padCnt<$lineWidth) $out .= str_repeat(chr(0), $padCnt); # pad line
|
171 |
-
break;
|
172 |
-
case 1: # END OF FILE
|
173 |
-
$padCnt = $lineWidth - strlen($out)%$lineWidth;
|
174 |
-
if ($padCnt<$lineWidth) $out .= str_repeat(chr(0), $padCnt); # pad line
|
175 |
-
break 3;
|
176 |
-
case 2: # DELTA
|
177 |
-
$i += 2;
|
178 |
-
break;
|
179 |
-
default: # ABSOLUTE MODE
|
180 |
-
$num = ord($str[$i]);
|
181 |
-
for ($j=0;$j<$num;$j++)
|
182 |
-
$out .= $str[++$i];
|
183 |
-
if ($num % 2) $i++;
|
184 |
-
}
|
185 |
-
break;
|
186 |
-
default:
|
187 |
-
$out .= str_repeat($str[++$i], $o);
|
188 |
-
}
|
189 |
-
}
|
190 |
-
return $out;
|
191 |
-
}
|
192 |
-
|
193 |
-
# Decoder for RLE4 compression in windows bitmaps
|
194 |
-
# see http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/bitmaps_6x0u.asp
|
195 |
-
function rle4_decode ($str, $width){
|
196 |
-
$w = floor($width/2) + ($width % 2);
|
197 |
-
$lineWidth = $w + (3 - ( ($width-1) / 2) % 4);
|
198 |
-
$pixels = array();
|
199 |
-
$cnt = strlen($str);
|
200 |
-
for ($i=0;$i<$cnt;$i++){
|
201 |
-
$o = ord($str[$i]);
|
202 |
-
switch ($o){
|
203 |
-
case 0: # ESCAPE
|
204 |
-
$i++;
|
205 |
-
switch (ord($str[$i])){
|
206 |
-
case 0: # NEW LINE
|
207 |
-
while (count($pixels)%$lineWidth!=0)
|
208 |
-
$pixels[]=0;
|
209 |
-
break;
|
210 |
-
case 1: # END OF FILE
|
211 |
-
while (count($pixels)%$lineWidth!=0)
|
212 |
-
$pixels[]=0;
|
213 |
-
break 3;
|
214 |
-
case 2: # DELTA
|
215 |
-
$i += 2;
|
216 |
-
break;
|
217 |
-
default: # ABSOLUTE MODE
|
218 |
-
$num = ord($str[$i]);
|
219 |
-
for ($j=0;$j<$num;$j++){
|
220 |
-
if ($j%2==0){
|
221 |
-
$c = ord($str[++$i]);
|
222 |
-
$pixels[] = ($c & 240)>>4;
|
223 |
-
} else
|
224 |
-
$pixels[] = $c & 15;
|
225 |
-
}
|
226 |
-
if ($num % 2) $i++;
|
227 |
-
}
|
228 |
-
break;
|
229 |
-
default:
|
230 |
-
$c = ord($str[++$i]);
|
231 |
-
for ($j=0;$j<$o;$j++)
|
232 |
-
$pixels[] = ($j%2==0 ? ($c & 240)>>4 : $c & 15);
|
233 |
-
}
|
234 |
-
}
|
235 |
-
|
236 |
-
$out = '';
|
237 |
-
if (count($pixels)%2) $pixels[]=0;
|
238 |
-
$cnt = count($pixels)/2;
|
239 |
-
for ($i=0;$i<$cnt;$i++)
|
240 |
-
$out .= chr(16*$pixels[2*$i] + $pixels[2*$i+1]);
|
241 |
-
return $out;
|
242 |
-
}
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class bmp {
|
4 |
+
|
5 |
+
var $mpdf = null;
|
6 |
+
|
7 |
+
function __construct(&$mpdf) {
|
8 |
+
$this->mpdf = $mpdf;
|
9 |
+
}
|
10 |
+
|
11 |
+
|
12 |
+
function _getBMPimage($data, $file) {
|
13 |
+
$info = array();
|
14 |
+
// Adapted from script by Valentin Schmidt
|
15 |
+
// http://staff.dasdeck.de/valentin/fpdf/fpdf_bmp/
|
16 |
+
$bfOffBits=$this->_fourbytes2int_le(substr($data,10,4));
|
17 |
+
$width=$this->_fourbytes2int_le(substr($data,18,4));
|
18 |
+
$height=$this->_fourbytes2int_le(substr($data,22,4));
|
19 |
+
$flip = ($height<0);
|
20 |
+
if ($flip) $height =-$height;
|
21 |
+
$biBitCount=$this->_twobytes2int_le(substr($data,28,2));
|
22 |
+
$biCompression=$this->_fourbytes2int_le(substr($data,30,4));
|
23 |
+
$info = array('w'=>$width, 'h'=>$height);
|
24 |
+
if ($biBitCount<16){
|
25 |
+
$info['cs'] = 'Indexed';
|
26 |
+
$info['bpc'] = $biBitCount;
|
27 |
+
$palStr = substr($data,54,($bfOffBits-54));
|
28 |
+
$pal = '';
|
29 |
+
$cnt = strlen($palStr)/4;
|
30 |
+
for ($i=0;$i<$cnt;$i++){
|
31 |
+
$n = 4*$i;
|
32 |
+
$pal .= $palStr[$n+2].$palStr[$n+1].$palStr[$n];
|
33 |
+
}
|
34 |
+
$info['pal'] = $pal;
|
35 |
+
}
|
36 |
+
else{
|
37 |
+
$info['cs'] = 'DeviceRGB';
|
38 |
+
$info['bpc'] = 8;
|
39 |
+
}
|
40 |
+
|
41 |
+
if ($this->mpdf->restrictColorSpace==1 || $this->mpdf->PDFX || $this->mpdf->restrictColorSpace==3) {
|
42 |
+
if (($this->mpdf->PDFA && !$this->mpdf->PDFAauto) || ($this->mpdf->PDFX && !$this->mpdf->PDFXauto)) { $this->mpdf->PDFAXwarnings[] = "Image cannot be converted to suitable colour space for PDFA or PDFX file - ".$file." - (Image replaced by 'no-image'.)"; }
|
43 |
+
return array('error' => "BMP Image cannot be converted to suitable colour space - ".$file." - (Image replaced by 'no-image'.)");
|
44 |
+
}
|
45 |
+
|
46 |
+
$biXPelsPerMeter=$this->_fourbytes2int_le(substr($data,38,4)); // horizontal pixels per meter, usually set to zero
|
47 |
+
//$biYPelsPerMeter=$this->_fourbytes2int_le(substr($data,42,4)); // vertical pixels per meter, usually set to zero
|
48 |
+
$biXPelsPerMeter=round($biXPelsPerMeter/1000 *25.4);
|
49 |
+
//$biYPelsPerMeter=round($biYPelsPerMeter/1000 *25.4);
|
50 |
+
$info['set-dpi'] = $biXPelsPerMeter;
|
51 |
+
|
52 |
+
switch ($biCompression){
|
53 |
+
case 0:
|
54 |
+
$str = substr($data,$bfOffBits);
|
55 |
+
break;
|
56 |
+
case 1: # BI_RLE8
|
57 |
+
$str = $this->rle8_decode(substr($data,$bfOffBits), $width);
|
58 |
+
break;
|
59 |
+
case 2: # BI_RLE4
|
60 |
+
$str = $this->rle4_decode(substr($data,$bfOffBits), $width);
|
61 |
+
break;
|
62 |
+
}
|
63 |
+
$bmpdata = '';
|
64 |
+
$padCnt = (4-ceil(($width/(8/$biBitCount)))%4)%4;
|
65 |
+
switch ($biBitCount){
|
66 |
+
case 1:
|
67 |
+
case 4:
|
68 |
+
case 8:
|
69 |
+
$w = floor($width/(8/$biBitCount)) + ($width%(8/$biBitCount)?1:0);
|
70 |
+
$w_row = $w + $padCnt;
|
71 |
+
if ($flip){
|
72 |
+
for ($y=0;$y<$height;$y++){
|
73 |
+
$y0 = $y*$w_row;
|
74 |
+
for ($x=0;$x<$w;$x++)
|
75 |
+
$bmpdata .= $str[$y0+$x];
|
76 |
+
}
|
77 |
+
}else{
|
78 |
+
for ($y=$height-1;$y>=0;$y--){
|
79 |
+
$y0 = $y*$w_row;
|
80 |
+
for ($x=0;$x<$w;$x++)
|
81 |
+
$bmpdata .= $str[$y0+$x];
|
82 |
+
}
|
83 |
+
}
|
84 |
+
break;
|
85 |
+
|
86 |
+
case 16:
|
87 |
+
$w_row = $width*2 + $padCnt;
|
88 |
+
if ($flip){
|
89 |
+
for ($y=0;$y<$height;$y++){
|
90 |
+
$y0 = $y*$w_row;
|
91 |
+
for ($x=0;$x<$width;$x++){
|
92 |
+
$n = (ord( $str[$y0 + 2*$x + 1])*256 + ord( $str[$y0 + 2*$x]));
|
93 |
+
$b = ($n & 31)<<3; $g = ($n & 992)>>2; $r = ($n & 31744)>>7128;
|
94 |
+
$bmpdata .= chr($r) . chr($g) . chr($b);
|
95 |
+
}
|
96 |
+
}
|
97 |
+
}else{
|
98 |
+
for ($y=$height-1;$y>=0;$y--){
|
99 |
+
$y0 = $y*$w_row;
|
100 |
+
for ($x=0;$x<$width;$x++){
|
101 |
+
$n = (ord( $str[$y0 + 2*$x + 1])*256 + ord( $str[$y0 + 2*$x]));
|
102 |
+
$b = ($n & 31)<<3; $g = ($n & 992)>>2; $r = ($n & 31744)>>7;
|
103 |
+
$bmpdata .= chr($r) . chr($g) . chr($b);
|
104 |
+
}
|
105 |
+
}
|
106 |
+
}
|
107 |
+
break;
|
108 |
+
|
109 |
+
case 24:
|
110 |
+
case 32:
|
111 |
+
$byteCnt = $biBitCount/8;
|
112 |
+
$w_row = $width*$byteCnt + $padCnt;
|
113 |
+
|
114 |
+
if ($flip){
|
115 |
+
for ($y=0;$y<$height;$y++){
|
116 |
+
$y0 = $y*$w_row;
|
117 |
+
for ($x=0;$x<$width;$x++){
|
118 |
+
$i = $y0 + $x*$byteCnt ; # + 1
|
119 |
+
$bmpdata .= $str[$i+2].$str[$i+1].$str[$i];
|
120 |
+
}
|
121 |
+
}
|
122 |
+
}else{
|
123 |
+
for ($y=$height-1;$y>=0;$y--){
|
124 |
+
$y0 = $y*$w_row;
|
125 |
+
for ($x=0;$x<$width;$x++){
|
126 |
+
$i = $y0 + $x*$byteCnt ; # + 1
|
127 |
+
$bmpdata .= $str[$i+2].$str[$i+1].$str[$i];
|
128 |
+
}
|
129 |
+
}
|
130 |
+
}
|
131 |
+
break;
|
132 |
+
|
133 |
+
default:
|
134 |
+
return array('error' => 'Error parsing BMP image - Unsupported image biBitCount');
|
135 |
+
}
|
136 |
+
if ($this->mpdf->compress) {
|
137 |
+
$bmpdata=gzcompress($bmpdata);
|
138 |
+
$info['f']='FlateDecode';
|
139 |
+
}
|
140 |
+
$info['data']=$bmpdata;
|
141 |
+
$info['type']='bmp';
|
142 |
+
return $info;
|
143 |
+
}
|
144 |
+
|
145 |
+
function _fourbytes2int_le($s) {
|
146 |
+
//Read a 4-byte integer from string
|
147 |
+
return (ord($s[3])<<24) + (ord($s[2])<<16) + (ord($s[1])<<8) + ord($s[0]);
|
148 |
+
}
|
149 |
+
|
150 |
+
function _twobytes2int_le($s) {
|
151 |
+
//Read a 2-byte integer from string
|
152 |
+
return (ord(substr($s, 1, 1))<<8) + ord(substr($s, 0, 1));
|
153 |
+
}
|
154 |
+
|
155 |
+
|
156 |
+
# Decoder for RLE8 compression in windows bitmaps
|
157 |
+
# see http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/bitmaps_6x0u.asp
|
158 |
+
function rle8_decode ($str, $width){
|
159 |
+
$lineWidth = $width + (3 - ($width-1) % 4);
|
160 |
+
$out = '';
|
161 |
+
$cnt = strlen($str);
|
162 |
+
for ($i=0;$i<$cnt;$i++){
|
163 |
+
$o = ord($str[$i]);
|
164 |
+
switch ($o){
|
165 |
+
case 0: # ESCAPE
|
166 |
+
$i++;
|
167 |
+
switch (ord($str[$i])){
|
168 |
+
case 0: # NEW LINE
|
169 |
+
$padCnt = $lineWidth - strlen($out)%$lineWidth;
|
170 |
+
if ($padCnt<$lineWidth) $out .= str_repeat(chr(0), $padCnt); # pad line
|
171 |
+
break;
|
172 |
+
case 1: # END OF FILE
|
173 |
+
$padCnt = $lineWidth - strlen($out)%$lineWidth;
|
174 |
+
if ($padCnt<$lineWidth) $out .= str_repeat(chr(0), $padCnt); # pad line
|
175 |
+
break 3;
|
176 |
+
case 2: # DELTA
|
177 |
+
$i += 2;
|
178 |
+
break;
|
179 |
+
default: # ABSOLUTE MODE
|
180 |
+
$num = ord($str[$i]);
|
181 |
+
for ($j=0;$j<$num;$j++)
|
182 |
+
$out .= $str[++$i];
|
183 |
+
if ($num % 2) $i++;
|
184 |
+
}
|
185 |
+
break;
|
186 |
+
default:
|
187 |
+
$out .= str_repeat($str[++$i], $o);
|
188 |
+
}
|
189 |
+
}
|
190 |
+
return $out;
|
191 |
+
}
|
192 |
+
|
193 |
+
# Decoder for RLE4 compression in windows bitmaps
|
194 |
+
# see http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/bitmaps_6x0u.asp
|
195 |
+
function rle4_decode ($str, $width){
|
196 |
+
$w = floor($width/2) + ($width % 2);
|
197 |
+
$lineWidth = $w + (3 - ( ($width-1) / 2) % 4);
|
198 |
+
$pixels = array();
|
199 |
+
$cnt = strlen($str);
|
200 |
+
for ($i=0;$i<$cnt;$i++){
|
201 |
+
$o = ord($str[$i]);
|
202 |
+
switch ($o){
|
203 |
+
case 0: # ESCAPE
|
204 |
+
$i++;
|
205 |
+
switch (ord($str[$i])){
|
206 |
+
case 0: # NEW LINE
|
207 |
+
while (count($pixels)%$lineWidth!=0)
|
208 |
+
$pixels[]=0;
|
209 |
+
break;
|
210 |
+
case 1: # END OF FILE
|
211 |
+
while (count($pixels)%$lineWidth!=0)
|
212 |
+
$pixels[]=0;
|
213 |
+
break 3;
|
214 |
+
case 2: # DELTA
|
215 |
+
$i += 2;
|
216 |
+
break;
|
217 |
+
default: # ABSOLUTE MODE
|
218 |
+
$num = ord($str[$i]);
|
219 |
+
for ($j=0;$j<$num;$j++){
|
220 |
+
if ($j%2==0){
|
221 |
+
$c = ord($str[++$i]);
|
222 |
+
$pixels[] = ($c & 240)>>4;
|
223 |
+
} else
|
224 |
+
$pixels[] = $c & 15;
|
225 |
+
}
|
226 |
+
if ($num % 2) $i++;
|
227 |
+
}
|
228 |
+
break;
|
229 |
+
default:
|
230 |
+
$c = ord($str[++$i]);
|
231 |
+
for ($j=0;$j<$o;$j++)
|
232 |
+
$pixels[] = ($j%2==0 ? ($c & 240)>>4 : $c & 15);
|
233 |
+
}
|
234 |
+
}
|
235 |
+
|
236 |
+
$out = '';
|
237 |
+
if (count($pixels)%2) $pixels[]=0;
|
238 |
+
$cnt = count($pixels)/2;
|
239 |
+
for ($i=0;$i<$cnt;$i++)
|
240 |
+
$out .= chr(16*$pixels[2*$i] + $pixels[2*$i+1]);
|
241 |
+
return $out;
|
242 |
+
}
|
243 |
+
|
244 |
+
|
245 |
+
|
246 |
+
}
|
mPDF/classes/cssmgr.php
CHANGED
@@ -1,1600 +1,1600 @@
|
|
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 __construct(&$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 )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|