|
MIOLO26
|
Membros públicos | |
| __construct ($paper="letter", $orientation="portrait") | |
| get_pdflib () | |
| open_object () | |
| reopen_object ($object) | |
| close_object () | |
| add_object ($object, $where='all') | |
| stop_object ($object) | |
| 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=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, $angle=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) | |
Membros públicos herdados de Canvas | |
| text ($x, $y, $text, $font, $size, $color=array(0, 0, 0), $adjust=0) | |
Campos de Dados | |
| const | FONT_HEIGHT_SCALE = 1.2 |
Atributos Públicos Estáticos | |
| static | $PAPER_SIZES = array() |
| static | $IN_MEMORY = true |
Membros protegidos | |
| _close () | |
| _place_objects () | |
| _set_line_style ($width, $cap, $join, $dash) | |
| _set_stroke_color ($color) | |
| _set_fill_color ($color) | |
| _load_font ($font, $encoding=null, $options="") | |
| y ($y) | |
| _add_page_text () | |
| __construct | ( | $paper = "letter", | |
| $orientation = "portrait" ) |
Class constructor
| mixed | $paper | The size of paper to use either a string (see CPDF_Adapter::$PAPER_SIZES) or an array(xmin,ymin,xmax,ymax) |
| string | $orientation | The orientation of the document (either 'landscape' or 'portrait') |
|
protected |
Add text to each page after rendering is complete
|
protected |
Close the pdf
|
protected |
Loads a specific font and stores the corresponding descriptor.
| string | $font |
|
protected |
Add all active objects to the current page
|
protected |
Sets the fill color
| array | $color | array(r,g,b) |
|
protected |
Sets the line style
| float | width |
| string | corner |
| string | join |
| array | dash |
|
protected |
Sets the line color
| array | $color | array(r,g,b) |
| 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.
| add_object | ( | $object, | |
| $where = 'all' ) |
Adds the specified object to the document
$where can be one of:
| int | $object | the object handle returned by open_object() |
| string | $where |
| circle | ( | $x, | |
| $y, | |||
| $r, | |||
| $color, | |||
| $width = null, | |||
| $style = null, | |||
| $fill = false ) |
Draws a circle at $x,$y with radius $r
See Style::munge_colour() for the format of the colour 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.
| close_object | ( | ) |
Close the current template
| filled_rectangle | ( | $x1, | |
| $y1, | |||
| $w, | |||
| $h, | |||
| $color ) |
Draws a filled rectangle at x1,y1 with width w and height h
See Style::munge_colour() for the format of the colour array.
| float | $x1 | |
| float | $y1 | |
| float | $w | |
| float | $h | |
| array | $color |
Implementa Canvas.
| get_font_height | ( | $font, | |
| $size ) |
| get_height | ( | ) |
| get_page_count | ( | ) |
| get_page_number | ( | ) |
| get_pdflib | ( | ) |
Returns the PDFLib instance
| 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 | ( | ) |
| 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_colour() for the format of the colour 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 | ( | ) |
| open_object | ( | ) |
Opens a new 'object' (template in PDFLib-speak)
While an object is open, all drawing actions are recorded to the object instead of 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.
| output | ( | $options = null | ) |
Returns the PDF as a string
| array | $options | associative array: 'compress' => 1 or 0 |
Implementa Canvas.
| page_text | ( | $x, | |
| $y, | |||
| $text, | |||
| $font, | |||
| $size, | |||
| $color = array(0,0,0), | |||
| $adjust = 0, | |||
| $angle = 0, | |||
| $blend = "Normal", | |||
| $opacity = 1.0 ) |
| 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_colour() for the format of the colour 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_colour() for the format of the colour 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.
| reopen_object | ( | $object | ) |
Reopen an existing object (NOT IMPLEMENTED)
PDFLib does not seem to support reopening templates.
| int | $object | the ID of a previously opened object |
| set_page_count | ( | $count | ) |
| set_page_number | ( | $num | ) |
| stop_object | ( | $object | ) |
Stops the specified template from appearing in the document.
The object will stop being displayed on the page following the current one.
| int | $object |
| stream | ( | $filename, | |
| $options = null ) |
Streams the PDF directly to the browser
| string | $filename | the name of the PDF file |
| array | $options | associative array, 'Attachment' => 0 or 1, 'compress' => 1 or 0 |
Implementa Canvas.
| text | ( | $x, | |
| $y, | |||
| $text, | |||
| $font, | |||
| $size, | |||
| $color = array(0,0,0), | |||
| $adjust = 0, | |||
| $angle = 0 ) |
|
protected |
Remaps y coords from 4th to 1st quadrant
| float | $y |
|
static |
|
static |
| const FONT_HEIGHT_SCALE = 1.2 |