forked from andrewklimek/formidable-pro-pdf-extended
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocumentation.html
1561 lines (1411 loc) · 65.7 KB
/
documentation.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
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
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Formidable Pro PDF Extended Documentation</title>
</head>
<body>
<h1>Formidable Pro PDF Extended Documentation</h1>
<p><em>This is a copy of old documentation. It may not be 100% correct and links may be broken</em></p>
<section id="intro">
<h2>What is Formidable Pro PDF Extended?</h2>
<p>Formidable Pro PDF Extended is an expansion of the popular <a href="http://gravityformspdfextended.com">Gravity Forms PDF Extended</a> WordPress plugin that allows developers to quickly take data captured from Formidable Pro and generate and email or download a PDF document using nothing more than HTML and CSS. Powering this system is the feature-rich HTML-to-PDF package, <a href="http://www.mpdf1.com/mpdf/index.php">mPDF</a>.</p>
<h3>What can mPDF accomplish?</h3>
<p>mPDF offers the following features out of the box:</p>
<ul>
<li>Language Support – almost all languages are supported including RTL (right to left) languages like Arabic and Hebrew and <a href="#fonts-language-support">CJK languages</a> – Chinese, Japanese and Korean.</li>
<li>Page Numbering</li>
<li>Odd and even paging with mirrored margins (most commonly used in printing).</li>
<li>Nested Tables</li>
<li>Text-justification and hyphenation</li>
<li>Table of Contents</li>
<li>Index</li>
<li>Bookmarks</li>
<li>Watermarks</li>
<li>Password protection</li>
<li>UTF-8 encoded HTML</li>
<li>Better system resource handling</li>
</ul>
<p>To see exactly what mPDF is capable of view the <a href="#templates-intro">custom template examples</a> on our documentation pages.</p>
</section>
<section id="requirements">
<h2>Software and Server Requirements</h2>
<p>Formidable Pro PDF Extended has the following conditions that must be met to use the package:</p>
<table>
<tbody>
<tr>
<th colspan="2">Software Requirements</th>
</tr>
<tr>
<td colspan="2"><a href="https://formidableforms.com">Purchase and install Formidable Pro</a></td>
</tr>
<tr>
<td colspan="2">WordPress 3.6+</td>
</tr>
<tr>
<td colspan="2">Formidable Pro 1.07.01+</td>
</tr>
<tr>
<th colspan="2">Server Requirements</th>
</tr>
<tr>
<td colspan="2">PHP 5+ (5.3+ recommended)</td>
</tr>
<tr>
<td colspan="2"><a href="http://www.php.net/manual/en/mbstring.installation.php">MB String</a></td>
</tr>
<tr>
<td colspan="2"><a href="http://www.php.net/manual/en/image.installation.php">GD Library (optional)</a></td>
</tr>
<tr>
<td>RAM</td>
<td><strong>Recommended: 128MB</strong><br>
Minimum: 64MB</td>
</tr>
</tbody>
</table>
</section>
<section id="installation-configuration">
<h2>Installation and Configuration</h2>
<h3>Installation</h3>
<ol>
<li><a href="https://github.com/blueliquiddesigns/formidable-pro-pdf-extended/archive/master.zip">Download Formidable Pro PDF Extended</a>, upload the plugin to your website’s plugins folder and activate it.</li>
<li>Get the ID of the Formidable Pro form you want to generate a PDF with.</li>
<li>Open up /wp-content/themes/%ACTIVE_THEME%/FORMIDABLE_PDF_TEMPLATES/configuration.php and configure accordingly. The configuration section below will aid you setting up the plugin.</li>
<li>If you want to use a custom template to generate your PDFs then <a href="#templates-intro">see our comprehensive guide to building a PDF template</a>.</li>
</ol>
<h3>Configuration</h3>
<p>All configuration should be done in <em>/wp-content/theme/%ACTIVE_THEME%/FORMIDABLE_PDF_TEMPLATES/configuration.php</em>. The file contains examples of all the options and is heavily documented.</p>
<p><strong>BASIC USAGE</strong><br>
It is very easy to generate PDFs and have them attached to a Formidable Pro notifications. The following will send the default PDF template to all form notifications.</p>
<pre>/* send default template to all attachments */
$fp_pdf_config[] = array(
'form_id' => 1,
'notifications' => true
);
</pre>
<p><strong id="default-template-only">DEFAULT TEMPLATE-ONLY CONFIGURATION</strong></p>
<p><em>Description:</em></p>
<ul>
<li><strong>default-show-html</strong> – This option will display HTML blocks in your default template.</li>
<li><strong>default-show-empty</strong> – All form fields will be displayed in the PDF, regardless of what the user input is.</li>
</ul>
<pre>/* set individual options for default templates */
$fp_pdf_config[] = array(
'form_id' => 1,
'template' => 'default-template.php',
'default-show-html' => true
);
$fp_pdf_config[] = array(
'form_id' => 1,
'template' => 'default-template.php',
'default-show-empty' => true
);
/*
* Or use a combination of the new options to achieve the results you want
*/
$fp_pdf_config[] = array(
'form_id' => 1,
'template' => 'default-template.php',
'default-show-html' => true,
'default-show-empty' => true
);
</pre>
<p><strong>ATTACH DEFAULT TEMPLATE TO NOTIFICATION</strong><br>
You can also limit the notifications the PDF is sent to by specifying the specific notification(s). See our FAQ article on <a href="http://formidablepropdfextended.com/faq/find-notification-id">how to locate the notification ID</a>.</p>
<pre>/* only send default template to the notification with an ID of 1 */
$fp_pdf_config[] = array(
'form_id' => 1,
'notifications' => 1
);
/* multiple attachments but not all */
$fp_pdf_config[] = array(
'form_id' => 1,
'notifications' => array(0, 2)
);
</pre>
<p><strong>CUSTOM PDF NAME</strong><br>
You can set the PDF name of your document and use field ID/Keys in your filename ([sitename], [ip], [id], [key], [20], [ltzq9]).</p>
<div><strong>Note: </strong>Remember to add .pdf to the end of your custom PDF name</div>
<pre>$fp_pdf_config[] = array(
'form_id' => 1,
'notifications' => true,
'filename' => 'User Document.pdf'
);
$fp_pdf_config[] = array(
'form_id' => 1,
'notifications' => true,
'filename' => 'New PDF Name [id].pdf'
);
</pre>
<p><strong>CUSTOM TEMPLATE</strong><br>
Please see our dedicated documentation page which discusses the <a href="#templates-intro">creation of custom template files</a>.<br>
You can set the custom template using the template parameter.</p>
<pre>$fp_pdf_config[] = array(
'form_id' => 1,
'template' => 'example-template.php'
);
</pre>
<p><strong>CUSTOM PDF SIZE AND ORIENTATION</strong><br>
You can change the default size of your PDF from A4 to a number of pre-defined sizes, including letter and legal. You can also control if the document is landscape or portrait.</p>
<div><strong>Note:</strong> PDF size presents include: A0 – A10, B0 – B10, C0 – C10, 4A0, 2A0, RA0 – RA4, SRA0 – SRA4, Letter, Legal, Executive, Folio, Demy and Royal</div>
<pre>/* generate a PDF the size of US letter in landscape */
$fp_pdf_config[] = array(
'form_id' => 1,
'pdf_size' => 'letter',
'orientation' => 'landscape'
);
/* generate a custom PDF (specified in millimeters) */
$fp_pdf_config[] = array(
'form_id' => 1,
'pdf_size' => array(150, 250)
);
</pre>
<p><strong>LANGUAGE SUPPORT</strong><br>
mPDF comes with a number of unicode fonts and by default will substitute a font if the specific character isn’t available, so you should be safe using the default font selection – DejaVuSans.</p>
<div><strong>Note: </strong>If you want to output PDFs in Japanese, Korean or Chinese you will need to <a href="#fonts-language-support">install additional fonts</a>.</div>
<div><strong>Note: </strong>If you are generating PDFs in RTL languages like Arabic or Hebrew you can call the RTL parameter to correctly display text in your PDF.</div>
<pre>$fp_pdf_config[] = array(
'form_id' => 1,
'rtl' => true
);
</pre>
<p><strong>PDF SECURITY</strong><br>
You can easily restrict access to your PDFs by restricting user permission and applying a password to access the document, or modify PDF permissions. To enable these security methods you first need to set the security setting to true.</p>
<pre>/*
* Setting security settings with all values
*/
$fp_pdf_config[] = array(
'form_id' => 1,
'notifications' => true,
'security' => true,
'pdf_password' => 'myPDFpass',
'pdf_privileges' => array('copy', 'print', 'modify', 'annot-forms', 'fill-forms', 'extract', 'assemble', 'print-highres'),
'pdf_master_password' => 'admin password'
);
</pre>
<div><strong>Warning:</strong> If pdf_master_password is omitted a random one will be generated</div>
<div><strong>Note:</strong> Valid privileges include: copy, print, modify, annot-forms, fill-forms, extract, assemble, print-highres</div>
<div><strong>Note:</strong> The use of print will only allow low-resolution printing from the document; you must specify print-highres to allow full resolution printing.</div>
<div><strong>Note:</strong> Passing a blank array or not passing anything to pdf_privileges will deny all permissions to the user.</div>
<p><strong>ADVANCED USAGE</strong><br>
You can generate and attach multiple PDFs on the same form by creating two different configuration arrays using the same form_id.</p>
<div><strong>Warning: </strong>You need to explicitly set the filename when using this method otherwise the default file name will be used and only generate one PDF.</div>
<pre>$fp_pdf_config[] = array(
'form_id' => 1,
'notifications' => true,
'template' => 'custom-template.php',
'filename' => 'Custom.pdf'
);
$fp_pdf_config[] = array(
'form_id' => 1,
'notifications' => true,
'template' => 'custom2.php',
'filename' => 'Custom Template 2.pdf'
);
</pre>
<p><strong id="default-configuration-options">DEFAULT CONFIGURATION OPTIONS</strong></p>
<div><strong>Note: </strong> The default configuration will only work if the configuration option FPPDF_SET_DEFAULT_TEMPLATE is set to true.</div>
<p>You also have the ability to set default configuration options for all forms that you haven’t explicitly set a configuration for. Users can use any configuration option which you would use in the normal configuration.</p>
<pre>/*
* Users can use any configuration option like you would for a singular form, including:
* notifications, template, filename, pdf_size, orientation, security and rtl
* Note: this will only work if the configuration option FPPDF_SET_DEFAULT_TEMPLATE is set to true
*/
global $fp_pdf_default_configuration;
$fp_pdf_default_configuration = array(
'template' => 'default-template.php',
'pdf_size' => 'A4'
);
</pre>
<p><strong>PUTTING IT ALL TOGETHER</strong><br>
We’ve put together an example that uses all the configuration options (minus the default template-specific options) for Formidable Pro PDF Extended.</p>
<pre>$fp_pdf_config[] = array(
'form_id' => 1,
'notifications' => array(1, 2),
'template' => 'custom-template.php',
'filename' => 'My_Custom_PDF.pdf',
'rtl' => true,
'pdfsize' => 'A10',
'orientation' => 'landscape',
'security' => true,
'pdf_password' => 'mypass',
'pdf_privileges' => array('print', 'fill-forms', 'print-highres'),
'pdf_master_password' => 'admin password'
);
</pre>
<h2>Settings</h2>
<table cellspacing="0">
<colgroup>
<col>
<col>
<col>
<col>
<col> </colgroup>
<tbody>
<tr>
<th>Property</th>
<th>Default</th>
<th>Type</th>
<th>Example</th>
<th>Description</th>
</tr>
<tr>
<td><strong>form_id</strong></td>
<td>N/A</td>
<td>Mixed – Integer/Array</td>
<td>1 or array(1,2,5)</td>
<td>The ID of the form you want to apply the PDF configuration to. The only required option.</td>
</tr>
<tr>
<td><strong>default-show-html</strong> (v3.1.0+)</td>
<td>false</td>
<td>Boolean</td>
<td>true or false</td>
<td>This option will display HTML blocks in your default template.</td>
</tr>
<tr>
<td><strong>default-show-empty</strong> (v3.1.0+)</td>
<td>false</td>
<td>Boolean</td>
<td>true or false</td>
<td>All form fields will be displayed in the PDF, regardless of what the user input is.</td>
</tr>
<tr>
<td><strong>notifications </strong></td>
<td>N/A</td>
<td>Mixed – Integer/Array/Boolean</td>
<td>1, array(0, 3) or true.</td>
<td>The notifications you want to attach the PDF to. Leave blank will not attach PDF to notification.</td>
</tr>
<tr>
<td><strong>template</strong></td>
<td>Default-template.php</td>
<td>String</td>
<td>“my-custom- template.php”</td>
<td>The template file used to generate the PDF document.<p></p>
<p>Note: PDF templates are located in your active theme’s FORMIDABLE_PDF_TEMPLATES folder.</p></td>
</tr>
<tr>
<td><strong>filename </strong></td>
<td>form-{form_id}- entry-{entry_id}.pdf</td>
<td>String</td>
<td>“My Custom Name.pdf”</td>
<td>Change the name of the PDF file.</td>
</tr>
<tr>
<td><strong>pdf_size </strong></td>
<td>A4</td>
<td>Mixed – String/Array</td>
<td>“Letter”, “A10″ or array(50, 200)</td>
<td>Sets the PDF size. Can pass a string with pre-defined size or an array which sets the PDF width and height in millimetres.<p></p>
<p><strong>PDF Presets</strong></p>
<p>A0 – A10, B0 – B10, C0 – C10</p>
<p>4A0, 2A0, RA0 – RA4, SRA0 – SRA4</p>
<p>Letter, Legal, Executive, Folio</p>
<p>Demy, Royal</p></td>
</tr>
<tr>
<td><strong>orientation </strong></td>
<td>Portrait</td>
<td>String</td>
<td>“landscape”</td>
<td>Change the orientation of the PDF to landscape.<br>
NOTE: By default the orientation is portrait so you only need to add it for landscape PDFs</td>
</tr>
<tr>
<td><strong>rtl </strong></td>
<td>False</td>
<td>Boolean</td>
<td>True</td>
<td>Change the text direction from right to left for languages like Hebrew and Arabic</td>
</tr>
<tr>
<td><strong>security </strong></td>
<td>False</td>
<td>Boolean</td>
<td>True</td>
<td>Determines whether to restrict access to PDF. Use in conjunction with pdf_master_password, pdf_password and pdf_privileges.</td>
</tr>
<tr>
<td><strong>pdf_master_password</strong></td>
<td>N/A</td>
<td>String</td>
<td>“aSAja4202$@@”</td>
<td>Restricts modification of the PDF document. If omitted a random password will be generated.</td>
</tr>
<tr>
<td><strong>pdf_password</strong></td>
<td>N/A</td>
<td>String</td>
<td>“U5erPa55w%rd”</td>
<td>Restricts access to a PDF. If you pass an empty string there won’t be a password on the PDF.</td>
</tr>
<tr>
<td><strong>pdf_privileges</strong></td>
<td>N/A</td>
<td>Array</td>
<td>array(‘copy’, ‘print’, ‘modify’, ‘annot-forms’, ‘fill-forms’, ‘extract’, ‘assemble’, ‘print-highres’)</td>
<td>Restricts what users are able to do with the PDF.<br>
Note: The use of print will only allow low-resolution printing from the document; you must specify print-highres to allow full resolution printing.<br>
Note: Passing a blank array or not passing anything to pdf_privileges will deny all permissions to the user</td>
</tr>
</tbody>
</table>
<h2 id="constants">Advanced Configuration</h2>
<p>At the bottom of the configuration.php file is a number of constants that modify advanced program settings – most related to reducing the software’s memory footprint. View the<a href="#memory-problems"> memory footprint portion of the documentation</a> for more information about reducing memory usage.</p>
<table cellspacing="0">
<colgroup>
<col>
<col>
<col>
<col>
<col> </colgroup>
<tbody>
<tr>
<th>Property</th>
<th>Default</th>
<th>Type</th>
<th>Example</th>
<th>Description</th>
</tr>
<tr>
<td>FPPDF_SET_DEFAULT_TEMPLATE</td>
<td>True</td>
<td>Boolean</td>
<td>false</td>
<td>By default, forms that don’t have PDFs assigned through the above configuration will automatically use the default template in the admin area. Set to false to disable.</td>
</tr>
<tr>
<td>FP_PDF_ENABLE_MPDF_LITE</td>
<td>False</td>
<td>Boolean</td>
<td>true</td>
<td>Reduce the memory footprint by disabling advanced features like advanced table borders, terms and conditions, columns, index, bookmarks and barcodes.</td>
</tr>
<tr>
<td>FP_PDF_ENABLE_MPDF_TINY</td>
<td>False</td>
<td>Boolean</td>
<td>true</td>
<td>Further reduce memory footprint by disabling all the features of Lite plus positioning, float, watermark and form support</td>
</tr>
<tr>
<td>FP_PDF_DISABLE_FONT_SUBSTITUTION</td>
<td>False</td>
<td>Boolean</td>
<td>true</td>
<td valign="top" width="246">Disable font substitution. The entire font file will be embedded in PDF.<p></p>
<p>Note: embedding entire font files increases PDF file size.</p></td>
</tr>
<tr>
<td>FP_PDF_ENABLE_SIMPLE_TABLES</td>
<td>False</td>
<td>Boolean</td>
<td>true</td>
<td>Disable the advanced table feature and forces all cells to have the same border and background</td>
</tr>
</tbody>
</table>
</section>
<section id="custom-display-shortcodes">
<h1>Custom Display Shortcodes</h1>
<p>One of the unique features of Formidable Pro is the ability to create custom displays. To take advantage of this, we’ve created a shortcode called <strong>[pdf] </strong>which securely displays a form entry’s PDF.</p>
<p>As standard, a PDF generated with Formidable Pro PDF Extended can only be viewed by the original owner (matched against the user’s login ID or IP address) or a logged in user with the <em>frm_view_entries </em>role. Whereas the new shortcode uses WordPress’ nonce system to generate a secure URL so that non-authorised users can view these PDFs.</p>
<h2>Usage</h2>
<p>The shortcode can only be used in the custom display’s content area. We’ve made the shortcode as robust as possible. Users can change the template file used, choose whether the PDF should be viewed in the browser or download and change the link text.</p>
<p>By default, the shortcode will:</p>
<ul>
<li>Use the template assigned to the form in the configuration.php</li>
<li>Display the PDF inline</li>
<li>Display a link to the PDF saying ‘View PDF’</li>
</ul>
<pre><!-- The standard shortcode usage -->
[pdf]
<!-- Use a different PDF template that what is set in the configuration.php file -->
[pdf template="example-template.php"]
<!-- Use the default template and link text but force the browser to download the PDF -->
[pdf download="1"]
<!-- Change the link text -->
[pdf]Click here to view PDF[/pdf]
<!-- Putting it all together... -->
[pdf template="example-template.php" download="1"]Click here to view PDF[/pdf]</pre>
<dl id="attachment_2245" style="width: 810px;">
<dt></dt>
</dl>
<p></p><div id="attachment_2290" style="width: 788px"><img alt="Custom Display from the Admin Area" src="http://formidablepropdfextended.com/wp-content/uploads/2013/11/custom-display-admin.jpg" width="778" height="536"><p>Admin area example of the [pdf] shortcode usage in a custom display.</p></div><div id="attachment_2291" style="width: 642px"><img alt="custom-display-front-end" src="http://formidablepropdfextended.com/wp-content/uploads/2013/11/custom-display-front-end.jpg" width="632" height="356"><p>Front end view of the custom display with multiple [pdf] shortcode examples.</p></div> <p></p>
</section>
<section id="css-html-support">
<h2>CSS Selector and Cascade Limitations</h2>
<p>The only pitfall we’ve experienced while using the mPDF package is the lack of cascading CSS, psudo-classes and CSS3 selector support.</p>
<h3>Supported CSS</h3>
<p>The following are supported (in order of ascending priority). Lower styles and attributes in the list will overwrite higher styles and attributes.</p>
<ul>
<li>CSS Stylesheets – included in header of HTML document using <style></style>, as <link /> or using @import()
<ul>
<li>Html tags – p { font-size:12pt; color:#880000; }</li>
<li>Class – .stylename { font-size:9pt; }</li>
<li>Id – #style { font-size:9pt; }</li>
</ul>
</li>
<li>HTML attributes – <div align=”center”></li>
<li>Inline CSS style – <p style=”font-family:monospace;”></li>
</ul>
<p>CSS attributes used in stylesheets or inline can define:</p>
<ul>
<li>Most tags/elements such as div, p, body, table, span</li>
<li>Class names – p.mystylename { font-size:9pt; }</li>
<li>Id – div#style { font-size:9pt; }</li>
</ul>
<p>For a <a href="http://mpdf1.com/manual/index.php?tid=34">full list of supported CSS properties</a> please review the extensive mPDF manual.</p>
<h3>CSS Limitations</h3>
<p>There is limited support for cascaded CSS but this can only be applied to standard block-level elements (you can’t set an inline element to block and use it in a cascading CSS selector).</p>
<p><strong>Valid Cascading CSS</strong></p>
<ul>
<li>div.topic table.type1 td {…}</li>
<li>div #my-id {…}</li>
<li>table tr {…}</li>
<li>div p.style {…}</li>
</ul>
<p><strong>Invalid Cascading CSS</strong></p>
<ul>
<li>div.style a {…}</li>
<li>a#class1 {…}</li>
<li>span.class a {…}</li>
<li>body.class div {…}</li>
</ul>
<p>We advise you keep your CSS selectors as simple as possible and assign a class or ID to the elements you need to target.</p>
<ul>
<li>#my-id {…}</li>
<li>.my-class {…}</li>
</ul>
<h3>Supported HTML</h3>
<div><strong>Note: </strong>All HTML elements are hard coded as block or inline elements. This cannot be changed using CSS’s ‘display’ property.</div>
<p><a href="http://mpdf1.com/manual/index.php?tid=256">View all supported HTML tags</a> and <a href="http://mpdf1.com/manual/index.php?tid=257">attributes</a>.</p>
</section>
<section id="fonts-language-support">
<h2>Available Fonts</h2>
<div><strong>Note: </strong>By default the package uses the unicode font DejaVuSans which has characters available for most languages worldwide.</div>
<p>The following open source fonts are available with Formidable Pro PDF Extended and should cover the majority of languages worldwide:</p>
<ul>
<li>DejaVuSans, DejaVuSansCondensed, DejaVuSansMono, DejaVuSerif, DejaVuSerifCondensed</li>
<li>Garuda – Thai (sans-serif)</li>
<li>Norasi – Thai (serif)</li>
<li>XBZar, XBRiyaz – Arabic</li>
</ul>
<p>The exception to this is Chinese, Japanese and Korean languages which requires users to manually install the fonts.</p>
<h3>CJK Font Support</h3>
<p>Formidable Pro PDF Extended doesn’t support Chinese, Japanese or Korean languages out of the box due to licensing restrictions (or rather lack of a license).</p>
<p>If you need CJK support you will need to manually download Sun-ExtA, Sun-ExtB and UnBatang and upload the .ttf files to your active theme’s FORMIDABLE_PDF_TEMPLATES/fonts/ folder. Once uploaded, you can install the fonts through the plugin’s settings page (Forms -> Settings -> PDF) by clicking <em>Initialise Fonts Only</em>.</p>
<p>After installation you can use the new fonts by setting the font-family CSS property:</p>
<ul>
<li>font-family: UnBatang, dejavusanscondensed, sans-serif;</li>
<li>font-family: sun-exta, dejavusanscondensed, sans-serif;</li>
<li>font-family: sun-extb, dejavusanscondensed, sans-serif;</li>
</ul>
<h4>DOWNLOAD</h4>
<div>Download all three fonts below and upload them to your active theme’s FORMIDABLE_PDF_TEMPLATES/fonts/ folder.</div>
<ul>
<li><a href="http://www.alanwood.net/downloads/sun-exta.zip">Sun-ExtA</a></li>
<li><a href="http://www.alanwood.net/downloads/sun-extb.zip">Sun-ExtB</a></li>
<li><a href="http://www.fontsaddict.com/font/un-batang.html">UnBatang</a></li>
</ul>
<p>For a full overview of which languages each font supports <a href="http://mpdf1.com/manual/index.php?tid=54">please view the mPDF documentation</a>.</p>
<h3 id="installing-fonts">Installing Custom Fonts</h3>
<p>Users can install their own font files and user them in their PDFs. With that said there are a few restrictions on fonts, including:</p>
<ol>
<li>Only support for Truetype fonts (.ttf)</li>
<li>Fonts must follow the Truetype specification and use Unicode mapping to the characters. </li>
</ol>
<h4>Installation</h4>
<p>Installing your custom font is as easy as placing your .ttf file in the FORMIDABLE_PDF_TEMPLATES/fonts/ folder, which is located in your active theme. Once uploaded, you can install the fonts through the plugin’s settings page (Formidable -> Global Settings PDF) by clicking <em>Initialise Fonts Only</em>.</p>
<h4>Usage</h4>
<p>After installation you can use the new fonts by setting the font-family CSS property. Your font family name will be the name of your font file (minus .ttf). For instance, if I upload a file called Mefis.ttf the font family name would be <em>Mefis</em>.</p>
<pre>/*
* Apply my new font to the entire PDF
* Note: It's important to include a font-family type at the end of your font chain (in this example it is sans-serif) in case your font doesn't contain a character your user has used. By default, the plugin will substitute those characters out for one this is supported.
**/
body {
font-family: Mefis, Arial, sans-serif;
}
</pre>
</section>
<h2>Templates</h2>
<section id="templates-intro">
<h3>Getting Started</h3>
<p>Creating a custom template gives you ultimate control of your PDF documents. Use HTML and CSS to control the look and feel of your document. Add some PHP to integrate Formidable Pro fields and you’ve got a custom document tailored to your business.</p>
<h3>Creating your first template</h3>
<div><strong>Note: </strong>All template files are located in your active theme’s FORMIDABLE_PDF_TEMPLATES folder which the plugin automatically generates.</div>
<p>When we are developing template files we like to get all the Formidable Pro data first and work from there. To do this you can and append ‘&data=1′ to the end of the URL while viewing any of the example template files through the admin area (change template=default-template.php in the URL to a custom template file). This will output the entire $form_data array which you can use throughout your custom template.</p>
<div><strong>Note: </strong> Adding &data=1 to the default template files won’t show you the $form_data array; it will only work with templates labelled ‘example-‘.</div>
<div><strong>Note: </strong> We changed from using field IDs for accessing field data to field keys in version 1.4 of the plugin. This is not backwards compatible.</div>
<pre>/*
* An example of what &data=1 will display
* Exactly like running print_r($form_data);
*/
Array
(
[form_title] => All Fields
[form_id] => 25
[lead_id] => 88
[date_created] => 10/05/2014
[date_created_usa] => 05/10/2014
[misc] => Array
(
[created_at] => 2014-05-10 04:09:51
[updated_at] => 2014-07-27 06:47:58
[updated_by] => 1
[user_id] => 1
[post_id] => 0
[description] => Array
(
[browser] => Mozilla/5.0 (Windows NT 6.1; WOW64; rv:29.0) Gecko/20100101 Firefox/29.0
[referrer] => http://clients.blueliquiddesigns.com.au/formidable/wp-admin/admin.php?page=formidable-entries&frm_action=new&form=25
)
[ip] => 121.217.82.114
[parent_item_id] =>
)
[field] => Array
(
[d6k1qj.Single Line Text] => Array
(
[title] => Single Line Text
[value] => Single Line
[type] => text
)
[d6k1qj] => Array
(
[title] => Single Line Text
[value] => Single Line
[type] => text
)
[bfaovd.Paragraph Text] => Array
(
[title] => Paragraph Text
[value] => Paragraph Text
[type] => textarea
)
[bfaovd] => Array
(
[title] => Paragraph Text
[value] => Paragraph Text
[type] => textarea
)
[v502o9] => Array
(
[title] => Checkboxes
[value] => Option 1
[label] => Array
(
[0] => Option 1
)
[string] => Option 1
[options] => Array
(
[0] => Option 1
[1] => Option 2
)
[type] => checkbox
)
[v502o9.Checkboxes] => Array
(
[title] => Checkboxes
[value] => Option 1
[label] => Array
(
[0] => Option 1
)
[string] => Option 1
[options] => Array
(
[0] => Option 1
[1] => Option 2
)
[type] => checkbox
)
[estk1f] => Array
(
[title] => Radio Buttons
[value] => Option 2
[label] => Array
(
[0] => Option 2
)
[string] => Option 2
[options] => Array
(
[0] => Option 1
[1] => Option 2
)
[type] => radio
)
[estk1f.Radio Buttons] => Array
(
[title] => Radio Buttons
[value] => Option 2
[label] => Array
(
[0] => Option 2
)
[string] => Option 2
[options] => Array
(
[0] => Option 1
[1] => Option 2
)
[type] => radio
)
[mh1m9n] => Array
(
[title] => Dropdown
[value] => Option 1
[label] => Array
(
[0] => Option 1
)
[string] => Option 1
[options] => Array
(
[0] =>
[1] => Option 1
)
[type] => select
)
[mh1m9n.Dropdown] => Array
(
[title] => Dropdown
[value] => Option 1
[label] => Array
(
[0] => Option 1
)
[string] => Option 1
[options] => Array
(
[0] =>
[1] => Option 1
)
[type] => select
)
[m8pkp8.Email Address] => Array
(
[title] => Email Address
[value] => test@test.com
[type] => email
)
[m8pkp8] => Array
(
[title] => Email Address
[value] => test@test.com
[type] => email
)
[z9sw50.Website] => http://test.com
[z9sw50] => http://test.com
[vdq4wo.File Upload] => Array
(
[name] => 259.png
[url] => http://clients.blueliquiddesigns.com.au/formidable/wp-content/uploads/formidable/259.png
[path] => /home/blueliquiddesigns/domains/clients.blueliquiddesigns.com.au/public_html/formidable/wp-content/uploads/formidable/259.png
)
[vdq4wo] => Array
(
[name] => 259.png
[url] => http://clients.blueliquiddesigns.com.au/formidable/wp-content/uploads/formidable/259.png
[path] => /home/blueliquiddesigns/domains/clients.blueliquiddesigns.com.au/public_html/formidable/wp-content/uploads/formidable/259.png
)
[ac54cp.Rich Text] => Array
(
[title] => Rich Text
[value] => Rich Text editor
[type] => rte
)
[ac54cp] => Array
(
[title] => Rich Text
[value] => Rich Text editor
[type] => rte
)
[ikjtr3.Number] => Array
(
[title] => Number
[value] => 51
[type] => number
)
[ikjtr3] => Array
(
[title] => Number
[value] => 51
[type] => number
)
[trhlz8.Phone Number] => Array
(
[title] => Phone Number
[value] => 1231231234
[type] => phone
)
[trhlz8] => Array
(
[title] => Phone Number
[value] => 1231231234
[type] => phone
)
[xyh9dj.Date] => Array
(
[title] => Date
[value] => 2014-05-08
[type] => date
)
[xyh9dj] => Array
(
[title] => Date
[value] => 2014-05-08
[type] => date
)
[sqkmbi.Time] => Array
(
[title] => Time
[value] => 09:00 AM
[type] => time
)
[sqkmbi] => Array
(
[title] => Time
[value] => 09:00 AM
[type] => time
)
[7cjxh.Scale] => Array
(
[title] => Scale
[value] => 4
[type] => scale
)
[7cjxh] => Array
(
[title] => Scale
[value] => 4
[type] => scale
)
[ssx6ie.Data from Entries] => Array
(
[title] => Data from Entries
[value] => May 18, 2014
[type] => data
)
[ssx6ie] => Array
(
[title] => Data from Entries
[value] => May 18, 2014
[type] => data
)
[zqtfhm.Hidden Field] => Array
(
[title] => Hidden Field
[value] => hidden field
[type] => hidden
)
[zqtfhm] => Array
(
[title] => Hidden Field
[value] => hidden field
[type] => hidden
)
[bji1oh.Password] => Array
(
[title] => Password
[value] => test
[type] => password
)
[bji1oh] => Array
(
[title] => Password
[value] => test
[type] => password
)
[tjg8rs.Tags] => Array
(
[title] => Tags
[value] => test, test2, test3
[type] => tag
)
[tjg8rs] => Array
(
[title] => Tags
[value] => test, test2, test3
[type] => tag
)
[uvhlcl] => Array
(
[title] => Table
[table_html] => <div id="frm-table-container-1254">
<table id="frm-table-1254">
<thead>
<tr>
<th> </th>
<th>Column 1</th>
<th>Column 2</th>
</tr>
</thead>
<tbody>
<tr>
<th>Row 1</th>
<td>Data R1C1</td>
<td>Data R1C2</td>
</tr>
<tr>
<th>Row 2</th>
<td>Data R2C1</td>
<td>Data R2C2</td>
</tr>
</tbody>
</table>
</div>
[table_cells] => Array
(
[0] => Array
(
[col_1] => Column 1
[col_2] => Column 2
)
[1] => Array
(
[row_1] => Row 1
[row_2] => Row 2
)
)
[table_data] => Array
(
[0] => Array
(
[0] => Data R1C1
[1] => Data R1C2
)
[1] => Array
(
[0] => Data R2C1
[1] => Data R2C2
)
)
)
[uvhlcl.Table] => Array
(
[title] => Table
[table_html] => <div id="frm-table-container-1254">
<table id="frm-table-1254">
<thead>
<tr>
<th> </th>
<th>Column 1</th>
<th>Column 2</th>
</tr>
</thead>
<tbody>
<tr>
<th>Row 1</th>
<td>Data R1C1</td>
<td>Data R1C2</td>
</tr>
<tr>
<th>Row 2</th>
<td>Data R2C1</td>
<td>Data R2C2</td>
</tr>
</tbody>
</table>
</div>
[table_cells] => Array
(
[0] => Array