1.What's exactly the license of FPDF? Are there any usage restrictions?
-FPDF is released under a permissive license: there is no usage restriction. You may embed it
-freely in your application (commercial or not), with or without modifications.
-
-
-
-
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.
-If you can't figure out where the problem comes from, this other message appearing just before can help you:
-
-Warning: Cannot modify header information - headers already sent by (output started at script.php:X)
-
-It means that script.php outputs something at line X. Go to this line and fix it.
-In case the message doesn't show, first check that you didn't disable warnings, then add this at the very
-beginning of your script:
-
-
ob_end_clean();
-
-If you still don't see it, disable zlib.output_compression in your php.ini and it should appear.
-
-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:
-
-
$str = utf8_decode($str);
-
-But some characters such as Euro won't be translated correctly. If the iconv extension is available, the
-right way to do it is the following:
-
-
$str = iconv('UTF-8', 'windows-1252', $str);
-
-In case you need characters outside windows-1252, take a look at tutorial #7 or
-tFPDF.
-
-
-
-
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));
-
-
-
-
-
5.I try to display a variable in the Header method but nothing prints.
-You have to use the global keyword to access global variables, for example:
-
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();
-
-
-
-
-
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 use jQuery to generate the PDF but it doesn't show.
-Don't use an AJAX request to retrieve the PDF.
-
-
-
-
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.
-
-
-
-
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.
-
-
-
-
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().
-
-
-
-
12.How can I set a specific header or footer on the first page?
16.What's the limit of the file sizes I can generate with FPDF?
-There is no particular limit. There are some constraints, however:
-
-
-- There is usually a maximum memory size allocated to PHP scripts. For very big documents,
-especially with images, the limit may be reached (the file being built in memory). The
-parameter is configured in the php.ini file.
-
-
-- The maximum execution time allocated to scripts defaults to 30 seconds. This limit can of course
-be easily reached. It is configured in php.ini and may be altered dynamically with set_time_limit().
-
-
-You can work around the memory limit with this script.
-
-
-
-
17.Can I modify a PDF with FPDF?
-It's possible to import pages from an existing PDF document thanks to the
-FPDI extension.
-Then you can add some content to them.
-
-
-
-
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's 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's possible to use FPDI
-to perform that task. Some free command-line tools also exist:
-pdftk and
-mbtPdfAsm.
-
-- Added GetPageWidth() and GetPageHeight().
-- Fixed a bug in SetXY().
-
-
v1.8 (2015-11-29)
-
-- PHP 5.1.0 or higher is now required.
-- The MakeFont utility now subsets fonts, which can greatly reduce font sizes.
-- Added ToUnicode CMaps to improve text extraction.
-- Added a parameter to AddPage() to rotate the page.
-- Added a parameter to SetY() to indicate whether the x position should be reset or not.
-- 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).
-- The Error() method now throws an exception.
-- Adding contents before the first AddPage() or after Close() now raises an error.
-- Outputting text with no font selected now raises an error.
-
-
v1.7 (2011-06-18)
-
-- The MakeFont utility has been completely rewritten and doesn't depend on ttf2pt1 anymore.
-- Alpha channel is now supported for PNGs.
-- When inserting an image, it's now possible to specify its resolution.
-- Default resolution for images was increased from 72 to 96 dpi.
-- When inserting a GIF image, no temporary file is used anymore if the PHP version is 5.1 or higher.
-- When output buffering is enabled and the PDF is about to be sent, the buffer is now cleared if it contains only a UTF-8 BOM and/or whitespace (instead of throwing an error).
-- Symbol and ZapfDingbats fonts now support underline style.
-- Custom page sizes are now checked to ensure that width is smaller than height.
-- Standard font files were changed to use the same format as user fonts.
-- A bug in the embedding of Type1 fonts was fixed.
-- A bug related to SetDisplayMode() and the current locale was fixed.
-- A display issue occurring with the Adobe Reader X plug-in was fixed.
-- An issue related to transparency with some versions of Adobe Reader was fixed.
-- The Content-Length header was removed because it caused an issue when the HTTP server applies compression.
-
-
v1.6 (2008-08-03)
-
-- PHP 4.3.10 or higher is now required.
-- GIF image support.
-- Images can now trigger page breaks.
-- Possibility to have different page formats in a single document.
-- Document properties (author, creator, keywords, subject and title) can now be specified in UTF-8.
-- Fixed a bug: when a PNG was inserted through a URL, an error sometimes occurred.
-- An automatic page break in Header() doesn't cause an infinite loop any more.
-- Removed some warning messages appearing with recent PHP versions.
-- Added HTTP headers to reduce problems with IE.
-
-
v1.53 (2004-12-31)
-
-- When the font subdirectory is in the same directory as fpdf.php, it's no longer necessary to define the FPDF_FONTPATH constant.
-- The array $HTTP_SERVER_VARS is no longer used. It could cause trouble on PHP5-based configurations with the register_long_arrays option disabled.
-- Fixed a problem related to Type1 font embedding which caused trouble to some PDF processors.
-- The file name sent to the browser could not contain a space character.
-- The Cell() method could not print the number 0 (you had to pass the string '0').
-
-
v1.52 (2003-12-30)
-
-- Image() now displays the image at 72 dpi if no dimension is given.
-- Output() takes a string as second parameter to indicate destination.
-- Open() is now called automatically by AddPage().
-- Inserting remote JPEG images doesn't generate an error any longer.
-- Decimal separator is forced to dot in the constructor.
-- Added several encodings (Turkish, Thai, Hebrew, Ukrainian and Vietnamese).
-- The last line of a right-aligned MultiCell() was not correctly aligned if it was terminated by a carriage return.
-- No more error message about already sent headers when outputting the PDF to the standard output from the command line.
-- The underlining was going too far for text containing characters \, ( or ).
-- $HTTP_ENV_VARS has been replaced by $HTTP_SERVER_VARS.
-
-
v1.51 (2002-08-03)
-
-- Type1 font support.
-- Added Baltic encoding.
-- The class now works internally in points with the origin at the bottom in order to avoid two bugs occurring with Acrobat 5: * The line thickness was too large when printed under Windows 98 SE and ME. * 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.
-- It's no longer necessary to set the decimal separator as dot to produce valid documents.
-- The clickable area in a cell was always on the left independently from the text alignment.
-- JPEG images in CMYK mode appeared in inverted colors.
-- Transparent PNG images in grayscale or true color mode were incorrectly handled.
-- Adding new fonts now works correctly even with the magic_quotes_runtime option set to on.
-
-
v1.5 (2002-05-28)
-
-- TrueType font (AddFont()) and encoding support (Western and Eastern Europe, Cyrillic and Greek).
-- Added Write() method.
-- Added underlined style.
-- Internal and external link support (AddLink(), SetLink(), Link()).
-- Added right margin management and methods SetRightMargin(), SetTopMargin().
-- Modification of SetDisplayMode() to select page layout.
-- The border parameter of MultiCell() now lets choose borders to draw as Cell().
-- When a document contains no page, Close() now calls AddPage() instead of causing a fatal error.
-
-
v1.41 (2002-03-13)
-
-- Fixed SetDisplayMode() which no longer worked (the PDF viewer used its default display).
-
-
v1.4 (2002-03-02)
-
-- PHP3 is no longer supported.
-- Page compression (SetCompression()).
-- Choice of page format and possibility to change orientation inside document.
-- Added AcceptPageBreak() method.
-- Ability to print the total number of pages (AliasNbPages()).
-- Choice of cell borders to draw.
-- New mode for Cell(): the current position can now move under the cell.
-- Ability to include an image by specifying height only (width is calculated automatically).
-- Fixed a bug: when a justified line triggered a page break, the footer inherited the corresponding word spacing.
-
-
v1.31 (2002-01-12)
-
-- Fixed a bug in drawing frame with MultiCell(): the last line always started from the left margin.
-- Removed Expires HTTP header (gives trouble in some situations).
-- Added Content-disposition HTTP header (seems to help in some situations).
-
-
v1.3 (2001-12-03)
-
-- Line break and text justification support (MultiCell()).
-- Color support (SetDrawColor(), SetFillColor(), SetTextColor()). Possibility to draw filled rectangles and paint cell background.
-- A cell whose width is declared null extends up to the right margin of the page.
-- Line width is now retained from page to page and defaults to 0.2 mm.
-- Added SetXY() method.
-- Fixed a passing by reference done in a deprecated manner for PHP4.
-
-
v1.2 (2001-11-11)
-
-- Added font metric files and GetStringWidth() method.
-- Centering and right-aligning text in cells.
-- Display mode control (SetDisplayMode()).
-- Added methods to set document properties (SetAuthor(), SetCreator(), SetKeywords(), SetSubject(), SetTitle()).
-- Possibility to force PDF download by browser.
-- Added SetX() and GetX() methods.
-- During automatic page break, current abscissa is now retained.
-
-
v1.11 (2001-10-20)
-
-- PNG support doesn't require PHP4/zlib any more. Data are now put directly into PDF without any decompression/recompression stage.
-- Image insertion now works correctly even with magic_quotes_runtime option set to on.
-
-
v1.1 (2001-10-07)
-
-- JPEG and PNG image support.
-
-
v1.01 (2001-10-03)
-
-- Fixed a bug involving page break: in case when Header() doesn't specify a font, the one from previous page was not restored and produced an incorrect document.
-
-__construct([string orientation [, string unit [, mixed size]]])
-
Description
-This is the class constructor. It allows to set up the page size, the orientation and the
-unit of measure used in all methods (except for font sizes).
-
Parameters
-
-
orientation
-
-Default page orientation. Possible values are (case insensitive):
-
-
P or Portrait
-
L or Landscape
-
-Default value is P.
-
-
unit
-
-User unit. Possible values are:
-
-
pt: point
-
mm: millimeter
-
cm: centimeter
-
in: inch
-
-A point equals 1/72 of inch, that is to say about 0.35 mm (an inch being 2.54 cm). This
-is a very common unit in typography; font sizes are expressed in that unit.
-
-
-Default value is mm.
-
-
size
-
-The size used for pages. It can be either one of the following values (case insensitive):
-
-
A3
-
A4
-
A5
-
Letter
-
Legal
-
-or an array containing the width and the height (expressed in the unit given by unit).
-
-Default value is A4.
-
-Whenever a page break condition is met, the method is called, and the break is issued or not
-depending on the returned value. The default implementation returns a value according to the
-mode selected by SetAutoPageBreak().
-
-This method is called automatically and should not be called directly by the application.
-
Example
-The method is overriden in an inherited class in order to obtain a 3 column layout:
-
-
class PDF extends FPDF
-{
-var $col = 0;
-
-function SetCol($col)
-{
- // Move position to a column
- $this->col = $col;
- $x = 10+$col*65;
- $this->SetLeftMargin($x);
- $this->SetX($x);
-}
-
-function AcceptPageBreak()
-{
- if($this->col<2)
- {
- // Go to next column
- $this->SetCol($this->col+1);
- $this->SetY(10);
- return false;
- }
- else
- {
- // Go back to first column and issue page break
- $this->SetCol(0);
- return true;
- }
-}
-}
-
-$pdf = new PDF();
-$pdf->AddPage();
-$pdf->SetFont('Arial','',12);
-for($i=1;$i<=300;$i++)
- $pdf->Cell(0,5,"Line $i",0,1);
-$pdf->Output();
-AddFont(string family [, string style [, string file]])
-
Description
-Imports a TrueType, OpenType or Type1 font and makes it available. It is necessary to generate a font
-definition file first with the MakeFont utility.
-
-The definition file (and the font file itself when embedding) must be present in the font directory.
-If it is not found, the error "Could not include font definition file" is raised.
-
Parameters
-
-
family
-
-Font family. The name can be chosen arbitrarily. If it is a standard family name, it will
-override the corresponding font.
-
-
style
-
-Font style. Possible values are (case insensitive):
-
-
empty string: regular
-
B: bold
-
I: italic
-
BI or IB: bold italic
-
-The default value is regular.
-
-
file
-
-The font definition file.
-
-By default, the name is built from the family and style, in lower case with no space.
-
-Creates a new internal link and returns its identifier. An internal link is a clickable area
-which directs to another place within the document.
-
-The identifier can then be passed to Cell(), Write(), Image() or Link(). The destination is
-defined with SetLink().
-
-AddPage([string orientation [, mixed size [, int rotation]]])
-
Description
-Adds a new page to the document. If a page is already present, the Footer() method is called
-first to output the footer. Then the page is added, the current position set to the top-left
-corner according to the left and top margins, and Header() is called to display the header.
-
-The font which was set before calling is automatically restored. There is no need to call
-SetFont() again if you want to continue with the same font. The same is true for colors and
-line width.
-
-The origin of the coordinate system is at the top-left corner and increasing ordinates go
-downwards.
-
Parameters
-
-
orientation
-
-Page orientation. Possible values are (case insensitive):
-
-
P or Portrait
-
L or Landscape
-
-The default value is the one passed to the constructor.
-
-
size
-
-Page size. It can be either one of the following values (case insensitive):
-
-
A3
-
A4
-
A5
-
Letter
-
Legal
-
-or an array containing the width and the height (expressed in user unit).
-
-The default value is the one passed to the constructor.
-
-
rotation
-
-Angle by which to rotate the page. It must be a multiple of 90; positive values
-mean clockwise rotation. The default value is 0.
-
-Defines an alias for the total number of pages. It will be substituted as the document is
-closed.
-
Parameters
-
-
alias
-
-The alias. Default value: {nb}.
-
-
-
Example
-
-
class PDF extends FPDF
-{
-function Footer()
-{
- // Go to 1.5 cm from bottom
- $this->SetY(-15);
- // Select Arial italic 8
- $this->SetFont('Arial','I',8);
- // Print current and total page numbers
- $this->Cell(0,10,'Page '.$this->PageNo().'/{nb}',0,0,'C');
-}
-}
-
-$pdf = new PDF();
-$pdf->AliasNbPages();
-Cell(float w [, float h [, string txt [, mixed border [, int ln [, string align [, boolean fill [, mixed link]]]]]]])
-
Description
-Prints a cell (rectangular area) with optional borders, background color and character string.
-The upper-left corner of the cell corresponds to the current position. The text can be aligned
-or centered. After the call, the current position moves to the right or to the next line. It is
-possible to put a link on the text.
-
-If automatic page breaking is enabled and the cell goes beyond the limit, a page break is
-done before outputting.
-
Parameters
-
-
w
-
-Cell width. If 0, the cell extends up to the right margin.
-
-
h
-
-Cell height.
-Default value: 0.
-
-
txt
-
-String to print.
-Default value: empty string.
-
-
border
-
-Indicates if borders must be drawn around the cell. The value can be either a number:
-
-
0: no border
-
1: frame
-
-or a string containing some or all of the following characters (in any order):
-
-
L: left
-
T: top
-
R: right
-
B: bottom
-
-Default value: 0.
-
-
ln
-
-Indicates where the current position should go after the call. Possible values are:
-
-
0: to the right
-
1: to the beginning of the next line
-
2: below
-
-Putting 1 is equivalent to putting 0 and calling Ln() just after.
-Default value: 0.
-
-
align
-
-Allows to center or align the text. Possible values are:
-
-
L or empty string: left align (default value)
-
C: center
-
R: right align
-
-
-
fill
-
-Indicates if the cell background must be painted (true) or transparent (false).
-Default value: false.
-
-
link
-
-URL or identifier returned by AddLink().
-
-
-
Example
-
-
// Set font
-$pdf->SetFont('Arial','B',16);
-// Move to 8 cm to the right
-$pdf->Cell(80);
-// Centered text in a framed 20*10 mm cell and line break
-$pdf->Cell(20,10,'Title',1,1,'C');
-Terminates the PDF document. It is not necessary to call this method explicitly because Output()
-does it automatically.
-
-If the document contains no page, AddPage() is called to prevent from getting an invalid document.
-
-This method is automatically called in case of a fatal error; it simply throws an exception
-with the provided message.
-An inherited class may override it to customize the error handling but the method should
-never return, otherwise the resulting document would probably be invalid.
-
-This method is used to render the page footer. It is automatically called by AddPage() and
-Close() and should not be called directly by the application. The implementation in FPDF is
-empty, so you have to subclass it and override the method if you want a specific processing.
-
Example
-
-
class PDF extends FPDF
-{
-function Footer()
-{
- // Go to 1.5 cm from bottom
- $this->SetY(-15);
- // Select Arial italic 8
- $this->SetFont('Arial','I',8);
- // Print centered page number
- $this->Cell(0,10,'Page '.$this->PageNo(),0,0,'C');
-}
-}
-This method is used to render the page header. It is automatically called by AddPage() and
-should not be called directly by the application. The implementation in FPDF is empty, so
-you have to subclass it and override the method if you want a specific processing.
-
Example
-
-
class PDF extends FPDF
-{
-function Header()
-{
- // Select Arial bold 15
- $this->SetFont('Arial','B',15);
- // Move to the right
- $this->Cell(80);
- // Framed title
- $this->Cell(30,10,'Title',1,0,'C');
- // Line break
- $this->Ln(20);
-}
-}
-Image(string file [, float x [, float y [, float w [, float h [, string type [, mixed link]]]]]])
-
Description
-Puts an image. The size it will take on the page can be specified in different ways:
-
-
explicit width and height (expressed in user unit or dpi)
-
one explicit dimension, the other being calculated automatically in order to keep the original proportions
-
no explicit dimension, in which case the image is put at 96 dpi
-
-Supported formats are JPEG, PNG and GIF. The GD extension is required for GIF.
-
-
-For JPEGs, all flavors are allowed:
-
-
gray scales
-
true colors (24 bits)
-
CMYK (32 bits)
-
-For PNGs, are allowed:
-
-
gray scales on at most 8 bits (256 levels)
-
indexed colors
-
true colors (24 bits)
-
-For GIFs: in case of an animated GIF, only the first frame is displayed.
-
-Transparency is supported.
-
-The format can be specified explicitly or inferred from the file extension.
-
-It is possible to put a link on the image.
-
-Remark: if an image is used several times, only one copy is embedded in the file.
-
Parameters
-
-
file
-
-Path or URL of the image.
-
-
x
-
-Abscissa of the upper-left corner. If not specified or equal to null, the current abscissa
-is used.
-
-
y
-
-Ordinate of the upper-left corner. If not specified or equal to null, the current ordinate
-is used; moreover, a page break is triggered first if necessary (in case automatic page breaking is enabled)
-and, after the call, the current ordinate is moved to the bottom of the image.
-
-
w
-
-Width of the image in the page. There are three cases:
-
-
If the value is positive, it represents the width in user unit
-
If the value is negative, the absolute value represents the horizontal resolution in dpi
-
If the value is not specified or equal to zero, it is automatically calculated
-
-
-
h
-
-Height of the image in the page. There are three cases:
-
-
If the value is positive, it represents the height in user unit
-
If the value is negative, the absolute value represents the vertical resolution in dpi
-
If the value is not specified or equal to zero, it is automatically calculated
-
-
-
type
-
-Image format. Possible values are (case insensitive): JPG, JPEG, PNG and GIF.
-If not specified, the type is inferred from the file extension.
-
-
link
-
-URL or identifier returned by AddLink().
-
-
-
Example
-
-
// Insert a logo in the top-left corner at 300 dpi
-$pdf->Image('logo.png',10,10,-300);
-// Insert a dynamic image from a URL
-$pdf->Image('http://chart.googleapis.com/chart?cht=p3&chd=t:60,40&chs=250x100&chl=Hello|World',60,30,90,0,'PNG');
-__construct - constructor
-AcceptPageBreak - accept or not automatic page break
-AddFont - add a new font
-AddLink - create an internal link
-AddPage - add a new page
-AliasNbPages - define an alias for number of pages
-Cell - print a cell
-Close - terminate the document
-Error - fatal error
-Footer - page footer
-GetPageHeight - get current page height
-GetPageWidth - get current page width
-GetStringWidth - compute string length
-GetX - get current x position
-GetY - get current y position
-Header - page header
-Image - output an image
-Line - draw a line
-Link - put a link
-Ln - line break
-MultiCell - print text with line breaks
-Output - save or send the document
-PageNo - page number
-Rect - draw a rectangle
-SetAuthor - set the document author
-SetAutoPageBreak - set the automatic page breaking mode
-SetCompression - turn compression on or off
-SetCreator - set document creator
-SetDisplayMode - set display mode
-SetDrawColor - set drawing color
-SetFillColor - set filling color
-SetFont - set font
-SetFontSize - set font size
-SetKeywords - associate keywords with document
-SetLeftMargin - set left margin
-SetLineWidth - set line width
-SetLink - set internal link destination
-SetMargins - set margins
-SetRightMargin - set right margin
-SetSubject - set document subject
-SetTextColor - set text color
-SetTitle - set document title
-SetTopMargin - set top margin
-SetX - set current x position
-SetXY - set current x and y positions
-SetY - set current y position and optionally reset x
-Text - print a string
-Write - print flowing text
-
-
diff --git a/Classes/fpdf/doc/line.htm b/Classes/fpdf/doc/line.htm
deleted file mode 100755
index e232b4e..0000000
--- a/Classes/fpdf/doc/line.htm
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
-
-Line
-
-
-
-
-Puts a link on a rectangular area of the page. Text or image links are generally put via Cell(),
-Write() or Image(), but this method can be useful for instance to define a clickable area inside
-an image.
-
Parameters
-
-
x
-
-Abscissa of the upper-left corner of the rectangle.
-
-
y
-
-Ordinate of the upper-left corner of the rectangle.
-
-This method allows printing text with line breaks. They can be automatic (as soon as the
-text reaches the right border of the cell) or explicit (via the \n character). As many cells
-as necessary are output, one below the other.
-
-Text can be aligned, centered or justified. The cell block can be framed and the background
-painted.
-
Parameters
-
-
w
-
-Width of cells. If 0, they extend up to the right margin of the page.
-
-
h
-
-Height of cells.
-
-
txt
-
-String to print.
-
-
border
-
-Indicates if borders must be drawn around the cell block. The value can be either a number:
-
-
0: no border
-
1: frame
-
-or a string containing some or all of the following characters (in any order):
-
-
L: left
-
T: top
-
R: right
-
B: bottom
-
-Default value: 0.
-
-
align
-
-Sets the text alignment. Possible values are:
-
-
L: left alignment
-
C: center
-
R: right alignment
-
J: justification (default value)
-
-
-
fill
-
-Indicates if the cell background must be painted (true) or transparent (false).
-Default value: false.
-
-string Output([string dest [, string name [, boolean isUTF8]]])
-
Description
-Send the document to a given destination: browser, file or string. In the case of a browser, the
-PDF viewer may be used or a download may be forced.
-
-The method first calls Close() if necessary to terminate the document.
-
Parameters
-
-
dest
-
-Destination where to send the document. It can be one of the following:
-
-
I: send the file inline to the browser. The PDF viewer is used if available.
-
D: send to the browser and force a file download with the name given by name.
-
F: save to a local file with the name given by name (may include a path).
-
S: return the document as a string.
-
-The default value is I.
-
-
name
-
-The name of the file. It is ignored in case of destination S.
-The default value is doc.pdf.
-
-
isUTF8
-
-Indicates if name is encoded in ISO-8859-1 (false) or UTF-8 (true).
-Only used for destinations I and D.
-The default value is false.
-
-SetAutoPageBreak(boolean auto [, float margin])
-
Description
-Enables or disables the automatic page breaking mode. When enabling, the second parameter is
-the distance from the bottom of the page that defines the triggering limit. By default, the
-mode is on and the margin is 2 cm.
-
Parameters
-
-
auto
-
-Boolean indicating if mode should be on or off.
-
-Activates or deactivates page compression. When activated, the internal representation of
-each page is compressed, which leads to a compression ratio of about 2 for the resulting
-document.
-
-Compression is on by default.
-
-
-Note: the Zlib extension is required for this feature. If not present, compression
-will be turned off.
-
Parameters
-
-
compress
-
-Boolean indicating if compression must be enabled.
-
-Defines the way the document is to be displayed by the viewer. The zoom level can be set: pages can be
-displayed entirely on screen, occupy the full width of the window, use real size, be scaled by a
-specific zooming factor or use viewer default (configured in the Preferences menu of Adobe Reader).
-The page layout can be specified too: single at once, continuous display, two columns or viewer
-default.
-
Parameters
-
-
zoom
-
-The zoom to use. It can be one of the following string values:
-
-
fullpage: displays the entire page on screen
-
fullwidth: uses maximum width of window
-
real: uses real size (equivalent to 100% zoom)
-
default: uses viewer default mode
-
-or a number indicating the zooming factor to use.
-
-Defines the color used for all drawing operations (lines, rectangles and cell borders). It
-can be expressed in RGB components or gray scale. The method can be called before the first
-page is created and the value is retained from page to page.
-
Parameters
-
-
r
-
-If g et b are given, red component; if not, indicates the gray level.
-Value between 0 and 255.
-
-Defines the color used for all filling operations (filled rectangles and cell backgrounds).
-It can be expressed in RGB components or gray scale. The method can be called before the first
-page is created and the value is retained from page to page.
-
Parameters
-
-
r
-
-If g and b are given, red component; if not, indicates the gray level.
-Value between 0 and 255.
-
-SetFont(string family [, string style [, float size]])
-
Description
-Sets the font used to print character strings. It is mandatory to call this method
-at least once before printing text or the resulting document would not be valid.
-
-The font can be either a standard one or a font added via the AddFont() method. Standard fonts
-use the Windows encoding cp1252 (Western Europe).
-
-The method can be called before the first page is created and the font is kept from page
-to page.
-
-If you just wish to change the current font size, it is simpler to call SetFontSize().
-
-
-Note: the font definition files must be accessible. They are searched successively in:
-
-
The directory defined by the FPDF_FONTPATH constant (if this constant is defined)
-
The font directory located in the same directory as fpdf.php (if it exists)
-If the file corresponding to the requested font is not found, the error "Could not include font
-definition file" is raised.
-
Parameters
-
-
family
-
-Family font. It can be either a name defined by AddFont() or one of the standard families (case
-insensitive):
-
-
Courier (fixed-width)
-
Helvetica or Arial (synonymous; sans serif)
-
Times (serif)
-
Symbol (symbolic)
-
ZapfDingbats (symbolic)
-
-It is also possible to pass an empty string. In that case, the current family is kept.
-
-
style
-
-Font style. Possible values are (case insensitive):
-
-
empty string: regular
-
B: bold
-
I: italic
-
U: underline
-
-or any combination. The default value is regular.
-Bold and italic styles do not apply to Symbol and ZapfDingbats.
-
-
size
-
-Font size in points.
-
-The default value is the current size. If no size has been specified since the beginning of
-the document, the value taken is 12.
-
-
-
Example
-
-
// Times regular 12
-$pdf->SetFont('Times');
-// Arial bold 14
-$pdf->SetFont('Arial','B',14);
-// Removes bold
-$pdf->SetFont('');
-// Times bold, italic and underlined 14
-$pdf->SetFont('Times','BIU');
-Defines the left margin. The method can be called before creating the first page.
-
-If the current abscissa gets out of page, it is brought back to the margin.
-
-Defines the line width. By default, the value equals 0.2 mm. The method can be called before
-the first page is created and the value is retained from page to page.
-
-Defines the color used for text. It can be expressed in RGB components or gray scale. The
-method can be called before the first page is created and the value is retained from page to
-page.
-
Parameters
-
-
r
-
-If g et b are given, red component; if not, indicates the gray level.
-Value between 0 and 255.
-
-Defines the abscissa and ordinate of the current position. If the passed values are negative,
-they are relative respectively to the right and bottom of the page.
-
-Sets the ordinate and optionally moves the current abscissa back to the left margin. If the value
-is negative, it is relative to the bottom of the page.
-
Parameters
-
-
y
-
-The value of the ordinate.
-
-
resetX
-
-Whether to reset the abscissa. Default value: true.
-
-Prints a character string. The origin is on the left of the first character, on the baseline.
-This method allows to place a string precisely on the page, but it is usually easier to use
-Cell(), MultiCell() or Write() which are the standard methods to print text.
-
-This method prints text from the current position. When the right margin is reached (or the \n
-character is met) a line break occurs and text continues from the left margin. Upon method exit,
-the current position is left just at the end of the text.
-
-It is possible to put a link on the text.
-
Parameters
-
-
h
-
-Line height.
-
-
txt
-
-String to print.
-
-
link
-
-URL or identifier returned by AddLink().
-
-
-
Example
-
-
// Begin with regular font
-$pdf->SetFont('Arial','',14);
-$pdf->Write(5,'Visit ');
-// Then put a blue underlined link
-$pdf->SetTextColor(0,0,255);
-$pdf->SetFont('','U');
-$pdf->Write(5,'www.fpdf.org','http://www.fpdf.org');
-After including the library file, we create an FPDF object.
-The constructor is used here with the default values: pages are in A4 portrait and
-the unit of measure is millimeter. It could have been specified explicitly with:
-
-
$pdf = new FPDF('P','mm','A4');
-
-
-It's possible to use landscape (L), other page sizes (such as Letter and
-Legal) and units (pt, cm, in).
-
-
-There's no page at the moment, so we have to add one with AddPage(). The origin
-is at the upper-left corner and the current position is by default set at 1 cm from the
-borders; the margins can be changed with SetMargins().
-
-
-Before we can print text, it's mandatory to select a font with SetFont().
-We choose Arial bold 16:
-
-
$pdf->SetFont('Arial','B',16);
-
-
-We could have specified italics with I, underlined with U or a regular font with an empty string
-(or any combination). Note that the font size is given in points, not millimeters (or another user
-unit); it's the only exception. The other standard fonts are Times, Courier, Symbol and ZapfDingbats.
-
-
-We can now print a cell with Cell(). A cell is a rectangular area, possibly framed,
-which contains a line of text. It is output at the current position. We specify its dimensions,
-its text (centered or aligned), if borders should be drawn, and where the current position
-moves after it (to the right, below or to the beginning of the next line). To add a frame, we would do this:
-
-
$pdf->Cell(40,10,'Hello World !',1);
-
-
-To add a new cell next to it with centered text and go to the next line, we would do:
-
-
$pdf->Cell(60,10,'Powered by FPDF.',0,1,'C');
-
-
-Remark: the line break can also be done with Ln(). This method additionnaly allows to specify
-the height of the break.
-
-
-Finally, the document is closed and sent to the browser with Output(). We could have saved
-it to a file by passing the appropriate parameters.
-
-
-Caution: in case when the PDF is sent to the browser, nothing else must be output by the
-script, neither before nor after (no HTML, not even a space or a carriage return). If you send something
-before, you will get the error message: "Some data has already been output, can't send PDF file". If you
-send something after, the document might not display.
-
-
diff --git a/Classes/fpdf/tutorial/tuto1.php b/Classes/fpdf/tutorial/tuto1.php
deleted file mode 100755
index 3ab55a1..0000000
--- a/Classes/fpdf/tutorial/tuto1.php
+++ /dev/null
@@ -1,9 +0,0 @@
-AddPage();
-$pdf->SetFont('Arial','B',16);
-$pdf->Cell(40,10,'Hello World!');
-$pdf->Output();
-?>
diff --git a/Classes/fpdf/tutorial/tuto2.htm b/Classes/fpdf/tutorial/tuto2.htm
deleted file mode 100755
index c402cf4..0000000
--- a/Classes/fpdf/tutorial/tuto2.htm
+++ /dev/null
@@ -1,80 +0,0 @@
-
-
-
-
-Header, footer, page break and image
-
-
-
-
Header, footer, page break and image
-Here's a two page example with header, footer and logo:
-
-
<?php
-require('fpdf.php');
-
-class PDF extends FPDF
-{
-// Page header
-function Header()
-{
- // Logo
- $this->Image('logo.png',10,6,30);
- // Arial bold 15
- $this->SetFont('Arial','B',15);
- // Move to the right
- $this->Cell(80);
- // Title
- $this->Cell(30,10,'Title',1,0,'C');
- // Line break
- $this->Ln(20);
-}
-
-// Page footer
-function Footer()
-{
- // Position at 1.5 cm from bottom
- $this->SetY(-15);
- // Arial italic 8
- $this->SetFont('Arial','I',8);
- // Page number
- $this->Cell(0,10,'Page '.$this->PageNo().'/{nb}',0,0,'C');
-}
-}
-
-// Instanciation of inherited class
-$pdf = new PDF();
-$pdf->AliasNbPages();
-$pdf->AddPage();
-$pdf->SetFont('Times','',12);
-for($i=1;$i<=40;$i++)
- $pdf->Cell(0,10,'Printing line number '.$i,0,1);
-$pdf->Output();
-?>
-This example makes use of the Header() and Footer() methods to process page headers and
-footers. They are called automatically. They already exist in the FPDF class but do nothing,
-therefore we have to extend the class and override them.
-
-
-The logo is printed with the Image() method by specifying its upper-left corner and
-its width. The height is calculated automatically to respect the image proportions.
-
-
-To print the page number, a null value is passed as the cell width. It means that the cell
-should extend up to the right margin of the page; this is handy to center text. The current page
-number is returned by the PageNo() method; as for the total number of pages, it's obtained
-via the special value {nb} which is substituted when the document is finished
-(provided you first called AliasNbPages()).
-
-Note the use of the SetY() method which allows to set position at an absolute location in
-the page, starting from the top or the bottom.
-
-
-Another interesting feature is used here: the automatic page breaking. As soon as a cell would
-cross a limit in the page (at 2 centimeters from the bottom by default), a break is issued
-and the font restored. Although the header and footer select their own font (Arial), the body
-continues with Times. This mechanism of automatic restoration also applies to colors and line
-width. The limit which triggers page breaks can be set with SetAutoPageBreak().
-
-
diff --git a/Classes/fpdf/tutorial/tuto2.php b/Classes/fpdf/tutorial/tuto2.php
deleted file mode 100755
index 6a1b4f8..0000000
--- a/Classes/fpdf/tutorial/tuto2.php
+++ /dev/null
@@ -1,41 +0,0 @@
-Image('logo.png',10,6,30);
- // Arial bold 15
- $this->SetFont('Arial','B',15);
- // Move to the right
- $this->Cell(80);
- // Title
- $this->Cell(30,10,'Title',1,0,'C');
- // Line break
- $this->Ln(20);
-}
-
-// Page footer
-function Footer()
-{
- // Position at 1.5 cm from bottom
- $this->SetY(-15);
- // Arial italic 8
- $this->SetFont('Arial','I',8);
- // Page number
- $this->Cell(0,10,'Page '.$this->PageNo().'/{nb}',0,0,'C');
-}
-}
-
-// Instanciation of inherited class
-$pdf = new PDF();
-$pdf->AliasNbPages();
-$pdf->AddPage();
-$pdf->SetFont('Times','',12);
-for($i=1;$i<=40;$i++)
- $pdf->Cell(0,10,'Printing line number '.$i,0,1);
-$pdf->Output();
-?>
diff --git a/Classes/fpdf/tutorial/tuto3.htm b/Classes/fpdf/tutorial/tuto3.htm
deleted file mode 100755
index 5d8363f..0000000
--- a/Classes/fpdf/tutorial/tuto3.htm
+++ /dev/null
@@ -1,115 +0,0 @@
-
-
-
-
-Line breaks and colors
-
-
-
-
Line breaks and colors
-Let's continue with an example which prints justified paragraphs. It also illustrates the use
-of colors.
-
-
<?php
-require('fpdf.php');
-
-class PDF extends FPDF
-{
-function Header()
-{
- global $title;
-
- // Arial bold 15
- $this->SetFont('Arial','B',15);
- // Calculate width of title and position
- $w = $this->GetStringWidth($title)+6;
- $this->SetX((210-$w)/2);
- // Colors of frame, background and text
- $this->SetDrawColor(0,80,180);
- $this->SetFillColor(230,230,0);
- $this->SetTextColor(220,50,50);
- // Thickness of frame (1 mm)
- $this->SetLineWidth(1);
- // Title
- $this->Cell($w,9,$title,1,1,'C',true);
- // Line break
- $this->Ln(10);
-}
-
-function Footer()
-{
- // Position at 1.5 cm from bottom
- $this->SetY(-15);
- // Arial italic 8
- $this->SetFont('Arial','I',8);
- // Text color in gray
- $this->SetTextColor(128);
- // Page number
- $this->Cell(0,10,'Page '.$this->PageNo(),0,0,'C');
-}
-
-function ChapterTitle($num, $label)
-{
- // Arial 12
- $this->SetFont('Arial','',12);
- // Background color
- $this->SetFillColor(200,220,255);
- // Title
- $this->Cell(0,6,"Chapter $num : $label",0,1,'L',true);
- // Line break
- $this->Ln(4);
-}
-
-function ChapterBody($file)
-{
- // Read text file
- $txt = file_get_contents($file);
- // Times 12
- $this->SetFont('Times','',12);
- // Output justified text
- $this->MultiCell(0,5,$txt);
- // Line break
- $this->Ln();
- // Mention in italics
- $this->SetFont('','I');
- $this->Cell(0,5,'(end of excerpt)');
-}
-
-function PrintChapter($num, $title, $file)
-{
- $this->AddPage();
- $this->ChapterTitle($num,$title);
- $this->ChapterBody($file);
-}
-}
-
-$pdf = new PDF();
-$title = '20000 Leagues Under the Seas';
-$pdf->SetTitle($title);
-$pdf->SetAuthor('Jules Verne');
-$pdf->PrintChapter(1,'A RUNAWAY REEF','20k_c1.txt');
-$pdf->PrintChapter(2,'THE PROS AND CONS','20k_c2.txt');
-$pdf->Output();
-?>
-The GetStringWidth() method allows to determine the length of a string in the current font,
-which is used here to calculate the position and the width of the frame surrounding the title.
-Then colors are set (via SetDrawColor(), SetFillColor() and SetTextColor()) and the
-thickness of the line is set to 1 mm (instead of 0.2 by default) with SetLineWidth(). Finally,
-we output the cell (the last parameter true indicates that the background must
-be filled).
-
-
-The method used to print the paragraphs is MultiCell(). Each time a line reaches the
-right extremity of the cell or a carriage return character is met, a line break is issued
-and a new cell automatically created under the current one. Text is justified by default.
-
-
-Two document properties are defined: the title (SetTitle()) and the author (SetAuthor()).
-There are several ways to view them in Adobe Reader. The first one is to open the file directly with
-the reader, go to the File menu and choose the Properties option. The second one, also available from
-the plug-in, is to right-click and select Document Properties. The third method is to type the Ctrl+D
-key combination.
-
-
diff --git a/Classes/fpdf/tutorial/tuto3.php b/Classes/fpdf/tutorial/tuto3.php
deleted file mode 100755
index 3316ddb..0000000
--- a/Classes/fpdf/tutorial/tuto3.php
+++ /dev/null
@@ -1,81 +0,0 @@
-SetFont('Arial','B',15);
- // Calculate width of title and position
- $w = $this->GetStringWidth($title)+6;
- $this->SetX((210-$w)/2);
- // Colors of frame, background and text
- $this->SetDrawColor(0,80,180);
- $this->SetFillColor(230,230,0);
- $this->SetTextColor(220,50,50);
- // Thickness of frame (1 mm)
- $this->SetLineWidth(1);
- // Title
- $this->Cell($w,9,$title,1,1,'C',true);
- // Line break
- $this->Ln(10);
-}
-
-function Footer()
-{
- // Position at 1.5 cm from bottom
- $this->SetY(-15);
- // Arial italic 8
- $this->SetFont('Arial','I',8);
- // Text color in gray
- $this->SetTextColor(128);
- // Page number
- $this->Cell(0,10,'Page '.$this->PageNo(),0,0,'C');
-}
-
-function ChapterTitle($num, $label)
-{
- // Arial 12
- $this->SetFont('Arial','',12);
- // Background color
- $this->SetFillColor(200,220,255);
- // Title
- $this->Cell(0,6,"Chapter $num : $label",0,1,'L',true);
- // Line break
- $this->Ln(4);
-}
-
-function ChapterBody($file)
-{
- // Read text file
- $txt = file_get_contents($file);
- // Times 12
- $this->SetFont('Times','',12);
- // Output justified text
- $this->MultiCell(0,5,$txt);
- // Line break
- $this->Ln();
- // Mention in italics
- $this->SetFont('','I');
- $this->Cell(0,5,'(end of excerpt)');
-}
-
-function PrintChapter($num, $title, $file)
-{
- $this->AddPage();
- $this->ChapterTitle($num,$title);
- $this->ChapterBody($file);
-}
-}
-
-$pdf = new PDF();
-$title = '20000 Leagues Under the Seas';
-$pdf->SetTitle($title);
-$pdf->SetAuthor('Jules Verne');
-$pdf->PrintChapter(1,'A RUNAWAY REEF','20k_c1.txt');
-$pdf->PrintChapter(2,'THE PROS AND CONS','20k_c2.txt');
-$pdf->Output();
-?>
diff --git a/Classes/fpdf/tutorial/tuto4.htm b/Classes/fpdf/tutorial/tuto4.htm
deleted file mode 100755
index 05ccde2..0000000
--- a/Classes/fpdf/tutorial/tuto4.htm
+++ /dev/null
@@ -1,132 +0,0 @@
-
-
-
-
-Multi-columns
-
-
-
-
Multi-columns
-This example is a variant of the previous one showing how to lay the text across multiple
-columns.
-
-
<?php
-require('fpdf.php');
-
-class PDF extends FPDF
-{
-protected $col = 0; // Current column
-protected $y0; // Ordinate of column start
-
-function Header()
-{
- // Page header
- global $title;
-
- $this->SetFont('Arial','B',15);
- $w = $this->GetStringWidth($title)+6;
- $this->SetX((210-$w)/2);
- $this->SetDrawColor(0,80,180);
- $this->SetFillColor(230,230,0);
- $this->SetTextColor(220,50,50);
- $this->SetLineWidth(1);
- $this->Cell($w,9,$title,1,1,'C',true);
- $this->Ln(10);
- // Save ordinate
- $this->y0 = $this->GetY();
-}
-
-function Footer()
-{
- // Page footer
- $this->SetY(-15);
- $this->SetFont('Arial','I',8);
- $this->SetTextColor(128);
- $this->Cell(0,10,'Page '.$this->PageNo(),0,0,'C');
-}
-
-function SetCol($col)
-{
- // Set position at a given column
- $this->col = $col;
- $x = 10+$col*65;
- $this->SetLeftMargin($x);
- $this->SetX($x);
-}
-
-function AcceptPageBreak()
-{
- // Method accepting or not automatic page break
- if($this->col<2)
- {
- // Go to next column
- $this->SetCol($this->col+1);
- // Set ordinate to top
- $this->SetY($this->y0);
- // Keep on page
- return false;
- }
- else
- {
- // Go back to first column
- $this->SetCol(0);
- // Page break
- return true;
- }
-}
-
-function ChapterTitle($num, $label)
-{
- // Title
- $this->SetFont('Arial','',12);
- $this->SetFillColor(200,220,255);
- $this->Cell(0,6,"Chapter $num : $label",0,1,'L',true);
- $this->Ln(4);
- // Save ordinate
- $this->y0 = $this->GetY();
-}
-
-function ChapterBody($file)
-{
- // Read text file
- $txt = file_get_contents($file);
- // Font
- $this->SetFont('Times','',12);
- // Output text in a 6 cm width column
- $this->MultiCell(60,5,$txt);
- $this->Ln();
- // Mention
- $this->SetFont('','I');
- $this->Cell(0,5,'(end of excerpt)');
- // Go back to first column
- $this->SetCol(0);
-}
-
-function PrintChapter($num, $title, $file)
-{
- // Add chapter
- $this->AddPage();
- $this->ChapterTitle($num,$title);
- $this->ChapterBody($file);
-}
-}
-
-$pdf = new PDF();
-$title = '20000 Leagues Under the Seas';
-$pdf->SetTitle($title);
-$pdf->SetAuthor('Jules Verne');
-$pdf->PrintChapter(1,'A RUNAWAY REEF','20k_c1.txt');
-$pdf->PrintChapter(2,'THE PROS AND CONS','20k_c2.txt');
-$pdf->Output();
-?>
-A table being just a collection of cells, it's natural to build one from them. The first
-example is achieved in the most basic way possible: simple framed cells, all of the same size
-and left aligned. The result is rudimentary but very quick to obtain.
-
-
-The second table brings some improvements: each column has its own width, headings are centered,
-and numbers right aligned. Moreover, horizontal lines have been removed. This is done by means
-of the border parameter of the Cell() method, which specifies which sides of the
-cell must be drawn. Here we want the left (L) and right (R) ones. It remains
-the problem of the horizontal line to finish the table. There are two possibilities: either
-check for the last line in the loop, in which case we use LRB for the border
-parameter; or, as done here, add the line once the loop is over.
-
-
-The third table is similar to the second one but uses colors. Fill, text and line colors are
-simply specified. Alternate coloring for rows is obtained by using alternatively transparent
-and filled cells.
-
-
diff --git a/Classes/fpdf/tutorial/tuto5.php b/Classes/fpdf/tutorial/tuto5.php
deleted file mode 100755
index 252b70f..0000000
--- a/Classes/fpdf/tutorial/tuto5.php
+++ /dev/null
@@ -1,102 +0,0 @@
-Cell(40,7,$col,1);
- $this->Ln();
- // Data
- foreach($data as $row)
- {
- foreach($row as $col)
- $this->Cell(40,6,$col,1);
- $this->Ln();
- }
-}
-
-// Better table
-function ImprovedTable($header, $data)
-{
- // Column widths
- $w = array(40, 35, 40, 45);
- // Header
- for($i=0;$iCell($w[$i],7,$header[$i],1,0,'C');
- $this->Ln();
- // Data
- foreach($data as $row)
- {
- $this->Cell($w[0],6,$row[0],'LR');
- $this->Cell($w[1],6,$row[1],'LR');
- $this->Cell($w[2],6,number_format($row[2]),'LR',0,'R');
- $this->Cell($w[3],6,number_format($row[3]),'LR',0,'R');
- $this->Ln();
- }
- // Closing line
- $this->Cell(array_sum($w),0,'','T');
-}
-
-// Colored table
-function FancyTable($header, $data)
-{
- // Colors, line width and bold font
- $this->SetFillColor(255,0,0);
- $this->SetTextColor(255);
- $this->SetDrawColor(128,0,0);
- $this->SetLineWidth(.3);
- $this->SetFont('','B');
- // Header
- $w = array(40, 35, 40, 45);
- for($i=0;$iCell($w[$i],7,$header[$i],1,0,'C',true);
- $this->Ln();
- // Color and font restoration
- $this->SetFillColor(224,235,255);
- $this->SetTextColor(0);
- $this->SetFont('');
- // Data
- $fill = false;
- foreach($data as $row)
- {
- $this->Cell($w[0],6,$row[0],'LR',0,'L',$fill);
- $this->Cell($w[1],6,$row[1],'LR',0,'L',$fill);
- $this->Cell($w[2],6,number_format($row[2]),'LR',0,'R',$fill);
- $this->Cell($w[3],6,number_format($row[3]),'LR',0,'R',$fill);
- $this->Ln();
- $fill = !$fill;
- }
- // Closing line
- $this->Cell(array_sum($w),0,'','T');
-}
-}
-
-$pdf = new PDF();
-// Column headings
-$header = array('Country', 'Capital', 'Area (sq km)', 'Pop. (thousands)');
-// Data loading
-$data = $pdf->LoadData('countries.txt');
-$pdf->SetFont('Arial','',14);
-$pdf->AddPage();
-$pdf->BasicTable($header,$data);
-$pdf->AddPage();
-$pdf->ImprovedTable($header,$data);
-$pdf->AddPage();
-$pdf->FancyTable($header,$data);
-$pdf->Output();
-?>
diff --git a/Classes/fpdf/tutorial/tuto6.htm b/Classes/fpdf/tutorial/tuto6.htm
deleted file mode 100755
index 602a119..0000000
--- a/Classes/fpdf/tutorial/tuto6.htm
+++ /dev/null
@@ -1,154 +0,0 @@
-
-
-
-
-Links and flowing text
-
-
-
-
Links and flowing text
-This tutorial explains how to insert links (internal and external) and shows a new text writing
-mode. It also contains a basic HTML parser.
-
-
<?php
-require('fpdf.php');
-
-class PDF extends FPDF
-{
-protected $B = 0;
-protected $I = 0;
-protected $U = 0;
-protected $HREF = '';
-
-function WriteHTML($html)
-{
- // HTML parser
- $html = str_replace("\n",' ',$html);
- $a = preg_split('/<(.*)>/U',$html,-1,PREG_SPLIT_DELIM_CAPTURE);
- foreach($a as $i=>$e)
- {
- if($i%2==0)
- {
- // Text
- if($this->HREF)
- $this->PutLink($this->HREF,$e);
- else
- $this->Write(5,$e);
- }
- else
- {
- // Tag
- if($e[0]=='/')
- $this->CloseTag(strtoupper(substr($e,1)));
- else
- {
- // Extract attributes
- $a2 = explode(' ',$e);
- $tag = strtoupper(array_shift($a2));
- $attr = array();
- foreach($a2 as $v)
- {
- if(preg_match('/([^=]*)=["\']?([^"\']*)/',$v,$a3))
- $attr[strtoupper($a3[1])] = $a3[2];
- }
- $this->OpenTag($tag,$attr);
- }
- }
- }
-}
-
-function OpenTag($tag, $attr)
-{
- // Opening tag
- if($tag=='B' || $tag=='I' || $tag=='U')
- $this->SetStyle($tag,true);
- if($tag=='A')
- $this->HREF = $attr['HREF'];
- if($tag=='BR')
- $this->Ln(5);
-}
-
-function CloseTag($tag)
-{
- // Closing tag
- if($tag=='B' || $tag=='I' || $tag=='U')
- $this->SetStyle($tag,false);
- if($tag=='A')
- $this->HREF = '';
-}
-
-function SetStyle($tag, $enable)
-{
- // Modify style and select corresponding font
- $this->$tag += ($enable ? 1 : -1);
- $style = '';
- foreach(array('B', 'I', 'U') as $s)
- {
- if($this->$s>0)
- $style .= $s;
- }
- $this->SetFont('',$style);
-}
-
-function PutLink($URL, $txt)
-{
- // Put a hyperlink
- $this->SetTextColor(0,0,255);
- $this->SetStyle('U',true);
- $this->Write(5,$txt,$URL);
- $this->SetStyle('U',false);
- $this->SetTextColor(0);
-}
-}
-
-$html = 'You can now easily print text mixing different styles: <b>bold</b>, <i>italic</i>,
-<u>underlined</u>, or <b><i><u>all at once</u></i></b>!<br><br>You can also insert links on
-text, such as <a href="http://www.fpdf.org">www.fpdf.org</a>, or on an image: click on the logo.';
-
-$pdf = new PDF();
-// First page
-$pdf->AddPage();
-$pdf->SetFont('Arial','',20);
-$pdf->Write(5,"To find out what's new in this tutorial, click ");
-$pdf->SetFont('','U');
-$link = $pdf->AddLink();
-$pdf->Write(5,'here',$link);
-$pdf->SetFont('');
-// Second page
-$pdf->AddPage();
-$pdf->SetLink($link);
-$pdf->Image('logo.png',10,12,30,0,'','http://www.fpdf.org');
-$pdf->SetLeftMargin(45);
-$pdf->SetFontSize(14);
-$pdf->WriteHTML($html);
-$pdf->Output();
-?>
-The new method to print text is Write(). It's very close to MultiCell(); the differences are:
-
-
The end of line is at the right margin and the next line begins at the left one
-
The current position moves at the end of the text
-
-So it allows to write a chunk of text, alter the font style, then continue from the exact
-place we left it. On the other hand, you cannot justify it.
-
-
-The method is used on the first page to put a link pointing to the second one. The beginning of
-the sentence is written in regular style, then we switch to underline and finish it. The link
-is created with AddLink(), which returns a link identifier. The identifier is
-passed as third parameter of Write(). Once the second page is created, we use SetLink() to
-make the link point to the beginning of the current page.
-
-
-Then we put an image with an external link on it. An external link is just a URL. It's passed as
-last parameter of Image().
-
-
-Finally, the left margin is moved after the image with SetLeftMargin() and some text in
-HTML format is output. A very simple HTML parser is used for this, based on regular expressions.
-Recognized tags are <b>, <i>, <u>, <a> and <br>; the others are
-ignored. The parser also makes use of the Write() method. An external link is put the same way as
-an internal one (third parameter of Write()). Note that Cell() also allows to put links.
-
-
diff --git a/Classes/fpdf/tutorial/tuto6.php b/Classes/fpdf/tutorial/tuto6.php
deleted file mode 100755
index 427e4d3..0000000
--- a/Classes/fpdf/tutorial/tuto6.php
+++ /dev/null
@@ -1,113 +0,0 @@
-/U',$html,-1,PREG_SPLIT_DELIM_CAPTURE);
- foreach($a as $i=>$e)
- {
- if($i%2==0)
- {
- // Text
- if($this->HREF)
- $this->PutLink($this->HREF,$e);
- else
- $this->Write(5,$e);
- }
- else
- {
- // Tag
- if($e[0]=='/')
- $this->CloseTag(strtoupper(substr($e,1)));
- else
- {
- // Extract attributes
- $a2 = explode(' ',$e);
- $tag = strtoupper(array_shift($a2));
- $attr = array();
- foreach($a2 as $v)
- {
- if(preg_match('/([^=]*)=["\']?([^"\']*)/',$v,$a3))
- $attr[strtoupper($a3[1])] = $a3[2];
- }
- $this->OpenTag($tag,$attr);
- }
- }
- }
-}
-
-function OpenTag($tag, $attr)
-{
- // Opening tag
- if($tag=='B' || $tag=='I' || $tag=='U')
- $this->SetStyle($tag,true);
- if($tag=='A')
- $this->HREF = $attr['HREF'];
- if($tag=='BR')
- $this->Ln(5);
-}
-
-function CloseTag($tag)
-{
- // Closing tag
- if($tag=='B' || $tag=='I' || $tag=='U')
- $this->SetStyle($tag,false);
- if($tag=='A')
- $this->HREF = '';
-}
-
-function SetStyle($tag, $enable)
-{
- // Modify style and select corresponding font
- $this->$tag += ($enable ? 1 : -1);
- $style = '';
- foreach(array('B', 'I', 'U') as $s)
- {
- if($this->$s>0)
- $style .= $s;
- }
- $this->SetFont('',$style);
-}
-
-function PutLink($URL, $txt)
-{
- // Put a hyperlink
- $this->SetTextColor(0,0,255);
- $this->SetStyle('U',true);
- $this->Write(5,$txt,$URL);
- $this->SetStyle('U',false);
- $this->SetTextColor(0);
-}
-}
-
-$html = 'You can now easily print text mixing different styles: bold, italic,
-underlined, or all at once!
You can also insert links on
-text, such as www.fpdf.org, or on an image: click on the logo.';
-
-$pdf = new PDF();
-// First page
-$pdf->AddPage();
-$pdf->SetFont('Arial','',20);
-$pdf->Write(5,"To find out what's new in this tutorial, click ");
-$pdf->SetFont('','U');
-$link = $pdf->AddLink();
-$pdf->Write(5,'here',$link);
-$pdf->SetFont('');
-// Second page
-$pdf->AddPage();
-$pdf->SetLink($link);
-$pdf->Image('logo.png',10,12,30,0,'','http://www.fpdf.org');
-$pdf->SetLeftMargin(45);
-$pdf->SetFontSize(14);
-$pdf->WriteHTML($html);
-$pdf->Output();
-?>
diff --git a/Classes/fpdf/tutorial/tuto7.htm b/Classes/fpdf/tutorial/tuto7.htm
deleted file mode 100755
index 146a952..0000000
--- a/Classes/fpdf/tutorial/tuto7.htm
+++ /dev/null
@@ -1,187 +0,0 @@
-
-
-
-
-Adding new fonts and encodings
-
-
-
-
Adding new fonts and encodings
-This tutorial explains how to use TrueType, OpenType and Type1 fonts so that you are not limited to the
-standard fonts anymore. The other benefit is that you can choose the text encoding, which allows you to
-use other languages than the Western ones (the standard fonts support only cp1252 aka windows-1252).
-
-
-For OpenType, only the format based on TrueType is supported (not the one based on Type1).
-For Type1, you will need the corresponding AFM file (it is usually provided with the font).
-
-
-Adding a new font requires two steps:
-
-
Generation of the font definition file
-
Declaration of the font in the script
-
-
-
Generation of the font definition file
-The first step consists in generating a PHP file containing all the information needed by FPDF;
-in addition, the font file is compressed. To do this, a helper script is provided in the makefont
-directory of the package: makefont.php. It contains the following function:
-
-
-MakeFont(string fontfile [, string enc [, boolean embed [, boolean subset]]])
-
-
fontfile
-
-
Path to the .ttf, .otf or .pfb file.
-
-
enc
-
-
Name of the encoding to use. Default value: cp1252.
-
-
embed
-
-
Whether to embed the font or not. Default value: true.
-
-
subset
-
-
Whether to subset the font or not. Default value: true.
-
-
-The first parameter is the name of the font file. The extension must be either .ttf, .otf or .pfb and
-determines the font type. If your Type1 font is in ASCII format (.pfa), you can convert it to binary
-(.pfb) with the help of t1utils.
-
-
-For Type1 fonts, the corresponding .afm file must be present in the same directory.
-
-
-The encoding defines the association between a code (from 0 to 255) and a character. The first 128 are
-always the same and correspond to ASCII; the following are variable. Encodings are stored in .map
-files. The available ones are:
-
-
cp1250 (Central Europe)
-
cp1251 (Cyrillic)
-
cp1252 (Western Europe)
-
cp1253 (Greek)
-
cp1254 (Turkish)
-
cp1255 (Hebrew)
-
cp1257 (Baltic)
-
cp1258 (Vietnamese)
-
cp874 (Thai)
-
ISO-8859-1 (Western Europe)
-
ISO-8859-2 (Central Europe)
-
ISO-8859-4 (Baltic)
-
ISO-8859-5 (Cyrillic)
-
ISO-8859-7 (Greek)
-
ISO-8859-9 (Turkish)
-
ISO-8859-11 (Thai)
-
ISO-8859-15 (Western Europe)
-
ISO-8859-16 (Central Europe)
-
KOI8-R (Russian)
-
KOI8-U (Ukrainian)
-
-Of course, the font must contain the characters corresponding to the selected encoding.
-
-
-The third parameter indicates whether the font should be embedded in the PDF or not. When a font is
-not embedded, it is searched in the system. The advantage is that the PDF file is smaller; on the
-other hand, if it is not available, then a substitution font is used. So you should ensure that the
-needed font is installed on the client systems. Embedding is the recommended option to guarantee a
-correct rendering.
-
-
-The last parameter indicates whether subsetting should be used, that is to say, whether only
-the characters from the selected encoding should be kept in the embedded font. As a result,
-the size of the PDF file can be greatly reduced, especially if the original font was big.
-
-
-After you have called the function (create a new file for this and include makefont.php), a .php file
-is created, with the same name as the font file. You may rename it if you wish. If the case of embedding,
-the font file is compressed and gives a second file with .z as extension (except if the compression
-function is not available, it requires Zlib). You may rename it too, but in this case you have to change
-the variable $file in the .php file accordingly.
-
-
-Example:
-
-which gives the files comic.php and comic.z.
-
-
-Then copy the generated files to the font directory. If the font file could not be compressed, copy
-it directly instead of the .z version.
-
-
-Another way to call MakeFont() is through the command line:
-
-
-php makefont\makefont.php C:\Windows\Fonts\comic.ttf cp1252
-
-
-Finally, for TrueType and OpenType fonts, you can also generate the files
-online instead of doing it manually.
-
-
Declaration of the font in the script
-The second step is simple. You just need to call the AddFont() method:
-
-
$pdf->AddFont('Comic','','comic.php');
-
-
-And the font is now available (in regular and underlined styles), usable like the others. If we
-had worked with Comic Sans MS Bold (comicbd.ttf), we would have written:
-
-
$pdf->AddFont('Comic','B','comicbd.php');
-
-
-
-
Example
-Let's now see a complete example. We will use the font Calligrapher.
-The first step is the generation of the font files:
-
-The script gives the following report:
-
-
-Warning: character Euro is missing
-Warning: character zcaron is missing
-Font file compressed: calligra.z
-Font definition file generated: calligra.php
-
-The euro character is not present in the font (it's too old). Another character is missing too.
-
-
-Alternatively we could have used the command line:
-
-
-php makefont\makefont.php calligra.ttf cp1252
-
-
-or used the online generator.
-
-
-We can now copy the two generated files to the font directory and write the script:
-
-
<?php
-require('fpdf.php');
-
-$pdf = new FPDF();
-$pdf->AddFont('Calligrapher','','calligra.php');
-$pdf->AddPage();
-$pdf->SetFont('Calligrapher','',35);
-$pdf->Write(10,'Enjoy new fonts with FPDF!');
-$pdf->Output();
-?>