class PDFlib (View source)

Methods

bool
activate_item(int $id)

Activates a previously created structure element or other content item.

bool
add_launchlink(float $llx, float $lly, float $urx, float $ury, string $filename)

Adds a link to a web resource.

bool
add_locallink(float $lowerleftx, float $lowerlefty, float $upperrightx, float $upperrighty, int $page, string $dest)

Add a link annotation to a target within the current PDF file.

bool
add_nameddest(string $name, string $optlist)

Creates a named destination on an arbitrary page in the current document.

bool
add_note(float $llx, float $lly, float $urx, float $ury, string $contents, string $title, string $icon, int $open)

Sets an annotation for the current page.

bool
add_pdflink(float $bottom_left_x, float $bottom_left_y, float $up_right_x, float $up_right_y, string $filename, int $page, string $dest)

Add a file link annotation to a PDF target.

int
add_table_cell(int $table, int $column, int $row, string $text, string $optlist)

Adds a cell to a new or existing table.

int
add_textflow(int $textflow, string $text, string $optlist)

Creates a Textflow object, or adds text and explicit options to an existing Textflow.

bool
add_thumbnail(int $image)

Adds an existing image as thumbnail for the current page.

bool
add_weblink(float $lowerleftx, float $lowerlefty, float $upperrightx, float $upperrighty, string $url)

Adds a weblink annotation to a target url on the Web.

bool
arc(float $x, float $y, float $r, float $alpha, float $beta)

Adds a counterclockwise circular arc

bool
arcn(float $x, float $y, float $r, float $alpha, float $beta)

Except for the drawing direction, this function behaves exactly like PDF_arc().

bool
attach_file(float $llx, float $lly, float $urx, float $ury, string $filename, string $description, string $author, string $mimetype, string $icon)

Adds a file attachment annotation.

int
begin_document(string $filename, string $optlist)

Creates a new PDF file subject to various options.

bool
begin_font(string $filename, float $a, float $b, float $c, float $d, float $e, float $f, string $optlist)

Starts a Type 3 font definition.

bool
begin_glyph(string $glyphname, float $wx, float $llx, float $lly, float $urx, float $ury)

Starts a glyph definition for a Type 3 font.

int
begin_item(string $tag, string $optlist)

Opens a structure element or other content item with attributes supplied as options.

bool
begin_layer(int $layer)

Starts a layer for subsequent output on the page.

bool
begin_page_ext(float $width, float $height, string $optlist)

Adds a new page to the document, and specifies various options. The parameters width and height are the dimensions of the new page in points.

bool
begin_page(float $width, float $height)

Adds a new page to the document.

int
begin_pattern(float $width, float $height, float $xstep, float $ystep, int $painttype)

Starts a new pattern definition.

int
begin_template_ext(float $width, float $height, string $optlist)

Starts a new template definition.

int
begin_template(float $width, float $height)

Start template definition [deprecated]

bool
circle(float $x, float $y, float $r)

Draw a circle

bool
clip()

Clip to current path

bool
close_image(int $image)

Close image

bool
close_pdi_page(int $page)

Closes the page handle, and frees all page-related resources

bool
close_pdi(int $doc)

Close the input PDF document [deprecated]

bool
close_pdi_document(int $doc)

No description

bool
close()

Close pdf resource [deprecated]

bool
closepath_fill_stroke()

Close, fill and stroke current path

bool
closepath_stroke()

Close and stroke path

bool
closepath()

Close current path

bool
concat(float $a, float $b, float $c, float $d, float $e, float $f)

Concatenate a matrix to the CTM

bool
continue_text(string $text)

Output text in next line

int
create_3dview(string $username, string $optlist)

Create 3D view

int
create_action(string $type, string $optlist)

Create action for objects or events

bool
create_annotation(float $llx, float $lly, float $urx, float $ury, string $type, string $optlist)

Create rectangular annotation

int
create_bookmark(string $text, string $optlist)

Create bookmark

bool
create_field(float $llx, float $lly, float $urx, float $ury, string $name, string $type, string $optlist)

Create form field

bool
create_fieldgroup(string $name, string $optlist)

Create form field group

int
create_gstate(string $optlist)

Create graphics state object

bool
create_pvf(string $filename, string $data, string $optlist)

Create PDFlib virtual file

int
create_textflow(string $text, string $optlist)

Create textflow object

bool
curveto(float $x1, float $y1, float $x2, float $y2, float $x3, float $y3)

Draw Bezier curve

int
define_layer(string $name, string $optlist)

Create layer definition

int
delete_pvf(string $filename)

Delete PDFlib virtual file

bool
delete_table(int $table, string $optlist)

Delete table object

bool
delete_textflow(int $textflow)

Delete textflow object

bool
delete()

Delete PDFlib object

bool
encoding_set_char(string $encoding, int $slot, string $glyphname, int $uv)

Add glyph name and/or Unicode value

bool
end_document(string $optlist)

Close PDF file

bool
end_font()

Terminate Type 3 font definition

bool
end_glyph()

Terminate glyph definition for Type 3 font

bool
end_item(int $id)

Close structure element or other content item

bool
end_layer()

Deactivate all active layers

bool
end_page_ext(string $optlist)

Finish page

bool
end_page()

Finish page

bool
end_pattern()

Finish pattern

bool
end_template()

Finish template

bool
endpath()

End current path

int
fill_imageblock(int $page, string $blockname, int $image, string $optlist)

Fill image block with variable data

int
fill_pdfblock(int $page, string $blockname, int $contents, string $optlist)

Fill PDF block with variable data

bool
fill_stroke()

Fill and stroke path

int
fill_textblock(int $page, string $blockname, string $text, string $optlist)

Fill text block with variable data

bool
fill()

Fill current path

int
findfont(string $fontname, string $encoding, int $embed)

Prepare font for later use [deprecated]

bool
fit_image(int $image, float $x, float $y, string $optlist)

Place image or template

bool
fit_pdi_page(int $page, float $x, float $y, string $optlist)

Place imported PDF page

string
fit_table(int $table, float $llx, float $lly, float $urx, float $ury, string $optlist)

No description

string
fit_textflow(int $textflow, float $llx, float $lly, float $urx, float $ury, string $optlist)

Format textflow in rectangular area

bool
fit_textline(string $text, float $x, float $y, string $optlist)

Place single line of text

string
get_apiname()

Get name of unsuccessfull API function

string
get_buffer()

Get PDF output buffer

string
get_errmsg()

Get error text

int
get_errnum()

Get error number

int
get_majorversion()

Get major version number [deprecated]

int
get_minorversion()

Get minor version number [deprecated]

float
get_option(string $keyword, string $optlist)

No description

string
get_parameter(string $key, float $modifier)

Get string parameter

string
get_pdi_parameter(string $key, int $doc, int $page, int $reserved)

Get PDI string parameter [deprecated]

float
get_pdi_value(string $key, int $doc, int $page, int $reserved)

Get PDI numerical parameter [deprecated]

float
get_string(string $keyword, string $optlist)

No description

float
get_value(string $key, float $modifier)

Get numerical parameter

float
info_font(int $font, string $keyword, string $optlist)

Query detailed information about a loaded font

float
info_image(int $image, string $keyword, string $optlist)

No description

float
info_matchbox(string $boxname, int $num, string $keyword)

Query matchbox information

float
info_graphics(int $graphics, string $keyword, string $optlist)

No description

float
info_path(int $path, string $keyword, string $optlist)

No description

float
info_pdi_page($page, string $keyword, string $optlist)

No description

float
info_pvf(string $filename, string $keyword)

No description

float
info_table(int $table, string $keyword)

Retrieve table information

float
info_textflow(int $textflow, string $keyword)

Query textflow state

float
info_textline(string $text, string $keyword, string $optlist)

Perform textline formatting and query metrics

bool
initgraphics()

Reset graphic state

bool
lineto(float $x, float $y)

Draw a line

int
load_3ddata(string $filename, string $optlist)

Load 3D model

int
load_font(string $fontname, string $encoding, string $optlist)

Search and prepare font

int
load_iccprofile(string $profilename, string $optlist)

Search and prepare ICC profile

int
load_image(string $imagetype, string $filename, string $optlist)

Open image file

int
makespotcolor(string $spotname)

Make spot color

bool
moveto(float $x, float $y)

Set current point

int
open_ccitt(string $filename, int $width, int $height, int $BitReverse, int $k, int $Blackls1)

Open raw CCITT image [deprecated]

bool
open_file(string $filename)

Create PDF file [deprecated]

int
open_image_file(string $imagetype, string $filename, string $stringparam, int $intparam)

Read image from file [deprecated]

int
open_image(string $imagetype, string $source, string $data, int $length, int $width, int $height, int $components, int $bpc, string $params)

Use image data [deprecated]

int
open_memory_image(resource $image)

Open image created with PHP's image functions [not supported]

int
open_pdi_document(string $filename, string $optlist)

Prepare a pdi document

int
open_pdi_page(int $doc, int $pagenumber, string $optlist)

Prepare a page

int
open_pdi(string $filename, string $optlist, int $len)

Open PDF file [deprecated]

float
pcos_get_number(int $doc, string $path)

Get value of pCOS path with type number or boolean

string
pcos_get_stream(int $doc, string $optlist, string $path)

Get contents of pCOS path with type stream, fstream, or string

string
pcos_get_string(int $doc, string $path)

Get value of pCOS path with type name, string, or boolean

bool
place_image(int $image, float $x, float $y, float $scale)

Place image on the page [deprecated]

bool
place_pdi_page(int $page, float $x, float $y, float $sx, float $sy)

Place PDF page [deprecated]

bool
set_option(string $optlist)

No description

int
process_pdi(int $doc, int $page, string $optlist)

Process imported PDF document

bool
rect(float $x, float $y, float $width, float $height)

Draw rectangle

bool
restore()

Restore graphics state

bool
resume_page(string $optlist)

Resume page

bool
rotate(float $phi)

Rotate coordinate system

bool
save()

Save graphics state

bool
scale(float $sx, float $sy)

Scale coordinate system

bool
set_border_color(float $red, float $green, float $blue)

Set border color of annotations [deprecated]

bool
set_border_dash(float $black, float $white)

Set border dash style of annotations [deprecated]

bool
set_border_style(string $style, float $width)

Set border style of annotations [deprecated]

bool
set_gstate(int $gstate)

Activate graphics state object

bool
set_info(string $key, string $value)

Fill document info field

bool
set_layer_dependency(string $type, string $optlist)

Define relationships among layers

bool
set_parameter(string $key, string $value)

Set string parameter

bool
set_text_pos(float $x, float $y)

Set text position

bool
set_value(string $key, float $value)

Set numerical parameter

bool
setcolor(string $fstype, string $colorspace, float $c1, float $c2, float $c3, float $c4)

Set fill and stroke color

bool
setdash(float $b, float $w)

Set simple dash pattern

bool
setdashpattern(string $optlist)

Set dash pattern

bool
setflat(float $flatness)

Set flatness

bool
setfont(int $font, float $fontsize)

Set font

bool
setgray_fill(float $g)

Set fill color to gray [deprecated]

bool
setgray_stroke(float $g)

Set stroke color to gray [deprecated]

bool
setgray(float $g)

Set color to gray [deprecated]

bool
setlinecap(int $linecap)

Set linecap parameter

bool
setlinejoin(int $value)

Set linejoin parameter

bool
setlinewidth(float $width)

Set line width

bool
setmatrix(float $a, float $b, float $c, float $d, float $e, float $f)

Set current transformation matrix

bool
setmiterlimit(float $miter)

Set miter limit

bool
setrgbcolor_fill(float $red, float $green, float $blue)

Set fill rgb color values [deprecated]

bool
setrgbcolor_stroke(float $red, float $green, float $blue)

Set stroke rgb color values [deprecated]

bool
setrgbcolor(float $red, float $green, float $blue)

Set fill and stroke rgb color values [deprecated]

int
shading_pattern(int $shading, string $optlist)

Define shading pattern

int
shading(string $shtype, float $x0, float $y0, float $x1, float $y1, float $c1, float $c2, float $c3, float $c4, string $optlist)

Define blend

bool
shfill(int $shading)

Fill area with shading

int
show_boxed(string $text, float $left, float $top, float $width, float $height, string $mode, string $feature)

Output text in a box [deprecated]

bool
show_xy(string $text, float $x, float $y)

Output text at given position

bool
show(string $text)

Output text at current position

bool
skew(float $alpha, float $beta)

Skew the coordinate system

float
stringwidth(string $text, int $font, float $fontsize)

Return width of text

bool
stroke()

Stroke path

bool
suspend_page(string $optlist)

Suspend page

bool
translate(float $tx, float $ty)

Set origin of coordinate system

string
utf16_to_utf8(string $utf16string)

Convert string from UTF-16 to UTF-8

string
utf32_to_utf16(string $utf32string, string $ordering)

Convert string from UTF-32 to UTF-16

string
utf8_to_utf16(string $utf8string, string $ordering)

Convert string from UTF-8 to UTF-16

Details

bool activate_item(int $id)

Activates a previously created structure element or other content item.

Parameters

int $id

Return Value

bool

Adds a link to a web resource.

Parameters

float $llx
float $lly
float $urx
float $ury
string $filename

Return Value

bool

See also

PDF_create_action()

Add a link annotation to a target within the current PDF file.

Parameters

float $lowerleftx
float $lowerlefty
float $upperrightx
float $upperrighty
int $page
string $dest

Return Value

bool

See also

PDF_create_action()

bool add_nameddest(string $name, string $optlist)

Creates a named destination on an arbitrary page in the current document.

Parameters

string $name
string $optlist

Return Value

bool

bool add_note(float $llx, float $lly, float $urx, float $ury, string $contents, string $title, string $icon, int $open)

Sets an annotation for the current page.

Parameters

float $llx
float $lly
float $urx
float $ury
string $contents
string $title
string $icon
int $open

Return Value

bool

See also

PDF_create_annotation()

Add a file link annotation to a PDF target.

Parameters

float $bottom_left_x
float $bottom_left_y
float $up_right_x
float $up_right_y
string $filename
int $page
string $dest

Return Value

bool

See also

PDF_create_action

int add_table_cell(int $table, int $column, int $row, string $text, string $optlist)

Adds a cell to a new or existing table.

Parameters

int $table
int $column
int $row
string $text
string $optlist

Return Value

int

int add_textflow(int $textflow, string $text, string $optlist)

Creates a Textflow object, or adds text and explicit options to an existing Textflow.

Parameters

int $textflow
string $text
string $optlist

Return Value

int

bool add_thumbnail(int $image)

Adds an existing image as thumbnail for the current page.

Parameters

int $image

Return Value

bool

Adds a weblink annotation to a target url on the Web.

Parameters

float $lowerleftx
float $lowerlefty
float $upperrightx
float $upperrighty
string $url

Return Value

bool

See also

PDF_create_action()

bool arc(float $x, float $y, float $r, float $alpha, float $beta)

Adds a counterclockwise circular arc

Parameters

float $x
float $y
float $r
float $alpha
float $beta

Return Value

bool

bool arcn(float $x, float $y, float $r, float $alpha, float $beta)

Except for the drawing direction, this function behaves exactly like PDF_arc().

Parameters

float $x
float $y
float $r
float $alpha
float $beta

Return Value

bool

bool attach_file(float $llx, float $lly, float $urx, float $ury, string $filename, string $description, string $author, string $mimetype, string $icon)

Adds a file attachment annotation.

Parameters

float $llx
float $lly
float $urx
float $ury
string $filename
string $description
string $author
string $mimetype
string $icon

Return Value

bool

See also

PDF_create_annotation()

int begin_document(string $filename, string $optlist)

Creates a new PDF file subject to various options.

Parameters

string $filename
string $optlist

Return Value

int

bool begin_font(string $filename, float $a, float $b, float $c, float $d, float $e, float $f, string $optlist)

Starts a Type 3 font definition.

Parameters

string $filename
float $a
float $b
float $c
float $d
float $e
float $f
string $optlist

Return Value

bool

bool begin_glyph(string $glyphname, float $wx, float $llx, float $lly, float $urx, float $ury)

Starts a glyph definition for a Type 3 font.

Parameters

string $glyphname
float $wx
float $llx
float $lly
float $urx
float $ury

Return Value

bool

int begin_item(string $tag, string $optlist)

Opens a structure element or other content item with attributes supplied as options.

Parameters

string $tag
string $optlist

Return Value

int

bool begin_layer(int $layer)

Starts a layer for subsequent output on the page.

Parameters

int $layer

Return Value

bool

bool begin_page_ext(float $width, float $height, string $optlist)

Adds a new page to the document, and specifies various options. The parameters width and height are the dimensions of the new page in points.

Parameters

float $width
float $height
string $optlist

Return Value

bool

bool begin_page(float $width, float $height)

Adds a new page to the document.

Parameters

float $width
float $height

Return Value

bool

See also

PDF_begin_page_ext()

int begin_pattern(float $width, float $height, float $xstep, float $ystep, int $painttype)

Starts a new pattern definition.

Parameters

float $width
float $height
float $xstep
float $ystep
int $painttype

Return Value

int

int begin_template_ext(float $width, float $height, string $optlist)

Starts a new template definition.

Parameters

float $width
float $height
string $optlist

Return Value

int

int begin_template(float $width, float $height)

Start template definition [deprecated]

Starts a new template definition. This function is deprecated since PDFlib version 7, use PDF_begin_template_ext() instead.

Parameters

float $width
float $height

Return Value

int

See also

PDF_begin_template_ext

bool circle(float $x, float $y, float $r)

Draw a circle

Adds a circle. Returns TRUE on success or FALSE on failure.

Parameters

float $x
float $y
float $r

Return Value

bool

bool clip()

Clip to current path

Uses the current path as clipping path, and terminate the path. Returns TRUE on success or FALSE on failure.

Return Value

bool

bool close_image(int $image)

Close image

Closes an image retrieved with the PDF_open_image() function.

Parameters

int $image

Return Value

bool

bool close_pdi_page(int $page)

Closes the page handle, and frees all page-related resources

Parameters

int $page

Return Value

bool

bool close_pdi(int $doc)

Close the input PDF document [deprecated]

Closes all open page handles, and closes the input PDF document. Returns TRUE on success or FALSE on failure. This function is deprecated since PDFlib version 7, use PDF_close_pdi_document() instead.

Parameters

int $doc

Return Value

bool

See also

PDF_close_pdi_document()

bool close_pdi_document(int $doc)

No description

Parameters

int $doc

Return Value

bool

bool close()

Close pdf resource [deprecated]

Closes the generated PDF file, and frees all document-related resources. Returns TRUE on success or FALSE on failure. This function is deprecated since PDFlib version 6, use PDF_end_document() instead.

Return Value

bool

See also

PDF_end_document

bool closepath_fill_stroke()

Close, fill and stroke current path

Closes the path, fills, and strokes it. Returns TRUE on success or FALSE on failure.

Return Value

bool

bool closepath_stroke()

Close and stroke path

Closes the path, and strokes it. Returns TRUE on success or FALSE on failure.

Return Value

bool

bool closepath()

Close current path

Closes the current path. Returns TRUE on success or FALSE on failure.

Return Value

bool

bool concat(float $a, float $b, float $c, float $d, float $e, float $f)

Concatenate a matrix to the CTM

Concatenates a matrix to the current transformation matrix (CTM). Returns TRUE on success or FALSE on failure.

Parameters

float $a
float $b
float $c
float $d
float $e
float $f

Return Value

bool

bool continue_text(string $text)

Output text in next line

Prints text at the next line. Returns TRUE on success or FALSE on failure.

Parameters

string $text

Return Value

bool

int create_3dview(string $username, string $optlist)

Create 3D view

Creates a 3D view. This function requires PDF 1.6.

Parameters

string $username
string $optlist

Return Value

int

int create_action(string $type, string $optlist)

Create action for objects or events

Creates an action which can be applied to various objects and events.

Parameters

string $type
string $optlist

Return Value

int

bool create_annotation(float $llx, float $lly, float $urx, float $ury, string $type, string $optlist)

Create rectangular annotation

Creates a rectangular annotation on the current page.

Parameters

float $llx
float $lly
float $urx
float $ury
string $type
string $optlist

Return Value

bool

int create_bookmark(string $text, string $optlist)

Create bookmark

Creates a bookmark subject to various options.

Parameters

string $text
string $optlist

Return Value

int

bool create_field(float $llx, float $lly, float $urx, float $ury, string $name, string $type, string $optlist)

Create form field

Creates a form field on the current page subject to various options.

Parameters

float $llx
float $lly
float $urx
float $ury
string $name
string $type
string $optlist

Return Value

bool

bool create_fieldgroup(string $name, string $optlist)

Create form field group

Creates a form field group subject to various options.

Parameters

string $name
string $optlist

Return Value

bool

int create_gstate(string $optlist)

Create graphics state object

Creates a graphics state object subject to various options.

Parameters

string $optlist

Return Value

int

bool create_pvf(string $filename, string $data, string $optlist)

Create PDFlib virtual file

Creates a named virtual read-only file from data provided in memory.

Parameters

string $filename
string $data
string $optlist

Return Value

bool

int create_textflow(string $text, string $optlist)

Create textflow object

Preprocesses text for later formatting and creates a textflow object.

Parameters

string $text
string $optlist

Return Value

int

bool curveto(float $x1, float $y1, float $x2, float $y2, float $x3, float $y3)

Draw Bezier curve

Draws a Bezier curve from the current point, using 3 more control points. Returns TRUE on success or FALSE on failure.

Parameters

float $x1
float $y1
float $x2
float $y2
float $x3
float $y3

Return Value

bool

int define_layer(string $name, string $optlist)

Create layer definition

Creates a new layer definition. This function requires PDF 1.5.

Parameters

string $name
string $optlist

Return Value

int

int delete_pvf(string $filename)

Delete PDFlib virtual file

Deletes a named virtual file and frees its data structures (but not the contents).

Parameters

string $filename

Return Value

int

bool delete_table(int $table, string $optlist)

Delete table object

Deletes a table and all associated data structures.

Parameters

int $table
string $optlist

Return Value

bool

bool delete_textflow(int $textflow)

Delete textflow object

Deletes a textflow and the associated data structures.

Parameters

int $textflow

Return Value

bool

bool delete()

Delete PDFlib object

Deletes a PDFlib object, and frees all internal resources. Returns TRUE on success or FALSE on failure.

Return Value

bool

bool encoding_set_char(string $encoding, int $slot, string $glyphname, int $uv)

Add glyph name and/or Unicode value

Adds a glyph name and/or Unicode value to a custom encoding.

Parameters

string $encoding
int $slot
string $glyphname
int $uv

Return Value

bool

bool end_document(string $optlist)

Close PDF file

Closes the generated PDF file and applies various options.

Parameters

string $optlist

Return Value

bool

bool end_font()

Terminate Type 3 font definition

Terminates a Type 3 font definition.

Return Value

bool

bool end_glyph()

Terminate glyph definition for Type 3 font

Terminates a glyph definition for a Type 3 font.

Return Value

bool

bool end_item(int $id)

Close structure element or other content item

Closes a structure element or other content item.

Parameters

int $id

Return Value

bool

bool end_layer()

Deactivate all active layers

Deactivates all active layers. Returns TRUE on success or FALSE on failure. This function requires PDF 1.5.

Return Value

bool

bool end_page_ext(string $optlist)

Finish page

Finishes a page, and applies various options. Returns TRUE on success or FALSE on failure.

Parameters

string $optlist

Return Value

bool

bool end_page()

Finish page

Finishes the page. Returns TRUE on success or FALSE on failure.

Return Value

bool

bool end_pattern()

Finish pattern

Finishes the pattern definition. Returns TRUE on success or FALSE on failure.

Return Value

bool

bool end_template()

Finish template

Finishes a template definition. Returns TRUE on success or FALSE on failure.

Return Value

bool

bool endpath()

End current path

Ends the current path without filling or stroking it.

Return Value

bool

int fill_imageblock(int $page, string $blockname, int $image, string $optlist)

Fill image block with variable data

Fills an image block with variable data according to its properties. This function is only available in the PDFlib Personalization Server (PPS).

Parameters

int $page
string $blockname
int $image
string $optlist

Return Value

int

int fill_pdfblock(int $page, string $blockname, int $contents, string $optlist)

Fill PDF block with variable data

Fills a PDF block with variable data according to its properties. This function is only available in the PDFlib Personalization Server (PPS).

Parameters

int $page
string $blockname
int $contents
string $optlist

Return Value

int

bool fill_stroke()

Fill and stroke path

Fills and strokes the current path with the current fill and stroke color. Returns TRUE on success or FALSE on failure.

Return Value

bool

int fill_textblock(int $page, string $blockname, string $text, string $optlist)

Fill text block with variable data

Fills a text block with variable data according to its properties. This function is only available in the PDFlib Personalization Server (PPS).

Parameters

int $page
string $blockname
string $text
string $optlist

Return Value

int

bool fill()

Fill current path

Fills the interior of the current path with the current fill color. Returns TRUE on success or FALSE on failure.

Return Value

bool

int findfont(string $fontname, string $encoding, int $embed)

Prepare font for later use [deprecated]

Search for a font and prepare it for later use with PDF_setfont(). The metrics will be loaded, and if embed is nonzero, the font file will be checked, but not yet used. encoding is one of builtin, macroman, winansi, host, a user-defined encoding name or the name of a CMap. Parameter embed is optional before PHP 4.3.5 or with PDFlib less than 5. This function is deprecated since PDFlib version 5, use PDF_load_font() instead.

Parameters

string $fontname
string $encoding
int $embed

Return Value

int

bool fit_image(int $image, float $x, float $y, string $optlist)

Place image or template

Places an image or template on the page, subject to various options. Returns TRUE on success or FALSE on failure.

Parameters

int $image
float $x
float $y
string $optlist

Return Value

bool

bool fit_pdi_page(int $page, float $x, float $y, string $optlist)

Place imported PDF page

Places an imported PDF page on the page, subject to various options. Returns TRUE on success or FALSE on failure.

Parameters

int $page
float $x
float $y
string $optlist

Return Value

bool

string fit_table(int $table, float $llx, float $lly, float $urx, float $ury, string $optlist)

No description

Parameters

int $table

A valid table handle retrieved with a call to PDF_add_table_cell()

float $llx

X Coordinate of the lower left corner of the target rectangle for the table instance (the fitbox) in user coordinates.

float $lly

Y Coordinate of the lower left corner of the target rectangle for the table instance (the fitbox) in user coordinates.

float $urx

X Coordinate of the upper right corner of the target rectangle for the table instance (the fitbox) in user coordinates.

float $ury

Y Coordinate of the upper right corner of the target rectangle for the table instance (the fitbox) in user coordinates.

string $optlist

An option list specifying filling details according to Table 5.18.

Return Value

string

A string which specifies the reason for returning from the function

string fit_textflow(int $textflow, float $llx, float $lly, float $urx, float $ury, string $optlist)

Format textflow in rectangular area

Formats the next portion of a textflow into a rectangular area.

Parameters

int $textflow
float $llx
float $lly
float $urx
float $ury
string $optlist

Return Value

string

bool fit_textline(string $text, float $x, float $y, string $optlist)

Place single line of text

Places a single line of text on the page, subject to various options. Returns TRUE on success or FALSE on failure.

Parameters

string $text
float $x
float $y
string $optlist

Return Value

bool

string get_apiname()

Get name of unsuccessfull API function

Gets the name of the API function which threw the last exception or failed.

Return Value

string

string get_buffer()

Get PDF output buffer

Fetches the buffer containing the generated PDF data.

Return Value

string

string get_errmsg()

Get error text

Gets the text of the last thrown exception or the reason for a failed function call.

Return Value

string

int get_errnum()

Get error number

Gets the number of the last thrown exception or the reason for a failed function call.

Return Value

int

int get_majorversion()

Get major version number [deprecated]

This function is deprecated since PDFlib version 5, use PDF_get_value() with the parameter major instead.

Return Value

int

int get_minorversion()

Get minor version number [deprecated]

Returns the minor version number of the PDFlib version. This function is deprecated since PDFlib version 5, use PDF_get_value() with the parameter minor instead.

Return Value

int

float get_option(string $keyword, string $optlist)

No description

Parameters

string $keyword
string $optlist

Return Value

float

string get_parameter(string $key, float $modifier)

Get string parameter

Gets the contents of some PDFlib parameter with string type.

Parameters

string $key
float $modifier

Return Value

string

string get_pdi_parameter(string $key, int $doc, int $page, int $reserved)

Get PDI string parameter [deprecated]

Gets the contents of a PDI document parameter with string type. This function is deprecated since PDFlib version 7, use PDF_pcos_get_string() instead.

Parameters

string $key
int $doc
int $page
int $reserved

Return Value

string

float get_pdi_value(string $key, int $doc, int $page, int $reserved)

Get PDI numerical parameter [deprecated]

Gets the contents of a PDI document parameter with numerical type. This function is deprecated since PDFlib version 7, use PDF_pcos_get_number() instead.

Parameters

string $key
int $doc
int $page
int $reserved

Return Value

float

float get_string(string $keyword, string $optlist)

No description

Parameters

string $keyword
string $optlist

Return Value

float

float get_value(string $key, float $modifier)

Get numerical parameter

Gets the value of some PDFlib parameter with numerical type.

Parameters

string $key
float $modifier

Return Value

float

float info_font(int $font, string $keyword, string $optlist)

Query detailed information about a loaded font

Queries detailed information about a loaded font.

Parameters

int $font
string $keyword
string $optlist

Return Value

float

float info_image(int $image, string $keyword, string $optlist)

No description

Parameters

int $image
string $keyword
string $optlist

Return Value

float

float info_matchbox(string $boxname, int $num, string $keyword)

Query matchbox information

Queries information about a matchbox on the current page.

Parameters

string $boxname
int $num
string $keyword

Return Value

float

float info_graphics(int $graphics, string $keyword, string $optlist)

No description

Parameters

int $graphics
string $keyword
string $optlist

Return Value

float

float info_path(int $path, string $keyword, string $optlist)

No description

Parameters

int $path
string $keyword
string $optlist

Return Value

float

float info_pdi_page($page, string $keyword, string $optlist)

No description

Parameters

$page
string $keyword
string $optlist

Return Value

float

float info_pvf(string $filename, string $keyword)

No description

Parameters

string $filename
string $keyword

Return Value

float

float info_table(int $table, string $keyword)

Retrieve table information

Retrieves table information related to the most recently placed table instance.

Parameters

int $table
string $keyword

Return Value

float

float info_textflow(int $textflow, string $keyword)

Query textflow state

Queries the current state of a textflow.

Parameters

int $textflow
string $keyword

Return Value

float

float info_textline(string $text, string $keyword, string $optlist)

Perform textline formatting and query metrics

Performs textline formatting and queries the resulting metrics.

Parameters

string $text
string $keyword
string $optlist

Return Value

float

bool initgraphics()

Reset graphic state

Reset all color and graphics state parameters to their defaults. Returns TRUE on success or FALSE on failure.

Return Value

bool

bool lineto(float $x, float $y)

Draw a line

Draws a line from the current point to another point. Returns TRUE on success or FALSE on failure.

Parameters

float $x
float $y

Return Value

bool

int load_3ddata(string $filename, string $optlist)

Load 3D model

Loads a 3D model from a disk-based or virtual file. This function requires PDF 1.6.

Parameters

string $filename
string $optlist

Return Value

int

int load_font(string $fontname, string $encoding, string $optlist)

Search and prepare font

Searches for a font and prepares it for later use.

Parameters

string $fontname
string $encoding
string $optlist

Return Value

int

int load_iccprofile(string $profilename, string $optlist)

Search and prepare ICC profile

Searches for an ICC profile, and prepares it for later use.

Parameters

string $profilename
string $optlist

Return Value

int

int load_image(string $imagetype, string $filename, string $optlist)

Open image file

Opens a disk-based or virtual image file subject to various options.

Parameters

string $imagetype
string $filename
string $optlist

Return Value

int

int makespotcolor(string $spotname)

Make spot color

Finds a built-in spot color name, or makes a named spot color from the current fill color. Returns TRUE on success or FALSE on failure.

Parameters

string $spotname

Return Value

int

bool moveto(float $x, float $y)

Set current point

Sets the current point for graphics output. Returns TRUE on success or FALSE on failure.

Parameters

float $x
float $y

Return Value

bool

int open_ccitt(string $filename, int $width, int $height, int $BitReverse, int $k, int $Blackls1)

Open raw CCITT image [deprecated]

Opens a raw CCITT image. This function is deprecated since PDFlib version 5, use PDF_load_image() instead.

Parameters

string $filename
int $width
int $height
int $BitReverse
int $k
int $Blackls1

Return Value

int

bool open_file(string $filename)

Create PDF file [deprecated]

Creates a new PDF file using the supplied file name. Returns TRUE on success or FALSE on failure. This function is deprecated since PDFlib version 6, use PDF_begin_document() instead.

Parameters

string $filename

Return Value

bool

int open_image_file(string $imagetype, string $filename, string $stringparam, int $intparam)

Read image from file [deprecated]

Opens an image file. This function is deprecated since PDFlib version 5, use PDF_load_image() with the colorize, ignoremask, invert, mask, masked, and page options instead.

Parameters

string $imagetype
string $filename
string $stringparam
int $intparam

Return Value

int

int open_image(string $imagetype, string $source, string $data, int $length, int $width, int $height, int $components, int $bpc, string $params)

Use image data [deprecated]

Uses image data from a variety of data sources. This function is deprecated since PDFlib version 5, use virtual files and PDF_load_image() instead.

Parameters

string $imagetype
string $source
string $data
int $length
int $width
int $height
int $components
int $bpc
string $params

Return Value

int

int open_memory_image(resource $image)

Open image created with PHP's image functions [not supported]

This function is not supported by PDFlib GmbH.

Parameters

resource $image

Return Value

int

int open_pdi_document(string $filename, string $optlist)

Prepare a pdi document

Open a disk-based or virtual PDF document and prepare it for later use.

Parameters

string $filename
string $optlist

Return Value

int

int open_pdi_page(int $doc, int $pagenumber, string $optlist)

Prepare a page

Prepares a page for later use with PDF_fit_pdi_page().

Parameters

int $doc
int $pagenumber
string $optlist

Return Value

int

int open_pdi(string $filename, string $optlist, int $len)

Open PDF file [deprecated]

Opens a disk-based or virtual PDF document and prepares it for later use. This function is deprecated since PDFlib version 7, use PDF_open_pdi_document() instead.

Parameters

string $filename
string $optlist
int $len

Return Value

int

float pcos_get_number(int $doc, string $path)

Get value of pCOS path with type number or boolean

Gets the value of a pCOS path with type number or boolean.

Parameters

int $doc
string $path

Return Value

float

string pcos_get_stream(int $doc, string $optlist, string $path)

Get contents of pCOS path with type stream, fstream, or string

Gets the contents of a pCOS path with type stream, fstream, or string.

Parameters

int $doc
string $optlist
string $path

Return Value

string

string pcos_get_string(int $doc, string $path)

Get value of pCOS path with type name, string, or boolean

Gets the value of a pCOS path with type name, string, or boolean.

Parameters

int $doc
string $path

Return Value

string

bool place_image(int $image, float $x, float $y, float $scale)

Place image on the page [deprecated]

Places an image and scales it. Returns TRUE on success or FALSE on failure. This function is deprecated since PDFlib version 5, use PDF_fit_image() instead.

Parameters

int $image
float $x
float $y
float $scale

Return Value

bool

bool place_pdi_page(int $page, float $x, float $y, float $sx, float $sy)

Place PDF page [deprecated]

Places a PDF page and scales it. Returns TRUE on success or FALSE on failure. This function is deprecated since PDFlib version 5, use PDF_fit_pdi_page() instead.

Parameters

int $page
float $x
float $y
float $sx
float $sy

Return Value

bool

bool set_option(string $optlist)

No description

Parameters

string $optlist

Return Value

bool

int process_pdi(int $doc, int $page, string $optlist)

Process imported PDF document

Processes certain elements of an imported PDF document.

Parameters

int $doc
int $page
string $optlist

Return Value

int

bool rect(float $x, float $y, float $width, float $height)

Draw rectangle

Draws a rectangle. Returns TRUE on success or FALSE on failure.

Parameters

float $x
float $y
float $width
float $height

Return Value

bool

bool restore()

Restore graphics state

Restores the most recently saved graphics state. Returns TRUE on success or FALSE on failure.

Return Value

bool

bool resume_page(string $optlist)

Resume page

Resumes a page to add more content to it.

Parameters

string $optlist

Return Value

bool

bool rotate(float $phi)

Rotate coordinate system

Rotates the coordinate system. Returns TRUE on success or FALSE on failure.

Parameters

float $phi

Return Value

bool

bool save()

Save graphics state

Saves the current graphics state. Returns TRUE on success or FALSE on failure.

Return Value

bool

bool scale(float $sx, float $sy)

Scale coordinate system

Scales the coordinate system. Returns TRUE on success or FALSE on failure.

Parameters

float $sx
float $sy

Return Value

bool

bool set_border_color(float $red, float $green, float $blue)

Set border color of annotations [deprecated]

Sets the border color for all kinds of annotations. Returns TRUE on success or FALSE on failure. This function is deprecated since PDFlib version 6, use the option annotcolor in PDF_create_annotation() instead.

Parameters

float $red
float $green
float $blue

Return Value

bool

bool set_border_dash(float $black, float $white)

Set border dash style of annotations [deprecated]

Sets the border dash style for all kinds of annotations. Returns TRUE on success or FALSE on failure. This function is deprecated since PDFlib version 6, use the option dasharray in PDF_create_annotation() instead.

Parameters

float $black
float $white

Return Value

bool

bool set_border_style(string $style, float $width)

Set border style of annotations [deprecated]

Sets the border style for all kinds of annotations. Returns TRUE on success or FALSE on failure. This function is deprecated since PDFlib version 6, use the options borderstyle and linewidth in PDF_create_annotation() instead.

Parameters

string $style
float $width

Return Value

bool

bool set_gstate(int $gstate)

Activate graphics state object

Activates a graphics state object.

Parameters

int $gstate

Return Value

bool

bool set_info(string $key, string $value)

Fill document info field

Fill document information field key with value. Returns TRUE on success or FALSE on failure.

Parameters

string $key
string $value

Return Value

bool

bool set_layer_dependency(string $type, string $optlist)

Define relationships among layers

Defines hierarchical and group relationships among layers. Returns TRUE on success or FALSE on failure. This function requires PDF 1.5.

Parameters

string $type
string $optlist

Return Value

bool

bool set_parameter(string $key, string $value)

Set string parameter

Sets some PDFlib parameter with string type. Returns TRUE on success or FALSE on failure.

Parameters

string $key
string $value

Return Value

bool

bool set_text_pos(float $x, float $y)

Set text position

Sets the position for text output on the page. Returns TRUE on success or FALSE on failure.

Parameters

float $x
float $y

Return Value

bool

bool set_value(string $key, float $value)

Set numerical parameter

Sets the value of some PDFlib parameter with numerical type. Returns TRUE on success or FALSE on failure.

Parameters

string $key
float $value

Return Value

bool

bool setcolor(string $fstype, string $colorspace, float $c1, float $c2, float $c3, float $c4)

Set fill and stroke color

Sets the current color space and color. Returns TRUE on success or FALSE on failure.

Parameters

string $fstype
string $colorspace
float $c1
float $c2
float $c3
float $c4

Return Value

bool

bool setdash(float $b, float $w)

Set simple dash pattern

Sets the current dash pattern to b black and w white units. Returns TRUE on success or FALSE on failure.

Parameters

float $b
float $w

Return Value

bool

bool setdashpattern(string $optlist)

Set dash pattern

Sets a dash pattern defined by an option list. Returns TRUE on success or FALSE on failure.

Parameters

string $optlist

Return Value

bool

bool setflat(float $flatness)

Set flatness

Sets the flatness parameter. Returns TRUE on success or FALSE on failure.

Parameters

float $flatness

Return Value

bool

bool setfont(int $font, float $fontsize)

Set font

Sets the current font in the specified fontsize, using a font handle returned by PDF_load_font(). Returns TRUE on success or FALSE on failure.

Parameters

int $font
float $fontsize

Return Value

bool

bool setgray_fill(float $g)

Set fill color to gray [deprecated]

Sets the current fill color to a gray value between 0 and 1 inclusive. Returns TRUE on success or FALSE on failure. This function is deprecated since PDFlib version 4, use PDF_setcolor() instead.

Parameters

float $g

Return Value

bool

bool setgray_stroke(float $g)

Set stroke color to gray [deprecated]

Sets the current stroke color to a gray value between 0 and 1 inclusive. Returns TRUE on success or FALSE on failure. This function is deprecated since PDFlib version 4, use PDF_setcolor() instead.

Parameters

float $g

Return Value

bool

bool setgray(float $g)

Set color to gray [deprecated]

Sets the current fill and stroke color to a gray value between 0 and 1 inclusive. Returns TRUE on success or FALSE on failure. This function is deprecated since PDFlib version 4, use PDF_setcolor() instead.

Parameters

float $g

Return Value

bool

bool setlinecap(int $linecap)

Set linecap parameter

Sets the linecap parameter to control the shape at the end of a path with respect to stroking.

Parameters

int $linecap

Return Value

bool

bool setlinejoin(int $value)

Set linejoin parameter

Sets the linejoin parameter to specify the shape at the corners of paths that are stroked. Returns TRUE on success or FALSE on failure.

Parameters

int $value

Return Value

bool

bool setlinewidth(float $width)

Set line width

Sets the current line width. Returns TRUE on success or FALSE on failure.

Parameters

float $width

Return Value

bool

bool setmatrix(float $a, float $b, float $c, float $d, float $e, float $f)

Set current transformation matrix

Explicitly sets the current transformation matrix. Returns TRUE on success or FALSE on failure.

Parameters

float $a
float $b
float $c
float $d
float $e
float $f

Return Value

bool

bool setmiterlimit(float $miter)

Set miter limit

Sets the miter limit.Returns TRUE on success or FALSE on failure.

Parameters

float $miter

Return Value

bool

bool setrgbcolor_fill(float $red, float $green, float $blue)

Set fill rgb color values [deprecated]

Sets the current fill color to the supplied RGB values. Returns TRUE on success or FALSE on failure. This function is deprecated since PDFlib version 4, use PDF_setcolor() instead.

Parameters

float $red
float $green
float $blue

Return Value

bool

bool setrgbcolor_stroke(float $red, float $green, float $blue)

Set stroke rgb color values [deprecated]

Sets the current stroke color to the supplied RGB values. Returns TRUE on success or FALSE on failure. This function is deprecated since PDFlib version 4, use PDF_setcolor() instead.

Parameters

float $red
float $green
float $blue

Return Value

bool

bool setrgbcolor(float $red, float $green, float $blue)

Set fill and stroke rgb color values [deprecated]

Sets the current fill and stroke color to the supplied RGB values. Returns TRUE on success or FALSE on failure. This function is deprecated since PDFlib version 4, use PDF_setcolor() instead.

Parameters

float $red
float $green
float $blue

Return Value

bool

int shading_pattern(int $shading, string $optlist)

Define shading pattern

Defines a shading pattern using a shading object. This function requires PDF 1.4 or above.

Parameters

int $shading
string $optlist

Return Value

int

int shading(string $shtype, float $x0, float $y0, float $x1, float $y1, float $c1, float $c2, float $c3, float $c4, string $optlist)

Define blend

Defines a blend from the current fill color to another color. This function requires PDF 1.4 or above.

Parameters

string $shtype
float $x0
float $y0
float $x1
float $y1
float $c1
float $c2
float $c3
float $c4
string $optlist

Return Value

int

bool shfill(int $shading)

Fill area with shading

Fills an area with a shading, based on a shading object. This function requires PDF 1.4 or above.

Parameters

int $shading

Return Value

bool

int show_boxed(string $text, float $left, float $top, float $width, float $height, string $mode, string $feature)

Output text in a box [deprecated]

This function is deprecated since PDFlib version 6, use PDF_fittextline() for single lines, or the PDF*_textflow() functions for multi-line formatting instead.

Parameters

string $text
float $left
float $top
float $width
float $height
string $mode
string $feature

Return Value

int

bool show_xy(string $text, float $x, float $y)

Output text at given position

Prints text in the current font. Returns TRUE on success or FALSE on failure.

Parameters

string $text
float $x
float $y

Return Value

bool

bool show(string $text)

Output text at current position

Prints text in the current font and size at the current position. Returns TRUE on success or FALSE on failure.

Parameters

string $text

Return Value

bool

bool skew(float $alpha, float $beta)

Skew the coordinate system

Skews the coordinate system in x and y direction by alpha and beta degrees, respectively. Returns TRUE on success or FALSE on failure.

Parameters

float $alpha
float $beta

Return Value

bool

float stringwidth(string $text, int $font, float $fontsize)

Return width of text

Returns the width of text in an arbitrary font.

Parameters

string $text
int $font
float $fontsize

Return Value

float

bool stroke()

Stroke path

Strokes the path with the current color and line width, and clear it. Returns TRUE on success or FALSE on failure.

Return Value

bool

bool suspend_page(string $optlist)

Suspend page

Suspends the current page so that it can later be resumed with PDF_resume_page().

Parameters

string $optlist

Return Value

bool

bool translate(float $tx, float $ty)

Set origin of coordinate system

Translates the origin of the coordinate system.

Parameters

float $tx
float $ty

Return Value

bool

string utf16_to_utf8(string $utf16string)

Convert string from UTF-16 to UTF-8

Converts a string from UTF-16 format to UTF-8.

Parameters

string $utf16string

Return Value

string

string utf32_to_utf16(string $utf32string, string $ordering)

Convert string from UTF-32 to UTF-16

Converts a string from UTF-32 format to UTF-16.

Parameters

string $utf32string
string $ordering

Return Value

string

string utf8_to_utf16(string $utf8string, string $ordering)

Convert string from UTF-8 to UTF-16

Converts a string from UTF-8 format to UTF-16.

Parameters

string $utf8string
string $ordering

Return Value

string