Class constructor
PDFLib_Adapter
__construct
([string $paper = "letter"], [string $orientation = "portrait"])
-
string
$paper: The size of paper to use (PDFLib_Adapter::$PAPER_SIZES)
-
string
$orientation: The orientation of the document (either 'landscape' or 'portrait')
Adds the specified object to the document
$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
void
add_object
(int $object, [string $where = 'all'])
-
int
$object: the object handle returned by open_object()
-
string
$where
void
circle
(mixed $x, mixed $y, mixed $r, mixed $color, [mixed $width = null], [mixed $style = null], [mixed $fill = false])
Close the current template
void
close_object
()
void
filled_rectangle
(mixed $x1, mixed $y1, mixed $w, mixed $h, mixed $color)
void
get_font_height
(mixed $font, mixed $size)
Returns the PDFLib instance
PDFLib
get_pdflib
()
void
get_text_width
(mixed $text, mixed $font, mixed $size, mixed $spacing)
void
image
(mixed $img_url, mixed $img_type, mixed $x, mixed $y, mixed $w, mixed $h)
void
line
(mixed $x1, mixed $y1, mixed $x2, mixed $y2, mixed $color, mixed $width, [mixed $style = null])
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.
int
open_object
()
void
page_text
(mixed $x, mixed $y, mixed $text, mixed $font, mixed $size, [mixed $color = array(0,0,0)], mixed $adjust, mixed $angle, [mixed $blend = "Normal"], [mixed $opacity = 1.0])
void
polygon
(mixed $points, mixed $color, [mixed $width = null], [mixed $style = null], [mixed $fill = false])
void
rectangle
(mixed $x1, mixed $y1, mixed $w, mixed $h, mixed $color, mixed $width, [mixed $style = null])
Reopen an existing object (NOT IMPLEMENTED)
PDFLib does not seem to support reopening templates.
void
reopen_object
(int $object)
-
int
$object: the ID of a previously opened object
void
set_page_count
(mixed $count)
void
set_page_number
(mixed $num)
Stops the specified template from appearing in the document.
The object will stop being displayed on the page following the current one.
void
stop_object
(int $object)
void
stream
(mixed $filename, [mixed $options = null])
void
text
(mixed $x, mixed $y, mixed $text, mixed $font, mixed $size, [mixed $color = array(0,0,0)], mixed $adjust, mixed $angle)
Close the pdf
void
_close
()
Loads a specific font and stores the corresponding descriptor.
int
_load_font
(string $font, [mixed $encoding = "auto"], [mixed $options = ""])
Add all active objects to the current page
void
_place_objects
()
Sets the fill color
void
_set_fill_color
(array $color)
-
array
$color: array(r,g,b)
Sets the line style
void
_set_line_style
(float $width, string $cap, string $join, array $dash)
-
float
$width: width
-
string
$cap: corner
-
string
$join: join
-
array
$dash: dash
Sets the line color
void
_set_stroke_color
(array $color)
-
array
$color: array(r,g,b)