Skip to content

Commit f4104a0

Browse files
committed
Update to 1.85
1 parent b0ddd9c commit f4104a0

File tree

15 files changed

+187
-147
lines changed

15 files changed

+187
-147
lines changed

FAQ.htm

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,29 +46,28 @@ <h1>FAQ</h1>
4646
<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>
4747
You must send nothing to the browser except the PDF itself: no HTML, no space, no carriage return. A common
4848
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 will help you:<br>
5049
<br>
51-
<b>Warning:</b> Cannot modify header information - headers already sent by (output started at script.php:X)<br>
50+
The message may be followed by this indication:<br>
5251
<br>
53-
It means that script.php outputs something at line X. Go to that line and fix it.
54-
In case the message doesn't show, check if PHP warnings are enabled. If they are not, enable them. If they are,
55-
try adding this at the very beginning of your script:
52+
(output started at script.php:X)<br>
53+
<br>
54+
which gives you exactly the script and line number responsible for the output. If you don't see it,
55+
try adding this line at the very beginning of your script:
5656
<div class="doc-source">
5757
<pre><code>ob_end_clean();</code></pre>
5858
</div>
5959
</li>
6060

6161
<li id='q3'>
6262
<p><b>3.</b> <span class='question'>Accented letters are replaced with some strange characters like é.</span></p>
63-
Don't use UTF-8 with the standard fonts; they expect text encoded in ISO-8859-1 or windows-1252.
64-
You can use utf8_decode() to perform a conversion to ISO-8859-1:
63+
Don't use UTF-8 with the standard fonts; they expect text encoded in windows-1252.
64+
You can perform a conversion with iconv:
6565
<div class="doc-source">
66-
<pre><code>$str = utf8_decode($str);</code></pre>
66+
<pre><code>$str = iconv('UTF-8', 'windows-1252', $str);</code></pre>
6767
</div>
68-
But some characters such as Euro won't be translated correctly. If the iconv extension is available, the
69-
right way to do it is the following:
68+
Or with mbstring:
7069
<div class="doc-source">
71-
<pre><code>$str = iconv('UTF-8', 'windows-1252', $str);</code></pre>
70+
<pre><code>$str = mb_convert_encoding($str, 'windows-1252', 'UTF-8');</code></pre>
7271
</div>
7372
In case you need characters outside windows-1252, take a look at tutorial #7 or
7473
<a href="http://www.fpdf.org/?go=script&amp;id=92" target="_blank">tFPDF</a>.

changelog.htm

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@
1111
<body>
1212
<h1>Changelog</h1>
1313
<dl>
14+
<dt><strong>v1.85</strong> (2022-11-10)</dt>
15+
<dd>
16+
- Removed deprecation notices on PHP 8.2.<br>
17+
- Removed notices when passing null values instead of strings.<br>
18+
- The FPDF_VERSION constant was replaced by a class constant.<br>
19+
- The creation date of the PDF now includes the timezone.<br>
20+
- The content-type is now always application/pdf, even for downloads.<br>
21+
</dd>
1422
<dt><strong>v1.84</strong> (2021-08-28)</dt>
1523
<dd>
1624
- Fixed an issue related to annotations.<br>
@@ -21,7 +29,7 @@ <h1>Changelog</h1>
2129
</dd>
2230
<dt><strong>v1.82</strong> (2019-12-07)</dt>
2331
<dd>
24-
- Removed a deprecation notice under PHP 7.4.<br>
32+
- Removed a deprecation notice on PHP 7.4.<br>
2533
</dd>
2634
<dt><strong>v1.81</strong> (2015-12-20)</dt>
2735
<dd>
@@ -94,7 +102,7 @@ <h1>Changelog</h1>
94102
<dd>
95103
- Type1 font support.<br>
96104
- Added Baltic encoding.<br>
97-
- 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>
105+
- 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 on 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>
98106
- It's no longer necessary to set the decimal separator as dot to produce valid documents.<br>
99107
- The clickable area in a cell was always on the left independently from the text alignment.<br>
100108
- JPEG images in CMYK mode appeared in inverted colors.<br>

doc/__construct.htm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ <h2>Parameters</h2>
5353
</dd>
5454
</dl>
5555
<h2>Example</h2>
56-
Example with a custom 100x150 mm page size:
56+
Document with a custom 100x150 mm page size:
5757
<div class="doc-source">
58-
<pre><code>$pdf = new FPDF('P','mm',array(100,150));</code></pre>
58+
<pre><code>$pdf = new FPDF('P', 'mm', array(100,150));</code></pre>
5959
</div>
6060
<hr style="margin-top:1.5em">
6161
<div style="text-align:center"><a href="index.htm">Index</a></div>

doc/acceptpagebreak.htm

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -19,40 +19,40 @@ <h2>Example</h2>
1919
<div class="doc-source">
2020
<pre><code>class PDF extends FPDF
2121
{
22-
var $col = 0;
22+
protected $col = 0;
2323

24-
function SetCol($col)
25-
{
26-
// Move position to a column
27-
$this-&gt;col = $col;
28-
$x = 10+$col*65;
29-
$this-&gt;SetLeftMargin($x);
30-
$this-&gt;SetX($x);
31-
}
32-
33-
function AcceptPageBreak()
34-
{
35-
if($this-&gt;col&lt;2)
24+
function SetCol($col)
3625
{
37-
// Go to next column
38-
$this-&gt;SetCol($this-&gt;col+1);
39-
$this-&gt;SetY(10);
40-
return false;
26+
// Move position to a column
27+
$this-&gt;col = $col;
28+
$x = 10 + $col*65;
29+
$this-&gt;SetLeftMargin($x);
30+
$this-&gt;SetX($x);
4131
}
42-
else
32+
33+
function AcceptPageBreak()
4334
{
44-
// Go back to first column and issue page break
45-
$this-&gt;SetCol(0);
46-
return true;
35+
if($this-&gt;col&lt;2)
36+
{
37+
// Go to next column
38+
$this-&gt;SetCol($this-&gt;col+1);
39+
$this-&gt;SetY(10);
40+
return false;
41+
}
42+
else
43+
{
44+
// Go back to first column and issue page break
45+
$this-&gt;SetCol(0);
46+
return true;
47+
}
4748
}
4849
}
49-
}
5050

5151
$pdf = new PDF();
5252
$pdf-&gt;AddPage();
53-
$pdf-&gt;SetFont('Arial','',12);
53+
$pdf-&gt;SetFont('Arial', '', 12);
5454
for($i=1;$i&lt;=300;$i++)
55-
$pdf-&gt;Cell(0,5,"Line $i",0,1);
55+
$pdf-&gt;Cell(0, 5, "Line $i", 0, 1);
5656
$pdf-&gt;Output();</code></pre>
5757
</div>
5858
<h2>See also</h2>

doc/addfont.htm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ <h2>Parameters</h2>
4141
</dl>
4242
<h2>Example</h2>
4343
<div class="doc-source">
44-
<pre><code>$pdf-&gt;AddFont('Comic','I');</code></pre>
44+
<pre><code>$pdf-&gt;AddFont('Comic', 'I');</code></pre>
4545
</div>
4646
is equivalent to:
4747
<div class="doc-source">
48-
<pre><code>$pdf-&gt;AddFont('Comic','I','comici.php');</code></pre>
48+
<pre><code>$pdf-&gt;AddFont('Comic', 'I', 'comici.php');</code></pre>
4949
</div>
5050
<h2>See also</h2>
5151
<a href="setfont.htm">SetFont</a>

doc/aliasnbpages.htm

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ <h2>Example</h2>
2222
<div class="doc-source">
2323
<pre><code>class PDF extends FPDF
2424
{
25-
function Footer()
26-
{
27-
// Go to 1.5 cm from bottom
28-
$this-&gt;SetY(-15);
29-
// Select Arial italic 8
30-
$this-&gt;SetFont('Arial','I',8);
31-
// Print current and total page numbers
32-
$this-&gt;Cell(0,10,'Page '.$this-&gt;PageNo().'/{nb}',0,0,'C');
33-
}
25+
function Footer()
26+
{
27+
// Go to 1.5 cm from bottom
28+
$this-&gt;SetY(-15);
29+
// Select Arial italic 8
30+
$this-&gt;SetFont('Arial', 'I', 8);
31+
// Print current and total page numbers
32+
$this-&gt;Cell(0, 10, 'Page '.$this-&gt;PageNo().'/{nb}', 0, 0, 'C');
33+
}
3434
}
3535

3636
$pdf = new PDF();

doc/cell.htm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,11 @@ <h2>Parameters</h2>
8181
<h2>Example</h2>
8282
<div class="doc-source">
8383
<pre><code>// Set font
84-
$pdf-&gt;SetFont('Arial','B',16);
84+
$pdf-&gt;SetFont('Arial', 'B', 16);
8585
// Move to 8 cm to the right
8686
$pdf-&gt;Cell(80);
8787
// Centered text in a framed 20*10 mm cell and line break
88-
$pdf-&gt;Cell(20,10,'Title',1,1,'C');</code></pre>
88+
$pdf-&gt;Cell(20, 10, 'Title', 1, 1, 'C');</code></pre>
8989
</div>
9090
<h2>See also</h2>
9191
<a href="setfont.htm">SetFont</a>,

doc/footer.htm

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ <h2>Example</h2>
1616
<div class="doc-source">
1717
<pre><code>class PDF extends FPDF
1818
{
19-
function Footer()
20-
{
21-
// Go to 1.5 cm from bottom
22-
$this-&gt;SetY(-15);
23-
// Select Arial italic 8
24-
$this-&gt;SetFont('Arial','I',8);
25-
// Print centered page number
26-
$this-&gt;Cell(0,10,'Page '.$this-&gt;PageNo(),0,0,'C');
27-
}
19+
function Footer()
20+
{
21+
// Go to 1.5 cm from bottom
22+
$this-&gt;SetY(-15);
23+
// Select Arial italic 8
24+
$this-&gt;SetFont('Arial', 'I', 8);
25+
// Print centered page number
26+
$this-&gt;Cell(0, 10, 'Page '.$this-&gt;PageNo(), 0, 0, 'C');
27+
}
2828
}</code></pre>
2929
</div>
3030
<h2>See also</h2>

doc/header.htm

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@ <h2>Example</h2>
1616
<div class="doc-source">
1717
<pre><code>class PDF extends FPDF
1818
{
19-
function Header()
20-
{
21-
// Select Arial bold 15
22-
$this-&gt;SetFont('Arial','B',15);
23-
// Move to the right
24-
$this-&gt;Cell(80);
25-
// Framed title
26-
$this-&gt;Cell(30,10,'Title',1,0,'C');
27-
// Line break
28-
$this-&gt;Ln(20);
29-
}
19+
function Header()
20+
{
21+
// Select Arial bold 15
22+
$this-&gt;SetFont('Arial', 'B', 15);
23+
// Move to the right
24+
$this-&gt;Cell(80);
25+
// Framed title
26+
$this-&gt;Cell(30, 10, 'Title', 1, 0, 'C');
27+
// Line break
28+
$this-&gt;Ln(20);
29+
}
3030
}</code></pre>
3131
</div>
3232
<h2>See also</h2>

doc/image.htm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ <h2>Parameters</h2>
8787
<h2>Example</h2>
8888
<div class="doc-source">
8989
<pre><code>// Insert a logo in the top-left corner at 300 dpi
90-
$pdf-&gt;Image('logo.png',10,10,-300);
90+
$pdf-&gt;Image('logo.png', 10, 10, -300);
9191
// Insert a dynamic image from a URL
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>
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>
9393
</div>
9494
<h2>See also</h2>
9595
<a href="addlink.htm">AddLink</a>

0 commit comments

Comments
 (0)