public
|
#
__construct( string $orientation = 'P', string $unit = 'mm', mixed $format = 'A4', boolean $unicode = true, boolean $encoding = 'UTF-8', String $diskcache = false )
This is the class constructor. It allows to set up the page format, the
orientation and the measure unit used in all the methods (except for the font
sizes).
This is the class constructor. It allows to set up the page format, the
orientation and the measure unit used in all the methods (except for the font
sizes).
Parameters
- $orientation
string $orientation page orientation. Possible values are (case insensitive):
- P or Portrait (default)
- L or Landscape
- $unit
string $unit User measure unit. Possible values are:
- pt: point
- mm: millimeter (default)
- 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.
- $format
mixed $format The format used for pages. It can be either one of the following values
(case insensitive) or a custom format in the form of a two-element array
containing the width and the height (expressed in the unit given by unit).
- 4A0
- 2A0
- A0
- A1
- A2
- A3
- A4 (default)
- A5
- A6
- A7
- A8
- A9
- A10
- B0
- B1
- B2
- B3
- B4
- B5
- B6
- B7
- B8
- B9
- B10
- C0
- C1
- C2
- C3
- C4
- C5
- C6
- C7
- C8
- C9
- C10
- RA0
- RA1
- RA2
- RA3
- RA4
- SRA0
- SRA1
- SRA2
- SRA3
- SRA4
- LETTER
- LEGAL
- EXECUTIVE
- FOLIO
- $unicode
boolean $unicode TRUE means that the input text is unicode (default = true)
- $encoding
boolean $diskcache if TRUE reduce the RAM memory usage by caching temporary data on
filesystem (slower).
- $diskcache
String $encoding charset encoding; default is UTF-8
Since
1.0
|
public
|
#
__destruct( )
Default destructor.
Since
1.53.0.TC016
|
public
|
#
setPageUnit( string $unit )
Set the units of measure for the document.
Set the units of measure for the document.
Parameters
- $unit
string $unit User measure unit. Possible values are:
- pt: point
- mm: millimeter (default)
- 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.
Since
3.0.015 (2008-06-06)
|
public
|
#
setPageFormat( mixed $format, string $orientation = 'P' )
Set the page format
Parameters
- $format
mixed $format The format used for pages. It can be either one of the following values
(case insensitive) or a custom format in the form of a two-element array
containing the width and the height (expressed in the unit given by unit).
- 4A0
- 2A0
- A0
- A1
- A2
- A3
- A4 (default)
- A5
- A6
- A7
- A8
- A9
- A10
- B0
- B1
- B2
- B3
- B4
- B5
- B6
- B7
- B8
- B9
- B10
- C0
- C1
- C2
- C3
- C4
- C5
- C6
- C7
- C8
- C9
- C10
- RA0
- RA1
- RA2
- RA3
- RA4
- SRA0
- SRA1
- SRA2
- SRA3
- SRA4
- LETTER
- LEGAL
- EXECUTIVE
- FOLIO
- $orientation
string $orientation page orientation. Possible values are (case insensitive):
- P or PORTRAIT (default)
- L or LANDSCAPE
Since
3.0.015 (2008-06-06)
|
public
|
#
setPageOrientation( string $orientation, boolean $autopagebreak = '', float $bottommargin = '' )
Set page orientation.
Parameters
- $orientation
string $orientation page orientation. Possible values are (case insensitive):
- P or PORTRAIT (default)
- L or LANDSCAPE
- $autopagebreak
boolean $autopagebreak Boolean indicating if auto-page-break mode should be on or off.
- $bottommargin
float $bottommargin bottom margin of the page.
Since
3.0.015 (2008-06-06)
|
public
|
#
setSpacesRE( string $re = '/[\s]/' )
Set regular expression to detect withespaces or word separators.
Set regular expression to detect withespaces or word separators.
Parameters
- $re
string $re regular expression (leave empty for default).
Since
4.6.016 (2009-06-15)
|
public
|
#
setRTL( Boolean $enable, Boolean $resetx = true )
Enable or disable Right-To-Left language mode
Enable or disable Right-To-Left language mode
Parameters
- $enable
Boolean $enable if true enable Right-To-Left language mode.
- $resetx
Boolean $resetx if true reset the X position on direction change.
Since
2.0.000 (2008-01-03)
|
public
boolean
|
#
getRTL( )
Return the RTL status
Returns
boolean
Since
4.0.012 (2008-07-24)
|
public
|
#
setTempRTL( mixed $mode )
Force temporary RTL language direction
Force temporary RTL language direction
Parameters
- $mode
mixed $mode can be false, 'L' for LTR or 'R' for RTL
Since
2.1.000 (2008-01-09)
|
public
boolean
|
#
isRTLTextDir( )
Return the current temporary RTL status
Return the current temporary RTL status
Returns
boolean
Since
4.8.014 (2009-11-04)
|
public
|
#
setLastH( float $h )
Set the last cell height.
Set the last cell height.
Parameters
Author
Nicola Asuni
Since
1.53.0.TC034
|
public
last
|
#
getLastH( )
Get the last cell height.
Get the last cell height.
Returns
last cell height
Since
4.0.017 (2008-08-05)
|
public
|
#
setImageScale( float $scale )
Set the adjusting factor to convert pixels to user units.
Set the adjusting factor to convert pixels to user units.
Parameters
- $scale
float $scale adjusting factor to convert pixels to user units.
Author
Nicola Asuni
Since
1.5.2
|
public
float
|
#
getImageScale( )
Returns the adjusting factor to convert pixels to user units.
Returns the adjusting factor to convert pixels to user units.
Returns
float adjusting factor to convert pixels to user units.
Author
Nicola Asuni
Since
1.5.2
|
public
array
|
#
getPageDimensions( integer $pagenum = '' )
Returns an array of page dimensions:
- $this->pagedim[$this->page]['w'] => page_width_in_points
- $this->pagedim[$this->page]['h'] => height in points
- $this->pagedim[$this->page]['wk'] => page_width_in_points
- $this->pagedim[$this->page]['hk'] => height
- $this->pagedim[$this->page]['tm'] => top_margin
- $this->pagedim[$this->page]['bm'] => bottom_margin
- $this->pagedim[$this->page]['lm'] => left_margin
- $this->pagedim[$this->page]['rm'] => right_margin
- $this->pagedim[$this->page]['pb'] => auto_page_break
- $this->pagedim[$this->page]['or'] => page_orientation
- $this->pagedim[$this->page]['olm'] => original_left_margin
- $this->pagedim[$this->page]['orm'] => original_right_margin
Returns an array of page dimensions:
- $this->pagedim[$this->page]['w'] => page_width_in_points
- $this->pagedim[$this->page]['h'] => height in points
- $this->pagedim[$this->page]['wk'] => page_width_in_points
- $this->pagedim[$this->page]['hk'] => height
- $this->pagedim[$this->page]['tm'] => top_margin
- $this->pagedim[$this->page]['bm'] => bottom_margin
- $this->pagedim[$this->page]['lm'] => left_margin
- $this->pagedim[$this->page]['rm'] => right_margin
- $this->pagedim[$this->page]['pb'] => auto_page_break
- $this->pagedim[$this->page]['or'] => page_orientation
- $this->pagedim[$this->page]['olm'] => original_left_margin
- $this->pagedim[$this->page]['orm'] => original_right_margin
Parameters
- $pagenum
integer $pagenum page number (empty = current page)
Returns
array of page dimensions.
Author
Nicola Asuni
Since
4.5.027 (2009-03-16)
|
public
integer
|
#
getPageWidth( integer $pagenum = '' )
Returns the page width in units.
Returns the page width in units.
Parameters
- $pagenum
integer $pagenum page number (empty = current page)
Returns
integer page width.
Author
Nicola Asuni
Since
1.5.2
See
|
public
integer
|
#
getPageHeight( integer $pagenum = '' )
Returns the page height in units.
Returns the page height in units.
Parameters
- $pagenum
integer $pagenum page number (empty = current page)
Returns
integer page height.
Author
Nicola Asuni
Since
1.5.2
See
|
public
integer
|
#
getBreakMargin( integer $pagenum = '' )
Returns the page break margin.
Returns the page break margin.
Parameters
- $pagenum
integer $pagenum page number (empty = current page)
Returns
integer page break margin.
Author
Nicola Asuni
Since
1.5.2
See
|
public
integer
|
#
getScaleFactor( )
Returns the scale factor (number of points in user unit).
Returns the scale factor (number of points in user unit).
Returns
integer scale factor.
Author
Nicola Asuni
Since
1.5.2
|
public
|
#
SetMargins( float $left, float $top, float $right = -1, boolean $keepmargins = false )
Defines the left, top and right margins.
Defines the left, top and right margins.
Parameters
- $left
float $left Left margin.
- $top
float $top Top margin.
- $right
float $right Right margin. Default value is the left one.
- $keepmargins
boolean $keepmargins if true overwrites the default page margins
Since
1.0
See
|
public
|
#
SetLeftMargin( float $margin )
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 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.
Parameters
- $margin
float $margin The margin.
Since
1.4
See
|
public
|
#
SetTopMargin( float $margin )
Defines the top margin. The method can be called before creating the first
page.
Defines the top margin. The method can be called before creating the first
page.
Parameters
- $margin
float $margin The margin.
Since
1.5
See
|
public
|
#
SetRightMargin( float $margin )
Defines the right margin. The method can be called before creating the first
page.
Defines the right margin. The method can be called before creating the first
page.
Parameters
- $margin
float $margin The margin.
Since
1.5
See
|
public
|
#
SetCellPadding( float $pad )
Set the internal Cell padding.
Set the internal Cell padding.
Parameters
- $pad
float $pad internal padding.
Since
2.1.000 (2008-01-09)
See
|
public
|
#
SetAutoPageBreak( boolean $auto, float $margin = 0 )
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.
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 $auto Boolean indicating if mode should be on or off.
- $margin
float $margin Distance from the bottom of the page.
Since
1.0
See
|
public
|
#
SetDisplayMode( mixed $zoom, string $layout = 'SinglePage', string $mode = 'UseNone' )
Defines the way the document is to be displayed by the viewer.
Defines the way the document is to be displayed by the viewer.
Parameters
- $zoom
mixed $zoom The zoom to use. It can be one of the following string values or a number
indicating the zooming factor to use.
- 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
- $layout
string $layout The page layout. Possible values are:
- SinglePage Display one page at a time
- OneColumn Display the pages in one column
- TwoColumnLeft Display the pages in two columns, with odd-numbered pages on
the left
- TwoColumnRight Display the pages in two columns, with odd-numbered pages on
the right
- TwoPageLeft (PDF 1.5) Display the pages two at a time, with odd-numbered
pages on the left
- TwoPageRight (PDF 1.5) Display the pages two at a time, with odd-numbered
pages on the right
- $mode
string $mode A name object specifying how the document should be displayed when opened:
- UseNone Neither document outline nor thumbnail images visible
- UseOutlines Document outline visible
- UseThumbs Thumbnail images visible
- FullScreen Full-screen mode, with no menu bar, window controls, or any other
window visible
- UseOC (PDF 1.5) Optional content group panel visible
- UseAttachments (PDF 1.6) Attachments panel visible
Since
1.2
|
public
|
#
SetCompression( boolean $compress )
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.
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 $compress Boolean indicating if compression must be enabled.
Since
1.4
|
public
|
#
SetTitle( string $title )
Defines the title of the document.
Defines the title of the document.
Parameters
- $title
string $title The title.
Since
1.2
See
|
public
|
#
SetSubject( string $subject )
Defines the subject of the document.
Defines the subject of the document.
Parameters
- $subject
string $subject The subject.
Since
1.2
See
|
public
|
#
SetAuthor( string $author )
Defines the author of the document.
Defines the author of the document.
Parameters
- $author
string $author The name of the author.
Since
1.2
See
|
public
|
#
SetKeywords( string $keywords )
Associates keywords with the document, generally in the form 'keyword1
keyword2 ...'.
Associates keywords with the document, generally in the form 'keyword1
keyword2 ...'.
Parameters
- $keywords
string $keywords The list of keywords.
Since
1.2
See
|
public
|
#
SetCreator( string $creator )
Defines the creator of the document. This is typically the name of the
application that generates the PDF.
Defines the creator of the document. This is typically the name of the
application that generates the PDF.
Parameters
- $creator
string $creator The name of the creator.
Since
1.2
See
|
public
|
#
Error( string $msg )
This method is automatically called in case of fatal error; it simply outputs
the message and halts the execution. An inherited class may override it to
customize the error handling but should always halt the script, or the resulting
document would probably be invalid. 2004-06-11 :: Nicola Asuni : changed bold
tag with strong
This method is automatically called in case of fatal error; it simply outputs
the message and halts the execution. An inherited class may override it to
customize the error handling but should always halt the script, or the resulting
document would probably be invalid. 2004-06-11 :: Nicola Asuni : changed bold
tag with strong
Parameters
- $msg
string $msg The error message
Since
1.0
|
public
|
#
Open( )
This method begins the generation of the PDF document. It is not necessary to
call it explicitly because AddPage() does it automatically. Note: no page is
created by this method
This method begins the generation of the PDF document. It is not necessary to
call it explicitly because AddPage() does it automatically. Note: no page is
created by this method
Since
1.0
See
|
public
|
#
Close( )
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.
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.
Since
1.0
See
|
public
|
#
setPage( integer $pnum, boolean $resetmargins = false )
Move pointer at the specified document page and update page dimensions.
Move pointer at the specified document page and update page dimensions.
Parameters
- $pnum
integer $pnum page number
- $resetmargins
boolean $resetmargins if true reset left, right, top margins and Y position.
Since
2.1.000 (2008-01-07)
See
|
public
|
#
lastPage( boolean $resetmargins = false )
Reset pointer to the last document page.
Reset pointer to the last document page.
Parameters
- $resetmargins
boolean $resetmargins if true reset left, right, top margins and Y position.
Since
2.0.000 (2008-01-04)
See
|
public
integer
|
#
getPage( )
Get current document page number.
Get current document page number.
Returns
integer page number
Since
2.1.000 (2008-01-07)
See
|
public
integer
|
#
getNumPages( )
Get the total number of insered pages.
Get the total number of insered pages.
Returns
integer number of pages
Since
2.1.000 (2008-01-07)
See
|
public
|
#
AddPage( string $orientation = '', mixed $format = '', boolean $keepmargins = false )
Adds a new page to the document. If a page is already present, the Footer()
method is called first to output the footer (if enabled). Then the page is
added, the current position set to the top-left corner according to the left and
top margins (or top-right if in RTL mode), and Header() is called to display the
header (if enabled). The origin of the coordinate system is at the top-left
corner (or top-right for RTL) and increasing ordinates go downwards.
Adds a new page to the document. If a page is already present, the Footer()
method is called first to output the footer (if enabled). Then the page is
added, the current position set to the top-left corner according to the left and
top margins (or top-right if in RTL mode), and Header() is called to display the
header (if enabled). The origin of the coordinate system is at the top-left
corner (or top-right for RTL) and increasing ordinates go downwards.
Parameters
- $orientation
string $orientation page orientation. Possible values are (case insensitive):
- P or PORTRAIT (default)
- L or LANDSCAPE
- $format
mixed $format The format used for pages. It can be either one of the following values
(case insensitive) or a custom format in the form of a two-element array
containing the width and the height (expressed in the unit given by unit).
- 4A0
- 2A0
- A0
- A1
- A2
- A3
- A4 (default)
- A5
- A6
- A7
- A8
- A9
- A10
- B0
- B1
- B2
- B3
- B4
- B5
- B6
- B7
- B8
- B9
- B10
- C0
- C1
- C2
- C3
- C4
- C5
- C6
- C7
- C8
- C9
- C10
- RA0
- RA1
- RA2
- RA3
- RA4
- SRA0
- SRA1
- SRA2
- SRA3
- SRA4
- LETTER
- LEGAL
- EXECUTIVE
- FOLIO
- $keepmargins
boolean $keepmargins if true overwrites the default page margins with the current
margins
Since
1.0
See
|
protected
|
#
endPage( )
Terminate the current page
Terminate the current page
Since
4.2.010 (2008-11-14)
See
|
protected
|
#
startPage( string $orientation = '', mixed $format = '' )
Starts a new page to the document. The page must be closed using the
endPage() function. The origin of the coordinate system is at the top-left
corner and increasing ordinates go downwards.
Starts a new page to the document. The page must be closed using the
endPage() function. The origin of the coordinate system is at the top-left
corner and increasing ordinates go downwards.
Parameters
- $orientation
string $orientation page orientation. Possible values are (case insensitive):
- P or PORTRAIT (default)
- L or LANDSCAPE
- $format
mixed $format The format used for pages. It can be either one of the following values
(case insensitive) or a custom format in the form of a two-element array
containing the width and the height (expressed in the unit given by unit).
- 4A0
- 2A0
- A0
- A1
- A2
- A3
- A4 (default)
- A5
- A6
- A7
- A8
- A9
- A10
- B0
- B1
- B2
- B3
- B4
- B5
- B6
- B7
- B8
- B9
- B10
- C0
- C1
- C2
- C3
- C4
- C5
- C6
- C7
- C8
- C9
- C10
- RA0
- RA1
- RA2
- RA3
- RA4
- SRA0
- SRA1
- SRA2
- SRA3
- SRA4
- LETTER
- LEGAL
- EXECUTIVE
- FOLIO
Since
4.2.010 (2008-11-14)
See
|
public
|
#
setPageMark( )
Set start-writing mark on current page for multicell borders and fills. This
function must be called after calling Image() function for a background image.
Background images must be always inserted before calling Multicell() or
WriteHTMLCell() or WriteHTML() functions.
Set start-writing mark on current page for multicell borders and fills. This
function must be called after calling Image() function for a background image.
Background images must be always inserted before calling Multicell() or
WriteHTMLCell() or WriteHTML() functions.
Since
4.0.016 (2008-07-30)
|
protected
|
#
setContentMark( integer $page = 0 )
Set start-writing mark on selected page.
Set start-writing mark on selected page.
Parameters
- $page
integer $page page number (default is the current page)
Since
4.6.021 (2009-07-20)
|
public
float
|
#
getImageRBX( )
Return the right-bottom (or left-bottom for RTL) corner X coordinate of last
inserted image
Return the right-bottom (or left-bottom for RTL) corner X coordinate of last
inserted image
Returns
float
|
public
float
|
#
getImageRBY( )
Return the right-bottom (or left-bottom for RTL) corner Y coordinate of last
inserted image
Return the right-bottom (or left-bottom for RTL) corner Y coordinate of last
inserted image
Returns
float
|
public
integer
|
#
PageNo( )
Returns the current page number.
Returns the current page number.
Returns
integer page number
Since
1.0
See
|
public
|
#
AddSpotColor( integer $name, integer $c, integer $m, integer $y, mixed $k )
Defines a new spot color. 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.
Defines a new spot color. 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
- $name
integer $c Cyan color for CMYK. Value between 0 and 255
- $c
integer $m Magenta color for CMYK. Value between 0 and 255
- $m
integer $y Yellow color for CMYK. Value between 0 and 255
- $y
integer $k Key (Black) color for CMYK. Value between 0 and 255
- $k
Since
4.0.024 (2008-09-12)
See
|
public
|
#
SetDrawColorArray( array $color )
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.
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
- $color
array $color array of colors
Since
3.1.000 (2008-06-11)
See
|
public
|
#
SetDrawColor( integer $col1 = 0, integer $col2 = -1, integer $col3 = -1, integer $col4 = -1 )
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.
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
- $col1
integer $col1 Gray level for single color, or Red color for RGB, or Cyan color for CMYK.
Value between 0 and 255
- $col2
integer $col2 Green color for RGB, or Magenta color for CMYK. Value between 0 and 255
- $col3
integer $col3 Blue color for RGB, or Yellow color for CMYK. Value between 0 and 255
- $col4
integer $col4 Key (Black) color for CMYK. Value between 0 and 255
Since
1.3
See
|
public
|
#
SetDrawSpotColor( string $name, integer $tint = 100 )
Defines the spot color used for all drawing operations (lines, rectangles and
cell borders).
Defines the spot color used for all drawing operations (lines, rectangles and
cell borders).
Parameters
- $name
string $name name of the spot color
- $tint
integer $tint the intensity of the color (from 0 to 100 ; 100 = full intensity by
default).
Since
4.0.024 (2008-09-12)
See
|
public
|
#
SetFillColorArray( array $color )
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.
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
- $color
array $color array of colors
Since
3.1.000 (2008-6-11)
See
|
public
|
#
SetFillColor( integer $col1 = 0, integer $col2 = -1, integer $col3 = -1, integer $col4 = -1 )
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.
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
- $col1
integer $col1 Gray level for single color, or Red color for RGB, or Cyan color for CMYK.
Value between 0 and 255
- $col2
integer $col2 Green color for RGB, or Magenta color for CMYK. Value between 0 and 255
- $col3
integer $col3 Blue color for RGB, or Yellow color for CMYK. Value between 0 and 255
- $col4
integer $col4 Key (Black) color for CMYK. Value between 0 and 255
Since
1.3
See
|
public
|
#
SetFillSpotColor( string $name, integer $tint = 100 )
Defines the spot color used for all filling operations (filled rectangles and
cell backgrounds).
Defines the spot color used for all filling operations (filled rectangles and
cell backgrounds).
Parameters
- $name
string $name name of the spot color
- $tint
integer $tint the intensity of the color (from 0 to 100 ; 100 = full intensity by
default).
Since
4.0.024 (2008-09-12)
See
|
public
|
#
SetTextColorArray( array $color )
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.
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
- $color
array $color array of colors
Since
3.1.000 (2008-6-11)
See
|
public
|
#
SetTextColor( integer $col1 = 0, integer $col2 = -1, integer $col3 = -1, integer $col4 = -1 )
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.
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
- $col1
integer $col1 Gray level for single color, or Red color for RGB, or Cyan color for CMYK.
Value between 0 and 255
- $col2
integer $col2 Green color for RGB, or Magenta color for CMYK. Value between 0 and 255
- $col3
integer $col3 Blue color for RGB, or Yellow color for CMYK. Value between 0 and 255
- $col4
integer $col4 Key (Black) color for CMYK. Value between 0 and 255
Since
1.3
See
|
public
|
#
SetTextSpotColor( string $name, integer $tint = 100 )
Defines the spot color used for text.
Defines the spot color used for text.
Parameters
- $name
string $name name of the spot color
- $tint
integer $tint the intensity of the color (from 0 to 100 ; 100 = full intensity by
default).
Since
4.0.024 (2008-09-12)
See
|
public
mixed
|
#
GetStringWidth( string $s, string $fontname = '', string $fontstyle = '', float $fontsize = 0, boolean $getarray = false )
Returns the length of a string in user unit. A font must be selected.
Returns the length of a string in user unit. A font must be selected.
Parameters
- $s
string $s The string whose length is to be computed
- $fontname
string $fontname Family font. It can be either a name defined by AddFont() or one of
the standard families. It is also possible to pass an empty string, in that
case, the current family is retained.
- $fontstyle
string $fontstyle Font style. Possible values are (case insensitive):
- empty string: regular
- B: bold
- I: italic
- U: underline
- D: line trough
or any combination. The default value is regular.
- $fontsize
float $fontsize Font size in points. The default value is the current size.
- $getarray
boolean $getarray if true returns an array of characters widths, if false returns the
total length.
Returns
mixed int total string length or array of characted widths
Author
Nicola Asuni
Since
1.2
|
public
mixed
|
#
GetArrStringWidth( string $sa, string $fontname = '', string $fontstyle = '', float $fontsize = 0, boolean $getarray = false )
Returns the string length of an array of chars in user unit or an array of
characters widths. A font must be selected.
Returns the string length of an array of chars in user unit or an array of
characters widths. A font must be selected.
Parameters
- $sa
string $sa The array of chars whose total length is to be computed
- $fontname
string $fontname Family font. It can be either a name defined by AddFont() or one of
the standard families. It is also possible to pass an empty string, in that
case, the current family is retained.
- $fontstyle
string $fontstyle Font style. Possible values are (case insensitive):
- empty string: regular
- B: bold
- I: italic
- U: underline
- D: line trough
or any combination. The default value is regular.
- $fontsize
float $fontsize Font size in points. The default value is the current size.
- $getarray
boolean $getarray if true returns an array of characters widths, if false returns the
total length.
Returns
mixed int total string length or array of characted widths
Author
Nicola Asuni
Since
2.4.000 (2008-03-06)
|
public
integer
|
#
GetCharWidth( integer $char )
Returns the length of the char in user unit for the current font.
Returns the length of the char in user unit for the current font.
Parameters
- $char
integer $char The char code whose length is to be returned
Returns
integer char width
Author
Nicola Asuni
Since
2.4.000 (2008-03-06)
|
public
integer
|
#
GetNumChars( string $s )
Returns the numbero of characters in a string.
Returns the numbero of characters in a string.
Parameters
- $s
string $s The input string.
Returns
integer number of characters
Since
2.0.0001 (2008-01-07)
|
protected
|
#
getFontsList( )
Fill the list of available fonts ($this->fontlist).
Fill the list of available fonts ($this->fontlist).
Since
4.0.013 (2008-07-28)
|
public
array
|
#
AddFont( string $family, string $style = '', string $fontfile = '' )
Imports a TrueType, Type1, core, or CID0 font and makes it available. It is
necessary to generate a font definition file first (read
/fonts/utils/README.TXT). The definition file (and the font file itself when
embedding) must be present either in the current directory or in the one
indicated by K_PATH_FONTS if the constant is defined. If it could not be found,
the error "Could not include font definition file" is generated.
Imports a TrueType, Type1, core, or CID0 font and makes it available. It is
necessary to generate a font definition file first (read
/fonts/utils/README.TXT). The definition file (and the font file itself when
embedding) must be present either in the current directory or in the one
indicated by K_PATH_FONTS if the constant is defined. If it could not be found,
the error "Could not include font definition file" is generated.
Parameters
- $family
string $family Font family. The name can be chosen arbitrarily. If it is a standard
family name, it will override the corresponding font.
- $style
string $style Font style. Possible values are (case insensitive):
- empty string: regular (default)
- B: bold
- I: italic
- BI or IB: bold italic
- $fontfile
string $fontfile The font definition file. By default, the name is built from the
family and style, in lower case with no spaces.
Returns
array containing the font data, or false in case of error.
Since
1.5
See
|
public
|
#
SetFont( string $family, string $style = '', float $size = 0, string $fontfile = '' )
Sets the font used to print character strings. The font can be either a standard
one or a font added via the AddFont() method. Standard fonts use Windows
encoding cp1252 (Western Europe). The method can be called before the first page
is created and the font is retained from page to page. If you just wish to
change the current font size, it is simpler to call SetFontSize(). Note: for the
standard fonts, the font metric files must be accessible. There are three
possibilities for this:
- They are in the current directory (the one where the running script
lies)
- They are in one of the directories defined by the include_path
parameter
- They are in the directory defined by the K_PATH_FONTS constant
Sets the font used to print character strings. The font can be either a standard
one or a font added via the AddFont() method. Standard fonts use Windows
encoding cp1252 (Western Europe). The method can be called before the first page
is created and the font is retained from page to page. If you just wish to
change the current font size, it is simpler to call SetFontSize(). Note: for the
standard fonts, the font metric files must be accessible. There are three
possibilities for this:
- They are in the current directory (the one where the running script
lies)
- They are in one of the directories defined by the include_path
parameter
- They are in the directory defined by the K_PATH_FONTS constant
Parameters
- $family
string $family Family font. It can be either a name defined by AddFont() or one of the
standard Type1 families (case insensitive):
- times (Times-Roman)
- timesb (Times-Bold)
- timesi (Times-Italic)
- timesbi (Times-BoldItalic)
- helvetica (Helvetica)
- helveticab (Helvetica-Bold)
- helveticai (Helvetica-Oblique)
- helveticabi (Helvetica-BoldOblique)
- courier (Courier)
- courierb (Courier-Bold)
- courieri (Courier-Oblique)
- courierbi (Courier-BoldOblique)
- symbol (Symbol)
- zapfdingbats (ZapfDingbats)
It is also possible to pass an empty string. In that case, the current family
is retained.
- $style
string $style Font style. Possible values are (case insensitive):
- empty string: regular
- B: bold
- I: italic
- U: underline
- D: line trough
or any combination. The default value is regular. Bold and italic styles do not
apply to Symbol and ZapfDingbats basic fonts or other fonts when not defined.
- $size
float $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
- $fontfile
string $fontfile The font definition file. By default, the name is built from the
family and style, in lower case with no spaces.
Since
1.0
See
|
public
|
#
SetFontSize( float $size )
Defines the size of the current font.
Defines the size of the current font.
Parameters
- $size
float $size The size (in points)
Since
1.0
See
|
public
integer
|
#
getFontDescent( string $font, string $style = '', float $size = 0 )
Return the font descent value
Return the font descent value
Parameters
- $font
string $font font name
- $style
string $style font style
- $size
float $size The size (in points)
Returns
integer font descent
Since
4.9.003 (2010-03-30)
|
public
integer
|
#
getFontAscent( string $font, string $style = '', float $size = 0 )
Return the font ascent value
Return the font ascent value
Parameters
- $font
string $font font name
- $style
string $style font style
- $size
float $size The size (in points)
Returns
integer font ascent
Since
4.9.003 (2010-03-30)
|
public
|
#
SetDefaultMonospacedFont( string $font )
Defines the default monospaced font.
Defines the default monospaced font.
Parameters
- $font
string $font Font name.
Since
4.5.025
|
public
|
#
AddLink( )
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().
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().
Since
1.5
See
|
public
|
#
SetLink( integer $link, float $y = 0, integer $page = -1 )
Defines the page and position a link points to.
Defines the page and position a link points to.
Parameters
- $link
integer $link The link identifier returned by AddLink()
- $y
float $y Ordinate of target position; -1 indicates the current position. The default
value is 0 (top of page)
- $page
integer $page Number of target page; -1 indicates the current page. This is the default
value
Since
1.5
See
|
public
|
#
Link( float $x, float $y, float $w, float $h, mixed $link, integer $spaces = 0 )
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.
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
float $x Abscissa of the upper-left corner of the rectangle
- $y
float $y Ordinate of the upper-left corner of the rectangle
- $w
float $w Width of the rectangle
- $h
float $h Height of the rectangle
- $link
mixed $link URL or identifier returned by AddLink()
- $spaces
integer $spaces number of spaces on the text to link
Since
1.5
See
|
public
|
#
Annotation( float $x, float $y, float $w, float $h, string $text, array $opt = array('Subtype'=>'Text'), integer $spaces = 0 )
Puts a markup annotation on a rectangular area of the page. !!!!THE
ANNOTATION SUPPORT IS NOT YET FULLY IMPLEMENTED !!!!
Puts a markup annotation on a rectangular area of the page. !!!!THE
ANNOTATION SUPPORT IS NOT YET FULLY IMPLEMENTED !!!!
Parameters
- $x
float $x Abscissa of the upper-left corner of the rectangle
- $y
float $y Ordinate of the upper-left corner of the rectangle
- $w
float $w Width of the rectangle
- $h
float $h Height of the rectangle
- $text
string $text annotation text or alternate content
- $opt
array $opt array of options (see section 8.4 of PDF reference 1.7).
- $spaces
integer $spaces number of spaces on the text to link
Since
4.0.018 (2008-08-06)
|
protected
|
#
_putEmbeddedFiles( )
Embedd the attached files.
Embedd the attached files.
Since
4.4.000 (2008-12-07)
See
|
public
|
#
Text( float $x, float $y, string $txt, integer $stroke = 0, boolean $clip = false )
Prints a character string. The origin is on the left of the first charcter,
on the baseline. This method allows to place a string precisely on the page.
Prints a character string. The origin is on the left of the first charcter,
on the baseline. This method allows to place a string precisely on the page.
Deprecated
deprecated since version 4.3.005 (2008-11-25)
Parameters
- $x
float $x Abscissa of the origin
- $y
float $y Ordinate of the origin
- $txt
string $txt String to print
- $stroke
integer $stroke outline size in points (0 = disable)
- $clip
boolean $clip if true activate clipping mode (you must call StartTransform() before this
function and StopTransform() to stop the clipping tranformation).
Since
1.0
See
|
public
boolean
|
#
AcceptPageBreak( )
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.
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.
Returns
boolean
Since
1.4
See
|
protected
boolean
|
#
checkPageBreak( float $h = 0, mixed $y = '', boolean $addpage = true )
Add page if needed.
Parameters
- $h
float $h Cell height. Default value: 0.
- $y
mixed $y starting y position, leave empty for current position.
- $addpage
boolean $addpage if true add a page, otherwise only return the true/false state
Returns
boolean true in case of page break, false otherwise.
Since
3.2.000 (2008-07-01)
|
public
|
#
Cell( float $w, float $h = 0, string $txt = '', mixed $border = 0, integer $ln = 0, string $align = '', integer $fill = 0, mixed $link = '', integer $stretch = 0, boolean $ignore_min_height = false )
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.
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
float $w Cell width. If 0, the cell extends up to the right margin.
- $h
float $h Cell height. Default value: 0.
- $txt
string $txt String to print. Default value: empty string.
- $border
mixed $border Indicates if borders must be drawn around the cell. The value can be
either a number:
- 0: no border (default)
- 1: frame
or a string containing some or all of the following characters (in any order):
- L: left
- T: top
- R: right
- B: bottom
- $ln
integer $ln Indicates where the current position should go after the call. Possible
values are:
- 0: to the right (or left for RTL languages)
- 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
string $align Allows to center or align the text. Possible values are:
- L or empty string: left align (default value)
- C: center
- R: right align
- J: justify
- $fill
integer $fill Indicates if the cell background must be painted (1) or transparent (0).
Default value: 0.
- $link
mixed $link URL or identifier returned by AddLink().
- $stretch
integer $stretch stretch carachter mode:
- 0 = disabled
- 1 = horizontal scaling only if necessary
- 2 = forced horizontal scaling
- 3 = character spacing only if necessary
- 4 = forced character spacing
- $ignore_min_height
boolean $ignore_min_height if true ignore automatic minimum height value.
Since
1.0
See
|
public
string
|
#
removeSHY( string $txt = '' )
Removes SHY characters from text.
Removes SHY characters from text.
Parameters
- $txt
string $txt input string
Returns
string without SHY characters.
Since
(4.5.019) 2009-02-28
|
protected
|
#
getCellCode( float $w, float $h = 0, string $txt = '', mixed $border = 0, integer $ln = 0, string $align = '', integer $fill = 0, mixed $link = '', integer $stretch = 0, boolean $ignore_min_height = false )
Returns the PDF string code to print 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.
Returns the PDF string code to print 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
float $w Cell width. If 0, the cell extends up to the right margin.
- $h
float $h Cell height. Default value: 0.
- $txt
string $txt String to print. Default value: empty string.
- $border
mixed $border Indicates if borders must be drawn around the cell. The value can be
either a number:
- 0: no border (default)
- 1: frame
or a string containing some or all of the following characters (in any order):
- L: left
- T: top
- R: right
- B: bottom
- $ln
integer $ln Indicates where the current position should go after the call. Possible
values are:
- 0: to the right (or left for RTL languages)
- 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
string $align Allows to center or align the text. Possible values are:
- L or empty string: left align (default value)
- C: center
- R: right align
- J: justify
- $fill
integer $fill Indicates if the cell background must be painted (1) or transparent (0).
Default value: 0.
- $link
mixed $link URL or identifier returned by AddLink().
- $stretch
integer $stretch stretch carachter mode:
- 0 = disabled
- 1 = horizontal scaling only if necessary
- 2 = forced horizontal scaling
- 3 = character spacing only if necessary
- 4 = forced character spacing
- $ignore_min_height
boolean $ignore_min_height if true ignore automatic minimum height value.
Since
1.0
See
|
public
integer
|
#
MultiCell( float $w, float $h, string $txt, mixed $border = 0, string $align = 'J', integer $fill = 0, integer $ln = 1, float $x = '', float $y = '', boolean $reseth = true, integer $stretch = 0, boolean $ishtml = false, boolean $autopadding = true, float $maxh = 0 )
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.
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
float $w Width of cells. If 0, they extend up to the right margin of the page.
- $h
float $h Cell minimum height. The cell extends automatically if needed.
- $txt
string $txt String to print
- $border
mixed $border Indicates if borders must be drawn around the cell block. The value can
be either a number:
- 0: no border (default)
- 1: frame
or a string containing some or all of the following characters (in any order):
- L: left
- T: top
- R: right
- B: bottom
- $align
string $align Allows to center or align the text. Possible values are:
- L or empty string: left align
- C: center
- R: right align
- J: justification (default value when $ishtml=false)
- $fill
integer $fill Indicates if the cell background must be painted (1) or transparent (0).
Default value: 0.
- $ln
integer $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 [DEFAULT]
- 2: below
- $x
float $x x position in user units
- $y
float $y y position in user units
- $reseth
boolean $reseth if true reset the last cell height (default true).
- $stretch
integer $stretch stretch carachter mode:
- 0 = disabled
- 1 = horizontal scaling only if necessary
- 2 = forced horizontal scaling
- 3 = character spacing only if necessary
- 4 = forced character spacing
- $ishtml
boolean $ishtml set to true if $txt is HTML content (default = false).
- $autopadding
boolean $autopadding if true, uses internal padding and automatically adjust it to
account for line width.
- $maxh
float $maxh maximum height. It should be >= $h and less then remaining space to the
bottom of the page, or 0 for disable this feature. This feature works only when
$ishtml=false.
Returns
integer Return the number of cells or 1 for html mode.
Since
1.3
See
Used by
|
protected
border
|
#
getBorderMode( mixed $border, string $position = 'start' )
Get the border mode accounting for multicell position (opens bottom side of
multicell crossing pages)
Get the border mode accounting for multicell position (opens bottom side of
multicell crossing pages)
Parameters
- $border
mixed $border Indicates if borders must be drawn around the cell block. The value can
be either a number:
- 0: no border (default)
- 1: frame
or a string containing some or all of the following characters (in any order):
- L: left
- T: top
- R: right
- B: bottom
- $position
string multicell position: 'start', 'middle', 'end'
Returns
border mode
Since
4.4.002 (2008-12-09)
|
public
integer
|
#
getNumLines( string $txt, float $w = 0 )
This method returns the estimated number of lines required to print the text
(not the real number just a quick estimation). If you want o know the exact
number of lines you have to use the following technique:
// store current object
$pdf->startTransaction();
// get the number of lines for multicell
$lines = $pdf->MultiCell($w, 0, $txt, 0, 'L', 0, 0, '', '', true, 0, false, true, 0);
// restore previous object
$pdf = $pdf->rollbackTransaction();
This method returns the estimated number of lines required to print the text
(not the real number just a quick estimation). If you want o know the exact
number of lines you have to use the following technique:
// store current object
$pdf->startTransaction();
// get the number of lines for multicell
$lines = $pdf->MultiCell($w, 0, $txt, 0, 'L', 0, 0, '', '', true, 0, false, true, 0);
// restore previous object
$pdf = $pdf->rollbackTransaction();
Parameters
- $txt
string $txt text to print
- $w
float $w width of cell. If 0, they extend up to the right margin of the page.
Returns
integer Return the estimated number of lines.
Since
4.5.011
|
public
mixed
|
#
Write( float $h, string $txt, mixed $link = '', integer $fill = 0, string $align = '', boolean $ln = false, integer $stretch = 0, boolean $firstline = false, boolean $firstblock = false, float $maxh = 0 )
This method prints text from the current position.
This method prints text from the current position.
Parameters
- $h
float $h Line height
- $txt
string $txt String to print
- $link
mixed $link URL or identifier returned by AddLink()
- $fill
integer $fill Indicates if the background must be painted (1) or transparent (0).
Default value: 0.
- $align
string $align Allows to center or align the text. Possible values are:
- L or empty string: left align (default value)
- C: center
- R: right align
- J: justify
- $ln
boolean $ln if true set cursor at the bottom of the line, otherwise set cursor at the
top of the line.
- $stretch
integer $stretch stretch carachter mode:
- 0 = disabled
- 1 = horizontal scaling only if necessary
- 2 = forced horizontal scaling
- 3 = character spacing only if necessary
- 4 = forced character spacing
- $firstline
boolean $firstline if true prints only the first line and return the remaining string.
- $firstblock
boolean $firstblock if true the string is the starting of a line.
- $maxh
float $maxh maximum height. The remaining unprinted text will be returned. It should
be >= $h and less then remaining space to the bottom of the page, or 0 for
disable this feature.
Returns
mixed Return the number of cells or the remaining string if $firstline = true.
Since
1.5
|
protected
integer
|
#
getRemainingWidth( )
Returns the remaining width between the current position and margins.
Returns the remaining width between the current position and margins.
Returns
integer Return the remaining width
|
public
Return
|
#
UTF8ArrSubString( string $strarr, integer $start = '', integer $end = '' )
Extract a slice of the $strarr array and return it as string.
Extract a slice of the $strarr array and return it as string.
Parameters
- $strarr
string $strarr The input array of characters.
- $start
integer $start the starting element of $strarr.
- $end
integer $end first element that will not be returned.
Returns
Return part of a string
|
public
Return
|
#
UniArrSubString( string $uniarr, integer $start = '', integer $end = '' )
Extract a slice of the $uniarr array and return it as string.
Extract a slice of the $uniarr array and return it as string.
Parameters
- $uniarr
string $uniarr The input array of characters.
- $start
integer $start the starting element of $strarr.
- $end
integer $end first element that will not be returned.
Returns
Return part of a string
Since
4.5.037 (2009-04-07)
|
public
Return
|
#
UTF8ArrayToUniArray( string $ta )
Convert an array of UTF8 values to array of unicode characters
Convert an array of UTF8 values to array of unicode characters
Parameters
- $ta
string $ta The input array of UTF8 values.
Returns
Return array of unicode characters
Since
4.5.037 (2009-04-07)
|
public
Returns
|
#
unichr( integer $c )
Returns the unicode caracter specified by UTF-8 code
Returns the unicode caracter specified by UTF-8 code
Parameters
Returns
Returns the specified character.
Author
Miguel Perez, Nicola Asuni
Since
2.3.000 (2008-03-05)
|
public
string
|
#
getImageFileType( string $imgfile )
Return the image type given the file name and path
Return the image type given the file name and path
Parameters
- $imgfile
string $imgfile image file name
Returns
string image type
Since
4.8.017 (2009-11-27)
|
public
image
|
#
Image( string $file, float $x = '', float $y = '', float $w = 0, float $h = 0, string $type = '', mixed $link = '', string $align = '', mixed $resize = false, integer $dpi = 300, string $palign = '', boolean $ismask = false, mixed $imgmask = false, mixed $border = 0, boolean $fitbox = false, boolean $hidden = false )
Puts an image in the page. The upper-left corner must be given. The dimensions
can be specified in different ways:
- explicit width and height (expressed in user unit)
- 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 72 dpi
Supported formats are JPEG and PNG images whitout GD library and all images
supported by GD: GD, GD2, GD2PART, GIF, JPEG, PNG, BMP, XBM, XPM; 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 will be embedded in the
file.
Puts an image in the page. The upper-left corner must be given. The dimensions
can be specified in different ways:
- explicit width and height (expressed in user unit)
- 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 72 dpi
Supported formats are JPEG and PNG images whitout GD library and all images
supported by GD: GD, GD2, GD2PART, GIF, JPEG, PNG, BMP, XBM, XPM; 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 will be embedded in the
file.
Parameters
- $file
string $file Name of the file containing the image.
- $x
float $x Abscissa of the upper-left corner.
- $y
float $y Ordinate of the upper-left corner.
- $w
float $w Width of the image in the page. If not specified or equal to zero, it is
automatically calculated.
- $h
float $h Height of the image in the page. If not specified or equal to zero, it is
automatically calculated.
- $type
string $type Image format. Possible values are (case insensitive): JPEG and PNG
(whitout GD library) and all images supported by GD: GD, GD2, GD2PART, GIF,
JPEG, PNG, BMP, XBM, XPM;. If not specified, the type is inferred from the file
extension.
- $link
mixed $link URL or identifier returned by AddLink().
- $align
string $align Indicates the alignment of the pointer next to image insertion relative
to image height. The value can be:
- T: top-right for LTR or top-left for RTL
- M: middle-right for LTR or middle-left for RTL
- B: bottom-right for LTR or bottom-left for RTL
- N: next line
- $resize
mixed $resize If true resize (reduce) the image to fit $w and $h (requires GD or
ImageMagick library); if false do not resize; if 2 force resize in all cases
(upscaling and downscaling).
- $dpi
integer $dpi dot-per-inch resolution used on resize
- $palign
string $palign Allows to center or align the image on the current line. Possible values
are:
- L : left align
- C : center
- R : right align
- '' : empty string : left for LTR or right for RTL
- $ismask
boolean $ismask true if this image is a mask, false otherwise
- $imgmask
mixed $imgmask image object returned by this function or false
- $border
mixed $border Indicates if borders must be drawn around the image. The value can be
either a number:
- 0: no border (default)
- 1: frame
or a string containing some or all of the following characters (in any order):
- L: left
- T: top
- R: right
- B: bottom
- $fitbox
boolean $fitbox If true scale image dimensions proportionally to fit within the ($w, $h)
box.
- $hidden
boolean $hidden if true do not display the image.
Returns
image information
Since
1.1
|
public
|
#
set_mqr( boolean $mqr )
Sets the current active configuration setting of magic_quotes_runtime (if the
set_magic_quotes_runtime function exist)
Sets the current active configuration setting of magic_quotes_runtime (if the
set_magic_quotes_runtime function exist)
Parameters
- $mqr
boolean $mqr FALSE for off, TRUE for on.
Since
4.6.025 (2009-08-17)
|
public
Returns
|
#
get_mqr( )
Gets the current active configuration setting of magic_quotes_runtime (if the
get_magic_quotes_runtime function exist)
Gets the current active configuration setting of magic_quotes_runtime (if the
get_magic_quotes_runtime function exist)
Returns
Returns 0 if magic quotes runtime is off or get_magic_quotes_runtime doesn't exist, 1
otherwise.
Since
4.6.025 (2009-08-17)
|
protected
|
#
_toJPEG( string $image )
Convert the loaded php image to a JPEG and then return a structure for the
PDF creator. This function requires GD library and write access to the directory
defined on K_PATH_CACHE constant.
Convert the loaded php image to a JPEG and then return a structure for the
PDF creator. This function requires GD library and write access to the directory
defined on K_PATH_CACHE constant.
Parameters
- $image
string $file Image file name.
|
protected
array
|
#
_parsejpeg( string $file )
Extract info from a JPEG file without using the GD library.
Extract info from a JPEG file without using the GD library.
Parameters
- $file
string $file image file to parse
Returns
array structure containing the image data
|
protected
array
|
#
_parsepng( string $file )
Extract info from a PNG file without using the GD library.
Extract info from a PNG file without using the GD library.
Parameters
- $file
string $file image file to parse
Returns
array structure containing the image data
|
protected
Returns
|
#
rfread( resource $handle, integer $length )
Binary-safe and URL-safe file read. Reads up to length bytes from the file
pointer referenced by handle. Reading stops as soon as one of the following
conditions is met: length bytes have been read; EOF (end of file) is
reached.
Binary-safe and URL-safe file read. Reads up to length bytes from the file
pointer referenced by handle. Reading stops as soon as one of the following
conditions is met: length bytes have been read; EOF (end of file) is
reached.
Parameters
- $handle
resource $handle
- $length
integer $length
Returns
Returns the read string or FALSE in case of error.
Author
Nicola Asuni
Since
4.5.027 (2009-03-16)
|
protected
|
#
ImagePngAlpha( string $file, float $x = '', float $y = '', float $w = 0, float $h = 0, string $type = '', mixed $link = '', string $align = '', boolean $resize = false, integer $dpi = 300, string $palign = '' )
Extract info from a PNG image with alpha channel using the GD library.
Extract info from a PNG image with alpha channel using the GD library.
Parameters
- $file
string $file Name of the file containing the image.
- $x
float $x Abscissa of the upper-left corner.
- $y
float $y Ordinate of the upper-left corner.
- $w
float $w Width of the image in the page. If not specified or equal to zero, it is
automatically calculated.
- $h
float $h Height of the image in the page. If not specified or equal to zero, it is
automatically calculated.
- $type
string $type Image format. Possible values are (case insensitive): JPEG and PNG
(whitout GD library) and all images supported by GD: GD, GD2, GD2PART, GIF,
JPEG, PNG, BMP, XBM, XPM;. If not specified, the type is inferred from the file
extension.
- $link
mixed $link URL or identifier returned by AddLink().
- $align
string $align Indicates the alignment of the pointer next to image insertion relative
to image height. The value can be:
- T: top-right for LTR or top-left for RTL
- M: middle-right for LTR or middle-left for RTL
- B: bottom-right for LTR or bottom-left for RTL
- N: next line
- $resize
boolean $resize If true resize (reduce) the image to fit $w and $h (requires GD
library).
- $dpi
integer $dpi dot-per-inch resolution used on resize
- $palign
string $palign Allows to center or align the image on the current line. Possible values
are:
- L : left align
- C : center
- R : right align
- '' : empty string : left for LTR or right for RTL
Author
Valentin Schmidt, Nicola Asuni
Since
4.3.007 (2008-12-04)
See
|
protected
|
#
getGDgamma( float $v )
Correct the gamma value to be used with GD library
Correct the gamma value to be used with GD library
Parameters
- $v
float $v the gamma value to be corrected
Since
4.3.007 (2008-12-04)
|
public
|
#
Ln( float $h = '', boolean $cell = false )
Performs a line break. The current abscissa goes back to the left margin and
the ordinate increases by the amount passed in parameter.
Performs a line break. The current abscissa goes back to the left margin and
the ordinate increases by the amount passed in parameter.
Parameters
- $h
float $h The height of the break. By default, the value equals the height of the last
printed cell.
- $cell
boolean $cell if true add a cMargin to the x coordinate
Since
1.0
See
|
public
float
|
#
GetX( )
Returns the relative X value of current position. The value is relative to
the left border for LTR languages and to the right border for RTL languages.
Returns the relative X value of current position. The value is relative to
the left border for LTR languages and to the right border for RTL languages.
Returns
float
Since
1.2
See
|
public
float
|
#
GetAbsX( )
Returns the absolute X value of current position.
Returns the absolute X value of current position.
Returns
float
Since
1.2
See
|
public
float
|
#
GetY( )
Returns the ordinate of the current position.
Returns the ordinate of the current position.
Returns
float
Since
1.0
See
|
public
|
#
SetX( float $x )
Defines the abscissa of the current position. If the passed value is
negative, it is relative to the right of the page (or left if language is
RTL).
Defines the abscissa of the current position. If the passed value is
negative, it is relative to the right of the page (or left if language is
RTL).
Parameters
- $x
float $x The value of the abscissa.
Since
1.2
See
|
public
|
#
SetY( float $y, boolean $resetx = true )
Moves the current abscissa back to the left margin and sets the ordinate. If
the passed value is negative, it is relative to the bottom of the page.
Moves the current abscissa back to the left margin and sets the ordinate. If
the passed value is negative, it is relative to the bottom of the page.
Parameters
- $y
float $y The value of the ordinate.
- $resetx
boolean $resetx if true (default) reset the X position.
Since
1.0
See
|
public
|
#
SetXY( float $x, float $y )
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.
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.
Parameters
- $x
float $x The value of the abscissa
- $y
float $y The value of the ordinate
Since
1.2
See
|
public
|
#
Output( string $name = 'doc.pdf', string $dest = 'I' )
Send the document to a given destination: string, local file or browser. In
the last case, the plug-in may be used (if present) or a download ("Save as"
dialog box) may be forced.
The method first calls Close() if necessary to terminate the document.
Send the document to a given destination: string, local file or browser. In
the last case, the plug-in may be used (if present) or a download ("Save as"
dialog box) may be forced.
The method first calls Close() if necessary to terminate the document.
Parameters
- $name
string $name The name of the file when saved. Note that special characters are removed
and blanks characters are replaced with the underscore character.
- $dest
string $dest Destination where to send the document. It can take one of the following
values:
- I: send the file inline to the browser (default). The plug-in is used if
available. The name given by name is used when one selects the "Save as" option
on the link generating the PDF.
- 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.
- S: return the document as a string. name is ignored.
Since
1.0
See
|
public
|
#
_destroy( boolean $destroyall = false, boolean $preserve_objcopy = false )
Unset all class variables except the following critical variables:
internal_encoding, state, bufferlen, buffer and diskcache.
Unset all class variables except the following critical variables:
internal_encoding, state, bufferlen, buffer and diskcache.
Parameters
- $destroyall
boolean $destroyall if true destroys all class variables, otherwise preserves critical
variables.
- $preserve_objcopy
boolean $preserve_objcopy if true preserves the objcopy variable
Since
4.5.016 (2009-02-24)
|
protected
|
#
_dochecks( )
Check for locale-related bug
Check for locale-related bug
|
protected
string
|
#
_getfontpath( )
Return fonts path
Returns
string
|
protected
|
|
protected
|
#
_putannotsrefs( integer $n )
Output referencees to page annotations
Output referencees to page annotations
Parameters
Author
Nicola Asuni
Since
4.7.000 (2008-08-29)
|
protected
|
#
_putannotsobjs( )
Output annotations objects for all pages. !!! THIS METHOD IS NOT YET
COMPLETED !!! See section 12.5 of PDF 32000_2008 reference.
Output annotations objects for all pages. !!! THIS METHOD IS NOT YET
COMPLETED !!! See section 12.5 of PDF 32000_2008 reference.
Author
Nicola Asuni
Since
4.0.018 (2008-08-06)
|
protected
integer
|
#
_putAPXObject( integer $w = 0, integer $h = 0, string $stream = '' )
Put appearance streams XObject used to define annotation's appearance
states
Put appearance streams XObject used to define annotation's appearance
states
Parameters
- $w
integer $w annotation width
- $h
integer $h annotation height
- $stream
string $stream appearance stream
Returns
integer object ID
Since
4.8.001 (2009-09-09)
|
protected
|
|
protected
|
#
_putfontwidths( mixed $font, mixed $cidoffset = 0 )
Outputs font widths
Author
Nicola Asuni
Since
4.4.000 (2008-12-07)
Parameter
array $font font data
int $cidoffset offset for CID values
|
protected
integer
|
#
_puttruetypeunicode( mixed $font )
Adds unicode fonts.
Based on PDF Reference 1.3 (section 5)
Adds unicode fonts.
Based on PDF Reference 1.3 (section 5)
Returns
integer font object ID
Author
Nicola Asuni
Since
1.52.0.TC005 (2005-01-05)
Parameter
array $font font data
|
protected
integer
|
#
_putcidfont0( array $font )
Output CID-0 fonts. A Type 0 CIDFont contains glyph descriptions based on the
Adobe Type 1 font format
Output CID-0 fonts. A Type 0 CIDFont contains glyph descriptions based on the
Adobe Type 1 font format
Parameters
- $font
array $font font data
Returns
integer font object ID
Author
Andrew Whitehead, Nicola Asuni, Yukihiro Nakadaira
Since
3.2.000 (2008-06-23)
|
protected
|
|
protected
|
#
_putspotcolors( )
Output Spot Colors Resources.
Output Spot Colors Resources.
Since
4.0.024 (2008-09-12)
|
protected
|
#
_putxobjectdict( )
Output object dictionary for images.
Output object dictionary for images.
|
protected
|
#
_putresourcedict( )
Output Resources Dictionary.
Output Resources Dictionary.
|
protected
|
|
protected
|
#
_putinfo( )
Adds some Metadata information (Document Information Dictionary) (see Chapter
14.3.3 Document Information Dictionary of PDF32000_2008.pdf Reference)
Adds some Metadata information (Document Information Dictionary) (see Chapter
14.3.3 Document Information Dictionary of PDF32000_2008.pdf Reference)
|
protected
|
|
protected
|
#
_putviewerpreferences( )
Output viewer preferences.
Output viewer preferences.
Author
Nicola asuni
Since
3.1.000 (2008-06-09)
|
protected
|
|
protected
|
#
_enddoc( )
Output end of document (EOF).
Output end of document (EOF).
|
protected
|
#
_beginpage( string $orientation = '', mixed $format = '' )
Initialize a new page.
Parameters
- $orientation
string $orientation page orientation. Possible values are (case insensitive):
- P or PORTRAIT (default)
- L or LANDSCAPE
- $format
mixed $format The format used for pages. It can be either one of the following values
(case insensitive) or a custom format in the form of a two-element array
containing the width and the height (expressed in the unit given by unit).
- 4A0
- 2A0
- A0
- A1
- A2
- A3
- A4 (default)
- A5
- A6
- A7
- A8
- A9
- A10
- B0
- B1
- B2
- B3
- B4
- B5
- B6
- B7
- B8
- B9
- B10
- C0
- C1
- C2
- C3
- C4
- C5
- C6
- C7
- C8
- C9
- C10
- RA0
- RA1
- RA2
- RA3
- RA4
- SRA0
- SRA1
- SRA2
- SRA3
- SRA4
- LETTER
- LEGAL
- EXECUTIVE
- FOLIO
|
protected
|
|
protected
integer
|
#
_newobj( )
Begin a new object and return the object number.
Begin a new object and return the object number.
Returns
integer object number
|
protected
|
#
_dounderline( integer $x, integer $y, string $txt )
Underline text.
Parameters
- $x
integer $x X coordinate
- $y
integer $y Y coordinate
- $txt
string $txt text to underline
|
protected
|
#
_dolinethrough( integer $x, integer $y, string $txt )
Line through text.
Parameters
- $x
integer $x X coordinate
- $y
integer $y Y coordinate
- $txt
string $txt text to linethrough
|
protected
|
#
_dounderlinew( integer $x, integer $y, integer $w )
Underline for rectangular text area.
Underline for rectangular text area.
Parameters
- $x
integer $x X coordinate
- $y
integer $y Y coordinate
- $w
integer $w width to underline
Since
4.8.008 (2009-09-29)
|
protected
|
#
_dolinethroughw( integer $x, integer $y, string $w )
Line through for rectangular text area.
Line through for rectangular text area.
Parameters
- $x
integer $x X coordinate
- $y
integer $y Y coordinate
- $w
string $txt text to linethrough
Since
4.8.008 (2009-09-29)
|
protected
4-byte
|
#
_freadint( string $f )
Read a 4-byte integer from file.
Read a 4-byte integer from file.
Parameters
Returns
4-byte integer
|
protected
string
|
#
_escape( string $s )
Add "\" before "\", "(" and ")"
Add "\" before "\", "(" and ")"
Parameters
- $s
string $s string to escape.
Returns
string escaped string.
|
protected
string
|
#
_datastring( string $s )
Format a data string for meta information
Format a data string for meta information
Parameters
- $s
string $s data string to escape.
Returns
string escaped string.
|
protected
string
|
#
_dataannobjstring( string $s )
Format a data string for annotation objects
Format a data string for annotation objects
Parameters
- $s
string $s data string to escape.
Returns
string escaped string.
|
protected
string
|
#
_datestring( )
Returns a formatted date for meta information
Returns a formatted date for meta information
Returns
string escaped date string.
Since
4.6.028 (2009-08-25)
|
protected
string
|
#
_textstring( string $s )
Format a text string for meta information
Format a text string for meta information
Parameters
- $s
string $s string to escape.
Returns
string escaped string.
|
protected
string
|
#
_escapetext( string $s )
Format a text string
Parameters
- $s
string $s string to escape.
Returns
string escaped string.
|
protected
|
#
_putstream( string $s, integer $n = 0 )
Output a stream.
Parameters
- $s
string $s string to output.
- $n
integer $n object reference for encryption mode
|
protected
|
#
_out( string $s )
Output a string to the document.
Output a string to the document.
Parameters
- $s
string $s string to output.
|
protected
array
|
#
UTF8StringToArray( string $str )
Converts UTF-8 strings to codepoints array.
Invalid byte sequences will be replaced with 0xFFFD (replacement character)
Based on: http://www.faqs.org/rfcs/rfc3629.html
<pre>
Char. number range | UTF-8 octet sequence
(hexadecimal) | (binary)
--------------------+-----------------------------------------------
0000 0000-0000 007F | 0xxxxxxx
0000 0080-0000 07FF | 110xxxxx 10xxxxxx
0000 0800-0000 FFFF | 1110xxxx 10xxxxxx 10xxxxxx
0001 0000-0010 FFFF | 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
---------------------------------------------------------------------
Converts UTF-8 strings to codepoints array.
Invalid byte sequences will be replaced with 0xFFFD (replacement character)
Based on: http://www.faqs.org/rfcs/rfc3629.html
Char. number range | UTF-8 octet sequence
(hexadecimal) | (binary)
--------------------+-----------------------------------------------
0000 0000-0000 007F | 0xxxxxxx
0000 0080-0000 07FF | 110xxxxx 10xxxxxx
0000 0800-0000 FFFF | 1110xxxx 10xxxxxx 10xxxxxx
0001 0000-0010 FFFF | 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
---------------------------------------------------------------------
ABFN notation:
---------------------------------------------------------------------
UTF8-octets = *( UTF8-char )
UTF8-char = UTF8-1 / UTF8-2 / UTF8-3 / UTF8-4
UTF8-1 = %x00-7F
UTF8-2 = %xC2-DF UTF8-tail
UTF8-3 = %xE0 %xA0-BF UTF8-tail / %xE1-EC 2( UTF8-tail ) /
%xED %x80-9F UTF8-tail / %xEE-EF 2( UTF8-tail )
UTF8-4 = %xF0 %x90-BF 2( UTF8-tail ) / %xF1-F3 3( UTF8-tail ) /
%xF4 %x80-8F 2( UTF8-tail )
UTF8-tail = %x80-BF
---------------------------------------------------------------------
Parameters
- $str
string $str string to process.
Returns
array containing codepoints (UTF-8 characters values)
Author
Nicola Asuni
Since
1.53.0.TC005 (2005-01-05)
|
protected
string
|
#
UTF8ToUTF16BE( string $str, boolean $setbom = true )
Converts UTF-8 strings to UTF16-BE.
Converts UTF-8 strings to UTF16-BE.
Parameters
- $str
string $str string to process.
- $setbom
boolean $setbom if true set the Byte Order Mark (BOM = 0xFEFF)
Returns
string
Author
Nicola Asuni
Since
1.53.0.TC005 (2005-01-05)
Uses
UTF8StringToArray(), arrUTF8ToUTF16BE()
|
protected
string
|
#
UTF8ToLatin1( string $str )
Converts UTF-8 strings to Latin1 when using the standard 14 core fonts.
Converts UTF-8 strings to Latin1 when using the standard 14 core fonts.
Parameters
- $str
string $str string to process.
Returns
string
Author
Andrew Whitehead, Nicola Asuni
Since
3.2.000 (2008-06-23)
|
protected
array
|
#
UTF8ArrToLatin1( array $unicode )
Converts UTF-8 characters array to array of Latin1 characters
Converts UTF-8 characters array to array of Latin1 characters
Parameters
- $unicode
array $unicode array containing UTF-8 unicode values
Returns
array
Author
Nicola Asuni
Since
4.8.023 (2010-01-15)
|
protected
string
|
#
arrUTF8ToUTF16BE( array $unicode, boolean $setbom = true )
Converts array of UTF-8 characters to UTF16-BE string.
Based on: http://www.faqs.org/rfcs/rfc2781.html
Encoding UTF-16:
Encoding of a single character from an ISO 10646 character value to
UTF-16 proceeds as follows. Let U be the character number, no greater
than 0x10FFFF.
1) If U < 0x10000, encode U as a 16-bit unsigned integer and
terminate.
2) Let U' = U - 0x10000. Because U is less than or equal to 0x10FFFF,
U' must be less than or equal to 0xFFFFF. That is, U' can be
represented in 20 bits.
3) Initialize two 16-bit unsigned integers, W1 and W2, to 0xD800 and
0xDC00, respectively. These integers each have 10 bits free to
encode the character value, for a total of 20 bits.
4) Assign the 10 high-order bits of the 20-bit U' to the 10 low-order
bits of W1 and the 10 low-order bits of U' to the 10 low-order
bits of W2. Terminate.
Graphically, steps 2 through 4 look like:
U' = yyyyyyyyyyxxxxxxxxxx
W1 = 110110yyyyyyyyyy
W2 = 110111xxxxxxxxxx
Parameters
- $unicode
array $unicode array containing UTF-8 unicode values
- $setbom
boolean $setbom if true set the Byte Order Mark (BOM = 0xFEFF)
Returns
string
Author
Nicola Asuni
Since
2.1.000 (2008-01-08)
See
|
public
|
#
setLanguageArray( array $language )
Set language array.
Parameters
Since
1.1
|
public
|
|
public
the
|
#
addHtmlLink( string $url, string $name, integer $fill = 0, boolean $firstline = false, array $color = '', string $style = -1, boolean $firstblock = false )
Output anchor link.
Parameters
- $url
string $url link URL or internal link (i.e.: <a href="#23">link to page
23</a>)
- $name
string $name link name
- $fill
integer $fill Indicates if the cell background must be painted (1) or transparent (0).
Default value: 0.
- $firstline
boolean $firstline if true prints only the first line and return the remaining string.
- $color
array $color array of RGB text color
- $style
string $style font style (U, D, B, I)
- $firstblock
boolean $firstblock if true the string is the starting of a line.
Returns
the number of cells used or the remaining text if $firstline = true;
|
public
array
|
#
convertHTMLColorToDec( string $color = '#FFFFFF' )
Returns an associative array (keys: R,G,B) from an html color name or a
six-digit or three-digit hexadecimal color representation (i.e. #3FE5AA or
#7FF).
Returns an associative array (keys: R,G,B) from an html color name or a
six-digit or three-digit hexadecimal color representation (i.e. #3FE5AA or
#7FF).
Parameters
- $color
string $color html color
Returns
array RGB color or false in case of error.
|
public
float
|
#
pixelsToUnits( integer $px )
Converts pixels to User's Units.
Converts pixels to User's Units.
Parameters
Returns
float value in user's unit
See
|
public
string
|
#
unhtmlentities( mixed $text_to_convert )
Reverse function for htmlentities. Convert entities in UTF-8.
Reverse function for htmlentities. Convert entities in UTF-8.
Parameters
- $text_to_convert
mixed $text_to_convert Text to convert.
Returns
string converted
|
protected
|
#
_objectkey( integer $n )
Compute encryption key depending on object number where the encrypted data is
stored
Compute encryption key depending on object number where the encrypted data is
stored
Parameters
- $n
integer $n object number
Since
2.0.000 (2008-01-02)
|
protected
|
#
_putencryption( )
Put encryption on PDF document.
Put encryption on PDF document.
Since
2.0.000 (2008-01-02)
|
protected
String
|
#
_RC4( string $key, String $text )
Returns the input text exrypted using RC4 algorithm and the specified key.
RC4 is the standard encryption algorithm used in PDF format
Returns the input text exrypted using RC4 algorithm and the specified key.
RC4 is the standard encryption algorithm used in PDF format
Parameters
- $key
string $key encryption key
- $text
String $text input text to be encrypted
Returns
String encrypted text
Author
Klemen Vodopivec
Since
2.0.000 (2008-01-02)
|
protected
String
|
#
_md5_16( string $str )
Encrypts a string using MD5 and returns it's value as a binary string.
Encrypts a string using MD5 and returns it's value as a binary string.
Parameters
- $str
string $str input string
Returns
String MD5 encrypted binary string
Author
Klemen Vodopivec
Since
2.0.000 (2008-01-02)
|
protected
String
|
#
_Ovalue( String $user_pass, String $owner_pass )
Compute O value (used for RC4 encryption)
Compute O value (used for RC4 encryption)
Parameters
- $user_pass
String $user_pass user password
- $owner_pass
String $owner_pass user password
Returns
String O value
Author
Klemen Vodopivec
Since
2.0.000 (2008-01-02)
|
protected
String
|
#
_Uvalue( )
Compute U value (used for RC4 encryption)
Compute U value (used for RC4 encryption)
Returns
String U value
Author
Klemen Vodopivec
Since
2.0.000 (2008-01-02)
|
protected
|
#
_generateencryptionkey( String $user_pass, String $owner_pass, String $protection )
Compute encryption key
Parameters
- $user_pass
String $user_pass user password
- $owner_pass
String $owner_pass user password
- $protection
String $protection protection type
Author
Klemen Vodopivec
Since
2.0.000 (2008-01-02)
|
public
|
#
SetProtection( Array $permissions = array(), String $user_pass = '', String $owner_pass = null )
Set document protection The permission array is composed of values taken from
the following ones:
- copy: copy text and images to the clipboard
- print: print the document
- modify: modify it (except for annotations and forms)
- annot-forms: add annotations and forms
Remark: the protection against modification is for people who have the full
Acrobat product. If you don't set any password, the document will open as usual.
If you set a user password, the PDF viewer will ask for it before displaying the
document. The master password, if different from the user one, can be used to
get full access. Note: protecting a document requires to encrypt it, which
increases the processing time a lot. This can cause a PHP time-out in some
cases, especially if the document contains images or fonts.
Set document protection The permission array is composed of values taken from
the following ones:
- copy: copy text and images to the clipboard
- print: print the document
- modify: modify it (except for annotations and forms)
- annot-forms: add annotations and forms
Remark: the protection against modification is for people who have the full
Acrobat product. If you don't set any password, the document will open as usual.
If you set a user password, the PDF viewer will ask for it before displaying the
document. The master password, if different from the user one, can be used to
get full access. Note: protecting a document requires to encrypt it, which
increases the processing time a lot. This can cause a PHP time-out in some
cases, especially if the document contains images or fonts.
Parameters
- $permissions
Array $permissions the set of permissions. Empty by default (only viewing is allowed).
(print, modify, copy, annot-forms)
- $user_pass
String $user_pass user password. Empty by default.
- $owner_pass
String $owner_pass owner password. If not specified, a random value is used.
Author
Klemen Vodopivec
Since
2.0.000 (2008-01-02)
|
public
|
#
StartTransform( )
Starts a 2D tranformation saving current graphic state. This function must be
called before scaling, mirroring, translation, rotation and skewing. Use
StartTransform() before, and StopTransform() after the transformations to
restore the normal behavior.
Starts a 2D tranformation saving current graphic state. This function must be
called before scaling, mirroring, translation, rotation and skewing. Use
StartTransform() before, and StopTransform() after the transformations to
restore the normal behavior.
Since
2.1.000 (2008-01-07)
See
|
public
|
#
StopTransform( )
Stops a 2D tranformation restoring previous graphic state. This function must
be called after scaling, mirroring, translation, rotation and skewing. Use
StartTransform() before, and StopTransform() after the transformations to
restore the normal behavior.
Stops a 2D tranformation restoring previous graphic state. This function must
be called after scaling, mirroring, translation, rotation and skewing. Use
StartTransform() before, and StopTransform() after the transformations to
restore the normal behavior.
Since
2.1.000 (2008-01-07)
See
|
public
|
#
ScaleX( float $s_x, integer $x = '', integer $y = '' )
Horizontal Scaling.
Parameters
- $s_x
float $s_x scaling factor for width as percent. 0 is not allowed.
- $x
integer $x abscissa of the scaling center. Default is current x position
- $y
integer $y ordinate of the scaling center. Default is current y position
Since
2.1.000 (2008-01-07)
See
|
public
|
#
ScaleY( float $s_y, integer $x = '', integer $y = '' )
Vertical Scaling.
Parameters
- $s_y
float $s_y scaling factor for height as percent. 0 is not allowed.
- $x
integer $x abscissa of the scaling center. Default is current x position
- $y
integer $y ordinate of the scaling center. Default is current y position
Since
2.1.000 (2008-01-07)
See
|
public
|
#
ScaleXY( float $s, integer $x = '', integer $y = '' )
Vertical and horizontal proportional Scaling.
Vertical and horizontal proportional Scaling.
Parameters
- $s
float $s scaling factor for width and height as percent. 0 is not allowed.
- $x
integer $x abscissa of the scaling center. Default is current x position
- $y
integer $y ordinate of the scaling center. Default is current y position
Since
2.1.000 (2008-01-07)
See
|
public
|
#
Scale( float $s_x, float $s_y, integer $x = '', integer $y = '' )
Vertical and horizontal non-proportional Scaling.
Vertical and horizontal non-proportional Scaling.
Parameters
- $s_x
float $s_x scaling factor for width as percent. 0 is not allowed.
- $s_y
float $s_y scaling factor for height as percent. 0 is not allowed.
- $x
integer $x abscissa of the scaling center. Default is current x position
- $y
integer $y ordinate of the scaling center. Default is current y position
Since
2.1.000 (2008-01-07)
See
|
public
|
#
MirrorH( integer $x = '' )
Horizontal Mirroring.
Parameters
- $x
integer $x abscissa of the point. Default is current x position
Since
2.1.000 (2008-01-07)
See
|
public
|
#
MirrorV( integer $y = '' )
Verical Mirroring.
Parameters
- $y
integer $y ordinate of the point. Default is current y position
Since
2.1.000 (2008-01-07)
See
|
public
|
#
MirrorP( integer $x = '', integer $y = '' )
Point reflection mirroring.
Point reflection mirroring.
Parameters
- $x
integer $x abscissa of the point. Default is current x position
- $y
integer $y ordinate of the point. Default is current y position
Since
2.1.000 (2008-01-07)
See
|
public
|
#
MirrorL( float $angle = 0, integer $x = '', integer $y = '' )
Reflection against a straight line through point (x, y) with the gradient
angle (angle).
Reflection against a straight line through point (x, y) with the gradient
angle (angle).
Parameters
- $angle
float $angle gradient angle of the straight line. Default is 0 (horizontal line).
- $x
integer $x abscissa of the point. Default is current x position
- $y
integer $y ordinate of the point. Default is current y position
Since
2.1.000 (2008-01-07)
See
|
public
|
#
TranslateX( integer $t_x )
Translate graphic object horizontally.
Translate graphic object horizontally.
Parameters
- $t_x
integer $t_x movement to the right (or left for RTL)
Since
2.1.000 (2008-01-07)
See
|
public
|
#
TranslateY( integer $t_y )
Translate graphic object vertically.
Translate graphic object vertically.
Parameters
- $t_y
integer $t_y movement to the bottom
Since
2.1.000 (2008-01-07)
See
|
public
|
#
Translate( integer $t_x, integer $t_y )
Translate graphic object horizontally and vertically.
Translate graphic object horizontally and vertically.
Parameters
- $t_x
integer $t_x movement to the right
- $t_y
integer $t_y movement to the bottom
Since
2.1.000 (2008-01-07)
See
|
public
|
#
Rotate( float $angle, integer $x = '', integer $y = '' )
Rotate object.
Parameters
- $angle
float $angle angle in degrees for counter-clockwise rotation
- $x
integer $x abscissa of the rotation center. Default is current x position
- $y
integer $y ordinate of the rotation center. Default is current y position
Since
2.1.000 (2008-01-07)
See
|
public
|
#
SkewX( float $angle_x, integer $x = '', integer $y = '' )
Skew horizontally.
Parameters
- $angle_x
float $angle_x angle in degrees between -90 (skew to the left) and 90 (skew to the
right)
- $x
integer $x abscissa of the skewing center. default is current x position
- $y
integer $y ordinate of the skewing center. default is current y position
Since
2.1.000 (2008-01-07)
See
|
public
|
#
SkewY( float $angle_y, integer $x = '', integer $y = '' )
Skew vertically.
Parameters
- $angle_y
float $angle_y angle in degrees between -90 (skew to the bottom) and 90 (skew to the
top)
- $x
integer $x abscissa of the skewing center. default is current x position
- $y
integer $y ordinate of the skewing center. default is current y position
Since
2.1.000 (2008-01-07)
See
|
public
|
#
Skew( float $angle_x, float $angle_y, integer $x = '', integer $y = '' )
Skew.
Parameters
- $angle_x
float $angle_x angle in degrees between -90 (skew to the left) and 90 (skew to the
right)
- $angle_y
float $angle_y angle in degrees between -90 (skew to the bottom) and 90 (skew to the
top)
- $x
integer $x abscissa of the skewing center. default is current x position
- $y
integer $y ordinate of the skewing center. default is current y position
Since
2.1.000 (2008-01-07)
See
|
protected
|
#
Transform( mixed $tm )
Apply graphic transformations.
Apply graphic transformations.
Since
2.1.000 (2008-01-07)
See
|
public
|
#
SetLineWidth( float $width )
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 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.
Parameters
- $width
float $width The width.
Since
1.0
See
|
public
integer
|
#
GetLineWidth( )
Returns the current the line width.
Returns the current the line width.
Returns
integer Line width
Since
2.1.000 (2008-01-07)
See
|
public
|
#
SetLineStyle( array $style )
Set line style.
Parameters
- $style
array $style Line style. Array with keys among the following:
- width (float): Width of the line in user units.
- cap (string): Type of cap to put on the line. Possible values are: butt,
round, square. The difference between "square" and "butt" is that "square"
projects a flat end past the end of the line.
- join (string): Type of join. Possible values are: miter, round, bevel.
- dash (mixed): Dash pattern. Is 0 (without dash) or string with series of
length values, which are the lengths of the on and off dashes. For example: "2"
represents 2 on, 2 off, 2 on, 2 off, ...; "2,1" is 2 on, 1 off, 2 on, 1 off,
...
- phase (integer): Modifier on the dash pattern which is used to shift the
point at which the pattern starts.
- color (array): Draw color. Format: array(GREY) or array(R,G,B) or
array(C,M,Y,K).
Since
2.1.000 (2008-01-08)
|
protected
|
#
_outPoint( float $x, float $y )
Set a draw point.
Parameters
- $x
float $x Abscissa of point.
- $y
float $y Ordinate of point.
Since
2.1.000 (2008-01-08)
|
protected
|
#
_outLine( float $x, float $y )
Draws a line from last draw point.
Draws a line from last draw point.
Parameters
- $x
float $x Abscissa of end point.
- $y
float $y Ordinate of end point.
Since
2.1.000 (2008-01-08)
|
protected
|
#
_outRect( float $x, float $y, float $w, float $h, string $op )
Draws a rectangle.
Parameters
- $x
float $x Abscissa of upper-left corner (or upper-right corner for RTL language).
- $y
float $y Ordinate of upper-left corner (or upper-right corner for RTL language).
- $w
float $w Width.
- $h
float $h Height.
- $op
string $op options
Since
2.1.000 (2008-01-08)
|
protected
|
#
_outCurve( float $x1, float $y1, float $x2, float $y2, float $x3, float $y3 )
Draws a Bezier curve from last draw point. The Bezier curve is a tangent to
the line between the control points at either end of the curve.
Draws a Bezier curve from last draw point. The Bezier curve is a tangent to
the line between the control points at either end of the curve.
Parameters
- $x1
float $x1 Abscissa of control point 1.
- $y1
float $y1 Ordinate of control point 1.
- $x2
float $x2 Abscissa of control point 2.
- $y2
float $y2 Ordinate of control point 2.
- $x3
float $x3 Abscissa of end point.
- $y3
float $y3 Ordinate of end point.
Since
2.1.000 (2008-01-08)
|
public
|
#
Line( float $x1, float $y1, float $x2, float $y2, array $style = array() )
Draws a line between two points.
Draws a line between two points.
Parameters
- $x1
float $x1 Abscissa of first point.
- $y1
float $y1 Ordinate of first point.
- $x2
float $x2 Abscissa of second point.
- $y2
float $y2 Ordinate of second point.
- $style
array $style Line style. Array like for SetLineStyle SetLineStyle. Default
value: default line style (empty array).
Since
1.0
See
|
public
|
#
Rect( float $x, float $y, float $w, float $h, string $style = '', array $border_style = array(), array $fill_color = array() )
Draws a rectangle.
Parameters
- $x
float $x Abscissa of upper-left corner (or upper-right corner for RTL language).
- $y
float $y Ordinate of upper-left corner (or upper-right corner for RTL language).
- $w
float $w Width.
- $h
float $h Height.
- $style
string $style Style of rendering. Possible values are:
- D or empty string: Draw (default).
- F: Fill.
- DF or FD: Draw and fill.
- CNZ: Clipping mode (using the even-odd rule to determine which regions lie
inside the clipping path).
- CEO: Clipping mode (using the nonzero winding number rule to determine which
regions lie inside the clipping path).
- $border_style
array $border_style Border style of rectangle. Array with keys among the following:
- all: Line style of all borders. Array like for SetLineStyle
SetLineStyle.
- L, T, R, B or combinations: Line style of left, top, right or bottom border.
Array like for SetLineStyle SetLineStyle.
If a key is not present or is null, not draws the border. Default value:
default line style (empty array).
- $fill_color
array $border_style Border style of rectangle. Array like for SetLineStyle
SetLineStyle. Default value: default line style (empty array).
Since
1.0
See
|
public
|
#
Curve( float $x0, float $y0, float $x1, float $y1, float $x2, float $y2, float $x3, float $y3, string $style = '', array $line_style = array(), array $fill_color = array() )
Draws a Bezier curve. The Bezier curve is a tangent to the line between the
control points at either end of the curve.
Draws a Bezier curve. The Bezier curve is a tangent to the line between the
control points at either end of the curve.
Parameters
- $x0
float $x0 Abscissa of start point.
- $y0
float $y0 Ordinate of start point.
- $x1
float $x1 Abscissa of control point 1.
- $y1
float $y1 Ordinate of control point 1.
- $x2
float $x2 Abscissa of control point 2.
- $y2
float $y2 Ordinate of control point 2.
- $x3
float $x3 Abscissa of end point.
- $y3
float $y3 Ordinate of end point.
- $style
string $style Style of rendering. Possible values are:
- D or empty string: Draw (default).
- F: Fill.
- DF or FD: Draw and fill.
- CNZ: Clipping mode (using the even-odd rule to determine which regions lie
inside the clipping path).
- CEO: Clipping mode (using the nonzero winding number rule to determine which
regions lie inside the clipping path).
- $line_style
array $line_style Line style of curve. Array like for SetLineStyle
SetLineStyle. Default value: default line style (empty array).
- $fill_color
array $fill_color Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K).
Default value: default color (empty array).
Since
2.1.000 (2008-01-08)
See
|
public
|
#
Polycurve( float $x0, float $y0, float $segments, string $style = '', array $line_style = array(), array $fill_color = array() )
Draws a poly-Bezier curve. Each Bezier curve segment is a tangent to the line
between the control points at either end of the curve.
Draws a poly-Bezier curve. Each Bezier curve segment is a tangent to the line
between the control points at either end of the curve.
Parameters
- $x0
float $x0 Abscissa of start point.
- $y0
float $y0 Ordinate of start point.
- $segments
float $segments An array of bezier descriptions. Format: array(x1, y1, x2, y2, x3,
y3).
- $style
string $style Style of rendering. Possible values are:
- D or empty string: Draw (default).
- F: Fill.
- DF or FD: Draw and fill.
- CNZ: Clipping mode (using the even-odd rule to determine which regions lie
inside the clipping path).
- CEO: Clipping mode (using the nonzero winding number rule to determine which
regions lie inside the clipping path).
- $line_style
array $line_style Line style of curve. Array like for SetLineStyle
SetLineStyle. Default value: default line style (empty array).
- $fill_color
array $fill_color Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K).
Default value: default color (empty array).
Since
3.0008 (2008-05-12)
See
|
public
|
#
Ellipse( float $x0, float $y0, float $rx, float $ry = 0, float $angle = 0, float $astart = 0, float $afinish = 360, string $style = '', array $line_style = array(), array $fill_color = array(), integer $nc = 8 )
Draws an ellipse. An ellipse is formed from n Bezier curves.
Draws an ellipse. An ellipse is formed from n Bezier curves.
Parameters
- $x0
float $x0 Abscissa of center point.
- $y0
float $y0 Ordinate of center point.
- $rx
float $rx Horizontal radius.
- $ry
float $ry Vertical radius (if ry = 0 then is a circle, see Circle Circle).
Default value: 0.
- $angle
float $angle: Angle oriented (anti-clockwise). Default value: 0.
- $astart
float $astart: Angle start of draw line. Default value: 0.
- $afinish
float $afinish: Angle finish of draw line. Default value: 360.
- $style
string $style Style of rendering. Possible values are:
- D or empty string: Draw (default).
- F: Fill.
- DF or FD: Draw and fill.
- C: Draw close.
- CNZ: Clipping mode (using the even-odd rule to determine which regions lie
inside the clipping path).
- CEO: Clipping mode (using the nonzero winding number rule to determine which
regions lie inside the clipping path).
- $line_style
array $line_style Line style of ellipse. Array like for SetLineStyle
SetLineStyle. Default value: default line style (empty array).
- $fill_color
array $fill_color Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K).
Default value: default color (empty array).
- $nc
integer $nc Number of curves used in ellipse. Default value: 8.
Since
2.1.000 (2008-01-08)
|
public
|
#
Circle( float $x0, float $y0, float $r, float $astart = 0, float $afinish = 360, string $style = '', array $line_style = array(), array $fill_color = array(), integer $nc = 8 )
Draws a circle. A circle is formed from n Bezier curves.
Draws a circle. A circle is formed from n Bezier curves.
Parameters
- $x0
float $x0 Abscissa of center point.
- $y0
float $y0 Ordinate of center point.
- $r
float $r Radius.
- $astart
float $astart: Angle start of draw line. Default value: 0.
- $afinish
float $afinish: Angle finish of draw line. Default value: 360.
- $style
string $style Style of rendering. Possible values are:
- D or empty string: Draw (default).
- F: Fill.
- DF or FD: Draw and fill.
- C: Draw close.
- CNZ: Clipping mode (using the even-odd rule to determine which regions lie
inside the clipping path).
- CEO: Clipping mode (using the nonzero winding number rule to determine which
regions lie inside the clipping path).
- $line_style
array $line_style Line style of circle. Array like for SetLineStyle
SetLineStyle. Default value: default line style (empty array).
- $fill_color
array $fill_color Fill color. Format: array(red, green, blue). Default value: default
color (empty array).
- $nc
integer $nc Number of curves used in circle. Default value: 8.
Since
2.1.000 (2008-01-08)
|
public
|
#
PolyLine( array $p, string $style = '', array $line_style = array(), array $fill_color = array() )
Draws a polygonal line
Parameters
- $p
array $p Points 0 to ($np - 1). Array with values (x0, y0, x1, y1,..., x(np-1), y(np -
1))
- $style
string $style Style of rendering. Possible values are:
- D or empty string: Draw (default).
- F: Fill.
- DF or FD: Draw and fill.
- CNZ: Clipping mode (using the even-odd rule to determine which regions lie
inside the clipping path).
- CEO: Clipping mode (using the nonzero winding number rule to determine which
regions lie inside the clipping path).
- $line_style
array $line_style Line style of polygon. Array with keys among the following:
- all: Line style of all lines. Array like for SetLineStyle
SetLineStyle.
- 0 to ($np - 1): Line style of each line. Array like for SetLineStyle
SetLineStyle.
If a key is not present or is null, not draws the line. Default value is
default line style (empty array).
- $fill_color
array $fill_color Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K).
Default value: default color (empty array).
Since
4.8.003 (2009-09-15)
|
public
|
#
Polygon( array $p, string $style = '', array $line_style = array(), array $fill_color = array(), boolean $closed = true )
Draws a polygon.
Parameters
- $p
array $p Points 0 to ($np - 1). Array with values (x0, y0, x1, y1,..., x(np-1), y(np -
1))
- $style
string $style Style of rendering. Possible values are:
- D or empty string: Draw (default).
- F: Fill.
- DF or FD: Draw and fill.
- CNZ: Clipping mode (using the even-odd rule to determine which regions lie
inside the clipping path).
- CEO: Clipping mode (using the nonzero winding number rule to determine which
regions lie inside the clipping path).
- $line_style
array $line_style Line style of polygon. Array with keys among the following:
- all: Line style of all lines. Array like for SetLineStyle
SetLineStyle.
- 0 to ($np - 1): Line style of each line. Array like for SetLineStyle
SetLineStyle.
If a key is not present or is null, not draws the line. Default value is
default line style (empty array).
- $fill_color
array $fill_color Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K).
Default value: default color (empty array).
- $closed
boolean $closed if true the polygon is closes, otherwise will remain open
Since
2.1.000 (2008-01-08)
|
public
|
#
RegularPolygon( float $x0, float $y0, float $r, integer $ns, float $angle = 0, boolean $draw_circle = false, string $style = '', array $line_style = array(), array $fill_color = array(), string $circle_style = '', array $circle_outLine_style = array(), array $circle_fill_color = array() )
Draws a regular polygon.
Parameters
- $x0
float $x0 Abscissa of center point.
- $y0
float $y0 Ordinate of center point.
- $r
float $r: Radius of inscribed circle.
- $ns
integer $ns Number of sides.
- $angle
float $angle Angle oriented (anti-clockwise). Default value: 0.
- $draw_circle
boolean $draw_circle Draw inscribed circle or not. Default value: false.
- $style
string $style Style of rendering. Possible values are:
- D or empty string: Draw (default).
- F: Fill.
- DF or FD: Draw and fill.
- CNZ: Clipping mode (using the even-odd rule to determine which regions lie
inside the clipping path).
- CEO: Clipping mode (using the nonzero winding number rule to determine which
regions lie inside the clipping path).
- $line_style
array $line_style Line style of polygon sides. Array with keys among the following:
- all: Line style of all sides. Array like for SetLineStyle
SetLineStyle.
- 0 to ($ns - 1): Line style of each side. Array like for SetLineStyle
SetLineStyle.
If a key is not present or is null, not draws the side. Default value is
default line style (empty array).
- $fill_color
array $fill_color Fill color. Format: array(red, green, blue). Default value: default
color (empty array).
- $circle_style
string $circle_style Style of rendering of inscribed circle (if draws). Possible values
are:
- D or empty string: Draw (default).
- F: Fill.
- DF or FD: Draw and fill.
- CNZ: Clipping mode (using the even-odd rule to determine which regions lie
inside the clipping path).
- CEO: Clipping mode (using the nonzero winding number rule to determine which
regions lie inside the clipping path).
- $circle_outLine_style
array $circle_outLine_style Line style of inscribed circle (if draws). Array like for
SetLineStyle SetLineStyle. Default value: default line style (empty
array).
- $circle_fill_color
array $circle_fill_color Fill color of inscribed circle (if draws). Format: array(red,
green, blue). Default value: default color (empty array).
Since
2.1.000 (2008-01-08)
|
public
|
#
StarPolygon( float $x0, float $y0, float $r, integer $nv, integer $ng, float $angle = 0, boolean $draw_circle = false, string $style = '', array $line_style = array(), array $fill_color = array(), string $circle_style = '', array $circle_outLine_style = array(), array $circle_fill_color = array() )
Draws a star polygon
Parameters
- $x0
float $x0 Abscissa of center point.
- $y0
float $y0 Ordinate of center point.
- $r
float $r Radius of inscribed circle.
- $nv
integer $nv Number of vertices.
- $ng
integer $ng Number of gap (if ($ng % $nv = 1) then is a regular polygon).
- $angle
float $angle: Angle oriented (anti-clockwise). Default value: 0.
- $draw_circle
boolean $draw_circle: Draw inscribed circle or not. Default value is false.
- $style
string $style Style of rendering. Possible values are:
- D or empty string: Draw (default).
- F: Fill.
- DF or FD: Draw and fill.
- CNZ: Clipping mode (using the even-odd rule to determine which regions lie
inside the clipping path).
- CEO: Clipping mode (using the nonzero winding number rule to determine which
regions lie inside the clipping path).
- $line_style
array $line_style Line style of polygon sides. Array with keys among the following:
- all: Line style of all sides. Array like for SetLineStyle
SetLineStyle.
- 0 to (n - 1): Line style of each side. Array like for SetLineStyle
SetLineStyle.
If a key is not present or is null, not draws the side. Default value is
default line style (empty array).
- $fill_color
array $fill_color Fill color. Format: array(red, green, blue). Default value: default
color (empty array).
- $circle_style
string $circle_style Style of rendering of inscribed circle (if draws). Possible values
are:
- D or empty string: Draw (default).
- F: Fill.
- DF or FD: Draw and fill.
- CNZ: Clipping mode (using the even-odd rule to determine which regions lie
inside the clipping path).
- CEO: Clipping mode (using the nonzero winding number rule to determine which
regions lie inside the clipping path).
- $circle_outLine_style
array $circle_outLine_style Line style of inscribed circle (if draws). Array like for
SetLineStyle SetLineStyle. Default value: default line style (empty
array).
- $circle_fill_color
array $circle_fill_color Fill color of inscribed circle (if draws). Format: array(red,
green, blue). Default value: default color (empty array).
Since
2.1.000 (2008-01-08)
|
public
|
#
RoundedRect( float $x, float $y, float $w, float $h, float $r, string $round_corner = '1111', string $style = '', array $border_style = array(), array $fill_color = array() )
Draws a rounded rectangle.
Draws a rounded rectangle.
Parameters
- $x
float $x Abscissa of upper-left corner.
- $y
float $y Ordinate of upper-left corner.
- $w
float $w Width.
- $h
float $h Height.
- $r
float $r Radius of the rounded corners.
- $round_corner
string $round_corner Draws rounded corner or not. String with a 0 (not rounded
i-corner) or 1 (rounded i-corner) in i-position. Positions are, in order and
begin to 0: top left, top right, bottom right and bottom left. Default value:
all rounded corner ("1111").
- $style
string $style Style of rendering. Possible values are:
- D or empty string: Draw (default).
- F: Fill.
- DF or FD: Draw and fill.
- CNZ: Clipping mode (using the even-odd rule to determine which regions lie
inside the clipping path).
- CEO: Clipping mode (using the nonzero winding number rule to determine which
regions lie inside the clipping path).
- $border_style
array $border_style Border style of rectangle. Array like for SetLineStyle
SetLineStyle. Default value: default line style (empty array).
- $fill_color
array $fill_color Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K).
Default value: default color (empty array).
Since
2.1.000 (2008-01-08)
|
public
|
#
Arrow( mixed $x0, mixed $y0, mixed $x1, mixed $y1, mixed $head_style = 0, mixed $arm_size = 5, mixed $arm_angle = 15 )
Draws a grahic arrow.
Author
Piotr Galecki, Nicola Asuni, Andy Meier
Since
4.6.018 (2009-07-10)
Parameter
float $x0 Abscissa of first point.
float $y0 Ordinate of first point.
float $x0 Abscissa of second point.
float $y1 Ordinate of second point.
int $head_style (0 = draw only arrowhead arms, 1 = draw closed arrowhead, but no
fill, 2 = closed and filled arrowhead, 3 = filled arrowhead)
float $arm_size length of arrowhead arms
int $arm_angle angle between an arm and the shaft
|
protected
string
|
#
utf8StrRev( string $str, boolean $setbom = false, boolean $forcertl = false )
Reverse the RLT substrings using the Bidirectional Algorithm (http://unicode.org/reports/tr9/).
Parameters
- $str
string $str string to manipulate.
- $setbom
boolean $setbom if true set the Byte Order Mark (BOM = 0xFEFF)
- $forcertl
boolean $forcertl if true forces RTL text direction
Returns
string
Author
Nicola Asuni
Since
2.1.000 (2008-01-08)
|
protected
string
|
#
utf8StrArrRev( array $arr, string $str = '', boolean $setbom = false, boolean $forcertl = false )
Reverse the RLT substrings array using the Bidirectional Algorithm (http://unicode.org/reports/tr9/).
Parameters
- $arr
array $arr array of unicode values.
- $str
string $str string to manipulate (or empty value).
- $setbom
boolean $setbom if true set the Byte Order Mark (BOM = 0xFEFF)
- $forcertl
boolean $forcertl if true forces RTL text direction
Returns
string
Author
Nicola Asuni
Since
4.9.000 (2010-03-27)
|
protected
array
|
#
utf8Bidi( array $ta, string $str = '', boolean $forcertl = false )
Reverse the RLT substrings using the Bidirectional Algorithm (http://unicode.org/reports/tr9/).
Parameters
- $ta
array $ta array of characters composing the string.
- $str
string $str string to process
- $forcertl
boolean $forcertl if 'R' forces RTL, if 'L' forces LTR
Returns
array of unicode chars
Author
Nicola Asuni
Since
2.4.000 (2008-03-06)
|
public
|
#
Bookmark( string $txt, integer $level = 0, float $y = -1, integer $page = '' )
Adds a bookmark.
Parameters
- $txt
string $txt bookmark description.
- $level
integer $level bookmark level (minimum value is 0).
- $y
float $y Ordinate of the boorkmark position (default = -1 = current position).
- $page
integer $page target page number (leave empty for current page).
Author
Olivier Plathey, Nicola Asuni
Since
2.1.002 (2008-02-12)
|
protected
|
#
_putbookmarks( )
Create a bookmark PDF string.
Create a bookmark PDF string.
Author
Olivier Plathey, Nicola Asuni
Since
2.1.002 (2008-02-12)
|
public
|
#
IncludeJS( string $script )
Adds a javascript
Parameters
- $script
string $script Javascript code
Author
Johannes Güntert, Nicola Asuni
Since
2.1.002 (2008-02-12)
|
public
integer
|
#
addJavascriptObject( string $script, boolean $onload = false )
Adds a javascript object and return object ID
Adds a javascript object and return object ID
Parameters
- $script
string $script Javascript code
- $onload
boolean $onload if true executes this object when opening the document
Returns
integer internal object ID
Author
Nicola Asuni
Since
4.8.000 (2009-09-07)
|
protected
|
#
_putjavascript( )
Create a javascript PDF string.
Create a javascript PDF string.
Author
Johannes Güntert, Nicola Asuni
Since
2.1.002 (2008-02-12)
|
protected
|
#
_JScolor( string $color )
Convert color to javascript color.
Convert color to javascript color.
Parameters
- $color
string $color color name or #RRGGBB
Author
Denis Van Nuffelen, Nicola Asuni
Since
2.1.002 (2008-02-12)
|
protected
|
#
_addfield( string $type, string $name, integer $x, integer $y, integer $w, integer $h, array $prop )
Adds a javascript form field.
Adds a javascript form field.
Parameters
- $type
string $type field type
- $name
string $name field name
- $x
integer $x horizontal position
- $y
integer $y vertical position
- $w
integer $w width
- $h
integer $h height
- $prop
array $prop javascript field properties. Possible values are described on official
Javascript for Acrobat API reference.
Author
Denis Van Nuffelen, Nicola Asuni
Since
2.1.002 (2008-02-12)
|
protected
array
|
#
getAnnotOptFromJSProp( array $prop )
Convert JavaScript form fields properties array to Annotation Properties
array.
Convert JavaScript form fields properties array to Annotation Properties
array.
Parameters
- $prop
array $prop javascript field properties. Possible values are described on official
Javascript for Acrobat API reference.
Returns
array of annotation properties
Author
Nicola Asuni
Since
4.8.000 (2009-09-06)
|
public
|
#
setFormDefaultProp( array $prop = array() )
Set default properties for form fields.
Set default properties for form fields.
Parameters
- $prop
array $prop javascript field properties. Possible values are described on official
Javascript for Acrobat API reference.
Author
Nicola Asuni
Since
4.8.000 (2009-09-06)
|
public
array
|
#
getFormDefaultProp( )
Return the default properties for form fields.
Return the default properties for form fields.
Returns
array $prop javascript field properties. Possible values are described on official
Javascript for Acrobat API reference.
Author
Nicola Asuni
Since
4.8.000 (2009-09-06)
|
public
|
#
TextField( string $name, float $w, float $h, array $prop = array(), array $opt = array(), float $x = '', float $y = '', boolean $js = false )
Creates a text field
Parameters
- $name
string $name field name
- $w
float $w Width of the rectangle
- $h
float $h Height of the rectangle
- $prop
array $prop javascript field properties. Possible values are described on official
Javascript for Acrobat API reference.
- $opt
array $opt annotation parameters. Possible values are described on official
PDF32000_2008 reference.
- $x
float $x Abscissa of the upper-left corner of the rectangle
- $y
float $y Ordinate of the upper-left corner of the rectangle
- $js
boolean $js if true put the field using JavaScript (requires Acrobat Writer to be
rendered).
Author
Nicola Asuni
Since
4.8.000 (2009-09-07)
|
public
|
#
RadioButton( string $name, integer $w, array $prop = array(), array $opt = array(), string $onvalue = 'On', boolean $checked = false, float $x = '', float $y = '', boolean $js = false )
Creates a RadioButton field
Creates a RadioButton field
Parameters
- $name
string $name field name
- $w
integer $w width
- $prop
array $prop javascript field properties. Possible values are described on official
Javascript for Acrobat API reference.
- $opt
array $opt annotation parameters. Possible values are described on official
PDF32000_2008 reference.
- $onvalue
string $onvalue value to be returned if selected.
- $checked
boolean $checked define the initial state.
- $x
float $x Abscissa of the upper-left corner of the rectangle
- $y
float $y Ordinate of the upper-left corner of the rectangle
- $js
boolean $js if true put the field using JavaScript (requires Acrobat Writer to be
rendered).
Author
Nicola Asuni
Since
4.8.000 (2009-09-07)
|
public
|
#
ListBox( string $name, integer $w, integer $h, array $values, array $prop = array(), array $opt = array(), float $x = '', float $y = '', boolean $js = false )
Creates a List-box field
Parameters
- $name
string $name field name
- $w
integer $w width
- $h
integer $h height
- $values
array $values array containing the list of values.
- $prop
array $prop javascript field properties. Possible values are described on official
Javascript for Acrobat API reference.
- $opt
array $opt annotation parameters. Possible values are described on official
PDF32000_2008 reference.
- $x
float $x Abscissa of the upper-left corner of the rectangle
- $y
float $y Ordinate of the upper-left corner of the rectangle
- $js
boolean $js if true put the field using JavaScript (requires Acrobat Writer to be
rendered).
Author
Nicola Asuni
Since
4.8.000 (2009-09-07)
|
public
|
#
ComboBox( string $name, integer $w, integer $h, array $values, array $prop = array(), array $opt = array(), float $x = '', float $y = '', boolean $js = false )
Creates a Combo-box field
Creates a Combo-box field
Parameters
- $name
string $name field name
- $w
integer $w width
- $h
integer $h height
- $values
array $values array containing the list of values.
- $prop
array $prop javascript field properties. Possible values are described on official
Javascript for Acrobat API reference.
- $opt
array $opt annotation parameters. Possible values are described on official
PDF32000_2008 reference.
- $x
float $x Abscissa of the upper-left corner of the rectangle
- $y
float $y Ordinate of the upper-left corner of the rectangle
- $js
boolean $js if true put the field using JavaScript (requires Acrobat Writer to be
rendered).
Author
Nicola Asuni
Since
4.8.000 (2009-09-07)
|
public
|
#
CheckBox( string $name, integer $w, boolean $checked = false, array $prop = array(), array $opt = array(), string $onvalue = 'Yes', float $x = '', float $y = '', boolean $js = false )
Creates a CheckBox field
Parameters
- $name
string $name field name
- $w
integer $w width
- $checked
boolean $checked define the initial state.
- $prop
array $prop javascript field properties. Possible values are described on official
Javascript for Acrobat API reference.
- $opt
array $opt annotation parameters. Possible values are described on official
PDF32000_2008 reference.
- $onvalue
string $onvalue value to be returned if selected.
- $x
float $x Abscissa of the upper-left corner of the rectangle
- $y
float $y Ordinate of the upper-left corner of the rectangle
- $js
boolean $js if true put the field using JavaScript (requires Acrobat Writer to be
rendered).
Author
Nicola Asuni
Since
4.8.000 (2009-09-07)
|
public
|
#
Button( string $name, integer $w, integer $h, string $caption, mixed $action, array $prop = array(), array $opt = array(), float $x = '', float $y = '', boolean $js = false )
Creates a button field
Parameters
- $name
string $name field name
- $w
integer $w width
- $h
integer $h height
- $caption
string $caption caption.
- $action
mixed $action action triggered by pressing the button. Use a string to specify a
javascript action. Use an array to specify a form action options as on section
12.7.5 of PDF32000_2008.
- $prop
array $prop javascript field properties. Possible values are described on official
Javascript for Acrobat API reference.
- $opt
array $opt annotation parameters. Possible values are described on official
PDF32000_2008 reference.
- $x
float $x Abscissa of the upper-left corner of the rectangle
- $y
float $y Ordinate of the upper-left corner of the rectangle
- $js
boolean $js if true put the field using JavaScript (requires Acrobat Writer to be
rendered).
Author
Nicola Asuni
Since
4.8.000 (2009-09-07)
|
protected
|
#
_putsignature( )
Add certification signature (DocMDP or UR3) You can set only one signature
type
Add certification signature (DocMDP or UR3) You can set only one signature
type
Author
Nicola Asuni
Since
4.6.008 (2009-05-07)
|
public
|
#
setUserRights( boolean $enable = true, string $document = '/FullSave', string $annots = '/Create/Delete/Modify/Copy/Import/Export', string $form = '/Add/Delete/FillIn/Import/Export/SubmitStandalone/SpawnTemplate', string $signature = '/Modify' )
Set User's Rights for PDF Reader WARNING: This works only using the Adobe
private key with the setSignature() method!. Check the PDF Reference 8.7.1
Transform Methods, Table 8.105 Entries in the UR transform parameters
dictionary
Set User's Rights for PDF Reader WARNING: This works only using the Adobe
private key with the setSignature() method!. Check the PDF Reference 8.7.1
Transform Methods, Table 8.105 Entries in the UR transform parameters
dictionary
Parameters
- $enable
boolean $enable if true enable user's rights on PDF reader
- $document
string $document Names specifying additional document-wide usage rights for the
document. The only defined value is "/FullSave", which permits a user to save
the document along with modified form and/or annotation data.
- $annots
string $annots Names specifying additional annotation-related usage rights for the
document. Valid names in PDF 1.5 and later are
/Create/Delete/Modify/Copy/Import/Export, which permit the user to perform the
named operation on annotations.
- $form
string $form Names specifying additional form-field-related usage rights for the
document. Valid names are:
/Add/Delete/FillIn/Import/Export/SubmitStandalone/SpawnTemplate
- $signature
string $signature Names specifying additional signature-related usage rights for the
document. The only defined value is /Modify, which permits a user to apply a
digital signature to an existing signature form field or clear a signed
signature form field.
Author
Nicola Asuni
Since
2.9.000 (2008-03-26)
|
public
|
#
setSignature( mixed $signing_cert = '', mixed $private_key = '', string $private_key_password = '', string $extracerts = '', integer $cert_type = 2, array $info = array() )
Enable document signature (requires the OpenSSL Library). The digital
signature improve document authenticity and integrity and allows o enable extra
features on Acrobat Reader.
Enable document signature (requires the OpenSSL Library). The digital
signature improve document authenticity and integrity and allows o enable extra
features on Acrobat Reader.
Parameters
- $signing_cert
mixed $signing_cert signing certificate (string or filename prefixed with 'file://')
- $private_key
mixed $private_key private key (string or filename prefixed with 'file://')
- $private_key_password
string $private_key_password password
- $extracerts
string $extracerts specifies the name of a file containing a bunch of extra
certificates to include in the signature which can for example be used to help
the recipient to verify the certificate that you used.
- $cert_type
integer $cert_type The access permissions granted for this document. Valid values shall
be: 1 = No changes to the document shall be permitted; any change to the
document shall invalidate the signature; 2 = Permitted changes shall be filling
in forms, instantiating page templates, and signing; other changes shall
invalidate the signature; 3 = Permitted changes shall be the same as for 2, as
well as annotation creation, deletion, and modification; other changes shall
invalidate the signature.
- $info
array $info array of option information: Name, Location, Reason, ContactInfo.
Author
Nicola Asuni
Since
4.6.005 (2009-04-24)
|
public
|
#
startPageGroup( integer $page = '' )
Create a new page group. NOTE: call this function before calling
AddPage()
Create a new page group. NOTE: call this function before calling
AddPage()
Parameters
- $page
integer $page starting group page (leave empty for next page).
Since
3.0.000 (2008-03-27)
|
public
|
#
AliasNbPages( string $alias = '{nb}' )
Defines an alias for the total number of pages. It will be substituted as the
document is closed.
Defines an alias for the total number of pages. It will be substituted as the
document is closed.
Parameters
- $alias
string $alias The alias.
Since
1.4
See
|
public
string
|
#
getAliasNbPages( )
Returns the string alias used for the total number of pages. If the current
font is unicode type, the returned string is surrounded by additional curly
braces.
Returns the string alias used for the total number of pages. If the current
font is unicode type, the returned string is surrounded by additional curly
braces.
Returns
string
Since
4.0.018 (2008-08-08)
See
|
public
|
#
AliasNumPage( string $alias = '{pnb}' )
Defines an alias for the page number. It will be substituted as the document
is closed.
Defines an alias for the page number. It will be substituted as the document
is closed.
Parameters
- $alias
string $alias The alias.
Since
4.5.000 (2009-01-02)
See
|
public
string
|
#
getAliasNumPage( )
Returns the string alias used for the page number. If the current font is
unicode type, the returned string is surrounded by additional curly braces.
Returns the string alias used for the page number. If the current font is
unicode type, the returned string is surrounded by additional curly braces.
Returns
string
Since
4.5.000 (2009-01-02)
See
|
public
current
|
#
getGroupPageNo( )
Return the current page in the group.
Return the current page in the group.
Returns
current page in the group
Since
3.0.000 (2008-03-27)
|
public
|
#
getGroupPageNoFormatted( )
Returns the current group page number formatted as a string.
Returns the current group page number formatted as a string.
Since
4.3.003 (2008-11-18)
See
|
public
alias
|
#
getPageGroupAlias( )
Return the alias of the current page group If the current font is unicode
type, the returned string is surrounded by additional curly braces. (will be
replaced by the total number of pages in this group).
Return the alias of the current page group If the current font is unicode
type, the returned string is surrounded by additional curly braces. (will be
replaced by the total number of pages in this group).
Returns
alias of the current page group
Since
3.0.000 (2008-03-27)
|
public
alias
|
#
getPageNumGroupAlias( )
Return the alias for the page number on the current page group If the current
font is unicode type, the returned string is surrounded by additional curly
braces. (will be replaced by the total number of pages in this group).
Return the alias for the page number on the current page group If the current
font is unicode type, the returned string is surrounded by additional curly
braces. (will be replaced by the total number of pages in this group).
Returns
alias of the current page group
Since
4.5.000 (2009-01-02)
|
protected
|
#
formatPageNumber( integer $num )
Format the page numbers. This method can be overriden for custom formats.
Format the page numbers. This method can be overriden for custom formats.
Parameters
- $num
integer $num page number
Since
4.2.005 (2008-11-06)
|
protected
|
#
formatTOCPageNumber( integer $num )
Format the page numbers on the Table Of Content. This method can be overriden
for custom formats.
Format the page numbers on the Table Of Content. This method can be overriden
for custom formats.
Parameters
- $num
integer $num page number
Since
4.5.001 (2009-01-04)
See
|
public
|
#
PageNoFormatted( )
Returns the current page number formatted as a string.
Returns the current page number formatted as a string.
Since
4.2.005 (2008-11-06)
See
|
protected
|
#
_putocg( )
Put visibility settings.
Since
3.0.000 (2008-03-27)
|
public
|
#
setVisibility( string $v )
Set the visibility of the successive elements. This can be useful, for
instance, to put a background image or color that will show on screen but won't
print.
Set the visibility of the successive elements. This can be useful, for
instance, to put a background image or color that will show on screen but won't
print.
Parameters
- $v
string $v visibility mode. Legal values are: all, print, screen.
Since
3.0.000 (2008-03-27)
|
protected
the
|
#
addExtGState( array $parms )
Add transparency parameters to the current extgstate
Add transparency parameters to the current extgstate
Parameters
- $parms
array $params parameters
Returns
the number of extgstates
Since
3.0.000 (2008-03-27)
|
protected
|
#
setExtGState( array $gs )
Add an extgstate
Parameters
Since
3.0.000 (2008-03-27)
|
protected
|
#
_putextgstates( )
Put extgstates for object transparency
Put extgstates for object transparency
Since
3.0.000 (2008-03-27)
|
public
|
#
setAlpha( float $alpha, string $bm = 'Normal' )
Set alpha for stroking (CA) and non-stroking (ca) operations.
Set alpha for stroking (CA) and non-stroking (ca) operations.
Parameters
- $alpha
float $alpha real value from 0 (transparent) to 1 (opaque)
- $bm
string $bm blend mode, one of the following: Normal, Multiply, Screen, Overlay, Darken,
Lighten, ColorDodge, ColorBurn, HardLight, SoftLight, Difference, Exclusion,
Hue, Saturation, Color, Luminosity
Since
3.0.000 (2008-03-27)
|
public
|
#
setJPEGQuality( integer $quality )
Set the default JPEG compression quality (1-100)
Set the default JPEG compression quality (1-100)
Parameters
- $quality
integer $quality JPEG quality, integer between 1 and 100
Since
3.0.000 (2008-03-27)
|
public
|
#
setDefaultTableColumns( integer $cols = 4 )
Set the default number of columns in a row for HTML tables.
Set the default number of columns in a row for HTML tables.
Parameters
- $cols
integer $cols number of columns
Since
3.0.014 (2008-06-04)
|
public
|
#
setCellHeightRatio( integer $h )
Set the height of the cell (line height) respect the font height.
Set the height of the cell (line height) respect the font height.
Parameters
- $h
integer $h cell proportion respect font height (typical value = 1.25).
Since
3.0.014 (2008-06-04)
|
public
|
#
getCellHeightRatio( )
return the height of cell repect font height.
return the height of cell repect font height.
Since
4.0.012 (2008-07-24)
|
public
|
#
setPDFVersion( mixed $version = '1.7' )
Set the PDF version (check PDF reference for valid values). Default value is
1.t
Set the PDF version (check PDF reference for valid values). Default value is
1.t
Since
3.1.000 (2008-06-09)
|
public
|
#
setViewerPreferences( array $preferences )
Set the viewer preferences dictionary controlling the way the document is to be
presented on the screen or in print. (see Section 8.1 of PDF reference, "Viewer
Preferences").
- HideToolbar boolean (Optional) A flag specifying whether to hide the viewer
application's tool bars when the document is active. Default value: false.
- HideMenubar boolean (Optional) A flag specifying whether to hide the viewer
application's menu bar when the document is active. Default value: false.
- HideWindowUI boolean (Optional) A flag specifying whether to hide user
interface elements in the document's window (such as scroll bars and navigation
controls), leaving only the document's contents displayed. Default value:
false.
- FitWindow boolean (Optional) A flag specifying whether to resize the
document's window to fit the size of the first displayed page. Default value:
false.
- CenterWindow boolean (Optional) A flag specifying whether to position the
document's window in the center of the screen. Default value: false.
- DisplayDocTitle boolean (Optional; PDF 1.4) A flag specifying whether the
window's title bar should display the document title taken from the Title entry
of the document information dictionary (see Section 10.2.1, "Document
Information Dictionary"). If false, the title bar should instead display the
name of the PDF file containing the document. Default value: false.
- NonFullScreenPageMode name (Optional) The document's page mode, specifying
how to display the document on exiting full-screen mode:
- UseNone Neither document outline nor thumbnail images visible
- UseOutlines Document outline visible
- UseThumbs Thumbnail images visible
- UseOC Optional content group panel visible
This entry is meaningful only if the value of the PageMode entry in the catalog
dictionary (see Section 3.6.1, "Document Catalog") is FullScreen; it is ignored
otherwise. Default value: UseNone.
- ViewArea name (Optional; PDF 1.4) The name of the page boundary representing
the area of a page to be displayed when viewing the document on the screen.
Valid values are (see Section 10.10.1, "Page Boundaries").:
- MediaBox
- CropBox (default)
- BleedBox
- TrimBox
- ArtBox
- ViewClip name (Optional; PDF 1.4) The name of the page boundary to which the
contents of a page are to be clipped when viewing the document on the screen.
Valid values are (see Section 10.10.1, "Page Boundaries").:
- MediaBox
- CropBox (default)
- BleedBox
- TrimBox
- ArtBox
- PrintArea name (Optional; PDF 1.4) The name of the page boundary
representing the area of a page to be rendered when printing the document. Valid
values are (see Section 10.10.1, "Page Boundaries").:
- MediaBox
- CropBox (default)
- BleedBox
- TrimBox
- ArtBox
- PrintClip name (Optional; PDF 1.4) The name of the page boundary to which
the contents of a page are to be clipped when printing the document. Valid
values are (see Section 10.10.1, "Page Boundaries").:
- MediaBox
- CropBox (default)
- BleedBox
- TrimBox
- ArtBox
- PrintScaling name (Optional; PDF 1.6) The page scaling option to be selected
when a print dialog is displayed for this document. Valid values are:
- None, which indicates that the print dialog should reflect no page
scaling
- AppDefault (default), which indicates that applications should use the
current print scaling
- Duplex name (Optional; PDF 1.7) The paper handling option to use when
printing the file from the print dialog. The following values are valid:
- Simplex - Print single-sided
- DuplexFlipShortEdge - Duplex and flip on the short edge of the sheet
- DuplexFlipLongEdge - Duplex and flip on the long edge of the sheet
Default value: none
- PickTrayByPDFSize boolean (Optional; PDF 1.7) A flag specifying whether the
PDF page size is used to select the input paper tray. This setting influences
only the preset values used to populate the print dialog presented by a PDF
viewer application. If PickTrayByPDFSize is true, the check box in the print
dialog associated with input paper tray is checked. Note: This setting has no
effect on Mac OS systems, which do not provide the ability to pick the input
tray by size.
- PrintPageRange array (Optional; PDF 1.7) The page numbers used to initialize
the print dialog box when the file is printed. The first page of the PDF file is
denoted by 1. Each pair consists of the first and last pages in the sub-range.
An odd number of integers causes this entry to be ignored. Negative numbers
cause the entire array to be ignored. Default value: as defined by PDF viewer
application
- NumCopies integer (Optional; PDF 1.7) The number of copies to be printed
when the print dialog is opened for this file. Supported values are the integers
2 through 5. Values outside this range are ignored. Default value: as defined by
PDF viewer application, but typically 1
Set the viewer preferences dictionary controlling the way the document is to be
presented on the screen or in print. (see Section 8.1 of PDF reference, "Viewer
Preferences").
- HideToolbar boolean (Optional) A flag specifying whether to hide the viewer
application's tool bars when the document is active. Default value: false.
- HideMenubar boolean (Optional) A flag specifying whether to hide the viewer
application's menu bar when the document is active. Default value: false.
- HideWindowUI boolean (Optional) A flag specifying whether to hide user
interface elements in the document's window (such as scroll bars and navigation
controls), leaving only the document's contents displayed. Default value:
false.
- FitWindow boolean (Optional) A flag specifying whether to resize the
document's window to fit the size of the first displayed page. Default value:
false.
- CenterWindow boolean (Optional) A flag specifying whether to position the
document's window in the center of the screen. Default value: false.
- DisplayDocTitle boolean (Optional; PDF 1.4) A flag specifying whether the
window's title bar should display the document title taken from the Title entry
of the document information dictionary (see Section 10.2.1, "Document
Information Dictionary"). If false, the title bar should instead display the
name of the PDF file containing the document. Default value: false.
- NonFullScreenPageMode name (Optional) The document's page mode, specifying
how to display the document on exiting full-screen mode:
- UseNone Neither document outline nor thumbnail images visible
- UseOutlines Document outline visible
- UseThumbs Thumbnail images visible
- UseOC Optional content group panel visible
This entry is meaningful only if the value of the PageMode entry in the catalog
dictionary (see Section 3.6.1, "Document Catalog") is FullScreen; it is ignored
otherwise. Default value: UseNone.
- ViewArea name (Optional; PDF 1.4) The name of the page boundary representing
the area of a page to be displayed when viewing the document on the screen.
Valid values are (see Section 10.10.1, "Page Boundaries").:
- MediaBox
- CropBox (default)
- BleedBox
- TrimBox
- ArtBox
- ViewClip name (Optional; PDF 1.4) The name of the page boundary to which the
contents of a page are to be clipped when viewing the document on the screen.
Valid values are (see Section 10.10.1, "Page Boundaries").:
- MediaBox
- CropBox (default)
- BleedBox
- TrimBox
- ArtBox
- PrintArea name (Optional; PDF 1.4) The name of the page boundary
representing the area of a page to be rendered when printing the document. Valid
values are (see Section 10.10.1, "Page Boundaries").:
- MediaBox
- CropBox (default)
- BleedBox
- TrimBox
- ArtBox
- PrintClip name (Optional; PDF 1.4) The name of the page boundary to which
the contents of a page are to be clipped when printing the document. Valid
values are (see Section 10.10.1, "Page Boundaries").:
- MediaBox
- CropBox (default)
- BleedBox
- TrimBox
- ArtBox
- PrintScaling name (Optional; PDF 1.6) The page scaling option to be selected
when a print dialog is displayed for this document. Valid values are:
- None, which indicates that the print dialog should reflect no page
scaling
- AppDefault (default), which indicates that applications should use the
current print scaling
- Duplex name (Optional; PDF 1.7) The paper handling option to use when
printing the file from the print dialog. The following values are valid:
- Simplex - Print single-sided
- DuplexFlipShortEdge - Duplex and flip on the short edge of the sheet
- DuplexFlipLongEdge - Duplex and flip on the long edge of the sheet
Default value: none
- PickTrayByPDFSize boolean (Optional; PDF 1.7) A flag specifying whether the
PDF page size is used to select the input paper tray. This setting influences
only the preset values used to populate the print dialog presented by a PDF
viewer application. If PickTrayByPDFSize is true, the check box in the print
dialog associated with input paper tray is checked. Note: This setting has no
effect on Mac OS systems, which do not provide the ability to pick the input
tray by size.
- PrintPageRange array (Optional; PDF 1.7) The page numbers used to initialize
the print dialog box when the file is printed. The first page of the PDF file is
denoted by 1. Each pair consists of the first and last pages in the sub-range.
An odd number of integers causes this entry to be ignored. Negative numbers
cause the entire array to be ignored. Default value: as defined by PDF viewer
application
- NumCopies integer (Optional; PDF 1.7) The number of copies to be printed
when the print dialog is opened for this file. Supported values are the integers
2 through 5. Values outside this range are ignored. Default value: as defined by
PDF viewer application, but typically 1
Parameters
- $preferences
array $preferences array of options.
Author
Nicola Asuni
Since
3.1.000 (2008-06-09)
|
public
|
#
colorRegistrationBar( float $x, float $y, float $w, float $h, boolean $transition = true, boolean $vertical = false, string $colors = 'A,R,G,B,C,M,Y,K' )
Paints color transition registration bars
Paints color transition registration bars
Parameters
- $x
float $x abscissa of the top left corner of the rectangle.
- $y
float $y ordinate of the top left corner of the rectangle.
- $w
float $w width of the rectangle.
- $h
float $h height of the rectangle.
- $transition
boolean $transition if true prints tcolor transitions to white.
- $vertical
boolean $vertical if true prints bar vertically.
- $colors
string $colors colors to print, one letter per color separated by comma (for example
'A,W,R,G,B,C,M,Y,K'): A=black, W=white, R=red, G=green, B=blue, C=cyan,
M=magenta, Y=yellow, K=black.
Author
Nicola Asuni
Since
4.9.000 (2010-03-26)
|
public
|
#
cropMark( float $x, float $y, float $w, float $h, string $type = 'A,B,C,D', array $color = array(0,0,0) )
Paints crop mark
Parameters
- $x
float $x abscissa of the crop mark center.
- $y
float $y ordinate of the crop mark center.
- $w
float $w width of the crop mark.
- $h
float $h height of the crop mark.
- $type
string $type type of crop mark, one sybol per type separated by comma: A = top left, B
= top right, C = bottom left, D = bottom right.
- $color
array $color crop mark color (default black).
Author
Nicola Asuni
Since
4.9.000 (2010-03-26)
|
public
|
#
registrationMark( float $x, float $y, float $r, boolean $double = false, array $cola = array(0,0,0), array $colb = array(255,255,255) )
Paints a registration mark
Paints a registration mark
Parameters
- $x
float $x abscissa of the registration mark center.
- $y
float $y ordinate of the registration mark center.
- $r
float $r radius of the crop mark.
- $double
boolean $double if true print two concentric crop marks.
- $cola
array $cola crop mark color (default black).
- $colb
array $colb second crop mark color.
Author
Nicola Asuni
Since
4.9.000 (2010-03-26)
|
public
|
#
LinearGradient( float $x, float $y, float $w, float $h, array $col1 = array(), array $col2 = array(), array $coords = array(0,0,1,0) )
Paints a linear colour gradient.
Paints a linear colour gradient.
Parameters
- $x
float $x abscissa of the top left corner of the rectangle.
- $y
float $y ordinate of the top left corner of the rectangle.
- $w
float $w width of the rectangle.
- $h
float $h height of the rectangle.
- $col1
array $col1 first color (RGB components).
- $col2
array $col2 second color (RGB components).
- $coords
array $coords array of the form (x1, y1, x2, y2) which defines the gradient vector
(see linear_gradient_coords.jpg). The default value is from left to right (x1=0,
y1=0, x2=1, y2=0).
Author
Andreas Würmser, Nicola Asuni
Since
3.1.000 (2008-06-09)
|
public
|
#
RadialGradient( float $x, float $y, float $w, float $h, array $col1 = array(), array $col2 = array(), array $coords = array(0.5,0.5,0.5,0.5,1) )
Paints a radial colour gradient.
Paints a radial colour gradient.
Parameters
- $x
float $x abscissa of the top left corner of the rectangle.
- $y
float $y ordinate of the top left corner of the rectangle.
- $w
float $w width of the rectangle.
- $h
float $h height of the rectangle.
- $col1
array $col1 first color (RGB components).
- $col2
array $col2 second color (RGB components).
- $coords
array $coords array of the form (fx, fy, cx, cy, r) where (fx, fy) is the starting
point of the gradient with color1, (cx, cy) is the center of the circle with
color2, and r is the radius of the circle (see radial_gradient_coords.jpg). (fx,
fy) should be inside the circle, otherwise some areas will not be defined.
Author
Andreas Würmser, Nicola Asuni
Since
3.1.000 (2008-06-09)
|
public
|
#
CoonsPatchMesh( float $x, float $y, float $w, float $h, array $col1 = array(), array $col2 = array(), array $col3 = array(), array $col4 = array(), array $coords = array(0.00,0.0,0.33,0.00,0.67,0.00,1.00,0.00,1.00,0.33,1.00,0.67,1.00,1.00,0.67,1.00,0.33,1.00,0.00,1.00,0.00,0.67,0.00,0.33), array $coords_min = 0, array $coords_max = 1 )
Paints a coons patch mesh.
Paints a coons patch mesh.
Parameters
- $x
float $x abscissa of the top left corner of the rectangle.
- $y
float $y ordinate of the top left corner of the rectangle.
- $w
float $w width of the rectangle.
- $h
float $h height of the rectangle.
- $col1
array $col1 first color (lower left corner) (RGB components).
- $col2
array $col2 second color (lower right corner) (RGB components).
- $col3
array $col3 third color (upper right corner) (RGB components).
- $col4
array $col4 fourth color (upper left corner) (RGB components).
- $coords
array $coords
- for one patch mesh: array(float x1, float y1, .... float x12, float y12): 12
pairs of coordinates (normally from 0 to 1) which specify the Bezier control
points that define the patch. First pair is the lower left edge point, next is
its right control point (control point 2). Then the other points are defined in
the order: control point 1, edge point, control point 2 going counter-clockwise
around the patch. Last (x12, y12) is the first edge point's left control point
(control point 1).
- for two or more patch meshes: array[number of patches]: arrays with the
following keys for each patch: f: where to put that patch (0 = first patch, 1,
2, 3 = right, top and left of precedent patch - I didn't figure this out
completely - just try and error ;-) points: 12 pairs of coordinates of the
Bezier control points as above for the first patch, 8 pairs of coordinates for
the following patches, ignoring the coordinates already defined by the precedent
patch (I also didn't figure out the order of these - also: try and see what's
happening) colors: must be 4 colors for the first patch, 2 colors for the
following patches
- $coords_min
array $coords_min minimum value used by the coordinates. If a coordinate's value is
smaller than this it will be cut to coords_min. default: 0
- $coords_max
array $coords_max maximum value used by the coordinates. If a coordinate's value is
greater than this it will be cut to coords_max. default: 1
Author
Andreas Würmser, Nicola Asuni
Since
3.1.000 (2008-06-09)
|
protected
|
#
Clip( float $x, float $y, float $w, float $h )
Set a rectangular clipping area.
Set a rectangular clipping area.
Parameters
- $x
float $x abscissa of the top left corner of the rectangle (or top right corner for RTL
mode).
- $y
float $y ordinate of the top left corner of the rectangle.
- $w
float $w width of the rectangle.
- $h
float $h height of the rectangle.
Author
Andreas Würmser, Nicola Asuni
Since
3.1.000 (2008-06-09)
|
protected
|
#
Gradient( integer $type, array $col1, array $col2, array $coords )
Output gradient.
Parameters
- $type
integer $type type of gradient.
- $col1
array $col1 first color array (GRAY, RGB or CMYK)
- $col2
array $col2 second color array (GRAY, RGB or CMYK) - must be the same color type as
$col1
- $coords
array $coords array of coordinates.
Author
Andreas Würmser, Nicola Asuni
Since
3.1.000 (2008-06-09)
|
public
|
#
_putshaders( )
Output shaders.
Author
Andreas Würmser, Nicola Asuni
Since
3.1.000 (2008-06-09)
|
protected
|
#
_outarc( mixed $x1, mixed $y1, mixed $x2, mixed $y2, mixed $x3, mixed $y3 )
Output an arc
Author
Maxime Delorme, Nicola Asuni
Since
3.1.000 (2008-06-09)
|
public
|
#
PieSector( float $xc, float $yc, float $r, float $a, float $b, string $style = 'FD', float $cw = true, float $o = 90 )
Draw the sector of a circle. It can be used for instance to render pie
charts.
Draw the sector of a circle. It can be used for instance to render pie
charts.
Parameters
- $xc
float $xc abscissa of the center.
- $yc
float $yc ordinate of the center.
- $r
float $r radius.
- $a
float $a start angle (in degrees).
- $b
float $b end angle (in degrees).
- $style
string $style: D, F, FD or DF (draw, fill, fill and draw). Default: FD.
- $cw
float $cw: indicates whether to go clockwise (default: true).
- $o
float $o: origin of angles (0 for 3 o'clock, 90 for noon, 180 for 9 o'clock, 270 for 6
o'clock). Default: 90.
Author
Maxime Delorme, Nicola Asuni
Since
3.1.000 (2008-06-09)
|
public
|
#
ImageEps( string $file, float $x = '', float $y = '', float $w = 0, float $h = 0, mixed $link = '', boolean $useBoundingBox = true, string $align = '', string $palign = '', mixed $border = 0 )
Embed vector-based Adobe Illustrator (AI) or AI-compatible EPS files. Only
vector drawing is supported, not text or bitmap. Although the script was
successfully tested with various AI format versions, best results are probably
achieved with files that were exported in the AI3 format (tested with
Illustrator CS2, Freehand MX and Photoshop CS2).
Embed vector-based Adobe Illustrator (AI) or AI-compatible EPS files. Only
vector drawing is supported, not text or bitmap. Although the script was
successfully tested with various AI format versions, best results are probably
achieved with files that were exported in the AI3 format (tested with
Illustrator CS2, Freehand MX and Photoshop CS2).
Parameters
- $file
string $file Name of the file containing the image.
- $x
float $x Abscissa of the upper-left corner.
- $y
float $y Ordinate of the upper-left corner.
- $w
float $w Width of the image in the page. If not specified or equal to zero, it is
automatically calculated.
- $h
float $h Height of the image in the page. If not specified or equal to zero, it is
automatically calculated.
- $link
mixed $link URL or identifier returned by AddLink().
- $useBoundingBox
boolean useBoundingBox specifies whether to position the bounding box (true) or the
complete canvas (false) at location (x,y). Default value is true.
- $align
string $align Indicates the alignment of the pointer next to image insertion relative
to image height. The value can be:
- T: top-right for LTR or top-left for RTL
- M: middle-right for LTR or middle-left for RTL
- B: bottom-right for LTR or bottom-left for RTL
- N: next line
- $palign
string $palign Allows to center or align the image on the current line. Possible values
are:
- L : left align
- C : center
- R : right align
- '' : empty string : left for LTR or right for RTL
- $border
mixed $border Indicates if borders must be drawn around the image. The value can be
either a number:
- 0: no border (default)
- 1: frame
or a string containing some or all of the following characters (in any order):
- L: left
- T: top
- R: right
- B: bottom
Author
Valentin Schmidt, Nicola Asuni
Since
3.1.000 (2008-06-09)
|
public
|
#
setBarcode( string $bc = '' )
Set document barcode.
Parameters
|
public
string
|
#
getBarcode( )
Get current barcode.
Returns
string
Since
4.0.012 (2008-07-24)
|
public
|
#
write1DBarcode( string $code, string $type, integer $x = '', integer $y = '', integer $w = '', integer $h = '', float $xres = 0.4, array $style = '', string $align = '' )
Print a Linear Barcode.
Parameters
- $code
string $code code to print
- $type
string $type type of barcode (see barcodes.php for supported formats).
- $x
integer $x x position in user units
- $y
integer $y y position in user units
- $w
integer $w width in user units
- $h
integer $h height in user units
- $xres
float $xres width of the smallest bar in user units
- $style
array $style array of options:
- string $style['position'] barcode position inside the specified width: L =
left (default for LTR); C = center; R = right (default for RTL); S =
stretch
- boolean $style['border'] if true prints a border around the barcode
- int $style['padding'] padding to leave around the barcode in user units
- array $style['fgcolor'] color array for bars and text
- mixed $style['bgcolor'] color array for background or false for
transparent
- boolean $style["text"] boolean if true prints text below the barcode
- string $style['font'] font name for text
- int $style['fontsize'] font size for text
- int $style['stretchtext']: 0 = disabled; 1 = horizontal scaling only if
necessary; 2 = forced horizontal scaling; 3 = character spacing only if
necessary; 4 = forced character spacing
- $align
string $align Indicates the alignment of the pointer next to barcode insertion relative
to barcode height. The value can be:
- T: top-right for LTR or top-left for RTL
- M: middle-right for LTR or middle-left for RTL
- B: bottom-right for LTR or bottom-left for RTL
- N: next line
Author
Nicola Asuni
Since
3.1.000 (2008-06-09)
|
public
|
#
writeBarcode( integer $x, integer $y, integer $w, integer $h, string $type, string $style, string $font, integer $xres, string $code )
This function is DEPRECATED, please use the new write1DBarcode()
function.
This function is DEPRECATED, please use the new write1DBarcode()
function.
Deprecated
deprecated since version 3.1.000 (2008-06-10)
Parameters
- $x
integer $x x position in user units
- $y
integer $y y position in user units
- $w
integer $w width in user units
- $h
integer $h height position in user units
- $type
string $type type of barcode (I25, C128A, C128B, C128C, C39)
- $style
string $style barcode style
- $font
string $font font for text
- $xres
integer $xres x resolution
- $code
string $code code to print
See
|
public
|
#
write2DBarcode( string $code, string $type, integer $x = '', integer $y = '', integer $w = '', integer $h = '', array $style = '', string $align = '' )
Print 2D Barcode.
Parameters
- $code
string $code code to print
- $type
string $type type of barcode (see 2dbarcodes.php for supported formats).
- $x
integer $x x position in user units
- $y
integer $y y position in user units
- $w
integer $w width in user units
- $h
integer $h height in user units
- $style
array $style array of options:
- boolean $style['border'] if true prints a border around the barcode
- int $style['padding'] padding to leave around the barcode in user units
- array $style['fgcolor'] color array for bars and text
- mixed $style['bgcolor'] color array for background or false for
transparent
- $align
string $align Indicates the alignment of the pointer next to barcode insertion relative
to barcode height. The value can be:
- T: top-right for LTR or top-left for RTL
- M: middle-right for LTR or middle-left for RTL
- B: bottom-right for LTR or bottom-left for RTL
- N: next line
Author
Nicola Asuni
Since
4.5.037 (2009-04-07)
|
public
array
|
#
getMargins( )
Returns an array containing current margins:
- $ret['left'] = left margin
- $ret['right'] = right margin
- $ret['top'] = top margin
- $ret['bottom'] = bottom margin
- $ret['header'] = header margin
- $ret['footer'] = footer margin
- $ret['cell'] = cell margin
Returns an array containing current margins:
- $ret['left'] = left margin
- $ret['right'] = right margin
- $ret['top'] = top margin
- $ret['bottom'] = bottom margin
- $ret['header'] = header margin
- $ret['footer'] = footer margin
- $ret['cell'] = cell margin
Returns
array containing all margins measures
Since
3.2.000 (2008-06-23)
|
public
array
|
#
getOriginalMargins( )
Returns an array containing original margins:
- $ret['left'] = left margin
- $ret['right'] = right margin
Returns an array containing original margins:
- $ret['left'] = left margin
- $ret['right'] = right margin
Returns
array containing all margins measures
Since
4.0.012 (2008-07-24)
|
public
current
|
#
getFontSize( )
Returns the current font size.
Returns the current font size.
Returns
current font size
Since
3.2.000 (2008-06-23)
|
public
current
|
#
getFontSizePt( )
Returns the current font size in points unit.
Returns the current font size in points unit.
Returns
current font size in points unit
Since
3.2.000 (2008-06-23)
|
public
string
|
#
getFontFamily( )
Returns the current font family name.
Returns the current font family name.
Returns
string current font family name
Since
4.3.008 (2008-12-05)
|
public
string
|
#
getFontStyle( )
Returns the current font style.
Returns the current font style.
Returns
string current font style
Since
4.3.008 (2008-12-05)
|
public
|
#
writeHTMLCell( float $w, float $h, float $x, float $y, string $html = '', mixed $border = 0, integer $ln = 0, integer $fill = 0, boolean $reseth = true, string $align = '', boolean $autopadding = true )
Prints a cell (rectangular area) with optional borders, background color and
html text string. The upper-left corner of the cell corresponds to the current
position. After the call, the current position moves to the right or to the next
line.
If automatic page breaking is enabled and the cell goes beyond the limit, a page
break is done before outputting.
Prints a cell (rectangular area) with optional borders, background color and
html text string. The upper-left corner of the cell corresponds to the current
position. After the call, the current position moves to the right or to the next
line.
If automatic page breaking is enabled and the cell goes beyond the limit, a page
break is done before outputting.
Parameters
- $w
float $w Cell width. If 0, the cell extends up to the right margin.
- $h
float $h Cell minimum height. The cell extends automatically if needed.
- $x
float $x upper-left corner X coordinate
- $y
float $y upper-left corner Y coordinate
- $html
string $html html text to print. Default value: empty string.
- $border
mixed $border Indicates if borders must be drawn around the cell. The value can be
either a number:
- 0: no border (default)
- 1: frame
or a string containing some or all of the following characters (in any order):
- L: left
- T: top
- R: right
- B: bottom
- $ln
integer $ln Indicates where the current position should go after the call. Possible
values are:
- 0: to the right (or left for RTL language)
- 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.
- $fill
integer $fill Indicates if the cell background must be painted (1) or transparent (0).
Default value: 0.
- $reseth
boolean $reseth if true reset the last cell height (default true).
- $align
string $align Allows to center or align the text. Possible values are:
- L : left align
- C : center
- R : right align
- '' : empty string : left for LTR or right for RTL
- $autopadding
boolean $autopadding if true, uses internal padding and automatically adjust it to
account for line width.
See
Uses
|
protected
array
|
#
getHtmlDomArray( string $html )
Returns the HTML DOM array.
- $dom[$key]['tag'] = true if tag, false otherwise;
- $dom[$key]['value'] = tag name or text;
- $dom[$key]['opening'] = true if opening tag, false otherwise;
- $dom[$key]['attribute'] = array of attributes (attribute name is the
key);
- $dom[$key]['style'] = array of style attributes (attribute name is the
key);
- $dom[$key]['parent'] = id of parent element;
- $dom[$key]['fontname'] = font family name;
- $dom[$key]['fontstyle'] = font style;
- $dom[$key]['fontsize'] = font size in points;
- $dom[$key]['bgcolor'] = RGB array of background color;
- $dom[$key]['fgcolor'] = RGB array of foreground color;
- $dom[$key]['width'] = width in pixels;
- $dom[$key]['height'] = height in pixels;
- $dom[$key]['align'] = text alignment;
- $dom[$key]['cols'] = number of colums in table;
- $dom[$key]['rows'] = number of rows in table;
Returns the HTML DOM array.
- $dom[$key]['tag'] = true if tag, false otherwise;
- $dom[$key]['value'] = tag name or text;
- $dom[$key]['opening'] = true if opening tag, false otherwise;
- $dom[$key]['attribute'] = array of attributes (attribute name is the
key);
- $dom[$key]['style'] = array of style attributes (attribute name is the
key);
- $dom[$key]['parent'] = id of parent element;
- $dom[$key]['fontname'] = font family name;
- $dom[$key]['fontstyle'] = font style;
- $dom[$key]['fontsize'] = font size in points;
- $dom[$key]['bgcolor'] = RGB array of background color;
- $dom[$key]['fgcolor'] = RGB array of foreground color;
- $dom[$key]['width'] = width in pixels;
- $dom[$key]['height'] = height in pixels;
- $dom[$key]['align'] = text alignment;
- $dom[$key]['cols'] = number of colums in table;
- $dom[$key]['rows'] = number of rows in table;
Parameters
- $html
string $html html code
Returns
array
Since
3.2.000 (2008-06-20)
|
protected
string
|
#
getSpaceString( )
Returns the string used to find spaces
Returns the string used to find spaces
Returns
string
Author
Nicola Asuni
Since
4.8.024 (2010-01-15)
|
public
|
#
writeHTML( string $html, boolean $ln = true, integer $fill = false, boolean $reseth = false, boolean $cell = false, string $align = '' )
Allows to preserve some HTML formatting (limited support).
IMPORTANT: The HTML must be well formatted - try to clean-up it using an
application like HTML-Tidy before submitting. Supported tags are: a, b,
blockquote, br, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i,
img, li, ol, p, pre, small, span, strong, sub, sup, table, tcpdf, td, th, thead,
tr, tt, u, ul
Allows to preserve some HTML formatting (limited support).
IMPORTANT: The HTML must be well formatted - try to clean-up it using an
application like HTML-Tidy before submitting. Supported tags are: a, b,
blockquote, br, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i,
img, li, ol, p, pre, small, span, strong, sub, sup, table, tcpdf, td, th, thead,
tr, tt, u, ul
Parameters
- $html
string $html text to display
- $ln
boolean $ln if true add a new line after text (default = true)
- $fill
integer $fill Indicates if the background must be painted (true) or transparent (false).
- $reseth
boolean $reseth if true reset the last cell height (default false).
- $cell
boolean $cell if true add the default cMargin space to each Write (default false).
- $align
string $align Allows to center or align the text. Possible values are:
- L : left align
- C : center
- R : right align
- '' : empty string : left for LTR or right for RTL
|
protected
|
#
openHTMLTagHandler( array & $dom, integer $key, boolean $cell = false )
Process opening tags.
Parameters
- $dom
array $dom html dom array
- $key
integer $key current element id
- $cell
boolean $cell if true add the default cMargin space to each new line (default false).
|
protected
|
#
closeHTMLTagHandler( array & $dom, integer $key, boolean $cell = false )
Process closing tags.
Parameters
- $dom
array $dom html dom array
- $key
integer $key current element id
- $cell
boolean $cell if true add the default cMargin space to each new line (default false).
|
protected
|
#
addHTMLVertSpace( integer $n, boolean $cell = false, string $h = '', boolean $firstorlast = false, string $tag = '', boolean $closing = false )
Add vertical spaces if needed.
Add vertical spaces if needed.
Parameters
- $n
integer $n number of spaces to add
- $cell
boolean $cell if true add the default cMargin space to each new line (default false).
- $h
string $h The height of the break. By default, the value equals the height of the last
printed cell.
- $firstorlast
boolean $firstorlast if true do not print additional empty lines.
- $tag
string $tag HTML tag to which this space will be applied
- $closing
boolean $closing true if this space will be applied to a closing tag, false otherwise
|
public
|
#
setLIsymbol( string $symbol = '!' )
Set the default bullet to be used as LI bullet symbol
Set the default bullet to be used as LI bullet symbol
Parameters
- $symbol
string $symbol character or string to be used (legal values are: '' = automatic, '!' =
auto bullet, '#' = auto numbering, 'disc', 'disc', 'circle', 'square', '1',
'decimal', 'decimal-leading-zero', 'i', 'lower-roman', 'I', 'upper-roman', 'a',
'lower-alpha', 'lower-latin', 'A', 'upper-alpha', 'upper-latin', 'lower-greek')
Since
4.0.028 (2008-09-26)
|
public
|
#
SetBooklet( boolean $booklet = true, float $inner = -1, float $outer = -1 )
Set the booklet mode for double-sided pages.
Set the booklet mode for double-sided pages.
Parameters
- $booklet
boolean $booklet true set the booklet mode on, fals eotherwise.
- $inner
float $inner Inner page margin.
- $outer
float $outer Outer page margin.
Since
4.2.000 (2008-10-29)
|
protected
|
#
swapMargins( boolean $reverse = true )
Swap the left and right margins.
Swap the left and right margins.
Parameters
- $reverse
boolean $reverse if true swap left and right margins.
Since
4.2.000 (2008-10-29)
|
public
|
#
setHtmlVSpace( array $tagvs )
Set the vertical spaces for HTML tags. The array must have the following
structure (example): $tagvs = array('h1' => array(0 => array('h' => '',
'n' => 2), 1 => array('h' => 1.3, 'n' => 1))); The first array level
contains the tag names, the second level contains 0 for opening tags or 1 for
closing tags, the third level contains the vertical space unit (h) and the
number spaces to add (n). If the h parameter is not specified, default values
are used.
Set the vertical spaces for HTML tags. The array must have the following
structure (example): $tagvs = array('h1' => array(0 => array('h' => '',
'n' => 2), 1 => array('h' => 1.3, 'n' => 1))); The first array level
contains the tag names, the second level contains 0 for opening tags or 1 for
closing tags, the third level contains the vertical space unit (h) and the
number spaces to add (n). If the h parameter is not specified, default values
are used.
Parameters
- $tagvs
array $tagvs array of tags and relative vertical spaces.
Since
4.2.001 (2008-10-30)
|
public
|
#
setListIndentWidth( float $width )
Set custom width for list indentation.
Set custom width for list indentation.
Parameters
- $width
float $width width of the indentation. Use negative value to disable it.
Since
4.2.007 (2008-11-12)
|
public
|
#
setOpenCell( boolean $isopen )
Set the top/bottom cell sides to be open or closed when the cell cross the
page.
Set the top/bottom cell sides to be open or closed when the cell cross the
page.
Parameters
- $isopen
boolean $isopen if true keeps the top/bottom border open for the cell sides that cross
the page.
Since
4.2.010 (2008-11-14)
|
public
|
#
setHtmlLinksStyle( array $color = array(0,0,255), string $fontstyle = 'U' )
Set the color and font style for HTML links.
Set the color and font style for HTML links.
Parameters
- $color
array $color RGB array of colors
- $fontstyle
string $fontstyle additional font styles to add
Since
4.4.003 (2008-12-09)
|
public
float
|
#
getHTMLUnitToUnits( string $htmlval, string $refsize = 1, string $defaultunit = 'px', boolean $points = false )
Convert HTML string containing value and unit of measure to user's units or
points.
Convert HTML string containing value and unit of measure to user's units or
points.
Parameters
- $htmlval
string $htmlval string containing values and unit
- $refsize
string $refsize reference value in points
- $defaultunit
string $defaultunit default unit (can be one of the following: %, em, ex, px, in, mm,
pc, pt).
- $points
boolean $point if true returns points, otherwise returns value in user's units
Returns
float value in user's unit or point if $points=true
Since
4.4.004 (2008-12-10)
|
public
string
|
#
intToRoman( integer $number )
Returns the Roman representation of an integer number
Returns the Roman representation of an integer number
Parameters
- $number
integer number to convert
Returns
string roman representation of the specified number
Since
4.4.004 (2008-12-10)
|
protected
|
#
putHtmlListBullet( integer $listdepth, string $listtype = '', float $size = 10 )
Output an HTML list bullet or ordered item symbol
Output an HTML list bullet or ordered item symbol
Parameters
- $listdepth
integer $listdepth list nesting level
- $listtype
string $listtype type of list
- $size
float $size current font size
Since
4.4.004 (2008-12-10)
|
protected
array
|
#
getGraphicVars( )
Returns current graphic variables as array.
Returns current graphic variables as array.
Returns
array graphic variables
Since
4.2.010 (2008-11-14)
|
protected
|
#
setGraphicVars( mixed $gvars )
Set graphic variables.
Parameters
- $gvars
mixed $gvars array graphic variables
Since
4.2.010 (2008-11-14)
|
protected
|
#
getObjFilename( string $name )
Returns a temporary filename for caching object on filesystem.
Returns a temporary filename for caching object on filesystem.
Parameters
- $name
string $prefix prefix to add to filename return string filename.
Since
4.5.000 (2008-12-31)
|
protected
|
#
writeDiskCache( string $filename, mixed $data, boolean $append = false )
Writes data to a temporary file on filesystem.
Writes data to a temporary file on filesystem.
Parameters
- $filename
string $file file name
- $data
mixed $data data to write on file
- $append
boolean $append if true append data, false replace.
Since
4.5.000 (2008-12-31)
|
protected
mixed
|
#
readDiskCache( string $filename )
Read data from a temporary file on filesystem.
Read data from a temporary file on filesystem.
Parameters
- $filename
string $file file name
Returns
mixed retrieved data
Since
4.5.000 (2008-12-31)
|
protected
|
#
setBuffer( string $data )
Set buffer content (always append data).
Set buffer content (always append data).
Parameters
Since
4.5.000 (2009-01-02)
|
protected
string
|
#
getBuffer( )
Get buffer content.
Returns
string buffer content
Since
4.5.000 (2009-01-02)
|
protected
|
#
setPageBuffer( integer $page, string $data, boolean $append = false )
Set page buffer content.
Parameters
- $page
integer $page page number
- $data
string $data page data
- $append
boolean $append if true append data, false replace.
Since
4.5.000 (2008-12-31)
|
protected
string
|
#
getPageBuffer( integer $page )
Get page buffer content.
Parameters
- $page
integer $page page number
Returns
string page buffer content or false in case of error
Since
4.5.000 (2008-12-31)
|
protected
|
#
setImageBuffer( string $image, array $data )
Set image buffer content.
Set image buffer content.
Parameters
- $image
string $image image key
- $data
array $data image data
Since
4.5.000 (2008-12-31)
|
protected
|
#
setImageSubBuffer( string $image, string $key, array $data )
Set image buffer content for a specified sub-key.
Set image buffer content for a specified sub-key.
Parameters
- $image
string $image image key
- $key
string $key image sub-key
- $data
array $data image data
Since
4.5.000 (2008-12-31)
|
protected
string
|
#
getImageBuffer( string $image )
Get image buffer content.
Get image buffer content.
Parameters
- $image
string $image image key
Returns
string image buffer content or false in case of error
Since
4.5.000 (2008-12-31)
|
protected
|
#
setFontBuffer( string $font, array $data )
Set font buffer content.
Parameters
- $font
string $font font key
- $data
array $data font data
Since
4.5.000 (2009-01-02)
|
protected
|
#
setFontSubBuffer( string $font, string $key, array $data )
Set font buffer content.
Parameters
- $font
string $font font key
- $key
string $key font sub-key
- $data
array $data font data
Since
4.5.000 (2009-01-02)
|
protected
string
|
#
getFontBuffer( string $font )
Get font buffer content.
Parameters
- $font
string $font font key
Returns
string font buffer content or false in case of error
Since
4.5.000 (2009-01-02)
|
public
true
|
#
movePage( integer $frompage, integer $topage )
Move a page to a previous position.
Move a page to a previous position.
Parameters
- $frompage
integer $frompage number of the source page
- $topage
integer $topage number of the destination page (must be less than $frompage)
Returns
true in case of success, false in case of error.
Since
4.5.000 (2009-01-02)
|
public
true
|
#
deletePage( integer $page )
Remove the specified page.
Remove the specified page.
Parameters
- $page
integer $page page to remove
Returns
true in case of success, false in case of error.
Since
4.6.004 (2009-04-23)
|
public
|
#
addTOC( integer $page = '', string $numbersfont = '', string $filler = '.', string $toc_name = 'TOC' )
Output a Table of Content Index (TOC). After calling this method you have to
call addPage() to add other content. You can override this method to achieve
different styles.
Output a Table of Content Index (TOC). After calling this method you have to
call addPage() to add other content. You can override this method to achieve
different styles.
Parameters
- $page
integer $page page number where this TOC should be inserted (leave empty for current
page).
- $numbersfont
string $numbersfont set the font for page numbers (please use monospaced font for
better alignment).
- $filler
string $filler string used to fill the space between text and page number.
- $toc_name
string $toc_name name to use for TOC bookmark.
Author
Nicola Asuni
Since
4.5.000 (2009-01-02)
|
public
|
#
startTransaction( )
Stores a copy of the current TCPDF object used for undo operation.
Stores a copy of the current TCPDF object used for undo operation.
Since
4.5.029 (2009-03-19)
|
public
|
#
commitTransaction( )
Delete the copy of the current TCPDF object used for undo operation.
Delete the copy of the current TCPDF object used for undo operation.
Since
4.5.029 (2009-03-19)
|
public
TCPDF
|
#
rollbackTransaction( boolean $self = false )
This method allows to undo the latest transaction by returning the latest
saved TCPDF object with startTransaction().
This method allows to undo the latest transaction by returning the latest
saved TCPDF object with startTransaction().
Parameters
- $self
boolean $self if true restores current class object to previous state without the need
of reassignment via the returned value.
Returns
Since
4.5.029 (2009-03-19)
|
public
cloned
|
#
objclone( object $object )
Creates a copy of a class object
Creates a copy of a class object
Parameters
- $object
object $object class object to be cloned
Returns
cloned object
Since
4.5.029 (2009-03-19)
|
public
boolean
|
#
empty_string( string $str )
Determine whether a string is empty.
Determine whether a string is empty.
Parameters
- $str
string $str string to be checked
Returns
boolean true if string is empty
Since
4.5.044 (2009-04-16)
|
public
Returns
|
#
revstrpos( string $haystack, string $needle, integer $offset = 0 )
Find position of last occurrence of a substring in a string
Find position of last occurrence of a substring in a string
Parameters
- $haystack
string $haystack The string to search in.
- $needle
string $needle substring to search.
- $offset
integer $offset May be specified to begin searching an arbitrary number of characters
into the string.
Returns
Returns the position where the needle exists. Returns FALSE if the needle was not found.
Since
4.8.038 (2010-03-13)
|
public
|
#
setEqualColumns( integer $numcols = 0, integer $width = 0, integer $y = '' )
Set multiple columns of the same size
Set multiple columns of the same size
Parameters
- $numcols
integer $numcols number of columns (set to zero to disable columns mode)
- $width
integer $width column width
- $y
integer $y column starting Y position (leave empty for current Y position)
Since
4.9.001 (2010-03-28)
|
public
|
#
setColumnsArray( array $columns )
Set columns array. Each column is represented by and array with the following
keys: (w = width, s = space between columns, y = column top position).
Set columns array. Each column is represented by and array with the following
keys: (w = width, s = space between columns, y = column top position).
Parameters
Since
4.9.001 (2010-03-28)
|
public
|
#
selectColumn( integer $col = '' )
Set position at a given column
Set position at a given column
Parameters
- $col
integer $col column number (from 0 to getNumberOfColumns()-1); empty string = current
column.
Since
4.9.001 (2010-03-28)
|