MIOLO25
|
Membros públicos | |
__construct ($size, $orientation="portrait", $aa_factor=1, $bg_color=array(1, 1, 1, 0)) | |
get_image () | |
get_width () | |
get_height () | |
get_page_number () | |
get_page_count () | |
set_page_count ($count) | |
line ($x1, $y1, $x2, $y2, $color, $width, $style=null) | |
rectangle ($x1, $y1, $w, $h, $color, $width, $style=null) | |
filled_rectangle ($x1, $y1, $w, $h, $color) | |
polygon ($points, $color, $width=null, $style=null, $fill=false) | |
circle ($x, $y, $r, $color, $width=null, $style=null, $fill=false) | |
image ($img_url, $img_type, $x, $y, $w, $h) | |
text ($x, $y, $text, $font, $size, $color=array(0, 0, 0), $adjust=0) | |
add_named_dest ($anchorname) | |
add_link ($url, $x, $y, $width, $height) | |
get_text_width ($text, $font, $size, $spacing=0) | |
get_font_height ($font, $size) | |
new_page () | |
stream ($filename, $options=null) | |
output ($options=null) | |
__construct | ( | $size, | |
$orientation = "portrait", | |||
$aa_factor = 1, | |||
$bg_color = array(1,1,1,0) ) |
Class constructor
mixed | $size | The size of image to create: array(x1,y1,x2,y2) or "letter", "legal", etc. |
string | $orientation | The orientation of the document (either 'landscape' or 'portrait') |
float | $aa_factor | Anti-aliasing factor, 1 for no AA |
array | $bg_color | Image background color: array(r,g,b,a), 0 <= r,g,b,a <= 1 |
add_link | ( | $url, | |
$x, | |||
$y, | |||
$width, | |||
$height ) |
Add a link to the pdf
string | $url | The url to link to |
float | $x | The x position of the link |
float | $y | The y position of the link |
float | $width | The width of the link |
float | $height | The height of the link |
Implementa Canvas.
add_named_dest | ( | $anchorname | ) |
Add a named destination (similar to ... in html)
string | $anchorname | The name of the named destination |
Implementa Canvas.
circle | ( | $x, | |
$y, | |||
$r, | |||
$color, | |||
$width = null, | |||
$style = null, | |||
$fill = false ) |
Draws a circle at $x,$y with radius $r
See Style::munge_color()
for the format of the color array. See Cpdf::setLineStyle()
for a description of the $style parameter (aka dash)
float | $x | |
float | $y | |
float | $r | |
array | $color | |
float | $width | |
array | $style | |
bool | $fill | Fills the circle if true |
Implementa Canvas.
filled_rectangle | ( | $x1, | |
$y1, | |||
$w, | |||
$h, | |||
$color ) |
Draws a filled rectangle at x1,y1 with width w and height h
See Style::munge_color()
for the format of the color array.
float | $x1 | |
float | $y1 | |
float | $w | |
float | $h | |
array | $color |
Implementa Canvas.
get_font_height | ( | $font, | |
$size ) |
get_height | ( | ) |
Return the image's height in pixels
get_image | ( | ) |
Return the GF image resource
get_page_count | ( | ) |
get_page_number | ( | ) |
get_text_width | ( | $text, | |
$font, | |||
$size, | |||
$spacing = 0 ) |
Calculates text size, in points
string | $text | the text to be sized |
string | $font | the desired font |
float | $size | the desired font size |
float | $spacing | word spacing, if any |
Implementa Canvas.
get_width | ( | ) |
Return the image's width in pixels
image | ( | $img_url, | |
$img_type, | |||
$x, | |||
$y, | |||
$w, | |||
$h ) |
Add an image to the pdf.
The image is placed at the specified x and y coordinates with the given width and height.
string | $img_url | the path to the image |
string | $img_type | the type (e.g. extension) of the image |
float | $x | x position |
float | $y | y position |
int | $w | width (in pixels) |
int | $h | height (in pixels) |
Implementa Canvas.
line | ( | $x1, | |
$y1, | |||
$x2, | |||
$y2, | |||
$color, | |||
$width, | |||
$style = null ) |
Draws a line from x1,y1 to x2,y2
See Style::munge_color()
for the format of the color array. See Cpdf::setLineStyle()
for a description of the format of the $style parameter (aka dash).
float | $x1 | |
float | $y1 | |
float | $x2 | |
float | $y2 | |
array | $color | |
float | $width | |
array | $style |
Implementa Canvas.
new_page | ( | ) |
output | ( | $options = null | ) |
Returns the PNG as a string
array | $options | associative array, 'type' => jpeg|jpg|png, 'quality' => 0 - 100 (jpeg only) |
Implementa Canvas.
polygon | ( | $points, | |
$color, | |||
$width = null, | |||
$style = null, | |||
$fill = false ) |
Draws a polygon
The polygon is formed by joining all the points stored in the $points array. $points has the following structure: array(0 => x1, 1 => y1, 2 => x2, 3 => y2, ... );
See Style::munge_color()
for the format of the color array. See Cpdf::setLineStyle()
for a description of the $style parameter (aka dash)
array | $points | |
array | $color | |
float | $width | |
array | $style | |
bool | $fill | Fills the polygon if true |
Implementa Canvas.
rectangle | ( | $x1, | |
$y1, | |||
$w, | |||
$h, | |||
$color, | |||
$width, | |||
$style = null ) |
Draws a rectangle at x1,y1 with width w and height h
See Style::munge_color()
for the format of the color array. See Cpdf::setLineStyle()
for a description of the $style parameter (aka dash)
float | $x1 | |
float | $y1 | |
float | $w | |
float | $h | |
array | $color | |
float | $width | |
array | $style |
Implementa Canvas.
set_page_count | ( | $count | ) |
stream | ( | $filename, | |
$options = null ) |
Streams the image directly to the browser
string | $filename | the name of the image file (ignored) |
array | $options | associative array, 'type' => jpeg|jpg|png, 'quality' => 0 - 100 (jpeg only) |
Implementa Canvas.
text | ( | $x, | |
$y, | |||
$text, | |||
$font, | |||
$size, | |||
$color = array(0,0,0), | |||
$adjust = 0 ) |
Writes text at the specified x and y coordinates
See Style::munge_color()
for the format of the color array.
float | $x | |
float | $y | |
string | $text | the text to write |
string | $font | the font file to use |
float | $size | the font size, in points |
array | $color | |
float | $adjust | word spacing adjustment |
Implementa Canvas.