PDF functions PDF Introduction The PDF functions in PHP can create PDF files using the PDFlib library created by Thomas Merz. PDFlib is available for download at &url.pdf;, but requires that you purchase a license for commercial use. The JPEG and TIFF libraries are required to compile this extension. Please see the PDFlib installation section for more information about compiling PDF support into PHP. The documentation in this section is only meant to be an overview of the available functions in the PDFlib library and should not be considered an exhaustive reference. Please consult the documentation included in the source distribution of PDFlib for the full and detailed explanation of each function here. It provides a very good overview of what PDFlib is capable of doing and contains the most up-to-date documentation of all functions. All of the functions in PDFlib and the PHP module have identical function names and parameters. You will need to understand some of the basic concepts of PDF and PostScript to efficiently use this extension. All lengths and coordinates are measured in PostScript points. There are generally 72 PostScript points to an inch, but this depends on the output resolution. Please see the PDFlib documentation included with the source distribution of PDFlib for a more thorough explanation of the coordinate system used. Please note that most of the PDF functions require a pdf object as it's first parameter. Please see the examples below for more information. An alternative PHP module for PDF document creation based on FastIO's ClibPDF is available. Please see the ClibPDF section for details. Note that ClibPDF has a slightly different API compared to PDFlib. Confusion with old PDFlib versions Starting with PHP 4.0.5, the PHP extension for PDFlib is officially supported by PDFlib GmbH. This means that all the functions described in the PDFlib manual (V3.00 or greater) are supported by PHP 4 with exactly the same meaning and the same parameters. Only the return values may differ from the PDFlib manual, because the PHP convention of returning &false; was adopted. For compatibility reasons this binding for PDFlib still supports the old functions, but they should be replaced by their new versions. PDFlib GmbH will not support any problems arising from the use of these deprecated functions. Deprecated functions and its replacements Old function Replacement pdf_put_image Not needed anymore. pdf_execute_image Not needed anymore. pdf_get_annotation pdf_get_bookmark using the same parameters. pdf_get_font pdf_get_value passing "font" as the second parameter. pdf_get_fontsize pdf_get_value passing "fontsize" as the second parameter. pdf_get_fontname pdf_get_parameter passing "fontname" as the second parameter. pdf_set_info_creator pdf_set_info passing "Creator" as the second parameter. pdf_set_info_title pdf_set_info passing "Title" as the second parameter. pdf_set_info_subject pdf_set_info passing "Subject" as the second parameter. pdf_set_info_author pdf_set_info passing "Author" as the second parameter. pdf_set_info_keywords pdf_set_info passing "Keywords" as the second parameter. pdf_set_leading pdf_set_value passing "leading" as the second parameter. pdf_set_text_rendering pdf_set_value passing "textrendering" as the second parameter. pdf_set_text_rise pdf_set_value passing "textrise" as the second parameter. pdf_set_horiz_scaling pdf_set_value passing "horizscaling" as the second parameter. pdf_set_text_matrix Not available anymore pdf_set_char_spacing pdf_set_value passing "charspacing" as the second parameter. pdf_set_word_spacing pdf_set_value passing "wordspacing" as the second parameter. pdf_set_transition pdf_set_parameter passing "transition" as the second parameter. pdf_open pdf_new plus an subsequent call of pdf_open_file pdf_set_font pdf_findfont plus an subsequent call of pdf_setfont pdf_set_duration pdf_set_value passing "duration" as the second parameter. pdf_open_gif pdf_open_image_file passing "gif" as the second parameter. pdf_open_jpeg pdf_open_image_file passing "jpeg" as the second parameter. pdf_open_tiff pdf_open_image_file passing "tiff" as the second parameter. pdf_open_png pdf_open_image_file passing "png" as the second parameter. pdf_get_image_width pdf_get_value passing "imagewidth" as the second parameter and the image as the third parameter. pdf_get_image_height pdf_get_value passing "imageheight" as the second parameter and the image as the third parameter.
PDFlib 3.x Installation Hints When using version 3.x of PDFlib, you should configure PDFlib with the option --enable-shared-pdflib. Issues with older versions of PDFlib Any version of PHP 4 after March 9, 2000 does not support versions of PDFlib older than 3.0. PDFlib 3.0 or greater is supported by PHP 3.0.19 and later. Examples Most of the functions are fairly easy to use. The most difficult part is probably creating a very simple PDF document at all. The following example should help to get started. It creates test.pdf with one page. The page contains the text "Times Roman outlined" in an outlined, 30pt font. The text is also underlined. Creating a PDF document with PDFlib finished"; ?> ]]> The script getpdf.php just returns the pdf document. ]]> The PDFlib distribution contains a more complex example which creates a page with an analog clock. Here we use the in memory creation feature of PDFlib to alleviate the need to use temporary files. The example, converted to PHP from the PDFlib example, is as follows: (The same example is available in the CLibPDF documentation.) pdfclock example from PDFlib distribution 0) { pdf_begin_page($pdf, 2 * ($radius + $margin), 2 * ($radius + $margin)); pdf_set_parameter($pdf, "transition", "wipe"); pdf_set_value($pdf, "duration", 0.5); pdf_translate($pdf, $radius + $margin, $radius + $margin); pdf_save($pdf); pdf_setrgbcolor($pdf, 0.0, 0.0, 1.0); /* minute strokes */ pdf_setlinewidth($pdf, 2.0); for ($alpha = 0; $alpha < 360; $alpha += 6) { pdf_rotate($pdf, 6.0); pdf_moveto($pdf, $radius, 0.0); pdf_lineto($pdf, $radius-$margin/3, 0.0); pdf_stroke($pdf); } pdf_restore($pdf); pdf_save($pdf); /* 5 minute strokes */ pdf_setlinewidth($pdf, 3.0); for ($alpha = 0; $alpha < 360; $alpha += 30) { pdf_rotate($pdf, 30.0); pdf_moveto($pdf, $radius, 0.0); pdf_lineto($pdf, $radius-$margin, 0.0); pdf_stroke($pdf); } $ltime = getdate(); /* draw hour hand */ pdf_save($pdf); pdf_rotate($pdf,-(($ltime['minutes']/60.0)+$ltime['hours']-3.0)*30.0); pdf_moveto($pdf, -$radius/10, -$radius/20); pdf_lineto($pdf, $radius/2, 0.0); pdf_lineto($pdf, -$radius/10, $radius/20); pdf_closepath($pdf); pdf_fill($pdf); pdf_restore($pdf); /* draw minute hand */ pdf_save($pdf); pdf_rotate($pdf,-(($ltime['seconds']/60.0)+$ltime['minutes']-15.0)*6.0); pdf_moveto($pdf, -$radius/10, -$radius/20); pdf_lineto($pdf, $radius * 0.8, 0.0); pdf_lineto($pdf, -$radius/10, $radius/20); pdf_closepath($pdf); pdf_fill($pdf); pdf_restore($pdf); /* draw second hand */ pdf_setrgbcolor($pdf, 1.0, 0.0, 0.0); pdf_setlinewidth($pdf, 2); pdf_save($pdf); pdf_rotate($pdf, -(($ltime['seconds'] - 15.0) * 6.0)); pdf_moveto($pdf, -$radius/5, 0.0); pdf_lineto($pdf, $radius, 0.0); pdf_stroke($pdf); pdf_restore($pdf); /* draw little circle at center */ pdf_circle($pdf, 0, 0, $radius/30); pdf_fill($pdf); pdf_restore($pdf); pdf_end_page($pdf); # to see some difference sleep(1); } pdf_close($pdf); $buf = pdf_get_buffer($pdf); $len = strlen($buf); header("Content-type: application/pdf"); header("Content-Length: $len"); header("Content-Disposition: inline; filename=foo.pdf"); print $buf; pdf_delete($pdf); ?> ]]>
pdf_add_annotation Deprecated: Adds annotation Description pdf_add_outline is replaced by pdf_add_note See also pdf_add_note. pdf_add_bookmark Adds bookmark for current page Description int pdf_add_bookmark int pdf object string text int parent int open Add a nested bookmark under parent, or a new top-level bookmark if parent = 0. Returns a bookmark descriptor which may be used as parent for subsequent nested bookmarks. If open = 1, child bookmarks will be folded out, and invisible if open = 0. pdf_add_launchlink Add a launch annotation for current page Description int pdf_add_launchlink int pdf object float llx float lly float urx float ury string filename Add a launch annotation (to a target of arbitrary file type). pdf_add_locallink Add a link annotation for current page Description int pdf_add_locallink int pdf object float llx float lly float urx float ury int page string dest Add a link annotation to a target within the current PDF file. pdf_add_note Add a note annotation for current page Description int pdf_add_note int pdf object float llx float lly float urx float ury string contents string title string icon int open Add a note annotation. icon is one of of "comment, "insert", "note", "paragraph", "newparagraph", "key", or "help". pdf_add_outline Deprecated: Adds bookmark for current page Description Deprecated. See pdf_add_bookmark. pdf_add_pdflink Adds file link annotation for current page Description int pdf_add_pdflink int pdf object float llx float lly float urx float ury string filename int page string dest Add a file link annotation (to a PDF target). pdf_add_thumbnail Adds thumbnail for current page Description int pdf_add_thumbnail int pdf object int image Add an existing image as thumbnail for the current page. pdf_add_weblink Adds weblink for current page Description int pdf_add_weblink int pdf object float llx float lly float urx float ury string url Add a weblink annotation to a target URL on the Web. pdf_arc Draws an arc (counterclockwise) Description void pdf_arc resource pdf object float x float y float r float alpha float beta Draw a counterclockwise circular arc from alpha to beta degrees See also: pdf_arcn pdf_arcn Draws an arc (clockwise) Description void pdf_arc resource pdf object float x float y float r float alpha float beta Draw a clockwise circular arc from alpha to beta degrees See also: pdf_arc pdf_attach_file Adds a file attachement for current page Description int pdf_attach_file int pdf object float llx float lly float urx float ury string filename string description string author string mimetype string icon Add a file attachment annotation. icon is one of "graph, "paperclip", "pushpin", or "tag". pdf_begin_page Starts new page Description void pdf_begin_page int pdf object float width float height Add a new page to the document. The width and height are specified in points, which are 1/72 of an inch. Common Page Sizes in Points name size A0 2380✗3368 A1 1684✗2380 A2 1190✗1684 A3 842✗1190 A4 595✗842 A5 421✗595 A6 297✗421 B5 501✗709 letter (8.5"✗11") 612✗792 legal (8.5"✗14") 612✗1008 ledger (17"✗11") 1224✗792 11"✗17" 792✗1224
pdf_begin_pattern Starts new pattern Description int pdf_begin_pattern int pdf object float width float height float xstep float ystep int painttype Starts a new pattern definition and returns a pattern handle. width, and height define the bounding box for the pattern. xstep and ystep give the repeated pattern offsets. painttype=1 means that the pattern has its own colour settings whereas a value of 2 indicates that the current colour is used when the pattern is applied. pdf_begin_template Starts new template Description void pdf_begin_template int pdf object float width float height Start a new template definition. pdf_circle Draws a circle Description void pdf_circle int pdf object float x float y float r Draw a circle with center (x, y) and radius r. pdf_clip Clips to current path Description void pdf_clip int pdf object Use the current path as clipping path. pdf_close Closes a pdf object Description void pdf_close int pdf object Close the generated PDF file, and free all document-related resources. pdf_closepath Closes path Description void pdf_closepath int pdf object Close the current path. pdf_closepath_fill_stroke Closes, fills and strokes current path Description void pdf_closepath_fill_stroke int pdf object Close the path, fill, and stroke it. pdf_closepath_stroke Closes path and draws line along path Description void pdf_closepath_stroke int pdf object Close the path, and stroke it. pdf_close_image Closes an image Description void pdf_close_image int pdf object int image Close an image retrieved with one of the pdf_open_image* functions. pdf_close_pdi Close the input PDF document Description void pdf_close_pdi int pdf object int dochandle Close all open page handles, and close the input PDF document. pdf_close_pdi_page Close the page handle Description void pdf_close_pdi_page int pdf object int pagehandle Close the page handle, and free all page-related resources. pdf_concat Concatenate a matrix to the CTM Description void pdf_concat int pdf object float a float b float c float d float e float f Concatenate a matrix to the CTM. pdf_continue_text Outputs text in next line Description void pdf_continue_text int pdf object string text Print text at the next line. The spacing between lines is determined by the leading parameter. pdf_curveto Draws a curve Description void pdf_curveto int pdf object float x1 float y1 float x2 float y2 float x3 float y3 Draw a Bezier curve from the current point, using 3 more control points. pdf_delete Deletes a PDF object Description void pdf_delete int pdf object Delete the PDF object, and free all internal resources. pdf_end_page Ends a page Description void pdf_end_page int pdf object Finish the page. pdf_endpath Deprecated: Ends current path Description Deprecated, use one of the stroke, fill, or clip functions instead. pdf_end_pattern Finish pattern Description void pdf_end_pattern int pdf object Finish the pattern definition. pdf_end_template Finish template Description void pdf_end_template int pdf object Finish the template definition. pdf_fill Fills current path Description void pdf_fill_stroke int pdf object Fill the interior of the path with the current fill color. pdf_fill_stroke Fills and strokes current path Description void pdf_fill_stroke int pdf object Fill and stroke the path with the current fill and stroke color. pdf_findfont Prepare font for later use with pdf_setfont. Description int pdf_findfont int pdf object string fontname string encoding^ int embed Prepare a font 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", or a user-defined encoding name, or the name of a CMap. pdf_findfont returns a font handle or &false; on error. <function>pdf_findfont</function> example ]]> pdf_get_buffer Fetch the buffer containig the generated PDF data. Description string pdf_get_buffer int pdf object Get the contents of the PDF output buffer. The result must be used by the client before calling any other PDFlib function. pdf_get_font Deprecated: font handling Description Deprecated. See pdf_get_value. pdf_get_fontname Deprecated: font handling Description Deprecated. See pdf_get_parameter. pdf_get_fontsize Deprecated: font handling Description Deprecated. See pdf_get_value. pdf_get_image_height Returns height of an image Description string pdf_get_image_height int pdf object int image pdf_get_image_height is deprecated, use pdf_get_value instead. pdf_get_image_width Returns width of an image Description string pdf_get_image_width int pdf object int image The pdf_get_image_width is deprecated, use pdf_get_value instead. pdf_get_parameter Gets certain parameters Description string pdf_get_parameter int pdf object string key float modifier Get the contents of some PDFlib parameter with string type. pdf_get_pdi_parameter Get some PDI string parameters Description string pdf_get_pdi_parameter int pdf object string key int doc int page int index Get the contents of some PDI document parameter with string type. pdf_get_pdi_value Gets some PDI numerical parameters Description string pdf_get_pdi_value int pdf object string key int doc int page int index Get the contents of some PDI document parameter with numerical type. pdf_get_majorversion Returns the major version number of the PDFlib Description int pdf_get_majorversion Returns the major version number of the PDFlib. pdf_get_minorversion Returns the minor version number of the PDFlib Description int pdf_get_majorversion Returns the minor version number of the PDFlib. pdf_get_value Gets certain numerical value Description float pdf_get_value int pdf object string key float modifier Get the contents of some PDFlib parameter with float type. pdf_initgraphics Resets graphic state Description void pdf_initgraphics int pdf object Reset all implicit color and graphics state parameters to their defaults. pdf_lineto Draws a line Description void pdf_lineto int pdf object float x float y Draw a line from the current point to (x, y). pdf_makespotcolor Makes a spotcolor Description void pdf_makespotcolor int pdf object string spotname Make a named spot color from the current color. pdf_moveto Sets current point Description void pdf_moveto int pdf object float x float y Set the current point. The current point for graphics and the current text output position are maintained separately. See pdf_set_text_pos to set the text output position. pdf_new Creates a new pdf object Description int pdf_new Create a new PDF object, using default error handling and memory management. pdf_open Deprecated: Open a new pdf object Description pdf_open is deprecated, use pdf_new plus pdf_open_file instead. See also pdf_new, pdf_open_file. pdf_open_CCITT Opens a new image file with raw CCITT data Description int pdf_open_CCITT int pdf object string filename int width int height int BitReverse int k int Blackls1 Open a raw CCITT image. pdf_open_file Opens a new pdf object Description int pdf_open_file int pdf object string filename Create a new PDF file using the supplied file name. If filename is empty the PDF document will be generated in memory instead of on file. The result must be fetched by the client with the pdf_get_buffer function. The following example shows how to create a pdf document in memory and how to output it correctly. Creating a PDF document in memory ]]> pdf_open_gif Deprecated: Opens a GIF image Description Deprecated. See pdf_open_image, pdf_open_image Versatile function for images Description int pdf_open_image int PDF-document string imagetype string source string data long length int width int height int components int bpc string params Use image data from a variety of data sources. Supported types are "jpeg", "ccitt", "raw". Supported sources are "memory", "fileref", "url". len is only used for type="raw", params is only used for type="ccitt". pdf_open_image_file Reads an image from a file Description int pdf_open_image_file int PDF-document string imagetype string filename string stringparam string intparam Open an image file. Supported types are "jpeg", "tiff", "gif", and "png". stringparam is either "", "mask", "masked", or "page". intparamis either 0, the image id of the applied mask, or the page. pdf_open_jpeg Deprecated: Opens a JPEG image Description Deprecated. See also pdf_open_image, pdf_open_memory_image Opens an image created with PHP's image functions Description int pdf_open_memory_image int pdf object int image The pdf_open_memory_image function takes an image created with the PHP's image functions and makes it available for the pdf object. The function returns a pdf image identifier. Including a memory image ]]> See also pdf_close_image, pdf_place_image. pdf_open_pdi Opens a PDF file Description int pdf_open_pdi int pdf object string filename string stringparam int intparam Open an existing PDF document for later use. pdf_open_pdi_page Prepare a page Description int pdf_open_pdi_page int pdf object int dochandle int pagenumber string pagelabel Prepare a page for later use with pdf_place_image pdf_open_png Deprecated: Opens a PNG image Description Deprecated. See pdf_open_image. pdf_open_tiff Deprecated: Opens a TIFF image Description int pdf_open_tiff int PDF-document string filename Deprecated. See also pdf_open_image, pdf_place_image Places an image on the page Description void pdf_place_image int pdf object int image float x float y float scale Place an image with the lower left corner at (x, y), and scale it. pdf_place_pdi_page Places an image on the page Description void pdf_place_pdi_page int pdf object int page float x float y float sx float sy Place a PDF page with the lower left corner at (x, y), and scale it. pdf_rect Draws a rectangle Description void pdf_rect int pdf object float x float y float width float height Draw a rectangle at lower left (x, y) with width and height. pdf_restore Restores formerly saved environment Description void pdf_restore int pdf object Restore the most recently saved graphics state. pdf_rotate Sets rotation Description void pdf_rotate int pdf object float phi Rotate the coordinate system by phi degrees. pdf_save Saves the current environment Description void pdf_save int pdf object Save the current graphics state. pdf_scale Sets scaling Description void pdf_scale int pdf object float x-scale float y-scale Scale the coordinate system. pdf_setcolor Sets fill and stroke color to CMYK values Description void pdf_setcolor int pdf object string type string colorspace float c1 float c2 float c3 float c4 Set the current color space and color. The parameter type can be "fill", "stroke", or "both" to specify that the color is set for filling, stroking or both filling and stroking. The parameter colorspace can be gray, rgb, cmyk, spot or pattern. The parameters c1, c2, c3 and c4 represent the color components for the color space specified by colorspace. For gray only c1 is used. For rgb parameters c1, c2, and c3 specify the Red, Green amd Blue values respectively. For cmyk parameters c1, c2, c3, and c4 specify the Cyan, Magenta, Yellow and Black values respectively. For spot c1 specifies a spot color handles returned by pdf_makespotcolor and c2 specifies a tint value between 0 and 1. For pattern c1 specifies a pattern handle returned by pdf_begin_pattern. pdf_setdash Sets dash pattern Description void pdf_setdash int pdf object float b float w Set the current dash pattern to b black and w white units. pdf_setflat Sets flatness Description void pdf_setflat int pdf object float flatness Set the flatness to a value between 0 and 100 inclusive. pdf_setfont Set the current font Description void pdf_setfont int pdf object int font float size Set the current font in the given size, using a font handle returned by pdf_findfont See Also: pdf_findfont. pdf_setgray Sets drawing and filling color to gray value Description void pdf_setgray int pdf object float gray Set the current fill and stroke color. PDFlib V4.0: Deprecated, use pdf_setcolor instead. pdf_setgray_fill Sets filling color to gray value Description void pdf_setgray_fill int pdf object float gray Set the current fill color to a gray value between 0 and 1 inclusive. PDFlib V4.0: Deprecated, use pdf_setcolor instead. pdf_setgray_stroke Sets drawing color to gray value Description void pdf_setgray_stroke int pdf object float gray Set the current stroke color to a gray value between 0 and 1 inclusive PDFlib V4.0: Deprecated, use pdf_setcolor instead. pdf_setlinecap Sets linecap parameter Description void pdf_setlinecap int pdf object int linecap Set the linecap parameter to a value between 0 and 2 inclusive. pdf_setlinejoin Sets linejoin parameter Description void pdf_setlinejoin int pdf object long linejoin Set the line join parameter to a value between 0 and 2 inclusive. pdf_setlinewidth Sets line width Description void pdf_setlinewidth int pdf object float width Set the current linewidth to width. pdf_setmatrix Sets current transformation matrix Description void pdf_setmatrix int pdf object float a float b float c float d float e float f Explicitly set the current transformation matrix. pdf_setmiterlimit Sets miter limit Description void pdf_setmiterlimit int pdf object float miter Set the miter limit to a value greater than or equal to 1. pdf_setpolydash Sets complicated dash pattern Description void pdf_setpolydash int pdf object float *dasharray Set a more complicated dash pattern defined by an array. pdf_setrgbcolor Sets drawing and filling color to rgb color value Description void pdf_setrgbcolor int pdf object float red value float green value float blue value Set the current fill and stroke color to the supplied RGB values. PDFlib V4.0: Deprecated, use pdf_setcolor instead. pdf_setrgbcolor_fill Sets filling color to rgb color value Description void pdf_setrgbcolor_fill int pdf object float red value float green value float blue value Set the current fill color to the supplied RGB values. PDFlib V4.0: Deprecated, use pdf_setcolor instead. pdf_setrgbcolor_stroke Sets drawing color to rgb color value Description void pdf_setrgbcolor_stroke int pdf object float red value float green value float blue value Set the current stroke color to the supplied RGB values. PDFlib V4.0: Deprecated, use pdf_setcolor instead. pdf_set_border_color Sets color of border around links and annotations Description void pdf_set_border_color int pdf object float red float green float blue Set the border color for all kinds of annotations. pdf_set_border_dash Sets dash style of border around links and annotations Description void pdf_set_border_dash int pdf object float black float white Set the border dash style for all kinds of annotations. See pdf_setdash. pdf_set_border_style Sets style of border around links and annotations Description void pdf_set_border_style int pdf object string style float width Set the border style for all kinds of annotations. style is "solid" or "dashed". pdf_set_char_spacing Deprecated: Sets character spacing Description Deprecated. See also pdf_set_value, pdf_set_duration Deprecated: Sets duration between pages Description Deprecated. See pdf_set_value. pdf_set_font Deprecated: Selects a font face and size Description Deprecated. You should use pdf_findfont plus pdf_setfont instead. See pdf_findfont, pdf_setfont. pdf_set_horiz_scaling Sets horizontal scaling of text Description void pdf_set_horiz_scaling int pdf object float scale Deprecated. See also pdf_set_value, pdf_set_info Fills a field of the document information Description void pdf_set_info int pdf object string key string value Fill document information field key with value. key is one of "Subject", "Title", "Creator", "Author", "Keywords", or a user-defined key. pdf_set_info_author Fills the author field of the document Description bool pdf_set_info_author int pdfdoc string author This function is deprecate, use pdf_set_info instead. pdf_set_info_creator Fills the creator field of the document Description bool pdf_set_info_creator int pdfdoc string creator This function is deprecate, use pdf_set_info instead. pdf_set_info_keywords Fills the keywords field of the document Description bool pdf_set_info_keywords int pdfdoc string keywords This function is deprecate, use pdf_set_info instead. pdf_set_info_subject Fills the subject field of the document Description bool pdf_set_info_subject int pdfdoc string subject This function is deprecate, use pdf_set_info instead. pdf_set_info_title Fills the title field of the document Description bool pdf_set_info_title int pdfdoc string title This function is deprecate, use pdf_set_info instead. pdf_set_leading Deprecated: Sets distance between text lines Description Deprecated. See also pdf_set_value, pdf_set_parameter Sets certain parameters Description void pdf_set_parameter int pdf object string key string value Set some PDFlib parameter with string type. pdf_set_text_pos Sets text position Description void pdf_set_text_pos int pdf object float x float y Set the text output position. pdf_set_text_rendering Deprecated: Determines how text is rendered Description Deprecated. See pdf_set_value, pdf_set_text_rise Deprecated: Sets the text rise Description Deprecated. See pdf_set_value, pdf_set_text_matrix Deprecated: Sets the text matrix Description See pdf_set_paramter. pdf_set_value Sets certain numerical value Description void pdf_set_value int pdf object string key float value Set the value of some PDFlib parameter with float type. pdf_set_word_spacing Depriciated: Sets spacing between words Description Deprecated. See also pdf_set_value, pdf_show Output text at current position Description void pdf_show int pdf object string text Print text in the current font and size at the current position. pdf_show_boxed Output text in a box Description int pdf_show_boxed int pdf object string text float left float top float width float height string hmode string feature Format text in the current font and size into the supplied text box according to the requested formatting mode, which must be one of "left", "right", "center", "justify", or "fulljustify". If width and height are 0, only a single line is placed at the point (left, top) in the requested mode. Returns the number of characters that did not fit in the specified box. Returns 0 if all characters fit or the width and height parameters were set to 0 for single-line formattting. pdf_show_xy Output text at given position Description void pdf_show_xy int pdf object string text float x float y Print text in the current font at (x, y). pdf_skew Skews the coordinate system Description void pdf_skew int pdf object float alpha float beta Skew the coordinate system in x and y direction by alpha and beta degrees. pdf_stringwidth Returns width of text using current font Description float pdf_stringwidth int pdf object string text int font float size Returns the width of text using the last font set by pdf_setfont. If the optional parameters font and size are specified, the width will be calculated using that font and size instead. Please note that font is a font handle returned by pdf_findfont. Both the font and size parameters must used together. See Also: pdf_setfont and pdf_findfont. pdf_stroke Draws line along path Description void pdf_stroke int pdf object Stroke the path with the current color and line width, and clear it. pdf_translate Sets origin of coordinate system Description void pdf_translate int pdf object float tx float ty Translate the origin of the coordinate system.