MIOLO25
Carregando...
Procurando...
Nenhuma entrada encontrada
Referência à classe GD_Adapter
Diagrama de heranças da classe GD_Adapter
Canvas

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)
 

Documentação dos Construtores & Destrutor

◆ __construct()

__construct ( $size,
$orientation = "portrait",
$aa_factor = 1,
$bg_color = array(1,1,1,0) )

Class constructor

Parâmetros
mixed$sizeThe size of image to create: array(x1,y1,x2,y2) or "letter", "legal", etc.
string$orientationThe orientation of the document (either 'landscape' or 'portrait')
float$aa_factorAnti-aliasing factor, 1 for no AA
array$bg_colorImage background color: array(r,g,b,a), 0 <= r,g,b,a <= 1

Documentação das funções

◆ add_link()

add_link ( $url,
$x,
$y,
$width,
$height )

Add a link to the pdf

Parâmetros
string$urlThe url to link to
float$xThe x position of the link
float$yThe y position of the link
float$widthThe width of the link
float$heightThe height of the link

Implementa Canvas.

◆ add_named_dest()

add_named_dest ( $anchorname)

Add a named destination (similar to ... in html)

Parâmetros
string$anchornameThe name of the named destination

Implementa Canvas.

◆ circle()

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)

Parâmetros
float$x
float$y
float$r
array$color
float$width
array$style
bool$fillFills the circle if true

Implementa Canvas.

◆ filled_rectangle()

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.

Parâmetros
float$x1
float$y1
float$w
float$h
array$color

Implementa Canvas.

◆ get_font_height()

get_font_height ( $font,
$size )

Calculates font height, in points

Parâmetros
string$font
float$size
Retorna
float

Implementa Canvas.

◆ get_height()

get_height ( )

Return the image's height in pixels

Retorna
float

◆ get_image()

get_image ( )

Return the GF image resource

Retorna
resource

◆ get_page_count()

get_page_count ( )

Returns the total number of pages

Retorna
int

Implementa Canvas.

◆ get_page_number()

get_page_number ( )

Returns the current page number

Retorna
int

Implementa Canvas.

◆ get_text_width()

get_text_width ( $text,
$font,
$size,
$spacing = 0 )

Calculates text size, in points

Parâmetros
string$textthe text to be sized
string$fontthe desired font
float$sizethe desired font size
float$spacingword spacing, if any
Retorna
float

Implementa Canvas.

◆ get_width()

get_width ( )

Return the image's width in pixels

Retorna
float

◆ image()

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.

Parâmetros
string$img_urlthe path to the image
string$img_typethe type (e.g. extension) of the image
float$xx position
float$yy position
int$wwidth (in pixels)
int$hheight (in pixels)

Implementa Canvas.

◆ line()

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).

Parâmetros
float$x1
float$y1
float$x2
float$y2
array$color
float$width
array$style

Implementa Canvas.

◆ new_page()

new_page ( )

Starts a new page

Subsequent drawing operations will appear on the new page.

Implementa Canvas.

◆ output()

output ( $options = null)

Returns the PNG as a string

Parâmetros
array$optionsassociative array, 'type' => jpeg|jpg|png, 'quality' => 0 - 100 (jpeg only)
Retorna
string

Implementa Canvas.

◆ polygon()

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)

Parâmetros
array$points
array$color
float$width
array$style
bool$fillFills the polygon if true

Implementa Canvas.

◆ rectangle()

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)

Parâmetros
float$x1
float$y1
float$w
float$h
array$color
float$width
array$style

Implementa Canvas.

◆ set_page_count()

set_page_count ( $count)

Sets the total number of pages

Parâmetros
int$count

Implementa Canvas.

◆ stream()

stream ( $filename,
$options = null )

Streams the image directly to the browser

Parâmetros
string$filenamethe name of the image file (ignored)
array$optionsassociative array, 'type' => jpeg|jpg|png, 'quality' => 0 - 100 (jpeg only)

Implementa Canvas.

◆ text()

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.

Parâmetros
float$x
float$y
string$textthe text to write
string$fontthe font file to use
float$sizethe font size, in points
array$color
float$adjustword spacing adjustment

Implementa Canvas.


A documentação para esta classe foi gerada a partir do seguinte ficheiro: