From 56f7a3990023caa0052dbb1b9185b03c56c35517 Mon Sep 17 00:00:00 2001 From: Sashi20 Date: Wed, 7 Oct 2020 12:53:11 +0530 Subject: Update FPDF version --- pdf/fpdf/FAQ.htm | 223 ++++------ pdf/fpdf/changelog.htm | 23 +- pdf/fpdf/doc/__construct.htm | 63 +++ pdf/fpdf/doc/acceptpagebreak.htm | 4 +- pdf/fpdf/doc/addfont.htm | 2 +- pdf/fpdf/doc/addlink.htm | 10 +- pdf/fpdf/doc/addpage.htm | 15 +- pdf/fpdf/doc/aliasnbpages.htm | 4 +- pdf/fpdf/doc/cell.htm | 20 +- pdf/fpdf/doc/close.htm | 2 +- pdf/fpdf/doc/error.htm | 7 +- pdf/fpdf/doc/footer.htm | 2 +- pdf/fpdf/doc/getpageheight.htm | 18 + pdf/fpdf/doc/getpagewidth.htm | 18 + pdf/fpdf/doc/getstringwidth.htm | 0 pdf/fpdf/doc/getx.htm | 6 +- pdf/fpdf/doc/gety.htm | 6 +- pdf/fpdf/doc/header.htm | 2 +- pdf/fpdf/doc/image.htm | 2 +- pdf/fpdf/doc/index.htm | 10 +- pdf/fpdf/doc/line.htm | 4 +- pdf/fpdf/doc/link.htm | 8 +- pdf/fpdf/doc/ln.htm | 2 +- pdf/fpdf/doc/multicell.htm | 16 +- pdf/fpdf/doc/output.htm | 36 +- pdf/fpdf/doc/pageno.htm | 2 +- pdf/fpdf/doc/rect.htm | 6 +- pdf/fpdf/doc/setauthor.htm | 8 +- pdf/fpdf/doc/setautopagebreak.htm | 6 +- pdf/fpdf/doc/setcompression.htm | 0 pdf/fpdf/doc/setcreator.htm | 8 +- pdf/fpdf/doc/setdisplaymode.htm | 0 pdf/fpdf/doc/setdrawcolor.htm | 12 +- pdf/fpdf/doc/setfillcolor.htm | 10 +- pdf/fpdf/doc/setfont.htm | 10 +- pdf/fpdf/doc/setfontsize.htm | 2 +- pdf/fpdf/doc/setkeywords.htm | 8 +- pdf/fpdf/doc/setleftmargin.htm | 8 +- pdf/fpdf/doc/setlinewidth.htm | 8 +- pdf/fpdf/doc/setlink.htm | 2 +- pdf/fpdf/doc/setmargins.htm | 8 +- pdf/fpdf/doc/setrightmargin.htm | 8 +- pdf/fpdf/doc/setsubject.htm | 8 +- pdf/fpdf/doc/settextcolor.htm | 10 +- pdf/fpdf/doc/settitle.htm | 8 +- pdf/fpdf/doc/settopmargin.htm | 8 +- pdf/fpdf/doc/setx.htm | 8 +- pdf/fpdf/doc/setxy.htm | 4 +- pdf/fpdf/doc/sety.htm | 16 +- pdf/fpdf/doc/text.htm | 10 +- pdf/fpdf/doc/write.htm | 10 +- pdf/fpdf/font/courier.php | 2 + pdf/fpdf/font/courierb.php | 2 + pdf/fpdf/font/courierbi.php | 2 + pdf/fpdf/font/courieri.php | 2 + pdf/fpdf/font/helvetica.php | 2 + pdf/fpdf/font/helveticab.php | 2 + pdf/fpdf/font/helveticabi.php | 2 + pdf/fpdf/font/helveticai.php | 2 + pdf/fpdf/font/symbol.php | 1 + pdf/fpdf/font/times.php | 2 + pdf/fpdf/font/timesb.php | 2 + pdf/fpdf/font/timesbi.php | 2 + pdf/fpdf/font/timesi.php | 2 + pdf/fpdf/font/zapfdingbats.php | 1 + pdf/fpdf/fpdf.css | 2 +- pdf/fpdf/fpdf.php | 902 +++++++++++++++++++++----------------- pdf/fpdf/install.txt | 0 pdf/fpdf/license.txt | 0 pdf/fpdf/makefont/cp1250.map | 0 pdf/fpdf/makefont/cp1251.map | 0 pdf/fpdf/makefont/cp1252.map | 0 pdf/fpdf/makefont/cp1253.map | 0 pdf/fpdf/makefont/cp1254.map | 0 pdf/fpdf/makefont/cp1255.map | 0 pdf/fpdf/makefont/cp1257.map | 0 pdf/fpdf/makefont/cp1258.map | 0 pdf/fpdf/makefont/cp874.map | 0 pdf/fpdf/makefont/iso-8859-1.map | 0 pdf/fpdf/makefont/iso-8859-11.map | 0 pdf/fpdf/makefont/iso-8859-15.map | 0 pdf/fpdf/makefont/iso-8859-16.map | 0 pdf/fpdf/makefont/iso-8859-2.map | 0 pdf/fpdf/makefont/iso-8859-4.map | 0 pdf/fpdf/makefont/iso-8859-5.map | 0 pdf/fpdf/makefont/iso-8859-7.map | 0 pdf/fpdf/makefont/iso-8859-9.map | 0 pdf/fpdf/makefont/koi8-r.map | 0 pdf/fpdf/makefont/koi8-u.map | 0 pdf/fpdf/makefont/makefont.php | 144 ++++-- pdf/fpdf/makefont/ttfparser.php | 544 ++++++++++++++++++++--- pdf/fpdf/tutorial/20k_c1.txt | 0 pdf/fpdf/tutorial/20k_c2.txt | 0 pdf/fpdf/tutorial/calligra.php | 4 +- pdf/fpdf/tutorial/calligra.ttf | Bin pdf/fpdf/tutorial/calligra.z | Bin 25604 -> 22477 bytes pdf/fpdf/tutorial/countries.txt | 0 pdf/fpdf/tutorial/index.htm | 4 +- pdf/fpdf/tutorial/logo.png | Bin pdf/fpdf/tutorial/makefont.php | 0 pdf/fpdf/tutorial/tuto1.htm | 8 +- pdf/fpdf/tutorial/tuto1.php | 0 pdf/fpdf/tutorial/tuto2.htm | 0 pdf/fpdf/tutorial/tuto2.php | 0 pdf/fpdf/tutorial/tuto3.htm | 0 pdf/fpdf/tutorial/tuto3.php | 0 pdf/fpdf/tutorial/tuto4.htm | 8 +- pdf/fpdf/tutorial/tuto4.php | 6 +- pdf/fpdf/tutorial/tuto5.htm | 0 pdf/fpdf/tutorial/tuto5.php | 0 pdf/fpdf/tutorial/tuto6.htm | 19 +- pdf/fpdf/tutorial/tuto6.php | 19 +- pdf/fpdf/tutorial/tuto7.htm | 104 ++--- pdf/fpdf/tutorial/tuto7.php | 0 114 files changed, 1546 insertions(+), 935 deletions(-) mode change 100755 => 100644 pdf/fpdf/FAQ.htm mode change 100755 => 100644 pdf/fpdf/changelog.htm create mode 100644 pdf/fpdf/doc/__construct.htm mode change 100755 => 100644 pdf/fpdf/doc/acceptpagebreak.htm mode change 100755 => 100644 pdf/fpdf/doc/addfont.htm mode change 100755 => 100644 pdf/fpdf/doc/addlink.htm mode change 100755 => 100644 pdf/fpdf/doc/addpage.htm mode change 100755 => 100644 pdf/fpdf/doc/aliasnbpages.htm mode change 100755 => 100644 pdf/fpdf/doc/cell.htm mode change 100755 => 100644 pdf/fpdf/doc/close.htm mode change 100755 => 100644 pdf/fpdf/doc/error.htm mode change 100755 => 100644 pdf/fpdf/doc/footer.htm create mode 100644 pdf/fpdf/doc/getpageheight.htm create mode 100644 pdf/fpdf/doc/getpagewidth.htm mode change 100755 => 100644 pdf/fpdf/doc/getstringwidth.htm mode change 100755 => 100644 pdf/fpdf/doc/getx.htm mode change 100755 => 100644 pdf/fpdf/doc/gety.htm mode change 100755 => 100644 pdf/fpdf/doc/header.htm mode change 100755 => 100644 pdf/fpdf/doc/image.htm mode change 100755 => 100644 pdf/fpdf/doc/index.htm mode change 100755 => 100644 pdf/fpdf/doc/line.htm mode change 100755 => 100644 pdf/fpdf/doc/link.htm mode change 100755 => 100644 pdf/fpdf/doc/ln.htm mode change 100755 => 100644 pdf/fpdf/doc/multicell.htm mode change 100755 => 100644 pdf/fpdf/doc/output.htm mode change 100755 => 100644 pdf/fpdf/doc/pageno.htm mode change 100755 => 100644 pdf/fpdf/doc/rect.htm mode change 100755 => 100644 pdf/fpdf/doc/setauthor.htm mode change 100755 => 100644 pdf/fpdf/doc/setautopagebreak.htm mode change 100755 => 100644 pdf/fpdf/doc/setcompression.htm mode change 100755 => 100644 pdf/fpdf/doc/setcreator.htm mode change 100755 => 100644 pdf/fpdf/doc/setdisplaymode.htm mode change 100755 => 100644 pdf/fpdf/doc/setdrawcolor.htm mode change 100755 => 100644 pdf/fpdf/doc/setfillcolor.htm mode change 100755 => 100644 pdf/fpdf/doc/setfont.htm mode change 100755 => 100644 pdf/fpdf/doc/setfontsize.htm mode change 100755 => 100644 pdf/fpdf/doc/setkeywords.htm mode change 100755 => 100644 pdf/fpdf/doc/setleftmargin.htm mode change 100755 => 100644 pdf/fpdf/doc/setlinewidth.htm mode change 100755 => 100644 pdf/fpdf/doc/setlink.htm mode change 100755 => 100644 pdf/fpdf/doc/setmargins.htm mode change 100755 => 100644 pdf/fpdf/doc/setrightmargin.htm mode change 100755 => 100644 pdf/fpdf/doc/setsubject.htm mode change 100755 => 100644 pdf/fpdf/doc/settextcolor.htm mode change 100755 => 100644 pdf/fpdf/doc/settitle.htm mode change 100755 => 100644 pdf/fpdf/doc/settopmargin.htm mode change 100755 => 100644 pdf/fpdf/doc/setx.htm mode change 100755 => 100644 pdf/fpdf/doc/setxy.htm mode change 100755 => 100644 pdf/fpdf/doc/sety.htm mode change 100755 => 100644 pdf/fpdf/doc/text.htm mode change 100755 => 100644 pdf/fpdf/doc/write.htm mode change 100755 => 100644 pdf/fpdf/font/courier.php mode change 100755 => 100644 pdf/fpdf/font/courierb.php mode change 100755 => 100644 pdf/fpdf/font/courierbi.php mode change 100755 => 100644 pdf/fpdf/font/courieri.php mode change 100755 => 100644 pdf/fpdf/font/helvetica.php mode change 100755 => 100644 pdf/fpdf/font/helveticab.php mode change 100755 => 100644 pdf/fpdf/font/helveticabi.php mode change 100755 => 100644 pdf/fpdf/font/helveticai.php mode change 100755 => 100644 pdf/fpdf/font/symbol.php mode change 100755 => 100644 pdf/fpdf/font/times.php mode change 100755 => 100644 pdf/fpdf/font/timesb.php mode change 100755 => 100644 pdf/fpdf/font/timesbi.php mode change 100755 => 100644 pdf/fpdf/font/timesi.php mode change 100755 => 100644 pdf/fpdf/font/zapfdingbats.php mode change 100755 => 100644 pdf/fpdf/fpdf.css mode change 100755 => 100644 pdf/fpdf/fpdf.php mode change 100755 => 100644 pdf/fpdf/install.txt mode change 100755 => 100644 pdf/fpdf/license.txt mode change 100755 => 100644 pdf/fpdf/makefont/cp1250.map mode change 100755 => 100644 pdf/fpdf/makefont/cp1251.map mode change 100755 => 100644 pdf/fpdf/makefont/cp1252.map mode change 100755 => 100644 pdf/fpdf/makefont/cp1253.map mode change 100755 => 100644 pdf/fpdf/makefont/cp1254.map mode change 100755 => 100644 pdf/fpdf/makefont/cp1255.map mode change 100755 => 100644 pdf/fpdf/makefont/cp1257.map mode change 100755 => 100644 pdf/fpdf/makefont/cp1258.map mode change 100755 => 100644 pdf/fpdf/makefont/cp874.map mode change 100755 => 100644 pdf/fpdf/makefont/iso-8859-1.map mode change 100755 => 100644 pdf/fpdf/makefont/iso-8859-11.map mode change 100755 => 100644 pdf/fpdf/makefont/iso-8859-15.map mode change 100755 => 100644 pdf/fpdf/makefont/iso-8859-16.map mode change 100755 => 100644 pdf/fpdf/makefont/iso-8859-2.map mode change 100755 => 100644 pdf/fpdf/makefont/iso-8859-4.map mode change 100755 => 100644 pdf/fpdf/makefont/iso-8859-5.map mode change 100755 => 100644 pdf/fpdf/makefont/iso-8859-7.map mode change 100755 => 100644 pdf/fpdf/makefont/iso-8859-9.map mode change 100755 => 100644 pdf/fpdf/makefont/koi8-r.map mode change 100755 => 100644 pdf/fpdf/makefont/koi8-u.map mode change 100755 => 100644 pdf/fpdf/makefont/makefont.php mode change 100755 => 100644 pdf/fpdf/makefont/ttfparser.php mode change 100755 => 100644 pdf/fpdf/tutorial/20k_c1.txt mode change 100755 => 100644 pdf/fpdf/tutorial/20k_c2.txt mode change 100755 => 100644 pdf/fpdf/tutorial/calligra.php mode change 100755 => 100644 pdf/fpdf/tutorial/calligra.ttf mode change 100755 => 100644 pdf/fpdf/tutorial/calligra.z mode change 100755 => 100644 pdf/fpdf/tutorial/countries.txt mode change 100755 => 100644 pdf/fpdf/tutorial/index.htm mode change 100755 => 100644 pdf/fpdf/tutorial/logo.png mode change 100755 => 100644 pdf/fpdf/tutorial/makefont.php mode change 100755 => 100644 pdf/fpdf/tutorial/tuto1.htm mode change 100755 => 100644 pdf/fpdf/tutorial/tuto1.php mode change 100755 => 100644 pdf/fpdf/tutorial/tuto2.htm mode change 100755 => 100644 pdf/fpdf/tutorial/tuto2.php mode change 100755 => 100644 pdf/fpdf/tutorial/tuto3.htm mode change 100755 => 100644 pdf/fpdf/tutorial/tuto3.php mode change 100755 => 100644 pdf/fpdf/tutorial/tuto4.htm mode change 100755 => 100644 pdf/fpdf/tutorial/tuto4.php mode change 100755 => 100644 pdf/fpdf/tutorial/tuto5.htm mode change 100755 => 100644 pdf/fpdf/tutorial/tuto5.php mode change 100755 => 100644 pdf/fpdf/tutorial/tuto6.htm mode change 100755 => 100644 pdf/fpdf/tutorial/tuto6.php mode change 100755 => 100644 pdf/fpdf/tutorial/tuto7.htm mode change 100755 => 100644 pdf/fpdf/tutorial/tuto7.php diff --git a/pdf/fpdf/FAQ.htm b/pdf/fpdf/FAQ.htm old mode 100755 new mode 100644 index 05d85c6..f41ad8a --- a/pdf/fpdf/FAQ.htm +++ b/pdf/fpdf/FAQ.htm @@ -14,19 +14,19 @@ ul#answers li {margin-top:1.8em}
2. When I try to create a PDF, a lot of weird characters show on the screen. Why?
-These "weird" characters are in fact the actual content of your PDF. This behavior is a bug of -IE6. When it first receives an HTML page, then a PDF from the same URL, it displays it directly -without launching Acrobat. This happens frequently during the development stage: on the least -script error, an HTML page is sent, and after correction, the PDF arrives. +2. I get the following error when I try to generate a PDF: Some data has already been output, can't send PDF file
+You must send nothing to the browser except the PDF itself: no HTML, no space, no carriage return. A common +case is having extra blank at the end of an included script file.ob_end_clean();
+3. I try to generate a PDF and IE displays a blank page. What happens?
-First of all, check that you send nothing to the browser after the PDF (not even a space or a -carriage return). You can put an exit statement just after the call to the Output() method to -be sure. If it still doesn't work, it means you're a victim of the "blank page syndrome". IE -used in conjunction with the Acrobat plug-in suffers from many bugs. To avoid these problems -in a reliable manner, two main techniques exist: -3. Accented letters are replaced with some strange characters like é.
+Don't use UTF-8 with the standard fonts; they expect text encoded in ISO-8859-1 or windows-1252. +You can use utf8_decode() to perform a conversion to ISO-8859-1://Determine a temporary file name in the current directory
-$file = basename(tempnam('.', 'tmp'));
-rename($file, $file.'.pdf');
-$file .= '.pdf';
-//Save PDF to file
-$pdf->Output($file, 'F');
-//Redirect
-header('Location: '.$file);
+$str = utf8_decode($str);
function CleanFiles($dir)
-{
- //Delete temporary files
- $t = time();
- $h = opendir($dir);
- while($file=readdir($h))
- {
- if(substr($file,0,3)=='tmp' && substr($file,-4)=='.pdf')
- {
- $path = $dir.'/'.$file;
- if($t-filemtime($path)>3600)
- @unlink($path);
- }
- }
- closedir($h);
-}
+$str = iconv('UTF-8', 'windows-1252', $str);
4. I can't make line breaks work. I put \n in the string printed by MultiCell but it doesn't work.
-You have to enclose your string with double quotes, not single ones. +4. I try to display the Euro symbol but it doesn't work.
+The standard fonts have the Euro character at position 128. You can define a constant like this +for convenience: +define('EURO', chr(128));
+6. I defined the Header and Footer methods in my PDF class but nothing appears.
+6. I have defined the Header and Footer methods in my PDF class but nothing shows.
You have to create an object from the PDF class, not FPDF:$pdf = new PDF();
@@ -151,64 +119,34 @@ You have to create an object from the PDF class, not FPDF:
7. Accented characters are replaced by some strange characters like é.
-Don't use UTF-8 encoding. Standard FPDF fonts use ISO-8859-1 or Windows-1252. -It is possible to perform a conversion to ISO-8859-1 with utf8_decode(): -$str = utf8_decode($str);
-$str = iconv('UTF-8', 'windows-1252', $str);
-7. I can't make line breaks work. I put \n in the string printed by MultiCell but it doesn't work.
+You have to enclose your string with double quotes, not single ones.8. I try to display the Euro symbol but it doesn't work.
-The standard fonts have the Euro character at position 128. You can define a constant like this -for convenience: -define('EURO', chr(128));
-8. I use jQuery to generate the PDF but it doesn't show.
+Don't use an AJAX request to retrieve the PDF.9. I get the following error when I try to generate a PDF: Some data has already been output, can't send PDF file
-You must send nothing to the browser except the PDF itself: no HTML, no space, no carriage return. A common -case is having extra blank at the end of an included script file.ob_end_clean();
-10. I draw a frame with very precise dimensions, but when printed I notice some differences.
+9. I draw a frame with very precise dimensions, but when printed I notice some differences.
To respect dimensions, select "None" for the Page Scaling setting instead of "Shrink to Printable Area" in the print dialog box.11. 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?
+10. 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?
Printers have physical margins (different depending on the models); it is therefore impossible to remove them and print on the whole surface of the paper.12. How can I put a background in my PDF?
+11. How can I put a background in my PDF?
For a picture, call Image() in the Header() method, before any other output. To set a background color, use Rect().13. How can I set a specific header or footer on the first page?
-Simply test the page number: +12. How can I set a specific header or footer on the first page?
+Just test the page number:function Header()
{
@@ -226,8 +164,8 @@ Simply test the page number:
14. I'd like to use extensions provided by different scripts. How can I combine them?
+13. I'd like to use extensions provided by different scripts. How can I combine them?
Use an inheritance chain. If you have two classes, say A in a.php:require('fpdf.php');
@@ -268,14 +206,19 @@ $pdf = new PDF();
14. How can I open the PDF in a new tab?
+Just do the same as you would for an HTML page or anything else: add a target="_blank" to your link or form. +15. How can I send the PDF by email?
-As any other file, but an easy way is to use PHPMailer and +As for any other file, but an easy way is to use PHPMailer and its in-memory attachment:$mail = new PHPMailer();
...
-$doc = $pdf->Output('', 'S');
+$doc = $pdf->Output('S');
$mail->AddStringAttachment($doc, 'doc.pdf', 'base64', 'application/pdf');
$mail->Send();
17. Can I modify a PDF with FPDF?
-It is possible to import pages from an existing PDF document thanks to the FPDI extension:18. I'd like to make a search engine in PHP and index PDF files. Can I do it with FPDF?
-No. But a GPL C utility does exist, pdftotext, which is able to extract the textual content from -a PDF. It is provided with the Xpdf package:19. Can I convert an HTML page to PDF with FPDF?
-Not real-world pages. But a GPL C utility does exist, htmldoc, which allows to do it and gives good results:20. Can I concatenate PDF files with FPDF?
-Not directly, but it is possible to use FPDI -to perform this task. Some free command-line tools also exist:__construct([string orientation [, string unit [, mixed size]]])
+orientation
P
or Portrait
L
or Landscape
P
.
+unit
pt
: pointmm
: millimetercm
: centimeterin
: inchmm
.
+size
A3
A4
A5
Letter
Legal
unit
).A4
.
+$pdf = new FPDF('P','mm',array(100,150));
+AddPage([string orientation [, mixed size]])
+AddPage([string orientation [, mixed size [, int rotation]]])
rotation
0
.
+