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

Membros públicos

 __construct ($paper="letter", $orientation="portrait")
 
 __destruct ()
 
 get_cpdf ()
 
 open_object ()
 
 reopen_object ($object)
 
 close_object ()
 
 add_object ($object, $where='all')
 
 stop_object ($object)
 
 serialize_object ($id)
 
 reopen_serialized_object ($obj)
 
 get_width ()
 
 get_height ()
 
 get_page_number ()
 
 get_page_count ()
 
 set_page_number ($num)
 
 set_page_count ($count)
 
 line ($x1, $y1, $x2, $y2, $color, $width, $style=array(), $blend="Normal", $opacity=1.0)
 
 rectangle ($x1, $y1, $w, $h, $color, $width, $style=array(), $blend="Normal", $opacity=1.0)
 
 filled_rectangle ($x1, $y1, $w, $h, $color, $blend="Normal", $opacity=1.0)
 
 polygon ($points, $color, $width=null, $style=array(), $fill=false, $blend="Normal", $opacity=1.0)
 
 circle ($x, $y, $r1, $color, $width=null, $style=null, $fill=false, $blend="Normal", $opacity=1.0)
 
 image ($img_url, $img_type, $x, $y, $w, $h)
 
 text ($x, $y, $text, $font, $size, $color=array(0, 0, 0), $adjust=0, $angle=0, $blend="Normal", $opacity=1.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)
 
 page_text ($x, $y, $text, $font, $size, $color=array(0, 0, 0), $adjust=0, $angle=0, $blend="Normal", $opacity=1.0)
 
 new_page ()
 
 stream ($filename, $options=null)
 
 output ($options=null)
 
 get_messages ()
 
- Membros públicos herdados de Canvas
 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)
 
 text ($x, $y, $text, $font, $size, $color=array(0, 0, 0), $adjust=0)
 

Atributos Públicos Estáticos

static $PAPER_SIZES
 

Membros protegidos

 _set_stroke_color ($color)
 
 _set_fill_color ($color)
 
 _set_line_transparency ($mode, $opacity)
 
 _set_fill_transparency ($mode, $opacity)
 
 _set_line_style ($width, $cap, $join, $dash)
 
 y ($y)
 
 _convert_gif_to_png ($image_url)
 
 _add_page_text ()
 

Documentação dos Construtores & Destrutor

◆ __construct()

__construct ( $paper = "letter",
$orientation = "portrait" )

Class constructor

Parâmetros
mixed$paperThe size of paper to use in this PDF (CPDF_Adapter::$PAPER_SIZES)
string$orientationThe orienation of the document (either 'landscape' or 'portrait')

◆ __destruct()

__destruct ( )

Class destructor

Deletes all temporary image files

Documentação das funções

◆ _add_page_text()

_add_page_text ( )
protected

Add text to each page after rendering is complete

◆ _convert_gif_to_png()

_convert_gif_to_png ( $image_url)
protected

Convert a GIF image to a PNG image

Retorna
string The url of the newly converted image

◆ _set_fill_color()

_set_fill_color ( $color)
protected

Sets the fill colour

See Style::set_colour() for the format of the colour array.

Parâmetros
array$color

◆ _set_fill_transparency()

_set_fill_transparency ( $mode,
$opacity )
protected

Sets fill transparency

Veja também
Cpdf::setFillTransparency()

Valid blend modes are (case-sensitive):

Normal, Multiply, Screen, Overlay, Darken, Lighten, ColorDogde, ColorBurn, HardLight, SoftLight, Difference, Exclusion

Parâmetros
string$modethe blending mode to use
float$opacity0.0 fully transparent, 1.0 fully opaque

◆ _set_line_style()

_set_line_style ( $width,
$cap,
$join,
$dash )
protected

Sets the line style

Veja também
Cpdf::setLineStyle()
Parâmetros
floatwidth
stringcap
stringjoin
arraydash

◆ _set_line_transparency()

_set_line_transparency ( $mode,
$opacity )
protected

Sets line transparency

Veja também
Cpdf::setLineTransparency()

Valid blend modes are (case-sensitive):

Normal, Multiply, Screen, Overlay, Darken, Lighten, ColorDodge, ColorBurn, HardLight, SoftLight, Difference, Exclusion

Parâmetros
string$modethe blending mode to use
float$opacity0.0 fully transparent, 1.0 fully opaque

◆ _set_stroke_color()

_set_stroke_color ( $color)
protected

Sets the stroke colour

See Style::set_colour() for the format of the color array.

Parâmetros
array$color

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

◆ add_object()

add_object ( $object,
$where = 'all' )

Adds a specified 'object' to the document

$object int specifying an object created with CPDF_Adapter::open_object(). $where can be one of:

  • 'add' add to current page only
  • 'all' add to every page from the current one onwards
  • 'odd' add to all odd numbered pages from now on
  • 'even' add to all even numbered pages from now on
  • 'next' add the object to the next page only
  • 'nextodd' add to all odd numbered pages from the next one
  • 'nexteven' add to all even numbered pages from the next one
Veja também
Cpdf::addObject()
Parâmetros
int$object
string$where

Reimplementado em Cached_PDF_Decorator.

◆ circle()

circle ( $x,
$y,
$r1,
$color,
$width = null,
$style = null,
$fill = false,
$blend = "Normal",
$opacity = 1.0 )

◆ close_object()

close_object ( )

Closes the current 'object'

Veja também
CPDF_Adapter::open_object()

Reimplementado em Cached_PDF_Decorator.

◆ filled_rectangle()

filled_rectangle ( $x1,
$y1,
$w,
$h,
$color,
$blend = "Normal",
$opacity = 1.0 )

◆ get_cpdf()

get_cpdf ( )

Returns the Cpdf instance

Retorna
Cpdf

Reimplementado em Cached_PDF_Decorator.

◆ 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 ( )

Returns the PDF's height in points

Retorna
float

Reimplementado em Cached_PDF_Decorator.

◆ get_messages()

get_messages ( )

Returns logging messages generated by the Cpdf class

Retorna
string

Reimplementado em Cached_PDF_Decorator.

◆ get_page_count()

get_page_count ( )

Returns the total number of pages in the document

Retorna
int

Implementa Canvas.

Reimplementado em Cached_PDF_Decorator.

◆ get_page_number()

get_page_number ( )

Returns the current page number

Retorna
int

Implementa Canvas.

Reimplementado em Cached_PDF_Decorator.

◆ 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 ( )

Returns the PDF's width in points

Retorna
float

Reimplementado em Cached_PDF_Decorator.

◆ 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 = array(),
$blend = "Normal",
$opacity = 1.0 )

◆ new_page()

new_page ( )

Starts a new page

Subsequent drawing operations will appear on the new page.

Implementa Canvas.

Reimplementado em Cached_PDF_Decorator.

◆ open_object()

open_object ( )

Opens a new 'object'

While an object is open, all drawing actions are recored in the object, as opposed to being drawn on the current page. Objects can be added later to a specific page or to several pages.

The return value is an integer ID for the new object.

Veja também
CPDF_Adapter::close_object()
CPDF_Adapter::add_object()
Retorna
int

Reimplementado em Cached_PDF_Decorator.

◆ output()

output ( $options = null)

Returns the PDF as a string

Retorna
string

Implementa Canvas.

◆ page_text()

page_text ( $x,
$y,
$text,
$font,
$size,
$color = array(0,0,0),
$adjust = 0,
$angle = 0,
$blend = "Normal",
$opacity = 1.0 )

Writes text at the specified x and y coordinates on every page

The strings '{PAGE_NUM}' and '{PAGE_COUNT}' are automatically replaced with their current values.

See Style::munge_colour() for the format of the colour 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
float$angleangle to write the text at, measured CW starting from the x-axis

◆ polygon()

polygon ( $points,
$color,
$width = null,
$style = array(),
$fill = false,
$blend = "Normal",
$opacity = 1.0 )

◆ rectangle()

rectangle ( $x1,
$y1,
$w,
$h,
$color,
$width,
$style = array(),
$blend = "Normal",
$opacity = 1.0 )

◆ reopen_object()

reopen_object ( $object)

Reopens an existing 'object'

Veja também
CPDF_Adapter::open_object()
Parâmetros
int$objectthe ID of a previously opened object

◆ reopen_serialized_object()

reopen_serialized_object ( $obj)

@access private

Reimplementado em Cached_PDF_Decorator.

◆ serialize_object()

serialize_object ( $id)

@access private

Reimplementado em Cached_PDF_Decorator.

◆ set_page_count()

set_page_count ( $count)

Sets the page count

Parâmetros
int$count

Implementa Canvas.

Reimplementado em Cached_PDF_Decorator.

◆ set_page_number()

set_page_number ( $num)

Sets the current page number

Parâmetros
int$num

Reimplementado em Cached_PDF_Decorator.

◆ stop_object()

stop_object ( $object)

Stops the specified 'object' from appearing in the document.

The object will stop being displayed on the page following the current one.

Parâmetros
int$object

◆ stream()

stream ( $filename,
$options = null )

Streams the PDF directly to the browser

Parâmetros
string$filenamethe name of the PDF file
array$optionsassociative array, 'Attachment' => 0 or 1, 'compress' => 1 or 0

Implementa Canvas.

◆ text()

text ( $x,
$y,
$text,
$font,
$size,
$color = array(0,0,0),
$adjust = 0,
$angle = 0,
$blend = "Normal",
$opacity = 1.0 )

◆ y()

y ( $y)
protected

Remaps y coords from 4th to 1st quadrant

Parâmetros
float$y
Retorna
float

Documentação dos campos e atributos

◆ $PAPER_SIZES

$PAPER_SIZES
static

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