Ultimate FAQ - Version 1.9.5

Version Description

  • Correcting/eliminating several PHP notices
  • Updating the version of FPDF used to 1.82
Download this release

Release Info

Developer Rustaurius
Plugin Icon 128x128 Ultimate FAQ
Version 1.9.5
Comparing to
See all releases

Code changes from version 1.9.4 to 1.9.5

Files changed (89) hide show
  1. FPDF/FAQ.htm +77 -146
  2. FPDF/changelog.htm +22 -1
  3. FPDF/doc/{fpdf.htm → __construct.htm} +3 -3
  4. FPDF/doc/acceptpagebreak.htm +2 -2
  5. FPDF/doc/addfont.htm +1 -1
  6. FPDF/doc/addlink.htm +5 -5
  7. FPDF/doc/addpage.htm +10 -5
  8. FPDF/doc/aliasnbpages.htm +2 -2
  9. FPDF/doc/cell.htm +10 -10
  10. FPDF/doc/close.htm +1 -1
  11. FPDF/doc/error.htm +4 -3
  12. FPDF/doc/footer.htm +1 -1
  13. FPDF/doc/getpageheight.htm +18 -0
  14. FPDF/doc/getpagewidth.htm +18 -0
  15. FPDF/doc/getx.htm +3 -3
  16. FPDF/doc/gety.htm +3 -3
  17. FPDF/doc/header.htm +1 -1
  18. FPDF/doc/image.htm +1 -1
  19. FPDF/doc/index.htm +6 -4
  20. FPDF/doc/line.htm +2 -2
  21. FPDF/doc/link.htm +4 -4
  22. FPDF/doc/ln.htm +1 -1
  23. FPDF/doc/multicell.htm +8 -8
  24. FPDF/doc/output.htm +20 -16
  25. FPDF/doc/pageno.htm +1 -1
  26. FPDF/doc/rect.htm +3 -3
  27. FPDF/doc/setauthor.htm +4 -4
  28. FPDF/doc/setautopagebreak.htm +3 -3
  29. FPDF/doc/setcreator.htm +4 -4
  30. FPDF/doc/setdrawcolor.htm +6 -6
  31. FPDF/doc/setfillcolor.htm +5 -5
  32. FPDF/doc/setfont.htm +5 -5
  33. FPDF/doc/setfontsize.htm +1 -1
  34. FPDF/doc/setkeywords.htm +4 -4
  35. FPDF/doc/setleftmargin.htm +4 -4
  36. FPDF/doc/setlinewidth.htm +4 -4
  37. FPDF/doc/setlink.htm +1 -1
  38. FPDF/doc/setmargins.htm +4 -4
  39. FPDF/doc/setrightmargin.htm +4 -4
  40. FPDF/doc/setsubject.htm +4 -4
  41. FPDF/doc/settextcolor.htm +5 -5
  42. FPDF/doc/settitle.htm +4 -4
  43. FPDF/doc/settopmargin.htm +4 -4
  44. FPDF/doc/setx.htm +4 -4
  45. FPDF/doc/setxy.htm +2 -2
  46. FPDF/doc/sety.htm +10 -6
  47. FPDF/doc/text.htm +5 -5
  48. FPDF/doc/write.htm +5 -5
  49. FPDF/font/courier.php +2 -0
  50. FPDF/font/courierb.php +2 -0
  51. FPDF/font/courierbi.php +2 -0
  52. FPDF/font/courieri.php +2 -0
  53. FPDF/font/helvetica.php +2 -0
  54. FPDF/font/helveticab.php +2 -0
  55. FPDF/font/helveticabi.php +2 -0
  56. FPDF/font/helveticai.php +2 -0
  57. FPDF/font/symbol.php +1 -0
  58. FPDF/font/times.php +2 -0
  59. FPDF/font/timesb.php +2 -0
  60. FPDF/font/timesbi.php +2 -0
  61. FPDF/font/timesi.php +2 -0
  62. FPDF/font/zapfdingbats.php +1 -0
  63. FPDF/fpdf.php +501 -404
  64. FPDF/makefont/makefont.php +109 -35
  65. FPDF/makefont/ttfparser.php +489 -55
  66. FPDF/tutorial/calligra.php +3 -1
  67. FPDF/tutorial/calligra.z +0 -0
  68. FPDF/tutorial/index.htm +2 -2
  69. FPDF/tutorial/tuto1.htm +4 -4
  70. FPDF/tutorial/tuto4.htm +3 -5
  71. FPDF/tutorial/tuto4.php +2 -4
  72. FPDF/tutorial/tuto6.htm +4 -15
  73. FPDF/tutorial/tuto6.php +4 -15
  74. FPDF/tutorial/tuto7.htm +25 -79
  75. Functions/EWD_UFAQ_Captcha.php +2 -2
  76. Functions/EWD_UFAQ_Create_Captcha_Image.php +1 -1
  77. Functions/EWD_UFAQ_Export.php +1 -1
  78. Functions/EWD_UFAQ_Import.php +9 -10
  79. Functions/EWD_UFAQ_Version_Reversion.php +0 -87
  80. Functions/Full_Upgrade.php +0 -47
  81. Functions/Process_Ajax.php +18 -19
  82. Functions/Update_Admin_Databases.php +9 -9
  83. Main.php +1 -3
  84. Shortcodes/DisplayFAQs.php +4 -4
  85. Shortcodes/Display_FAQ_Search.php +8 -8
  86. Shortcodes/SubmitFAQ.php +1 -2
  87. html/DashboardPage.php +17 -33
  88. html/OptionsPage.php +2 -2
  89. readme.txt +4 -0
FPDF/FAQ.htm CHANGED
@@ -14,19 +14,19 @@ ul#answers li {margin-top:1.8em}
14
  <h1>FAQ</h1>
15
  <ul>
16
  <li><b>1.</b> <a href='#q1'>What's exactly the license of FPDF? Are there any usage restrictions?</a></li>
17
- <li><b>2.</b> <a href='#q2'>When I try to create a PDF, a lot of weird characters show on the screen. Why?</a></li>
18
- <li><b>3.</b> <a href='#q3'>I try to generate a PDF and IE displays a blank page. What happens?</a></li>
19
- <li><b>4.</b> <a href='#q4'>I can't make line breaks work. I put \n in the string printed by MultiCell but it doesn't work.</a></li>
20
  <li><b>5.</b> <a href='#q5'>I try to display a variable in the Header method but nothing prints.</a></li>
21
- <li><b>6.</b> <a href='#q6'>I defined the Header and Footer methods in my PDF class but nothing appears.</a></li>
22
- <li><b>7.</b> <a href='#q7'>Accented characters are replaced by some strange characters like é.</a></li>
23
- <li><b>8.</b> <a href='#q8'>I try to display the Euro symbol but it doesn't work.</a></li>
24
- <li><b>9.</b> <a href='#q9'>I get the following error when I try to generate a PDF: Some data has already been output, can't send PDF file</a></li>
25
- <li><b>10.</b> <a href='#q10'>I draw a frame with very precise dimensions, but when printed I notice some differences.</a></li>
26
- <li><b>11.</b> <a href='#q11'>I'd like to use the whole surface of the page, but when printed I always have some margins. How can I get rid of them?</a></li>
27
- <li><b>12.</b> <a href='#q12'>How can I put a background in my PDF?</a></li>
28
- <li><b>13.</b> <a href='#q13'>How can I set a specific header or footer on the first page?</a></li>
29
- <li><b>14.</b> <a href='#q14'>I'd like to use extensions provided by different scripts. How can I combine them?</a></li>
30
  <li><b>15.</b> <a href='#q15'>How can I send the PDF by email?</a></li>
31
  <li><b>16.</b> <a href='#q16'>What's the limit of the file sizes I can generate with FPDF?</a></li>
32
  <li><b>17.</b> <a href='#q17'>Can I modify a PDF with FPDF?</a></li>
@@ -43,77 +43,45 @@ freely in your application (commercial or not), with or without modifications.
43
  </li>
44
 
45
  <li id='q2'>
46
- <p><b>2.</b> <span class='question'>When I try to create a PDF, a lot of weird characters show on the screen. Why?</span></p>
47
- These "weird" characters are in fact the actual content of your PDF. This behavior is a bug of
48
- IE6. When it first receives an HTML page, then a PDF from the same URL, it displays it directly
49
- without launching Acrobat. This happens frequently during the development stage: on the least
50
- script error, an HTML page is sent, and after correction, the PDF arrives.
51
  <br>
52
- To solve the problem, simply quit and restart IE. You can also go to another URL and come
53
- back.
54
  <br>
55
- To avoid this kind of inconvenience during the development, you can generate the PDF directly
56
- to a file and open it through the explorer.
 
 
 
 
 
57
  </li>
58
 
59
  <li id='q3'>
60
- <p><b>3.</b> <span class='question'>I try to generate a PDF and IE displays a blank page. What happens?</span></p>
61
- First of all, check that you send nothing to the browser after the PDF (not even a space or a
62
- carriage return). You can put an exit statement just after the call to the Output() method to
63
- be sure. If it still doesn't work, it means you're a victim of the "blank page syndrome". IE
64
- used in conjunction with the Acrobat plug-in suffers from many bugs. To avoid these problems
65
- in a reliable manner, two main techniques exist:
66
- <br>
67
- <br>
68
- - Disable the plug-in and use Acrobat as a helper application. To do this, launch Acrobat, go
69
- to the Edit menu, Preferences, Internet, and uncheck "Display PDF in browser". Then, the next
70
- time you load a PDF in IE, it displays the dialog box "Open it" or "Save it to disk". Uncheck
71
- the option "Always ask before opening this type of file" and choose Open. From now on, PDF files
72
- will open automatically in an external Acrobat window.
73
- <br>
74
- The drawback of the method is that you need to alter the client configuration, which you can do
75
- in an intranet environment but not for the Internet.
76
- <br>
77
- <br>
78
- - Use a redirection technique. It consists in generating the PDF in a temporary file on the server
79
- and redirect the client to it. For example, at the end of the script, you can put the following:
80
  <div class="doc-source">
81
- <pre><code>//Determine a temporary file name in the current directory
82
- $file = basename(tempnam('.', 'tmp'));
83
- rename($file, $file.'.pdf');
84
- $file .= '.pdf';
85
- //Save PDF to file
86
- $pdf-&gt;Output($file, 'F');
87
- //Redirect
88
- header('Location: '.$file);</code></pre>
89
  </div>
90
- This method turns the dynamic PDF into a static one and avoids all troubles. But you have to do
91
- some cleaning in order to delete the temporary files. For example:
92
  <div class="doc-source">
93
- <pre><code>function CleanFiles($dir)
94
- {
95
- //Delete temporary files
96
- $t = time();
97
- $h = opendir($dir);
98
- while($file=readdir($h))
99
- {
100
- if(substr($file,0,3)=='tmp' &amp;&amp; substr($file,-4)=='.pdf')
101
- {
102
- $path = $dir.'/'.$file;
103
- if($t-filemtime($path)&gt;3600)
104
- @unlink($path);
105
- }
106
- }
107
- closedir($h);
108
- }</code></pre>
109
  </div>
110
- This function deletes all files of the form tmp*.pdf older than an hour in the specified
111
- directory. You may call it where you want, for example in the script which generates the PDF.
112
  </li>
113
 
114
  <li id='q4'>
115
- <p><b>4.</b> <span class='question'>I can't make line breaks work. I put \n in the string printed by MultiCell but it doesn't work.</span></p>
116
- You have to enclose your string with double quotes, not single ones.
 
 
 
 
117
  </li>
118
 
119
  <li id='q5'>
@@ -143,7 +111,7 @@ $pdf-&gt;title = 'My title';</code></pre>
143
  </li>
144
 
145
  <li id='q6'>
146
- <p><b>6.</b> <span class='question'>I defined the Header and Footer methods in my PDF class but nothing appears.</span></p>
147
  You have to create an object from the PDF class, not FPDF:
148
  <div class="doc-source">
149
  <pre><code>$pdf = new PDF();</code></pre>
@@ -151,64 +119,34 @@ You have to create an object from the PDF class, not FPDF:
151
  </li>
152
 
153
  <li id='q7'>
154
- <p><b>7.</b> <span class='question'>Accented characters are replaced by some strange characters like é.</span></p>
155
- Don't use UTF-8 encoding. Standard FPDF fonts use ISO-8859-1 or Windows-1252.
156
- It is possible to perform a conversion to ISO-8859-1 with utf8_decode():
157
- <div class="doc-source">
158
- <pre><code>$str = utf8_decode($str);</code></pre>
159
- </div>
160
- But some characters such as Euro won't be translated correctly. If the iconv extension is available, the
161
- right way to do it is the following:
162
- <div class="doc-source">
163
- <pre><code>$str = iconv('UTF-8', 'windows-1252', $str);</code></pre>
164
- </div>
165
  </li>
166
 
167
  <li id='q8'>
168
- <p><b>8.</b> <span class='question'>I try to display the Euro symbol but it doesn't work.</span></p>
169
- The standard fonts have the Euro character at position 128. You can define a constant like this
170
- for convenience:
171
- <div class="doc-source">
172
- <pre><code>define('EURO', chr(128));</code></pre>
173
- </div>
174
  </li>
175
 
176
  <li id='q9'>
177
- <p><b>9.</b> <span class='question'>I get the following error when I try to generate a PDF: Some data has already been output, can't send PDF file</span></p>
178
- You must send nothing to the browser except the PDF itself: no HTML, no space, no carriage return. A common
179
- case is having extra blank at the end of an included script file.<br>
180
- If you can't figure out where the problem comes from, this other message appearing just before can help you:<br>
181
- <br>
182
- <b>Warning:</b> Cannot modify header information - headers already sent by (output started at script.php:X)<br>
183
- <br>
184
- It means that script.php outputs something at line X. Go to this line and fix it.
185
- In case the message doesn't show, first check that you didn't disable warnings, then add this at the very
186
- beginning of your script:
187
- <div class="doc-source">
188
- <pre><code>ob_end_clean();</code></pre>
189
- </div>
190
- If you still don't see it, disable zlib.output_compression in your php.ini and it should appear.
191
- </li>
192
-
193
- <li id='q10'>
194
- <p><b>10.</b> <span class='question'>I draw a frame with very precise dimensions, but when printed I notice some differences.</span></p>
195
  To respect dimensions, select "None" for the Page Scaling setting instead of "Shrink to Printable Area" in the print dialog box.
196
  </li>
197
 
198
- <li id='q11'>
199
- <p><b>11.</b> <span class='question'>I'd like to use the whole surface of the page, but when printed I always have some margins. How can I get rid of them?</span></p>
200
  Printers have physical margins (different depending on the models); it is therefore impossible to remove
201
  them and print on the whole surface of the paper.
202
  </li>
203
 
204
- <li id='q12'>
205
- <p><b>12.</b> <span class='question'>How can I put a background in my PDF?</span></p>
206
  For a picture, call Image() in the Header() method, before any other output. To set a background color, use Rect().
207
  </li>
208
 
209
- <li id='q13'>
210
- <p><b>13.</b> <span class='question'>How can I set a specific header or footer on the first page?</span></p>
211
- Simply test the page number:
212
  <div class="doc-source">
213
  <pre><code>function Header()
214
  {
@@ -226,8 +164,8 @@ Simply test the page number:
226
  </div>
227
  </li>
228
 
229
- <li id='q14'>
230
- <p><b>14.</b> <span class='question'>I'd like to use extensions provided by different scripts. How can I combine them?</span></p>
231
  Use an inheritance chain. If you have two classes, say A in a.php:
232
  <div class="doc-source">
233
  <pre><code>require('fpdf.php');
@@ -268,14 +206,19 @@ $pdf = new PDF();</code></pre>
268
  </div>
269
  </li>
270
 
 
 
 
 
 
271
  <li id='q15'>
272
  <p><b>15.</b> <span class='question'>How can I send the PDF by email?</span></p>
273
- As any other file, but an easy way is to use <a href="http://phpmailer.codeworxtech.com">PHPMailer</a> and
274
  its in-memory attachment:
275
  <div class="doc-source">
276
  <pre><code>$mail = new PHPMailer();
277
  ...
278
- $doc = $pdf-&gt;Output('', 'S');
279
  $mail-&gt;AddStringAttachment($doc, 'doc.pdf', 'base64', 'application/pdf');
280
  $mail-&gt;Send();</code></pre>
281
  </div>
@@ -286,55 +229,43 @@ $mail-&gt;Send();</code></pre>
286
  There is no particular limit. There are some constraints, however:
287
  <br>
288
  <br>
289
- - The maximum memory size allocated to PHP scripts is usually 8MB. For very big documents,
290
- especially with images, this limit may be reached (the file being built into memory). The
291
  parameter is configured in the php.ini file.
292
  <br>
293
  <br>
294
- - The maximum execution time allocated defaults to 30 seconds. This limit can of course be easily
295
- reached. It is configured in php.ini and may be altered dynamically with set_time_limit().
296
  <br>
297
  <br>
298
- - Browsers generally have a 5 minute time-out. If you send the PDF directly to the browser and
299
- reach the limit, it will be lost. It is therefore advised for very big documents to
300
- generate them in a file, and to send some data to the browser from time to time (with a call
301
- to flush() to force the output). When the document is finished, you can send a redirection to
302
- it or create a link.
303
- <br>
304
- Remark: even if the browser times out, the script may continue to run on the server.
305
  </li>
306
 
307
  <li id='q17'>
308
  <p><b>17.</b> <span class='question'>Can I modify a PDF with FPDF?</span></p>
309
- It is possible to import pages from an existing PDF document thanks to the FPDI extension:<br>
310
- <br>
311
- <a href="http://www.setasign.de/products/pdf-php-solutions/fpdi/" target="_blank">http://www.setasign.de/products/pdf-php-solutions/fpdi/</a><br>
312
- <br>
313
- You can then add some content to them.
314
  </li>
315
 
316
  <li id='q18'>
317
  <p><b>18.</b> <span class='question'>I'd like to make a search engine in PHP and index PDF files. Can I do it with FPDF?</span></p>
318
- No. But a GPL C utility does exist, pdftotext, which is able to extract the textual content from
319
- a PDF. It is provided with the Xpdf package:<br>
320
- <br>
321
- <a href="http://www.foolabs.com/xpdf/" target="_blank">http://www.foolabs.com/xpdf/</a>
322
  </li>
323
 
324
  <li id='q19'>
325
  <p><b>19.</b> <span class='question'>Can I convert an HTML page to PDF with FPDF?</span></p>
326
- Not real-world pages. But a GPL C utility does exist, htmldoc, which allows to do it and gives good results:<br>
327
- <br>
328
- <a href="http://www.htmldoc.org" target="_blank">http://www.htmldoc.org</a>
329
  </li>
330
 
331
  <li id='q20'>
332
  <p><b>20.</b> <span class='question'>Can I concatenate PDF files with FPDF?</span></p>
333
- Not directly, but it is possible to use <a href="http://www.setasign.de/products/pdf-php-solutions/fpdi/demos/concatenate-fake/" target="_blank">FPDI</a>
334
- to perform this task. Some free command-line tools also exist:<br>
335
- <br>
336
- <a href="http://thierry.schmit.free.fr/spip/spip.php?article15&amp;lang=en" target="_blank">mbtPdfAsm</a><br>
337
- <a href="http://www.accesspdf.com/pdftk/" target="_blank">pdftk</a>
338
  </li>
339
  </ul>
340
  </body>
14
  <h1>FAQ</h1>
15
  <ul>
16
  <li><b>1.</b> <a href='#q1'>What's exactly the license of FPDF? Are there any usage restrictions?</a></li>
17
+ <li><b>2.</b> <a href='#q2'>I get the following error when I try to generate a PDF: Some data has already been output, can't send PDF file</a></li>
18
+ <li><b>3.</b> <a href='#q3'>Accented letters are replaced with some strange characters like é.</a></li>
19
+ <li><b>4.</b> <a href='#q4'>I try to display the Euro symbol but it doesn't work.</a></li>
20
  <li><b>5.</b> <a href='#q5'>I try to display a variable in the Header method but nothing prints.</a></li>
21
+ <li><b>6.</b> <a href='#q6'>I have defined the Header and Footer methods in my PDF class but nothing shows.</a></li>
22
+ <li><b>7.</b> <a href='#q7'>I can't make line breaks work. I put \n in the string printed by MultiCell but it doesn't work.</a></li>
23
+ <li><b>8.</b> <a href='#q8'>I use jQuery to generate the PDF but it doesn't show.</a></li>
24
+ <li><b>9.</b> <a href='#q9'>I draw a frame with very precise dimensions, but when printed I notice some differences.</a></li>
25
+ <li><b>10.</b> <a href='#q10'>I'd like to use the whole surface of the page, but when printed I always have some margins. How can I get rid of them?</a></li>
26
+ <li><b>11.</b> <a href='#q11'>How can I put a background in my PDF?</a></li>
27
+ <li><b>12.</b> <a href='#q12'>How can I set a specific header or footer on the first page?</a></li>
28
+ <li><b>13.</b> <a href='#q13'>I'd like to use extensions provided by different scripts. How can I combine them?</a></li>
29
+ <li><b>14.</b> <a href='#q14'>How can I open the PDF in a new tab?</a></li>
30
  <li><b>15.</b> <a href='#q15'>How can I send the PDF by email?</a></li>
31
  <li><b>16.</b> <a href='#q16'>What's the limit of the file sizes I can generate with FPDF?</a></li>
32
  <li><b>17.</b> <a href='#q17'>Can I modify a PDF with FPDF?</a></li>
43
  </li>
44
 
45
  <li id='q2'>
46
+ <p><b>2.</b> <span class='question'>I get the following error when I try to generate a PDF: Some data has already been output, can't send PDF file</span></p>
47
+ You must send nothing to the browser except the PDF itself: no HTML, no space, no carriage return. A common
48
+ case is having extra blank at the end of an included script file.<br>
49
+ If you can't figure out where the problem comes from, this other message appearing just before can help you:<br>
 
50
  <br>
51
+ <b>Warning:</b> Cannot modify header information - headers already sent by (output started at script.php:X)<br>
 
52
  <br>
53
+ It means that script.php outputs something at line X. Go to this line and fix it.
54
+ In case the message doesn't show, first check that you didn't disable warnings, then add this at the very
55
+ beginning of your script:
56
+ <div class="doc-source">
57
+ <pre><code>ob_end_clean();</code></pre>
58
+ </div>
59
+ If you still don't see it, disable zlib.output_compression in your php.ini and it should appear.
60
  </li>
61
 
62
  <li id='q3'>
63
+ <p><b>3.</b> <span class='question'>Accented letters are replaced with some strange characters like é.</span></p>
64
+ Don't use UTF-8 with the standard fonts; they expect text encoded in ISO-8859-1 or windows-1252.
65
+ You can use utf8_decode() to perform a conversion to ISO-8859-1:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
  <div class="doc-source">
67
+ <pre><code>$str = utf8_decode($str);</code></pre>
 
 
 
 
 
 
 
68
  </div>
69
+ But some characters such as Euro won't be translated correctly. If the iconv extension is available, the
70
+ right way to do it is the following:
71
  <div class="doc-source">
72
+ <pre><code>$str = iconv('UTF-8', 'windows-1252', $str);</code></pre>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73
  </div>
74
+ In case you need characters outside windows-1252, take a look at tutorial #7 or
75
+ <a href="http://www.fpdf.org/?go=script&amp;id=92" target="_blank">tFPDF</a>.
76
  </li>
77
 
78
  <li id='q4'>
79
+ <p><b>4.</b> <span class='question'>I try to display the Euro symbol but it doesn't work.</span></p>
80
+ The standard fonts have the Euro character at position 128. You can define a constant like this
81
+ for convenience:
82
+ <div class="doc-source">
83
+ <pre><code>define('EURO', chr(128));</code></pre>
84
+ </div>
85
  </li>
86
 
87
  <li id='q5'>
111
  </li>
112
 
113
  <li id='q6'>
114
+ <p><b>6.</b> <span class='question'>I have defined the Header and Footer methods in my PDF class but nothing shows.</span></p>
115
  You have to create an object from the PDF class, not FPDF:
116
  <div class="doc-source">
117
  <pre><code>$pdf = new PDF();</code></pre>
119
  </li>
120
 
121
  <li id='q7'>
122
+ <p><b>7.</b> <span class='question'>I can't make line breaks work. I put \n in the string printed by MultiCell but it doesn't work.</span></p>
123
+ You have to enclose your string with double quotes, not single ones.
 
 
 
 
 
 
 
 
 
124
  </li>
125
 
126
  <li id='q8'>
127
+ <p><b>8.</b> <span class='question'>I use jQuery to generate the PDF but it doesn't show.</span></p>
128
+ Don't use an AJAX request to retrieve the PDF.
 
 
 
 
129
  </li>
130
 
131
  <li id='q9'>
132
+ <p><b>9.</b> <span class='question'>I draw a frame with very precise dimensions, but when printed I notice some differences.</span></p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
133
  To respect dimensions, select "None" for the Page Scaling setting instead of "Shrink to Printable Area" in the print dialog box.
134
  </li>
135
 
136
+ <li id='q10'>
137
+ <p><b>10.</b> <span class='question'>I'd like to use the whole surface of the page, but when printed I always have some margins. How can I get rid of them?</span></p>
138
  Printers have physical margins (different depending on the models); it is therefore impossible to remove
139
  them and print on the whole surface of the paper.
140
  </li>
141
 
142
+ <li id='q11'>
143
+ <p><b>11.</b> <span class='question'>How can I put a background in my PDF?</span></p>
144
  For a picture, call Image() in the Header() method, before any other output. To set a background color, use Rect().
145
  </li>
146
 
147
+ <li id='q12'>
148
+ <p><b>12.</b> <span class='question'>How can I set a specific header or footer on the first page?</span></p>
149
+ Just test the page number:
150
  <div class="doc-source">
151
  <pre><code>function Header()
152
  {
164
  </div>
165
  </li>
166
 
167
+ <li id='q13'>
168
+ <p><b>13.</b> <span class='question'>I'd like to use extensions provided by different scripts. How can I combine them?</span></p>
169
  Use an inheritance chain. If you have two classes, say A in a.php:
170
  <div class="doc-source">
171
  <pre><code>require('fpdf.php');
206
  </div>
207
  </li>
208
 
209
+ <li id='q14'>
210
+ <p><b>14.</b> <span class='question'>How can I open the PDF in a new tab?</span></p>
211
+ Just do the same as you would for an HTML page or anything else: add a target="_blank" to your link or form.
212
+ </li>
213
+
214
  <li id='q15'>
215
  <p><b>15.</b> <span class='question'>How can I send the PDF by email?</span></p>
216
+ As for any other file, but an easy way is to use <a href="https://github.com/PHPMailer/PHPMailer" target="_blank">PHPMailer</a> and
217
  its in-memory attachment:
218
  <div class="doc-source">
219
  <pre><code>$mail = new PHPMailer();
220
  ...
221
+ $doc = $pdf-&gt;Output('S');
222
  $mail-&gt;AddStringAttachment($doc, 'doc.pdf', 'base64', 'application/pdf');
223
  $mail-&gt;Send();</code></pre>
224
  </div>
229
  There is no particular limit. There are some constraints, however:
230
  <br>
231
  <br>
232
+ - There is usually a maximum memory size allocated to PHP scripts. For very big documents,
233
+ especially with images, the limit may be reached (the file being built in memory). The
234
  parameter is configured in the php.ini file.
235
  <br>
236
  <br>
237
+ - The maximum execution time allocated to scripts defaults to 30 seconds. This limit can of course
238
+ be easily reached. It is configured in php.ini and may be altered dynamically with set_time_limit().
239
  <br>
240
  <br>
241
+ You can work around the memory limit with <a href="http://www.fpdf.org/?go=script&amp;id=76" target="_blank">this script</a>.
 
 
 
 
 
 
242
  </li>
243
 
244
  <li id='q17'>
245
  <p><b>17.</b> <span class='question'>Can I modify a PDF with FPDF?</span></p>
246
+ It's possible to import pages from an existing PDF document thanks to the
247
+ <a href="https://www.setasign.com/products/fpdi/about/" target="_blank">FPDI</a> extension.
248
+ Then you can add some content to them.
 
 
249
  </li>
250
 
251
  <li id='q18'>
252
  <p><b>18.</b> <span class='question'>I'd like to make a search engine in PHP and index PDF files. Can I do it with FPDF?</span></p>
253
+ No. But a GPL C utility does exist, pdftotext, which is able to extract the textual content from a PDF.
254
+ It's provided with the <a href="https://www.xpdfreader.com" target="_blank">Xpdf</a> package.
 
 
255
  </li>
256
 
257
  <li id='q19'>
258
  <p><b>19.</b> <span class='question'>Can I convert an HTML page to PDF with FPDF?</span></p>
259
+ Not real-world pages. But a GPL C utility does exist, <a href="https://www.msweet.org/htmldoc/" target="_blank">HTMLDOC</a>,
260
+ which allows to do it and gives good results.
 
261
  </li>
262
 
263
  <li id='q20'>
264
  <p><b>20.</b> <span class='question'>Can I concatenate PDF files with FPDF?</span></p>
265
+ Not directly, but it's possible to use <a href="https://www.setasign.com/products/fpdi/demos/concatenate-fake/" target="_blank">FPDI</a>
266
+ to perform that task. Some free command-line tools also exist:
267
+ <a href="https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/" target="_blank">pdftk</a> and
268
+ <a href="http://thierry.schmit.free.fr/spip/spip.php?article15" target="_blank">mbtPdfAsm</a>.
 
269
  </li>
270
  </ul>
271
  </body>
FPDF/changelog.htm CHANGED
@@ -11,6 +11,27 @@ dd {margin:1em 0 1em 1em}
11
  <body>
12
  <h1>Changelog</h1>
13
  <dl>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  <dt><strong>v1.7</strong> (2011-06-18)</dt>
15
  <dd>
16
  - The MakeFont utility has been completely rewritten and doesn't depend on ttf2pt1 anymore.<br>
@@ -65,7 +86,7 @@ dd {margin:1em 0 1em 1em}
65
  <dd>
66
  - Type1 font support.<br>
67
  - Added Baltic encoding.<br>
68
- - The class now works internally in points with the origin at the bottom in order to avoid two bugs occurring with Acrobat 5 :<br>&nbsp;&nbsp;* The line thickness was too large when printed under Windows 98 SE and ME.<br>&nbsp;&nbsp;* TrueType fonts didn't appear immediately inside the plug-in (a substitution font was used), one had to cause a window refresh to make them show up.<br>
69
  - It's no longer necessary to set the decimal separator as dot to produce valid documents.<br>
70
  - The clickable area in a cell was always on the left independently from the text alignment.<br>
71
  - JPEG images in CMYK mode appeared in inverted colors.<br>
11
  <body>
12
  <h1>Changelog</h1>
13
  <dl>
14
+ <dt><strong>v1.82</strong> (2019-12-07)</dt>
15
+ <dd>
16
+ - Removed a deprecation notice under PHP 7.4.<br>
17
+ </dd>
18
+ <dt><strong>v1.81</strong> (2015-12-20)</dt>
19
+ <dd>
20
+ - Added GetPageWidth() and GetPageHeight().<br>
21
+ - Fixed a bug in SetXY().<br>
22
+ </dd>
23
+ <dt><strong>v1.8</strong> (2015-11-29)</dt>
24
+ <dd>
25
+ - PHP 5.1.0 or higher is now required.<br>
26
+ - The MakeFont utility now subsets fonts, which can greatly reduce font sizes.<br>
27
+ - Added ToUnicode CMaps to improve text extraction.<br>
28
+ - Added a parameter to AddPage() to rotate the page.<br>
29
+ - Added a parameter to SetY() to indicate whether the x position should be reset or not.<br>
30
+ - Added a parameter to Output() to specify the encoding of the name, and special characters are now properly encoded. Additionally the order of the first two parameters was reversed to be more logical (however the old order is still supported for compatibility).<br>
31
+ - The Error() method now throws an exception.<br>
32
+ - Adding contents before the first AddPage() or after Close() now raises an error.<br>
33
+ - Outputting text with no font selected now raises an error.<br>
34
+ </dd>
35
  <dt><strong>v1.7</strong> (2011-06-18)</dt>
36
  <dd>
37
  - The MakeFont utility has been completely rewritten and doesn't depend on ttf2pt1 anymore.<br>
86
  <dd>
87
  - Type1 font support.<br>
88
  - Added Baltic encoding.<br>
89
+ - The class now works internally in points with the origin at the bottom in order to avoid two bugs occurring with Acrobat 5:<br>&nbsp;&nbsp;* The line thickness was too large when printed under Windows 98 SE and ME.<br>&nbsp;&nbsp;* TrueType fonts didn't appear immediately inside the plug-in (a substitution font was used), one had to cause a window refresh to make them show up.<br>
90
  - It's no longer necessary to set the decimal separator as dot to produce valid documents.<br>
91
  - The clickable area in a cell was always on the left independently from the text alignment.<br>
92
  - JPEG images in CMYK mode appeared in inverted colors.<br>
FPDF/doc/{fpdf.htm → __construct.htm} RENAMED
@@ -2,12 +2,12 @@
2
  <html>
3
  <head>
4
  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
5
- <title>FPDF</title>
6
  <link type="text/css" rel="stylesheet" href="../fpdf.css">
7
  </head>
8
  <body>
9
- <h1>FPDF</h1>
10
- <code>FPDF([<b>string</b> orientation [, <b>string</b> unit [, <b>mixed</b> size]]])</code>
11
  <h2>Description</h2>
12
  This is the class constructor. It allows to set up the page size, the orientation and the
13
  unit of measure used in all methods (except for font sizes).
2
  <html>
3
  <head>
4
  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
5
+ <title>__construct</title>
6
  <link type="text/css" rel="stylesheet" href="../fpdf.css">
7
  </head>
8
  <body>
9
+ <h1>__construct</h1>
10
+ <code>__construct([<b>string</b> orientation [, <b>string</b> unit [, <b>mixed</b> size]]])</code>
11
  <h2>Description</h2>
12
  This is the class constructor. It allows to set up the page size, the orientation and the
13
  unit of measure used in all methods (except for font sizes).
FPDF/doc/acceptpagebreak.htm CHANGED
@@ -52,11 +52,11 @@ $pdf = new PDF();
52
  $pdf-&gt;AddPage();
53
  $pdf-&gt;SetFont('Arial','',12);
54
  for($i=1;$i&lt;=300;$i++)
55
- $pdf-&gt;Cell(0,5,&quot;Line $i&quot;,0,1);
56
  $pdf-&gt;Output();</code></pre>
57
  </div>
58
  <h2>See also</h2>
59
- <a href="setautopagebreak.htm">SetAutoPageBreak()</a>.
60
  <hr style="margin-top:1.5em">
61
  <div style="text-align:center"><a href="index.htm">Index</a></div>
62
  </body>
52
  $pdf-&gt;AddPage();
53
  $pdf-&gt;SetFont('Arial','',12);
54
  for($i=1;$i&lt;=300;$i++)
55
+ $pdf-&gt;Cell(0,5,"Line $i",0,1);
56
  $pdf-&gt;Output();</code></pre>
57
  </div>
58
  <h2>See also</h2>
59
+ <a href="setautopagebreak.htm">SetAutoPageBreak</a>
60
  <hr style="margin-top:1.5em">
61
  <div style="text-align:center"><a href="index.htm">Index</a></div>
62
  </body>
FPDF/doc/addfont.htm CHANGED
@@ -48,7 +48,7 @@ is equivalent to:
48
  <pre><code>$pdf-&gt;AddFont('Comic','I','comici.php');</code></pre>
49
  </div>
50
  <h2>See also</h2>
51
- <a href="setfont.htm">SetFont()</a>.
52
  <hr style="margin-top:1.5em">
53
  <div style="text-align:center"><a href="index.htm">Index</a></div>
54
  </body>
48
  <pre><code>$pdf-&gt;AddFont('Comic','I','comici.php');</code></pre>
49
  </div>
50
  <h2>See also</h2>
51
+ <a href="setfont.htm">SetFont</a>
52
  <hr style="margin-top:1.5em">
53
  <div style="text-align:center"><a href="index.htm">Index</a></div>
54
  </body>
FPDF/doc/addlink.htm CHANGED
@@ -15,11 +15,11 @@ which directs to another place within the document.
15
  The identifier can then be passed to Cell(), Write(), Image() or Link(). The destination is
16
  defined with SetLink().
17
  <h2>See also</h2>
18
- <a href="cell.htm">Cell()</a>,
19
- <a href="write.htm">Write()</a>,
20
- <a href="image.htm">Image()</a>,
21
- <a href="link.htm">Link()</a>,
22
- <a href="setlink.htm">SetLink()</a>.
23
  <hr style="margin-top:1.5em">
24
  <div style="text-align:center"><a href="index.htm">Index</a></div>
25
  </body>
15
  The identifier can then be passed to Cell(), Write(), Image() or Link(). The destination is
16
  defined with SetLink().
17
  <h2>See also</h2>
18
+ <a href="cell.htm">Cell</a>,
19
+ <a href="write.htm">Write</a>,
20
+ <a href="image.htm">Image</a>,
21
+ <a href="link.htm">Link</a>,
22
+ <a href="setlink.htm">SetLink</a>
23
  <hr style="margin-top:1.5em">
24
  <div style="text-align:center"><a href="index.htm">Index</a></div>
25
  </body>
FPDF/doc/addpage.htm CHANGED
@@ -7,7 +7,7 @@
7
  </head>
8
  <body>
9
  <h1>AddPage</h1>
10
- <code>AddPage([<b>string</b> orientation [, <b>mixed</b> size]])</code>
11
  <h2>Description</h2>
12
  Adds a new page to the document. If a page is already present, the Footer() method is called
13
  first to output the footer. Then the page is added, the current position set to the top-left
@@ -44,12 +44,17 @@ or an array containing the width and the height (expressed in user unit).<br>
44
  <br>
45
  The default value is the one passed to the constructor.
46
  </dd>
 
 
 
 
 
47
  </dl>
48
  <h2>See also</h2>
49
- <a href="fpdf.htm">FPDF()</a>,
50
- <a href="header.htm">Header()</a>,
51
- <a href="footer.htm">Footer()</a>,
52
- <a href="setmargins.htm">SetMargins()</a>.
53
  <hr style="margin-top:1.5em">
54
  <div style="text-align:center"><a href="index.htm">Index</a></div>
55
  </body>
7
  </head>
8
  <body>
9
  <h1>AddPage</h1>
10
+ <code>AddPage([<b>string</b> orientation [, <b>mixed</b> size [, <b>int</b> rotation]]])</code>
11
  <h2>Description</h2>
12
  Adds a new page to the document. If a page is already present, the Footer() method is called
13
  first to output the footer. Then the page is added, the current position set to the top-left
44
  <br>
45
  The default value is the one passed to the constructor.
46
  </dd>
47
+ <dt><code>rotation</code></dt>
48
+ <dd>
49
+ Angle by which to rotate the page. It must be a multiple of 90; positive values
50
+ mean clockwise rotation. The default value is <code>0</code>.
51
+ </dd>
52
  </dl>
53
  <h2>See also</h2>
54
+ <a href="__construct.htm">__construct</a>,
55
+ <a href="header.htm">Header</a>,
56
+ <a href="footer.htm">Footer</a>,
57
+ <a href="setmargins.htm">SetMargins</a>
58
  <hr style="margin-top:1.5em">
59
  <div style="text-align:center"><a href="index.htm">Index</a></div>
60
  </body>
FPDF/doc/aliasnbpages.htm CHANGED
@@ -37,8 +37,8 @@ $pdf = new PDF();
37
  $pdf-&gt;AliasNbPages();</code></pre>
38
  </div>
39
  <h2>See also</h2>
40
- <a href="pageno.htm">PageNo()</a>,
41
- <a href="footer.htm">Footer()</a>.
42
  <hr style="margin-top:1.5em">
43
  <div style="text-align:center"><a href="index.htm">Index</a></div>
44
  </body>
37
  $pdf-&gt;AliasNbPages();</code></pre>
38
  </div>
39
  <h2>See also</h2>
40
+ <a href="pageno.htm">PageNo</a>,
41
+ <a href="footer.htm">Footer</a>
42
  <hr style="margin-top:1.5em">
43
  <div style="text-align:center"><a href="index.htm">Index</a></div>
44
  </body>
FPDF/doc/cell.htm CHANGED
@@ -88,16 +88,16 @@ $pdf-&gt;Cell(80);
88
  $pdf-&gt;Cell(20,10,'Title',1,1,'C');</code></pre>
89
  </div>
90
  <h2>See also</h2>
91
- <a href="setfont.htm">SetFont()</a>,
92
- <a href="setdrawcolor.htm">SetDrawColor()</a>,
93
- <a href="setfillcolor.htm">SetFillColor()</a>,
94
- <a href="settextcolor.htm">SetTextColor()</a>,
95
- <a href="setlinewidth.htm">SetLineWidth()</a>,
96
- <a href="addlink.htm">AddLink()</a>,
97
- <a href="ln.htm">Ln()</a>,
98
- <a href="multicell.htm">MultiCell()</a>,
99
- <a href="write.htm">Write()</a>,
100
- <a href="setautopagebreak.htm">SetAutoPageBreak()</a>.
101
  <hr style="margin-top:1.5em">
102
  <div style="text-align:center"><a href="index.htm">Index</a></div>
103
  </body>
88
  $pdf-&gt;Cell(20,10,'Title',1,1,'C');</code></pre>
89
  </div>
90
  <h2>See also</h2>
91
+ <a href="setfont.htm">SetFont</a>,
92
+ <a href="setdrawcolor.htm">SetDrawColor</a>,
93
+ <a href="setfillcolor.htm">SetFillColor</a>,
94
+ <a href="settextcolor.htm">SetTextColor</a>,
95
+ <a href="setlinewidth.htm">SetLineWidth</a>,
96
+ <a href="addlink.htm">AddLink</a>,
97
+ <a href="ln.htm">Ln</a>,
98
+ <a href="multicell.htm">MultiCell</a>,
99
+ <a href="write.htm">Write</a>,
100
+ <a href="setautopagebreak.htm">SetAutoPageBreak</a>
101
  <hr style="margin-top:1.5em">
102
  <div style="text-align:center"><a href="index.htm">Index</a></div>
103
  </body>
FPDF/doc/close.htm CHANGED
@@ -14,7 +14,7 @@ does it automatically.
14
  <br>
15
  If the document contains no page, AddPage() is called to prevent from getting an invalid document.
16
  <h2>See also</h2>
17
- <a href="output.htm">Output()</a>.
18
  <hr style="margin-top:1.5em">
19
  <div style="text-align:center"><a href="index.htm">Index</a></div>
20
  </body>
14
  <br>
15
  If the document contains no page, AddPage() is called to prevent from getting an invalid document.
16
  <h2>See also</h2>
17
+ <a href="output.htm">Output</a>
18
  <hr style="margin-top:1.5em">
19
  <div style="text-align:center"><a href="index.htm">Index</a></div>
20
  </body>
FPDF/doc/error.htm CHANGED
@@ -9,9 +9,10 @@
9
  <h1>Error</h1>
10
  <code>Error(<b>string</b> msg)</code>
11
  <h2>Description</h2>
12
- This method is automatically called in case of fatal error; it simply outputs the message
13
- and halts the execution. An inherited class may override it to customize the error handling
14
- but should always halt the script, or the resulting document would probably be invalid.
 
15
  <h2>Parameters</h2>
16
  <dl class="param">
17
  <dt><code>msg</code></dt>
9
  <h1>Error</h1>
10
  <code>Error(<b>string</b> msg)</code>
11
  <h2>Description</h2>
12
+ This method is automatically called in case of a fatal error; it simply throws an exception
13
+ with the provided message.<br>
14
+ An inherited class may override it to customize the error handling but the method should
15
+ never return, otherwise the resulting document would probably be invalid.
16
  <h2>Parameters</h2>
17
  <dl class="param">
18
  <dt><code>msg</code></dt>
FPDF/doc/footer.htm CHANGED
@@ -28,7 +28,7 @@ function Footer()
28
  }</code></pre>
29
  </div>
30
  <h2>See also</h2>
31
- <a href="header.htm">Header()</a>.
32
  <hr style="margin-top:1.5em">
33
  <div style="text-align:center"><a href="index.htm">Index</a></div>
34
  </body>
28
  }</code></pre>
29
  </div>
30
  <h2>See also</h2>
31
+ <a href="header.htm">Header</a>
32
  <hr style="margin-top:1.5em">
33
  <div style="text-align:center"><a href="index.htm">Index</a></div>
34
  </body>
FPDF/doc/getpageheight.htm ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
5
+ <title>GetPageHeight</title>
6
+ <link type="text/css" rel="stylesheet" href="../fpdf.css">
7
+ </head>
8
+ <body>
9
+ <h1>GetPageHeight</h1>
10
+ <code><b>float</b> GetPageHeight()</code>
11
+ <h2>Description</h2>
12
+ Returns the current page height.
13
+ <h2>See also</h2>
14
+ <a href="getpagewidth.htm">GetPageWidth</a>
15
+ <hr style="margin-top:1.5em">
16
+ <div style="text-align:center"><a href="index.htm">Index</a></div>
17
+ </body>
18
+ </html>
FPDF/doc/getpagewidth.htm ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
5
+ <title>GetPageWidth</title>
6
+ <link type="text/css" rel="stylesheet" href="../fpdf.css">
7
+ </head>
8
+ <body>
9
+ <h1>GetPageWidth</h1>
10
+ <code><b>float</b> GetPageWidth()</code>
11
+ <h2>Description</h2>
12
+ Returns the current page width.
13
+ <h2>See also</h2>
14
+ <a href="getpageheight.htm">GetPageHeight</a>
15
+ <hr style="margin-top:1.5em">
16
+ <div style="text-align:center"><a href="index.htm">Index</a></div>
17
+ </body>
18
+ </html>
FPDF/doc/getx.htm CHANGED
@@ -11,9 +11,9 @@
11
  <h2>Description</h2>
12
  Returns the abscissa of the current position.
13
  <h2>See also</h2>
14
- <a href="setx.htm">SetX()</a>,
15
- <a href="gety.htm">GetY()</a>,
16
- <a href="sety.htm">SetY()</a>.
17
  <hr style="margin-top:1.5em">
18
  <div style="text-align:center"><a href="index.htm">Index</a></div>
19
  </body>
11
  <h2>Description</h2>
12
  Returns the abscissa of the current position.
13
  <h2>See also</h2>
14
+ <a href="setx.htm">SetX</a>,
15
+ <a href="gety.htm">GetY</a>,
16
+ <a href="sety.htm">SetY</a>
17
  <hr style="margin-top:1.5em">
18
  <div style="text-align:center"><a href="index.htm">Index</a></div>
19
  </body>
FPDF/doc/gety.htm CHANGED
@@ -11,9 +11,9 @@
11
  <h2>Description</h2>
12
  Returns the ordinate of the current position.
13
  <h2>See also</h2>
14
- <a href="sety.htm">SetY()</a>,
15
- <a href="getx.htm">GetX()</a>,
16
- <a href="setx.htm">SetX()</a>.
17
  <hr style="margin-top:1.5em">
18
  <div style="text-align:center"><a href="index.htm">Index</a></div>
19
  </body>
11
  <h2>Description</h2>
12
  Returns the ordinate of the current position.
13
  <h2>See also</h2>
14
+ <a href="sety.htm">SetY</a>,
15
+ <a href="getx.htm">GetX</a>,
16
+ <a href="setx.htm">SetX</a>
17
  <hr style="margin-top:1.5em">
18
  <div style="text-align:center"><a href="index.htm">Index</a></div>
19
  </body>
FPDF/doc/header.htm CHANGED
@@ -30,7 +30,7 @@ function Header()
30
  }</code></pre>
31
  </div>
32
  <h2>See also</h2>
33
- <a href="footer.htm">Footer()</a>.
34
  <hr style="margin-top:1.5em">
35
  <div style="text-align:center"><a href="index.htm">Index</a></div>
36
  </body>
30
  }</code></pre>
31
  </div>
32
  <h2>See also</h2>
33
+ <a href="footer.htm">Footer</a>
34
  <hr style="margin-top:1.5em">
35
  <div style="text-align:center"><a href="index.htm">Index</a></div>
36
  </body>
FPDF/doc/image.htm CHANGED
@@ -92,7 +92,7 @@ $pdf-&gt;Image('logo.png',10,10,-300);
92
  $pdf-&gt;Image('http://chart.googleapis.com/chart?cht=p3&amp;chd=t:60,40&amp;chs=250x100&amp;chl=Hello|World',60,30,90,0,'PNG');</code></pre>
93
  </div>
94
  <h2>See also</h2>
95
- <a href="addlink.htm">AddLink()</a>.
96
  <hr style="margin-top:1.5em">
97
  <div style="text-align:center"><a href="index.htm">Index</a></div>
98
  </body>
92
  $pdf-&gt;Image('http://chart.googleapis.com/chart?cht=p3&amp;chd=t:60,40&amp;chs=250x100&amp;chl=Hello|World',60,30,90,0,'PNG');</code></pre>
93
  </div>
94
  <h2>See also</h2>
95
+ <a href="addlink.htm">AddLink</a>
96
  <hr style="margin-top:1.5em">
97
  <div style="text-align:center"><a href="index.htm">Index</a></div>
98
  </body>
FPDF/doc/index.htm CHANGED
@@ -2,11 +2,12 @@
2
  <html>
3
  <head>
4
  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
5
- <title>FPDF 1.7 Reference Manual</title>
6
  <link type="text/css" rel="stylesheet" href="../fpdf.css">
7
  </head>
8
  <body>
9
- <h1>FPDF 1.7 Reference Manual</h1>
 
10
  <a href="acceptpagebreak.htm">AcceptPageBreak</a> - accept or not automatic page break<br>
11
  <a href="addfont.htm">AddFont</a> - add a new font<br>
12
  <a href="addlink.htm">AddLink</a> - create an internal link<br>
@@ -16,7 +17,8 @@
16
  <a href="close.htm">Close</a> - terminate the document<br>
17
  <a href="error.htm">Error</a> - fatal error<br>
18
  <a href="footer.htm">Footer</a> - page footer<br>
19
- <a href="fpdf.htm">FPDF</a> - constructor<br>
 
20
  <a href="getstringwidth.htm">GetStringWidth</a> - compute string length<br>
21
  <a href="getx.htm">GetX</a> - get current x position<br>
22
  <a href="gety.htm">GetY</a> - get current y position<br>
@@ -50,7 +52,7 @@
50
  <a href="settopmargin.htm">SetTopMargin</a> - set top margin<br>
51
  <a href="setx.htm">SetX</a> - set current x position<br>
52
  <a href="setxy.htm">SetXY</a> - set current x and y positions<br>
53
- <a href="sety.htm">SetY</a> - set current y position<br>
54
  <a href="text.htm">Text</a> - print a string<br>
55
  <a href="write.htm">Write</a> - print flowing text<br>
56
  </body>
2
  <html>
3
  <head>
4
  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
5
+ <title>FPDF 1.82 Reference Manual</title>
6
  <link type="text/css" rel="stylesheet" href="../fpdf.css">
7
  </head>
8
  <body>
9
+ <h1>FPDF 1.82 Reference Manual</h1>
10
+ <a href="__construct.htm">__construct</a> - constructor<br>
11
  <a href="acceptpagebreak.htm">AcceptPageBreak</a> - accept or not automatic page break<br>
12
  <a href="addfont.htm">AddFont</a> - add a new font<br>
13
  <a href="addlink.htm">AddLink</a> - create an internal link<br>
17
  <a href="close.htm">Close</a> - terminate the document<br>
18
  <a href="error.htm">Error</a> - fatal error<br>
19
  <a href="footer.htm">Footer</a> - page footer<br>
20
+ <a href="getpageheight.htm">GetPageHeight</a> - get current page height<br>
21
+ <a href="getpagewidth.htm">GetPageWidth</a> - get current page width<br>
22
  <a href="getstringwidth.htm">GetStringWidth</a> - compute string length<br>
23
  <a href="getx.htm">GetX</a> - get current x position<br>
24
  <a href="gety.htm">GetY</a> - get current y position<br>
52
  <a href="settopmargin.htm">SetTopMargin</a> - set top margin<br>
53
  <a href="setx.htm">SetX</a> - set current x position<br>
54
  <a href="setxy.htm">SetXY</a> - set current x and y positions<br>
55
+ <a href="sety.htm">SetY</a> - set current y position and optionally reset x<br>
56
  <a href="text.htm">Text</a> - print a string<br>
57
  <a href="write.htm">Write</a> - print flowing text<br>
58
  </body>
FPDF/doc/line.htm CHANGED
@@ -30,8 +30,8 @@ Ordinate of second point.
30
  </dd>
31
  </dl>
32
  <h2>See also</h2>
33
- <a href="setlinewidth.htm">SetLineWidth()</a>,
34
- <a href="setdrawcolor.htm">SetDrawColor()</a>.
35
  <hr style="margin-top:1.5em">
36
  <div style="text-align:center"><a href="index.htm">Index</a></div>
37
  </body>
30
  </dd>
31
  </dl>
32
  <h2>See also</h2>
33
+ <a href="setlinewidth.htm">SetLineWidth</a>,
34
+ <a href="setdrawcolor.htm">SetDrawColor</a>
35
  <hr style="margin-top:1.5em">
36
  <div style="text-align:center"><a href="index.htm">Index</a></div>
37
  </body>
FPDF/doc/link.htm CHANGED
@@ -36,10 +36,10 @@ URL or identifier returned by AddLink().
36
  </dd>
37
  </dl>
38
  <h2>See also</h2>
39
- <a href="addlink.htm">AddLink()</a>,
40
- <a href="cell.htm">Cell()</a>,
41
- <a href="write.htm">Write()</a>,
42
- <a href="image.htm">Image()</a>.
43
  <hr style="margin-top:1.5em">
44
  <div style="text-align:center"><a href="index.htm">Index</a></div>
45
  </body>
36
  </dd>
37
  </dl>
38
  <h2>See also</h2>
39
+ <a href="addlink.htm">AddLink</a>,
40
+ <a href="cell.htm">Cell</a>,
41
+ <a href="write.htm">Write</a>,
42
+ <a href="image.htm">Image</a>
43
  <hr style="margin-top:1.5em">
44
  <div style="text-align:center"><a href="index.htm">Index</a></div>
45
  </body>
FPDF/doc/ln.htm CHANGED
@@ -21,7 +21,7 @@ By default, the value equals the height of the last printed cell.
21
  </dd>
22
  </dl>
23
  <h2>See also</h2>
24
- <a href="cell.htm">Cell()</a>.
25
  <hr style="margin-top:1.5em">
26
  <div style="text-align:center"><a href="index.htm">Index</a></div>
27
  </body>
21
  </dd>
22
  </dl>
23
  <h2>See also</h2>
24
+ <a href="cell.htm">Cell</a>
25
  <hr style="margin-top:1.5em">
26
  <div style="text-align:center"><a href="index.htm">Index</a></div>
27
  </body>
FPDF/doc/multicell.htm CHANGED
@@ -62,14 +62,14 @@ Default value: <code>false</code>.
62
  </dd>
63
  </dl>
64
  <h2>See also</h2>
65
- <a href="setfont.htm">SetFont()</a>,
66
- <a href="setdrawcolor.htm">SetDrawColor()</a>,
67
- <a href="setfillcolor.htm">SetFillColor()</a>,
68
- <a href="settextcolor.htm">SetTextColor()</a>,
69
- <a href="setlinewidth.htm">SetLineWidth()</a>,
70
- <a href="cell.htm">Cell()</a>,
71
- <a href="write.htm">Write()</a>,
72
- <a href="setautopagebreak.htm">SetAutoPageBreak()</a>.
73
  <hr style="margin-top:1.5em">
74
  <div style="text-align:center"><a href="index.htm">Index</a></div>
75
  </body>
62
  </dd>
63
  </dl>
64
  <h2>See also</h2>
65
+ <a href="setfont.htm">SetFont</a>,
66
+ <a href="setdrawcolor.htm">SetDrawColor</a>,
67
+ <a href="setfillcolor.htm">SetFillColor</a>,
68
+ <a href="settextcolor.htm">SetTextColor</a>,
69
+ <a href="setlinewidth.htm">SetLineWidth</a>,
70
+ <a href="cell.htm">Cell</a>,
71
+ <a href="write.htm">Write</a>,
72
+ <a href="setautopagebreak.htm">SetAutoPageBreak</a>
73
  <hr style="margin-top:1.5em">
74
  <div style="text-align:center"><a href="index.htm">Index</a></div>
75
  </body>
FPDF/doc/output.htm CHANGED
@@ -7,35 +7,39 @@
7
  </head>
8
  <body>
9
  <h1>Output</h1>
10
- <code><b>string</b> Output([<b>string</b> name, <b>string</b> dest])</code>
11
  <h2>Description</h2>
12
- Send the document to a given destination: browser, file or string. In the case of browser, the
13
- plug-in may be used (if present) or a download ("Save as" dialog box) may be forced.
14
  <br>
15
  The method first calls Close() if necessary to terminate the document.
16
  <h2>Parameters</h2>
17
  <dl class="param">
18
- <dt><code>name</code></dt>
19
- <dd>
20
- The name of the file. If not specified, the document will be sent to the browser
21
- (destination <code>I</code>) with the name <code>doc.pdf</code>.
22
- </dd>
23
  <dt><code>dest</code></dt>
24
  <dd>
25
- Destination where to send the document. It can take one of the following values:
26
  <ul>
27
- <li><code>I</code>: send the file inline to the browser. The plug-in is used if available.
28
- The name given by <code>name</code> is used when one selects the "Save as" option on the
29
- link generating the PDF.</li>
30
- <li><code>D</code>: send to the browser and force a file download with the name given by
31
- <code>name</code>.</li>
32
  <li><code>F</code>: save to a local file with the name given by <code>name</code> (may include a path).</li>
33
- <li><code>S</code>: return the document as a string. <code>name</code> is ignored.</li>
34
  </ul>
 
 
 
 
 
 
 
 
 
 
 
 
35
  </dd>
36
  </dl>
37
  <h2>See also</h2>
38
- <a href="close.htm">Close()</a>.
39
  <hr style="margin-top:1.5em">
40
  <div style="text-align:center"><a href="index.htm">Index</a></div>
41
  </body>
7
  </head>
8
  <body>
9
  <h1>Output</h1>
10
+ <code><b>string</b> Output([<b>string</b> dest [, <b>string</b> name [, <b>boolean</b> isUTF8]]])</code>
11
  <h2>Description</h2>
12
+ Send the document to a given destination: browser, file or string. In the case of a browser, the
13
+ PDF viewer may be used or a download may be forced.
14
  <br>
15
  The method first calls Close() if necessary to terminate the document.
16
  <h2>Parameters</h2>
17
  <dl class="param">
 
 
 
 
 
18
  <dt><code>dest</code></dt>
19
  <dd>
20
+ Destination where to send the document. It can be one of the following:
21
  <ul>
22
+ <li><code>I</code>: send the file inline to the browser. The PDF viewer is used if available.</li>
23
+ <li><code>D</code>: send to the browser and force a file download with the name given by <code>name</code>.</li>
 
 
 
24
  <li><code>F</code>: save to a local file with the name given by <code>name</code> (may include a path).</li>
25
+ <li><code>S</code>: return the document as a string.</li>
26
  </ul>
27
+ The default value is <code>I</code>.
28
+ </dd>
29
+ <dt><code>name</code></dt>
30
+ <dd>
31
+ The name of the file. It is ignored in case of destination <code>S</code>.<br>
32
+ The default value is <code>doc.pdf</code>.
33
+ </dd>
34
+ <dt><code>isUTF8</code></dt>
35
+ <dd>
36
+ Indicates if <code>name</code> is encoded in ISO-8859-1 (<code>false</code>) or UTF-8 (<code>true</code>).
37
+ Only used for destinations <code>I</code> and <code>D</code>.<br>
38
+ The default value is <code>false</code>.
39
  </dd>
40
  </dl>
41
  <h2>See also</h2>
42
+ <a href="close.htm">Close</a>
43
  <hr style="margin-top:1.5em">
44
  <div style="text-align:center"><a href="index.htm">Index</a></div>
45
  </body>
FPDF/doc/pageno.htm CHANGED
@@ -11,7 +11,7 @@
11
  <h2>Description</h2>
12
  Returns the current page number.
13
  <h2>See also</h2>
14
- <a href="aliasnbpages.htm">AliasNbPages()</a>.
15
  <hr style="margin-top:1.5em">
16
  <div style="text-align:center"><a href="index.htm">Index</a></div>
17
  </body>
11
  <h2>Description</h2>
12
  Returns the current page number.
13
  <h2>See also</h2>
14
+ <a href="aliasnbpages.htm">AliasNbPages</a>
15
  <hr style="margin-top:1.5em">
16
  <div style="text-align:center"><a href="index.htm">Index</a></div>
17
  </body>
FPDF/doc/rect.htm CHANGED
@@ -39,9 +39,9 @@ Style of rendering. Possible values are:
39
  </dd>
40
  </dl>
41
  <h2>See also</h2>
42
- <a href="setlinewidth.htm">SetLineWidth()</a>,
43
- <a href="setdrawcolor.htm">SetDrawColor()</a>,
44
- <a href="setfillcolor.htm">SetFillColor()</a>.
45
  <hr style="margin-top:1.5em">
46
  <div style="text-align:center"><a href="index.htm">Index</a></div>
47
  </body>
39
  </dd>
40
  </dl>
41
  <h2>See also</h2>
42
+ <a href="setlinewidth.htm">SetLineWidth</a>,
43
+ <a href="setdrawcolor.htm">SetDrawColor</a>,
44
+ <a href="setfillcolor.htm">SetFillColor</a>
45
  <hr style="margin-top:1.5em">
46
  <div style="text-align:center"><a href="index.htm">Index</a></div>
47
  </body>
FPDF/doc/setauthor.htm CHANGED
@@ -23,10 +23,10 @@ Default value: <code>false</code>.
23
  </dd>
24
  </dl>
25
  <h2>See also</h2>
26
- <a href="setcreator.htm">SetCreator()</a>,
27
- <a href="setkeywords.htm">SetKeywords()</a>,
28
- <a href="setsubject.htm">SetSubject()</a>,
29
- <a href="settitle.htm">SetTitle()</a>.
30
  <hr style="margin-top:1.5em">
31
  <div style="text-align:center"><a href="index.htm">Index</a></div>
32
  </body>
23
  </dd>
24
  </dl>
25
  <h2>See also</h2>
26
+ <a href="setcreator.htm">SetCreator</a>,
27
+ <a href="setkeywords.htm">SetKeywords</a>,
28
+ <a href="setsubject.htm">SetSubject</a>,
29
+ <a href="settitle.htm">SetTitle</a>
30
  <hr style="margin-top:1.5em">
31
  <div style="text-align:center"><a href="index.htm">Index</a></div>
32
  </body>
FPDF/doc/setautopagebreak.htm CHANGED
@@ -24,9 +24,9 @@ Distance from the bottom of the page.
24
  </dd>
25
  </dl>
26
  <h2>See also</h2>
27
- <a href="cell.htm">Cell()</a>,
28
- <a href="multicell.htm">MultiCell()</a>,
29
- <a href="acceptpagebreak.htm">AcceptPageBreak()</a>.
30
  <hr style="margin-top:1.5em">
31
  <div style="text-align:center"><a href="index.htm">Index</a></div>
32
  </body>
24
  </dd>
25
  </dl>
26
  <h2>See also</h2>
27
+ <a href="cell.htm">Cell</a>,
28
+ <a href="multicell.htm">MultiCell</a>,
29
+ <a href="acceptpagebreak.htm">AcceptPageBreak</a>
30
  <hr style="margin-top:1.5em">
31
  <div style="text-align:center"><a href="index.htm">Index</a></div>
32
  </body>
FPDF/doc/setcreator.htm CHANGED
@@ -24,10 +24,10 @@ Default value: <code>false</code>.
24
  </dd>
25
  </dl>
26
  <h2>See also</h2>
27
- <a href="setauthor.htm">SetAuthor()</a>,
28
- <a href="setkeywords.htm">SetKeywords()</a>,
29
- <a href="setsubject.htm">SetSubject()</a>,
30
- <a href="settitle.htm">SetTitle()</a>.
31
  <hr style="margin-top:1.5em">
32
  <div style="text-align:center"><a href="index.htm">Index</a></div>
33
  </body>
24
  </dd>
25
  </dl>
26
  <h2>See also</h2>
27
+ <a href="setauthor.htm">SetAuthor</a>,
28
+ <a href="setkeywords.htm">SetKeywords</a>,
29
+ <a href="setsubject.htm">SetSubject</a>,
30
+ <a href="settitle.htm">SetTitle</a>
31
  <hr style="margin-top:1.5em">
32
  <div style="text-align:center"><a href="index.htm">Index</a></div>
33
  </body>
FPDF/doc/setdrawcolor.htm CHANGED
@@ -29,12 +29,12 @@ Blue component (between 0 and 255).
29
  </dd>
30
  </dl>
31
  <h2>See also</h2>
32
- <a href="setfillcolor.htm">SetFillColor()</a>,
33
- <a href="settextcolor.htm">SetTextColor()</a>,
34
- <a href="line.htm">Line()</a>,
35
- <a href="rect.htm">Rect()</a>,
36
- <a href="cell.htm">Cell()</a>,
37
- <a href="multicell.htm">MultiCell()</a>.
38
  <hr style="margin-top:1.5em">
39
  <div style="text-align:center"><a href="index.htm">Index</a></div>
40
  </body>
29
  </dd>
30
  </dl>
31
  <h2>See also</h2>
32
+ <a href="setfillcolor.htm">SetFillColor</a>,
33
+ <a href="settextcolor.htm">SetTextColor</a>,
34
+ <a href="line.htm">Line</a>,
35
+ <a href="rect.htm">Rect</a>,
36
+ <a href="cell.htm">Cell</a>,
37
+ <a href="multicell.htm">MultiCell</a>
38
  <hr style="margin-top:1.5em">
39
  <div style="text-align:center"><a href="index.htm">Index</a></div>
40
  </body>
FPDF/doc/setfillcolor.htm CHANGED
@@ -29,11 +29,11 @@ Blue component (between 0 and 255).
29
  </dd>
30
  </dl>
31
  <h2>See also</h2>
32
- <a href="setdrawcolor.htm">SetDrawColor()</a>,
33
- <a href="settextcolor.htm">SetTextColor()</a>,
34
- <a href="rect.htm">Rect()</a>,
35
- <a href="cell.htm">Cell()</a>,
36
- <a href="multicell.htm">MultiCell()</a>.
37
  <hr style="margin-top:1.5em">
38
  <div style="text-align:center"><a href="index.htm">Index</a></div>
39
  </body>
29
  </dd>
30
  </dl>
31
  <h2>See also</h2>
32
+ <a href="setdrawcolor.htm">SetDrawColor</a>,
33
+ <a href="settextcolor.htm">SetTextColor</a>,
34
+ <a href="rect.htm">Rect</a>,
35
+ <a href="cell.htm">Cell</a>,
36
+ <a href="multicell.htm">MultiCell</a>
37
  <hr style="margin-top:1.5em">
38
  <div style="text-align:center"><a href="index.htm">Index</a></div>
39
  </body>
FPDF/doc/setfont.htm CHANGED
@@ -81,11 +81,11 @@ $pdf-&gt;SetFont('');
81
  $pdf-&gt;SetFont('Times','BIU');</code></pre>
82
  </div>
83
  <h2>See also</h2>
84
- <a href="addfont.htm">AddFont()</a>,
85
- <a href="setfontsize.htm">SetFontSize()</a>,
86
- <a href="cell.htm">Cell()</a>,
87
- <a href="multicell.htm">MultiCell()</a>,
88
- <a href="write.htm">Write()</a>.
89
  <hr style="margin-top:1.5em">
90
  <div style="text-align:center"><a href="index.htm">Index</a></div>
91
  </body>
81
  $pdf-&gt;SetFont('Times','BIU');</code></pre>
82
  </div>
83
  <h2>See also</h2>
84
+ <a href="addfont.htm">AddFont</a>,
85
+ <a href="setfontsize.htm">SetFontSize</a>,
86
+ <a href="cell.htm">Cell</a>,
87
+ <a href="multicell.htm">MultiCell</a>,
88
+ <a href="write.htm">Write</a>
89
  <hr style="margin-top:1.5em">
90
  <div style="text-align:center"><a href="index.htm">Index</a></div>
91
  </body>
FPDF/doc/setfontsize.htm CHANGED
@@ -18,7 +18,7 @@ The size (in points).
18
  </dd>
19
  </dl>
20
  <h2>See also</h2>
21
- <a href="setfont.htm">SetFont()</a>.
22
  <hr style="margin-top:1.5em">
23
  <div style="text-align:center"><a href="index.htm">Index</a></div>
24
  </body>
18
  </dd>
19
  </dl>
20
  <h2>See also</h2>
21
+ <a href="setfont.htm">SetFont</a>
22
  <hr style="margin-top:1.5em">
23
  <div style="text-align:center"><a href="index.htm">Index</a></div>
24
  </body>
FPDF/doc/setkeywords.htm CHANGED
@@ -23,10 +23,10 @@ Default value: <code>false</code>.
23
  </dd>
24
  </dl>
25
  <h2>See also</h2>
26
- <a href="setauthor.htm">SetAuthor()</a>,
27
- <a href="setcreator.htm">SetCreator()</a>,
28
- <a href="setsubject.htm">SetSubject()</a>,
29
- <a href="settitle.htm">SetTitle()</a>.
30
  <hr style="margin-top:1.5em">
31
  <div style="text-align:center"><a href="index.htm">Index</a></div>
32
  </body>
23
  </dd>
24
  </dl>
25
  <h2>See also</h2>
26
+ <a href="setauthor.htm">SetAuthor</a>,
27
+ <a href="setcreator.htm">SetCreator</a>,
28
+ <a href="setsubject.htm">SetSubject</a>,
29
+ <a href="settitle.htm">SetTitle</a>
30
  <hr style="margin-top:1.5em">
31
  <div style="text-align:center"><a href="index.htm">Index</a></div>
32
  </body>
FPDF/doc/setleftmargin.htm CHANGED
@@ -20,10 +20,10 @@ The margin.
20
  </dd>
21
  </dl>
22
  <h2>See also</h2>
23
- <a href="settopmargin.htm">SetTopMargin()</a>,
24
- <a href="setrightmargin.htm">SetRightMargin()</a>,
25
- <a href="setautopagebreak.htm">SetAutoPageBreak()</a>,
26
- <a href="setmargins.htm">SetMargins()</a>.
27
  <hr style="margin-top:1.5em">
28
  <div style="text-align:center"><a href="index.htm">Index</a></div>
29
  </body>
20
  </dd>
21
  </dl>
22
  <h2>See also</h2>
23
+ <a href="settopmargin.htm">SetTopMargin</a>,
24
+ <a href="setrightmargin.htm">SetRightMargin</a>,
25
+ <a href="setautopagebreak.htm">SetAutoPageBreak</a>,
26
+ <a href="setmargins.htm">SetMargins</a>
27
  <hr style="margin-top:1.5em">
28
  <div style="text-align:center"><a href="index.htm">Index</a></div>
29
  </body>
FPDF/doc/setlinewidth.htm CHANGED
@@ -19,10 +19,10 @@ The width.
19
  </dd>
20
  </dl>
21
  <h2>See also</h2>
22
- <a href="line.htm">Line()</a>,
23
- <a href="rect.htm">Rect()</a>,
24
- <a href="cell.htm">Cell()</a>,
25
- <a href="multicell.htm">MultiCell()</a>.
26
  <hr style="margin-top:1.5em">
27
  <div style="text-align:center"><a href="index.htm">Index</a></div>
28
  </body>
19
  </dd>
20
  </dl>
21
  <h2>See also</h2>
22
+ <a href="line.htm">Line</a>,
23
+ <a href="rect.htm">Rect</a>,
24
+ <a href="cell.htm">Cell</a>,
25
+ <a href="multicell.htm">MultiCell</a>
26
  <hr style="margin-top:1.5em">
27
  <div style="text-align:center"><a href="index.htm">Index</a></div>
28
  </body>
FPDF/doc/setlink.htm CHANGED
@@ -27,7 +27,7 @@ Number of target page; <code>-1</code> indicates the current page. This is the d
27
  </dd>
28
  </dl>
29
  <h2>See also</h2>
30
- <a href="addlink.htm">AddLink()</a>.
31
  <hr style="margin-top:1.5em">
32
  <div style="text-align:center"><a href="index.htm">Index</a></div>
33
  </body>
27
  </dd>
28
  </dl>
29
  <h2>See also</h2>
30
+ <a href="addlink.htm">AddLink</a>
31
  <hr style="margin-top:1.5em">
32
  <div style="text-align:center"><a href="index.htm">Index</a></div>
33
  </body>
FPDF/doc/setmargins.htm CHANGED
@@ -27,10 +27,10 @@ Right margin. Default value is the left one.
27
  </dd>
28
  </dl>
29
  <h2>See also</h2>
30
- <a href="setleftmargin.htm">SetLeftMargin()</a>,
31
- <a href="settopmargin.htm">SetTopMargin()</a>,
32
- <a href="setrightmargin.htm">SetRightMargin()</a>,
33
- <a href="setautopagebreak.htm">SetAutoPageBreak()</a>.
34
  <hr style="margin-top:1.5em">
35
  <div style="text-align:center"><a href="index.htm">Index</a></div>
36
  </body>
27
  </dd>
28
  </dl>
29
  <h2>See also</h2>
30
+ <a href="setleftmargin.htm">SetLeftMargin</a>,
31
+ <a href="settopmargin.htm">SetTopMargin</a>,
32
+ <a href="setrightmargin.htm">SetRightMargin</a>,
33
+ <a href="setautopagebreak.htm">SetAutoPageBreak</a>
34
  <hr style="margin-top:1.5em">
35
  <div style="text-align:center"><a href="index.htm">Index</a></div>
36
  </body>
FPDF/doc/setrightmargin.htm CHANGED
@@ -18,10 +18,10 @@ The margin.
18
  </dd>
19
  </dl>
20
  <h2>See also</h2>
21
- <a href="setleftmargin.htm">SetLeftMargin()</a>,
22
- <a href="settopmargin.htm">SetTopMargin()</a>,
23
- <a href="setautopagebreak.htm">SetAutoPageBreak()</a>,
24
- <a href="setmargins.htm">SetMargins()</a>.
25
  <hr style="margin-top:1.5em">
26
  <div style="text-align:center"><a href="index.htm">Index</a></div>
27
  </body>
18
  </dd>
19
  </dl>
20
  <h2>See also</h2>
21
+ <a href="setleftmargin.htm">SetLeftMargin</a>,
22
+ <a href="settopmargin.htm">SetTopMargin</a>,
23
+ <a href="setautopagebreak.htm">SetAutoPageBreak</a>,
24
+ <a href="setmargins.htm">SetMargins</a>
25
  <hr style="margin-top:1.5em">
26
  <div style="text-align:center"><a href="index.htm">Index</a></div>
27
  </body>
FPDF/doc/setsubject.htm CHANGED
@@ -23,10 +23,10 @@ Default value: <code>false</code>.
23
  </dd>
24
  </dl>
25
  <h2>See also</h2>
26
- <a href="setauthor.htm">SetAuthor()</a>,
27
- <a href="setcreator.htm">SetCreator()</a>,
28
- <a href="setkeywords.htm">SetKeywords()</a>,
29
- <a href="settitle.htm">SetTitle()</a>.
30
  <hr style="margin-top:1.5em">
31
  <div style="text-align:center"><a href="index.htm">Index</a></div>
32
  </body>
23
  </dd>
24
  </dl>
25
  <h2>See also</h2>
26
+ <a href="setauthor.htm">SetAuthor</a>,
27
+ <a href="setcreator.htm">SetCreator</a>,
28
+ <a href="setkeywords.htm">SetKeywords</a>,
29
+ <a href="settitle.htm">SetTitle</a>
30
  <hr style="margin-top:1.5em">
31
  <div style="text-align:center"><a href="index.htm">Index</a></div>
32
  </body>
FPDF/doc/settextcolor.htm CHANGED
@@ -29,11 +29,11 @@ Blue component (between 0 and 255).
29
  </dd>
30
  </dl>
31
  <h2>See also</h2>
32
- <a href="setdrawcolor.htm">SetDrawColor()</a>,
33
- <a href="setfillcolor.htm">SetFillColor()</a>,
34
- <a href="text.htm">Text()</a>,
35
- <a href="cell.htm">Cell()</a>,
36
- <a href="multicell.htm">MultiCell()</a>.
37
  <hr style="margin-top:1.5em">
38
  <div style="text-align:center"><a href="index.htm">Index</a></div>
39
  </body>
29
  </dd>
30
  </dl>
31
  <h2>See also</h2>
32
+ <a href="setdrawcolor.htm">SetDrawColor</a>,
33
+ <a href="setfillcolor.htm">SetFillColor</a>,
34
+ <a href="text.htm">Text</a>,
35
+ <a href="cell.htm">Cell</a>,
36
+ <a href="multicell.htm">MultiCell</a>
37
  <hr style="margin-top:1.5em">
38
  <div style="text-align:center"><a href="index.htm">Index</a></div>
39
  </body>
FPDF/doc/settitle.htm CHANGED
@@ -23,10 +23,10 @@ Default value: <code>false</code>.
23
  </dd>
24
  </dl>
25
  <h2>See also</h2>
26
- <a href="setauthor.htm">SetAuthor()</a>,
27
- <a href="setcreator.htm">SetCreator()</a>,
28
- <a href="setkeywords.htm">SetKeywords()</a>,
29
- <a href="setsubject.htm">SetSubject()</a>.
30
  <hr style="margin-top:1.5em">
31
  <div style="text-align:center"><a href="index.htm">Index</a></div>
32
  </body>
23
  </dd>
24
  </dl>
25
  <h2>See also</h2>
26
+ <a href="setauthor.htm">SetAuthor</a>,
27
+ <a href="setcreator.htm">SetCreator</a>,
28
+ <a href="setkeywords.htm">SetKeywords</a>,
29
+ <a href="setsubject.htm">SetSubject</a>
30
  <hr style="margin-top:1.5em">
31
  <div style="text-align:center"><a href="index.htm">Index</a></div>
32
  </body>
FPDF/doc/settopmargin.htm CHANGED
@@ -18,10 +18,10 @@ The margin.
18
  </dd>
19
  </dl>
20
  <h2>See also</h2>
21
- <a href="setleftmargin.htm">SetLeftMargin()</a>,
22
- <a href="setrightmargin.htm">SetRightMargin()</a>,
23
- <a href="setautopagebreak.htm">SetAutoPageBreak()</a>,
24
- <a href="setmargins.htm">SetMargins()</a>.
25
  <hr style="margin-top:1.5em">
26
  <div style="text-align:center"><a href="index.htm">Index</a></div>
27
  </body>
18
  </dd>
19
  </dl>
20
  <h2>See also</h2>
21
+ <a href="setleftmargin.htm">SetLeftMargin</a>,
22
+ <a href="setrightmargin.htm">SetRightMargin</a>,
23
+ <a href="setautopagebreak.htm">SetAutoPageBreak</a>,
24
+ <a href="setmargins.htm">SetMargins</a>
25
  <hr style="margin-top:1.5em">
26
  <div style="text-align:center"><a href="index.htm">Index</a></div>
27
  </body>
FPDF/doc/setx.htm CHANGED
@@ -19,10 +19,10 @@ The value of the abscissa.
19
  </dd>
20
  </dl>
21
  <h2>See also</h2>
22
- <a href="getx.htm">GetX()</a>,
23
- <a href="gety.htm">GetY()</a>,
24
- <a href="sety.htm">SetY()</a>,
25
- <a href="setxy.htm">SetXY()</a>.
26
  <hr style="margin-top:1.5em">
27
  <div style="text-align:center"><a href="index.htm">Index</a></div>
28
  </body>
19
  </dd>
20
  </dl>
21
  <h2>See also</h2>
22
+ <a href="getx.htm">GetX</a>,
23
+ <a href="gety.htm">GetY</a>,
24
+ <a href="sety.htm">SetY</a>,
25
+ <a href="setxy.htm">SetXY</a>
26
  <hr style="margin-top:1.5em">
27
  <div style="text-align:center"><a href="index.htm">Index</a></div>
28
  </body>
FPDF/doc/setxy.htm CHANGED
@@ -23,8 +23,8 @@ The value of the ordinate.
23
  </dd>
24
  </dl>
25
  <h2>See also</h2>
26
- <a href="setx.htm">SetX()</a>,
27
- <a href="sety.htm">SetY()</a>.
28
  <hr style="margin-top:1.5em">
29
  <div style="text-align:center"><a href="index.htm">Index</a></div>
30
  </body>
23
  </dd>
24
  </dl>
25
  <h2>See also</h2>
26
+ <a href="setx.htm">SetX</a>,
27
+ <a href="sety.htm">SetY</a>
28
  <hr style="margin-top:1.5em">
29
  <div style="text-align:center"><a href="index.htm">Index</a></div>
30
  </body>
FPDF/doc/sety.htm CHANGED
@@ -7,9 +7,9 @@
7
  </head>
8
  <body>
9
  <h1>SetY</h1>
10
- <code>SetY(<b>float</b> y)</code>
11
  <h2>Description</h2>
12
- Moves the current abscissa back to the left margin and sets the ordinate. If the passed value
13
  is negative, it is relative to the bottom of the page.
14
  <h2>Parameters</h2>
15
  <dl class="param">
@@ -17,12 +17,16 @@ is negative, it is relative to the bottom of the page.
17
  <dd>
18
  The value of the ordinate.
19
  </dd>
 
 
 
 
20
  </dl>
21
  <h2>See also</h2>
22
- <a href="getx.htm">GetX()</a>,
23
- <a href="gety.htm">GetY()</a>,
24
- <a href="setx.htm">SetX()</a>,
25
- <a href="setxy.htm">SetXY()</a>.
26
  <hr style="margin-top:1.5em">
27
  <div style="text-align:center"><a href="index.htm">Index</a></div>
28
  </body>
7
  </head>
8
  <body>
9
  <h1>SetY</h1>
10
+ <code>SetY(<b>float</b> y [, <b>boolean</b> resetX])</code>
11
  <h2>Description</h2>
12
+ Sets the ordinate and optionally moves the current abscissa back to the left margin. If the value
13
  is negative, it is relative to the bottom of the page.
14
  <h2>Parameters</h2>
15
  <dl class="param">
17
  <dd>
18
  The value of the ordinate.
19
  </dd>
20
+ <dt><code>resetX</code></dt>
21
+ <dd>
22
+ Whether to reset the abscissa. Default value: <code>true</code>.
23
+ </dd>
24
  </dl>
25
  <h2>See also</h2>
26
+ <a href="getx.htm">GetX</a>,
27
+ <a href="gety.htm">GetY</a>,
28
+ <a href="setx.htm">SetX</a>,
29
+ <a href="setxy.htm">SetXY</a>
30
  <hr style="margin-top:1.5em">
31
  <div style="text-align:center"><a href="index.htm">Index</a></div>
32
  </body>
FPDF/doc/text.htm CHANGED
@@ -28,11 +28,11 @@ String to print.
28
  </dd>
29
  </dl>
30
  <h2>See also</h2>
31
- <a href="setfont.htm">SetFont()</a>,
32
- <a href="settextcolor.htm">SetTextColor()</a>,
33
- <a href="cell.htm">Cell()</a>,
34
- <a href="multicell.htm">MultiCell()</a>,
35
- <a href="write.htm">Write()</a>.
36
  <hr style="margin-top:1.5em">
37
  <div style="text-align:center"><a href="index.htm">Index</a></div>
38
  </body>
28
  </dd>
29
  </dl>
30
  <h2>See also</h2>
31
+ <a href="setfont.htm">SetFont</a>,
32
+ <a href="settextcolor.htm">SetTextColor</a>,
33
+ <a href="cell.htm">Cell</a>,
34
+ <a href="multicell.htm">MultiCell</a>,
35
+ <a href="write.htm">Write</a>
36
  <hr style="margin-top:1.5em">
37
  <div style="text-align:center"><a href="index.htm">Index</a></div>
38
  </body>
FPDF/doc/write.htm CHANGED
@@ -40,11 +40,11 @@ $pdf-&gt;SetFont('','U');
40
  $pdf-&gt;Write(5,'www.fpdf.org','http://www.fpdf.org');</code></pre>
41
  </div>
42
  <h2>See also</h2>
43
- <a href="setfont.htm">SetFont()</a>,
44
- <a href="settextcolor.htm">SetTextColor()</a>,
45
- <a href="addlink.htm">AddLink()</a>,
46
- <a href="multicell.htm">MultiCell()</a>,
47
- <a href="setautopagebreak.htm">SetAutoPageBreak()</a>.
48
  <hr style="margin-top:1.5em">
49
  <div style="text-align:center"><a href="index.htm">Index</a></div>
50
  </body>
40
  $pdf-&gt;Write(5,'www.fpdf.org','http://www.fpdf.org');</code></pre>
41
  </div>
42
  <h2>See also</h2>
43
+ <a href="setfont.htm">SetFont</a>,
44
+ <a href="settextcolor.htm">SetTextColor</a>,
45
+ <a href="addlink.htm">AddLink</a>,
46
+ <a href="multicell.htm">MultiCell</a>,
47
+ <a href="setautopagebreak.htm">SetAutoPageBreak</a>
48
  <hr style="margin-top:1.5em">
49
  <div style="text-align:center"><a href="index.htm">Index</a></div>
50
  </body>
FPDF/font/courier.php CHANGED
@@ -5,4 +5,6 @@ $up = -100;
5
  $ut = 50;
6
  for($i=0;$i<=255;$i++)
7
  $cw[chr($i)] = 600;
 
 
8
  ?>
5
  $ut = 50;
6
  for($i=0;$i<=255;$i++)
7
  $cw[chr($i)] = 600;
8
+ $enc = 'cp1252';
9
+ $uv = array(0=>array(0,128),128=>8364,130=>8218,131=>402,132=>8222,133=>8230,134=>array(8224,2),136=>710,137=>8240,138=>352,139=>8249,140=>338,142=>381,145=>array(8216,2),147=>array(8220,2),149=>8226,150=>array(8211,2),152=>732,153=>8482,154=>353,155=>8250,156=>339,158=>382,159=>376,160=>array(160,96));
10
  ?>
FPDF/font/courierb.php CHANGED
@@ -5,4 +5,6 @@ $up = -100;
5
  $ut = 50;
6
  for($i=0;$i<=255;$i++)
7
  $cw[chr($i)] = 600;
 
 
8
  ?>
5
  $ut = 50;
6
  for($i=0;$i<=255;$i++)
7
  $cw[chr($i)] = 600;
8
+ $enc = 'cp1252';
9
+ $uv = array(0=>array(0,128),128=>8364,130=>8218,131=>402,132=>8222,133=>8230,134=>array(8224,2),136=>710,137=>8240,138=>352,139=>8249,140=>338,142=>381,145=>array(8216,2),147=>array(8220,2),149=>8226,150=>array(8211,2),152=>732,153=>8482,154=>353,155=>8250,156=>339,158=>382,159=>376,160=>array(160,96));
10
  ?>
FPDF/font/courierbi.php CHANGED
@@ -5,4 +5,6 @@ $up = -100;
5
  $ut = 50;
6
  for($i=0;$i<=255;$i++)
7
  $cw[chr($i)] = 600;
 
 
8
  ?>
5
  $ut = 50;
6
  for($i=0;$i<=255;$i++)
7
  $cw[chr($i)] = 600;
8
+ $enc = 'cp1252';
9
+ $uv = array(0=>array(0,128),128=>8364,130=>8218,131=>402,132=>8222,133=>8230,134=>array(8224,2),136=>710,137=>8240,138=>352,139=>8249,140=>338,142=>381,145=>array(8216,2),147=>array(8220,2),149=>8226,150=>array(8211,2),152=>732,153=>8482,154=>353,155=>8250,156=>339,158=>382,159=>376,160=>array(160,96));
10
  ?>
FPDF/font/courieri.php CHANGED
@@ -5,4 +5,6 @@ $up = -100;
5
  $ut = 50;
6
  for($i=0;$i<=255;$i++)
7
  $cw[chr($i)] = 600;
 
 
8
  ?>
5
  $ut = 50;
6
  for($i=0;$i<=255;$i++)
7
  $cw[chr($i)] = 600;
8
+ $enc = 'cp1252';
9
+ $uv = array(0=>array(0,128),128=>8364,130=>8218,131=>402,132=>8222,133=>8230,134=>array(8224,2),136=>710,137=>8240,138=>352,139=>8249,140=>338,142=>381,145=>array(8216,2),147=>array(8220,2),149=>8226,150=>array(8211,2),152=>732,153=>8482,154=>353,155=>8250,156=>339,158=>382,159=>376,160=>array(160,96));
10
  ?>
FPDF/font/helvetica.php CHANGED
@@ -16,4 +16,6 @@ $cw = array(
16
  chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722,
17
  chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>500,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>556,chr(241)=>556,
18
  chr(242)=>556,chr(243)=>556,chr(244)=>556,chr(245)=>556,chr(246)=>556,chr(247)=>584,chr(248)=>611,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>500,chr(254)=>556,chr(255)=>500);
 
 
19
  ?>
16
  chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722,
17
  chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>500,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>556,chr(241)=>556,
18
  chr(242)=>556,chr(243)=>556,chr(244)=>556,chr(245)=>556,chr(246)=>556,chr(247)=>584,chr(248)=>611,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>500,chr(254)=>556,chr(255)=>500);
19
+ $enc = 'cp1252';
20
+ $uv = array(0=>array(0,128),128=>8364,130=>8218,131=>402,132=>8222,133=>8230,134=>array(8224,2),136=>710,137=>8240,138=>352,139=>8249,140=>338,142=>381,145=>array(8216,2),147=>array(8220,2),149=>8226,150=>array(8211,2),152=>732,153=>8482,154=>353,155=>8250,156=>339,158=>382,159=>376,160=>array(160,96));
21
  ?>
FPDF/font/helveticab.php CHANGED
@@ -16,4 +16,6 @@ $cw = array(
16
  chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722,
17
  chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>556,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>611,chr(241)=>611,
18
  chr(242)=>611,chr(243)=>611,chr(244)=>611,chr(245)=>611,chr(246)=>611,chr(247)=>584,chr(248)=>611,chr(249)=>611,chr(250)=>611,chr(251)=>611,chr(252)=>611,chr(253)=>556,chr(254)=>611,chr(255)=>556);
 
 
19
  ?>
16
  chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722,
17
  chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>556,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>611,chr(241)=>611,
18
  chr(242)=>611,chr(243)=>611,chr(244)=>611,chr(245)=>611,chr(246)=>611,chr(247)=>584,chr(248)=>611,chr(249)=>611,chr(250)=>611,chr(251)=>611,chr(252)=>611,chr(253)=>556,chr(254)=>611,chr(255)=>556);
19
+ $enc = 'cp1252';
20
+ $uv = array(0=>array(0,128),128=>8364,130=>8218,131=>402,132=>8222,133=>8230,134=>array(8224,2),136=>710,137=>8240,138=>352,139=>8249,140=>338,142=>381,145=>array(8216,2),147=>array(8220,2),149=>8226,150=>array(8211,2),152=>732,153=>8482,154=>353,155=>8250,156=>339,158=>382,159=>376,160=>array(160,96));
21
  ?>
FPDF/font/helveticabi.php CHANGED
@@ -16,4 +16,6 @@ $cw = array(
16
  chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722,
17
  chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>556,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>611,chr(241)=>611,
18
  chr(242)=>611,chr(243)=>611,chr(244)=>611,chr(245)=>611,chr(246)=>611,chr(247)=>584,chr(248)=>611,chr(249)=>611,chr(250)=>611,chr(251)=>611,chr(252)=>611,chr(253)=>556,chr(254)=>611,chr(255)=>556);
 
 
19
  ?>
16
  chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722,
17
  chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>556,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>611,chr(241)=>611,
18
  chr(242)=>611,chr(243)=>611,chr(244)=>611,chr(245)=>611,chr(246)=>611,chr(247)=>584,chr(248)=>611,chr(249)=>611,chr(250)=>611,chr(251)=>611,chr(252)=>611,chr(253)=>556,chr(254)=>611,chr(255)=>556);
19
+ $enc = 'cp1252';
20
+ $uv = array(0=>array(0,128),128=>8364,130=>8218,131=>402,132=>8222,133=>8230,134=>array(8224,2),136=>710,137=>8240,138=>352,139=>8249,140=>338,142=>381,145=>array(8216,2),147=>array(8220,2),149=>8226,150=>array(8211,2),152=>732,153=>8482,154=>353,155=>8250,156=>339,158=>382,159=>376,160=>array(160,96));
21
  ?>
FPDF/font/helveticai.php CHANGED
@@ -16,4 +16,6 @@ $cw = array(
16
  chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722,
17
  chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>500,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>556,chr(241)=>556,
18
  chr(242)=>556,chr(243)=>556,chr(244)=>556,chr(245)=>556,chr(246)=>556,chr(247)=>584,chr(248)=>611,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>500,chr(254)=>556,chr(255)=>500);
 
 
19
  ?>
16
  chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722,
17
  chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>500,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>556,chr(241)=>556,
18
  chr(242)=>556,chr(243)=>556,chr(244)=>556,chr(245)=>556,chr(246)=>556,chr(247)=>584,chr(248)=>611,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>500,chr(254)=>556,chr(255)=>500);
19
+ $enc = 'cp1252';
20
+ $uv = array(0=>array(0,128),128=>8364,130=>8218,131=>402,132=>8222,133=>8230,134=>array(8224,2),136=>710,137=>8240,138=>352,139=>8249,140=>338,142=>381,145=>array(8216,2),147=>array(8220,2),149=>8226,150=>array(8211,2),152=>732,153=>8482,154=>353,155=>8250,156=>339,158=>382,159=>376,160=>array(160,96));
21
  ?>
FPDF/font/symbol.php CHANGED
@@ -16,4 +16,5 @@ $cw = array(
16
  chr(198)=>823,chr(199)=>768,chr(200)=>768,chr(201)=>713,chr(202)=>713,chr(203)=>713,chr(204)=>713,chr(205)=>713,chr(206)=>713,chr(207)=>713,chr(208)=>768,chr(209)=>713,chr(210)=>790,chr(211)=>790,chr(212)=>890,chr(213)=>823,chr(214)=>549,chr(215)=>250,chr(216)=>713,chr(217)=>603,chr(218)=>603,chr(219)=>1042,
17
  chr(220)=>987,chr(221)=>603,chr(222)=>987,chr(223)=>603,chr(224)=>494,chr(225)=>329,chr(226)=>790,chr(227)=>790,chr(228)=>786,chr(229)=>713,chr(230)=>384,chr(231)=>384,chr(232)=>384,chr(233)=>384,chr(234)=>384,chr(235)=>384,chr(236)=>494,chr(237)=>494,chr(238)=>494,chr(239)=>494,chr(240)=>0,chr(241)=>329,
18
  chr(242)=>274,chr(243)=>686,chr(244)=>686,chr(245)=>686,chr(246)=>384,chr(247)=>384,chr(248)=>384,chr(249)=>384,chr(250)=>384,chr(251)=>384,chr(252)=>494,chr(253)=>494,chr(254)=>494,chr(255)=>0);
 
19
  ?>
16
  chr(198)=>823,chr(199)=>768,chr(200)=>768,chr(201)=>713,chr(202)=>713,chr(203)=>713,chr(204)=>713,chr(205)=>713,chr(206)=>713,chr(207)=>713,chr(208)=>768,chr(209)=>713,chr(210)=>790,chr(211)=>790,chr(212)=>890,chr(213)=>823,chr(214)=>549,chr(215)=>250,chr(216)=>713,chr(217)=>603,chr(218)=>603,chr(219)=>1042,
17
  chr(220)=>987,chr(221)=>603,chr(222)=>987,chr(223)=>603,chr(224)=>494,chr(225)=>329,chr(226)=>790,chr(227)=>790,chr(228)=>786,chr(229)=>713,chr(230)=>384,chr(231)=>384,chr(232)=>384,chr(233)=>384,chr(234)=>384,chr(235)=>384,chr(236)=>494,chr(237)=>494,chr(238)=>494,chr(239)=>494,chr(240)=>0,chr(241)=>329,
18
  chr(242)=>274,chr(243)=>686,chr(244)=>686,chr(245)=>686,chr(246)=>384,chr(247)=>384,chr(248)=>384,chr(249)=>384,chr(250)=>384,chr(251)=>384,chr(252)=>494,chr(253)=>494,chr(254)=>494,chr(255)=>0);
19
+ $uv = array(32=>160,33=>33,34=>8704,35=>35,36=>8707,37=>array(37,2),39=>8715,40=>array(40,2),42=>8727,43=>array(43,2),45=>8722,46=>array(46,18),64=>8773,65=>array(913,2),67=>935,68=>array(916,2),70=>934,71=>915,72=>919,73=>921,74=>977,75=>array(922,4),79=>array(927,2),81=>920,82=>929,83=>array(931,3),86=>962,87=>937,88=>926,89=>936,90=>918,91=>91,92=>8756,93=>93,94=>8869,95=>95,96=>63717,97=>array(945,2),99=>967,100=>array(948,2),102=>966,103=>947,104=>951,105=>953,106=>981,107=>array(954,4),111=>array(959,2),113=>952,114=>961,115=>array(963,3),118=>982,119=>969,120=>958,121=>968,122=>950,123=>array(123,3),126=>8764,160=>8364,161=>978,162=>8242,163=>8804,164=>8725,165=>8734,166=>402,167=>9827,168=>9830,169=>9829,170=>9824,171=>8596,172=>array(8592,4),176=>array(176,2),178=>8243,179=>8805,180=>215,181=>8733,182=>8706,183=>8226,184=>247,185=>array(8800,2),187=>8776,188=>8230,189=>array(63718,2),191=>8629,192=>8501,193=>8465,194=>8476,195=>8472,196=>8855,197=>8853,198=>8709,199=>array(8745,2),201=>8835,202=>8839,203=>8836,204=>8834,205=>8838,206=>array(8712,2),208=>8736,209=>8711,210=>63194,211=>63193,212=>63195,213=>8719,214=>8730,215=>8901,216=>172,217=>array(8743,2),219=>8660,220=>array(8656,4),224=>9674,225=>9001,226=>array(63720,3),229=>8721,230=>array(63723,10),241=>9002,242=>8747,243=>8992,244=>63733,245=>8993,246=>array(63734,9));
20
  ?>
FPDF/font/times.php CHANGED
@@ -16,4 +16,6 @@ $cw = array(
16
  chr(198)=>889,chr(199)=>667,chr(200)=>611,chr(201)=>611,chr(202)=>611,chr(203)=>611,chr(204)=>333,chr(205)=>333,chr(206)=>333,chr(207)=>333,chr(208)=>722,chr(209)=>722,chr(210)=>722,chr(211)=>722,chr(212)=>722,chr(213)=>722,chr(214)=>722,chr(215)=>564,chr(216)=>722,chr(217)=>722,chr(218)=>722,chr(219)=>722,
17
  chr(220)=>722,chr(221)=>722,chr(222)=>556,chr(223)=>500,chr(224)=>444,chr(225)=>444,chr(226)=>444,chr(227)=>444,chr(228)=>444,chr(229)=>444,chr(230)=>667,chr(231)=>444,chr(232)=>444,chr(233)=>444,chr(234)=>444,chr(235)=>444,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>500,chr(241)=>500,
18
  chr(242)=>500,chr(243)=>500,chr(244)=>500,chr(245)=>500,chr(246)=>500,chr(247)=>564,chr(248)=>500,chr(249)=>500,chr(250)=>500,chr(251)=>500,chr(252)=>500,chr(253)=>500,chr(254)=>500,chr(255)=>500);
 
 
19
  ?>
16
  chr(198)=>889,chr(199)=>667,chr(200)=>611,chr(201)=>611,chr(202)=>611,chr(203)=>611,chr(204)=>333,chr(205)=>333,chr(206)=>333,chr(207)=>333,chr(208)=>722,chr(209)=>722,chr(210)=>722,chr(211)=>722,chr(212)=>722,chr(213)=>722,chr(214)=>722,chr(215)=>564,chr(216)=>722,chr(217)=>722,chr(218)=>722,chr(219)=>722,
17
  chr(220)=>722,chr(221)=>722,chr(222)=>556,chr(223)=>500,chr(224)=>444,chr(225)=>444,chr(226)=>444,chr(227)=>444,chr(228)=>444,chr(229)=>444,chr(230)=>667,chr(231)=>444,chr(232)=>444,chr(233)=>444,chr(234)=>444,chr(235)=>444,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>500,chr(241)=>500,
18
  chr(242)=>500,chr(243)=>500,chr(244)=>500,chr(245)=>500,chr(246)=>500,chr(247)=>564,chr(248)=>500,chr(249)=>500,chr(250)=>500,chr(251)=>500,chr(252)=>500,chr(253)=>500,chr(254)=>500,chr(255)=>500);
19
+ $enc = 'cp1252';
20
+ $uv = array(0=>array(0,128),128=>8364,130=>8218,131=>402,132=>8222,133=>8230,134=>array(8224,2),136=>710,137=>8240,138=>352,139=>8249,140=>338,142=>381,145=>array(8216,2),147=>array(8220,2),149=>8226,150=>array(8211,2),152=>732,153=>8482,154=>353,155=>8250,156=>339,158=>382,159=>376,160=>array(160,96));
21
  ?>
FPDF/font/timesb.php CHANGED
@@ -16,4 +16,6 @@ $cw = array(
16
  chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>389,chr(205)=>389,chr(206)=>389,chr(207)=>389,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>570,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722,
17
  chr(220)=>722,chr(221)=>722,chr(222)=>611,chr(223)=>556,chr(224)=>500,chr(225)=>500,chr(226)=>500,chr(227)=>500,chr(228)=>500,chr(229)=>500,chr(230)=>722,chr(231)=>444,chr(232)=>444,chr(233)=>444,chr(234)=>444,chr(235)=>444,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>500,chr(241)=>556,
18
  chr(242)=>500,chr(243)=>500,chr(244)=>500,chr(245)=>500,chr(246)=>500,chr(247)=>570,chr(248)=>500,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>500,chr(254)=>556,chr(255)=>500);
 
 
19
  ?>
16
  chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>389,chr(205)=>389,chr(206)=>389,chr(207)=>389,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>570,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722,
17
  chr(220)=>722,chr(221)=>722,chr(222)=>611,chr(223)=>556,chr(224)=>500,chr(225)=>500,chr(226)=>500,chr(227)=>500,chr(228)=>500,chr(229)=>500,chr(230)=>722,chr(231)=>444,chr(232)=>444,chr(233)=>444,chr(234)=>444,chr(235)=>444,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>500,chr(241)=>556,
18
  chr(242)=>500,chr(243)=>500,chr(244)=>500,chr(245)=>500,chr(246)=>500,chr(247)=>570,chr(248)=>500,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>500,chr(254)=>556,chr(255)=>500);
19
+ $enc = 'cp1252';
20
+ $uv = array(0=>array(0,128),128=>8364,130=>8218,131=>402,132=>8222,133=>8230,134=>array(8224,2),136=>710,137=>8240,138=>352,139=>8249,140=>338,142=>381,145=>array(8216,2),147=>array(8220,2),149=>8226,150=>array(8211,2),152=>732,153=>8482,154=>353,155=>8250,156=>339,158=>382,159=>376,160=>array(160,96));
21
  ?>
FPDF/font/timesbi.php CHANGED
@@ -16,4 +16,6 @@ $cw = array(
16
  chr(198)=>944,chr(199)=>667,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>389,chr(205)=>389,chr(206)=>389,chr(207)=>389,chr(208)=>722,chr(209)=>722,chr(210)=>722,chr(211)=>722,chr(212)=>722,chr(213)=>722,chr(214)=>722,chr(215)=>570,chr(216)=>722,chr(217)=>722,chr(218)=>722,chr(219)=>722,
17
  chr(220)=>722,chr(221)=>611,chr(222)=>611,chr(223)=>500,chr(224)=>500,chr(225)=>500,chr(226)=>500,chr(227)=>500,chr(228)=>500,chr(229)=>500,chr(230)=>722,chr(231)=>444,chr(232)=>444,chr(233)=>444,chr(234)=>444,chr(235)=>444,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>500,chr(241)=>556,
18
  chr(242)=>500,chr(243)=>500,chr(244)=>500,chr(245)=>500,chr(246)=>500,chr(247)=>570,chr(248)=>500,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>444,chr(254)=>500,chr(255)=>444);
 
 
19
  ?>
16
  chr(198)=>944,chr(199)=>667,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>389,chr(205)=>389,chr(206)=>389,chr(207)=>389,chr(208)=>722,chr(209)=>722,chr(210)=>722,chr(211)=>722,chr(212)=>722,chr(213)=>722,chr(214)=>722,chr(215)=>570,chr(216)=>722,chr(217)=>722,chr(218)=>722,chr(219)=>722,
17
  chr(220)=>722,chr(221)=>611,chr(222)=>611,chr(223)=>500,chr(224)=>500,chr(225)=>500,chr(226)=>500,chr(227)=>500,chr(228)=>500,chr(229)=>500,chr(230)=>722,chr(231)=>444,chr(232)=>444,chr(233)=>444,chr(234)=>444,chr(235)=>444,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>500,chr(241)=>556,
18
  chr(242)=>500,chr(243)=>500,chr(244)=>500,chr(245)=>500,chr(246)=>500,chr(247)=>570,chr(248)=>500,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>444,chr(254)=>500,chr(255)=>444);
19
+ $enc = 'cp1252';
20
+ $uv = array(0=>array(0,128),128=>8364,130=>8218,131=>402,132=>8222,133=>8230,134=>array(8224,2),136=>710,137=>8240,138=>352,139=>8249,140=>338,142=>381,145=>array(8216,2),147=>array(8220,2),149=>8226,150=>array(8211,2),152=>732,153=>8482,154=>353,155=>8250,156=>339,158=>382,159=>376,160=>array(160,96));
21
  ?>
FPDF/font/timesi.php CHANGED
@@ -16,4 +16,6 @@ $cw = array(
16
  chr(198)=>889,chr(199)=>667,chr(200)=>611,chr(201)=>611,chr(202)=>611,chr(203)=>611,chr(204)=>333,chr(205)=>333,chr(206)=>333,chr(207)=>333,chr(208)=>722,chr(209)=>667,chr(210)=>722,chr(211)=>722,chr(212)=>722,chr(213)=>722,chr(214)=>722,chr(215)=>675,chr(216)=>722,chr(217)=>722,chr(218)=>722,chr(219)=>722,
17
  chr(220)=>722,chr(221)=>556,chr(222)=>611,chr(223)=>500,chr(224)=>500,chr(225)=>500,chr(226)=>500,chr(227)=>500,chr(228)=>500,chr(229)=>500,chr(230)=>667,chr(231)=>444,chr(232)=>444,chr(233)=>444,chr(234)=>444,chr(235)=>444,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>500,chr(241)=>500,
18
  chr(242)=>500,chr(243)=>500,chr(244)=>500,chr(245)=>500,chr(246)=>500,chr(247)=>675,chr(248)=>500,chr(249)=>500,chr(250)=>500,chr(251)=>500,chr(252)=>500,chr(253)=>444,chr(254)=>500,chr(255)=>444);
 
 
19
  ?>
16
  chr(198)=>889,chr(199)=>667,chr(200)=>611,chr(201)=>611,chr(202)=>611,chr(203)=>611,chr(204)=>333,chr(205)=>333,chr(206)=>333,chr(207)=>333,chr(208)=>722,chr(209)=>667,chr(210)=>722,chr(211)=>722,chr(212)=>722,chr(213)=>722,chr(214)=>722,chr(215)=>675,chr(216)=>722,chr(217)=>722,chr(218)=>722,chr(219)=>722,
17
  chr(220)=>722,chr(221)=>556,chr(222)=>611,chr(223)=>500,chr(224)=>500,chr(225)=>500,chr(226)=>500,chr(227)=>500,chr(228)=>500,chr(229)=>500,chr(230)=>667,chr(231)=>444,chr(232)=>444,chr(233)=>444,chr(234)=>444,chr(235)=>444,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>500,chr(241)=>500,
18
  chr(242)=>500,chr(243)=>500,chr(244)=>500,chr(245)=>500,chr(246)=>500,chr(247)=>675,chr(248)=>500,chr(249)=>500,chr(250)=>500,chr(251)=>500,chr(252)=>500,chr(253)=>444,chr(254)=>500,chr(255)=>444);
19
+ $enc = 'cp1252';
20
+ $uv = array(0=>array(0,128),128=>8364,130=>8218,131=>402,132=>8222,133=>8230,134=>array(8224,2),136=>710,137=>8240,138=>352,139=>8249,140=>338,142=>381,145=>array(8216,2),147=>array(8220,2),149=>8226,150=>array(8211,2),152=>732,153=>8482,154=>353,155=>8250,156=>339,158=>382,159=>376,160=>array(160,96));
21
  ?>
FPDF/font/zapfdingbats.php CHANGED
@@ -16,4 +16,5 @@ $cw = array(
16
  chr(198)=>788,chr(199)=>788,chr(200)=>788,chr(201)=>788,chr(202)=>788,chr(203)=>788,chr(204)=>788,chr(205)=>788,chr(206)=>788,chr(207)=>788,chr(208)=>788,chr(209)=>788,chr(210)=>788,chr(211)=>788,chr(212)=>894,chr(213)=>838,chr(214)=>1016,chr(215)=>458,chr(216)=>748,chr(217)=>924,chr(218)=>748,chr(219)=>918,
17
  chr(220)=>927,chr(221)=>928,chr(222)=>928,chr(223)=>834,chr(224)=>873,chr(225)=>828,chr(226)=>924,chr(227)=>924,chr(228)=>917,chr(229)=>930,chr(230)=>931,chr(231)=>463,chr(232)=>883,chr(233)=>836,chr(234)=>836,chr(235)=>867,chr(236)=>867,chr(237)=>696,chr(238)=>696,chr(239)=>874,chr(240)=>0,chr(241)=>874,
18
  chr(242)=>760,chr(243)=>946,chr(244)=>771,chr(245)=>865,chr(246)=>771,chr(247)=>888,chr(248)=>967,chr(249)=>888,chr(250)=>831,chr(251)=>873,chr(252)=>927,chr(253)=>970,chr(254)=>918,chr(255)=>0);
 
19
  ?>
16
  chr(198)=>788,chr(199)=>788,chr(200)=>788,chr(201)=>788,chr(202)=>788,chr(203)=>788,chr(204)=>788,chr(205)=>788,chr(206)=>788,chr(207)=>788,chr(208)=>788,chr(209)=>788,chr(210)=>788,chr(211)=>788,chr(212)=>894,chr(213)=>838,chr(214)=>1016,chr(215)=>458,chr(216)=>748,chr(217)=>924,chr(218)=>748,chr(219)=>918,
17
  chr(220)=>927,chr(221)=>928,chr(222)=>928,chr(223)=>834,chr(224)=>873,chr(225)=>828,chr(226)=>924,chr(227)=>924,chr(228)=>917,chr(229)=>930,chr(230)=>931,chr(231)=>463,chr(232)=>883,chr(233)=>836,chr(234)=>836,chr(235)=>867,chr(236)=>867,chr(237)=>696,chr(238)=>696,chr(239)=>874,chr(240)=>0,chr(241)=>874,
18
  chr(242)=>760,chr(243)=>946,chr(244)=>771,chr(245)=>865,chr(246)=>771,chr(247)=>888,chr(248)=>967,chr(249)=>888,chr(250)=>831,chr(251)=>873,chr(252)=>927,chr(253)=>970,chr(254)=>918,chr(255)=>0);
19
+ $uv = array(32=>32,33=>array(9985,4),37=>9742,38=>array(9990,4),42=>9755,43=>9758,44=>array(9996,28),72=>9733,73=>array(10025,35),108=>9679,109=>10061,110=>9632,111=>array(10063,4),115=>9650,116=>9660,117=>9670,118=>10070,119=>9687,120=>array(10072,7),128=>array(10088,14),161=>array(10081,7),168=>9827,169=>9830,170=>9829,171=>9824,172=>array(9312,10),182=>array(10102,31),213=>8594,214=>array(8596,2),216=>array(10136,24),241=>array(10161,14));
20
  ?>
FPDF/fpdf.php CHANGED
@@ -2,91 +2,90 @@
2
  /*******************************************************************************
3
  * FPDF *
4
  * *
5
- * Version: 1.7 *
6
- * Date: 2011-06-18 *
7
  * Author: Olivier PLATHEY *
8
  *******************************************************************************/
9
 
10
- define('FPDF_VERSION','1.7');
11
 
12
  class FPDF
13
  {
14
- var $page; // current page number
15
- var $n; // current object number
16
- var $offsets; // array of object offsets
17
- var $buffer; // buffer holding in-memory PDF
18
- var $pages; // array containing pages
19
- var $state; // current document state
20
- var $compress; // compression flag
21
- var $k; // scale factor (number of points in user unit)
22
- var $DefOrientation; // default orientation
23
- var $CurOrientation; // current orientation
24
- var $StdPageSizes; // standard page sizes
25
- var $DefPageSize; // default page size
26
- var $CurPageSize; // current page size
27
- var $PageSizes; // used for pages with non default sizes or orientations
28
- var $wPt, $hPt; // dimensions of current page in points
29
- var $w, $h; // dimensions of current page in user unit
30
- var $lMargin; // left margin
31
- var $tMargin; // top margin
32
- var $rMargin; // right margin
33
- var $bMargin; // page break margin
34
- var $cMargin; // cell margin
35
- var $x, $y; // current position in user unit
36
- var $lasth; // height of last printed cell
37
- var $LineWidth; // line width in user unit
38
- var $fontpath; // path containing fonts
39
- var $CoreFonts; // array of core font names
40
- var $fonts; // array of used fonts
41
- var $FontFiles; // array of font files
42
- var $diffs; // array of encoding differences
43
- var $FontFamily; // current font family
44
- var $FontStyle; // current font style
45
- var $underline; // underlining flag
46
- var $CurrentFont; // current font info
47
- var $FontSizePt; // current font size in points
48
- var $FontSize; // current font size in user unit
49
- var $DrawColor; // commands for drawing color
50
- var $FillColor; // commands for filling color
51
- var $TextColor; // commands for text color
52
- var $ColorFlag; // indicates whether fill and text colors are different
53
- var $ws; // word spacing
54
- var $images; // array of used images
55
- var $PageLinks; // array of links in pages
56
- var $links; // array of internal links
57
- var $AutoPageBreak; // automatic page breaking
58
- var $PageBreakTrigger; // threshold used to trigger page breaks
59
- var $InHeader; // flag set when processing header
60
- var $InFooter; // flag set when processing footer
61
- var $ZoomMode; // zoom display mode
62
- var $LayoutMode; // layout display mode
63
- var $title; // title
64
- var $subject; // subject
65
- var $author; // author
66
- var $keywords; // keywords
67
- var $creator; // creator
68
- var $AliasNbPages; // alias for total number of pages
69
- var $PDFVersion; // PDF version number
70
 
71
  /*******************************************************************************
72
- * *
73
  * Public methods *
74
- * *
75
  *******************************************************************************/
76
- function FPDF($orientation='P', $unit='mm', $size='A4')
 
77
  {
78
  // Some checks
79
  $this->_dochecks();
80
  // Initialization of properties
 
81
  $this->page = 0;
82
  $this->n = 2;
83
  $this->buffer = '';
84
  $this->pages = array();
85
- $this->PageSizes = array();
86
- $this->state = 0;
87
  $this->fonts = array();
88
  $this->FontFiles = array();
89
- $this->diffs = array();
 
90
  $this->images = array();
91
  $this->links = array();
92
  $this->InHeader = false;
@@ -100,6 +99,7 @@ function FPDF($orientation='P', $unit='mm', $size='A4')
100
  $this->FillColor = '0 g';
101
  $this->TextColor = '0 g';
102
  $this->ColorFlag = false;
 
103
  $this->ws = 0;
104
  // Font path
105
  if(defined('FPDF_FONTPATH'))
@@ -150,6 +150,8 @@ function FPDF($orientation='P', $unit='mm', $size='A4')
150
  $this->CurOrientation = $this->DefOrientation;
151
  $this->wPt = $this->w*$this->k;
152
  $this->hPt = $this->h*$this->k;
 
 
153
  // Page margins (1 cm)
154
  $margin = 28.35/$this->k;
155
  $this->SetMargins($margin,$margin);
@@ -230,41 +232,31 @@ function SetCompression($compress)
230
  function SetTitle($title, $isUTF8=false)
231
  {
232
  // Title of document
233
- if($isUTF8)
234
- $title = $this->_UTF8toUTF16($title);
235
- $this->title = $title;
236
  }
237
 
238
- function SetSubject($subject, $isUTF8=false)
239
  {
240
- // Subject of document
241
- if($isUTF8)
242
- $subject = $this->_UTF8toUTF16($subject);
243
- $this->subject = $subject;
244
  }
245
 
246
- function SetAuthor($author, $isUTF8=false)
247
  {
248
- // Author of document
249
- if($isUTF8)
250
- $author = $this->_UTF8toUTF16($author);
251
- $this->author = $author;
252
  }
253
 
254
  function SetKeywords($keywords, $isUTF8=false)
255
  {
256
  // Keywords of document
257
- if($isUTF8)
258
- $keywords = $this->_UTF8toUTF16($keywords);
259
- $this->keywords = $keywords;
260
  }
261
 
262
  function SetCreator($creator, $isUTF8=false)
263
  {
264
  // Creator of document
265
- if($isUTF8)
266
- $creator = $this->_UTF8toUTF16($creator);
267
- $this->creator = $creator;
268
  }
269
 
270
  function AliasNbPages($alias='{nb}')
@@ -276,13 +268,7 @@ function AliasNbPages($alias='{nb}')
276
  function Error($msg)
277
  {
278
  // Fatal error
279
- die('<b>FPDF error:</b> '.$msg);
280
- }
281
-
282
- function Open()
283
- {
284
- // Begin document
285
- $this->state = 1;
286
  }
287
 
288
  function Close()
@@ -302,11 +288,11 @@ function Close()
302
  $this->_enddoc();
303
  }
304
 
305
- function AddPage($orientation='', $size='')
306
  {
307
  // Start a new page
308
- if($this->state==0)
309
- $this->Open();
310
  $family = $this->FontFamily;
311
  $style = $this->FontStyle.($this->underline ? 'U' : '');
312
  $fontsize = $this->FontSizePt;
@@ -325,7 +311,7 @@ function AddPage($orientation='', $size='')
325
  $this->_endpage();
326
  }
327
  // Start new page
328
- $this->_beginpage($orientation,$size);
329
  // Set line cap style to square
330
  $this->_out('2 J');
331
  // Set line width
@@ -472,17 +458,6 @@ function AddFont($family, $style='', $file='')
472
  return;
473
  $info = $this->_loadfont($file);
474
  $info['i'] = count($this->fonts)+1;
475
- if(!empty($info['diff']))
476
- {
477
- // Search existing encodings
478
- $n = array_search($info['diff'],$this->diffs);
479
- if(!$n)
480
- {
481
- $n = count($this->diffs)+1;
482
- $this->diffs[$n] = $info['diff'];
483
- }
484
- $info['diffn'] = $n;
485
- }
486
  if(!empty($info['file']))
487
  {
488
  // Embedded font
@@ -582,6 +557,8 @@ function Link($x, $y, $w, $h, $link)
582
  function Text($x, $y, $txt)
583
  {
584
  // Output a string
 
 
585
  $s = sprintf('BT %.2F %.2F Td (%s) Tj ET',$x*$this->k,($this->h-$y)*$this->k,$this->_escape($txt));
586
  if($this->underline && $txt!='')
587
  $s .= ' '.$this->_dounderline($x,$y,$txt);
@@ -610,7 +587,7 @@ function Cell($w, $h=0, $txt='', $border=0, $ln=0, $align='', $fill=false, $link
610
  $this->ws = 0;
611
  $this->_out('0 Tw');
612
  }
613
- $this->AddPage($this->CurOrientation,$this->CurPageSize);
614
  $this->x = $x;
615
  if($ws>0)
616
  {
@@ -644,6 +621,8 @@ function Cell($w, $h=0, $txt='', $border=0, $ln=0, $align='', $fill=false, $link
644
  }
645
  if($txt!=='')
646
  {
 
 
647
  if($align=='R')
648
  $dx = $w-$this->cMargin-$this->GetStringWidth($txt);
649
  elseif($align=='C')
@@ -652,8 +631,7 @@ function Cell($w, $h=0, $txt='', $border=0, $ln=0, $align='', $fill=false, $link
652
  $dx = $this->cMargin;
653
  if($this->ColorFlag)
654
  $s .= 'q '.$this->TextColor.' ';
655
- $txt2 = str_replace(')','\\)',str_replace('(','\\(',str_replace('\\','\\\\',$txt)));
656
- $s .= sprintf('BT %.2F %.2F Td (%s) Tj ET',($this->x+$dx)*$k,($this->h-($this->y+.5*$h+.3*$this->FontSize))*$k,$txt2);
657
  if($this->underline)
658
  $s .= ' '.$this->_dounderline($this->x+$dx,$this->y+.5*$h+.3*$this->FontSize,$txt);
659
  if($this->ColorFlag)
@@ -678,6 +656,8 @@ function Cell($w, $h=0, $txt='', $border=0, $ln=0, $align='', $fill=false, $link
678
  function MultiCell($w, $h, $txt, $border=0, $align='J', $fill=false)
679
  {
680
  // Output text with automatic or explicit line breaks
 
 
681
  $cw = &$this->CurrentFont['cw'];
682
  if($w==0)
683
  $w = $this->w-$this->rMargin-$this->x;
@@ -791,6 +771,8 @@ function MultiCell($w, $h, $txt, $border=0, $align='J', $fill=false)
791
  function Write($h, $txt, $link='')
792
  {
793
  // Output text in flowing mode
 
 
794
  $cw = &$this->CurrentFont['cw'];
795
  $w = $this->w-$this->rMargin-$this->x;
796
  $wmax = ($w-2*$this->cMargin)*1000/$this->FontSize;
@@ -808,7 +790,7 @@ function Write($h, $txt, $link='')
808
  if($c=="\n")
809
  {
810
  // Explicit line break
811
- $this->Cell($w,$h,substr($s,$j,$i-$j),0,2,'',0,$link);
812
  $i++;
813
  $sep = -1;
814
  $j = $i;
@@ -843,11 +825,11 @@ function Write($h, $txt, $link='')
843
  }
844
  if($i==$j)
845
  $i++;
846
- $this->Cell($w,$h,substr($s,$j,$i-$j),0,2,'',0,$link);
847
  }
848
  else
849
  {
850
- $this->Cell($w,$h,substr($s,$j,$sep-$j),0,2,'',0,$link);
851
  $i = $sep+1;
852
  }
853
  $sep = -1;
@@ -866,12 +848,12 @@ function Write($h, $txt, $link='')
866
  }
867
  // Last chunk
868
  if($i!=$j)
869
- $this->Cell($l/1000*$this->FontSize,$h,substr($s,$j),0,0,'',0,$link);
870
  }
871
 
872
  function Ln($h=null)
873
  {
874
- // Line feed; default value is last cell height
875
  $this->x = $this->lMargin;
876
  if($h===null)
877
  $this->y += $this->lasth;
@@ -882,6 +864,8 @@ function Ln($h=null)
882
  function Image($file, $x=null, $y=null, $w=0, $h=0, $type='', $link='')
883
  {
884
  // Put an image on the page
 
 
885
  if(!isset($this->images[$file]))
886
  {
887
  // First use of this image, get info
@@ -928,7 +912,7 @@ function Image($file, $x=null, $y=null, $w=0, $h=0, $type='', $link='')
928
  {
929
  // Automatic page break
930
  $x2 = $this->x;
931
- $this->AddPage($this->CurOrientation,$this->CurPageSize);
932
  $this->x = $x2;
933
  }
934
  $y = $this->y;
@@ -942,6 +926,24 @@ function Image($file, $x=null, $y=null, $w=0, $h=0, $type='', $link='')
942
  $this->Link($x,$y,$w,$h,$link);
943
  }
944
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
945
  function GetX()
946
  {
947
  // Get x position
@@ -963,40 +965,40 @@ function GetY()
963
  return $this->y;
964
  }
965
 
966
- function SetY($y)
967
  {
968
- // Set y position and reset x
969
- $this->x = $this->lMargin;
970
  if($y>=0)
971
  $this->y = $y;
972
  else
973
  $this->y = $this->h+$y;
 
 
974
  }
975
 
976
  function SetXY($x, $y)
977
  {
978
  // Set x and y positions
979
- $this->SetY($y);
980
  $this->SetX($x);
 
981
  }
982
 
983
- function Output($name='', $dest='')
984
  {
985
  // Output PDF to some destination
986
- if($this->state<3)
987
- $this->Close();
988
- $dest = strtoupper($dest);
989
- if($dest=='')
990
  {
991
- if($name=='')
992
- {
993
- $name = 'doc.pdf';
994
- $dest = 'I';
995
- }
996
- else
997
- $dest = 'F';
998
  }
999
- switch($dest)
 
 
 
 
1000
  {
1001
  case 'I':
1002
  // Send to standard output
@@ -1005,7 +1007,7 @@ function Output($name='', $dest='')
1005
  {
1006
  // We send to a browser
1007
  header('Content-Type: application/pdf');
1008
- header('Content-Disposition: inline; filename="'.$name.'"');
1009
  header('Cache-Control: private, max-age=0, must-revalidate');
1010
  header('Pragma: public');
1011
  }
@@ -1015,18 +1017,15 @@ function Output($name='', $dest='')
1015
  // Download file
1016
  $this->_checkoutput();
1017
  header('Content-Type: application/x-download');
1018
- header('Content-Disposition: attachment; filename="'.$name.'"');
1019
  header('Cache-Control: private, max-age=0, must-revalidate');
1020
  header('Pragma: public');
1021
  echo $this->buffer;
1022
  break;
1023
  case 'F':
1024
  // Save to local file
1025
- $f = fopen($name,'wb');
1026
- if(!$f)
1027
  $this->Error('Unable to create output file: '.$name);
1028
- fwrite($f,$this->buffer,strlen($this->buffer));
1029
- fclose($f);
1030
  break;
1031
  case 'S':
1032
  // Return as a string
@@ -1038,24 +1037,17 @@ function Output($name='', $dest='')
1038
  }
1039
 
1040
  /*******************************************************************************
1041
- * *
1042
  * Protected methods *
1043
- * *
1044
  *******************************************************************************/
1045
- function _dochecks()
 
1046
  {
1047
- // Check availability of %F
1048
- if(sprintf('%.1F',1.0)!='1.0')
1049
- $this->Error('This version of PHP is not supported');
1050
  // Check mbstring overloading
1051
  if(ini_get('mbstring.func_overload') & 2)
1052
  $this->Error('mbstring overloading must be disabled');
1053
- // Ensure runtime magic quotes are disabled
1054
- if(get_magic_quotes_runtime())
1055
- @set_magic_quotes_runtime(0);
1056
  }
1057
 
1058
- function _checkoutput()
1059
  {
1060
  if(PHP_SAPI!='cli')
1061
  {
@@ -1075,7 +1067,7 @@ function _checkoutput()
1075
  }
1076
  }
1077
 
1078
- function _getpagesize($size)
1079
  {
1080
  if(is_string($size))
1081
  {
@@ -1094,7 +1086,7 @@ function _getpagesize($size)
1094
  }
1095
  }
1096
 
1097
- function _beginpage($orientation, $size)
1098
  {
1099
  $this->page++;
1100
  $this->pages[$this->page] = '';
@@ -1131,41 +1123,62 @@ function _beginpage($orientation, $size)
1131
  $this->CurPageSize = $size;
1132
  }
1133
  if($orientation!=$this->DefOrientation || $size[0]!=$this->DefPageSize[0] || $size[1]!=$this->DefPageSize[1])
1134
- $this->PageSizes[$this->page] = array($this->wPt, $this->hPt);
 
 
 
 
 
 
 
1135
  }
1136
 
1137
- function _endpage()
1138
  {
1139
  $this->state = 1;
1140
  }
1141
 
1142
- function _loadfont($font)
1143
  {
1144
  // Load a font definition file from the font directory
 
 
1145
  include($this->fontpath.$font);
1146
- $a = get_defined_vars();
1147
- if(!isset($a['name']))
1148
  $this->Error('Could not include font definition file');
1149
- return $a;
 
 
 
 
1150
  }
1151
 
1152
- function _escape($s)
1153
  {
1154
- // Escape special characters in strings
1155
- $s = str_replace('\\','\\\\',$s);
1156
- $s = str_replace('(','\\(',$s);
1157
- $s = str_replace(')','\\)',$s);
1158
- $s = str_replace("\r",'\\r',$s);
1159
- return $s;
 
 
1160
  }
1161
 
1162
- function _textstring($s)
1163
  {
1164
- // Format a text string
1165
- return '('.$this->_escape($s).')';
 
 
 
 
 
 
 
1166
  }
1167
 
1168
- function _UTF8toUTF16($s)
1169
  {
1170
  // Convert UTF-8 to UTF-16BE with BOM
1171
  $res = "\xFE\xFF";
@@ -1198,7 +1211,24 @@ function _UTF8toUTF16($s)
1198
  return $res;
1199
  }
1200
 
1201
- function _dounderline($x, $y, $txt)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1202
  {
1203
  // Underline text
1204
  $up = $this->CurrentFont['up'];
@@ -1207,7 +1237,7 @@ function _dounderline($x, $y, $txt)
1207
  return sprintf('%.2F %.2F %.2F %.2F re f',$x*$this->k,($this->h-($y-$up/1000*$this->FontSize))*$this->k,$w*$this->k,-$ut/1000*$this->FontSizePt);
1208
  }
1209
 
1210
- function _parsejpg($file)
1211
  {
1212
  // Extract info from a JPEG file
1213
  $a = getimagesize($file);
@@ -1226,7 +1256,7 @@ function _parsejpg($file)
1226
  return array('w'=>$a[0], 'h'=>$a[1], 'cs'=>$colspace, 'bpc'=>$bpc, 'f'=>'DCTDecode', 'data'=>$data);
1227
  }
1228
 
1229
- function _parsepng($file)
1230
  {
1231
  // Extract info from a PNG file
1232
  $f = fopen($file,'rb');
@@ -1237,7 +1267,7 @@ function _parsepng($file)
1237
  return $info;
1238
  }
1239
 
1240
- function _parsepngstream($f, $file)
1241
  {
1242
  // Check signature
1243
  if($this->_readstream($f,8)!=chr(137).'PNG'.chr(13).chr(10).chr(26).chr(10))
@@ -1355,6 +1385,7 @@ function _parsepngstream($f, $file)
1355
  unset($data);
1356
  $data = gzcompress($color);
1357
  $info['smask'] = gzcompress($alpha);
 
1358
  if($this->PDFVersion<'1.4')
1359
  $this->PDFVersion = '1.4';
1360
  }
@@ -1362,7 +1393,7 @@ function _parsepngstream($f, $file)
1362
  return $info;
1363
  }
1364
 
1365
- function _readstream($f, $n)
1366
  {
1367
  // Read n bytes from stream
1368
  $res = '';
@@ -1379,14 +1410,14 @@ function _readstream($f, $n)
1379
  return $res;
1380
  }
1381
 
1382
- function _readint($f)
1383
  {
1384
  // Read a 4-byte integer from stream
1385
  $a = unpack('Ni',$this->_readstream($f,4));
1386
  return $a['i'];
1387
  }
1388
 
1389
- function _parsegif($file)
1390
  {
1391
  // Extract info from a GIF file (via PNG conversion)
1392
  if(!function_exists('imagepng'))
@@ -1397,141 +1428,149 @@ function _parsegif($file)
1397
  if(!$im)
1398
  $this->Error('Missing or incorrect image file: '.$file);
1399
  imageinterlace($im,0);
1400
- $f = @fopen('php://temp','rb+');
1401
- if($f)
1402
- {
1403
- // Perform conversion in memory
1404
- ob_start();
1405
- imagepng($im);
1406
- $data = ob_get_clean();
1407
- imagedestroy($im);
1408
- fwrite($f,$data);
1409
- rewind($f);
1410
- $info = $this->_parsepngstream($f,$file);
1411
- fclose($f);
1412
- }
1413
- else
1414
- {
1415
- // Use temporary file
1416
- $tmp = tempnam('.','gif');
1417
- if(!$tmp)
1418
- $this->Error('Unable to create a temporary file');
1419
- if(!imagepng($im,$tmp))
1420
- $this->Error('Error while saving to temporary file');
1421
- imagedestroy($im);
1422
- $info = $this->_parsepng($tmp);
1423
- unlink($tmp);
1424
- }
1425
  return $info;
1426
  }
1427
 
1428
- function _newobj()
1429
  {
1430
- // Begin a new object
1431
- $this->n++;
1432
- $this->offsets[$this->n] = strlen($this->buffer);
1433
- $this->_out($this->n.' 0 obj');
 
 
 
 
 
1434
  }
1435
 
1436
- function _putstream($s)
1437
  {
1438
- $this->_out('stream');
1439
- $this->_out($s);
1440
- $this->_out('endstream');
1441
  }
1442
 
1443
- function _out($s)
1444
  {
1445
- // Add a line to the document
1446
- if($this->state==2)
1447
- $this->pages[$this->page] .= $s."\n";
1448
- else
1449
- $this->buffer .= $s."\n";
1450
  }
1451
 
1452
- function _putpages()
1453
  {
1454
- $nb = $this->page;
1455
- if(!empty($this->AliasNbPages))
1456
- {
1457
- // Replace number of pages
1458
- for($n=1;$n<=$nb;$n++)
1459
- $this->pages[$n] = str_replace($this->AliasNbPages,$nb,$this->pages[$n]);
1460
- }
1461
- if($this->DefOrientation=='P')
 
 
 
 
 
 
 
 
 
1462
  {
1463
- $wPt = $this->DefPageSize[0]*$this->k;
1464
- $hPt = $this->DefPageSize[1]*$this->k;
1465
  }
1466
  else
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1467
  {
1468
- $wPt = $this->DefPageSize[1]*$this->k;
1469
- $hPt = $this->DefPageSize[0]*$this->k;
1470
- }
1471
- $filter = ($this->compress) ? '/Filter /FlateDecode ' : '';
1472
- for($n=1;$n<=$nb;$n++)
1473
- {
1474
- // Page
1475
- $this->_newobj();
1476
- $this->_out('<</Type /Page');
1477
- $this->_out('/Parent 1 0 R');
1478
- if(isset($this->PageSizes[$n]))
1479
- $this->_out(sprintf('/MediaBox [0 0 %.2F %.2F]',$this->PageSizes[$n][0],$this->PageSizes[$n][1]));
1480
- $this->_out('/Resources 2 0 R');
1481
- if(isset($this->PageLinks[$n]))
1482
  {
1483
- // Links
1484
- $annots = '/Annots [';
1485
- foreach($this->PageLinks[$n] as $pl)
 
 
1486
  {
1487
- $rect = sprintf('%.2F %.2F %.2F %.2F',$pl[0],$pl[1],$pl[0]+$pl[2],$pl[1]-$pl[3]);
1488
- $annots .= '<</Type /Annot /Subtype /Link /Rect ['.$rect.'] /Border [0 0 0] ';
1489
- if(is_string($pl[4]))
1490
- $annots .= '/A <</S /URI /URI '.$this->_textstring($pl[4]).'>>>>';
1491
  else
1492
- {
1493
- $l = $this->links[$pl[4]];
1494
- $h = isset($this->PageSizes[$l[0]]) ? $this->PageSizes[$l[0]][1] : $hPt;
1495
- $annots .= sprintf('/Dest [%d 0 R /XYZ 0 %.2F null]>>',1+2*$l[0],$h-$l[1]*$this->k);
1496
- }
1497
  }
1498
- $this->_out($annots.']');
1499
  }
1500
- if($this->PDFVersion>'1.3')
1501
- $this->_out('/Group <</Type /Group /S /Transparency /CS /DeviceRGB>>');
1502
- $this->_out('/Contents '.($this->n+1).' 0 R>>');
1503
- $this->_out('endobj');
1504
- // Page content
1505
- $p = ($this->compress) ? gzcompress($this->pages[$n]) : $this->pages[$n];
1506
- $this->_newobj();
1507
- $this->_out('<<'.$filter.'/Length '.strlen($p).'>>');
1508
- $this->_putstream($p);
1509
- $this->_out('endobj');
1510
  }
1511
- // Pages root
1512
- $this->offsets[1] = strlen($this->buffer);
1513
- $this->_out('1 0 obj');
1514
- $this->_out('<</Type /Pages');
1515
- $kids = '/Kids [';
1516
- for($i=0;$i<$nb;$i++)
1517
- $kids .= (3+2*$i).' 0 R ';
1518
- $this->_out($kids.']');
1519
- $this->_out('/Count '.$nb);
1520
- $this->_out(sprintf('/MediaBox [0 0 %.2F %.2F]',$wPt,$hPt));
1521
- $this->_out('>>');
1522
- $this->_out('endobj');
1523
  }
1524
 
1525
- function _putfonts()
1526
  {
1527
- $nf = $this->n;
1528
- foreach($this->diffs as $diff)
 
 
 
 
 
 
 
 
 
 
 
 
1529
  {
1530
- // Encodings
1531
- $this->_newobj();
1532
- $this->_out('<</Type /Encoding /BaseEncoding /WinAnsiEncoding /Differences ['.$diff.']>>');
1533
- $this->_out('endobj');
1534
  }
 
 
 
 
 
 
 
 
 
 
 
 
1535
  foreach($this->FontFiles as $file=>$info)
1536
  {
1537
  // Font file embedding
@@ -1543,58 +1582,89 @@ function _putfonts()
1543
  $compressed = (substr($file,-2)=='.z');
1544
  if(!$compressed && isset($info['length2']))
1545
  $font = substr($font,6,$info['length1']).substr($font,6+$info['length1']+6,$info['length2']);
1546
- $this->_out('<</Length '.strlen($font));
1547
  if($compressed)
1548
- $this->_out('/Filter /FlateDecode');
1549
- $this->_out('/Length1 '.$info['length1']);
1550
  if(isset($info['length2']))
1551
- $this->_out('/Length2 '.$info['length2'].' /Length3 0');
1552
- $this->_out('>>');
1553
  $this->_putstream($font);
1554
- $this->_out('endobj');
1555
  }
1556
  foreach($this->fonts as $k=>$font)
1557
  {
1558
- // Font objects
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1559
  $this->fonts[$k]['n'] = $this->n+1;
1560
  $type = $font['type'];
1561
  $name = $font['name'];
 
 
1562
  if($type=='Core')
1563
  {
1564
  // Core font
1565
  $this->_newobj();
1566
- $this->_out('<</Type /Font');
1567
- $this->_out('/BaseFont /'.$name);
1568
- $this->_out('/Subtype /Type1');
1569
  if($name!='Symbol' && $name!='ZapfDingbats')
1570
- $this->_out('/Encoding /WinAnsiEncoding');
1571
- $this->_out('>>');
1572
- $this->_out('endobj');
 
 
1573
  }
1574
  elseif($type=='Type1' || $type=='TrueType')
1575
  {
1576
  // Additional Type1 or TrueType/OpenType font
1577
  $this->_newobj();
1578
- $this->_out('<</Type /Font');
1579
- $this->_out('/BaseFont /'.$name);
1580
- $this->_out('/Subtype /'.$type);
1581
- $this->_out('/FirstChar 32 /LastChar 255');
1582
- $this->_out('/Widths '.($this->n+1).' 0 R');
1583
- $this->_out('/FontDescriptor '.($this->n+2).' 0 R');
1584
- if(isset($font['diffn']))
1585
- $this->_out('/Encoding '.($nf+$font['diffn']).' 0 R');
1586
  else
1587
- $this->_out('/Encoding /WinAnsiEncoding');
1588
- $this->_out('>>');
1589
- $this->_out('endobj');
 
 
1590
  // Widths
1591
  $this->_newobj();
1592
  $cw = &$font['cw'];
1593
  $s = '[';
1594
  for($i=32;$i<=255;$i++)
1595
  $s .= $cw[chr($i)].' ';
1596
- $this->_out($s.']');
1597
- $this->_out('endobj');
1598
  // Descriptor
1599
  $this->_newobj();
1600
  $s = '<</Type /FontDescriptor /FontName /'.$name;
@@ -1602,8 +1672,8 @@ function _putfonts()
1602
  $s .= ' /'.$k.' '.$v;
1603
  if(!empty($font['file']))
1604
  $s .= ' /FontFile'.($type=='Type1' ? '' : '2').' '.$this->FontFiles[$font['file']]['n'].' 0 R';
1605
- $this->_out($s.'>>');
1606
- $this->_out('endobj');
1607
  }
1608
  else
1609
  {
@@ -1616,7 +1686,58 @@ function _putfonts()
1616
  }
1617
  }
1618
 
1619
- function _putimages()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1620
  {
1621
  foreach(array_keys($this->images) as $file)
1622
  {
@@ -1626,39 +1747,39 @@ function _putimages()
1626
  }
1627
  }
1628
 
1629
- function _putimage(&$info)
1630
  {
1631
  $this->_newobj();
1632
  $info['n'] = $this->n;
1633
- $this->_out('<</Type /XObject');
1634
- $this->_out('/Subtype /Image');
1635
- $this->_out('/Width '.$info['w']);
1636
- $this->_out('/Height '.$info['h']);
1637
  if($info['cs']=='Indexed')
1638
- $this->_out('/ColorSpace [/Indexed /DeviceRGB '.(strlen($info['pal'])/3-1).' '.($this->n+1).' 0 R]');
1639
  else
1640
  {
1641
- $this->_out('/ColorSpace /'.$info['cs']);
1642
  if($info['cs']=='DeviceCMYK')
1643
- $this->_out('/Decode [1 0 1 0 1 0 1 0]');
1644
  }
1645
- $this->_out('/BitsPerComponent '.$info['bpc']);
1646
  if(isset($info['f']))
1647
- $this->_out('/Filter /'.$info['f']);
1648
  if(isset($info['dp']))
1649
- $this->_out('/DecodeParms <<'.$info['dp'].'>>');
1650
  if(isset($info['trns']) && is_array($info['trns']))
1651
  {
1652
  $trns = '';
1653
  for($i=0;$i<count($info['trns']);$i++)
1654
  $trns .= $info['trns'][$i].' '.$info['trns'][$i].' ';
1655
- $this->_out('/Mask ['.$trns.']');
1656
  }
1657
  if(isset($info['smask']))
1658
- $this->_out('/SMask '.($this->n+1).' 0 R');
1659
- $this->_out('/Length '.strlen($info['data']).'>>');
1660
  $this->_putstream($info['data']);
1661
- $this->_out('endobj');
1662
  // Soft mask
1663
  if(isset($info['smask']))
1664
  {
@@ -1668,137 +1789,113 @@ function _putimage(&$info)
1668
  }
1669
  // Palette
1670
  if($info['cs']=='Indexed')
1671
- {
1672
- $filter = ($this->compress) ? '/Filter /FlateDecode ' : '';
1673
- $pal = ($this->compress) ? gzcompress($info['pal']) : $info['pal'];
1674
- $this->_newobj();
1675
- $this->_out('<<'.$filter.'/Length '.strlen($pal).'>>');
1676
- $this->_putstream($pal);
1677
- $this->_out('endobj');
1678
- }
1679
  }
1680
 
1681
- function _putxobjectdict()
1682
  {
1683
  foreach($this->images as $image)
1684
- $this->_out('/I'.$image['i'].' '.$image['n'].' 0 R');
1685
  }
1686
 
1687
- function _putresourcedict()
1688
  {
1689
- $this->_out('/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]');
1690
- $this->_out('/Font <<');
1691
  foreach($this->fonts as $font)
1692
- $this->_out('/F'.$font['i'].' '.$font['n'].' 0 R');
1693
- $this->_out('>>');
1694
- $this->_out('/XObject <<');
1695
  $this->_putxobjectdict();
1696
- $this->_out('>>');
1697
  }
1698
 
1699
- function _putresources()
1700
  {
1701
  $this->_putfonts();
1702
  $this->_putimages();
1703
  // Resource dictionary
1704
- $this->offsets[2] = strlen($this->buffer);
1705
- $this->_out('2 0 obj');
1706
- $this->_out('<<');
1707
  $this->_putresourcedict();
1708
- $this->_out('>>');
1709
- $this->_out('endobj');
1710
  }
1711
 
1712
- function _putinfo()
1713
  {
1714
- $this->_out('/Producer '.$this->_textstring('FPDF '.FPDF_VERSION));
1715
- if(!empty($this->title))
1716
- $this->_out('/Title '.$this->_textstring($this->title));
1717
- if(!empty($this->subject))
1718
- $this->_out('/Subject '.$this->_textstring($this->subject));
1719
- if(!empty($this->author))
1720
- $this->_out('/Author '.$this->_textstring($this->author));
1721
- if(!empty($this->keywords))
1722
- $this->_out('/Keywords '.$this->_textstring($this->keywords));
1723
- if(!empty($this->creator))
1724
- $this->_out('/Creator '.$this->_textstring($this->creator));
1725
- $this->_out('/CreationDate '.$this->_textstring('D:'.@date('YmdHis')));
1726
  }
1727
 
1728
- function _putcatalog()
1729
  {
1730
- $this->_out('/Type /Catalog');
1731
- $this->_out('/Pages 1 0 R');
 
1732
  if($this->ZoomMode=='fullpage')
1733
- $this->_out('/OpenAction [3 0 R /Fit]');
1734
  elseif($this->ZoomMode=='fullwidth')
1735
- $this->_out('/OpenAction [3 0 R /FitH null]');
1736
  elseif($this->ZoomMode=='real')
1737
- $this->_out('/OpenAction [3 0 R /XYZ null null 1]');
1738
  elseif(!is_string($this->ZoomMode))
1739
- $this->_out('/OpenAction [3 0 R /XYZ null null '.sprintf('%.2F',$this->ZoomMode/100).']');
1740
  if($this->LayoutMode=='single')
1741
- $this->_out('/PageLayout /SinglePage');
1742
  elseif($this->LayoutMode=='continuous')
1743
- $this->_out('/PageLayout /OneColumn');
1744
  elseif($this->LayoutMode=='two')
1745
- $this->_out('/PageLayout /TwoColumnLeft');
1746
  }
1747
 
1748
- function _putheader()
1749
  {
1750
- $this->_out('%PDF-'.$this->PDFVersion);
1751
  }
1752
 
1753
- function _puttrailer()
1754
  {
1755
- $this->_out('/Size '.($this->n+1));
1756
- $this->_out('/Root '.$this->n.' 0 R');
1757
- $this->_out('/Info '.($this->n-1).' 0 R');
1758
  }
1759
 
1760
- function _enddoc()
1761
  {
1762
  $this->_putheader();
1763
  $this->_putpages();
1764
  $this->_putresources();
1765
  // Info
1766
  $this->_newobj();
1767
- $this->_out('<<');
1768
  $this->_putinfo();
1769
- $this->_out('>>');
1770
- $this->_out('endobj');
1771
  // Catalog
1772
  $this->_newobj();
1773
- $this->_out('<<');
1774
  $this->_putcatalog();
1775
- $this->_out('>>');
1776
- $this->_out('endobj');
1777
  // Cross-ref
1778
- $o = strlen($this->buffer);
1779
- $this->_out('xref');
1780
- $this->_out('0 '.($this->n+1));
1781
- $this->_out('0000000000 65535 f ');
1782
  for($i=1;$i<=$this->n;$i++)
1783
- $this->_out(sprintf('%010d 00000 n ',$this->offsets[$i]));
1784
  // Trailer
1785
- $this->_out('trailer');
1786
- $this->_out('<<');
1787
  $this->_puttrailer();
1788
- $this->_out('>>');
1789
- $this->_out('startxref');
1790
- $this->_out($o);
1791
- $this->_out('%%EOF');
1792
  $this->state = 3;
1793
  }
1794
- // End of class
1795
  }
1796
-
1797
- // Handle special IE contype request
1798
- if(isset($_SERVER['HTTP_USER_AGENT']) && $_SERVER['HTTP_USER_AGENT']=='contype')
1799
- {
1800
- header('Content-Type: application/pdf');
1801
- exit;
1802
- }
1803
-
1804
  ?>
2
  /*******************************************************************************
3
  * FPDF *
4
  * *
5
+ * Version: 1.82 *
6
+ * Date: 2019-12-07 *
7
  * Author: Olivier PLATHEY *
8
  *******************************************************************************/
9
 
10
+ define('FPDF_VERSION','1.82');
11
 
12
  class FPDF
13
  {
14
+ protected $page; // current page number
15
+ protected $n; // current object number
16
+ protected $offsets; // array of object offsets
17
+ protected $buffer; // buffer holding in-memory PDF
18
+ protected $pages; // array containing pages
19
+ protected $state; // current document state
20
+ protected $compress; // compression flag
21
+ protected $k; // scale factor (number of points in user unit)
22
+ protected $DefOrientation; // default orientation
23
+ protected $CurOrientation; // current orientation
24
+ protected $StdPageSizes; // standard page sizes
25
+ protected $DefPageSize; // default page size
26
+ protected $CurPageSize; // current page size
27
+ protected $CurRotation; // current page rotation
28
+ protected $PageInfo; // page-related data
29
+ protected $wPt, $hPt; // dimensions of current page in points
30
+ protected $w, $h; // dimensions of current page in user unit
31
+ protected $lMargin; // left margin
32
+ protected $tMargin; // top margin
33
+ protected $rMargin; // right margin
34
+ protected $bMargin; // page break margin
35
+ protected $cMargin; // cell margin
36
+ protected $x, $y; // current position in user unit
37
+ protected $lasth; // height of last printed cell
38
+ protected $LineWidth; // line width in user unit
39
+ protected $fontpath; // path containing fonts
40
+ protected $CoreFonts; // array of core font names
41
+ protected $fonts; // array of used fonts
42
+ protected $FontFiles; // array of font files
43
+ protected $encodings; // array of encodings
44
+ protected $cmaps; // array of ToUnicode CMaps
45
+ protected $FontFamily; // current font family
46
+ protected $FontStyle; // current font style
47
+ protected $underline; // underlining flag
48
+ protected $CurrentFont; // current font info
49
+ protected $FontSizePt; // current font size in points
50
+ protected $FontSize; // current font size in user unit
51
+ protected $DrawColor; // commands for drawing color
52
+ protected $FillColor; // commands for filling color
53
+ protected $TextColor; // commands for text color
54
+ protected $ColorFlag; // indicates whether fill and text colors are different
55
+ protected $WithAlpha; // indicates whether alpha channel is used
56
+ protected $ws; // word spacing
57
+ protected $images; // array of used images
58
+ protected $PageLinks; // array of links in pages
59
+ protected $links; // array of internal links
60
+ protected $AutoPageBreak; // automatic page breaking
61
+ protected $PageBreakTrigger; // threshold used to trigger page breaks
62
+ protected $InHeader; // flag set when processing header
63
+ protected $InFooter; // flag set when processing footer
64
+ protected $AliasNbPages; // alias for total number of pages
65
+ protected $ZoomMode; // zoom display mode
66
+ protected $LayoutMode; // layout display mode
67
+ protected $metadata; // document properties
68
+ protected $PDFVersion; // PDF version number
 
69
 
70
  /*******************************************************************************
 
71
  * Public methods *
 
72
  *******************************************************************************/
73
+
74
+ function __construct($orientation='P', $unit='mm', $size='A4')
75
  {
76
  // Some checks
77
  $this->_dochecks();
78
  // Initialization of properties
79
+ $this->state = 0;
80
  $this->page = 0;
81
  $this->n = 2;
82
  $this->buffer = '';
83
  $this->pages = array();
84
+ $this->PageInfo = array();
 
85
  $this->fonts = array();
86
  $this->FontFiles = array();
87
+ $this->encodings = array();
88
+ $this->cmaps = array();
89
  $this->images = array();
90
  $this->links = array();
91
  $this->InHeader = false;
99
  $this->FillColor = '0 g';
100
  $this->TextColor = '0 g';
101
  $this->ColorFlag = false;
102
+ $this->WithAlpha = false;
103
  $this->ws = 0;
104
  // Font path
105
  if(defined('FPDF_FONTPATH'))
150
  $this->CurOrientation = $this->DefOrientation;
151
  $this->wPt = $this->w*$this->k;
152
  $this->hPt = $this->h*$this->k;
153
+ // Page rotation
154
+ $this->CurRotation = 0;
155
  // Page margins (1 cm)
156
  $margin = 28.35/$this->k;
157
  $this->SetMargins($margin,$margin);
232
  function SetTitle($title, $isUTF8=false)
233
  {
234
  // Title of document
235
+ $this->metadata['Title'] = $isUTF8 ? $title : utf8_encode($title);
 
 
236
  }
237
 
238
+ function SetAuthor($author, $isUTF8=false)
239
  {
240
+ // Author of document
241
+ $this->metadata['Author'] = $isUTF8 ? $author : utf8_encode($author);
 
 
242
  }
243
 
244
+ function SetSubject($subject, $isUTF8=false)
245
  {
246
+ // Subject of document
247
+ $this->metadata['Subject'] = $isUTF8 ? $subject : utf8_encode($subject);
 
 
248
  }
249
 
250
  function SetKeywords($keywords, $isUTF8=false)
251
  {
252
  // Keywords of document
253
+ $this->metadata['Keywords'] = $isUTF8 ? $keywords : utf8_encode($keywords);
 
 
254
  }
255
 
256
  function SetCreator($creator, $isUTF8=false)
257
  {
258
  // Creator of document
259
+ $this->metadata['Creator'] = $isUTF8 ? $creator : utf8_encode($creator);
 
 
260
  }
261
 
262
  function AliasNbPages($alias='{nb}')
268
  function Error($msg)
269
  {
270
  // Fatal error
271
+ throw new Exception('FPDF error: '.$msg);
 
 
 
 
 
 
272
  }
273
 
274
  function Close()
288
  $this->_enddoc();
289
  }
290
 
291
+ function AddPage($orientation='', $size='', $rotation=0)
292
  {
293
  // Start a new page
294
+ if($this->state==3)
295
+ $this->Error('The document is closed');
296
  $family = $this->FontFamily;
297
  $style = $this->FontStyle.($this->underline ? 'U' : '');
298
  $fontsize = $this->FontSizePt;
311
  $this->_endpage();
312
  }
313
  // Start new page
314
+ $this->_beginpage($orientation,$size,$rotation);
315
  // Set line cap style to square
316
  $this->_out('2 J');
317
  // Set line width
458
  return;
459
  $info = $this->_loadfont($file);
460
  $info['i'] = count($this->fonts)+1;
 
 
 
 
 
 
 
 
 
 
 
461
  if(!empty($info['file']))
462
  {
463
  // Embedded font
557
  function Text($x, $y, $txt)
558
  {
559
  // Output a string
560
+ if(!isset($this->CurrentFont))
561
+ $this->Error('No font has been set');
562
  $s = sprintf('BT %.2F %.2F Td (%s) Tj ET',$x*$this->k,($this->h-$y)*$this->k,$this->_escape($txt));
563
  if($this->underline && $txt!='')
564
  $s .= ' '.$this->_dounderline($x,$y,$txt);
587
  $this->ws = 0;
588
  $this->_out('0 Tw');
589
  }
590
+ $this->AddPage($this->CurOrientation,$this->CurPageSize,$this->CurRotation);
591
  $this->x = $x;
592
  if($ws>0)
593
  {
621
  }
622
  if($txt!=='')
623
  {
624
+ if(!isset($this->CurrentFont))
625
+ $this->Error('No font has been set');
626
  if($align=='R')
627
  $dx = $w-$this->cMargin-$this->GetStringWidth($txt);
628
  elseif($align=='C')
631
  $dx = $this->cMargin;
632
  if($this->ColorFlag)
633
  $s .= 'q '.$this->TextColor.' ';
634
+ $s .= sprintf('BT %.2F %.2F Td (%s) Tj ET',($this->x+$dx)*$k,($this->h-($this->y+.5*$h+.3*$this->FontSize))*$k,$this->_escape($txt));
 
635
  if($this->underline)
636
  $s .= ' '.$this->_dounderline($this->x+$dx,$this->y+.5*$h+.3*$this->FontSize,$txt);
637
  if($this->ColorFlag)
656
  function MultiCell($w, $h, $txt, $border=0, $align='J', $fill=false)
657
  {
658
  // Output text with automatic or explicit line breaks
659
+ if(!isset($this->CurrentFont))
660
+ $this->Error('No font has been set');
661
  $cw = &$this->CurrentFont['cw'];
662
  if($w==0)
663
  $w = $this->w-$this->rMargin-$this->x;
771
  function Write($h, $txt, $link='')
772
  {
773
  // Output text in flowing mode
774
+ if(!isset($this->CurrentFont))
775
+ $this->Error('No font has been set');
776
  $cw = &$this->CurrentFont['cw'];
777
  $w = $this->w-$this->rMargin-$this->x;
778
  $wmax = ($w-2*$this->cMargin)*1000/$this->FontSize;
790
  if($c=="\n")
791
  {
792
  // Explicit line break
793
+ $this->Cell($w,$h,substr($s,$j,$i-$j),0,2,'',false,$link);
794
  $i++;
795
  $sep = -1;
796
  $j = $i;
825
  }
826
  if($i==$j)
827
  $i++;
828
+ $this->Cell($w,$h,substr($s,$j,$i-$j),0,2,'',false,$link);
829
  }
830
  else
831
  {
832
+ $this->Cell($w,$h,substr($s,$j,$sep-$j),0,2,'',false,$link);
833
  $i = $sep+1;
834
  }
835
  $sep = -1;
848
  }
849
  // Last chunk
850
  if($i!=$j)
851
+ $this->Cell($l/1000*$this->FontSize,$h,substr($s,$j),0,0,'',false,$link);
852
  }
853
 
854
  function Ln($h=null)
855
  {
856
+ // Line feed; default value is the last cell height
857
  $this->x = $this->lMargin;
858
  if($h===null)
859
  $this->y += $this->lasth;
864
  function Image($file, $x=null, $y=null, $w=0, $h=0, $type='', $link='')
865
  {
866
  // Put an image on the page
867
+ if($file=='')
868
+ $this->Error('Image file name is empty');
869
  if(!isset($this->images[$file]))
870
  {
871
  // First use of this image, get info
912
  {
913
  // Automatic page break
914
  $x2 = $this->x;
915
+ $this->AddPage($this->CurOrientation,$this->CurPageSize,$this->CurRotation);
916
  $this->x = $x2;
917
  }
918
  $y = $this->y;
926
  $this->Link($x,$y,$w,$h,$link);
927
  }
928
 
929
+ function GetPage()
930
+ {
931
+ // Get current page
932
+ return $this->page;
933
+ }
934
+
935
+ function GetPageWidth()
936
+ {
937
+ // Get current page width
938
+ return $this->w;
939
+ }
940
+
941
+ function GetPageHeight()
942
+ {
943
+ // Get current page height
944
+ return $this->h;
945
+ }
946
+
947
  function GetX()
948
  {
949
  // Get x position
965
  return $this->y;
966
  }
967
 
968
+ function SetY($y, $resetX=true)
969
  {
970
+ // Set y position and optionally reset x
 
971
  if($y>=0)
972
  $this->y = $y;
973
  else
974
  $this->y = $this->h+$y;
975
+ if($resetX)
976
+ $this->x = $this->lMargin;
977
  }
978
 
979
  function SetXY($x, $y)
980
  {
981
  // Set x and y positions
 
982
  $this->SetX($x);
983
+ $this->SetY($y,false);
984
  }
985
 
986
+ function Output($dest='', $name='', $isUTF8=false)
987
  {
988
  // Output PDF to some destination
989
+ $this->Close();
990
+ if(strlen($name)==1 && strlen($dest)!=1)
 
 
991
  {
992
+ // Fix parameter order
993
+ $tmp = $dest;
994
+ $dest = $name;
995
+ $name = $tmp;
 
 
 
996
  }
997
+ if($dest=='')
998
+ $dest = 'I';
999
+ if($name=='')
1000
+ $name = 'doc.pdf';
1001
+ switch(strtoupper($dest))
1002
  {
1003
  case 'I':
1004
  // Send to standard output
1007
  {
1008
  // We send to a browser
1009
  header('Content-Type: application/pdf');
1010
+ header('Content-Disposition: inline; '.$this->_httpencode('filename',$name,$isUTF8));
1011
  header('Cache-Control: private, max-age=0, must-revalidate');
1012
  header('Pragma: public');
1013
  }
1017
  // Download file
1018
  $this->_checkoutput();
1019
  header('Content-Type: application/x-download');
1020
+ header('Content-Disposition: attachment; '.$this->_httpencode('filename',$name,$isUTF8));
1021
  header('Cache-Control: private, max-age=0, must-revalidate');
1022
  header('Pragma: public');
1023
  echo $this->buffer;
1024
  break;
1025
  case 'F':
1026
  // Save to local file
1027
+ if(!file_put_contents($name,$this->buffer))
 
1028
  $this->Error('Unable to create output file: '.$name);
 
 
1029
  break;
1030
  case 'S':
1031
  // Return as a string
1037
  }
1038
 
1039
  /*******************************************************************************
 
1040
  * Protected methods *
 
1041
  *******************************************************************************/
1042
+
1043
+ protected function _dochecks()
1044
  {
 
 
 
1045
  // Check mbstring overloading
1046
  if(ini_get('mbstring.func_overload') & 2)
1047
  $this->Error('mbstring overloading must be disabled');
 
 
 
1048
  }
1049
 
1050
+ protected function _checkoutput()
1051
  {
1052
  if(PHP_SAPI!='cli')
1053
  {
1067
  }
1068
  }
1069
 
1070
+ protected function _getpagesize($size)
1071
  {
1072
  if(is_string($size))
1073
  {
1086
  }
1087
  }
1088
 
1089
+ protected function _beginpage($orientation, $size, $rotation)
1090
  {
1091
  $this->page++;
1092
  $this->pages[$this->page] = '';
1123
  $this->CurPageSize = $size;
1124
  }
1125
  if($orientation!=$this->DefOrientation || $size[0]!=$this->DefPageSize[0] || $size[1]!=$this->DefPageSize[1])
1126
+ $this->PageInfo[$this->page]['size'] = array($this->wPt, $this->hPt);
1127
+ if($rotation!=0)
1128
+ {
1129
+ if($rotation%90!=0)
1130
+ $this->Error('Incorrect rotation value: '.$rotation);
1131
+ $this->CurRotation = $rotation;
1132
+ $this->PageInfo[$this->page]['rotation'] = $rotation;
1133
+ }
1134
  }
1135
 
1136
+ protected function _endpage()
1137
  {
1138
  $this->state = 1;
1139
  }
1140
 
1141
+ protected function _loadfont($font)
1142
  {
1143
  // Load a font definition file from the font directory
1144
+ if(strpos($font,'/')!==false || strpos($font,"\\")!==false)
1145
+ $this->Error('Incorrect font definition file name: '.$font);
1146
  include($this->fontpath.$font);
1147
+ if(!isset($name))
 
1148
  $this->Error('Could not include font definition file');
1149
+ if(isset($enc))
1150
+ $enc = strtolower($enc);
1151
+ if(!isset($subsetted))
1152
+ $subsetted = false;
1153
+ return get_defined_vars();
1154
  }
1155
 
1156
+ protected function _isascii($s)
1157
  {
1158
+ // Test if string is ASCII
1159
+ $nb = strlen($s);
1160
+ for($i=0;$i<$nb;$i++)
1161
+ {
1162
+ if(ord($s[$i])>127)
1163
+ return false;
1164
+ }
1165
+ return true;
1166
  }
1167
 
1168
+ protected function _httpencode($param, $value, $isUTF8)
1169
  {
1170
+ // Encode HTTP header field parameter
1171
+ if($this->_isascii($value))
1172
+ return $param.'="'.$value.'"';
1173
+ if(!$isUTF8)
1174
+ $value = utf8_encode($value);
1175
+ if(strpos($_SERVER['HTTP_USER_AGENT'],'MSIE')!==false)
1176
+ return $param.'="'.rawurlencode($value).'"';
1177
+ else
1178
+ return $param."*=UTF-8''".rawurlencode($value);
1179
  }
1180
 
1181
+ protected function _UTF8toUTF16($s)
1182
  {
1183
  // Convert UTF-8 to UTF-16BE with BOM
1184
  $res = "\xFE\xFF";
1211
  return $res;
1212
  }
1213
 
1214
+ protected function _escape($s)
1215
+ {
1216
+ // Escape special characters
1217
+ if(strpos($s,'(')!==false || strpos($s,')')!==false || strpos($s,'\\')!==false || strpos($s,"\r")!==false)
1218
+ return str_replace(array('\\','(',')',"\r"), array('\\\\','\\(','\\)','\\r'), $s);
1219
+ else
1220
+ return $s;
1221
+ }
1222
+
1223
+ protected function _textstring($s)
1224
+ {
1225
+ // Format a text string
1226
+ if(!$this->_isascii($s))
1227
+ $s = $this->_UTF8toUTF16($s);
1228
+ return '('.$this->_escape($s).')';
1229
+ }
1230
+
1231
+ protected function _dounderline($x, $y, $txt)
1232
  {
1233
  // Underline text
1234
  $up = $this->CurrentFont['up'];
1237
  return sprintf('%.2F %.2F %.2F %.2F re f',$x*$this->k,($this->h-($y-$up/1000*$this->FontSize))*$this->k,$w*$this->k,-$ut/1000*$this->FontSizePt);
1238
  }
1239
 
1240
+ protected function _parsejpg($file)
1241
  {
1242
  // Extract info from a JPEG file
1243
  $a = getimagesize($file);
1256
  return array('w'=>$a[0], 'h'=>$a[1], 'cs'=>$colspace, 'bpc'=>$bpc, 'f'=>'DCTDecode', 'data'=>$data);
1257
  }
1258
 
1259
+ protected function _parsepng($file)
1260
  {
1261
  // Extract info from a PNG file
1262
  $f = fopen($file,'rb');
1267
  return $info;
1268
  }
1269
 
1270
+ protected function _parsepngstream($f, $file)
1271
  {
1272
  // Check signature
1273
  if($this->_readstream($f,8)!=chr(137).'PNG'.chr(13).chr(10).chr(26).chr(10))
1385
  unset($data);
1386
  $data = gzcompress($color);
1387
  $info['smask'] = gzcompress($alpha);
1388
+ $this->WithAlpha = true;
1389
  if($this->PDFVersion<'1.4')
1390
  $this->PDFVersion = '1.4';
1391
  }
1393
  return $info;
1394
  }
1395
 
1396
+ protected function _readstream($f, $n)
1397
  {
1398
  // Read n bytes from stream
1399
  $res = '';
1410
  return $res;
1411
  }
1412
 
1413
+ protected function _readint($f)
1414
  {
1415
  // Read a 4-byte integer from stream
1416
  $a = unpack('Ni',$this->_readstream($f,4));
1417
  return $a['i'];
1418
  }
1419
 
1420
+ protected function _parsegif($file)
1421
  {
1422
  // Extract info from a GIF file (via PNG conversion)
1423
  if(!function_exists('imagepng'))
1428
  if(!$im)
1429
  $this->Error('Missing or incorrect image file: '.$file);
1430
  imageinterlace($im,0);
1431
+ ob_start();
1432
+ imagepng($im);
1433
+ $data = ob_get_clean();
1434
+ imagedestroy($im);
1435
+ $f = fopen('php://temp','rb+');
1436
+ if(!$f)
1437
+ $this->Error('Unable to create memory stream');
1438
+ fwrite($f,$data);
1439
+ rewind($f);
1440
+ $info = $this->_parsepngstream($f,$file);
1441
+ fclose($f);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1442
  return $info;
1443
  }
1444
 
1445
+ protected function _out($s)
1446
  {
1447
+ // Add a line to the document
1448
+ if($this->state==2)
1449
+ $this->pages[$this->page] .= $s."\n";
1450
+ elseif($this->state==1)
1451
+ $this->_put($s);
1452
+ elseif($this->state==0)
1453
+ $this->Error('No page has been added yet');
1454
+ elseif($this->state==3)
1455
+ $this->Error('The document is closed');
1456
  }
1457
 
1458
+ protected function _put($s)
1459
  {
1460
+ $this->buffer .= $s."\n";
 
 
1461
  }
1462
 
1463
+ protected function _getoffset()
1464
  {
1465
+ return strlen($this->buffer);
 
 
 
 
1466
  }
1467
 
1468
+ protected function _newobj($n=null)
1469
  {
1470
+ // Begin a new object
1471
+ if($n===null)
1472
+ $n = ++$this->n;
1473
+ $this->offsets[$n] = $this->_getoffset();
1474
+ $this->_put($n.' 0 obj');
1475
+ }
1476
+
1477
+ protected function _putstream($data)
1478
+ {
1479
+ $this->_put('stream');
1480
+ $this->_put($data);
1481
+ $this->_put('endstream');
1482
+ }
1483
+
1484
+ protected function _putstreamobject($data)
1485
+ {
1486
+ if($this->compress)
1487
  {
1488
+ $entries = '/Filter /FlateDecode ';
1489
+ $data = gzcompress($data);
1490
  }
1491
  else
1492
+ $entries = '';
1493
+ $entries .= '/Length '.strlen($data);
1494
+ $this->_newobj();
1495
+ $this->_put('<<'.$entries.'>>');
1496
+ $this->_putstream($data);
1497
+ $this->_put('endobj');
1498
+ }
1499
+
1500
+ protected function _putpage($n)
1501
+ {
1502
+ $this->_newobj();
1503
+ $this->_put('<</Type /Page');
1504
+ $this->_put('/Parent 1 0 R');
1505
+ if(isset($this->PageInfo[$n]['size']))
1506
+ $this->_put(sprintf('/MediaBox [0 0 %.2F %.2F]',$this->PageInfo[$n]['size'][0],$this->PageInfo[$n]['size'][1]));
1507
+ if(isset($this->PageInfo[$n]['rotation']))
1508
+ $this->_put('/Rotate '.$this->PageInfo[$n]['rotation']);
1509
+ $this->_put('/Resources 2 0 R');
1510
+ if(isset($this->PageLinks[$n]))
1511
  {
1512
+ // Links
1513
+ $annots = '/Annots [';
1514
+ foreach($this->PageLinks[$n] as $pl)
 
 
 
 
 
 
 
 
 
 
 
1515
  {
1516
+ $rect = sprintf('%.2F %.2F %.2F %.2F',$pl[0],$pl[1],$pl[0]+$pl[2],$pl[1]-$pl[3]);
1517
+ $annots .= '<</Type /Annot /Subtype /Link /Rect ['.$rect.'] /Border [0 0 0] ';
1518
+ if(is_string($pl[4]))
1519
+ $annots .= '/A <</S /URI /URI '.$this->_textstring($pl[4]).'>>>>';
1520
+ else
1521
  {
1522
+ $l = $this->links[$pl[4]];
1523
+ if(isset($this->PageInfo[$l[0]]['size']))
1524
+ $h = $this->PageInfo[$l[0]]['size'][1];
 
1525
  else
1526
+ $h = ($this->DefOrientation=='P') ? $this->DefPageSize[1]*$this->k : $this->DefPageSize[0]*$this->k;
1527
+ $annots .= sprintf('/Dest [%d 0 R /XYZ 0 %.2F null]>>',$this->PageInfo[$l[0]]['n'],$h-$l[1]*$this->k);
 
 
 
1528
  }
 
1529
  }
1530
+ $this->_put($annots.']');
 
 
 
 
 
 
 
 
 
1531
  }
1532
+ if($this->WithAlpha)
1533
+ $this->_put('/Group <</Type /Group /S /Transparency /CS /DeviceRGB>>');
1534
+ $this->_put('/Contents '.($this->n+1).' 0 R>>');
1535
+ $this->_put('endobj');
1536
+ // Page content
1537
+ if(!empty($this->AliasNbPages))
1538
+ $this->pages[$n] = str_replace($this->AliasNbPages,$this->page,$this->pages[$n]);
1539
+ $this->_putstreamobject($this->pages[$n]);
 
 
 
 
1540
  }
1541
 
1542
+ protected function _putpages()
1543
  {
1544
+ $nb = $this->page;
1545
+ for($n=1;$n<=$nb;$n++)
1546
+ $this->PageInfo[$n]['n'] = $this->n+1+2*($n-1);
1547
+ for($n=1;$n<=$nb;$n++)
1548
+ $this->_putpage($n);
1549
+ // Pages root
1550
+ $this->_newobj(1);
1551
+ $this->_put('<</Type /Pages');
1552
+ $kids = '/Kids [';
1553
+ for($n=1;$n<=$nb;$n++)
1554
+ $kids .= $this->PageInfo[$n]['n'].' 0 R ';
1555
+ $this->_put($kids.']');
1556
+ $this->_put('/Count '.$nb);
1557
+ if($this->DefOrientation=='P')
1558
  {
1559
+ $w = $this->DefPageSize[0];
1560
+ $h = $this->DefPageSize[1];
 
 
1561
  }
1562
+ else
1563
+ {
1564
+ $w = $this->DefPageSize[1];
1565
+ $h = $this->DefPageSize[0];
1566
+ }
1567
+ $this->_put(sprintf('/MediaBox [0 0 %.2F %.2F]',$w*$this->k,$h*$this->k));
1568
+ $this->_put('>>');
1569
+ $this->_put('endobj');
1570
+ }
1571
+
1572
+ protected function _putfonts()
1573
+ {
1574
  foreach($this->FontFiles as $file=>$info)
1575
  {
1576
  // Font file embedding
1582
  $compressed = (substr($file,-2)=='.z');
1583
  if(!$compressed && isset($info['length2']))
1584
  $font = substr($font,6,$info['length1']).substr($font,6+$info['length1']+6,$info['length2']);
1585
+ $this->_put('<</Length '.strlen($font));
1586
  if($compressed)
1587
+ $this->_put('/Filter /FlateDecode');
1588
+ $this->_put('/Length1 '.$info['length1']);
1589
  if(isset($info['length2']))
1590
+ $this->_put('/Length2 '.$info['length2'].' /Length3 0');
1591
+ $this->_put('>>');
1592
  $this->_putstream($font);
1593
+ $this->_put('endobj');
1594
  }
1595
  foreach($this->fonts as $k=>$font)
1596
  {
1597
+ // Encoding
1598
+ if(isset($font['diff']))
1599
+ {
1600
+ if(!isset($this->encodings[$font['enc']]))
1601
+ {
1602
+ $this->_newobj();
1603
+ $this->_put('<</Type /Encoding /BaseEncoding /WinAnsiEncoding /Differences ['.$font['diff'].']>>');
1604
+ $this->_put('endobj');
1605
+ $this->encodings[$font['enc']] = $this->n;
1606
+ }
1607
+ }
1608
+ // ToUnicode CMap
1609
+ if(isset($font['uv']))
1610
+ {
1611
+ if(isset($font['enc']))
1612
+ $cmapkey = $font['enc'];
1613
+ else
1614
+ $cmapkey = $font['name'];
1615
+ if(!isset($this->cmaps[$cmapkey]))
1616
+ {
1617
+ $cmap = $this->_tounicodecmap($font['uv']);
1618
+ $this->_putstreamobject($cmap);
1619
+ $this->cmaps[$cmapkey] = $this->n;
1620
+ }
1621
+ }
1622
+ // Font object
1623
  $this->fonts[$k]['n'] = $this->n+1;
1624
  $type = $font['type'];
1625
  $name = $font['name'];
1626
+ if($font['subsetted'])
1627
+ $name = 'AAAAAA+'.$name;
1628
  if($type=='Core')
1629
  {
1630
  // Core font
1631
  $this->_newobj();
1632
+ $this->_put('<</Type /Font');
1633
+ $this->_put('/BaseFont /'.$name);
1634
+ $this->_put('/Subtype /Type1');
1635
  if($name!='Symbol' && $name!='ZapfDingbats')
1636
+ $this->_put('/Encoding /WinAnsiEncoding');
1637
+ if(isset($font['uv']))
1638
+ $this->_put('/ToUnicode '.$this->cmaps[$cmapkey].' 0 R');
1639
+ $this->_put('>>');
1640
+ $this->_put('endobj');
1641
  }
1642
  elseif($type=='Type1' || $type=='TrueType')
1643
  {
1644
  // Additional Type1 or TrueType/OpenType font
1645
  $this->_newobj();
1646
+ $this->_put('<</Type /Font');
1647
+ $this->_put('/BaseFont /'.$name);
1648
+ $this->_put('/Subtype /'.$type);
1649
+ $this->_put('/FirstChar 32 /LastChar 255');
1650
+ $this->_put('/Widths '.($this->n+1).' 0 R');
1651
+ $this->_put('/FontDescriptor '.($this->n+2).' 0 R');
1652
+ if(isset($font['diff']))
1653
+ $this->_put('/Encoding '.$this->encodings[$font['enc']].' 0 R');
1654
  else
1655
+ $this->_put('/Encoding /WinAnsiEncoding');
1656
+ if(isset($font['uv']))
1657
+ $this->_put('/ToUnicode '.$this->cmaps[$cmapkey].' 0 R');
1658
+ $this->_put('>>');
1659
+ $this->_put('endobj');
1660
  // Widths
1661
  $this->_newobj();
1662
  $cw = &$font['cw'];
1663
  $s = '[';
1664
  for($i=32;$i<=255;$i++)
1665
  $s .= $cw[chr($i)].' ';
1666
+ $this->_put($s.']');
1667
+ $this->_put('endobj');
1668
  // Descriptor
1669
  $this->_newobj();
1670
  $s = '<</Type /FontDescriptor /FontName /'.$name;
1672
  $s .= ' /'.$k.' '.$v;
1673
  if(!empty($font['file']))
1674
  $s .= ' /FontFile'.($type=='Type1' ? '' : '2').' '.$this->FontFiles[$font['file']]['n'].' 0 R';
1675
+ $this->_put($s.'>>');
1676
+ $this->_put('endobj');
1677
  }
1678
  else
1679
  {
1686
  }
1687
  }
1688
 
1689
+ protected function _tounicodecmap($uv)
1690
+ {
1691
+ $ranges = '';
1692
+ $nbr = 0;
1693
+ $chars = '';
1694
+ $nbc = 0;
1695
+ foreach($uv as $c=>$v)
1696
+ {
1697
+ if(is_array($v))
1698
+ {
1699
+ $ranges .= sprintf("<%02X> <%02X> <%04X>\n",$c,$c+$v[1]-1,$v[0]);
1700
+ $nbr++;
1701
+ }
1702
+ else
1703
+ {
1704
+ $chars .= sprintf("<%02X> <%04X>\n",$c,$v);
1705
+ $nbc++;
1706
+ }
1707
+ }
1708
+ $s = "/CIDInit /ProcSet findresource begin\n";
1709
+ $s .= "12 dict begin\n";
1710
+ $s .= "begincmap\n";
1711
+ $s .= "/CIDSystemInfo\n";
1712
+ $s .= "<</Registry (Adobe)\n";
1713
+ $s .= "/Ordering (UCS)\n";
1714
+ $s .= "/Supplement 0\n";
1715
+ $s .= ">> def\n";
1716
+ $s .= "/CMapName /Adobe-Identity-UCS def\n";
1717
+ $s .= "/CMapType 2 def\n";
1718
+ $s .= "1 begincodespacerange\n";
1719
+ $s .= "<00> <FF>\n";
1720
+ $s .= "endcodespacerange\n";
1721
+ if($nbr>0)
1722
+ {
1723
+ $s .= "$nbr beginbfrange\n";
1724
+ $s .= $ranges;
1725
+ $s .= "endbfrange\n";
1726
+ }
1727
+ if($nbc>0)
1728
+ {
1729
+ $s .= "$nbc beginbfchar\n";
1730
+ $s .= $chars;
1731
+ $s .= "endbfchar\n";
1732
+ }
1733
+ $s .= "endcmap\n";
1734
+ $s .= "CMapName currentdict /CMap defineresource pop\n";
1735
+ $s .= "end\n";
1736
+ $s .= "end";
1737
+ return $s;
1738
+ }
1739
+
1740
+ protected function _putimages()
1741
  {
1742
  foreach(array_keys($this->images) as $file)
1743
  {
1747
  }
1748
  }
1749
 
1750
+ protected function _putimage(&$info)
1751
  {
1752
  $this->_newobj();
1753
  $info['n'] = $this->n;
1754
+ $this->_put('<</Type /XObject');
1755
+ $this->_put('/Subtype /Image');
1756
+ $this->_put('/Width '.$info['w']);
1757
+ $this->_put('/Height '.$info['h']);
1758
  if($info['cs']=='Indexed')
1759
+ $this->_put('/ColorSpace [/Indexed /DeviceRGB '.(strlen($info['pal'])/3-1).' '.($this->n+1).' 0 R]');
1760
  else
1761
  {
1762
+ $this->_put('/ColorSpace /'.$info['cs']);
1763
  if($info['cs']=='DeviceCMYK')
1764
+ $this->_put('/Decode [1 0 1 0 1 0 1 0]');
1765
  }
1766
+ $this->_put('/BitsPerComponent '.$info['bpc']);
1767
  if(isset($info['f']))
1768
+ $this->_put('/Filter /'.$info['f']);
1769
  if(isset($info['dp']))
1770
+ $this->_put('/DecodeParms <<'.$info['dp'].'>>');
1771
  if(isset($info['trns']) && is_array($info['trns']))
1772
  {
1773
  $trns = '';
1774
  for($i=0;$i<count($info['trns']);$i++)
1775
  $trns .= $info['trns'][$i].' '.$info['trns'][$i].' ';
1776
+ $this->_put('/Mask ['.$trns.']');
1777
  }
1778
  if(isset($info['smask']))
1779
+ $this->_put('/SMask '.($this->n+1).' 0 R');
1780
+ $this->_put('/Length '.strlen($info['data']).'>>');
1781
  $this->_putstream($info['data']);
1782
+ $this->_put('endobj');
1783
  // Soft mask
1784
  if(isset($info['smask']))
1785
  {
1789
  }
1790
  // Palette
1791
  if($info['cs']=='Indexed')
1792
+ $this->_putstreamobject($info['pal']);
 
 
 
 
 
 
 
1793
  }
1794
 
1795
+ protected function _putxobjectdict()
1796
  {
1797
  foreach($this->images as $image)
1798
+ $this->_put('/I'.$image['i'].' '.$image['n'].' 0 R');
1799
  }
1800
 
1801
+ protected function _putresourcedict()
1802
  {
1803
+ $this->_put('/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]');
1804
+ $this->_put('/Font <<');
1805
  foreach($this->fonts as $font)
1806
+ $this->_put('/F'.$font['i'].' '.$font['n'].' 0 R');
1807
+ $this->_put('>>');
1808
+ $this->_put('/XObject <<');
1809
  $this->_putxobjectdict();
1810
+ $this->_put('>>');
1811
  }
1812
 
1813
+ protected function _putresources()
1814
  {
1815
  $this->_putfonts();
1816
  $this->_putimages();
1817
  // Resource dictionary
1818
+ $this->_newobj(2);
1819
+ $this->_put('<<');
 
1820
  $this->_putresourcedict();
1821
+ $this->_put('>>');
1822
+ $this->_put('endobj');
1823
  }
1824
 
1825
+ protected function _putinfo()
1826
  {
1827
+ $this->metadata['Producer'] = 'FPDF '.FPDF_VERSION;
1828
+ $this->metadata['CreationDate'] = 'D:'.@date('YmdHis');
1829
+ foreach($this->metadata as $key=>$value)
1830
+ $this->_put('/'.$key.' '.$this->_textstring($value));
 
 
 
 
 
 
 
 
1831
  }
1832
 
1833
+ protected function _putcatalog()
1834
  {
1835
+ $n = $this->PageInfo[1]['n'];
1836
+ $this->_put('/Type /Catalog');
1837
+ $this->_put('/Pages 1 0 R');
1838
  if($this->ZoomMode=='fullpage')
1839
+ $this->_put('/OpenAction ['.$n.' 0 R /Fit]');
1840
  elseif($this->ZoomMode=='fullwidth')
1841
+ $this->_put('/OpenAction ['.$n.' 0 R /FitH null]');
1842
  elseif($this->ZoomMode=='real')
1843
+ $this->_put('/OpenAction ['.$n.' 0 R /XYZ null null 1]');
1844
  elseif(!is_string($this->ZoomMode))
1845
+ $this->_put('/OpenAction ['.$n.' 0 R /XYZ null null '.sprintf('%.2F',$this->ZoomMode/100).']');
1846
  if($this->LayoutMode=='single')
1847
+ $this->_put('/PageLayout /SinglePage');
1848
  elseif($this->LayoutMode=='continuous')
1849
+ $this->_put('/PageLayout /OneColumn');
1850
  elseif($this->LayoutMode=='two')
1851
+ $this->_put('/PageLayout /TwoColumnLeft');
1852
  }
1853
 
1854
+ protected function _putheader()
1855
  {
1856
+ $this->_put('%PDF-'.$this->PDFVersion);
1857
  }
1858
 
1859
+ protected function _puttrailer()
1860
  {
1861
+ $this->_put('/Size '.($this->n+1));
1862
+ $this->_put('/Root '.$this->n.' 0 R');
1863
+ $this->_put('/Info '.($this->n-1).' 0 R');
1864
  }
1865
 
1866
+ protected function _enddoc()
1867
  {
1868
  $this->_putheader();
1869
  $this->_putpages();
1870
  $this->_putresources();
1871
  // Info
1872
  $this->_newobj();
1873
+ $this->_put('<<');
1874
  $this->_putinfo();
1875
+ $this->_put('>>');
1876
+ $this->_put('endobj');
1877
  // Catalog
1878
  $this->_newobj();
1879
+ $this->_put('<<');
1880
  $this->_putcatalog();
1881
+ $this->_put('>>');
1882
+ $this->_put('endobj');
1883
  // Cross-ref
1884
+ $offset = $this->_getoffset();
1885
+ $this->_put('xref');
1886
+ $this->_put('0 '.($this->n+1));
1887
+ $this->_put('0000000000 65535 f ');
1888
  for($i=1;$i<=$this->n;$i++)
1889
+ $this->_put(sprintf('%010d 00000 n ',$this->offsets[$i]));
1890
  // Trailer
1891
+ $this->_put('trailer');
1892
+ $this->_put('<<');
1893
  $this->_puttrailer();
1894
+ $this->_put('>>');
1895
+ $this->_put('startxref');
1896
+ $this->_put($offset);
1897
+ $this->_put('%%EOF');
1898
  $this->state = 3;
1899
  }
 
1900
  }
 
 
 
 
 
 
 
 
1901
  ?>
FPDF/makefont/makefont.php CHANGED
@@ -2,8 +2,8 @@
2
  /*******************************************************************************
3
  * Utility to generate font definition files *
4
  * *
5
- * Version: 1.2 *
6
- * Date: 2011-06-18 *
7
  * Author: Olivier PLATHEY *
8
  *******************************************************************************/
9
 
@@ -59,21 +59,40 @@ function LoadMap($enc)
59
  return $map;
60
  }
61
 
62
- function GetInfoFromTrueType($file, $embed, $map)
63
  {
64
- // Return informations from a TrueType font
65
- $ttf = new TTFParser();
66
- $ttf->Parse($file);
 
 
 
 
 
 
 
67
  if($embed)
68
  {
69
- if(!$ttf->Embeddable)
70
  Error('Font license does not allow embedding');
71
- $info['Data'] = file_get_contents($file);
72
- $info['OriginalSize'] = filesize($file);
 
 
 
 
 
 
 
 
 
 
 
 
73
  }
74
  $k = 1000/$ttf->unitsPerEm;
75
  $info['FontName'] = $ttf->postScriptName;
76
- $info['Bold'] = $ttf->Bold;
77
  $info['ItalicAngle'] = $ttf->italicAngle;
78
  $info['IsFixedPitch'] = $ttf->isFixedPitch;
79
  $info['Ascender'] = round($k*$ttf->typoAscender);
@@ -82,20 +101,20 @@ function GetInfoFromTrueType($file, $embed, $map)
82
  $info['UnderlinePosition'] = round($k*$ttf->underlinePosition);
83
  $info['FontBBox'] = array(round($k*$ttf->xMin), round($k*$ttf->yMin), round($k*$ttf->xMax), round($k*$ttf->yMax));
84
  $info['CapHeight'] = round($k*$ttf->capHeight);
85
- $info['MissingWidth'] = round($k*$ttf->widths[0]);
86
  $widths = array_fill(0, 256, $info['MissingWidth']);
87
- for($c=0;$c<=255;$c++)
88
  {
89
- if($map[$c]['name']!='.notdef')
90
  {
91
- $uv = $map[$c]['uv'];
92
- if(isset($ttf->chars[$uv]))
93
  {
94
- $w = $ttf->widths[$ttf->chars[$uv]];
 
95
  $widths[$c] = round($k*$w);
96
  }
97
  else
98
- Warning('Character '.$map[$c]['name'].' is missing');
99
  }
100
  }
101
  $info['Widths'] = $widths;
@@ -104,7 +123,7 @@ function GetInfoFromTrueType($file, $embed, $map)
104
 
105
  function GetInfoFromType1($file, $embed, $map)
106
  {
107
- // Return informations from a Type1 font
108
  if($embed)
109
  {
110
  $f = fopen($file, 'rb');
@@ -172,21 +191,24 @@ function GetInfoFromType1($file, $embed, $map)
172
 
173
  if(!isset($info['FontName']))
174
  Error('FontName missing in AFM file');
 
 
 
 
175
  $info['Bold'] = isset($info['Weight']) && preg_match('/bold|black/i', $info['Weight']);
176
  if(isset($cw['.notdef']))
177
  $info['MissingWidth'] = $cw['.notdef'];
178
  else
179
  $info['MissingWidth'] = 0;
180
  $widths = array_fill(0, 256, $info['MissingWidth']);
181
- for($c=0;$c<=255;$c++)
182
  {
183
- $name = $map[$c]['name'];
184
- if($name!='.notdef')
185
  {
186
- if(isset($cw[$name]))
187
- $widths[$c] = $cw[$name];
188
  else
189
- Warning('Character '.$name.' is missing');
190
  }
191
  }
192
  $info['Widths'] = $widths;
@@ -272,16 +294,61 @@ function MakeFontEncoding($map)
272
  return rtrim($s);
273
  }
274
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
275
  function SaveToFile($file, $s, $mode)
276
  {
277
  $f = fopen($file, 'w'.$mode);
278
  if(!$f)
279
  Error('Can\'t write to file '.$file);
280
- fwrite($f, $s, strlen($s));
281
  fclose($f);
282
  }
283
 
284
- function MakeDefinitionFile($file, $type, $enc, $embed, $map, $info)
285
  {
286
  $s = "<?php\n";
287
  $s .= '$type = \''.$type."';\n";
@@ -294,6 +361,7 @@ function MakeDefinitionFile($file, $type, $enc, $embed, $map, $info)
294
  $diff = MakeFontEncoding($map);
295
  if($diff)
296
  $s .= '$diff = \''.$diff."';\n";
 
297
  if($embed)
298
  {
299
  $s .= '$file = \''.$info['File']."';\n";
@@ -303,19 +371,19 @@ function MakeDefinitionFile($file, $type, $enc, $embed, $map, $info)
303
  $s .= '$size2 = '.$info['Size2'].";\n";
304
  }
305
  else
 
306
  $s .= '$originalsize = '.$info['OriginalSize'].";\n";
 
 
 
307
  }
308
  $s .= "?>\n";
309
  SaveToFile($file, $s, 't');
310
  }
311
 
312
- function MakeFont($fontfile, $enc='cp1252', $embed=true)
313
  {
314
  // Generate a font definition file
315
- if(get_magic_quotes_runtime())
316
- @set_magic_quotes_runtime(0);
317
- ini_set('auto_detect_line_endings', '1');
318
-
319
  if(!file_exists($fontfile))
320
  Error('Font file not found: '.$fontfile);
321
  $ext = strtolower(substr($fontfile,-3));
@@ -329,7 +397,7 @@ function MakeFont($fontfile, $enc='cp1252', $embed=true)
329
  $map = LoadMap($enc);
330
 
331
  if($type=='TrueType')
332
- $info = GetInfoFromTrueType($fontfile, $embed, $map);
333
  else
334
  $info = GetInfoFromType1($fontfile, $embed, $map);
335
 
@@ -346,19 +414,21 @@ function MakeFont($fontfile, $enc='cp1252', $embed=true)
346
  else
347
  {
348
  $info['File'] = basename($fontfile);
 
349
  Notice('Font file could not be compressed (zlib extension not available)');
350
  }
351
  }
352
 
353
- MakeDefinitionFile($basename.'.php', $type, $enc, $embed, $map, $info);
354
  Message('Font definition file generated: '.$basename.'.php');
355
  }
356
 
357
  if(PHP_SAPI=='cli')
358
  {
359
  // Command-line interface
 
360
  if($argc==1)
361
- die("Usage: php makefont.php fontfile [enc] [embed]\n");
362
  $fontfile = $argv[1];
363
  if($argc>=3)
364
  $enc = $argv[2];
@@ -368,6 +438,10 @@ if(PHP_SAPI=='cli')
368
  $embed = ($argv[3]=='true' || $argv[3]=='1');
369
  else
370
  $embed = true;
371
- MakeFont($fontfile, $enc, $embed);
 
 
 
 
372
  }
373
  ?>
2
  /*******************************************************************************
3
  * Utility to generate font definition files *
4
  * *
5
+ * Version: 1.31 *
6
+ * Date: 2019-12-07 *
7
  * Author: Olivier PLATHEY *
8
  *******************************************************************************/
9
 
59
  return $map;
60
  }
61
 
62
+ function GetInfoFromTrueType($file, $embed, $subset, $map)
63
  {
64
+ // Return information from a TrueType font
65
+ try
66
+ {
67
+ $ttf = new TTFParser($file);
68
+ $ttf->Parse();
69
+ }
70
+ catch(Exception $e)
71
+ {
72
+ Error($e->getMessage());
73
+ }
74
  if($embed)
75
  {
76
+ if(!$ttf->embeddable)
77
  Error('Font license does not allow embedding');
78
+ if($subset)
79
+ {
80
+ $chars = array();
81
+ foreach($map as $v)
82
+ {
83
+ if($v['name']!='.notdef')
84
+ $chars[] = $v['uv'];
85
+ }
86
+ $ttf->Subset($chars);
87
+ $info['Data'] = $ttf->Build();
88
+ }
89
+ else
90
+ $info['Data'] = file_get_contents($file);
91
+ $info['OriginalSize'] = strlen($info['Data']);
92
  }
93
  $k = 1000/$ttf->unitsPerEm;
94
  $info['FontName'] = $ttf->postScriptName;
95
+ $info['Bold'] = $ttf->bold;
96
  $info['ItalicAngle'] = $ttf->italicAngle;
97
  $info['IsFixedPitch'] = $ttf->isFixedPitch;
98
  $info['Ascender'] = round($k*$ttf->typoAscender);
101
  $info['UnderlinePosition'] = round($k*$ttf->underlinePosition);
102
  $info['FontBBox'] = array(round($k*$ttf->xMin), round($k*$ttf->yMin), round($k*$ttf->xMax), round($k*$ttf->yMax));
103
  $info['CapHeight'] = round($k*$ttf->capHeight);
104
+ $info['MissingWidth'] = round($k*$ttf->glyphs[0]['w']);
105
  $widths = array_fill(0, 256, $info['MissingWidth']);
106
+ foreach($map as $c=>$v)
107
  {
108
+ if($v['name']!='.notdef')
109
  {
110
+ if(isset($ttf->chars[$v['uv']]))
 
111
  {
112
+ $id = $ttf->chars[$v['uv']];
113
+ $w = $ttf->glyphs[$id]['w'];
114
  $widths[$c] = round($k*$w);
115
  }
116
  else
117
+ Warning('Character '.$v['name'].' is missing');
118
  }
119
  }
120
  $info['Widths'] = $widths;
123
 
124
  function GetInfoFromType1($file, $embed, $map)
125
  {
126
+ // Return information from a Type1 font
127
  if($embed)
128
  {
129
  $f = fopen($file, 'rb');
191
 
192
  if(!isset($info['FontName']))
193
  Error('FontName missing in AFM file');
194
+ if(!isset($info['Ascender']))
195
+ $info['Ascender'] = $info['FontBBox'][3];
196
+ if(!isset($info['Descender']))
197
+ $info['Descender'] = $info['FontBBox'][1];
198
  $info['Bold'] = isset($info['Weight']) && preg_match('/bold|black/i', $info['Weight']);
199
  if(isset($cw['.notdef']))
200
  $info['MissingWidth'] = $cw['.notdef'];
201
  else
202
  $info['MissingWidth'] = 0;
203
  $widths = array_fill(0, 256, $info['MissingWidth']);
204
+ foreach($map as $c=>$v)
205
  {
206
+ if($v['name']!='.notdef')
 
207
  {
208
+ if(isset($cw[$v['name']]))
209
+ $widths[$c] = $cw[$v['name']];
210
  else
211
+ Warning('Character '.$v['name'].' is missing');
212
  }
213
  }
214
  $info['Widths'] = $widths;
294
  return rtrim($s);
295
  }
296
 
297
+ function MakeUnicodeArray($map)
298
+ {
299
+ // Build mapping to Unicode values
300
+ $ranges = array();
301
+ foreach($map as $c=>$v)
302
+ {
303
+ $uv = $v['uv'];
304
+ if($uv!=-1)
305
+ {
306
+ if(isset($range))
307
+ {
308
+ if($c==$range[1]+1 && $uv==$range[3]+1)
309
+ {
310
+ $range[1]++;
311
+ $range[3]++;
312
+ }
313
+ else
314
+ {
315
+ $ranges[] = $range;
316
+ $range = array($c, $c, $uv, $uv);
317
+ }
318
+ }
319
+ else
320
+ $range = array($c, $c, $uv, $uv);
321
+ }
322
+ }
323
+ $ranges[] = $range;
324
+
325
+ foreach($ranges as $range)
326
+ {
327
+ if(isset($s))
328
+ $s .= ',';
329
+ else
330
+ $s = 'array(';
331
+ $s .= $range[0].'=>';
332
+ $nb = $range[1]-$range[0]+1;
333
+ if($nb>1)
334
+ $s .= 'array('.$range[2].','.$nb.')';
335
+ else
336
+ $s .= $range[2];
337
+ }
338
+ $s .= ')';
339
+ return $s;
340
+ }
341
+
342
  function SaveToFile($file, $s, $mode)
343
  {
344
  $f = fopen($file, 'w'.$mode);
345
  if(!$f)
346
  Error('Can\'t write to file '.$file);
347
+ fwrite($f, $s);
348
  fclose($f);
349
  }
350
 
351
+ function MakeDefinitionFile($file, $type, $enc, $embed, $subset, $map, $info)
352
  {
353
  $s = "<?php\n";
354
  $s .= '$type = \''.$type."';\n";
361
  $diff = MakeFontEncoding($map);
362
  if($diff)
363
  $s .= '$diff = \''.$diff."';\n";
364
+ $s .= '$uv = '.MakeUnicodeArray($map).";\n";
365
  if($embed)
366
  {
367
  $s .= '$file = \''.$info['File']."';\n";
371
  $s .= '$size2 = '.$info['Size2'].";\n";
372
  }
373
  else
374
+ {
375
  $s .= '$originalsize = '.$info['OriginalSize'].";\n";
376
+ if($subset)
377
+ $s .= "\$subsetted = true;\n";
378
+ }
379
  }
380
  $s .= "?>\n";
381
  SaveToFile($file, $s, 't');
382
  }
383
 
384
+ function MakeFont($fontfile, $enc='cp1252', $embed=true, $subset=true)
385
  {
386
  // Generate a font definition file
 
 
 
 
387
  if(!file_exists($fontfile))
388
  Error('Font file not found: '.$fontfile);
389
  $ext = strtolower(substr($fontfile,-3));
397
  $map = LoadMap($enc);
398
 
399
  if($type=='TrueType')
400
+ $info = GetInfoFromTrueType($fontfile, $embed, $subset, $map);
401
  else
402
  $info = GetInfoFromType1($fontfile, $embed, $map);
403
 
414
  else
415
  {
416
  $info['File'] = basename($fontfile);
417
+ $subset = false;
418
  Notice('Font file could not be compressed (zlib extension not available)');
419
  }
420
  }
421
 
422
+ MakeDefinitionFile($basename.'.php', $type, $enc, $embed, $subset, $map, $info);
423
  Message('Font definition file generated: '.$basename.'.php');
424
  }
425
 
426
  if(PHP_SAPI=='cli')
427
  {
428
  // Command-line interface
429
+ ini_set('log_errors', '0');
430
  if($argc==1)
431
+ die("Usage: php makefont.php fontfile [encoding] [embed] [subset]\n");
432
  $fontfile = $argv[1];
433
  if($argc>=3)
434
  $enc = $argv[2];
438
  $embed = ($argv[3]=='true' || $argv[3]=='1');
439
  else
440
  $embed = true;
441
+ if($argc>=5)
442
+ $subset = ($argv[4]=='true' || $argv[4]=='1');
443
+ else
444
+ $subset = true;
445
+ MakeFont($fontfile, $enc, $embed, $subset);
446
  }
447
  ?>
FPDF/makefont/ttfparser.php CHANGED
@@ -1,39 +1,67 @@
1
  <?php
2
  /*******************************************************************************
3
- * Utility to parse TTF font files *
4
  * *
5
- * Version: 1.0 *
6
- * Date: 2011-06-18 *
7
  * Author: Olivier PLATHEY *
8
  *******************************************************************************/
9
 
10
  class TTFParser
11
  {
12
- var $f;
13
- var $tables;
14
- var $unitsPerEm;
15
- var $xMin, $yMin, $xMax, $yMax;
16
- var $numberOfHMetrics;
17
- var $numGlyphs;
18
- var $widths;
19
- var $chars;
20
- var $postScriptName;
21
- var $Embeddable;
22
- var $Bold;
23
- var $typoAscender;
24
- var $typoDescender;
25
- var $capHeight;
26
- var $italicAngle;
27
- var $underlinePosition;
28
- var $underlineThickness;
29
- var $isFixedPitch;
30
-
31
- function Parse($file)
 
 
 
 
32
  {
33
  $this->f = fopen($file, 'rb');
34
  if(!$this->f)
35
  $this->Error('Can\'t open file: '.$file);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
 
 
 
37
  $version = $this->Read(4);
38
  if($version=='OTTO')
39
  $this->Error('OpenType fonts based on PostScript outlines are not supported');
@@ -45,23 +73,12 @@ class TTFParser
45
  for($i=0;$i<$numTables;$i++)
46
  {
47
  $tag = $this->Read(4);
48
- $this->Skip(4); // checkSum
49
  $offset = $this->ReadULong();
50
- $this->Skip(4); // length
51
- $this->tables[$tag] = $offset;
52
  }
53
-
54
- $this->ParseHead();
55
- $this->ParseHhea();
56
- $this->ParseMaxp();
57
- $this->ParseHmtx();
58
- $this->ParseCmap();
59
- $this->ParseName();
60
- $this->ParseOS2();
61
- $this->ParsePost();
62
-
63
- fclose($this->f);
64
- }
65
 
66
  function ParseHead()
67
  {
@@ -77,6 +94,8 @@ class TTFParser
77
  $this->yMin = $this->ReadShort();
78
  $this->xMax = $this->ReadShort();
79
  $this->yMax = $this->ReadShort();
 
 
80
  }
81
 
82
  function ParseHhea()
@@ -96,17 +115,79 @@ class TTFParser
96
  function ParseHmtx()
97
  {
98
  $this->Seek('hmtx');
99
- $this->widths = array();
100
  for($i=0;$i<$this->numberOfHMetrics;$i++)
101
  {
102
  $advanceWidth = $this->ReadUShort();
103
- $this->Skip(2); // lsb
104
- $this->widths[$i] = $advanceWidth;
105
  }
106
- if($this->numberOfHMetrics<$this->numGlyphs)
107
  {
108
- $lastWidth = $this->widths[$this->numberOfHMetrics-1];
109
- $this->widths = array_pad($this->widths, $this->numGlyphs, $lastWidth);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
110
  }
111
  }
112
 
@@ -132,7 +213,7 @@ class TTFParser
132
  $idDelta = array();
133
  $idRangeOffset = array();
134
  $this->chars = array();
135
- fseek($this->f, $this->tables['cmap']+$offset31, SEEK_SET);
136
  $format = $this->ReadUShort();
137
  if($format!=4)
138
  $this->Error('Unexpected subtable format: '.$format);
@@ -181,7 +262,7 @@ class TTFParser
181
  function ParseName()
182
  {
183
  $this->Seek('name');
184
- $tableOffset = ftell($this->f);
185
  $this->postScriptName = '';
186
  $this->Skip(2); // format
187
  $count = $this->ReadUShort();
@@ -213,10 +294,10 @@ class TTFParser
213
  $version = $this->ReadUShort();
214
  $this->Skip(3*2); // xAvgCharWidth, usWeightClass, usWidthClass
215
  $fsType = $this->ReadUShort();
216
- $this->Embeddable = ($fsType!=2) && ($fsType & 0x200)==0;
217
  $this->Skip(11*2+10+4*4+4);
218
  $fsSelection = $this->ReadUShort();
219
- $this->Bold = ($fsSelection & 32)!=0;
220
  $this->Skip(2*2); // usFirstCharIndex, usLastCharIndex
221
  $this->typoAscender = $this->ReadShort();
222
  $this->typoDescender = $this->ReadShort();
@@ -232,27 +313,362 @@ class TTFParser
232
  function ParsePost()
233
  {
234
  $this->Seek('post');
235
- $this->Skip(4); // version
236
  $this->italicAngle = $this->ReadShort();
237
  $this->Skip(2); // Skip decimal part
238
  $this->underlinePosition = $this->ReadShort();
239
  $this->underlineThickness = $this->ReadShort();
240
  $this->isFixedPitch = ($this->ReadULong()!=0);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
241
  }
242
 
243
- function Error($msg)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
244
  {
245
- if(PHP_SAPI=='cli')
246
- die("Error: $msg\n");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
247
  else
248
- die("<b>Error</b>: $msg");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
249
  }
250
 
251
  function Seek($tag)
252
  {
253
  if(!isset($this->tables[$tag]))
254
  $this->Error('Table not found: '.$tag);
255
- fseek($this->f, $this->tables[$tag], SEEK_SET);
256
  }
257
 
258
  function Skip($n)
@@ -262,7 +678,7 @@ class TTFParser
262
 
263
  function Read($n)
264
  {
265
- return fread($this->f, $n);
266
  }
267
 
268
  function ReadUShort()
@@ -285,5 +701,23 @@ class TTFParser
285
  $a = unpack('NN', fread($this->f,4));
286
  return $a['N'];
287
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
288
  }
289
  ?>
1
  <?php
2
  /*******************************************************************************
3
+ * Class to parse and subset TrueType fonts *
4
  * *
5
+ * Version: 1.1 *
6
+ * Date: 2015-11-29 *
7
  * Author: Olivier PLATHEY *
8
  *******************************************************************************/
9
 
10
  class TTFParser
11
  {
12
+ protected $f;
13
+ protected $tables;
14
+ protected $numberOfHMetrics;
15
+ protected $numGlyphs;
16
+ protected $glyphNames;
17
+ protected $indexToLocFormat;
18
+ protected $subsettedChars;
19
+ protected $subsettedGlyphs;
20
+ public $chars;
21
+ public $glyphs;
22
+ public $unitsPerEm;
23
+ public $xMin, $yMin, $xMax, $yMax;
24
+ public $postScriptName;
25
+ public $embeddable;
26
+ public $bold;
27
+ public $typoAscender;
28
+ public $typoDescender;
29
+ public $capHeight;
30
+ public $italicAngle;
31
+ public $underlinePosition;
32
+ public $underlineThickness;
33
+ public $isFixedPitch;
34
+
35
+ function __construct($file)
36
  {
37
  $this->f = fopen($file, 'rb');
38
  if(!$this->f)
39
  $this->Error('Can\'t open file: '.$file);
40
+ }
41
+
42
+ function __destruct()
43
+ {
44
+ if(is_resource($this->f))
45
+ fclose($this->f);
46
+ }
47
+
48
+ function Parse()
49
+ {
50
+ $this->ParseOffsetTable();
51
+ $this->ParseHead();
52
+ $this->ParseHhea();
53
+ $this->ParseMaxp();
54
+ $this->ParseHmtx();
55
+ $this->ParseLoca();
56
+ $this->ParseGlyf();
57
+ $this->ParseCmap();
58
+ $this->ParseName();
59
+ $this->ParseOS2();
60
+ $this->ParsePost();
61
+ }
62
 
63
+ function ParseOffsetTable()
64
+ {
65
  $version = $this->Read(4);
66
  if($version=='OTTO')
67
  $this->Error('OpenType fonts based on PostScript outlines are not supported');
73
  for($i=0;$i<$numTables;$i++)
74
  {
75
  $tag = $this->Read(4);
76
+ $checkSum = $this->Read(4);
77
  $offset = $this->ReadULong();
78
+ $length = $this->ReadULong(4);
79
+ $this->tables[$tag] = array('offset'=>$offset, 'length'=>$length, 'checkSum'=>$checkSum);
80
  }
81
+ }
 
 
 
 
 
 
 
 
 
 
 
82
 
83
  function ParseHead()
84
  {
94
  $this->yMin = $this->ReadShort();
95
  $this->xMax = $this->ReadShort();
96
  $this->yMax = $this->ReadShort();
97
+ $this->Skip(3*2); // macStyle, lowestRecPPEM, fontDirectionHint
98
+ $this->indexToLocFormat = $this->ReadShort();
99
  }
100
 
101
  function ParseHhea()
115
  function ParseHmtx()
116
  {
117
  $this->Seek('hmtx');
118
+ $this->glyphs = array();
119
  for($i=0;$i<$this->numberOfHMetrics;$i++)
120
  {
121
  $advanceWidth = $this->ReadUShort();
122
+ $lsb = $this->ReadShort();
123
+ $this->glyphs[$i] = array('w'=>$advanceWidth, 'lsb'=>$lsb);
124
  }
125
+ for($i=$this->numberOfHMetrics;$i<$this->numGlyphs;$i++)
126
  {
127
+ $lsb = $this->ReadShort();
128
+ $this->glyphs[$i] = array('w'=>$advanceWidth, 'lsb'=>$lsb);
129
+ }
130
+ }
131
+
132
+ function ParseLoca()
133
+ {
134
+ $this->Seek('loca');
135
+ $offsets = array();
136
+ if($this->indexToLocFormat==0)
137
+ {
138
+ // Short format
139
+ for($i=0;$i<=$this->numGlyphs;$i++)
140
+ $offsets[] = 2*$this->ReadUShort();
141
+ }
142
+ else
143
+ {
144
+ // Long format
145
+ for($i=0;$i<=$this->numGlyphs;$i++)
146
+ $offsets[] = $this->ReadULong();
147
+ }
148
+ for($i=0;$i<$this->numGlyphs;$i++)
149
+ {
150
+ $this->glyphs[$i]['offset'] = $offsets[$i];
151
+ $this->glyphs[$i]['length'] = $offsets[$i+1] - $offsets[$i];
152
+ }
153
+ }
154
+
155
+ function ParseGlyf()
156
+ {
157
+ $tableOffset = $this->tables['glyf']['offset'];
158
+ foreach($this->glyphs as &$glyph)
159
+ {
160
+ if($glyph['length']>0)
161
+ {
162
+ fseek($this->f, $tableOffset+$glyph['offset'], SEEK_SET);
163
+ if($this->ReadShort()<0)
164
+ {
165
+ // Composite glyph
166
+ $this->Skip(4*2); // xMin, yMin, xMax, yMax
167
+ $offset = 5*2;
168
+ $a = array();
169
+ do
170
+ {
171
+ $flags = $this->ReadUShort();
172
+ $index = $this->ReadUShort();
173
+ $a[$offset+2] = $index;
174
+ if($flags & 1) // ARG_1_AND_2_ARE_WORDS
175
+ $skip = 2*2;
176
+ else
177
+ $skip = 2;
178
+ if($flags & 8) // WE_HAVE_A_SCALE
179
+ $skip += 2;
180
+ elseif($flags & 64) // WE_HAVE_AN_X_AND_Y_SCALE
181
+ $skip += 2*2;
182
+ elseif($flags & 128) // WE_HAVE_A_TWO_BY_TWO
183
+ $skip += 4*2;
184
+ $this->Skip($skip);
185
+ $offset += 2*2 + $skip;
186
+ }
187
+ while($flags & 32); // MORE_COMPONENTS
188
+ $glyph['components'] = $a;
189
+ }
190
+ }
191
  }
192
  }
193
 
213
  $idDelta = array();
214
  $idRangeOffset = array();
215
  $this->chars = array();
216
+ fseek($this->f, $this->tables['cmap']['offset']+$offset31, SEEK_SET);
217
  $format = $this->ReadUShort();
218
  if($format!=4)
219
  $this->Error('Unexpected subtable format: '.$format);
262
  function ParseName()
263
  {
264
  $this->Seek('name');
265
+ $tableOffset = $this->tables['name']['offset'];
266
  $this->postScriptName = '';
267
  $this->Skip(2); // format
268
  $count = $this->ReadUShort();
294
  $version = $this->ReadUShort();
295
  $this->Skip(3*2); // xAvgCharWidth, usWeightClass, usWidthClass
296
  $fsType = $this->ReadUShort();
297
+ $this->embeddable = ($fsType!=2) && ($fsType & 0x200)==0;
298
  $this->Skip(11*2+10+4*4+4);
299
  $fsSelection = $this->ReadUShort();
300
+ $this->bold = ($fsSelection & 32)!=0;
301
  $this->Skip(2*2); // usFirstCharIndex, usLastCharIndex
302
  $this->typoAscender = $this->ReadShort();
303
  $this->typoDescender = $this->ReadShort();
313
  function ParsePost()
314
  {
315
  $this->Seek('post');
316
+ $version = $this->ReadULong();
317
  $this->italicAngle = $this->ReadShort();
318
  $this->Skip(2); // Skip decimal part
319
  $this->underlinePosition = $this->ReadShort();
320
  $this->underlineThickness = $this->ReadShort();
321
  $this->isFixedPitch = ($this->ReadULong()!=0);
322
+ if($version==0x20000)
323
+ {
324
+ // Extract glyph names
325
+ $this->Skip(4*4); // min/max usage
326
+ $this->Skip(2); // numberOfGlyphs
327
+ $glyphNameIndex = array();
328
+ $names = array();
329
+ $numNames = 0;
330
+ for($i=0;$i<$this->numGlyphs;$i++)
331
+ {
332
+ $index = $this->ReadUShort();
333
+ $glyphNameIndex[] = $index;
334
+ if($index>=258 && $index-257>$numNames)
335
+ $numNames = $index-257;
336
+ }
337
+ for($i=0;$i<$numNames;$i++)
338
+ {
339
+ $len = ord($this->Read(1));
340
+ $names[] = $this->Read($len);
341
+ }
342
+ foreach($glyphNameIndex as $i=>$index)
343
+ {
344
+ if($index>=258)
345
+ $this->glyphs[$i]['name'] = $names[$index-258];
346
+ else
347
+ $this->glyphs[$i]['name'] = $index;
348
+ }
349
+ $this->glyphNames = true;
350
+ }
351
+ else
352
+ $this->glyphNames = false;
353
  }
354
 
355
+ function Subset($chars)
356
+ {
357
+ /* $chars = array_keys($this->chars);
358
+ $this->subsettedChars = $chars;
359
+ $this->subsettedGlyphs = array();
360
+ for($i=0;$i<$this->numGlyphs;$i++)
361
+ {
362
+ $this->subsettedGlyphs[] = $i;
363
+ $this->glyphs[$i]['ssid'] = $i;
364
+ }*/
365
+
366
+ $this->AddGlyph(0);
367
+ $this->subsettedChars = array();
368
+ foreach($chars as $char)
369
+ {
370
+ if(isset($this->chars[$char]))
371
+ {
372
+ $this->subsettedChars[] = $char;
373
+ $this->AddGlyph($this->chars[$char]);
374
+ }
375
+ }
376
+ }
377
+
378
+ function AddGlyph($id)
379
  {
380
+ if(!isset($this->glyphs[$id]['ssid']))
381
+ {
382
+ $this->glyphs[$id]['ssid'] = count($this->subsettedGlyphs);
383
+ $this->subsettedGlyphs[] = $id;
384
+ if(isset($this->glyphs[$id]['components']))
385
+ {
386
+ foreach($this->glyphs[$id]['components'] as $cid)
387
+ $this->AddGlyph($cid);
388
+ }
389
+ }
390
+ }
391
+
392
+ function Build()
393
+ {
394
+ $this->BuildCmap();
395
+ $this->BuildHhea();
396
+ $this->BuildHmtx();
397
+ $this->BuildLoca();
398
+ $this->BuildGlyf();
399
+ $this->BuildMaxp();
400
+ $this->BuildPost();
401
+ return $this->BuildFont();
402
+ }
403
+
404
+ function BuildCmap()
405
+ {
406
+ if(!isset($this->subsettedChars))
407
+ return;
408
+
409
+ // Divide charset in contiguous segments
410
+ $chars = $this->subsettedChars;
411
+ sort($chars);
412
+ $segments = array();
413
+ $segment = array($chars[0], $chars[0]);
414
+ for($i=1;$i<count($chars);$i++)
415
+ {
416
+ if($chars[$i]>$segment[1]+1)
417
+ {
418
+ $segments[] = $segment;
419
+ $segment = array($chars[$i], $chars[$i]);
420
+ }
421
+ else
422
+ $segment[1]++;
423
+ }
424
+ $segments[] = $segment;
425
+ $segments[] = array(0xFFFF, 0xFFFF);
426
+ $segCount = count($segments);
427
+
428
+ // Build a Format 4 subtable
429
+ $startCount = array();
430
+ $endCount = array();
431
+ $idDelta = array();
432
+ $idRangeOffset = array();
433
+ $glyphIdArray = '';
434
+ for($i=0;$i<$segCount;$i++)
435
+ {
436
+ list($start, $end) = $segments[$i];
437
+ $startCount[] = $start;
438
+ $endCount[] = $end;
439
+ if($start!=$end)
440
+ {
441
+ // Segment with multiple chars
442
+ $idDelta[] = 0;
443
+ $idRangeOffset[] = strlen($glyphIdArray) + ($segCount-$i)*2;
444
+ for($c=$start;$c<=$end;$c++)
445
+ {
446
+ $ssid = $this->glyphs[$this->chars[$c]]['ssid'];
447
+ $glyphIdArray .= pack('n', $ssid);
448
+ }
449
+ }
450
+ else
451
+ {
452
+ // Segment with a single char
453
+ if($start<0xFFFF)
454
+ $ssid = $this->glyphs[$this->chars[$start]]['ssid'];
455
+ else
456
+ $ssid = 0;
457
+ $idDelta[] = $ssid - $start;
458
+ $idRangeOffset[] = 0;
459
+ }
460
+ }
461
+ $entrySelector = 0;
462
+ $n = $segCount;
463
+ while($n!=1)
464
+ {
465
+ $n = $n>>1;
466
+ $entrySelector++;
467
+ }
468
+ $searchRange = (1<<$entrySelector)*2;
469
+ $rangeShift = 2*$segCount - $searchRange;
470
+ $cmap = pack('nnnn', 2*$segCount, $searchRange, $entrySelector, $rangeShift);
471
+ foreach($endCount as $val)
472
+ $cmap .= pack('n', $val);
473
+ $cmap .= pack('n', 0); // reservedPad
474
+ foreach($startCount as $val)
475
+ $cmap .= pack('n', $val);
476
+ foreach($idDelta as $val)
477
+ $cmap .= pack('n', $val);
478
+ foreach($idRangeOffset as $val)
479
+ $cmap .= pack('n', $val);
480
+ $cmap .= $glyphIdArray;
481
+
482
+ $data = pack('nn', 0, 1); // version, numTables
483
+ $data .= pack('nnN', 3, 1, 12); // platformID, encodingID, offset
484
+ $data .= pack('nnn', 4, 6+strlen($cmap), 0); // format, length, language
485
+ $data .= $cmap;
486
+ $this->SetTable('cmap', $data);
487
+ }
488
+
489
+ function BuildHhea()
490
+ {
491
+ $this->LoadTable('hhea');
492
+ $numberOfHMetrics = count($this->subsettedGlyphs);
493
+ $data = substr_replace($this->tables['hhea']['data'], pack('n',$numberOfHMetrics), 4+15*2, 2);
494
+ $this->SetTable('hhea', $data);
495
+ }
496
+
497
+ function BuildHmtx()
498
+ {
499
+ $data = '';
500
+ foreach($this->subsettedGlyphs as $id)
501
+ {
502
+ $glyph = $this->glyphs[$id];
503
+ $data .= pack('nn', $glyph['w'], $glyph['lsb']);
504
+ }
505
+ $this->SetTable('hmtx', $data);
506
+ }
507
+
508
+ function BuildLoca()
509
+ {
510
+ $data = '';
511
+ $offset = 0;
512
+ foreach($this->subsettedGlyphs as $id)
513
+ {
514
+ if($this->indexToLocFormat==0)
515
+ $data .= pack('n', $offset/2);
516
+ else
517
+ $data .= pack('N', $offset);
518
+ $offset += $this->glyphs[$id]['length'];
519
+ }
520
+ if($this->indexToLocFormat==0)
521
+ $data .= pack('n', $offset/2);
522
+ else
523
+ $data .= pack('N', $offset);
524
+ $this->SetTable('loca', $data);
525
+ }
526
+
527
+ function BuildGlyf()
528
+ {
529
+ $tableOffset = $this->tables['glyf']['offset'];
530
+ $data = '';
531
+ foreach($this->subsettedGlyphs as $id)
532
+ {
533
+ $glyph = $this->glyphs[$id];
534
+ fseek($this->f, $tableOffset+$glyph['offset'], SEEK_SET);
535
+ $glyph_data = $this->Read($glyph['length']);
536
+ if(isset($glyph['components']))
537
+ {
538
+ // Composite glyph
539
+ foreach($glyph['components'] as $offset=>$cid)
540
+ {
541
+ $ssid = $this->glyphs[$cid]['ssid'];
542
+ $glyph_data = substr_replace($glyph_data, pack('n',$ssid), $offset, 2);
543
+ }
544
+ }
545
+ $data .= $glyph_data;
546
+ }
547
+ $this->SetTable('glyf', $data);
548
+ }
549
+
550
+ function BuildMaxp()
551
+ {
552
+ $this->LoadTable('maxp');
553
+ $numGlyphs = count($this->subsettedGlyphs);
554
+ $data = substr_replace($this->tables['maxp']['data'], pack('n',$numGlyphs), 4, 2);
555
+ $this->SetTable('maxp', $data);
556
+ }
557
+
558
+ function BuildPost()
559
+ {
560
+ $this->Seek('post');
561
+ if($this->glyphNames)
562
+ {
563
+ // Version 2.0
564
+ $numberOfGlyphs = count($this->subsettedGlyphs);
565
+ $numNames = 0;
566
+ $names = '';
567
+ $data = $this->Read(2*4+2*2+5*4);
568
+ $data .= pack('n', $numberOfGlyphs);
569
+ foreach($this->subsettedGlyphs as $id)
570
+ {
571
+ $name = $this->glyphs[$id]['name'];
572
+ if(is_string($name))
573
+ {
574
+ $data .= pack('n', 258+$numNames);
575
+ $names .= chr(strlen($name)).$name;
576
+ $numNames++;
577
+ }
578
+ else
579
+ $data .= pack('n', $name);
580
+ }
581
+ $data .= $names;
582
+ }
583
  else
584
+ {
585
+ // Version 3.0
586
+ $this->Skip(4);
587
+ $data = "\x00\x03\x00\x00";
588
+ $data .= $this->Read(4+2*2+5*4);
589
+ }
590
+ $this->SetTable('post', $data);
591
+ }
592
+
593
+ function BuildFont()
594
+ {
595
+ $tags = array();
596
+ foreach(array('cmap', 'cvt ', 'fpgm', 'glyf', 'head', 'hhea', 'hmtx', 'loca', 'maxp', 'name', 'post', 'prep') as $tag)
597
+ {
598
+ if(isset($this->tables[$tag]))
599
+ $tags[] = $tag;
600
+ }
601
+ $numTables = count($tags);
602
+ $offset = 12 + 16*$numTables;
603
+ foreach($tags as $tag)
604
+ {
605
+ if(!isset($this->tables[$tag]['data']))
606
+ $this->LoadTable($tag);
607
+ $this->tables[$tag]['offset'] = $offset;
608
+ $offset += strlen($this->tables[$tag]['data']);
609
+ }
610
+ // $this->tables['head']['data'] = substr_replace($this->tables['head']['data'], "\x00\x00\x00\x00", 8, 4);
611
+
612
+ // Build offset table
613
+ $entrySelector = 0;
614
+ $n = $numTables;
615
+ while($n!=1)
616
+ {
617
+ $n = $n>>1;
618
+ $entrySelector++;
619
+ }
620
+ $searchRange = 16*(1<<$entrySelector);
621
+ $rangeShift = 16*$numTables - $searchRange;
622
+ $offsetTable = pack('nnnnnn', 1, 0, $numTables, $searchRange, $entrySelector, $rangeShift);
623
+ foreach($tags as $tag)
624
+ {
625
+ $table = $this->tables[$tag];
626
+ $offsetTable .= $tag.$table['checkSum'].pack('NN', $table['offset'], $table['length']);
627
+ }
628
+
629
+ // Compute checkSumAdjustment (0xB1B0AFBA - font checkSum)
630
+ $s = $this->CheckSum($offsetTable);
631
+ foreach($tags as $tag)
632
+ $s .= $this->tables[$tag]['checkSum'];
633
+ $a = unpack('n2', $this->CheckSum($s));
634
+ $high = 0xB1B0 + ($a[1]^0xFFFF);
635
+ $low = 0xAFBA + ($a[2]^0xFFFF) + 1;
636
+ $checkSumAdjustment = pack('nn', $high+($low>>16), $low);
637
+ $this->tables['head']['data'] = substr_replace($this->tables['head']['data'], $checkSumAdjustment, 8, 4);
638
+
639
+ $font = $offsetTable;
640
+ foreach($tags as $tag)
641
+ $font .= $this->tables[$tag]['data'];
642
+
643
+ return $font;
644
+ }
645
+
646
+ function LoadTable($tag)
647
+ {
648
+ $this->Seek($tag);
649
+ $length = $this->tables[$tag]['length'];
650
+ $n = $length % 4;
651
+ if($n>0)
652
+ $length += 4 - $n;
653
+ $this->tables[$tag]['data'] = $this->Read($length);
654
+ }
655
+
656
+ function SetTable($tag, $data)
657
+ {
658
+ $length = strlen($data);
659
+ $n = $length % 4;
660
+ if($n>0)
661
+ $data = str_pad($data, $length+4-$n, "\x00");
662
+ $this->tables[$tag]['data'] = $data;
663
+ $this->tables[$tag]['length'] = $length;
664
+ $this->tables[$tag]['checkSum'] = $this->CheckSum($data);
665
  }
666
 
667
  function Seek($tag)
668
  {
669
  if(!isset($this->tables[$tag]))
670
  $this->Error('Table not found: '.$tag);
671
+ fseek($this->f, $this->tables[$tag]['offset'], SEEK_SET);
672
  }
673
 
674
  function Skip($n)
678
 
679
  function Read($n)
680
  {
681
+ return $n>0 ? fread($this->f, $n) : '';
682
  }
683
 
684
  function ReadUShort()
701
  $a = unpack('NN', fread($this->f,4));
702
  return $a['N'];
703
  }
704
+
705
+ function CheckSum($s)
706
+ {
707
+ $n = strlen($s);
708
+ $high = 0;
709
+ $low = 0;
710
+ for($i=0;$i<$n;$i+=4)
711
+ {
712
+ $high += (ord($s[$i])<<8) + ord($s[$i+1]);
713
+ $low += (ord($s[$i+2])<<8) + ord($s[$i+3]);
714
+ }
715
+ return pack('nn', $high+($low>>16), $low);
716
+ }
717
+
718
+ function Error($msg)
719
+ {
720
+ throw new Exception($msg);
721
+ }
722
  }
723
  ?>
FPDF/tutorial/calligra.php CHANGED
@@ -18,6 +18,8 @@ $cw = array(
18
  chr(220)=>805,chr(221)=>0,chr(222)=>0,chr(223)=>688,chr(224)=>581,chr(225)=>581,chr(226)=>581,chr(227)=>581,chr(228)=>581,chr(229)=>581,chr(230)=>792,chr(231)=>440,chr(232)=>450,chr(233)=>450,chr(234)=>450,chr(235)=>450,chr(236)=>283,chr(237)=>283,chr(238)=>283,chr(239)=>283,chr(240)=>0,chr(241)=>595,
19
  chr(242)=>508,chr(243)=>508,chr(244)=>508,chr(245)=>508,chr(246)=>508,chr(247)=>0,chr(248)=>508,chr(249)=>614,chr(250)=>614,chr(251)=>614,chr(252)=>614,chr(253)=>0,chr(254)=>0,chr(255)=>597);
20
  $enc = 'cp1252';
 
21
  $file = 'calligra.z';
22
- $originalsize = 40120;
 
23
  ?>
18
  chr(220)=>805,chr(221)=>0,chr(222)=>0,chr(223)=>688,chr(224)=>581,chr(225)=>581,chr(226)=>581,chr(227)=>581,chr(228)=>581,chr(229)=>581,chr(230)=>792,chr(231)=>440,chr(232)=>450,chr(233)=>450,chr(234)=>450,chr(235)=>450,chr(236)=>283,chr(237)=>283,chr(238)=>283,chr(239)=>283,chr(240)=>0,chr(241)=>595,
19
  chr(242)=>508,chr(243)=>508,chr(244)=>508,chr(245)=>508,chr(246)=>508,chr(247)=>0,chr(248)=>508,chr(249)=>614,chr(250)=>614,chr(251)=>614,chr(252)=>614,chr(253)=>0,chr(254)=>0,chr(255)=>597);
20
  $enc = 'cp1252';
21
+ $uv = array(0=>array(0,128),128=>8364,130=>8218,131=>402,132=>8222,133=>8230,134=>array(8224,2),136=>710,137=>8240,138=>352,139=>8249,140=>338,142=>381,145=>array(8216,2),147=>array(8220,2),149=>8226,150=>array(8211,2),152=>732,153=>8482,154=>353,155=>8250,156=>339,158=>382,159=>376,160=>array(160,96));
22
  $file = 'calligra.z';
23
+ $originalsize = 33948;
24
+ $subsetted = true;
25
  ?>
FPDF/tutorial/calligra.z CHANGED
Binary file
FPDF/tutorial/index.htm CHANGED
@@ -14,7 +14,7 @@
14
  <li><a href="tuto4.htm">Tutorial 4</a>: Multi-columns</li>
15
  <li><a href="tuto5.htm">Tutorial 5</a>: Tables</li>
16
  <li><a href="tuto6.htm">Tutorial 6</a>: Links and flowing text</li>
17
- <li><a href="tuto7.htm">Tutorial 7</a>: Adding new fonts and encoding support</li>
18
- </UL>
19
  </body>
20
  </html>
14
  <li><a href="tuto4.htm">Tutorial 4</a>: Multi-columns</li>
15
  <li><a href="tuto5.htm">Tutorial 5</a>: Tables</li>
16
  <li><a href="tuto6.htm">Tutorial 6</a>: Links and flowing text</li>
17
+ <li><a href="tuto7.htm">Tutorial 7</a>: Adding new fonts and encodings</li>
18
+ </ul>
19
  </body>
20
  </html>
FPDF/tutorial/tuto1.htm CHANGED
@@ -21,7 +21,7 @@ Let's start with the classic example:
21
  </div>
22
  <p class='demo'><a href='tuto1.php' target='_blank' class='demo'>[Demo]</a></p>
23
  After including the library file, we create an FPDF object.
24
- The <a href='../doc/fpdf.htm'>FPDF()</a> constructor is used here with the default values: pages are in A4 portrait and
25
  the unit of measure is millimeter. It could have been specified explicitly with:
26
  <div class="source">
27
  <pre><code>$pdf <span class="kw">= new </span>FPDF<span class="kw">(</span><span class="str">'P'</span><span class="kw">,</span><span class="str">'mm'</span><span class="kw">,</span><span class="str">'A4'</span><span class="kw">);
@@ -36,8 +36,8 @@ is at the upper-left corner and the current position is by default set at 1 cm f
36
  borders; the margins can be changed with <a href='../doc/setmargins.htm'>SetMargins()</a>.
37
  <br>
38
  <br>
39
- Before we can print text, it's mandatory to select a font with <a href='../doc/setfont.htm'>SetFont()</a>, otherwise the
40
- document would be invalid. We choose Arial bold 16:
41
  <div class="source">
42
  <pre><code>$pdf<span class="kw">-&gt;</span>SetFont<span class="kw">(</span><span class="str">'Arial'</span><span class="kw">,</span><span class="str">'B'</span><span class="kw">,</span>16<span class="kw">);
43
  </span></code></pre>
@@ -65,7 +65,7 @@ the height of the break.
65
  <br>
66
  <br>
67
  Finally, the document is closed and sent to the browser with <a href='../doc/output.htm'>Output()</a>. We could have saved
68
- it to a file by passing the desired file name.
69
  <br>
70
  <br>
71
  <strong>Caution:</strong> in case when the PDF is sent to the browser, nothing else must be output by the
21
  </div>
22
  <p class='demo'><a href='tuto1.php' target='_blank' class='demo'>[Demo]</a></p>
23
  After including the library file, we create an FPDF object.
24
+ The <a href='../doc/__construct.htm'>constructor</a> is used here with the default values: pages are in A4 portrait and
25
  the unit of measure is millimeter. It could have been specified explicitly with:
26
  <div class="source">
27
  <pre><code>$pdf <span class="kw">= new </span>FPDF<span class="kw">(</span><span class="str">'P'</span><span class="kw">,</span><span class="str">'mm'</span><span class="kw">,</span><span class="str">'A4'</span><span class="kw">);
36
  borders; the margins can be changed with <a href='../doc/setmargins.htm'>SetMargins()</a>.
37
  <br>
38
  <br>
39
+ Before we can print text, it's mandatory to select a font with <a href='../doc/setfont.htm'>SetFont()</a>.
40
+ We choose Arial bold 16:
41
  <div class="source">
42
  <pre><code>$pdf<span class="kw">-&gt;</span>SetFont<span class="kw">(</span><span class="str">'Arial'</span><span class="kw">,</span><span class="str">'B'</span><span class="kw">,</span>16<span class="kw">);
43
  </span></code></pre>
65
  <br>
66
  <br>
67
  Finally, the document is closed and sent to the browser with <a href='../doc/output.htm'>Output()</a>. We could have saved
68
+ it to a file by passing the appropriate parameters.
69
  <br>
70
  <br>
71
  <strong>Caution:</strong> in case when the PDF is sent to the browser, nothing else must be output by the
FPDF/tutorial/tuto4.htm CHANGED
@@ -15,12 +15,10 @@ columns.
15
 
16
  class </span>PDF <span class="kw">extends </span>FPDF
17
  <span class="kw">{
18
- </span><span class="cmt">// Current column
19
- </span><span class="kw">var </span>$col <span class="kw">= </span>0<span class="kw">;
20
- </span><span class="cmt">// Ordinate of column start
21
- </span><span class="kw">var </span>$y0<span class="kw">;
22
 
23
- function </span>Header<span class="kw">()
24
  {
25
  </span><span class="cmt">// Page header
26
  </span><span class="kw">global </span>$title<span class="kw">;
15
 
16
  class </span>PDF <span class="kw">extends </span>FPDF
17
  <span class="kw">{
18
+ protected </span>$col <span class="kw">= </span>0<span class="kw">; </span><span class="cmt">// Current column
19
+ </span><span class="kw">protected </span>$y0<span class="kw">; </span><span class="cmt">// Ordinate of column start
 
 
20
 
21
+ </span><span class="kw">function </span>Header<span class="kw">()
22
  {
23
  </span><span class="cmt">// Page header
24
  </span><span class="kw">global </span>$title<span class="kw">;
FPDF/tutorial/tuto4.php CHANGED
@@ -3,10 +3,8 @@ require('../fpdf.php');
3
 
4
  class PDF extends FPDF
5
  {
6
- // Current column
7
- var $col = 0;
8
- // Ordinate of column start
9
- var $y0;
10
 
11
  function Header()
12
  {
3
 
4
  class PDF extends FPDF
5
  {
6
+ protected $col = 0; // Current column
7
+ protected $y0; // Ordinate of column start
 
 
8
 
9
  function Header()
10
  {
FPDF/tutorial/tuto6.htm CHANGED
@@ -15,21 +15,10 @@ mode. It also contains a basic HTML parser.
15
 
16
  class </span>PDF <span class="kw">extends </span>FPDF
17
  <span class="kw">{
18
- var </span>$B<span class="kw">;
19
- var </span>$I<span class="kw">;
20
- var </span>$U<span class="kw">;
21
- var </span>$HREF<span class="kw">;
22
-
23
- function </span>PDF<span class="kw">(</span>$orientation<span class="kw">=</span><span class="str">'P'</span><span class="kw">, </span>$unit<span class="kw">=</span><span class="str">'mm'</span><span class="kw">, </span>$size<span class="kw">=</span><span class="str">'A4'</span><span class="kw">)
24
- {
25
- </span><span class="cmt">// Call parent constructor
26
- </span>$<span class="kw">this-&gt;</span>FPDF<span class="kw">(</span>$orientation<span class="kw">,</span>$unit<span class="kw">,</span>$size<span class="kw">);
27
- </span><span class="cmt">// Initialization
28
- </span>$<span class="kw">this-&gt;</span>B <span class="kw">= </span>0<span class="kw">;
29
- </span>$<span class="kw">this-&gt;</span>I <span class="kw">= </span>0<span class="kw">;
30
- </span>$<span class="kw">this-&gt;</span>U <span class="kw">= </span>0<span class="kw">;
31
- </span>$<span class="kw">this-&gt;</span>HREF <span class="kw">= </span><span class="str">''</span><span class="kw">;
32
- }
33
 
34
  function </span>WriteHTML<span class="kw">(</span>$html<span class="kw">)
35
  {
15
 
16
  class </span>PDF <span class="kw">extends </span>FPDF
17
  <span class="kw">{
18
+ protected </span>$B <span class="kw">= </span>0<span class="kw">;
19
+ protected </span>$I <span class="kw">= </span>0<span class="kw">;
20
+ protected </span>$U <span class="kw">= </span>0<span class="kw">;
21
+ protected </span>$HREF <span class="kw">= </span><span class="str">''</span><span class="kw">;
 
 
 
 
 
 
 
 
 
 
 
22
 
23
  function </span>WriteHTML<span class="kw">(</span>$html<span class="kw">)
24
  {
FPDF/tutorial/tuto6.php CHANGED
@@ -3,21 +3,10 @@ require('../fpdf.php');
3
 
4
  class PDF extends FPDF
5
  {
6
- var $B;
7
- var $I;
8
- var $U;
9
- var $HREF;
10
-
11
- function PDF($orientation='P', $unit='mm', $size='A4')
12
- {
13
- // Call parent constructor
14
- $this->FPDF($orientation,$unit,$size);
15
- // Initialization
16
- $this->B = 0;
17
- $this->I = 0;
18
- $this->U = 0;
19
- $this->HREF = '';
20
- }
21
 
22
  function WriteHTML($html)
23
  {
3
 
4
  class PDF extends FPDF
5
  {
6
+ protected $B = 0;
7
+ protected $I = 0;
8
+ protected $U = 0;
9
+ protected $HREF = '';
 
 
 
 
 
 
 
 
 
 
 
10
 
11
  function WriteHTML($html)
12
  {
FPDF/tutorial/tuto7.htm CHANGED
@@ -2,32 +2,18 @@
2
  <html>
3
  <head>
4
  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
5
- <title>Adding new fonts and encoding support</title>
6
  <link type="text/css" rel="stylesheet" href="../fpdf.css">
7
- <style type="text/css">
8
- table {border-collapse:collapse; border-style:solid; border-width:2px; border-color:#A0A0A0 #000000 #000000 #A0A0A0}
9
- table {margin:1.4em 0 1.4em 1em}
10
- th {background-color:#E0EBFF; color:#900000; text-align:left}
11
- th, td {border:1px solid #808080; padding:2px 10px}
12
- tr.alt0 {background-color:#FFFFEE}
13
- tr.alt1 {background-color:#FFFFE0}
14
- </style>
15
  </head>
16
  <body>
17
- <h1>Adding new fonts and encoding support</h1>
18
- This tutorial explains how to use TrueType, OpenType and Type1 fonts so that you are not limited to
19
- the standard fonts any more. The other benefit is that you can choose the font encoding, which allows
20
- you to use other languages than the Western ones (the standard fonts having too few available characters).
21
  <br>
22
  <br>
23
- Remark: for OpenType, only the format based on TrueType is supported (not the one based on Type1).
24
- <br>
25
- <br>
26
- There are two ways to use a new font: embedding it in the PDF or not. When a font is not
27
- embedded, it is searched in the system. The advantage is that the PDF file is lighter; on the other
28
- hand, if it's not available, a substitution font is used. So it's preferable to ensure that the
29
- needed font is installed on the client systems. If the file is to be viewed by a large audience,
30
- it's highly recommended to embed.
31
  <br>
32
  <br>
33
  Adding a new font requires two steps:
@@ -35,7 +21,6 @@ Adding a new font requires two steps:
35
  <li>Generation of the font definition file</li>
36
  <li>Declaration of the font in the script</li>
37
  </ul>
38
- For Type1, you need the corresponding AFM file. It's usually provided with the font.
39
 
40
  <h2>Generation of the font definition file</h2>
41
  The first step consists in generating a PHP file containing all the information needed by FPDF;
@@ -43,7 +28,7 @@ in addition, the font file is compressed. To do this, a helper script is provide
43
  directory of the package: makefont.php. It contains the following function:
44
  <br>
45
  <br>
46
- <code>MakeFont(<b>string</b> fontfile, [, <b>string</b> enc [, <b>boolean</b> embed]])</code>
47
  <dl class="param" style="margin-bottom:2em">
48
  <dt><code>fontfile</code></dt>
49
  <dd>
@@ -57,6 +42,10 @@ directory of the package: makefont.php. It contains the following function:
57
  <dd>
58
  <p>Whether to embed the font or not. Default value: <code>true</code>.</p>
59
  </dd>
 
 
 
 
60
  </dl>
61
  The first parameter is the name of the font file. The extension must be either .ttf, .otf or .pfb and
62
  determines the font type. If your Type1 font is in ASCII format (.pfa), you can convert it to binary
@@ -91,10 +80,19 @@ files. The available ones are:
91
  <li>KOI8-R (Russian)</li>
92
  <li>KOI8-U (Ukrainian)</li>
93
  </ul>
94
- Of course, the font must contain the characters corresponding to the chosen encoding.
95
  <br>
96
  <br>
97
- Remark: the standard fonts use cp1252.
 
 
 
 
 
 
 
 
 
98
  <br>
99
  <br>
100
  After you have called the function (create a new file for this and include makefont.php), a .php file
@@ -109,7 +107,7 @@ Example:
109
  <pre><code>&lt;?php
110
  <span class="kw">require(</span><span class="str">'makefont/makefont.php'</span><span class="kw">);
111
 
112
- </span>MakeFont<span class="kw">(</span><span class="str">'c:\\Windows\\Fonts\\comic.ttf'</span><span class="kw">,</span><span class="str">'cp1252'</span><span class="kw">);
113
  </span>?&gt;</code></pre>
114
  </div>
115
  which gives the files comic.php and comic.z.
@@ -122,7 +120,7 @@ it directly instead of the .z version.
122
  Another way to call MakeFont() is through the command line:
123
  <br>
124
  <br>
125
- <kbd>php makefont\makefont.php c:\Windows\Fonts\comic.ttf cp1252</kbd>
126
  <br>
127
  <br>
128
  Finally, for TrueType and OpenType fonts, you can also generate the files
@@ -185,57 +183,5 @@ We can now copy the two generated files to the font directory and write the scri
185
  </span>?&gt;</code></pre>
186
  </div>
187
  <p class='demo'><a href='tuto7.php' target='_blank' class='demo'>[Demo]</a></p>
188
-
189
- <h2>About the euro symbol</h2>
190
- The euro character is not present in all encodings, and is not always placed at the same position:
191
- <table>
192
- <tr><th>Encoding</th><th>Position</th></tr>
193
- <tr class="alt0"><td>cp1250</td><td>128</td></tr>
194
- <tr class="alt1"><td>cp1251</td><td>136</td></tr>
195
- <tr class="alt0"><td>cp1252</td><td>128</td></tr>
196
- <tr class="alt1"><td>cp1253</td><td>128</td></tr>
197
- <tr class="alt0"><td>cp1254</td><td>128</td></tr>
198
- <tr class="alt1"><td>cp1255</td><td>128</td></tr>
199
- <tr class="alt0"><td>cp1257</td><td>128</td></tr>
200
- <tr class="alt1"><td>cp1258</td><td>128</td></tr>
201
- <tr class="alt0"><td>cp874</td><td>128</td></tr>
202
- <tr class="alt1"><td>ISO-8859-1</td><td>N/A</td></tr>
203
- <tr class="alt0"><td>ISO-8859-2</td><td>N/A</td></tr>
204
- <tr class="alt1"><td>ISO-8859-4</td><td>N/A</td></tr>
205
- <tr class="alt0"><td>ISO-8859-5</td><td>N/A</td></tr>
206
- <tr class="alt1"><td>ISO-8859-7</td><td>N/A</td></tr>
207
- <tr class="alt0"><td>ISO-8859-9</td><td>N/A</td></tr>
208
- <tr class="alt1"><td>ISO-8859-11</td><td>N/A</td></tr>
209
- <tr class="alt0"><td>ISO-8859-15</td><td>164</td></tr>
210
- <tr class="alt1"><td>ISO-8859-16</td><td>164</td></tr>
211
- <tr class="alt0"><td>KOI8-R</td><td>N/A</td></tr>
212
- <tr class="alt1"><td>KOI8-U</td><td>N/A</td></tr>
213
- </table>
214
- ISO-8859-1 is widespread but does not include the euro sign. If you need it, the simplest thing
215
- to do is to use cp1252 or ISO-8859-15 instead, which are nearly identical but contain the precious
216
- symbol.
217
-
218
- <h2>Reducing the size of TrueType fonts</h2>
219
- Font files are often quite voluminous; this is due to the fact that they contain the characters
220
- corresponding to many encodings. Zlib compression reduces them but they remain fairly big. A
221
- technique exists to reduce them further. It consists in converting the font to the Type1 format
222
- with <a href="http://ttf2pt1.sourceforge.net" target="_blank">ttf2pt1</a> (the Windows binary is
223
- available <a href="http://www.fpdf.org/fr/dl.php?id=22">here</a>) while specifying the encoding
224
- you are interested in; all other characters will be discarded.
225
- <br>
226
- For example, the arial.ttf font that ships with Windows Vista weights 748 KB (it contains 3381 characters).
227
- After compression it drops to 411. Let's convert it to Type1 by keeping only cp1250 characters:
228
- <br>
229
- <br>
230
- <kbd>ttf2pt1 -b -L cp1250.map c:\Windows\Fonts\arial.ttf arial</kbd>
231
- <br>
232
- <br>
233
- The .map files are located in the makefont directory of the package. The command produces
234
- arial.pfb and arial.afm. The arial.pfb file weights only 57 KB, and 53 after compression.
235
- <br>
236
- <br>
237
- It's possible to go even further. If you are interested only by a subset of the encoding (you
238
- probably don't need all 217 characters), you can open the .map file and remove the lines you are
239
- not interested in. This will reduce the file size accordingly.
240
  </body>
241
  </html>
2
  <html>
3
  <head>
4
  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
5
+ <title>Adding new fonts and encodings</title>
6
  <link type="text/css" rel="stylesheet" href="../fpdf.css">
 
 
 
 
 
 
 
 
7
  </head>
8
  <body>
9
+ <h1>Adding new fonts and encodings</h1>
10
+ This tutorial explains how to use TrueType, OpenType and Type1 fonts so that you are not limited to the
11
+ standard fonts anymore. The other benefit is that you can choose the text encoding, which allows you to
12
+ use other languages than the Western ones (the standard fonts support only cp1252 aka windows-1252).
13
  <br>
14
  <br>
15
+ For OpenType, only the format based on TrueType is supported (not the one based on Type1).<br>
16
+ For Type1, you will need the corresponding AFM file (it is usually provided with the font).
 
 
 
 
 
 
17
  <br>
18
  <br>
19
  Adding a new font requires two steps:
21
  <li>Generation of the font definition file</li>
22
  <li>Declaration of the font in the script</li>
23
  </ul>
 
24
 
25
  <h2>Generation of the font definition file</h2>
26
  The first step consists in generating a PHP file containing all the information needed by FPDF;
28
  directory of the package: makefont.php. It contains the following function:
29
  <br>
30
  <br>
31
+ <code>MakeFont(<b>string</b> fontfile [, <b>string</b> enc [, <b>boolean</b> embed [, <b>boolean</b> subset]]])</code>
32
  <dl class="param" style="margin-bottom:2em">
33
  <dt><code>fontfile</code></dt>
34
  <dd>
42
  <dd>
43
  <p>Whether to embed the font or not. Default value: <code>true</code>.</p>
44
  </dd>
45
+ <dt><code>subset</code></dt>
46
+ <dd>
47
+ <p>Whether to subset the font or not. Default value: <code>true</code>.</p>
48
+ </dd>
49
  </dl>
50
  The first parameter is the name of the font file. The extension must be either .ttf, .otf or .pfb and
51
  determines the font type. If your Type1 font is in ASCII format (.pfa), you can convert it to binary
80
  <li>KOI8-R (Russian)</li>
81
  <li>KOI8-U (Ukrainian)</li>
82
  </ul>
83
+ Of course, the font must contain the characters corresponding to the selected encoding.
84
  <br>
85
  <br>
86
+ The third parameter indicates whether the font should be embedded in the PDF or not. When a font is
87
+ not embedded, it is searched in the system. The advantage is that the PDF file is smaller; on the
88
+ other hand, if it is not available, then a substitution font is used. So you should ensure that the
89
+ needed font is installed on the client systems. Embedding is the recommended option to guarantee a
90
+ correct rendering.
91
+ <br>
92
+ <br>
93
+ The last parameter indicates whether subsetting should be used, that is to say, whether only
94
+ the characters from the selected encoding should be kept in the embedded font. As a result,
95
+ the size of the PDF file can be greatly reduced, especially if the original font was big.
96
  <br>
97
  <br>
98
  After you have called the function (create a new file for this and include makefont.php), a .php file
107
  <pre><code>&lt;?php
108
  <span class="kw">require(</span><span class="str">'makefont/makefont.php'</span><span class="kw">);
109
 
110
+ </span>MakeFont<span class="kw">(</span><span class="str">'C:\\Windows\\Fonts\\comic.ttf'</span><span class="kw">,</span><span class="str">'cp1252'</span><span class="kw">);
111
  </span>?&gt;</code></pre>
112
  </div>
113
  which gives the files comic.php and comic.z.
120
  Another way to call MakeFont() is through the command line:
121
  <br>
122
  <br>
123
+ <kbd>php makefont\makefont.php C:\Windows\Fonts\comic.ttf cp1252</kbd>
124
  <br>
125
  <br>
126
  Finally, for TrueType and OpenType fonts, you can also generate the files
183
  </span>?&gt;</code></pre>
184
  </div>
185
  <p class='demo'><a href='tuto7.php' target='_blank' class='demo'>[Demo]</a></p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
186
  </body>
187
  </html>
Functions/EWD_UFAQ_Captcha.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  function EWD_UFAQ_Validate_Captcha() {
3
- $ModifiedCode = $_POST['ewd_ufaq_modified_captcha'];
4
- $UserCode = $_POST['ewd_ufaq_captcha'];
5
 
6
  $Code = EWD_UFAQ_Decrypt_Catpcha_Code($ModifiedCode);
7
 
1
  <?php
2
  function EWD_UFAQ_Validate_Captcha() {
3
+ $ModifiedCode = intval( $_POST['ewd_ufaq_modified_captcha'] );
4
+ $UserCode = intval( $_POST['ewd_ufaq_captcha'] );
5
 
6
  $Code = EWD_UFAQ_Decrypt_Catpcha_Code($ModifiedCode);
7
 
Functions/EWD_UFAQ_Create_Captcha_Image.php CHANGED
@@ -1,5 +1,5 @@
1
  <?php
2
- $ModifiedCode = $_GET['Code'];
3
  $Code = EWD_UFAQ_Decrypt_Catpcha_Code($ModifiedCode);
4
  $im = imagecreatetruecolor(50, 24);
5
  $bg = imagecolorallocate($im, 22, 86, 165);
1
  <?php
2
+ $ModifiedCode = intval( $_GET['Code'] );
3
  $Code = EWD_UFAQ_Decrypt_Catpcha_Code($ModifiedCode);
4
  $im = imagecreatetruecolor(50, 24);
5
  $bg = imagecolorallocate($im, 22, 86, 165);
Functions/EWD_UFAQ_Export.php CHANGED
@@ -50,7 +50,7 @@ function EWD_UFAQ_Export_To_PDF() {
50
 
51
  $pdf->AddPage();
52
 
53
- $Entry['page'] = $pdf->page;
54
  $Entry['title'] = $PostTitle;
55
 
56
  $pdf->SetFont('Arial','B',15);
50
 
51
  $pdf->AddPage();
52
 
53
+ $Entry['page'] = $pdf->GetPage();
54
  $Entry['title'] = $PostTitle;
55
 
56
  $pdf->SetFont('Arial','B',15);
Functions/EWD_UFAQ_Import.php CHANGED
@@ -40,8 +40,7 @@ function EWD_UFAQ_Import(){
40
  if (!class_exists('ComposerAutoloaderInit4618f5c41cf5e27cc7908556f031e4d4')) {require_once EWD_UFAQ_CD_PLUGIN_PATH . 'PHPSpreadsheet/vendor/autoload.php';}
41
  use PhpOffice\PhpSpreadsheet\Spreadsheet;
42
  function Add_EWD_UFAQs_From_Spreadsheet($Excel_File_Name){
43
- global $wpdb;
44
-
45
  // check that the current user has the correct privileges to create posts
46
  if ( ! current_user_can( 'edit_posts' ) ) { return; }
47
 
@@ -97,16 +96,16 @@ function Add_EWD_UFAQs_From_Spreadsheet($Excel_File_Name){
97
  // Create an array of the values that are being inserted for each order,
98
  // edit if it's a current order, otherwise add it
99
  foreach ($FAQ as $Col_Index => $Value) {
100
- if ($Col_Index == $ID_Column and $ID_Column !== null) {$Post['ID'] = esc_sql($Value);}
101
- if ($Col_Index == $Question_Column and $Question_Column !== null) {$Post['post_title'] = esc_sql($Value);}
102
- if ($Col_Index == $Answer_Column and $Answer_Column !== null) {$Post['post_content'] = esc_sql($Value);}
103
- if ($Col_Index == $Categories_Column and $Categories_Column !== null) {$Post_Categories = explode(",", esc_sql($Value));}
104
- if ($Col_Index == $Tags_Column and $Tags_Column !== null) {$Post_Tags = explode(",", esc_sql($Value));}
105
- if (isset($Date_Column) and $Col_Index == $Date_Column and $Date_Column !== null) {$Post['post_date'] = esc_sql($Value);}
106
  }
107
 
108
- if (!is_array($Post_Categories)) {$Post_Categories = array();}
109
- if (!is_array($Post_Tags)) {$Post_Tags = array();}
110
 
111
  if ($Post['post_title'] == '') {continue;}
112
 
40
  if (!class_exists('ComposerAutoloaderInit4618f5c41cf5e27cc7908556f031e4d4')) {require_once EWD_UFAQ_CD_PLUGIN_PATH . 'PHPSpreadsheet/vendor/autoload.php';}
41
  use PhpOffice\PhpSpreadsheet\Spreadsheet;
42
  function Add_EWD_UFAQs_From_Spreadsheet($Excel_File_Name){
43
+
 
44
  // check that the current user has the correct privileges to create posts
45
  if ( ! current_user_can( 'edit_posts' ) ) { return; }
46
 
96
  // Create an array of the values that are being inserted for each order,
97
  // edit if it's a current order, otherwise add it
98
  foreach ($FAQ as $Col_Index => $Value) {
99
+ if ( isset( $ID_Column ) and $Col_Index == $ID_Column ) {$Post['ID'] = esc_sql($Value);}
100
+ if ( isset( $Question_Column ) and $Col_Index == $Question_Column ) {$Post['post_title'] = esc_sql($Value);}
101
+ if ( isset( $Answer_Column ) and $Col_Index == $Answer_Column ) {$Post['post_content'] = esc_sql($Value);}
102
+ if ( isset( $Categories_Column ) and $Col_Index == $Categories_Column ) {$Post_Categories = explode(",", esc_sql($Value));}
103
+ if ( isset( $Tags_Column ) and $Col_Index == $Tags_Column ) {$Post_Tags = explode(",", esc_sql($Value));}
104
+ if ( isset($Date_Column) and $Col_Index == $Date_Column ) {$Post['post_date'] = esc_sql($Value);}
105
  }
106
 
107
+ if ( ! isset( $Post_Categories ) or ! is_array( $Post_Categories ) ) {$Post_Categories = array();}
108
+ if ( ! isset( $Post_Tags ) or ! is_array( $Post_Tags ) ) {$Post_Tags = array();}
109
 
110
  if ($Post['post_title'] == '') {continue;}
111
 
Functions/EWD_UFAQ_Version_Reversion.php DELETED
@@ -1,87 +0,0 @@
1
- <?php
2
- function EWD_UFAQ_Version_Reversion() {
3
- if (get_option("EWD_UFAQ_Trial_Happening") != "Yes" or time() < get_option("EWD_UFAQ_Trial_Expiry_Time")) {return;}
4
-
5
- update_option("EWD_UFAQ_Display_Style", "Default");
6
- update_option("EWD_UFAQ_Color_Block_Shape", "Square");
7
- update_option("EWD_UFAQ_FAQ_Ratings", "No");
8
- update_option("EWD_UFAQ_WooCommerce_FAQs", "No");
9
- update_option("EWD_UFAQ_Use_Product", "Yes");
10
- update_option("EWD_UFAQ_Reveal_Effect", "none");
11
- update_option("EWD_UFAQ_Pretty_Permalinks", "No");
12
- update_option("EWD_UFAQ_Allow_Proposed_Answer", "No");
13
- update_option("EWD_UFAQ_Admin_Question_Notification", "No");
14
- update_option("EWD_UFAQ_Auto_Complete_Titles", "Yes");
15
- update_option("EWD_UFAQ_Slug_Base", "ufaqs");
16
-
17
- update_option("EWD_UFAQ_Order_By", "date");
18
-
19
- update_option("EWD_UFAQ_FAQ_Fields", array());
20
-
21
- update_option("EWD_UFAQ_Posted_Label", "");
22
- update_option("EWD_UFAQ_By_Label", "");
23
- update_option("EWD_UFAQ_On_Label", "");
24
- update_option("EWD_UFAQ_Category_Label", "");
25
- update_option("EWD_UFAQ_Tag_Label", "");
26
- update_option("EWD_UFAQ_Enter_Question_Label", "");
27
- update_option("EWD_UFAQ_Search_Label", "");
28
- update_option("EWD_UFAQ_Permalink_Label", "");
29
- update_option("EWD_UFAQ_Back_To_Top_Label", "");
30
-
31
- update_option("EWD_UFAQ_Thank_You_Submit_Label", "");
32
- update_option("EWD_UFAQ_Submit_Question_Label", "");
33
- update_option("EWD_UFAQ_Please_Fill_Form_Below_Label", "");
34
- update_option("EWD_UFAQ_Send_Question_Label", "");
35
- update_option("EWD_UFAQ_Question_Title_Label", "");
36
- update_option("EWD_UFAQ_What_Question_Being_Answered_Label", "");
37
- update_option("EWD_UFAQ_Proposed_Answer_Label", "");
38
- update_option("EWD_UFAQ_Review_Author_Label", "");
39
- update_option("EWD_UFAQ_What_Name_With_Review_Label", "");
40
- update_option("EWD_UFAQ_Retrieving_Results", "");
41
- update_option("EWD_UFAQ_No_Results_Found_Text", "");
42
-
43
- update_option("EWD_UFAQ_Styling_Default_Bg_Color", "");
44
- update_option("EWD_UFAQ_Styling_Default_Font_Color", "");
45
- update_option("EWD_UFAQ_Styling_Default_Border", "");
46
- update_option("EWD_UFAQ_Styling_Default_Border_Radius", "");
47
- update_option("EWD_UFAQ_Styling_Block_Bg_Color", "");
48
- update_option("EWD_UFAQ_Styling_Block_Font_Color", "");
49
- update_option("EWD_UFAQ_Styling_List_Font", "");
50
- update_option("EWD_UFAQ_Styling_List_Font_Size", "");
51
- update_option("EWD_UFAQ_Styling_List_Font_Color", "");
52
- update_option("EWD_UFAQ_Styling_List_Margin", "");
53
- update_option("EWD_UFAQ_Styling_List_Padding", "");
54
-
55
- update_option("EWD_UFAQ_Styling_Question_Font", "");
56
- update_option("EWD_UFAQ_Styling_Question_Font_Size", "");
57
- update_option("EWD_UFAQ_Styling_Question_Font_Color", "");
58
- update_option("EWD_UFAQ_Styling_Question_Margin", "");
59
- update_option("EWD_UFAQ_Styling_Question_Padding", "");
60
- update_option("EWD_UFAQ_Styling_Question_Icon_Top_Margin", "");
61
- update_option("EWD_UFAQ_Styling_Answer_Font", "");
62
- update_option("EWD_UFAQ_Styling_Answer_Font_Size", "");
63
- update_option("EWD_UFAQ_Styling_Answer_Font_Color", "");
64
- update_option("EWD_UFAQ_Styling_Answer_Margin", "");
65
- update_option("EWD_UFAQ_Styling_Answer_Padding", "");
66
- update_option("EWD_UFAQ_Styling_Postdate_Font", "");
67
- update_option("EWD_UFAQ_Styling_Postdate_Font_Size", "");
68
- update_option("EWD_UFAQ_Styling_Postdate_Font_Color", "");
69
- update_option("EWD_UFAQ_Styling_Postdate_Margin", "");
70
- update_option("EWD_UFAQ_Styling_Postdate_Padding", "");
71
- update_option("EWD_UFAQ_Styling_Category_Font", "");
72
- update_option("EWD_UFAQ_Styling_Category_Font_Size", "");
73
- update_option("EWD_UFAQ_Styling_Category_Font_Color", "");
74
- update_option("EWD_UFAQ_Styling_Category_Margin", "");
75
- update_option("EWD_UFAQ_Styling_Category_Padding", "");
76
-
77
- update_option("EWD_UFAQ_Styling_Category_Heading_Type", "h4");
78
- update_option("EWD_UFAQ_Styling_FAQ_Heading_Type", "h4");
79
- update_option("EWD_UFAQ_Toggle_Symbol", "A");
80
-
81
- update_option("EWD_UFAQ_Full_Version", "No");
82
- update_option("EWD_UFAQ_Trial_Happening", "No");
83
- delete_option("EWD_UFAQ_Trial_Expiry_Time");
84
- }
85
- add_action('admin_init', 'EWD_UFAQ_Version_Reversion');
86
-
87
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Functions/Full_Upgrade.php DELETED
@@ -1,47 +0,0 @@
1
- <?php
2
- function EWD_UFAQ_Upgrade_To_Full() {
3
- global $ewd_ufaq_message, $EWD_UFAQ_Full_Version;
4
-
5
- $Key = trim($_POST['Key']);
6
-
7
- if ($Key == "EWD Trial" and !get_option("EWD_UFAQ_Trial_Happening")) {
8
- $ewd_ufaq_message = array("Message_Type" => "Update", "Message" => __("Trial successfully started!", 'ultimate-faqs'));
9
-
10
- update_option("EWD_UFAQ_Trial_Expiry_Time", time() + (7*24*60*60));
11
- update_option("EWD_UFAQ_Trial_Happening", "Yes");
12
- update_option("EWD_UFAQ_Full_Version", "Yes");
13
- $EWD_UFAQ_Full_Version = get_option("EWD_UFAQ_Full_Version");
14
-
15
- $Admin_Email = get_option('admin_email');
16
-
17
- $opts = array('http'=>array('method'=>"GET"));
18
- $context = stream_context_create($opts);
19
- $Response = unserialize(file_get_contents("http://www.etoilewebdesign.com/UPCP-Key-Check/Register_Trial.php?Plugin=UFAQ&Admin_Email=" . $Admin_Email . "&Site=" . get_bloginfo('wpurl'), false, $context));
20
- }
21
- elseif (strlen($Key) < 18 or strlen($Key) > 22) {
22
- $ewd_ufaq_message = array("Message_Type" => "Error", "Message" => 'Invalid Product Key');
23
- }
24
- elseif ($Key != "EWD Trial") {
25
- $opts = array('http'=>array('method'=>"GET"));
26
- $context = stream_context_create($opts);
27
- $Theme = wp_get_theme();
28
- $Theme_Name = $Theme->get('Name');
29
- $EWD_Theme_ID = get_option('EWD_Affiliate_Theme_ID');
30
- $Response = unserialize(file_get_contents("http://www.etoilewebdesign.com/UPCP-Key-Check/EWD_UFAQ_KeyCheck.php?Key=" . $Key . "&Site=" . get_bloginfo('wpurl') . "&Theme_ID=" . $EWD_Theme_ID . "&Theme_Name=" . $Theme_Name, false, $context));
31
- //echo "http://www.etoilewebdesign.com/UPCP-Key-Check/EWD_OTP_KeyCheck.php?Key=" . $Key . "&Site=" . get_bloginfo('wpurl');
32
- //$Response = file_get_contents("http://www.etoilewebdesign.com/UPCP-Key-Check/KeyCheck.php?Key=" . $Key);
33
-
34
- if ($Response['Message_Type'] == "Error") {
35
- $ewd_ufaq_message = array("Message_Type" => "Error", "Message" => $Response['Message']);
36
- }
37
- else {
38
- $ewd_ufaq_message = array("Message_Type" => "Update", "Message" => $Response['Message']);
39
- update_option("EWD_UFAQ_Trial_Happening", "No");
40
- delete_option("EWD_UFAQ_Trial_Expiry_Time");
41
- update_option("EWD_UFAQ_Full_Version", "Yes");
42
- $EWD_UFAQ_Full_Version = get_option("EWD_UFAQ_Full_Version");
43
- }
44
- }
45
- }
46
-
47
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Functions/Process_Ajax.php CHANGED
@@ -17,8 +17,8 @@ add_action( 'wp_ajax_nopriv_ufaq_search', 'UFAQ_Search');
17
 
18
  // Change the up and down votes for a particular FAQ
19
  function EWD_UFAQ_Update_Rating() {
20
- $FAQ_ID = is_numeric($_POST['FAQ_ID']) ? sanitize_text_field($_POST['FAQ_ID']) : 0;
21
- $Vote_Type = $_POST['Vote_Type'];
22
 
23
  if ($Vote_Type == "Up") {
24
  $Up_Votes = get_post_meta($FAQ_ID, "FAQ_Up_Votes", true);
@@ -42,7 +42,7 @@ add_action( 'wp_ajax_nopriv_ufaq_update_rating', 'EWD_UFAQ_Update_Rating');
42
  function UFAQ_Record_View() {
43
  global $wpdb;
44
  $wpdb->show_errors();
45
- $post_id = substr($_POST['post_id'], 4, strrpos(sanitize_text_field($_POST['post_id']), "-") - 4);
46
 
47
  if (!is_numeric($post_id)) {return;}
48
 
@@ -61,7 +61,7 @@ function EWD_UFAQ_Save_Order(){
61
  if (!is_array($_POST['ewd-ufaq-item']) or $UFAQ_Full_Version != "Yes") {return;}
62
 
63
  foreach ($_POST['ewd-ufaq-item'] as $Key=>$ID) {
64
- update_post_meta($ID, 'ufaq_order', $Key);
65
  }
66
 
67
  die();
@@ -69,7 +69,7 @@ function EWD_UFAQ_Save_Order(){
69
  add_action('wp_ajax_UFAQ_update_order','EWD_UFAQ_Save_Order');
70
 
71
  function EWD_UFAQ_Add_WC_FAQs(){
72
- $Post_ID = sanitize_text_field($_POST['Post_ID']);
73
 
74
  if (!is_numeric($Post_ID)) {return;}
75
 
@@ -98,7 +98,7 @@ function EWD_UFAQ_Add_WC_FAQs(){
98
  add_action('wp_ajax_ewd_ufaq_add_wc_faqs','EWD_UFAQ_Add_WC_FAQs');
99
 
100
  function EWD_UFAQ_Delete_WC_FAQs(){
101
- $Post_ID = $_POST['Post_ID'];
102
 
103
  $Current_FAQs = get_post_meta($Post_ID, 'EWD_UFAQ_WC_Selected_FAQs', true );
104
  if (!is_array($Current_FAQs)) {$Current_FAQs = array();}
@@ -263,14 +263,13 @@ function EWD_UFAQ_Sort_By_String_Length( $a, $b ) {
263
 
264
  /* WELCOME SCREEN AJAX INSTALL FUNCTIONS */
265
  function EWD_UFAQ_AJAX_Add_Category() {
266
- global $wpdb;
267
-
268
- $Category_Name = (isset($_POST['category_name']) ? stripslashes_deep($_POST['category_name']) : '');
269
- $Category_Description = (isset($_POST['category_description']) ? stripslashes_deep($_POST['category_description']) : '');
270
 
271
  $Category_Term_IDs = wp_insert_term( $Category_Name, 'ufaq-category', array('description' => $Category_Description) );
272
 
273
- echo json_encode(array('category_name' => $Category_Name, 'category_id' => $Category_Term_IDs['term_id']));
274
 
275
  exit();
276
  }
@@ -278,7 +277,7 @@ add_action('wp_ajax_ewd_ufaq_welcome_add_category', 'EWD_UFAQ_AJAX_Add_Category'
278
 
279
  function EWD_UFAQ_AJAX_Add_FAQ_Page() {
280
  wp_insert_post(array(
281
- 'post_title' => (isset($_POST['faq_page_title']) ? stripslashes_deep($_POST['faq_page_title']) : ''),
282
  'post_content' => '<!-- wp:paragraph --><p> [ultimate-faqs] </p><!-- /wp:paragraph -->',
283
  'post_status' => 'publish',
284
  'post_type' => 'page'
@@ -289,10 +288,10 @@ function EWD_UFAQ_AJAX_Add_FAQ_Page() {
289
  add_action('wp_ajax_ewd_ufaq_welcome_add_faq_page', 'EWD_UFAQ_AJAX_Add_FAQ_Page');
290
 
291
  function EWD_UFAQ_AJAX_Set_Options() {
292
- update_option("EWD_UFAQ_FAQ_Accordion", $_POST['faq_accordion']);
293
- update_option("EWD_UFAQ_Toggle", $_POST['faq_toggle']);
294
- update_option("EWD_UFAQ_Group_By_Category", $_POST['group_by_category']);
295
- update_option("EWD_UFAQ_Order_By", $_POST['order_by_setting']);
296
 
297
  exit();
298
  }
@@ -300,15 +299,15 @@ add_action('wp_ajax_ewd_ufaq_welcome_set_options', 'EWD_UFAQ_AJAX_Set_Options');
300
 
301
  function EWD_UFAQ_AJAX_Add_FAQ() {
302
  $FAQ_Post_ID = wp_insert_post(array(
303
- 'post_title' => (isset($_POST['faq_question']) ? stripslashes_deep($_POST['faq_question']) : ''),
304
- 'post_content' => (isset($_POST['faq_answer']) ? stripslashes_deep($_POST['faq_answer']) : ''),
305
  'post_status' => 'publish',
306
  'post_type' => 'ufaq'
307
  ));
308
 
309
 
310
  if (isset($_POST['faq_category']) and $_POST['faq_category']) {
311
- wp_set_post_terms($FAQ_Post_ID, $_POST['faq_category'], 'ufaq-category');
312
  }
313
 
314
  exit();
17
 
18
  // Change the up and down votes for a particular FAQ
19
  function EWD_UFAQ_Update_Rating() {
20
+ $FAQ_ID = is_numeric($_POST['FAQ_ID']) ? intval($_POST['FAQ_ID']) : 0;
21
+ $Vote_Type = sanitize_text_field( $_POST['Vote_Type'] );
22
 
23
  if ($Vote_Type == "Up") {
24
  $Up_Votes = get_post_meta($FAQ_ID, "FAQ_Up_Votes", true);
42
  function UFAQ_Record_View() {
43
  global $wpdb;
44
  $wpdb->show_errors();
45
+ $post_id = intval( substr($_POST['post_id'], 4, strrpos(sanitize_text_field($_POST['post_id']), "-") - 4) );
46
 
47
  if (!is_numeric($post_id)) {return;}
48
 
61
  if (!is_array($_POST['ewd-ufaq-item']) or $UFAQ_Full_Version != "Yes") {return;}
62
 
63
  foreach ($_POST['ewd-ufaq-item'] as $Key=>$ID) {
64
+ update_post_meta( intval( $ID ), 'ufaq_order', intval( $Key ) );
65
  }
66
 
67
  die();
69
  add_action('wp_ajax_UFAQ_update_order','EWD_UFAQ_Save_Order');
70
 
71
  function EWD_UFAQ_Add_WC_FAQs(){
72
+ $Post_ID = intval( $_POST['Post_ID'] );
73
 
74
  if (!is_numeric($Post_ID)) {return;}
75
 
98
  add_action('wp_ajax_ewd_ufaq_add_wc_faqs','EWD_UFAQ_Add_WC_FAQs');
99
 
100
  function EWD_UFAQ_Delete_WC_FAQs(){
101
+ $Post_ID = intval( $_POST['Post_ID'] );
102
 
103
  $Current_FAQs = get_post_meta($Post_ID, 'EWD_UFAQ_WC_Selected_FAQs', true );
104
  if (!is_array($Current_FAQs)) {$Current_FAQs = array();}
263
 
264
  /* WELCOME SCREEN AJAX INSTALL FUNCTIONS */
265
  function EWD_UFAQ_AJAX_Add_Category() {
266
+
267
+ $Category_Name = isset($_POST['category_name']) ? sanitize_text_field( $_POST['category_name'] ) : '';
268
+ $Category_Description = isset($_POST['category_description']) ? sanitize_text_field($_POST['category_description']) : '';
 
269
 
270
  $Category_Term_IDs = wp_insert_term( $Category_Name, 'ufaq-category', array('description' => $Category_Description) );
271
 
272
+ echo json_encode( array( 'category_name' => $Category_Name, 'category_id' => $Category_Term_IDs['term_id'] ) );
273
 
274
  exit();
275
  }
277
 
278
  function EWD_UFAQ_AJAX_Add_FAQ_Page() {
279
  wp_insert_post(array(
280
+ 'post_title' => (isset($_POST['faq_page_title']) ? sanitize_text_field($_POST['faq_page_title']) : ''),
281
  'post_content' => '<!-- wp:paragraph --><p> [ultimate-faqs] </p><!-- /wp:paragraph -->',
282
  'post_status' => 'publish',
283
  'post_type' => 'page'
288
  add_action('wp_ajax_ewd_ufaq_welcome_add_faq_page', 'EWD_UFAQ_AJAX_Add_FAQ_Page');
289
 
290
  function EWD_UFAQ_AJAX_Set_Options() {
291
+ update_option("EWD_UFAQ_FAQ_Accordion", sanitize_text_field( $_POST['faq_accordion'] ) );
292
+ update_option("EWD_UFAQ_Toggle", sanitize_text_field( $_POST['faq_toggle'] ) );
293
+ update_option("EWD_UFAQ_Group_By_Category", sanitize_text_field( $_POST['group_by_category'] ) );
294
+ update_option("EWD_UFAQ_Order_By", sanitize_text_field( $_POST['order_by_setting'] ) );
295
 
296
  exit();
297
  }
299
 
300
  function EWD_UFAQ_AJAX_Add_FAQ() {
301
  $FAQ_Post_ID = wp_insert_post(array(
302
+ 'post_title' => (isset($_POST['faq_question']) ? sanitize_text_field($_POST['faq_question']) : ''),
303
+ 'post_content' => (isset($_POST['faq_answer']) ? sanitize_text_field($_POST['faq_answer']) : ''),
304
  'post_status' => 'publish',
305
  'post_type' => 'ufaq'
306
  ));
307
 
308
 
309
  if (isset($_POST['faq_category']) and $_POST['faq_category']) {
310
+ wp_set_post_terms($FAQ_Post_ID, sanitize_text_field( $_POST['faq_category'] ), 'ufaq-category');
311
  }
312
 
313
  exit();
Functions/Update_Admin_Databases.php CHANGED
@@ -17,12 +17,12 @@ function EWD_UFAQ_UpdateOptions() {
17
 
18
  if ( ! wp_verify_nonce( $_POST['EWD_UFAQ_Save_Options_Nonce'], 'EWD_UFAQ_Save_Options' ) ) {return;}
19
 
20
- if (get_option("EWD_UFAQ_Access_Role") != '' and !current_user_can(get_option("EWD_UFAQ_Access_Role"))) {return;}
21
 
22
- $Custom_CSS = (isset($_POST['custom_css']) ? EWD_UFAQ_Validate_CSS($_POST['custom_css']) : null);
23
- $Social_Media_Array = (isset($_POST['Socialmedia']) ? $_POST['Socialmedia'] : array());
24
- array_walk($Social_Media_Array, 'sanitize_text_field');
25
- if (is_array($Social_Media_Array)) {$Social_Media = implode(",", $Social_Media_Array);}
26
 
27
  $Custom_CSS = stripslashes_deep($Custom_CSS);
28
 
@@ -54,9 +54,9 @@ function EWD_UFAQ_UpdateOptions() {
54
  if (isset($_POST['Options_Submit']) and $UFAQ_Full_Version == "Yes") {update_option('EWD_UFAQ_FAQs_Per_Page', sanitize_text_field($_POST['faqs_per_page']));}
55
  if (isset($_POST['faq_ratings']) and $UFAQ_Full_Version == "Yes") {update_option('EWD_UFAQ_FAQ_Ratings', sanitize_text_field($_POST['faq_ratings']));}
56
  $ThumbsUpImageLink = Prepare_Thumbs_Up_Image();
57
- if (isset($_POST['Thumbs_Up_Image']) and $UFAQ_Full_Version == "Yes") {update_option("EWD_UFAQ_Thumbs_Up_Image", $ThumbsUpImageLink);}
58
  $ThumbsDownImageLink = Prepare_Thumbs_Down_Image();
59
- if (isset($_POST['Thumbs_Down_Image']) and $UFAQ_Full_Version == "Yes") {update_option("EWD_UFAQ_Thumbs_Down_Image", $ThumbsDownImageLink);}
60
  if (isset($_POST['page_type']) and $UFAQ_Full_Version == "Yes") {update_option('EWD_UFAQ_Page_Type', sanitize_text_field($_POST['page_type']));}
61
  if (isset($_POST['woocommerce_faqs']) and $UFAQ_Full_Version == "Yes") {update_option('EWD_UFAQ_WooCommerce_FAQs', sanitize_text_field($_POST['woocommerce_faqs']));}
62
  if (isset($_POST['use_product']) and $UFAQ_Full_Version == "Yes") {update_option('EWD_UFAQ_Use_Product', sanitize_text_field($_POST['use_product']));}
@@ -74,12 +74,12 @@ function EWD_UFAQ_UpdateOptions() {
74
  if (isset($_POST['submit_faq_email']) and $UFAQ_Full_Version == "Yes") {update_option('EWD_UFAQ_Submit_FAQ_Email', sanitize_text_field($_POST['submit_faq_email']));}
75
  if (isset($_POST['faq_auto_complete_titles']) and $UFAQ_Full_Version == "Yes") {update_option('EWD_UFAQ_Auto_Complete_Titles', sanitize_text_field($_POST['faq_auto_complete_titles']));}
76
  if (isset($_POST['highlight_search_term']) and $UFAQ_Full_Version == "Yes") {update_option('EWD_UFAQ_Highlight_Search_Term', sanitize_text_field($_POST['highlight_search_term']));}
77
- if (isset($_POST['slug_base']) and $UFAQ_Full_Version == "Yes") {update_option('EWD_UFAQ_Slug_Base', $_POST['slug_base']);}
78
  if (isset($_POST['Socialmedia']) and $UFAQ_Full_Version == "Yes") {update_option('EWD_UFAQ_Social_Media', $Social_Media);}
79
 
80
  $FAQ_Elements = array();
81
  for ($i=0; $i<=9; $i++) {
82
- $FAQ_Elements[] = $_POST['Element_' . $i];
83
  }
84
  if (isset($_POST['Options_Submit'])) {update_option('EWD_UFAQ_FAQ_Elements', $FAQ_Elements);}
85
 
17
 
18
  if ( ! wp_verify_nonce( $_POST['EWD_UFAQ_Save_Options_Nonce'], 'EWD_UFAQ_Save_Options' ) ) {return;}
19
 
20
+ if ( get_option( "EWD_UFAQ_Access_Role" ) != '' and !current_user_can( get_option( "EWD_UFAQ_Access_Role" ) ) ) { return; }
21
 
22
+ $Custom_CSS = isset( $_POST['custom_css'] ) ? EWD_UFAQ_Validate_CSS( $_POST['custom_css'] ) : null;
23
+ $Social_Media_Array = ( isset( $_POST['Socialmedia'] ) and is_array( $_POST['Socialmedia'] ) ) ? $_POST['Socialmedia'] : array();
24
+ array_walk( $Social_Media_Array, 'sanitize_text_field' );
25
+ if ( is_array( $Social_Media_Array ) ) { $Social_Media = implode( ",", $Social_Media_Array ); }
26
 
27
  $Custom_CSS = stripslashes_deep($Custom_CSS);
28
 
54
  if (isset($_POST['Options_Submit']) and $UFAQ_Full_Version == "Yes") {update_option('EWD_UFAQ_FAQs_Per_Page', sanitize_text_field($_POST['faqs_per_page']));}
55
  if (isset($_POST['faq_ratings']) and $UFAQ_Full_Version == "Yes") {update_option('EWD_UFAQ_FAQ_Ratings', sanitize_text_field($_POST['faq_ratings']));}
56
  $ThumbsUpImageLink = Prepare_Thumbs_Up_Image();
57
+ if (isset($_POST['Thumbs_Up_Image']) and $UFAQ_Full_Version == "Yes") {update_option("EWD_UFAQ_Thumbs_Up_Image", esc_url_raw( $ThumbsUpImageLink ) );}
58
  $ThumbsDownImageLink = Prepare_Thumbs_Down_Image();
59
+ if (isset($_POST['Thumbs_Down_Image']) and $UFAQ_Full_Version == "Yes") {update_option("EWD_UFAQ_Thumbs_Down_Image", esc_url_raw( $ThumbsDownImageLink ) );}
60
  if (isset($_POST['page_type']) and $UFAQ_Full_Version == "Yes") {update_option('EWD_UFAQ_Page_Type', sanitize_text_field($_POST['page_type']));}
61
  if (isset($_POST['woocommerce_faqs']) and $UFAQ_Full_Version == "Yes") {update_option('EWD_UFAQ_WooCommerce_FAQs', sanitize_text_field($_POST['woocommerce_faqs']));}
62
  if (isset($_POST['use_product']) and $UFAQ_Full_Version == "Yes") {update_option('EWD_UFAQ_Use_Product', sanitize_text_field($_POST['use_product']));}
74
  if (isset($_POST['submit_faq_email']) and $UFAQ_Full_Version == "Yes") {update_option('EWD_UFAQ_Submit_FAQ_Email', sanitize_text_field($_POST['submit_faq_email']));}
75
  if (isset($_POST['faq_auto_complete_titles']) and $UFAQ_Full_Version == "Yes") {update_option('EWD_UFAQ_Auto_Complete_Titles', sanitize_text_field($_POST['faq_auto_complete_titles']));}
76
  if (isset($_POST['highlight_search_term']) and $UFAQ_Full_Version == "Yes") {update_option('EWD_UFAQ_Highlight_Search_Term', sanitize_text_field($_POST['highlight_search_term']));}
77
+ if (isset($_POST['slug_base']) and $UFAQ_Full_Version == "Yes") {update_option('EWD_UFAQ_Slug_Base', sanitize_text_field( $_POST['slug_base'] ) );}
78
  if (isset($_POST['Socialmedia']) and $UFAQ_Full_Version == "Yes") {update_option('EWD_UFAQ_Social_Media', $Social_Media);}
79
 
80
  $FAQ_Elements = array();
81
  for ($i=0; $i<=9; $i++) {
82
+ $FAQ_Elements[] = sanitize_text_field( $_POST['Element_' . $i] );
83
  }
84
  if (isset($_POST['Options_Submit'])) {update_option('EWD_UFAQ_FAQ_Elements', $FAQ_Elements);}
85
 
Main.php CHANGED
@@ -7,7 +7,7 @@ Author: Etoile Web Design
7
  Author URI: http://www.EtoileWebDesign.com/wordpress-plugins/
8
  Terms and Conditions: http://www.etoilewebdesign.com/plugin-terms-and-conditions/
9
  Text Domain: ultimate-faqs
10
- Version: 1.9.4
11
  */
12
 
13
  global $ewd_ufaq_message;
@@ -388,13 +388,11 @@ include "Functions/EWD_UFAQ_Pointers_Manager_Class.php";
388
  include "Functions/EWD_UFAQ_Rewrite_Rules.php";
389
  include "Functions/EWD_UFAQ_Submit_Question.php";
390
  include "Functions/EWD_UFAQ_Upgrade_Box.php";
391
- include "Functions/EWD_UFAQ_Version_Reversion.php";
392
  include "Functions/EWD_UFAQ_Version_Update.php";
393
  include "Functions/EWD_UFAQ_Widgets.php";
394
  include "Functions/EWD_UFAQ_WooCommerce_Tab.php";
395
  include "Functions/EWD_UFAQ_WPForms_Integration.php";
396
  include "Functions/FrontEndAjaxUrl.php";
397
- include "Functions/Full_Upgrade.php";
398
  include "Functions/Process_Ajax.php";
399
  include "Functions/Register_EWD_UFAQ_Posts_Taxonomies.php";
400
  include "Functions/Update_Admin_Databases.php";
7
  Author URI: http://www.EtoileWebDesign.com/wordpress-plugins/
8
  Terms and Conditions: http://www.etoilewebdesign.com/plugin-terms-and-conditions/
9
  Text Domain: ultimate-faqs
10
+ Version: 1.9.5
11
  */
12
 
13
  global $ewd_ufaq_message;
388
  include "Functions/EWD_UFAQ_Rewrite_Rules.php";
389
  include "Functions/EWD_UFAQ_Submit_Question.php";
390
  include "Functions/EWD_UFAQ_Upgrade_Box.php";
 
391
  include "Functions/EWD_UFAQ_Version_Update.php";
392
  include "Functions/EWD_UFAQ_Widgets.php";
393
  include "Functions/EWD_UFAQ_WooCommerce_Tab.php";
394
  include "Functions/EWD_UFAQ_WPForms_Integration.php";
395
  include "Functions/FrontEndAjaxUrl.php";
 
396
  include "Functions/Process_Ajax.php";
397
  include "Functions/Register_EWD_UFAQ_Posts_Taxonomies.php";
398
  include "Functions/Update_Admin_Databases.php";
Shortcodes/DisplayFAQs.php CHANGED
@@ -247,7 +247,7 @@ function Display_FAQs($atts) {
247
  }
248
  elseif (isset($_GET['Display_FAQ'])) {
249
  $ReturnString .= "<script>var Display_FAQ_ID = '" . intval( $_GET['Display_FAQ'] ) . "-%Counter_Placeholder%';</script>";
250
- $Display_FAQ_ID = $_GET['Display_FAQ'];
251
  }
252
  else {$Display_FAQ_ID = "";}
253
 
@@ -353,8 +353,8 @@ function Display_FAQs($atts) {
353
  $Category_Terms = wp_get_post_terms($faq->ID, 'ufaq-category');
354
  $Tag_Terms = wp_get_post_terms($faq->ID, 'ufaq-tag');
355
 
356
- if (is_array($post_id_array)) {
357
- if (($key = array_search($faq->ID, $post_id_array)) !== false) {unset($post_id_array[$key]);}
358
  }
359
 
360
  if ($Permalink_Type == "IndividualPage") {
@@ -414,7 +414,7 @@ function Display_FAQs($atts) {
414
  if ($Hide_Blank_Fields != "Yes" or $Value != "") {
415
  $ReturnString .= "<div class='ufaq-custom-field-label'>" . $FAQ_Field_Item['FieldName'] . ": </div>";
416
  $ReturnString .= "<div class='ufaq-custom-field-value'>&nbsp;";
417
- if ($FAQ_Field_Item['FieldType'] == "file") {$ReturnString .= "<a href='" . $Value . "'>" . substr($Value, strrpos($Value, "/"+1)) . "</a>";}
418
  elseif ($FAQ_Field_Item['FieldType'] == "link") {$ReturnString .= "<a href='" . $Value . "' target='_blank'>" . $Value ."</a>";}
419
  else {$ReturnString .= $Value;}
420
  $ReturnString .= "</div>";
247
  }
248
  elseif (isset($_GET['Display_FAQ'])) {
249
  $ReturnString .= "<script>var Display_FAQ_ID = '" . intval( $_GET['Display_FAQ'] ) . "-%Counter_Placeholder%';</script>";
250
+ $Display_FAQ_ID = intval( $_GET['Display_FAQ'] );
251
  }
252
  else {$Display_FAQ_ID = "";}
253
 
353
  $Category_Terms = wp_get_post_terms($faq->ID, 'ufaq-category');
354
  $Tag_Terms = wp_get_post_terms($faq->ID, 'ufaq-tag');
355
 
356
+ if ( isset( $post_id_array ) and is_array( $post_id_array ) ) {
357
+ if ( ( $key = array_search( $faq->ID, $post_id_array ) ) !== false ) { unset( $post_id_array[$key] ); }
358
  }
359
 
360
  if ($Permalink_Type == "IndividualPage") {
414
  if ($Hide_Blank_Fields != "Yes" or $Value != "") {
415
  $ReturnString .= "<div class='ufaq-custom-field-label'>" . $FAQ_Field_Item['FieldName'] . ": </div>";
416
  $ReturnString .= "<div class='ufaq-custom-field-value'>&nbsp;";
417
+ if ($FAQ_Field_Item['FieldType'] == "file") {$ReturnString .= "<a href='" . $Value . "'>" . strrpos( $Value, "/") ? substr( $Value, strrpos( $Value, "/" ) + 1 ) : $Value . "</a>";}
418
  elseif ($FAQ_Field_Item['FieldType'] == "link") {$ReturnString .= "<a href='" . $Value . "' target='_blank'>" . $Value ."</a>";}
419
  else {$ReturnString .= $Value;}
420
  $ReturnString .= "</div>";
Shortcodes/Display_FAQ_Search.php CHANGED
@@ -50,14 +50,14 @@ function UFAQ_AJAX_Search($atts) {
50
  $ReturnString .= "<form action='#' method='post' id='ufaq-ajax-form' class='pure-form pure-form-aligned'>";
51
  $ReturnString .= "<input type='hidden' name='ufaq-input' value='Search'>";
52
  $ReturnString .= "<div id='ewd-ufaq-jquery-ajax-search' class='pure-control-group ui-front' style='position:relative;'>";
53
- $ReturnString .= "<label id='ufaq-ajax-search-lbl' class='ewd-otp-field-label ewd-otp-bold'>" . $Enter_Question_Label . ":</label>";
54
- $ReturnString .= "<input type='hidden' name='include_category' value='" . $include_category . "' id='ufaq-include-category' />";
55
- $ReturnString .= "<input type='hidden' name='exclude_category' value='" . $exclude_category . "' id='ufaq-exclude-category' />";
56
- $ReturnString .= "<input type='hidden' name='orderby' value='" . $orderby . "' id='ufaq-orderby' />";
57
- $ReturnString .= "<input type='hidden' name='order' value='" . $order . "' id='ufaq-order' />";
58
- $ReturnString .= "<input type='hidden' name='post_count' value='" . $post_count . "' id='ufaq-post-count' />";
59
- $ReturnString .= "<input type='hidden' name='current_url' value='" . $_SERVER['REQUEST_URI'] . "' id='ufaq-current-url' />";
60
- $ReturnString .= "<input type='hidden' name='show_on_load' value='" . $show_on_load . "' id='ufaq-show-on-load' />";
61
  $ReturnString .= "<input type='text' id='ufaq-ajax-text-input' class='ufaq-text-input' name='Question ' placeholder='" . $Search_Placeholder_Label . "...' value='" . (isset($_GET['faq_search_term']) ? esc_attr($_GET['faq_search_term']) : '') . "'>";
62
  $ReturnString .= "</div>";
63
  if ($Auto_Complete_Titles != "Yes" and $show_on_load == "No") {$ReturnString .= "<label for='Submit'></label><input type='button' id='ufaq-ajax-search-btn' class='ewd-otp-submit pure-button pure-button-primary' name='Search' value='" . $Search_Label . "'>";}
50
  $ReturnString .= "<form action='#' method='post' id='ufaq-ajax-form' class='pure-form pure-form-aligned'>";
51
  $ReturnString .= "<input type='hidden' name='ufaq-input' value='Search'>";
52
  $ReturnString .= "<div id='ewd-ufaq-jquery-ajax-search' class='pure-control-group ui-front' style='position:relative;'>";
53
+ $ReturnString .= "<label id='ufaq-ajax-search-lbl' class='ewd-otp-field-label ewd-otp-bold'>" . esc_html( $Enter_Question_Label ) . ":</label>";
54
+ $ReturnString .= "<input type='hidden' name='include_category' value='" . esc_attr( $include_category ) . "' id='ufaq-include-category' />";
55
+ $ReturnString .= "<input type='hidden' name='exclude_category' value='" . esc_attr( $exclude_category ) . "' id='ufaq-exclude-category' />";
56
+ $ReturnString .= "<input type='hidden' name='orderby' value='" . esc_attr( $orderby ) . "' id='ufaq-orderby' />";
57
+ $ReturnString .= "<input type='hidden' name='order' value='" . esc_attr( $order ) . "' id='ufaq-order' />";
58
+ $ReturnString .= "<input type='hidden' name='post_count' value='" . esc_attr( $post_count ) . "' id='ufaq-post-count' />";
59
+ $ReturnString .= "<input type='hidden' name='current_url' value='" . esc_attr( $_SERVER['REQUEST_URI'] ) . "' id='ufaq-current-url' />";
60
+ $ReturnString .= "<input type='hidden' name='show_on_load' value='" . esc_attr( $show_on_load ) . "' id='ufaq-show-on-load' />";
61
  $ReturnString .= "<input type='text' id='ufaq-ajax-text-input' class='ufaq-text-input' name='Question ' placeholder='" . $Search_Placeholder_Label . "...' value='" . (isset($_GET['faq_search_term']) ? esc_attr($_GET['faq_search_term']) : '') . "'>";
62
  $ReturnString .= "</div>";
63
  if ($Auto_Complete_Titles != "Yes" and $show_on_load == "No") {$ReturnString .= "<label for='Submit'></label><input type='button' id='ufaq-ajax-search-btn' class='ewd-otp-submit pure-button pure-button-primary' name='Search' value='" . $Search_Label . "'>";}
Shortcodes/SubmitFAQ.php CHANGED
@@ -1,8 +1,7 @@
1
  <?php
2
  function Insert_Question_Form($atts) {
3
  global $user_message;
4
- global $wpdb;
5
-
6
  $Custom_CSS = get_option('EWD_UFAQ_Custom_CSS');
7
  $Allow_Proposed_Answer = get_option("EWD_UFAQ_Allow_Proposed_Answer");
8
  $Submit_Custom_Fields = get_option("EWD_UFAQ_Submit_Custom_Fields");
1
  <?php
2
  function Insert_Question_Form($atts) {
3
  global $user_message;
4
+
 
5
  $Custom_CSS = get_option('EWD_UFAQ_Custom_CSS');
6
  $Allow_Proposed_Answer = get_option("EWD_UFAQ_Allow_Proposed_Answer");
7
  $Submit_Custom_Fields = get_option("EWD_UFAQ_Submit_Custom_Fields");
html/DashboardPage.php CHANGED
@@ -24,17 +24,15 @@
24
 
25
  <div id="ewd-ufaq-dashboard-content-left">
26
 
27
- <?php if ($UFAQ_Full_Version != "Yes" or get_option("EWD_UFAQ_Trial_Happening") == "Yes") { ?>
28
- <div class="ewd-ufaq-dashboard-new-widget-box ewd-widget-box-full">
29
- <div class="ewd-ufaq-dashboard-new-widget-box-top">
30
- <form method="post" action="admin.php?page=EWD-UFAQ-Options" class="ewd-ufaq-dashboard-key-widget">
31
- <input class="ewd-ufaq-dashboard-key-widget-input" name="Key" type="text" placeholder="<?php _e('Enter Product Key Here', 'ultimate-faqs'); ?>">
32
- <input class="ewd-ufaq-dashboard-key-widget-submit" name="EWD_UFAQ_Upgrade_To_Full" type="submit" value="<?php _e('UNLOCK PREMIUM', 'ultimate-faqs'); ?>">
33
- <div class="ewd-ufaq-dashboard-key-widget-text">Don't have a key? Use the <a href="https://www.etoilewebdesign.com/license-payment/?Selected=UFAQ&Quantity=1" target="_blank">Upgrade Now</a> button above to purchase and unlock all premium features.</div>
34
- </form>
35
- </div>
36
- </div>
37
- <?php } ?>
38
 
39
  <div class="ewd-ufaq-dashboard-new-widget-box ewd-widget-box-full" id="ewd-ufaq-dashboard-support-widget-box">
40
  <div class="ewd-ufaq-dashboard-new-widget-box-top">Get Support<span id="ewd-ufaq-dash-mobile-support-down-caret">&nbsp;&nbsp;&#9660;</span><span id="ewd-ufaq-dash-mobile-support-up-caret">&nbsp;&nbsp;&#9650;</span></div>
@@ -175,21 +173,9 @@
175
  <?php if ($UFAQ_Full_Version != "Yes" or get_option("EWD_UFAQ_Trial_Happening") == "Yes") { ?>
176
  <div class="ewd-ufaq-dashboard-new-widget-box ewd-widget-box-full" id="ewd-ufaq-dashboard-get-premium-widget-box">
177
  <div class="ewd-ufaq-dashboard-new-widget-box-top">Get Premium</div>
178
- <?php if(get_option("EWD_UFAQ_Trial_Happening") == "Yes"){
179
- $trialExpireTime = get_option("EWD_UFAQ_Trial_Expiry_Time");
180
- $currentTime = time();
181
- $trialTimeLeft = $trialExpireTime - $currentTime;
182
- $trialTimeLeftDays = ( date("d", $trialTimeLeft) ) - 1;
183
- $trialTimeLeftHours = date("H", $trialTimeLeft);
184
- ?>
185
- <div class="ewd-ufaq-dashboard-new-widget-box-bottom">
186
- <div class="ewd-ufaq-dashboard-get-premium-widget-trial-time">
187
- <div class="ewd-ufaq-dashboard-get-premium-widget-trial-days"><?php echo $trialTimeLeftDays; ?><span>days</span></div>
188
- <div class="ewd-ufaq-dashboard-get-premium-widget-trial-hours"><?php echo $trialTimeLeftHours; ?><span>hours</span></div>
189
- </div>
190
- <div class="ewd-ufaq-dashboard-get-premium-widget-trial-time-left">LEFT IN TRIAL</div>
191
- </div>
192
- <?php } ?>
193
  <div class="ewd-ufaq-dashboard-new-widget-box-bottom">
194
  <div class="ewd-ufaq-dashboard-get-premium-widget-features-title"<?php echo ( get_option("EWD_UFAQ_Trial_Happening") == "Yes" ? "style='padding-top: 20px;'" : ""); ?>>GET FULL ACCESS WITH OUR PREMIUM VERSION AND GET:</div>
195
  <ul class="ewd-ufaq-dashboard-get-premium-widget-features">
@@ -200,13 +186,11 @@
200
  <li>+ More</li>
201
  </ul>
202
  <a href="https://www.etoilewebdesign.com/license-payment/?Selected=UFAQ&Quantity=1" class="ewd-ufaq-dashboard-get-premium-widget-button" target="_blank">UPGRADE NOW</a>
203
- <?php if (!get_option("EWD_UFAQ_Trial_Happening")) { ?>
204
- <form method="post" action="admin.php?page=EWD-UFAQ-Options">
205
- <input name="Key" type="hidden" value='EWD Trial'>
206
- <input name="EWD_UFAQ_Upgrade_To_Full" type="hidden" value='EWD_UFAQ_Upgrade_To_Full'>
207
- <button class="ewd-ufaq-dashboard-get-premium-widget-button ewd-ufaq-dashboard-new-trial-button">GET FREE 7-DAY TRIAL</button>
208
- </form>
209
- <?php } ?>
210
  </div>
211
  </div>
212
  <?php } ?>
24
 
25
  <div id="ewd-ufaq-dashboard-content-left">
26
 
27
+ <?php if ($UFAQ_Full_Version != "Yes" or get_option("EWD_UFAQ_Trial_Happening") == "Yes") {
28
+ $premium_info = '<div class="ewd-ufaq-dashboard-new-widget-box ewd-widget-box-full">';
29
+ $premium_info .= '<div class="ewd-ufaq-dashboard-new-widget-box-top">';
30
+ $premium_info .= sprintf( __( '<a href="%s" target="_blank">Visit our website</a> to learn how to upgrade to premium.'), 'https://www.etoilewebdesign.com/premium-upgrade-instructions/' );
31
+ $premium_info .= '</div>';
32
+ $premium_info .= '</div>';
33
+
34
+ echo apply_filters( 'ewd_dashboard_top', $premium_info, 'UFAQ', 'http://www.etoilewebdesign.com/plugins/ultimate-faq/#buy' );
35
+ } ?>
 
 
36
 
37
  <div class="ewd-ufaq-dashboard-new-widget-box ewd-widget-box-full" id="ewd-ufaq-dashboard-support-widget-box">
38
  <div class="ewd-ufaq-dashboard-new-widget-box-top">Get Support<span id="ewd-ufaq-dash-mobile-support-down-caret">&nbsp;&nbsp;&#9660;</span><span id="ewd-ufaq-dash-mobile-support-up-caret">&nbsp;&nbsp;&#9650;</span></div>
173
  <?php if ($UFAQ_Full_Version != "Yes" or get_option("EWD_UFAQ_Trial_Happening") == "Yes") { ?>
174
  <div class="ewd-ufaq-dashboard-new-widget-box ewd-widget-box-full" id="ewd-ufaq-dashboard-get-premium-widget-box">
175
  <div class="ewd-ufaq-dashboard-new-widget-box-top">Get Premium</div>
176
+
177
+ <?php if ( get_option("EWD_UFAQ_Trial_Happening") == "Yes" ) { do_action( 'ewd_trial_happening', 'UFAQ' ); } ?>
178
+
 
 
 
 
 
 
 
 
 
 
 
 
179
  <div class="ewd-ufaq-dashboard-new-widget-box-bottom">
180
  <div class="ewd-ufaq-dashboard-get-premium-widget-features-title"<?php echo ( get_option("EWD_UFAQ_Trial_Happening") == "Yes" ? "style='padding-top: 20px;'" : ""); ?>>GET FULL ACCESS WITH OUR PREMIUM VERSION AND GET:</div>
181
  <ul class="ewd-ufaq-dashboard-get-premium-widget-features">
186
  <li>+ More</li>
187
  </ul>
188
  <a href="https://www.etoilewebdesign.com/license-payment/?Selected=UFAQ&Quantity=1" class="ewd-ufaq-dashboard-get-premium-widget-button" target="_blank">UPGRADE NOW</a>
189
+ <?php if ( ! get_option( "EWD_UFAQ_Trial_Happening" ) ) {
190
+ $trial_info = sprintf( __( '<a href="%s" target="_blank">Visit our website</a> to learn how to get a free 7-day trial of the premium plugin.'), 'https://www.etoilewebdesign.com/premium-upgrade-instructions/' );
191
+
192
+ echo apply_filters( 'ewd_trial_button', $trial_info, 'UFAQ' );
193
+ } ?>
 
 
194
  </div>
195
  </div>
196
  <?php } ?>
html/OptionsPage.php CHANGED
@@ -128,7 +128,7 @@
128
  $UFAQ_Styling_FAQ_Heading_Type = get_option("EWD_UFAQ_Styling_FAQ_Heading_Type");
129
  $Toggle_Symbol = get_option("EWD_UFAQ_Toggle_Symbol");
130
 
131
- if (isset($_POST['Display_Tab'])) {$Display_Tab = $_POST['Display_Tab'];}
132
  else {$Display_Tab = "";}
133
  ?>
134
  <div class="wrap ufaq-options-page-tabbed">
@@ -149,7 +149,7 @@
149
  <form method="post" action="admin.php?page=EWD-UFAQ-Options&DisplayPage=Options&Action=EWD_UFAQ_UpdateOptions">
150
  <?php wp_nonce_field( 'EWD_UFAQ_Save_Options', 'EWD_UFAQ_Save_Options_Nonce' ); ?>
151
 
152
- <input type='hidden' name='Display_Tab' value='<?php echo $Display_Tab; ?>' />
153
 
154
  <div id='Basic' class='ufaq-option-set<?php echo ( ($Display_Tab == '' or $Display_Tab == 'Basic') ? '' : ' ufaq-hidden' ); ?>'>
155
  <h2 id='label-basic-options' class='ufaq-options-page-tab-title'>Basic Options</h2>
128
  $UFAQ_Styling_FAQ_Heading_Type = get_option("EWD_UFAQ_Styling_FAQ_Heading_Type");
129
  $Toggle_Symbol = get_option("EWD_UFAQ_Toggle_Symbol");
130
 
131
+ if (isset($_POST['Display_Tab'])) {$Display_Tab = sanitize_text_field( $_POST['Display_Tab'] );}
132
  else {$Display_Tab = "";}
133
  ?>
134
  <div class="wrap ufaq-options-page-tabbed">
149
  <form method="post" action="admin.php?page=EWD-UFAQ-Options&DisplayPage=Options&Action=EWD_UFAQ_UpdateOptions">
150
  <?php wp_nonce_field( 'EWD_UFAQ_Save_Options', 'EWD_UFAQ_Save_Options_Nonce' ); ?>
151
 
152
+ <input type='hidden' name='Display_Tab' value='<?php echo esc_attr( $Display_Tab ); ?>' />
153
 
154
  <div id='Basic' class='ufaq-option-set<?php echo ( ($Display_Tab == '' or $Display_Tab == 'Basic') ? '' : ' ufaq-hidden' ); ?>'>
155
  <h2 id='label-basic-options' class='ufaq-options-page-tab-title'>Basic Options</h2>
readme.txt CHANGED
@@ -289,6 +289,10 @@ Video 3 - FAQs Ordering
289
 
290
  == Changelog ==
291
 
 
 
 
 
292
  = 1.9.4 =
293
  - Update to correct a potential minor XSS vulnerability
294
 
289
 
290
  == Changelog ==
291
 
292
+ = 1.9.5 =
293
+ - Correcting/eliminating several PHP notices
294
+ - Updating the version of FPDF used to 1.82
295
+
296
  = 1.9.4 =
297
  - Update to correct a potential minor XSS vulnerability
298