PDF functions PDFIntroduction
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 replacementsOld functionReplacementpdf_put_imageNot needed anymore.pdf_execute_imageNot needed anymore.pdf_get_annotationpdf_get_bookmark using the same
parameters.pdf_get_fontpdf_get_value passing
"font" as the second parameter.pdf_get_fontsizepdf_get_value passing
"fontsize" as the second parameter.pdf_get_fontnamepdf_get_parameter passing
"fontname" as the second parameter.pdf_set_info_creatorpdf_set_info passing
"Creator" as the second parameter.pdf_set_info_titlepdf_set_info passing
"Title" as the second parameter.pdf_set_info_subjectpdf_set_info passing
"Subject" as the second parameter.pdf_set_info_authorpdf_set_info passing
"Author" as the second parameter.pdf_set_info_keywordspdf_set_info passing
"Keywords" as the second parameter.pdf_set_leadingpdf_set_value passing
"leading" as the second parameter.pdf_set_text_renderingpdf_set_value passing
"textrendering" as the second parameter.pdf_set_text_risepdf_set_value passing
"textrise" as the second parameter.pdf_set_horiz_scalingpdf_set_value passing
"horizscaling" as the second parameter.pdf_set_text_matrixNot available anymorepdf_set_char_spacingpdf_set_value passing
"charspacing" as the second parameter.pdf_set_word_spacingpdf_set_value passing
"wordspacing" as the second parameter.pdf_set_transitionpdf_set_parameter passing
"transition" as the second parameter.pdf_openpdf_new plus an subsequent call
of pdf_open_filepdf_set_fontpdf_findfont plus an subsequent call
of pdf_setfontpdf_set_durationpdf_set_value passing
"duration" as the second parameter.pdf_open_gifpdf_open_image_file passing
"gif" as the second parameter.pdf_open_jpegpdf_open_image_file passing
"jpeg" as the second parameter.pdf_open_tiffpdf_open_image_file passing
"tiff" as the second parameter.pdf_open_pngpdf_open_image_file passing
"png" as the second parameter.pdf_get_image_widthpdf_get_value passing
"imagewidth" as the second parameter and the image
as the third parameter.pdf_get_image_heightpdf_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_annotationDeprecated: Adds annotationDescriptionpdf_add_outline is replaced by
pdf_add_note
See also pdf_add_note.
pdf_add_bookmarkAdds bookmark for current pageDescriptionint pdf_add_bookmarkint pdf objectstring textint parentint 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_launchlinkAdd a launch annotation for current pageDescriptionint pdf_add_launchlinkint pdf objectfloat llxfloat llyfloat urxfloat urystring filename
Add a launch annotation (to a target of arbitrary file type).
pdf_add_locallinkAdd a link annotation for current pageDescriptionint pdf_add_locallinkint pdf objectfloat llxfloat llyfloat urxfloat uryint pagestring dest
Add a link annotation to a target within the current PDF file.
pdf_add_noteAdd a note annotation for current pageDescriptionint pdf_add_noteint pdf objectfloat llxfloat llyfloat urxfloat urystring contentsstring titlestring iconint open
Add a note annotation. icon is one of of "comment, "insert", "note",
"paragraph", "newparagraph", "key", or "help".
pdf_add_outlineDeprecated: Adds bookmark for current pageDescription
Deprecated.
See pdf_add_bookmark.
pdf_add_pdflinkAdds file link annotation for current pageDescriptionint pdf_add_pdflinkint pdf objectfloat llxfloat llyfloat urxfloat urystring filenameint pagestring dest
Add a file link annotation (to a PDF target).
pdf_add_thumbnailAdds thumbnail for current pageDescriptionint pdf_add_thumbnailint pdf objectint image
Add an existing image as thumbnail for the current page.
pdf_add_weblinkAdds weblink for current pageDescriptionint pdf_add_weblinkint pdf objectfloat llxfloat llyfloat urxfloat urystring url
Add a weblink annotation to a target URL on the Web.
pdf_arcDraws an arc (counterclockwise)Descriptionvoid pdf_arcresource pdf objectfloat xfloat yfloat rfloat alphafloat beta
Draw a counterclockwise circular arc from alpha to beta degrees
See also: pdf_arcnpdf_arcnDraws an arc (clockwise)Descriptionvoid pdf_arcresource pdf objectfloat xfloat yfloat rfloat alphafloat beta
Draw a clockwise circular arc from alpha to beta degrees
See also: pdf_arcpdf_attach_fileAdds a file attachement for current pageDescriptionint pdf_attach_fileint pdf objectfloat llxfloat llyfloat urxfloat urystring filenamestring descriptionstring authorstring mimetypestring icon
Add a file attachment annotation. icon is one of "graph,
"paperclip", "pushpin", or "tag".
pdf_begin_pageStarts new pageDescriptionvoid pdf_begin_pageint pdf objectfloat widthfloat 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 PointsnamesizeA02380✗3368A11684✗2380A21190✗1684A3842✗1190A4595✗842A5421✗595A6297✗421B5501✗709letter (8.5"✗11")612✗792legal (8.5"✗14")612✗1008ledger (17"✗11")1224✗79211"✗17"792✗1224
pdf_begin_patternStarts new patternDescriptionint pdf_begin_patternint pdf objectfloat widthfloat heightfloat xstepfloat ystepint 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_templateStarts new templateDescriptionvoid pdf_begin_templateint pdf objectfloat widthfloat height
Start a new template definition.
pdf_circleDraws a circleDescriptionvoid pdf_circleint pdf objectfloat xfloat yfloat r
Draw a circle with center (x, y) and radius r.
pdf_clipClips to current pathDescriptionvoid pdf_clipint pdf object
Use the current path as clipping path.
pdf_closeCloses a pdf objectDescriptionvoid pdf_closeint pdf object
Close the generated PDF file, and free all document-related resources.
pdf_closepathCloses pathDescriptionvoid pdf_closepathint pdf object
Close the current path.
pdf_closepath_fill_strokeCloses, fills and strokes current pathDescriptionvoid pdf_closepath_fill_strokeint pdf object
Close the path, fill, and stroke it.
pdf_closepath_strokeCloses path and draws line along pathDescriptionvoid pdf_closepath_strokeint pdf object
Close the path, and stroke it.
pdf_close_imageCloses an imageDescriptionvoid pdf_close_imageint pdf objectint image
Close an image retrieved with one of the
pdf_open_image* functions.
pdf_close_pdi
Close the input PDF document
Descriptionvoid pdf_close_pdiint pdf objectint dochandle
Close all open page handles, and close the input PDF document.
pdf_close_pdi_page
Close the page handle
Descriptionvoid pdf_close_pdi_pageint pdf objectint pagehandle
Close the page handle, and free all page-related resources.
pdf_concatConcatenate a matrix to the CTMDescriptionvoid pdf_concatint pdf objectfloat afloat bfloat cfloat dfloat efloat f
Concatenate a matrix to the CTM.
pdf_continue_textOutputs text in next lineDescriptionvoid pdf_continue_textint pdf objectstring text
Print text at the next line. The spacing between lines is determined
by the leading parameter.
pdf_curvetoDraws a curveDescriptionvoid pdf_curvetoint pdf objectfloat x1float y1float x2float y2float x3float y3
Draw a Bezier curve from the current point, using 3 more control points.
pdf_deleteDeletes a PDF objectDescriptionvoid pdf_deleteint pdf object
Delete the PDF object, and free all internal resources.
pdf_end_pageEnds a pageDescriptionvoid pdf_end_pageint pdf object
Finish the page.
pdf_endpathDeprecated: Ends current pathDescription
Deprecated, use one of the stroke, fill, or clip functions instead.
pdf_end_patternFinish patternDescriptionvoid pdf_end_patternint pdf object
Finish the pattern definition.
pdf_end_templateFinish templateDescriptionvoid pdf_end_templateint pdf object
Finish the template definition.
pdf_fillFills current pathDescriptionvoid pdf_fill_strokeint pdf object
Fill the interior of the path with the current fill color.
pdf_fill_strokeFills and strokes current pathDescriptionvoid pdf_fill_strokeint pdf object
Fill and stroke the path with the current fill and stroke color.
pdf_findfontPrepare font for later use with pdf_setfont.Descriptionint pdf_findfontint pdf objectstring fontnamestring 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.
pdf_findfont example
]]>
pdf_get_bufferFetch the buffer containig the generated PDF data.Descriptionstring pdf_get_bufferint 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_fontDeprecated: font handlingDescription
Deprecated.
See pdf_get_value.
pdf_get_fontnameDeprecated: font handlingDescription
Deprecated.
See pdf_get_parameter.
pdf_get_fontsizeDeprecated: font handlingDescription
Deprecated.
See pdf_get_value.
pdf_get_image_heightReturns height of an imageDescriptionstring pdf_get_image_heightint pdf objectint imagepdf_get_image_height is deprecated,
use pdf_get_value instead.
pdf_get_image_widthReturns width of an imageDescriptionstring pdf_get_image_widthint pdf objectint image
The pdf_get_image_width is deprecated,
use pdf_get_value instead.
pdf_get_parameterGets certain parametersDescriptionstring pdf_get_parameterint pdf objectstring keyfloat modifier
Get the contents of some PDFlib parameter with string type.
pdf_get_pdi_parameterGet some PDI string parametersDescriptionstring pdf_get_pdi_parameterint pdf objectstring keyint docint pageint index
Get the contents of some PDI document parameter with string type.
pdf_get_pdi_valueGets some PDI numerical parametersDescriptionstring pdf_get_pdi_valueint pdf objectstring keyint docint pageint index
Get the contents of some PDI document parameter with numerical type.
pdf_get_majorversion
Returns the major version number of the PDFlib
Descriptionint pdf_get_majorversion
Returns the major version number of the PDFlib.
pdf_get_minorversion
Returns the minor version number of the PDFlib
Descriptionint pdf_get_majorversion
Returns the minor version number of the PDFlib.
pdf_get_valueGets certain numerical valueDescriptionfloat pdf_get_valueint pdf objectstring keyfloat modifier
Get the contents of some PDFlib parameter with float type.
pdf_initgraphicsResets graphic stateDescriptionvoid pdf_initgraphicsint pdf object
Reset all implicit color and graphics state parameters to their defaults.
pdf_linetoDraws a lineDescriptionvoid pdf_linetoint pdf objectfloat xfloat y
Draw a line from the current point to (x,
y).
pdf_makespotcolorMakes a spotcolorDescriptionvoid pdf_makespotcolorint pdf objectstring spotname
Make a named spot color from the current color.
pdf_movetoSets current pointDescriptionvoid pdf_movetoint pdf objectfloat xfloat 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_newCreates a new pdf objectDescriptionint pdf_new
Create a new PDF object, using default error handling
and memory management.
pdf_openDeprecated: Open a new pdf objectDescriptionpdf_open is deprecated, use
pdf_new plus pdf_open_file
instead.
See also pdf_new,
pdf_open_file.
pdf_open_CCITTOpens a new image file with raw CCITT dataDescriptionint pdf_open_CCITTint pdf objectstring filenameint widthint heightint BitReverseint kint Blackls1
Open a raw CCITT image.
pdf_open_fileOpens a new pdf objectDescriptionint pdf_open_fileint pdf objectstring 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_gifDeprecated: Opens a GIF imageDescription
Deprecated.
See pdf_open_image,
pdf_open_imageVersatile function for imagesDescriptionint pdf_open_imageint PDF-documentstring imagetypestring sourcestring datalong lengthint widthint heightint componentsint bpcstring 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_fileReads an image from a fileDescriptionint pdf_open_image_fileint PDF-documentstring imagetypestring filenamestring stringparamstring 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_jpegDeprecated: Opens a JPEG imageDescription
Deprecated.
See also pdf_open_image,
pdf_open_memory_imageOpens an image created with PHP's image functionsDescriptionint pdf_open_memory_imageint pdf objectint 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
Descriptionint pdf_open_pdiint pdf objectstring filenamestring stringparamint intparam
Open an existing PDF document for later use.
pdf_open_pdi_page
Prepare a page
Descriptionint pdf_open_pdi_pageint pdf objectint dochandleint pagenumberstring pagelabel
Prepare a page for later use with pdf_place_imagepdf_open_png
Deprecated: Opens a PNG image
Description
Deprecated.
See pdf_open_image.
pdf_open_tiffDeprecated: Opens a TIFF imageDescriptionint pdf_open_tiffint PDF-documentstring filename
Deprecated.
See also pdf_open_image,
pdf_place_imagePlaces an image on the pageDescriptionvoid pdf_place_imageint pdf objectint imagefloat xfloat yfloat scale
Place an image with the lower left corner at (x,
y), and scale it.
pdf_place_pdi_pagePlaces an image on the pageDescriptionvoid pdf_place_pdi_pageint pdf objectint pagefloat xfloat yfloat sxfloat sy
Place a PDF page with the lower left corner at (x,
y), and scale it.
pdf_rectDraws a rectangleDescriptionvoid pdf_rectint pdf objectfloat xfloat yfloat widthfloat height
Draw a rectangle at lower left (x, y) with width and height.
pdf_restoreRestores formerly saved environmentDescriptionvoid pdf_restoreint pdf object
Restore the most recently saved graphics state.
pdf_rotateSets rotationDescriptionvoid pdf_rotateint pdf objectfloat phi
Rotate the coordinate system by phi degrees.
pdf_saveSaves the current environmentDescriptionvoid pdf_saveint pdf object
Save the current graphics state.
pdf_scaleSets scalingDescriptionvoid pdf_scaleint pdf objectfloat x-scalefloat y-scale
Scale the coordinate system.
pdf_setcolorSets fill and stroke color to CMYK valuesDescriptionvoid pdf_setcolorint pdf objectstring typestring colorspacefloat c1float c2float c3float 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 spotc1 specifies
a spot color handles returned by pdf_makespotcolor
and c2 specifies a tint value between 0 and 1.
For patternc1 specifies
a pattern handle returned by pdf_begin_pattern.
pdf_setdashSets dash patternDescriptionvoid pdf_setdashint pdf objectfloat bfloat w
Set the current dash pattern to b black
and w white units.
pdf_setflatSets flatnessDescriptionvoid pdf_setflatint pdf objectfloat flatness
Set the flatness to a value between 0 and 100 inclusive.
pdf_setfontSet the current fontDescriptionvoid pdf_setfontint pdf objectint fontfloat size
Set the current font in the given size, using a
font handle returned by
pdf_findfont
See Also: pdf_findfont.
pdf_setgraySets drawing and filling color to gray valueDescriptionvoid pdf_setgrayint pdf objectfloat gray
Set the current fill and stroke color.
PDFlib V4.0: Deprecated, use pdf_setcolor instead.
pdf_setgray_fillSets filling color to gray valueDescriptionvoid pdf_setgray_fillint pdf objectfloat 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_strokeSets drawing color to gray valueDescriptionvoid pdf_setgray_strokeint pdf objectfloat gray
Set the current stroke color to a gray value between 0 and 1 inclusive
PDFlib V4.0: Deprecated, use pdf_setcolor instead.
pdf_setlinecapSets linecap parameterDescriptionvoid pdf_setlinecapint pdf objectint linecap
Set the linecap parameter to a value between 0 and 2 inclusive.
pdf_setlinejoinSets linejoin parameterDescriptionvoid pdf_setlinejoinint pdf objectlong linejoin
Set the line join parameter to a value between 0 and 2 inclusive.
pdf_setlinewidthSets line widthDescriptionvoid pdf_setlinewidthint pdf objectfloat width
Set the current linewidth to width.
pdf_setmatrixSets current transformation matrixDescriptionvoid pdf_setmatrixint pdf objectfloat afloat bfloat cfloat dfloat efloat f
Explicitly set the current transformation matrix.
pdf_setmiterlimitSets miter limitDescriptionvoid pdf_setmiterlimitint pdf objectfloat miter
Set the miter limit to a value greater than or equal to 1.
pdf_setpolydashSets complicated dash patternDescriptionvoid pdf_setpolydashint pdf objectfloat *dasharray
Set a more complicated dash pattern defined by an array.
pdf_setrgbcolorSets drawing and filling color to rgb color valueDescriptionvoid pdf_setrgbcolorint pdf objectfloat red valuefloat green valuefloat blue value
Set the current fill and stroke color to the supplied RGB values.
PDFlib V4.0: Deprecated, use pdf_setcolor instead.
pdf_setrgbcolor_fillSets filling color to rgb color valueDescriptionvoid pdf_setrgbcolor_fillint pdf objectfloat red valuefloat green valuefloat blue value
Set the current fill color to the supplied RGB values.
PDFlib V4.0: Deprecated, use pdf_setcolor instead.
pdf_setrgbcolor_strokeSets drawing color to rgb color valueDescriptionvoid pdf_setrgbcolor_strokeint pdf objectfloat red valuefloat green valuefloat blue value
Set the current stroke color to the supplied RGB values.
PDFlib V4.0: Deprecated, use pdf_setcolor instead.
pdf_set_border_colorSets color of border around links and annotationsDescriptionvoid pdf_set_border_colorint pdf objectfloat redfloat greenfloat blue
Set the border color for all kinds of annotations.
pdf_set_border_dashSets dash style of border around links and annotationsDescriptionvoid pdf_set_border_dashint pdf objectfloat blackfloat white
Set the border dash style for all kinds of annotations.
See pdf_setdash.
pdf_set_border_styleSets style of border around links and annotationsDescriptionvoid pdf_set_border_styleint pdf objectstring stylefloat width
Set the border style for all kinds of annotations.
style is "solid" or "dashed".
pdf_set_char_spacingDeprecated: Sets character spacingDescription
Deprecated.
See also pdf_set_value,
pdf_set_durationDeprecated: Sets duration between pagesDescription
Deprecated.
See pdf_set_value.
pdf_set_fontDeprecated: Selects a font face and sizeDescription
Deprecated. You should use pdf_findfont plus
pdf_setfont instead.
See pdf_findfont,
pdf_setfont.
pdf_set_horiz_scalingSets horizontal scaling of textDescriptionvoid pdf_set_horiz_scalingint pdf objectfloat scale
Deprecated.
See also pdf_set_value,
pdf_set_infoFills a field of the document informationDescriptionvoid pdf_set_infoint pdf objectstring keystring 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
Descriptionbool pdf_set_info_authorint pdfdocstring author
This function is deprecate, use pdf_set_info instead.
pdf_set_info_creator
Fills the creator field of the document
Descriptionbool pdf_set_info_creatorint pdfdocstring creator
This function is deprecate, use pdf_set_info instead.
pdf_set_info_keywords
Fills the keywords field of the document
Descriptionbool pdf_set_info_keywordsint pdfdocstring keywords
This function is deprecate, use pdf_set_info instead.
pdf_set_info_subject
Fills the subject field of the document
Descriptionbool pdf_set_info_subjectint pdfdocstring subject
This function is deprecate, use pdf_set_info instead.
pdf_set_info_title
Fills the title field of the document
Descriptionbool pdf_set_info_titleint pdfdocstring title
This function is deprecate, use pdf_set_info instead.
pdf_set_leadingDeprecated: Sets distance between text linesDescription
Deprecated.
See also pdf_set_value,
pdf_set_parameterSets certain parametersDescriptionvoid pdf_set_parameterint pdf objectstring keystring value
Set some PDFlib parameter with string type.
pdf_set_text_posSets text positionDescriptionvoid pdf_set_text_posint pdf objectfloat xfloat y
Set the text output position.
pdf_set_text_renderingDeprecated: Determines how text is renderedDescription
Deprecated.
See pdf_set_value,
pdf_set_text_riseDeprecated: Sets the text riseDescription
Deprecated.
See pdf_set_value,
pdf_set_text_matrixDeprecated: Sets the text matrixDescription
See pdf_set_paramter.
pdf_set_valueSets certain numerical valueDescriptionvoid pdf_set_valueint pdf objectstring keyfloat value
Set the value of some PDFlib parameter with float type.
pdf_set_word_spacingDepriciated: Sets spacing between wordsDescription
Deprecated.
See also pdf_set_value,
pdf_showOutput text at current positionDescriptionvoid pdf_showint pdf objectstring text
Print text in the current font and size at the current position.
pdf_show_boxedOutput text in a boxDescriptionint pdf_show_boxedint pdf objectstring textfloat leftfloat topfloat widthfloat heightstring hmodestring 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_xyOutput text at given positionDescriptionvoid pdf_show_xyint pdf objectstring textfloat xfloat y
Print text in the current font at (x, y).
pdf_skewSkews the coordinate systemDescriptionvoid pdf_skewint pdf objectfloat alphafloat beta
Skew the coordinate system in x and y direction by alpha and
beta degrees.
pdf_stringwidthReturns width of text using current fontDescriptionfloat pdf_stringwidthint pdf objectstring textint fontfloat 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_strokeDraws line along pathDescriptionvoid pdf_strokeint pdf object
Stroke the path with the current color and line width, and clear it.
pdf_translateSets origin of coordinate systemDescriptionvoid pdf_translateint pdf objectfloat txfloat ty
Translate the origin of the coordinate system.