classes-TCPDF

It appears that you are using AdBlocking software. The cost of running this website is covered by advertisements. If you like it please feel free to a small amount of money to secure the future of this website.

    TCPDF

    in package

    Tags
    class

    TCPDF PHP class for generating PDF documents without requiring external extensions. TCPDF project (http://www.tcpdf.org) has been originally derived in 2002 from the Public Domain FPDF class by Olivier Plathey (http://www.fpdf.org), but now is almost entirely rewritten.

    brief

    PHP class for generating PDF documents without requiring external extensions.

    version
    6.7.4
    author

    Nicola Asuni - info@tecnick.com

    IgnoreAnnotation

    ("protected")

    IgnoreAnnotation

    ("public")

    IgnoreAnnotation

    ("pre")

    Table of Contents

    Methods

    __construct()  : mixed
    This is the class constructor.
    __destruct()  : mixed
    Default destructor.
    _destroy()  : mixed
    Unset all class variables except the following critical variables.
    _putshaders()  : mixed
    Output gradient shaders.
    AcceptPageBreak()  : bool
    Whenever a page break condition is met, the method is called, and the break is issued or not depending on the returned value.
    addEmptySignatureAppearance()  : mixed
    Add an empty digital signature appearance (a cliccable rectangle area to get signature properties)
    AddFont()  : array<string|int, mixed>|false
    Imports a TrueType, Type1, core, or CID0 font and makes it available.
    addHtmlLink()  : int
    Output anchor link.
    addHTMLTOC()  : mixed
    Output a Table Of Content Index (TOC) using HTML templates.
    addJavascriptObject()  : int
    Adds a javascript object and return object ID
    AddLink()  : mixed
    Creates a new internal link and returns its identifier. An internal link is a clickable area which directs to another place within the document.<br /> The identifier can then be passed to Cell(), Write(), Image() or Link(). The destination is defined with SetLink().
    AddPage()  : mixed
    Adds a new page to the document. If a page is already present, the Footer() method is called first to output the footer (if enabled). Then the page is added, the current position set to the top-left corner according to the left and top margins (or top-right if in RTL mode), and Header() is called to display the header (if enabled).
    addPageRegion()  : mixed
    Add a single no-write region on selected page.
    AddSpotColor()  : mixed
    Defines a new spot color.
    addTOC()  : mixed
    Output a Table of Content Index (TOC).
    addTOCPage()  : mixed
    Adds a new TOC (Table Of Content) page to the document.
    Annotation()  : mixed
    Puts a markup annotation on a rectangular area of the page.
    Arrow()  : mixed
    Draws a grahic arrow.
    Bookmark()  : mixed
    Adds a bookmark.
    Button()  : mixed
    Creates a button field
    Cell()  : mixed
    Prints a cell (rectangular area) with optional borders, background color and character string. The upper-left corner of the cell corresponds to the current position. The text can be aligned or centered. After the call, the current position moves to the right or to the next line. It is possible to put a link on the text.<br /> If automatic page breaking is enabled and the cell goes beyond the limit, a page break is done before outputting.
    CheckBox()  : mixed
    Creates a CheckBox field
    Circle()  : mixed
    Draws a circle.
    Close()  : mixed
    Terminates the PDF document.
    colorRegistrationBar()  : mixed
    Paints color transition registration bars
    ComboBox()  : mixed
    Creates a Combo-box field
    commitTransaction()  : mixed
    Delete the copy of the current TCPDF object used for undo operation.
    CoonsPatchMesh()  : mixed
    Paints a coons patch mesh.
    copyPage()  : bool
    Clone the specified page to a new page.
    cropMark()  : mixed
    Paints crop marks.
    Curve()  : mixed
    Draws a Bezier curve.
    deletePage()  : bool
    Remove the specified page.
    Ellipse()  : mixed
    Draws an ellipse.
    endLayer()  : mixed
    End the current PDF layer.
    endPage()  : mixed
    Terminate the current page
    endTemplate()  : string|false
    End the current XObject Template started with startTemplate() and restore the previous graphic state.
    endTOCPage()  : mixed
    Terminate the current TOC (Table Of Content) page
    Error()  : mixed
    Throw an exception or print an error message and die if the K_TCPDF_PARSER_THROW_EXCEPTION_ERROR constant is set to true.
    fixHTMLCode()  : string
    Cleanup HTML code (requires HTML Tidy library).
    Footer()  : mixed
    This method is used to render the page footer.
    getAbsFontMeasure()  : float
    Convert a relative font measure into absolute value.
    GetAbsX()  : float
    Returns the absolute X value of current position.
    getAliasNbPages()  : string
    Returns the string alias used for the total number of pages.
    getAliasNumPage()  : string
    Returns the string alias used for the page number.
    getAliasRightShift()  : string
    Returns the string alias used right align page numbers.
    getAllSpotColors()  : array<string|int, mixed>
    Returns the array of spot colors.
    getAlpha()  : array<string, bool|string>
    Get the alpha mode array (CA, ca, BM, AIS).
    GetArrStringWidth()  : array<string|int, float>|float
    Returns the string length of an array of chars in user unit or an array of characters widths. A font must be selected.<br>
    getAutoPageBreak()  : bool
    Return the auto-page-break mode (true or false).
    getBarcode()  : string
    Get current barcode.
    getBreakMargin()  : int|float
    Returns the page break margin.
    getCellHeight()  : float
    Return the cell height
    getCellHeightRatio()  : float
    return the height of cell repect font height.
    getCellMargins()  : array<string|int, mixed>
    Get the internal Cell margin array.
    getCellPaddings()  : array<string|int, mixed>
    Get the internal Cell padding array.
    getCharBBox()  : false|array<string|int, mixed>
    Returns the glyph bounding box of the specified character in the current font in user units.
    GetCharWidth()  : float
    Returns the length of the char in user unit for the current font considering current stretching and spacing (tracking).
    getColumn()  : int
    Return the current column number
    getCSSBorderMargin()  : array<string|int, mixed>
    Get the border-spacing from CSS attribute.
    getCSSMargin()  : array<string|int, mixed>
    Get the internal Cell margin from CSS attribute.
    getCSSPadding()  : array<string|int, mixed>
    Get the internal Cell padding from CSS attribute.
    getDestination()  : array<string|int, mixed>
    Return the Named Destination array.
    getDocCreationTimestamp()  : int
    Returns document creation timestamp in seconds.
    getDocModificationTimestamp()  : int
    Returns document modification timestamp in seconds.
    getFontAscent()  : int
    Return the font ascent value.
    getFontBBox()  : array<string|int, mixed>
    Returns the bounding box of the current font in user units.
    getFontDescent()  : int
    Return the font descent value
    getFontFamily()  : string
    Returns the current font family name.
    getFontFamilyName()  : string
    Return normalized font name
    getFontSize()  : float
    Returns the current font size.
    getFontSizePt()  : int
    Returns the current font size in points unit.
    getFontSpacing()  : int
    Get the amount to increase or decrease the space between characters in a text.
    getFontStretching()  : float
    Get the percentage of character stretching.
    getFontStyle()  : string
    Returns the current font style.
    getFontSubsetting()  : bool
    Return the default option for font subsetting.
    getFooterFont()  : array<int, string|float|null>
    Get Footer font.
    getFooterMargin()  : float
    Returns footer margin in user units.
    getFormDefaultProp()  : array<string|int, mixed>
    Return the default properties for form fields.
    getGroupPageNo()  : int
    Return the current page in the group.
    getGroupPageNoFormatted()  : mixed
    Returns the current group page number formatted as a string.
    getHeaderData()  : array<string, mixed>
    Returns header data: <ul><li>$ret['logo'] = logo image</li><li>$ret['logo_width'] = width of the image logo in user units</li><li>$ret['title'] = header title</li><li>$ret['string'] = header description string</li></ul>
    getHeaderFont()  : array<int, string|float|null>
    Get header font.
    getHeaderMargin()  : float
    Returns header margin in user units.
    getHTMLFontUnits()  : float
    Convert HTML string containing font size value to points
    getHTMLUnitToUnits()  : float
    Convert HTML string containing value and unit of measure to user's units or points.
    getImageRBX()  : float
    Return the right-bottom (or left-bottom for RTL) corner X coordinate of last inserted image
    getImageRBY()  : float
    Return the right-bottom (or left-bottom for RTL) corner Y coordinate of last inserted image
    getImageScale()  : float
    Returns the adjusting factor to convert pixels to user units.
    getLastH()  : float
    Get the last cell height.
    GetLineWidth()  : int
    Returns the current the line width.
    getMargins()  : array<string|int, mixed>
    Returns an array containing current margins: <ul> <li>$ret['left'] = left margin</li> <li>$ret['right'] = right margin</li> <li>$ret['top'] = top margin</li> <li>$ret['bottom'] = bottom margin</li> <li>$ret['header'] = header margin</li> <li>$ret['footer'] = footer margin</li> <li>$ret['cell'] = cell padding array</li> <li>$ret['padding_left'] = cell left padding</li> <li>$ret['padding_top'] = cell top padding</li> <li>$ret['padding_right'] = cell right padding</li> <li>$ret['padding_bottom'] = cell bottom padding</li> </ul>
    getNumberOfColumns()  : int
    Return the current number of columns.
    GetNumChars()  : int
    Returns the numbero of characters in a string.
    getNumLines()  : float
    This method return the estimated number of lines for print a simple text string using Multicell() method.
    getNumPages()  : int
    Get the total number of insered pages.
    getOriginalMargins()  : array<string|int, mixed>
    Returns an array containing original margins: <ul> <li>$ret['left'] = left margin</li> <li>$ret['right'] = right margin</li> </ul>
    getOverprint()  : array<string, bool|int>
    Get the overprint mode array (OP, op, OPM).
    getPage()  : int
    Get current document page number.
    getPageDimensions()  : array<string|int, mixed>
    Returns an array of page dimensions: <ul><li>$this->pagedim[$this->page]['w'] = page width in points</li><li>$this->pagedim[$this->page]['h'] = height in points</li><li>$this->pagedim[$this->page]['wk'] = page width in user units</li><li>$this->pagedim[$this->page]['hk'] = page height in user units</li><li>$this->pagedim[$this->page]['tm'] = top margin</li><li>$this->pagedim[$this->page]['bm'] = bottom margin</li><li>$this->pagedim[$this->page]['lm'] = left margin</li><li>$this->pagedim[$this->page]['rm'] = right margin</li><li>$this->pagedim[$this->page]['pb'] = auto page break</li><li>$this->pagedim[$this->page]['or'] = page orientation</li><li>$this->pagedim[$this->page]['olm'] = original left margin</li><li>$this->pagedim[$this->page]['orm'] = original right margin</li><li>$this->pagedim[$this->page]['Rotate'] = The number of degrees by which the page shall be rotated clockwise when displayed or printed. The value shall be a multiple of 90.</li><li>$this->pagedim[$this->page]['PZ'] = The page's preferred zoom (magnification) factor.</li><li>$this->pagedim[$this->page]['trans'] : the style and duration of the visual transition to use when moving from another page to the given page during a presentation<ul><li>$this->pagedim[$this->page]['trans']['Dur'] = The page's display duration (also called its advance timing): the maximum length of time, in seconds, that the page shall be displayed during presentations before the viewer application shall automatically advance to the next page.</li><li>$this->pagedim[$this->page]['trans']['S'] = transition style : Split, Blinds, Box, Wipe, Dissolve, Glitter, R, Fly, Push, Cover, Uncover, Fade</li><li>$this->pagedim[$this->page]['trans']['D'] = The duration of the transition effect, in seconds.</li><li>$this->pagedim[$this->page]['trans']['Dm'] = (Split and Blinds transition styles only) The dimension in which the specified transition effect shall occur: H = Horizontal, V = Vertical. Default value: H.</li><li>$this->pagedim[$this->page]['trans']['M'] = (Split, Box and Fly transition styles only) The direction of motion for the specified transition effect: I = Inward from the edges of the page, O = Outward from the center of the pageDefault value: I.</li><li>$this->pagedim[$this->page]['trans']['Di'] = (Wipe, Glitter, Fly, Cover, Uncover and Push transition styles only) The direction in which the specified transition effect shall moves, expressed in degrees counterclockwise starting from a left-to-right direction. If the value is a number, it shall be one of: 0 = Left to right, 90 = Bottom to top (Wipe only), 180 = Right to left (Wipe only), 270 = Top to bottom, 315 = Top-left to bottom-right (Glitter only). If the value is a name, it shall be None, which is relevant only for the Fly transition when the value of SS is not 1.0. Default value: 0.</li><li>$this->pagedim[$this->page]['trans']['SS'] = (Fly transition style only) The starting or ending scale at which the changes shall be drawn. If M specifies an inward transition, the scale of the changes drawn shall progress from SS to 1.0 over the course of the transition. If M specifies an outward transition, the scale of the changes drawn shall progress from 1.0 to SS over the course of the transition. Default: 1.0. </li><li>$this->pagedim[$this->page]['trans']['B'] = (Fly transition style only) If true, the area that shall be flown in is rectangular and opaque. Default: false.</li></ul></li><li>$this->pagedim[$this->page]['MediaBox'] : the boundaries of the physical medium on which the page shall be displayed or printed<ul><li>$this->pagedim[$this->page]['MediaBox']['llx'] = lower-left x coordinate in points</li><li>$this->pagedim[$this->page]['MediaBox']['lly'] = lower-left y coordinate in points</li><li>$this->pagedim[$this->page]['MediaBox']['urx'] = upper-right x coordinate in points</li><li>$this->pagedim[$this->page]['MediaBox']['ury'] = upper-right y coordinate in points</li></ul></li><li>$this->pagedim[$this->page]['CropBox'] : the visible region of default user space<ul><li>$this->pagedim[$this->page]['CropBox']['llx'] = lower-left x coordinate in points</li><li>$this->pagedim[$this->page]['CropBox']['lly'] = lower-left y coordinate in points</li><li>$this->pagedim[$this->page]['CropBox']['urx'] = upper-right x coordinate in points</li><li>$this->pagedim[$this->page]['CropBox']['ury'] = upper-right y coordinate in points</li></ul></li><li>$this->pagedim[$this->page]['BleedBox'] : the region to which the contents of the page shall be clipped when output in a production environment<ul><li>$this->pagedim[$this->page]['BleedBox']['llx'] = lower-left x coordinate in points</li><li>$this->pagedim[$this->page]['BleedBox']['lly'] = lower-left y coordinate in points</li><li>$this->pagedim[$this->page]['BleedBox']['urx'] = upper-right x coordinate in points</li><li>$this->pagedim[$this->page]['BleedBox']['ury'] = upper-right y coordinate in points</li></ul></li><li>$this->pagedim[$this->page]['TrimBox'] : the intended dimensions of the finished page after trimming<ul><li>$this->pagedim[$this->page]['TrimBox']['llx'] = lower-left x coordinate in points</li><li>$this->pagedim[$this->page]['TrimBox']['lly'] = lower-left y coordinate in points</li><li>$this->pagedim[$this->page]['TrimBox']['urx'] = upper-right x coordinate in points</li><li>$this->pagedim[$this->page]['TrimBox']['ury'] = upper-right y coordinate in points</li></ul></li><li>$this->pagedim[$this->page]['ArtBox'] : the extent of the page's meaningful content<ul><li>$this->pagedim[$this->page]['ArtBox']['llx'] = lower-left x coordinate in points</li><li>$this->pagedim[$this->page]['ArtBox']['lly'] = lower-left y coordinate in points</li><li>$this->pagedim[$this->page]['ArtBox']['urx'] = upper-right x coordinate in points</li><li>$this->pagedim[$this->page]['ArtBox']['ury'] = upper-right y coordinate in points</li></ul></li></ul>
    getPageGroupAlias()  : string
    Return the alias for the total number of pages in the current page group.
    getPageHeight()  : int|float
    Returns the page height in units.
    getPageNumGroupAlias()  : string
    Return the alias for the page number on the current page group.
    getPageRegions()  : array<string|int, mixed>
    Return an array of no-write page regions
    getPageWidth()  : int|float
    Returns the page width in units.
    getPDFData()  : mixed
    Returns the PDF data.
    getRawCharWidth()  : float
    Returns the length of the char in user unit for the current font.
    getRTL()  : bool
    Return the RTL status
    getScaleFactor()  : int
    Returns the scale factor (number of points in user unit).
    getStringHeight()  : float
    This method return the estimated height needed for printing a simple text string using the Multicell() method.
    GetStringWidth()  : array<string|int, float>|float
    Returns the length of a string in user unit. A font must be selected.<br>
    getTextShadow()  : array<string|int, mixed>
    Return the text shadow parameters array.
    GetX()  : float
    Returns the relative X value of current position.
    GetY()  : float
    Returns the ordinate of the current position.
    Gradient()  : mixed
    Output gradient.
    Header()  : mixed
    This method is used to render the page header.
    hyphenateText()  : string
    Returns text with soft hyphens.
    Image()  : mixed|false
    Puts an image in the page.
    ImageEps()  : mixed
    Embed vector-based Adobe Illustrator (AI) or AI-compatible EPS files.
    ImageSVG()  : mixed
    Embedd a Scalable Vector Graphics (SVG) image.
    IncludeJS()  : mixed
    Adds a javascript
    isCharDefined()  : bool
    Return true in the character is present in the specified font.
    isRTLTextDir()  : bool
    Return the current temporary RTL status
    isUnicodeFont()  : bool
    Return true if the current font is unicode type.
    lastPage()  : mixed
    Reset pointer to the last document page.
    Line()  : mixed
    Draws a line between two points.
    LinearGradient()  : mixed
    Paints a linear colour gradient.
    Link()  : mixed
    Puts a link on a rectangular area of the page.
    ListBox()  : mixed
    Creates a List-box field
    Ln()  : mixed
    Performs a line break.
    MirrorH()  : mixed
    Horizontal Mirroring.
    MirrorL()  : mixed
    Reflection against a straight line through point (x, y) with the gradient angle (angle).
    MirrorP()  : mixed
    Point reflection mirroring.
    MirrorV()  : mixed
    Verical Mirroring.
    movePage()  : bool
    Move a page to a previous position.
    MultiCell()  : int
    This method allows printing text with line breaks.
    Open()  : mixed
    This method begins the generation of the PDF document.
    Output()  : string
    Send the document to a given destination: string, local file or browser.
    PageNo()  : int
    Returns the current page number.
    PageNoFormatted()  : mixed
    Returns the current page number formatted as a string.
    PieSector()  : mixed
    Draw the sector of a circle.
    PieSectorXY()  : mixed
    Draw the sector of an ellipse.
    pixelsToUnits()  : float
    Converts pixels to User's Units.
    Polycurve()  : mixed
    Draws a poly-Bezier curve.
    Polygon()  : mixed
    Draws a polygon.
    PolyLine()  : mixed
    Draws a polygonal line
    printTemplate()  : mixed
    Print an XObject Template.
    RadialGradient()  : mixed
    Paints a radial colour gradient.
    RadioButton()  : mixed
    Creates a RadioButton field.
    Rect()  : mixed
    Draws a rectangle.
    registrationMark()  : mixed
    Paints a registration mark
    registrationMarkCMYK()  : mixed
    Paints a CMYK registration mark
    RegularPolygon()  : mixed
    Draws a regular polygon.
    removePageRegion()  : mixed
    Remove a single no-write region.
    replaceMissingChars()  : string
    Replace missing font characters on selected font with specified substitutions.
    resetColumns()  : mixed
    Remove columns and reset page margins.
    resetHeaderTemplate()  : mixed
    Reset the xobject template used by Header() method.
    resetLastH()  : mixed
    Reset the last cell height.
    rollbackTransaction()  : TCPDF
    This method allows to undo the latest transaction by returning the latest saved TCPDF object with startTransaction().
    Rotate()  : mixed
    Rotate object.
    RoundedRect()  : mixed
    Draws a rounded rectangle.
    RoundedRectXY()  : mixed
    Draws a rounded rectangle.
    Scale()  : mixed
    Vertical and horizontal non-proportional Scaling.
    ScaleX()  : mixed
    Horizontal Scaling.
    ScaleXY()  : mixed
    Vertical and horizontal proportional Scaling.
    ScaleY()  : mixed
    Vertical Scaling.
    selectColumn()  : mixed
    Set position at a given column
    serializeTCPDFtag()  : string
    Serialize data to be used with TCPDF tag in HTML code.
    setAbsX()  : mixed
    Set the absolute X coordinate of the current pointer.
    setAbsXY()  : mixed
    Set the absolute X and Y coordinates of the current pointer.
    setAbsY()  : mixed
    Set the absolute Y coordinate of the current pointer.
    setAllowLocalFiles()  : mixed
    Whether to allow local file path in image html tags, when prefixed with file://
    setAlpha()  : mixed
    Set alpha for stroking (CA) and non-stroking (ca) operations.
    setAuthor()  : mixed
    Defines the author of the document.
    setAutoPageBreak()  : mixed
    Enables or disables the automatic page breaking mode. When enabling, the second parameter is the distance from the bottom of the page that defines the triggering limit. By default, the mode is on and the margin is 2 cm.
    setBarcode()  : mixed
    Set document barcode.
    setBooklet()  : mixed
    Set the booklet mode for double-sided pages.
    setBookmark()  : mixed
    Adds a bookmark - alias for Bookmark().
    setCellHeightRatio()  : mixed
    Set the height of the cell (line height) respect the font height.
    setCellMargins()  : mixed
    Set the internal Cell margins.
    setCellPadding()  : mixed
    Set the same internal Cell padding for top, right, bottom, left-
    setCellPaddings()  : mixed
    Set the internal Cell paddings.
    setColor()  : string
    Defines the color used by the specified type ('draw', 'fill', 'text').
    setColorArray()  : string
    Set the color array for the specified type ('draw', 'fill', 'text').
    setColumnsArray()  : mixed
    Set columns array.
    setCompression()  : mixed
    Activates or deactivates page compression. When activated, the internal representation of each page is compressed, which leads to a compression ratio of about 2 for the resulting document. Compression is on by default.
    setCreator()  : mixed
    Defines the creator of the document. This is typically the name of the application that generates the PDF.
    setDefaultMonospacedFont()  : mixed
    Defines the default monospaced font.
    setDefaultTableColumns()  : mixed
    Set the default number of columns in a row for HTML tables.
    setDestination()  : string|false
    Add a Named Destination.
    setDisplayMode()  : mixed
    Defines the way the document is to be displayed by the viewer.
    setDocCreationTimestamp()  : mixed
    Set the document creation timestamp
    setDocInfoUnicode()  : mixed
    Turn on/off Unicode mode for document information dictionary (meta tags).
    setDocModificationTimestamp()  : mixed
    Set the document modification timestamp
    setDrawColor()  : string
    Defines the color used for all drawing operations (lines, rectangles and cell borders). It can be expressed in RGB components or gray scale. The method can be called before the first page is created and the value is retained from page to page.
    setDrawColorArray()  : string
    Defines the color used for all drawing operations (lines, rectangles and cell borders).
    setDrawSpotColor()  : mixed
    Defines the spot color used for all drawing operations (lines, rectangles and cell borders).
    setEqualColumns()  : mixed
    Set multiple columns of the same size
    setExtraXMP()  : mixed
    Set additional XMP data to be added on the default XMP data just before the end of "x:xmpmeta" tag.
    setExtraXMPRDF()  : mixed
    Set additional XMP data to be added on the default XMP data just before the end of "rdf:RDF" tag.
    setFillColor()  : string
    Defines the color used for all filling operations (filled rectangles and cell backgrounds). It can be expressed in RGB components or gray scale. The method can be called before the first page is created and the value is retained from page to page.
    setFillColorArray()  : mixed
    Defines the color used for all filling operations (filled rectangles and cell backgrounds).
    setFillSpotColor()  : mixed
    Defines the spot color used for all filling operations (filled rectangles and cell backgrounds).
    setFont()  : mixed
    Sets the font used to print character strings.
    setFontSize()  : mixed
    Defines the size of the current font.
    setFontSpacing()  : mixed
    Set the amount to increase or decrease the space between characters in a text.
    setFontStretching()  : mixed
    Set the percentage of character stretching.
    setFontSubsetting()  : mixed
    Enable or disable default option for font subsetting.
    setFooterData()  : mixed
    Set footer data.
    setFooterFont()  : mixed
    Set footer font.
    setFooterMargin()  : mixed
    Set footer margin.
    setFormDefaultProp()  : mixed
    Set default properties for form fields.
    setHeaderData()  : mixed
    Set header data.
    setHeaderFont()  : mixed
    Set header font.
    setHeaderMargin()  : mixed
    Set header margin.
    setHeaderTemplateAutoreset()  : mixed
    Set a flag to automatically reset the xobject template used by Header() method at each page.
    setHtmlLinksStyle()  : mixed
    Set the color and font style for HTML links.
    setHtmlVSpace()  : mixed
    Set the vertical spaces for HTML tags.
    setImageScale()  : mixed
    Set the adjusting factor to convert pixels to user units.
    setJPEGQuality()  : mixed
    Set the default JPEG compression quality (1-100)
    setKeywords()  : mixed
    Associates keywords with the document, generally in the form 'keyword1 keyword2 ...'.
    setLanguageArray()  : mixed
    Set language array.
    setLastH()  : mixed
    Set the last cell height.
    setLeftMargin()  : mixed
    Defines the left margin. The method can be called before creating the first page. If the current abscissa gets out of page, it is brought back to the margin.
    setLineStyle()  : string
    Set line style.
    setLineWidth()  : mixed
    Defines the line width. By default, the value equals 0.2 mm. The method can be called before the first page is created and the value is retained from page to page.
    setLink()  : mixed
    Defines the page and position a link points to.
    setListIndentWidth()  : mixed
    Set custom width for list indentation.
    setLIsymbol()  : mixed
    Set the default bullet to be used as LI bullet symbol
    setMargins()  : mixed
    Defines the left, top and right margins.
    setOpenCell()  : mixed
    Set the top/bottom cell sides to be open or closed when the cell cross the page.
    setOverprint()  : mixed
    Set overprint mode for stroking (OP) and non-stroking (op) painting operations.
    setPage()  : mixed
    Move pointer at the specified document page and update page dimensions.
    setPageMark()  : mixed
    Set start-writing mark on current page stream used to put borders and fills.
    setPageOrientation()  : mixed
    Set page orientation.
    setPageRegions()  : mixed
    Set no-write regions on page.
    setPageUnit()  : mixed
    Set the units of measure for the document.
    setPDFVersion()  : mixed
    Set the PDF version (check PDF reference for valid values).
    setPrintFooter()  : mixed
    Set a flag to print page footer.
    setPrintHeader()  : mixed
    Set a flag to print page header.
    setProtection()  : mixed
    Set document protection Remark: the protection against modification is for people who have the full Acrobat product.
    setRasterizeVectorImages()  : mixed
    Enable/disable rasterization of vector images using ImageMagick library.
    setRightMargin()  : mixed
    Defines the right margin. The method can be called before creating the first page.
    setRTL()  : mixed
    Enable or disable Right-To-Left language mode
    setSignature()  : mixed
    Enable document signature (requires the OpenSSL Library).
    setSignatureAppearance()  : mixed
    Set the digital signature appearance (a cliccable rectangle area to get signature properties)
    setSpacesRE()  : mixed
    Set regular expression to detect withespaces or word separators.
    setSpotColor()  : string
    Set the spot color for the specified type ('draw', 'fill', 'text').
    setSRGBmode()  : mixed
    Set flag to force sRGB_IEC61966-2.1 black scaled ICC color profile for the whole document.
    setStartingPageNumber()  : mixed
    Set the starting page number.
    setSubject()  : mixed
    Defines the subject of the document.
    setTempRTL()  : mixed
    Force temporary RTL language direction
    setTextColor()  : string
    Defines the color used for text. It can be expressed in RGB components or gray scale. The method can be called before the first page is created and the value is retained from page to page.
    setTextColorArray()  : mixed
    Defines the color used for text. It can be expressed in RGB components or gray scale.
    setTextRenderingMode()  : mixed
    Set Text rendering mode.
    setTextShadow()  : mixed
    Set parameters for drop shadow effect for text.
    setTextSpotColor()  : mixed
    Defines the spot color used for text.
    setTimeStamp()  : mixed
    Enable document timestamping (requires the OpenSSL Library).
    setTitle()  : mixed
    Defines the title of the document.
    setTopMargin()  : mixed
    Defines the top margin. The method can be called before creating the first page.
    setUserRights()  : mixed
    Set User's Rights for PDF Reader WARNING: This is experimental and currently do not work.
    setViewerPreferences()  : mixed
    Set the viewer preferences dictionary controlling the way the document is to be presented on the screen or in print.
    setVisibility()  : mixed
    Set the visibility of the successive elements.
    setX()  : mixed
    Defines the abscissa of the current position.
    setXY()  : mixed
    Defines the abscissa and ordinate of the current position.
    setY()  : mixed
    Moves the current abscissa back to the left margin and sets the ordinate.
    Skew()  : mixed
    Skew.
    SkewX()  : mixed
    Skew horizontally.
    SkewY()  : mixed
    Skew vertically.
    StarPolygon()  : mixed
    Draws a star polygon
    startLayer()  : mixed
    Start a new pdf layer.
    startPage()  : mixed
    Starts a new page to the document. The page must be closed using the endPage() function.
    startPageGroup()  : mixed
    Create a new page group.
    startTemplate()  : string|false
    Start a new XObject Template.
    startTransaction()  : mixed
    Stores a copy of the current TCPDF object used for undo operation.
    StartTransform()  : mixed
    Starts a 2D tranformation saving current graphic state.
    StopTransform()  : mixed
    Stops a 2D tranformation restoring previous graphic state.
    stringLeftTrim()  : string
    Left trim the input string
    stringRightTrim()  : string
    Right trim the input string
    stringTrim()  : string
    Trim the input string
    Text()  : mixed
    Prints a text cell at the specified position.
    TextField()  : mixed
    Creates a text field
    Translate()  : mixed
    Translate graphic object horizontally and vertically.
    TranslateX()  : mixed
    Translate graphic object horizontally.
    TranslateY()  : mixed
    Translate graphic object vertically.
    unhtmlentities()  : string
    Reverse function for htmlentities.
    Write()  : mixed
    This method prints text from the current position.<br />
    write1DBarcode()  : mixed
    Print a Linear Barcode.
    write2DBarcode()  : mixed
    Print 2D Barcode.
    writeHTML()  : mixed
    Allows to preserve some HTML formatting (limited support).<br /> IMPORTANT: The HTML must be well formatted - try to clean-up it using an application like HTML-Tidy before submitting.
    writeHTMLCell()  : mixed
    Prints a cell (rectangular area) with optional borders, background color and html text string.

    Methods

    __construct()

    This is the class constructor.

    public __construct([string $orientation = 'P' ][, string $unit = 'mm' ][, mixed $format = 'A4' ][, bool $unicode = true ][, string $encoding = 'UTF-8' ][, bool $diskcache = false ][, false|int $pdfa = false ]) : mixed

    It allows to set up the page format, the orientation and the measure unit used in all the methods (except for the font sizes).

    Parameters
    $orientation : string = 'P'

    page orientation. Possible values are (case insensitive):

    • P or Portrait (default)
    • L or Landscape
    • '' (empty string) for automatic orientation
    $unit : string = 'mm'

    User measure unit. Possible values are:

    • pt: point
    • mm: millimeter (default)
    • cm: centimeter
    • in: inch

    A point equals 1/72 of inch, that is to say about 0.35 mm (an inch being 2.54 cm). This is a very common unit in typography; font sizes are expressed in that unit.
    $format : mixed = 'A4'

    The format used for pages. It can be either: one of the string values specified at getPageSizeFromFormat() or an array of parameters specified at setPageFormat().

    $unicode : bool = true

    TRUE means that the input text is unicode (default = true)

    $encoding : string = 'UTF-8'

    Charset encoding (used only when converting back html entities); default is UTF-8.

    $diskcache : bool = false

    DEPRECATED FEATURE

    $pdfa : false|int = false

    If not false, set the document to PDF/A mode and the good version (1 or 3).

    Tags
    public
    see

    getPageSizeFromFormat(), setPageFormat()

    __destruct()

    Default destructor.

    public __destruct() : mixed
    Tags
    public
    since
    1.53.0.TC016

    _destroy()

    Unset all class variables except the following critical variables.

    public _destroy([bool $destroyall = false ][, bool $preserve_objcopy = false ]) : mixed
    Parameters
    $destroyall : bool = false

    if true destroys all class variables, otherwise preserves critical variables.

    $preserve_objcopy : bool = false

    if true preserves the objcopy variable

    Tags
    public
    since
    4.5.016

    (2009-02-24)

    _putshaders()

    Output gradient shaders.

    public _putshaders() : mixed
    Tags
    author

    Nicola Asuni

    since
    3.1.000

    (2008-06-09)

    protected

    AcceptPageBreak()

    Whenever a page break condition is met, the method is called, and the break is issued or not depending on the returned value.

    public AcceptPageBreak() : bool

    The default implementation returns a value according to the mode selected by SetAutoPageBreak().
    This method is called automatically and should not be called directly by the application.

    Tags
    public
    since
    1.4
    see
    SetAutoPageBreak()
    Return values
    bool

    addEmptySignatureAppearance()

    Add an empty digital signature appearance (a cliccable rectangle area to get signature properties)

    public addEmptySignatureAppearance([float $x = 0 ][, float $y = 0 ][, float $w = 0 ][, float $h = 0 ][, int $page = -1 ][, string $name = '' ]) : mixed
    Parameters
    $x : float = 0

    Abscissa of the upper-left corner.

    $y : float = 0

    Ordinate of the upper-left corner.

    $w : float = 0

    Width of the signature area.

    $h : float = 0

    Height of the signature area.

    $page : int = -1

    option page number (if < 0 the current page is used).

    $name : string = ''

    Name of the signature.

    Tags
    public
    author

    Nicola Asuni

    since
    5.9.101

    (2011-07-06)

    AddFont()

    Imports a TrueType, Type1, core, or CID0 font and makes it available.

    public AddFont(string $family[, string $style = '' ][, string $fontfile = '' ][, mixed $subset = 'default' ]) : array<string|int, mixed>|false

    It is necessary to generate a font definition file first (read /fonts/utils/README.TXT). The definition file (and the font file itself when embedding) must be present either in the current directory or in the one indicated by K_PATH_FONTS if the constant is defined. If it could not be found, the error "Could not include font definition file" is generated.

    Parameters
    $family : string

    Font family. The name can be chosen arbitrarily. If it is a standard family name, it will override the corresponding font.

    $style : string = ''

    Font style. Possible values are (case insensitive):

    • empty string: regular (default)
    • B: bold
    • I: italic
    • BI or IB: bold italic
    $fontfile : string = ''

    The font definition file. By default, the name is built from the family and style, in lower case with no spaces.

    $subset : mixed = 'default'

    if true embedd only a subset of the font (stores only the information related to the used characters); if false embedd full font; if 'default' uses the default value set using setFontSubsetting(). This option is valid only for TrueTypeUnicode fonts. If you want to enable users to change the document, set this parameter to false. If you subset the font, the person who receives your PDF would need to have your same font in order to make changes to your PDF. The file size of the PDF would also be smaller because you are embedding only part of a font.

    Tags
    public
    since
    1.5
    see

    SetFont(), setFontSubsetting()

    Return values
    array<string|int, mixed>|false

    array containing the font data, or false in case of error.

    Output anchor link.

    public addHtmlLink(string $url, string $name[, bool $fill = false ][, bool $firstline = false ][, array<string|int, mixed>|null $color = null ][, string $style = -1 ][, bool $firstblock = false ]) : int
    Parameters
    $url : string

    link URL or internal link (i.e.: <a href="#23,4.5">link to page 23 at 4.5 Y position</a>)

    $name : string

    link name

    $fill : bool = false

    Indicates if the cell background must be painted (true) or transparent (false).

    $firstline : bool = false

    if true prints only the first line and return the remaining string.

    $color : array<string|int, mixed>|null = null

    array of RGB text color

    $style : string = -1

    font style (U, D, B, I)

    $firstblock : bool = false

    if true the string is the starting of a line.

    Tags
    public
    Return values
    int

    the number of cells used or the remaining text if $firstline = true;

    addHTMLTOC()

    Output a Table Of Content Index (TOC) using HTML templates.

    public addHTMLTOC([int|null $page = null ][, string $toc_name = 'TOC' ][, array<string|int, mixed> $templates = array() ][, bool $correct_align = true ][, string $style = '' ][, array<string|int, mixed> $color = array(0, 0, 0) ]) : mixed

    This method must be called after all Bookmarks were set. Before calling this method you have to open the page using the addTOCPage() method. After calling this method you have to call endTOCPage() to close the TOC page.

    Parameters
    $page : int|null = null

    page number where this TOC should be inserted (leave empty for current page).

    $toc_name : string = 'TOC'

    name to use for TOC bookmark.

    $templates : array<string|int, mixed> = array()

    array of html templates. Use: "#TOC_DESCRIPTION#" for bookmark title, "#TOC_PAGE_NUMBER#" for page number.

    $correct_align : bool = true

    if true correct the number alignment (numbers must be in monospaced font like courier and right aligned on LTR, or left aligned on RTL)

    $style : string = ''

    Font style for title: B = Bold, I = Italic, BI = Bold + Italic.

    $color : array<string|int, mixed> = array(0, 0, 0)

    RGB color array for title (values from 0 to 255).

    Tags
    public
    author

    Nicola Asuni

    since
    5.0.001

    (2010-05-06)

    see

    addTOCPage(), endTOCPage(), addTOC()

    addJavascriptObject()

    Adds a javascript object and return object ID

    public addJavascriptObject(string $script[, bool $onload = false ]) : int
    Parameters
    $script : string

    Javascript code

    $onload : bool = false

    if true executes this object when opening the document

    Tags
    public
    author

    Nicola Asuni

    since
    4.8.000

    (2009-09-07)

    Return values
    int

    internal object ID

    Creates a new internal link and returns its identifier. An internal link is a clickable area which directs to another place within the document.<br /> The identifier can then be passed to Cell(), Write(), Image() or Link(). The destination is defined with SetLink().

    public AddLink() : mixed
    Tags
    public
    since
    1.5
    see

    Cell(), Write(), Image(), Link(), SetLink()

    AddPage()

    Adds a new page to the document. If a page is already present, the Footer() method is called first to output the footer (if enabled). Then the page is added, the current position set to the top-left corner according to the left and top margins (or top-right if in RTL mode), and Header() is called to display the header (if enabled).

    public AddPage([string $orientation = '' ][, mixed $format = '' ][, bool $keepmargins = false ][, bool $tocpage = false ]) : mixed

    The origin of the coordinate system is at the top-left corner (or top-right for RTL) and increasing ordinates go downwards.

    Parameters
    $orientation : string = ''

    page orientation. Possible values are (case insensitive):

    • P or PORTRAIT (default)
    • L or LANDSCAPE
    $format : mixed = ''

    The format used for pages. It can be either: one of the string values specified at getPageSizeFromFormat() or an array of parameters specified at setPageFormat().

    $keepmargins : bool = false

    if true overwrites the default page margins with the current margins

    $tocpage : bool = false

    if true set the tocpage state to true (the added page will be used to display Table Of Content).

    Tags
    public
    since
    1.0
    see

    startPage(), endPage(), addTOCPage(), endTOCPage(), getPageSizeFromFormat(), setPageFormat()

    addPageRegion()

    Add a single no-write region on selected page.

    public addPageRegion(array<string|int, mixed> $region) : mixed

    A no-write region is a portion of the page with a rectangular or trapezium shape that will not be covered when writing text or html code. A region is always aligned on the left or right side of the page ad is defined using a vertical segment. You can set multiple regions for the same page.

    Parameters
    $region : array<string|int, mixed>

    array of a single no-write region array: ('page' => page number or empy for current page, 'xt' => X top, 'yt' => Y top, 'xb' => X bottom, 'yb' => Y bottom, 'side' => page side 'L' = left or 'R' = right).

    Tags
    author

    Nicola Asuni

    public
    since
    5.9.003

    (2010-10-13)

    see

    setPageRegions(), getPageRegions()

    AddSpotColor()

    Defines a new spot color.

    public AddSpotColor(string $name, float $c, float $m, float $y, float $k) : mixed

    It can be expressed in RGB components or gray scale. The method can be called before the first page is created and the value is retained from page to page.

    Parameters
    $name : string

    Full name of the spot color.

    $c : float

    Cyan color for CMYK. Value between 0 and 100.

    $m : float

    Magenta color for CMYK. Value between 0 and 100.

    $y : float

    Yellow color for CMYK. Value between 0 and 100.

    $k : float

    Key (Black) color for CMYK. Value between 0 and 100.

    Tags
    public
    since
    4.0.024

    (2008-09-12)

    see

    SetDrawSpotColor(), SetFillSpotColor(), SetTextSpotColor()

    addTOC()

    Output a Table of Content Index (TOC).

    public addTOC([int|null $page = null ][, string $numbersfont = '' ][, string $filler = '.' ][, string $toc_name = 'TOC' ][, string $style = '' ][, array<string|int, mixed> $color = array(0, 0, 0) ]) : mixed

    This method must be called after all Bookmarks were set. Before calling this method you have to open the page using the addTOCPage() method. After calling this method you have to call endTOCPage() to close the TOC page. You can override this method to achieve different styles.

    Parameters
    $page : int|null = null

    page number where this TOC should be inserted (leave empty for current page).

    $numbersfont : string = ''

    set the font for page numbers (please use monospaced font for better alignment).

    $filler : string = '.'

    string used to fill the space between text and page number.

    $toc_name : string = 'TOC'

    name to use for TOC bookmark.

    $style : string = ''

    Font style for title: B = Bold, I = Italic, BI = Bold + Italic.

    $color : array<string|int, mixed> = array(0, 0, 0)

    RGB color array for bookmark title (values from 0 to 255).

    Tags
    public
    author

    Nicola Asuni

    since
    4.5.000

    (2009-01-02)

    see

    addTOCPage(), endTOCPage(), addHTMLTOC()

    addTOCPage()

    Adds a new TOC (Table Of Content) page to the document.

    public addTOCPage([string $orientation = '' ][, mixed $format = '' ][, bool $keepmargins = false ]) : mixed
    Parameters
    $orientation : string = ''

    page orientation.

    $format : mixed = ''

    The format used for pages. It can be either: one of the string values specified at getPageSizeFromFormat() or an array of parameters specified at setPageFormat().

    $keepmargins : bool = false

    if true overwrites the default page margins with the current margins

    Tags
    public
    since
    5.0.001

    (2010-05-06)

    see

    AddPage(), startPage(), endPage(), endTOCPage()

    Annotation()

    Puts a markup annotation on a rectangular area of the page.

    public Annotation(float $x, float $y, float $w, float $h, string $text[, array<string|int, mixed> $opt = array('Subtype' => 'Text') ][, int $spaces = 0 ]) : mixed

    !!!!THE ANNOTATION SUPPORT IS NOT YET FULLY IMPLEMENTED !!!!

    Parameters
    $x : float

    Abscissa of the upper-left corner of the rectangle

    $y : float

    Ordinate of the upper-left corner of the rectangle

    $w : float

    Width of the rectangle

    $h : float

    Height of the rectangle

    $text : string

    annotation text or alternate content

    $opt : array<string|int, mixed> = array('Subtype' => 'Text')

    array of options (see section 8.4 of PDF reference 1.7).

    $spaces : int = 0

    number of spaces on the text to link

    Tags
    public
    since
    4.0.018

    (2008-08-06)

    Arrow()

    Draws a grahic arrow.

    public Arrow(float $x0, float $y0, float $x1, float $y1[, int $head_style = 0 ][, float $arm_size = 5 ][, int $arm_angle = 15 ]) : mixed
    Parameters
    $x0 : float

    Abscissa of first point.

    $y0 : float

    Ordinate of first point.

    $x1 : float

    Abscissa of second point.

    $y1 : float

    Ordinate of second point.

    $head_style : int = 0

    (0 = draw only arrowhead arms, 1 = draw closed arrowhead, but no fill, 2 = closed and filled arrowhead, 3 = filled arrowhead)

    $arm_size : float = 5

    length of arrowhead arms

    $arm_angle : int = 15

    angle between an arm and the shaft

    Tags
    author

    Piotr Galecki, Nicola Asuni, Andy Meier

    since
    4.6.018

    (2009-07-10)

    Bookmark()

    Adds a bookmark.

    public Bookmark(string $txt[, int $level = 0 ][, float $y = -1 ][, int|string $page = '' ][, string $style = '' ][, array<string|int, mixed> $color = array(0, 0, 0) ][, float $x = -1 ][, mixed $link = '' ]) : mixed
    Parameters
    $txt : string

    Bookmark description.

    $level : int = 0

    Bookmark level (minimum value is 0).

    $y : float = -1

    Y position in user units of the bookmark on the selected page (default = -1 = current position; 0 = page start;).

    $page : int|string = ''

    Target page number (leave empty for current page). If you prefix a page number with the * character, then this page will not be changed when adding/deleting/moving pages.

    $style : string = ''

    Font style: B = Bold, I = Italic, BI = Bold + Italic.

    $color : array<string|int, mixed> = array(0, 0, 0)

    RGB color array (values from 0 to 255).

    $x : float = -1

    X position in user units of the bookmark on the selected page (default = -1 = current position;).

    $link : mixed = ''

    URL, or numerical link ID, or named destination (# character followed by the destination name), or embedded file (* character followed by the file name).

    Tags
    public
    since
    2.1.002

    (2008-02-12)

    Button()

    Creates a button field

    public Button(string $name, int $w, int $h, string $caption, mixed $action[, array<string|int, mixed> $prop = array() ][, array<string|int, mixed> $opt = array() ][, float|null $x = null ][, float|null $y = null ][, bool $js = false ]) : mixed
    Parameters
    $name : string

    field name

    $w : int

    width

    $h : int

    height

    $caption : string

    caption.

    $action : mixed

    action triggered by pressing the button. Use a string to specify a javascript action. Use an array to specify a form action options as on section 12.7.5 of PDF32000_2008.

    $prop : array<string|int, mixed> = array()

    javascript field properties. Possible values are described on official Javascript for Acrobat API reference.

    $opt : array<string|int, mixed> = array()

    annotation parameters. Possible values are described on official PDF32000_2008 reference.

    $x : float|null = null

    Abscissa of the upper-left corner of the rectangle

    $y : float|null = null

    Ordinate of the upper-left corner of the rectangle

    $js : bool = false

    if true put the field using JavaScript (requires Acrobat Writer to be rendered).

    Tags
    public
    author

    Nicola Asuni

    since
    4.8.000

    (2009-09-07)

    Cell()

    Prints a cell (rectangular area) with optional borders, background color and character string. The upper-left corner of the cell corresponds to the current position. The text can be aligned or centered. After the call, the current position moves to the right or to the next line. It is possible to put a link on the text.<br /> If automatic page breaking is enabled and the cell goes beyond the limit, a page break is done before outputting.

    public Cell(float $w[, float $h = 0 ][, string $txt = '' ][, mixed $border = 0 ][, int $ln = 0 ][, string $align = '' ][, bool $fill = false ][, mixed $link = '' ][, int $stretch = 0 ][, bool $ignore_min_height = false ][, string $calign = 'T' ][, string $valign = 'M' ]) : mixed
    Parameters
    $w : float

    Cell width. If 0, the cell extends up to the right margin.

    $h : float = 0

    Cell height. Default value: 0.

    $txt : string = ''

    String to print. Default value: empty string.

    $border : mixed = 0

    Indicates if borders must be drawn around the cell. The value can be a number:

    • 0: no border (default)
    • 1: frame
    or a string containing some or all of the following characters (in any order):
    • L: left
    • T: top
    • R: right
    • B: bottom
    or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)))
    $ln : int = 0

    Indicates where the current position should go after the call. Possible values are:

    • 0: to the right (or left for RTL languages)
    • 1: to the beginning of the next line
    • 2: below
    Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: 0.
    $align : string = ''

    Allows to center or align the text. Possible values are:

    • L or empty string: left align (default value)
    • C: center
    • R: right align
    • J: justify
    $fill : bool = false

    Indicates if the cell background must be painted (true) or transparent (false).

    $link : mixed = ''

    URL or identifier returned by AddLink().

    $stretch : int = 0

    font stretch mode:

    • 0 = disabled
    • 1 = horizontal scaling only if text is larger than cell width
    • 2 = forced horizontal scaling to fit cell width
    • 3 = character spacing only if text is larger than cell width
    • 4 = forced character spacing to fit cell width
    General font stretching and scaling values will be preserved when possible.
    $ignore_min_height : bool = false

    if true ignore automatic minimum height value.

    $calign : string = 'T'

    cell vertical alignment relative to the specified Y value. Possible values are:

    • T : cell top
    • C : center
    • B : cell bottom
    • A : font top
    • L : font baseline
    • D : font bottom
    $valign : string = 'M'

    text vertical alignment inside the cell. Possible values are:

    • T : top
    • C : center
    • B : bottom
    Tags
    public
    since
    1.0
    see

    SetFont(), SetDrawColor(), SetFillColor(), SetTextColor(), SetLineWidth(), AddLink(), Ln(), MultiCell(), Write(), SetAutoPageBreak()

    CheckBox()

    Creates a CheckBox field

    public CheckBox(string $name, int $w[, bool $checked = false ][, array<string|int, mixed> $prop = array() ][, array<string|int, mixed> $opt = array() ][, string $onvalue = 'Yes' ][, float|null $x = null ][, float|null $y = null ][, bool $js = false ]) : mixed
    Parameters
    $name : string

    field name

    $w : int

    width

    $checked : bool = false

    define the initial state.

    $prop : array<string|int, mixed> = array()

    javascript field properties. Possible values are described on official Javascript for Acrobat API reference.

    $opt : array<string|int, mixed> = array()

    annotation parameters. Possible values are described on official PDF32000_2008 reference.

    $onvalue : string = 'Yes'

    value to be returned if selected.

    $x : float|null = null

    Abscissa of the upper-left corner of the rectangle

    $y : float|null = null

    Ordinate of the upper-left corner of the rectangle

    $js : bool = false

    if true put the field using JavaScript (requires Acrobat Writer to be rendered).

    Tags
    public
    author

    Nicola Asuni

    since
    4.8.000

    (2009-09-07)

    Circle()

    Draws a circle.

    public Circle(float $x0, float $y0, float $r[, float $angstr = 0 ][, float $angend = 360 ][, string $style = '' ][, array<string|int, mixed> $line_style = array() ][, array<string|int, mixed> $fill_color = array() ][, int $nc = 2 ]) : mixed

    A circle is formed from n Bezier curves.

    Parameters
    $x0 : float

    Abscissa of center point.

    $y0 : float

    Ordinate of center point.

    $r : float

    Radius.

    $angstr : float = 0

    Angle start of draw line. Default value: 0.

    $angend : float = 360

    Angle finish of draw line. Default value: 360.

    $style : string = ''

    Style of rendering. See the getPathPaintOperator() function for more information.

    $line_style : array<string|int, mixed> = array()

    Line style of circle. Array like for SetLineStyle(). Default value: default line style (empty array).

    $fill_color : array<string|int, mixed> = array()

    Fill color. Format: array(red, green, blue). Default value: default color (empty array).

    $nc : int = 2

    Number of curves used to draw a 90 degrees portion of circle.

    Tags
    public
    since
    2.1.000

    (2008-01-08)

    Close()

    Terminates the PDF document.

    public Close() : mixed

    It is not necessary to call this method explicitly because Output() does it automatically. If the document contains no page, AddPage() is called to prevent from getting an invalid document.

    Tags
    public
    since
    1.0
    see

    Open(), Output()

    colorRegistrationBar()

    Paints color transition registration bars

    public colorRegistrationBar(float $x, float $y, float $w, float $h[, bool $transition = true ][, bool $vertical = false ][, string $colors = 'A,R,G,B,C,M,Y,K' ]) : mixed
    Parameters
    $x : float

    abscissa of the top left corner of the rectangle.

    $y : float

    ordinate of the top left corner of the rectangle.

    $w : float

    width of the rectangle.

    $h : float

    height of the rectangle.

    $transition : bool = true

    if true prints tcolor transitions to white.

    $vertical : bool = false

    if true prints bar vertically.

    $colors : string = 'A,R,G,B,C,M,Y,K'

    colors to print separated by comma. Valid values are: A,W,R,G,B,C,M,Y,K,RGB,CMYK,ALL,ALLSPOT,<SPOT_COLOR_NAME>. Where: A = grayscale black, W = grayscale white, R = RGB red, G RGB green, B RGB blue, C = CMYK cyan, M = CMYK magenta, Y = CMYK yellow, K = CMYK key/black, RGB = RGB registration color, CMYK = CMYK registration color, ALL = Spot registration color, ALLSPOT = print all defined spot colors, <SPOT_COLOR_NAME> = name of the spot color to print.

    Tags
    author

    Nicola Asuni

    since
    4.9.000

    (2010-03-26)

    public

    ComboBox()

    Creates a Combo-box field

    public ComboBox(string $name, int $w, int $h, array<string|int, mixed> $values[, array<string|int, mixed> $prop = array() ][, array<string|int, mixed> $opt = array() ][, float|null $x = null ][, float|null $y = null ][, bool $js = false ]) : mixed
    Parameters
    $name : string

    field name

    $w : int

    width

    $h : int

    height

    $values : array<string|int, mixed>

    array containing the list of values.

    $prop : array<string|int, mixed> = array()

    javascript field properties. Possible values are described on official Javascript for Acrobat API reference.

    $opt : array<string|int, mixed> = array()

    annotation parameters. Possible values are described on official PDF32000_2008 reference.

    $x : float|null = null

    Abscissa of the upper-left corner of the rectangle

    $y : float|null = null

    Ordinate of the upper-left corner of the rectangle

    $js : bool = false

    if true put the field using JavaScript (requires Acrobat Writer to be rendered).

    Tags
    public
    author

    Nicola Asuni

    since
    4.8.000

    (2009-09-07)

    commitTransaction()

    Delete the copy of the current TCPDF object used for undo operation.

    public commitTransaction() : mixed
    Tags
    public
    since
    4.5.029

    (2009-03-19)

    CoonsPatchMesh()

    Paints a coons patch mesh.

    public CoonsPatchMesh(float $x, float $y, float $w, float $h[, array<string|int, mixed> $col1 = array() ][, array<string|int, mixed> $col2 = array() ][, array<string|int, mixed> $col3 = array() ][, array<string|int, mixed> $col4 = array() ][, array<string|int, mixed> $coords = array(0.0, 0.0, 0.33, 0.0, 0.67, 0.0, 1.0, 0.0, 1.0, 0.33, 1.0, 0.67, 1.0, 1.0, 0.67, 1.0, 0.33, 1.0, 0.0, 1.0, 0.0, 0.67, 0.0, 0.33) ][, array<string|int, mixed> $coords_min = 0 ][, array<string|int, mixed> $coords_max = 1 ][, bool $antialias = false ]) : mixed
    Parameters
    $x : float

    abscissa of the top left corner of the rectangle.

    $y : float

    ordinate of the top left corner of the rectangle.

    $w : float

    width of the rectangle.

    $h : float

    height of the rectangle.

    $col1 : array<string|int, mixed> = array()

    first color (lower left corner) (RGB components).

    $col2 : array<string|int, mixed> = array()

    second color (lower right corner) (RGB components).

    $col3 : array<string|int, mixed> = array()

    third color (upper right corner) (RGB components).

    $col4 : array<string|int, mixed> = array()

    fourth color (upper left corner) (RGB components).

    $coords : array<string|int, mixed> = array(0.0, 0.0, 0.33, 0.0, 0.67, 0.0, 1.0, 0.0, 1.0, 0.33, 1.0, 0.67, 1.0, 1.0, 0.67, 1.0, 0.33, 1.0, 0.0, 1.0, 0.0, 0.67, 0.0, 0.33)
    • for one patch mesh: array(float x1, float y1, .... float x12, float y12): 12 pairs of coordinates (normally from 0 to 1) which specify the Bezier control points that define the patch. First pair is the lower left edge point, next is its right control point (control point 2). Then the other points are defined in the order: control point 1, edge point, control point 2 going counter-clockwise around the patch. Last (x12, y12) is the first edge point's left control point (control point 1).
    • for two or more patch meshes: array[number of patches]: arrays with the following keys for each patch: f: where to put that patch (0 = first patch, 1, 2, 3 = right, top and left of precedent patch - I didn't figure this out completely - just try and error ;-) points: 12 pairs of coordinates of the Bezier control points as above for the first patch, 8 pairs of coordinates for the following patches, ignoring the coordinates already defined by the precedent patch (I also didn't figure out the order of these - also: try and see what's happening) colors: must be 4 colors for the first patch, 2 colors for the following patches
    $coords_min : array<string|int, mixed> = 0

    minimum value used by the coordinates. If a coordinate's value is smaller than this it will be cut to coords_min. default: 0

    $coords_max : array<string|int, mixed> = 1

    maximum value used by the coordinates. If a coordinate's value is greater than this it will be cut to coords_max. default: 1

    $antialias : bool = false

    A flag indicating whether to filter the shading function to prevent aliasing artifacts.

    Tags
    author

    Andreas W\FCrmser, Nicola Asuni

    since
    3.1.000

    (2008-06-09)

    public

    copyPage()

    Clone the specified page to a new page.

    public copyPage([int $page = 0 ]) : bool
    Parameters
    $page : int = 0

    number of page to copy (0 = current page)

    Tags
    public
    since
    4.9.015

    (2010-04-20)

    Return values
    bool

    true in case of success, false in case of error.

    cropMark()

    Paints crop marks.

    public cropMark(float $x, float $y, float $w, float $h[, string $type = 'T,R,B,L' ][, array<string|int, mixed> $color = array(100, 100, 100, 100, 'All') ]) : mixed
    Parameters
    $x : float

    abscissa of the crop mark center.

    $y : float

    ordinate of the crop mark center.

    $w : float

    width of the crop mark.

    $h : float

    height of the crop mark.

    $type : string = 'T,R,B,L'

    type of crop mark, one symbol per type separated by comma: T = TOP, F = BOTTOM, L = LEFT, R = RIGHT, TL = A = TOP-LEFT, TR = B = TOP-RIGHT, BL = C = BOTTOM-LEFT, BR = D = BOTTOM-RIGHT.

    $color : array<string|int, mixed> = array(100, 100, 100, 100, 'All')

    crop mark color (default spot registration color).

    Tags
    author

    Nicola Asuni

    since
    4.9.000

    (2010-03-26)

    public

    Curve()

    Draws a Bezier curve.

    public Curve(float $x0, float $y0, float $x1, float $y1, float $x2, float $y2, float $x3, float $y3[, string $style = '' ][, array<string|int, mixed> $line_style = array() ][, array<string|int, mixed> $fill_color = array() ]) : mixed

    The Bezier curve is a tangent to the line between the control points at either end of the curve.

    Parameters
    $x0 : float

    Abscissa of start point.

    $y0 : float

    Ordinate of start point.

    $x1 : float

    Abscissa of control point 1.

    $y1 : float

    Ordinate of control point 1.

    $x2 : float

    Abscissa of control point 2.

    $y2 : float

    Ordinate of control point 2.

    $x3 : float

    Abscissa of end point.

    $y3 : float

    Ordinate of end point.

    $style : string = ''

    Style of rendering. See the getPathPaintOperator() function for more information.

    $line_style : array<string|int, mixed> = array()

    Line style of curve. Array like for SetLineStyle(). Default value: default line style (empty array).

    $fill_color : array<string|int, mixed> = array()

    Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K) or array(C,M,Y,K,SpotColorName). Default value: default color (empty array).

    Tags
    public
    see
    SetLineStyle()
    since
    2.1.000

    (2008-01-08)

    deletePage()

    Remove the specified page.

    public deletePage(int $page) : bool
    Parameters
    $page : int

    page to remove

    Tags
    public
    since
    4.6.004

    (2009-04-23)

    Return values
    bool

    true in case of success, false in case of error.

    Ellipse()

    Draws an ellipse.

    public Ellipse(float $x0, float $y0, float $rx[, float $ry = 0 ][, float $angle = 0 ][, float $astart = 0 ][, float $afinish = 360 ][, string $style = '' ][, array<string|int, mixed> $line_style = array() ][, array<string|int, mixed> $fill_color = array() ][, int $nc = 2 ]) : mixed

    An ellipse is formed from n Bezier curves.

    Parameters
    $x0 : float

    Abscissa of center point.

    $y0 : float

    Ordinate of center point.

    $rx : float

    Horizontal radius.

    $ry : float = 0

    Vertical radius (if ry = 0 then is a circle, see Circle()). Default value: 0.

    $angle : float = 0

    Angle oriented (anti-clockwise). Default value: 0.

    $astart : float = 0

    Angle start of draw line. Default value: 0.

    $afinish : float = 360

    Angle finish of draw line. Default value: 360.

    $style : string = ''

    Style of rendering. See the getPathPaintOperator() function for more information.

    $line_style : array<string|int, mixed> = array()

    Line style of ellipse. Array like for SetLineStyle(). Default value: default line style (empty array).

    $fill_color : array<string|int, mixed> = array()

    Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K) or array(C,M,Y,K,SpotColorName). Default value: default color (empty array).

    $nc : int = 2

    Number of curves used to draw a 90 degrees portion of ellipse.

    Tags
    author

    Nicola Asuni

    public
    since
    2.1.000

    (2008-01-08)

    endLayer()

    End the current PDF layer.

    public endLayer() : mixed
    Tags
    public
    since
    5.9.102

    (2011-07-13)

    endPage()

    Terminate the current page

    public endPage([bool $tocpage = false ]) : mixed
    Parameters
    $tocpage : bool = false

    if true set the tocpage state to false (end the page used to display Table Of Content).

    Tags
    public
    since
    4.2.010

    (2008-11-14)

    see

    AddPage(), startPage(), addTOCPage(), endTOCPage()

    endTemplate()

    End the current XObject Template started with startTemplate() and restore the previous graphic state.

    public endTemplate() : string|false

    An XObject Template is a PDF block that is a self-contained description of any sequence of graphics objects (including path objects, text objects, and sampled images). An XObject Template may be painted multiple times, either on several pages or at several locations on the same page and produces the same results each time, subject only to the graphics state at the time it is invoked.

    Tags
    author

    Nicola Asuni

    public
    since
    5.8.017

    (2010-08-24)

    see

    startTemplate(), printTemplate()

    Return values
    string|false

    the XObject Template ID in case of success or false in case of error.

    endTOCPage()

    Terminate the current TOC (Table Of Content) page

    public endTOCPage() : mixed
    Tags
    public
    since
    5.0.001

    (2010-05-06)

    see

    AddPage(), startPage(), endPage(), addTOCPage()

    Error()

    Throw an exception or print an error message and die if the K_TCPDF_PARSER_THROW_EXCEPTION_ERROR constant is set to true.

    public Error(string $msg) : mixed
    Parameters
    $msg : string

    The error message

    Tags
    public
    since
    1.0

    fixHTMLCode()

    Cleanup HTML code (requires HTML Tidy library).

    public fixHTMLCode(string $html[, string $default_css = '' ][, array<string|int, mixed>|null $tagvs = null ][, array<string|int, mixed>|null $tidy_options = null ]) : string
    Parameters
    $html : string

    htmlcode to fix

    $default_css : string = ''

    CSS commands to add

    $tagvs : array<string|int, mixed>|null = null

    parameters for setHtmlVSpace method

    $tidy_options : array<string|int, mixed>|null = null

    options for tidy_parse_string function

    Tags
    author

    Nicola Asuni

    public
    since
    5.9.017

    (2010-11-16)

    see
    setHtmlVSpace()
    Return values
    string

    XHTML code cleaned up

    This method is used to render the page footer.

    public Footer() : mixed

    It is automatically called by AddPage() and could be overwritten in your own inherited class.

    Tags
    public

    getAbsFontMeasure()

    Convert a relative font measure into absolute value.

    public getAbsFontMeasure(int $s) : float
    Parameters
    $s : int

    Font measure.

    Tags
    since
    5.9.186

    (2012-09-13)

    Return values
    float

    Absolute measure.

    GetAbsX()

    Returns the absolute X value of current position.

    public GetAbsX() : float
    Tags
    public
    since
    1.2
    see

    SetX(), GetY(), SetY()

    Return values
    float

    getAliasNbPages()

    Returns the string alias used for the total number of pages.

    public getAliasNbPages() : string

    If the current font is unicode type, the returned string is surrounded by additional curly braces. This alias will be replaced by the total number of pages in the document.

    Tags
    since
    4.0.018

    (2008-08-08)

    public
    Return values
    string

    getAliasNumPage()

    Returns the string alias used for the page number.

    public getAliasNumPage() : string

    If the current font is unicode type, the returned string is surrounded by additional curly braces. This alias will be replaced by the page number.

    Tags
    since
    4.5.000

    (2009-01-02)

    public
    Return values
    string

    getAliasRightShift()

    Returns the string alias used right align page numbers.

    public getAliasRightShift() : string

    If the current font is unicode type, the returned string wil contain an additional open curly brace.

    Tags
    since
    5.9.099

    (2011-06-27)

    public
    Return values
    string

    getAllSpotColors()

    Returns the array of spot colors.

    public getAllSpotColors() : array<string|int, mixed>
    Tags
    public
    since
    6.0.038

    (2013-09-30)

    Return values
    array<string|int, mixed>

    Spot colors array.

    getAlpha()

    Get the alpha mode array (CA, ca, BM, AIS).

    public getAlpha() : array<string, bool|string>

    (Check the "Entries in a Graphics State Parameter Dictionary" on PDF 32000-1:2008).

    Tags
    public
    since
    5.9.152

    (2012-03-23)

    Return values
    array<string, bool|string>

    GetArrStringWidth()

    Returns the string length of an array of chars in user unit or an array of characters widths. A font must be selected.<br>

    public GetArrStringWidth(array<string|int, mixed> $sa[, string $fontname = '' ][, string $fontstyle = '' ][, float $fontsize = 0 ][, bool $getarray = false ]) : array<string|int, float>|float
    Parameters
    $sa : array<string|int, mixed>

    The array of chars whose total length is to be computed

    $fontname : string = ''

    Family font. It can be either a name defined by AddFont() or one of the standard families. It is also possible to pass an empty string, in that case, the current family is retained.

    $fontstyle : string = ''

    Font style. Possible values are (case insensitive):

    • empty string: regular
    • B: bold
    • I: italic
    • U: underline
    • D: line through
    • O: overline
    or any combination. The default value is regular.
    $fontsize : float = 0

    Font size in points. The default value is the current size.

    $getarray : bool = false

    if true returns an array of characters widths, if false returns the total length.

    Tags
    phpstan-return

    ($getarray is true ? float[] : float) total string length or array of characted widths

    author

    Nicola Asuni

    public
    since
    2.4.000

    (2008-03-06)

    Return values
    array<string|int, float>|float

    total string length or array of characted widths

    getAutoPageBreak()

    Return the auto-page-break mode (true or false).

    public getAutoPageBreak() : bool
    Tags
    public
    since
    5.9.088
    Return values
    bool

    auto-page-break mode

    getBarcode()

    Get current barcode.

    public getBarcode() : string
    Tags
    public
    since
    4.0.012

    (2008-07-24)

    Return values
    string

    getBreakMargin()

    Returns the page break margin.

    public getBreakMargin([int|null $pagenum = null ]) : int|float
    Parameters
    $pagenum : int|null = null

    page number (empty = current page)

    Tags
    author

    Nicola Asuni

    public
    since
    1.5.2
    see
    getPageDimensions()
    Return values
    int|float

    page break margin.

    getCellHeight()

    Return the cell height

    public getCellHeight(int $fontsize[, bool $padding = TRUE ]) : float
    Parameters
    $fontsize : int

    Font size in internal units

    $padding : bool = TRUE

    If true add cell padding

    Tags
    public
    Return values
    float

    getCellHeightRatio()

    return the height of cell repect font height.

    public getCellHeightRatio() : float
    Tags
    public
    since
    4.0.012

    (2008-07-24)

    Return values
    float

    getCellMargins()

    Get the internal Cell margin array.

    public getCellMargins() : array<string|int, mixed>
    Tags
    public
    since
    5.9.000

    (2010-10-03)

    see
    setCellMargins()
    Return values
    array<string|int, mixed>

    of margin values

    getCellPaddings()

    Get the internal Cell padding array.

    public getCellPaddings() : array<string|int, mixed>
    Tags
    public
    since
    5.9.000

    (2010-10-03)

    see

    setCellPaddings(), SetCellPadding()

    Return values
    array<string|int, mixed>

    of padding values

    getCharBBox()

    Returns the glyph bounding box of the specified character in the current font in user units.

    public getCharBBox(int $char) : false|array<string|int, mixed>
    Parameters
    $char : int

    Input character code.

    Tags
    since
    5.9.186

    (2012-09-13)

    Return values
    false|array<string|int, mixed>

    array(xMin, yMin, xMax, yMax) or FALSE if not defined.

    GetCharWidth()

    Returns the length of the char in user unit for the current font considering current stretching and spacing (tracking).

    public GetCharWidth(int $char[, bool $notlast = true ]) : float
    Parameters
    $char : int

    The char code whose length is to be returned

    $notlast : bool = true

    If false ignore the font-spacing.

    Tags
    author

    Nicola Asuni

    public
    since
    2.4.000

    (2008-03-06)

    Return values
    float

    char width

    getColumn()

    Return the current column number

    public getColumn() : int
    Tags
    public
    since
    5.5.011

    (2010-07-08)

    Return values
    int

    current column number

    getCSSBorderMargin()

    Get the border-spacing from CSS attribute.

    public getCSSBorderMargin(string $cssbspace[, float $width = 0 ]) : array<string|int, mixed>
    Parameters
    $cssbspace : string

    border-spacing CSS properties

    $width : float = 0

    width of the containing element

    Tags
    public
    since
    5.9.010

    (2010-10-27)

    Return values
    array<string|int, mixed>

    of border spacings

    getCSSMargin()

    Get the internal Cell margin from CSS attribute.

    public getCSSMargin(string $cssmargin[, float $width = 0 ]) : array<string|int, mixed>
    Parameters
    $cssmargin : string

    margin properties

    $width : float = 0

    width of the containing element

    Tags
    public
    since
    5.9.000

    (2010-10-04)

    Return values
    array<string|int, mixed>

    of cell margins

    getCSSPadding()

    Get the internal Cell padding from CSS attribute.

    public getCSSPadding(string $csspadding[, float $width = 0 ]) : array<string|int, mixed>
    Parameters
    $csspadding : string

    padding properties

    $width : float = 0

    width of the containing element

    Tags
    public
    since
    5.9.000

    (2010-10-04)

    Return values
    array<string|int, mixed>

    of cell paddings

    getDestination()

    Return the Named Destination array.

    public getDestination() : array<string|int, mixed>
    Tags
    public
    author

    Nicola Asuni

    since
    5.9.097

    (2011-06-23)

    Return values
    array<string|int, mixed>

    Named Destination array.

    getDocCreationTimestamp()

    Returns document creation timestamp in seconds.

    public getDocCreationTimestamp() : int
    Tags
    public
    since
    5.9.152

    (2012-03-23)

    Return values
    int

    Creation timestamp in seconds.

    getDocModificationTimestamp()

    Returns document modification timestamp in seconds.

    public getDocModificationTimestamp() : int
    Tags
    public
    since
    5.9.152

    (2012-03-23)

    Return values
    int

    Modfication timestamp in seconds.

    getFontAscent()

    Return the font ascent value.

    public getFontAscent(string $font[, string $style = '' ][, float $size = 0 ]) : int
    Parameters
    $font : string

    font name

    $style : string = ''

    font style

    $size : float = 0

    The size (in points)

    Tags
    public
    author

    Nicola Asuni

    since
    4.9.003

    (2010-03-30)

    Return values
    int

    font ascent

    getFontBBox()

    Returns the bounding box of the current font in user units.

    public getFontBBox() : array<string|int, mixed>
    Tags
    public
    since
    5.9.152

    (2012-03-23)

    Return values
    array<string|int, mixed>

    getFontDescent()

    Return the font descent value

    public getFontDescent(string $font[, string $style = '' ][, float $size = 0 ]) : int
    Parameters
    $font : string

    font name

    $style : string = ''

    font style

    $size : float = 0

    The size (in points)

    Tags
    public
    author

    Nicola Asuni

    since
    4.9.003

    (2010-03-30)

    Return values
    int

    font descent

    getFontFamily()

    Returns the current font family name.

    public getFontFamily() : string
    Tags
    public
    since
    4.3.008

    (2008-12-05)

    Return values
    string

    current font family name

    getFontFamilyName()

    Return normalized font name

    public getFontFamilyName(string $fontfamily) : string
    Parameters
    $fontfamily : string

    property string containing font family names

    Tags
    author

    Nicola Asuni

    public
    since
    5.8.004

    (2010-08-17)

    Return values
    string

    normalized font name

    getFontSize()

    Returns the current font size.

    public getFontSize() : float
    Tags
    public
    since
    3.2.000

    (2008-06-23)

    Return values
    float

    current font size

    getFontSizePt()

    Returns the current font size in points unit.

    public getFontSizePt() : int
    Tags
    public
    since
    3.2.000

    (2008-06-23)

    Return values
    int

    current font size in points unit

    getFontSpacing()

    Get the amount to increase or decrease the space between characters in a text.

    public getFontSpacing() : int
    Tags
    author

    Nicola Asuni

    public
    since
    5.9.000

    (2010-09-29)

    Return values
    int

    font spacing (tracking) value

    getFontStretching()

    Get the percentage of character stretching.

    public getFontStretching() : float
    Tags
    author

    Nicola Asuni

    public
    since
    5.9.000

    (2010-09-29)

    Return values
    float

    stretching value

    getFontStyle()

    Returns the current font style.

    public getFontStyle() : string
    Tags
    public
    since
    4.3.008

    (2008-12-05)

    Return values
    string

    current font style

    getFontSubsetting()

    Return the default option for font subsetting.

    public getFontSubsetting() : bool
    Tags
    author

    Nicola Asuni

    public
    since
    5.3.002

    (2010-06-07)

    Return values
    bool

    default font subsetting state.

    getFooterFont()

    Get Footer font.

    public getFooterFont() : array<int, string|float|null>
    Tags
    phpstan-return

    array{0: string, 1: string, 2: float|null} $font

    public
    since
    4.0.012

    (2008-07-24)

    Return values
    array<int, string|float|null>

    Array describing the basic font parameters: (family, style, size).

    getFooterMargin()

    Returns footer margin in user units.

    public getFooterMargin() : float
    Tags
    since
    4.0.012

    (2008-07-24)

    public
    Return values
    float

    getFormDefaultProp()

    Return the default properties for form fields.

    public getFormDefaultProp() : array<string|int, mixed>
    Tags
    public
    author

    Nicola Asuni

    since
    4.8.000

    (2009-09-06)

    Return values
    array<string|int, mixed>

    $prop javascript field properties. Possible values are described on official Javascript for Acrobat API reference.

    getGroupPageNo()

    Return the current page in the group.

    public getGroupPageNo() : int
    Tags
    public
    since
    3.0.000

    (2008-03-27)

    Return values
    int

    current page in the group

    getGroupPageNoFormatted()

    Returns the current group page number formatted as a string.

    public getGroupPageNoFormatted() : mixed
    Tags
    public
    since
    4.3.003

    (2008-11-18)

    see

    PaneNo(), formatPageNumber()

    getHeaderData()

    Returns header data: <ul><li>$ret['logo'] = logo image</li><li>$ret['logo_width'] = width of the image logo in user units</li><li>$ret['title'] = header title</li><li>$ret['string'] = header description string</li></ul>

    public getHeaderData() : array<string, mixed>
    Tags
    public
    since
    4.0.012

    (2008-07-24)

    Return values
    array<string, mixed>

    getHeaderFont()

    Get header font.

    public getHeaderFont() : array<int, string|float|null>
    Tags
    phpstan-return

    array{0: string, 1: string, 2: float|null}

    public
    since
    4.0.012

    (2008-07-24)

    Return values
    array<int, string|float|null>

    Array describing the basic font parameters: (family, style, size).

    getHeaderMargin()

    Returns header margin in user units.

    public getHeaderMargin() : float
    Tags
    since
    4.0.012

    (2008-07-24)

    public
    Return values
    float

    getHTMLFontUnits()

    Convert HTML string containing font size value to points

    public getHTMLFontUnits(string $val[, float $refsize = 12 ][, float $parent_size = 12 ][, string $defaultunit = 'pt' ]) : float
    Parameters
    $val : string

    String containing font size value and unit.

    $refsize : float = 12

    Reference font size in points.

    $parent_size : float = 12

    Parent font size in points.

    $defaultunit : string = 'pt'

    Default unit (can be one of the following: %, em, ex, px, in, mm, pc, pt).

    Tags
    public
    Return values
    float

    value in points

    getHTMLUnitToUnits()

    Convert HTML string containing value and unit of measure to user's units or points.

    public getHTMLUnitToUnits(string $htmlval[, string $refsize = 1 ][, string $defaultunit = 'px' ][, bool $points = false ]) : float
    Parameters
    $htmlval : string

    String containing values and unit.

    $refsize : string = 1

    Reference value in points.

    $defaultunit : string = 'px'

    Default unit (can be one of the following: %, em, ex, px, in, mm, pc, pt).

    $points : bool = false

    If true returns points, otherwise returns value in user's units.

    Tags
    public
    since
    4.4.004

    (2008-12-10)

    Return values
    float

    value in user's unit or point if $points=true

    getImageRBX()

    Return the right-bottom (or left-bottom for RTL) corner X coordinate of last inserted image

    public getImageRBX() : float
    Tags
    public
    Return values
    float

    getImageRBY()

    Return the right-bottom (or left-bottom for RTL) corner Y coordinate of last inserted image

    public getImageRBY() : float
    Tags
    public
    Return values
    float

    getImageScale()

    Returns the adjusting factor to convert pixels to user units.

    public getImageScale() : float
    Tags
    author

    Nicola Asuni

    public
    since
    1.5.2
    Return values
    float

    adjusting factor to convert pixels to user units.

    getLastH()

    Get the last cell height.

    public getLastH() : float
    Tags
    public
    since
    4.0.017

    (2008-08-05)

    Return values
    float

    last cell height

    GetLineWidth()

    Returns the current the line width.

    public GetLineWidth() : int
    Tags
    public
    since
    2.1.000

    (2008-01-07)

    see

    Line(), SetLineWidth()

    Return values
    int

    Line width

    getMargins()

    Returns an array containing current margins: <ul> <li>$ret['left'] = left margin</li> <li>$ret['right'] = right margin</li> <li>$ret['top'] = top margin</li> <li>$ret['bottom'] = bottom margin</li> <li>$ret['header'] = header margin</li> <li>$ret['footer'] = footer margin</li> <li>$ret['cell'] = cell padding array</li> <li>$ret['padding_left'] = cell left padding</li> <li>$ret['padding_top'] = cell top padding</li> <li>$ret['padding_right'] = cell right padding</li> <li>$ret['padding_bottom'] = cell bottom padding</li> </ul>

    public getMargins() : array<string|int, mixed>
    Tags
    public
    since
    3.2.000

    (2008-06-23)

    Return values
    array<string|int, mixed>

    containing all margins measures

    getNumberOfColumns()

    Return the current number of columns.

    public getNumberOfColumns() : int
    Tags
    public
    since
    5.8.018

    (2010-08-25)

    Return values
    int

    number of columns

    GetNumChars()

    Returns the numbero of characters in a string.

    public GetNumChars(string $s) : int
    Parameters
    $s : string

    The input string.

    Tags
    public
    since
    2.0.0001

    (2008-01-07)

    Return values
    int

    number of characters

    getNumLines()

    This method return the estimated number of lines for print a simple text string using Multicell() method.

    public getNumLines(string $txt[, float $w = 0 ][, bool $reseth = false ][, bool $autopadding = true ][, array<string|int, mixed>|null $cellpadding = null ][, mixed $border = 0 ]) : float
    Parameters
    $txt : string

    String for calculating his height

    $w : float = 0

    Width of cells. If 0, they extend up to the right margin of the page.

    $reseth : bool = false

    if true reset the last cell height (default false).

    $autopadding : bool = true

    if true, uses internal padding and automatically adjust it to account for line width (default true).

    $cellpadding : array<string|int, mixed>|null = null

    Internal cell padding, if empty uses default cell padding.

    $border : mixed = 0

    Indicates if borders must be drawn around the cell. The value can be a number:

    • 0: no border (default)
    • 1: frame
    or a string containing some or all of the following characters (in any order):
    • L: left
    • T: top
    • R: right
    • B: bottom
    or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)))
    Tags
    author

    Alexander Escalona Fern\E1ndez, Nicola Asuni

    public
    since
    4.5.011
    Return values
    float

    Return the minimal height needed for multicell method for printing the $txt param.

    getNumPages()

    Get the total number of insered pages.

    public getNumPages() : int
    Tags
    public
    since
    2.1.000

    (2008-01-07)

    see

    setPage(), getPage(), lastpage()

    Return values
    int

    number of pages

    getOriginalMargins()

    Returns an array containing original margins: <ul> <li>$ret['left'] = left margin</li> <li>$ret['right'] = right margin</li> </ul>

    public getOriginalMargins() : array<string|int, mixed>
    Tags
    public
    since
    4.0.012

    (2008-07-24)

    Return values
    array<string|int, mixed>

    containing all margins measures

    getOverprint()

    Get the overprint mode array (OP, op, OPM).

    public getOverprint() : array<string, bool|int>

    (Check the "Entries in a Graphics State Parameter Dictionary" on PDF 32000-1:2008).

    Tags
    public
    since
    5.9.152

    (2012-03-23)

    Return values
    array<string, bool|int>

    getPage()

    Get current document page number.

    public getPage() : int
    Tags
    public
    since
    2.1.000

    (2008-01-07)

    see

    setPage(), lastpage(), getNumPages()

    Return values
    int

    page number

    getPageDimensions()

    Returns an array of page dimensions: <ul><li>$this->pagedim[$this->page]['w'] = page width in points</li><li>$this->pagedim[$this->page]['h'] = height in points</li><li>$this->pagedim[$this->page]['wk'] = page width in user units</li><li>$this->pagedim[$this->page]['hk'] = page height in user units</li><li>$this->pagedim[$this->page]['tm'] = top margin</li><li>$this->pagedim[$this->page]['bm'] = bottom margin</li><li>$this->pagedim[$this->page]['lm'] = left margin</li><li>$this->pagedim[$this->page]['rm'] = right margin</li><li>$this->pagedim[$this->page]['pb'] = auto page break</li><li>$this->pagedim[$this->page]['or'] = page orientation</li><li>$this->pagedim[$this->page]['olm'] = original left margin</li><li>$this->pagedim[$this->page]['orm'] = original right margin</li><li>$this->pagedim[$this->page]['Rotate'] = The number of degrees by which the page shall be rotated clockwise when displayed or printed. The value shall be a multiple of 90.</li><li>$this->pagedim[$this->page]['PZ'] = The page's preferred zoom (magnification) factor.</li><li>$this->pagedim[$this->page]['trans'] : the style and duration of the visual transition to use when moving from another page to the given page during a presentation<ul><li>$this->pagedim[$this->page]['trans']['Dur'] = The page's display duration (also called its advance timing): the maximum length of time, in seconds, that the page shall be displayed during presentations before the viewer application shall automatically advance to the next page.</li><li>$this->pagedim[$this->page]['trans']['S'] = transition style : Split, Blinds, Box, Wipe, Dissolve, Glitter, R, Fly, Push, Cover, Uncover, Fade</li><li>$this->pagedim[$this->page]['trans']['D'] = The duration of the transition effect, in seconds.</li><li>$this->pagedim[$this->page]['trans']['Dm'] = (Split and Blinds transition styles only) The dimension in which the specified transition effect shall occur: H = Horizontal, V = Vertical. Default value: H.</li><li>$this->pagedim[$this->page]['trans']['M'] = (Split, Box and Fly transition styles only) The direction of motion for the specified transition effect: I = Inward from the edges of the page, O = Outward from the center of the pageDefault value: I.</li><li>$this->pagedim[$this->page]['trans']['Di'] = (Wipe, Glitter, Fly, Cover, Uncover and Push transition styles only) The direction in which the specified transition effect shall moves, expressed in degrees counterclockwise starting from a left-to-right direction. If the value is a number, it shall be one of: 0 = Left to right, 90 = Bottom to top (Wipe only), 180 = Right to left (Wipe only), 270 = Top to bottom, 315 = Top-left to bottom-right (Glitter only). If the value is a name, it shall be None, which is relevant only for the Fly transition when the value of SS is not 1.0. Default value: 0.</li><li>$this->pagedim[$this->page]['trans']['SS'] = (Fly transition style only) The starting or ending scale at which the changes shall be drawn. If M specifies an inward transition, the scale of the changes drawn shall progress from SS to 1.0 over the course of the transition. If M specifies an outward transition, the scale of the changes drawn shall progress from 1.0 to SS over the course of the transition. Default: 1.0. </li><li>$this->pagedim[$this->page]['trans']['B'] = (Fly transition style only) If true, the area that shall be flown in is rectangular and opaque. Default: false.</li></ul></li><li>$this->pagedim[$this->page]['MediaBox'] : the boundaries of the physical medium on which the page shall be displayed or printed<ul><li>$this->pagedim[$this->page]['MediaBox']['llx'] = lower-left x coordinate in points</li><li>$this->pagedim[$this->page]['MediaBox']['lly'] = lower-left y coordinate in points</li><li>$this->pagedim[$this->page]['MediaBox']['urx'] = upper-right x coordinate in points</li><li>$this->pagedim[$this->page]['MediaBox']['ury'] = upper-right y coordinate in points</li></ul></li><li>$this->pagedim[$this->page]['CropBox'] : the visible region of default user space<ul><li>$this->pagedim[$this->page]['CropBox']['llx'] = lower-left x coordinate in points</li><li>$this->pagedim[$this->page]['CropBox']['lly'] = lower-left y coordinate in points</li><li>$this->pagedim[$this->page]['CropBox']['urx'] = upper-right x coordinate in points</li><li>$this->pagedim[$this->page]['CropBox']['ury'] = upper-right y coordinate in points</li></ul></li><li>$this->pagedim[$this->page]['BleedBox'] : the region to which the contents of the page shall be clipped when output in a production environment<ul><li>$this->pagedim[$this->page]['BleedBox']['llx'] = lower-left x coordinate in points</li><li>$this->pagedim[$this->page]['BleedBox']['lly'] = lower-left y coordinate in points</li><li>$this->pagedim[$this->page]['BleedBox']['urx'] = upper-right x coordinate in points</li><li>$this->pagedim[$this->page]['BleedBox']['ury'] = upper-right y coordinate in points</li></ul></li><li>$this->pagedim[$this->page]['TrimBox'] : the intended dimensions of the finished page after trimming<ul><li>$this->pagedim[$this->page]['TrimBox']['llx'] = lower-left x coordinate in points</li><li>$this->pagedim[$this->page]['TrimBox']['lly'] = lower-left y coordinate in points</li><li>$this->pagedim[$this->page]['TrimBox']['urx'] = upper-right x coordinate in points</li><li>$this->pagedim[$this->page]['TrimBox']['ury'] = upper-right y coordinate in points</li></ul></li><li>$this->pagedim[$this->page]['ArtBox'] : the extent of the page's meaningful content<ul><li>$this->pagedim[$this->page]['ArtBox']['llx'] = lower-left x coordinate in points</li><li>$this->pagedim[$this->page]['ArtBox']['lly'] = lower-left y coordinate in points</li><li>$this->pagedim[$this->page]['ArtBox']['urx'] = upper-right x coordinate in points</li><li>$this->pagedim[$this->page]['ArtBox']['ury'] = upper-right y coordinate in points</li></ul></li></ul>

    public getPageDimensions([int|null $pagenum = null ]) : array<string|int, mixed>
    Parameters
    $pagenum : int|null = null

    page number (empty = current page)

    Tags
    author

    Nicola Asuni

    public
    since
    4.5.027

    (2009-03-16)

    Return values
    array<string|int, mixed>

    of page dimensions.

    getPageGroupAlias()

    Return the alias for the total number of pages in the current page group.

    public getPageGroupAlias() : string

    If the current font is unicode type, the returned string is surrounded by additional curly braces. This alias will be replaced by the total number of pages in this group.

    Tags
    public
    since
    3.0.000

    (2008-03-27)

    Return values
    string

    alias of the current page group

    getPageHeight()

    Returns the page height in units.

    public getPageHeight([int|null $pagenum = null ]) : int|float
    Parameters
    $pagenum : int|null = null

    page number (empty = current page)

    Tags
    author

    Nicola Asuni

    public
    since
    1.5.2
    see
    getPageDimensions()
    Return values
    int|float

    page height.

    getPageNumGroupAlias()

    Return the alias for the page number on the current page group.

    public getPageNumGroupAlias() : string

    If the current font is unicode type, the returned string is surrounded by additional curly braces. This alias will be replaced by the page number (relative to the belonging group).

    Tags
    public
    since
    4.5.000

    (2009-01-02)

    Return values
    string

    alias of the current page group

    getPageRegions()

    Return an array of no-write page regions

    public getPageRegions() : array<string|int, mixed>
    Tags
    author

    Nicola Asuni

    public
    since
    5.9.003

    (2010-10-13)

    see

    setPageRegions(), addPageRegion()

    Return values
    array<string|int, mixed>

    of no-write page regions

    getPageWidth()

    Returns the page width in units.

    public getPageWidth([int|null $pagenum = null ]) : int|float
    Parameters
    $pagenum : int|null = null

    page number (empty = current page)

    Tags
    author

    Nicola Asuni

    public
    since
    1.5.2
    see
    getPageDimensions()
    Return values
    int|float

    page width.

    getPDFData()

    Returns the PDF data.

    public getPDFData() : mixed
    Tags
    public

    getRawCharWidth()

    Returns the length of the char in user unit for the current font.

    public getRawCharWidth(int $char) : float
    Parameters
    $char : int

    The char code whose length is to be returned

    Tags
    author

    Nicola Asuni

    public
    since
    5.9.000

    (2010-09-28)

    Return values
    float

    char width

    getRTL()

    Return the RTL status

    public getRTL() : bool
    Tags
    public
    since
    4.0.012

    (2008-07-24)

    Return values
    bool

    getScaleFactor()

    Returns the scale factor (number of points in user unit).

    public getScaleFactor() : int
    Tags
    author

    Nicola Asuni

    public
    since
    1.5.2
    Return values
    int

    scale factor.

    getStringHeight()

    This method return the estimated height needed for printing a simple text string using the Multicell() method.

    public getStringHeight(float $w, string $txt[, bool $reseth = false ][, bool $autopadding = true ][, array<string|int, mixed>|null $cellpadding = null ][, mixed $border = 0 ]) : float

    Generally, if you want to know the exact height for a block of content you can use the following alternative technique:

    Parameters
    $w : float

    Width of cells. If 0, they extend up to the right margin of the page.

    $txt : string

    String for calculating his height

    $reseth : bool = false

    if true reset the last cell height (default false).

    $autopadding : bool = true

    if true, uses internal padding and automatically adjust it to account for line width (default true).

    $cellpadding : array<string|int, mixed>|null = null

    Internal cell padding, if empty uses default cell padding.

    $border : mixed = 0

    Indicates if borders must be drawn around the cell. The value can be a number:

    • 0: no border (default)
    • 1: frame
    or a string containing some or all of the following characters (in any order):
    • L: left
    • T: top
    • R: right
    • B: bottom
    or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)))
    Tags
    pre

    // store current object $pdf->startTransaction(); // store starting values $start_y = $pdf->GetY(); $start_page = $pdf->getPage(); // call your printing functions with your parameters // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $pdf->MultiCell($w=0, $h=0, $txt, $border=1, $align='L', $fill=false, $ln=1, $x=null, $y=null, $reseth=true, $stretch=0, $ishtml=false, $autopadding=true, $maxh=0); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // get the new Y $end_y = $pdf->GetY(); $end_page = $pdf->getPage(); // calculate height $height = 0; if ($end_page == $start_page) { $height = $end_y - $start_y; } else { for ($page=$start_page; $page <= $end_page; ++$page) { $this->setPage($page); if ($page == $start_page) { // first page $height += $this->h - $start_y - $this->bMargin; } elseif ($page == $end_page) { // last page $height += $end_y - $this->tMargin; } else { $height += $this->h - $this->tMargin - $this->bMargin; } } } // restore previous object $pdf = $pdf->rollbackTransaction();

    author

    Nicola Asuni, Alexander Escalona Fern\E1ndez

    public
    Return values
    float

    Return the minimal height needed for multicell method for printing the $txt param.

    GetStringWidth()

    Returns the length of a string in user unit. A font must be selected.<br>

    public GetStringWidth(string $s[, string $fontname = '' ][, string $fontstyle = '' ][, float $fontsize = 0 ][, bool $getarray = false ]) : array<string|int, float>|float
    Parameters
    $s : string

    The string whose length is to be computed

    $fontname : string = ''

    Family font. It can be either a name defined by AddFont() or one of the standard families. It is also possible to pass an empty string, in that case, the current family is retained.

    $fontstyle : string = ''

    Font style. Possible values are (case insensitive):

    • empty string: regular
    • B: bold
    • I: italic
    • U: underline
    • D: line-through
    • O: overline
    or any combination. The default value is regular.
    $fontsize : float = 0

    Font size in points. The default value is the current size.

    $getarray : bool = false

    if true returns an array of characters widths, if false returns the total length.

    Tags
    phpstan-return

    ($getarray is true ? float[] : float) total string length or array of characted widths

    author

    Nicola Asuni

    public
    since
    1.2
    Return values
    array<string|int, float>|float

    total string length or array of characted widths

    getTextShadow()

    Return the text shadow parameters array.

    public getTextShadow() : array<string|int, mixed>
    Tags
    since
    5.9.174

    (2012-07-25)

    public
    Return values
    array<string|int, mixed>

    array of parameters.

    GetX()

    Returns the relative X value of current position.

    public GetX() : float

    The value is relative to the left border for LTR languages and to the right border for RTL languages.

    Tags
    public
    since
    1.2
    see

    SetX(), GetY(), SetY()

    Return values
    float

    GetY()

    Returns the ordinate of the current position.

    public GetY() : float
    Tags
    public
    since
    1.0
    see

    SetY(), GetX(), SetX()

    Return values
    float

    Gradient()

    Output gradient.

    public Gradient(int $type, array<string|int, mixed> $coords, array<string|int, mixed> $stops[, array<string|int, mixed> $background = array() ][, bool $antialias = false ]) : mixed
    Parameters
    $type : int

    type of gradient (1 Function-based shading; 2 Axial shading; 3 Radial shading; 4 Free-form Gouraud-shaded triangle mesh; 5 Lattice-form Gouraud-shaded triangle mesh; 6 Coons patch mesh; 7 Tensor-product patch mesh). (Not all types are currently supported)

    $coords : array<string|int, mixed>

    array of coordinates.

    $stops : array<string|int, mixed>

    array gradient color components: color = array of GRAY, RGB or CMYK color components; offset = (0 to 1) represents a location along the gradient vector; exponent = exponent of the exponential interpolation function (default = 1).

    $background : array<string|int, mixed> = array()

    An array of colour components appropriate to the colour space, specifying a single background colour value.

    $antialias : bool = false

    A flag indicating whether to filter the shading function to prevent aliasing artifacts.

    Tags
    author

    Nicola Asuni

    since
    3.1.000

    (2008-06-09)

    public

    Header()

    This method is used to render the page header.

    public Header() : mixed

    It is automatically called by AddPage() and could be overwritten in your own inherited class.

    Tags
    public

    hyphenateText()

    Returns text with soft hyphens.

    public hyphenateText(string $text, mixed $patterns[, array<string|int, mixed> $dictionary = array() ][, int $leftmin = 1 ][, int $rightmin = 2 ][, int $charmin = 1 ][, int $charmax = 8 ]) : string
    Parameters
    $text : string

    text to process

    $patterns : mixed

    Array of hypenation patterns or a TEX file containing hypenation patterns. TEX patterns can be downloaded from http://www.ctan.org/tex-archive/language/hyph-utf8/tex/generic/hyph-utf8/patterns/

    $dictionary : array<string|int, mixed> = array()

    Array of words to be returned without applying the hyphenation algorithm.

    $leftmin : int = 1

    Minimum number of character to leave on the left of the word without applying the hyphens.

    $rightmin : int = 2

    Minimum number of character to leave on the right of the word without applying the hyphens.

    $charmin : int = 1

    Minimum word length to apply the hyphenation algorithm.

    $charmax : int = 8

    Maximum length of broken piece of word.

    Tags
    author

    Nicola Asuni

    since
    4.9.012

    (2010-04-12)

    public
    Return values
    string

    text with soft hyphens

    Image()

    Puts an image in the page.

    public Image(string $file[, float|null $x = null ][, float|null $y = null ][, float $w = 0 ][, float $h = 0 ][, string $type = '' ][, mixed $link = '' ][, string $align = '' ][, mixed $resize = false ][, int $dpi = 300 ][, string $palign = '' ][, bool $ismask = false ][, mixed $imgmask = false ][, mixed $border = 0 ][, mixed $fitbox = false ][, bool $hidden = false ][, bool $fitonpage = false ][, bool $alt = false ][, array<string|int, mixed> $altimgs = array() ]) : mixed|false

    The upper-left corner must be given. The dimensions can be specified in different ways:

    • explicit width and height (expressed in user unit)
    • one explicit dimension, the other being calculated automatically in order to keep the original proportions
    • no explicit dimension, in which case the image is put at 72 dpi
    Supported formats are JPEG and PNG images whitout GD library and all images supported by GD: GD, GD2, GD2PART, GIF, JPEG, PNG, BMP, XBM, XPM; The format can be specified explicitly or inferred from the file extension.
    It is possible to put a link on the image.
    Remark: if an image is used several times, only one copy will be embedded in the file.
    Parameters
    $file : string

    Name of the file containing the image or a '@' character followed by the image data string. To link an image without embedding it on the document, set an asterisk character before the URL (i.e.: '*http://www.example.com/image.jpg').

    $x : float|null = null

    Abscissa of the upper-left corner (LTR) or upper-right corner (RTL).

    $y : float|null = null

    Ordinate of the upper-left corner (LTR) or upper-right corner (RTL).

    $w : float = 0

    Width of the image in the page. If not specified or equal to zero, it is automatically calculated.

    $h : float = 0

    Height of the image in the page. If not specified or equal to zero, it is automatically calculated.

    $type : string = ''

    Image format. Possible values are (case insensitive): JPEG and PNG (whitout GD library) and all images supported by GD: GD, GD2, GD2PART, GIF, JPEG, PNG, BMP, XBM, XPM;. If not specified, the type is inferred from the file extension.

    $link : mixed = ''

    URL or identifier returned by AddLink().

    $align : string = ''

    Indicates the alignment of the pointer next to image insertion relative to image height. The value can be:

    • T: top-right for LTR or top-left for RTL
    • M: middle-right for LTR or middle-left for RTL
    • B: bottom-right for LTR or bottom-left for RTL
    • N: next line
    $resize : mixed = false

    If true resize (reduce) the image to fit $w and $h (requires GD or ImageMagick library); if false do not resize; if 2 force resize in all cases (upscaling and downscaling).

    $dpi : int = 300

    dot-per-inch resolution used on resize

    $palign : string = ''

    Allows to center or align the image on the current line. Possible values are:

    • L : left align
    • C : center
    • R : right align
    • '' : empty string : left for LTR or right for RTL
    $ismask : bool = false

    true if this image is a mask, false otherwise

    $imgmask : mixed = false

    image object returned by this function or false

    $border : mixed = 0

    Indicates if borders must be drawn around the cell. The value can be a number:

    • 0: no border (default)
    • 1: frame
    or a string containing some or all of the following characters (in any order):
    • L: left
    • T: top
    • R: right
    • B: bottom
    or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)))
    $fitbox : mixed = false

    If not false scale image dimensions proportionally to fit within the ($w, $h) box. $fitbox can be true or a 2 characters string indicating the image alignment inside the box. The first character indicate the horizontal alignment (L = left, C = center, R = right) the second character indicate the vertical algnment (T = top, M = middle, B = bottom).

    $hidden : bool = false

    If true do not display the image.

    $fitonpage : bool = false

    If true the image is resized to not exceed page dimensions.

    $alt : bool = false

    If true the image will be added as alternative and not directly printed (the ID of the image will be returned).

    $altimgs : array<string|int, mixed> = array()

    Array of alternate images IDs. Each alternative image must be an array with two values: an integer representing the image ID (the value returned by the Image method) and a boolean value to indicate if the image is the default for printing.

    Tags
    public
    since
    1.1
    Return values
    mixed|false

    image information

    ImageEps()

    Embed vector-based Adobe Illustrator (AI) or AI-compatible EPS files.

    public ImageEps(string $file[, float|null $x = null ][, float|null $y = null ][, float $w = 0 ][, float $h = 0 ][, mixed $link = '' ][, bool $useBoundingBox = true ][, string $align = '' ][, string $palign = '' ][, mixed $border = 0 ][, bool $fitonpage = false ][, bool $fixoutvals = false ]) : mixed

    NOTE: EPS is not yet fully implemented, use the setRasterizeVectorImages() method to enable/disable rasterization of vector images using ImageMagick library. Only vector drawing is supported, not text or bitmap. Although the script was successfully tested with various AI format versions, best results are probably achieved with files that were exported in the AI3 format (tested with Illustrator CS2, Freehand MX and Photoshop CS2).

    Parameters
    $file : string

    Name of the file containing the image or a '@' character followed by the EPS/AI data string.

    $x : float|null = null

    Abscissa of the upper-left corner.

    $y : float|null = null

    Ordinate of the upper-left corner.

    $w : float = 0

    Width of the image in the page. If not specified or equal to zero, it is automatically calculated.

    $h : float = 0

    Height of the image in the page. If not specified or equal to zero, it is automatically calculated.

    $link : mixed = ''

    URL or identifier returned by AddLink().

    $useBoundingBox : bool = true

    specifies whether to position the bounding box (true) or the complete canvas (false) at location (x,y). Default value is true.

    $align : string = ''

    Indicates the alignment of the pointer next to image insertion relative to image height. The value can be:

    • T: top-right for LTR or top-left for RTL
    • M: middle-right for LTR or middle-left for RTL
    • B: bottom-right for LTR or bottom-left for RTL
    • N: next line
    $palign : string = ''

    Allows to center or align the image on the current line. Possible values are:

    • L : left align
    • C : center
    • R : right align
    • '' : empty string : left for LTR or right for RTL
    $border : mixed = 0

    Indicates if borders must be drawn around the cell. The value can be a number:

    • 0: no border (default)
    • 1: frame
    or a string containing some or all of the following characters (in any order):
    • L: left
    • T: top
    • R: right
    • B: bottom
    or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)))
    $fitonpage : bool = false

    if true the image is resized to not exceed page dimensions.

    $fixoutvals : bool = false

    if true remove values outside the bounding box.

    Tags
    author

    Valentin Schmidt, Nicola Asuni

    since
    3.1.000

    (2008-06-09)

    public

    ImageSVG()

    Embedd a Scalable Vector Graphics (SVG) image.

    public ImageSVG(string $file[, float|null $x = null ][, float|null $y = null ][, float $w = 0 ][, float $h = 0 ][, mixed $link = '' ][, string $align = '' ][, string $palign = '' ][, mixed $border = 0 ][, bool $fitonpage = false ]) : mixed

    NOTE: SVG standard is not yet fully implemented, use the setRasterizeVectorImages() method to enable/disable rasterization of vector images using ImageMagick library.

    Parameters
    $file : string

    Name of the SVG file or a '@' character followed by the SVG data string.

    $x : float|null = null

    Abscissa of the upper-left corner.

    $y : float|null = null

    Ordinate of the upper-left corner.

    $w : float = 0

    Width of the image in the page. If not specified or equal to zero, it is automatically calculated.

    $h : float = 0

    Height of the image in the page. If not specified or equal to zero, it is automatically calculated.

    $link : mixed = ''

    URL or identifier returned by AddLink().

    $align : string = ''

    Indicates the alignment of the pointer next to image insertion relative to image height. The value can be:

    • T: top-right for LTR or top-left for RTL
    • M: middle-right for LTR or middle-left for RTL
    • B: bottom-right for LTR or bottom-left for RTL
    • N: next line
    If the alignment is an empty string, then the pointer will be restored on the starting SVG position.
    $palign : string = ''

    Allows to center or align the image on the current line. Possible values are:

    • L : left align
    • C : center
    • R : right align
    • '' : empty string : left for LTR or right for RTL
    $border : mixed = 0

    Indicates if borders must be drawn around the cell. The value can be a number:

    • 0: no border (default)
    • 1: frame
    or a string containing some or all of the following characters (in any order):
    • L: left
    • T: top
    • R: right
    • B: bottom
    or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)))
    $fitonpage : bool = false

    if true the image is resized to not exceed page dimensions.

    Tags
    author

    Nicola Asuni

    since
    5.0.000

    (2010-05-02)

    public

    IncludeJS()

    Adds a javascript

    public IncludeJS(string $script) : mixed
    Parameters
    $script : string

    Javascript code

    Tags
    public
    author

    Johannes G\FCntert, Nicola Asuni

    since
    2.1.002

    (2008-02-12)

    isCharDefined()

    Return true in the character is present in the specified font.

    public isCharDefined(mixed $char[, string $font = '' ][, string $style = '' ]) : bool
    Parameters
    $char : mixed

    Character to check (integer value or string)

    $font : string = ''

    Font name (family name).

    $style : string = ''

    Font style.

    Tags
    public
    since
    5.9.153

    (2012-03-28)

    Return values
    bool

    true if the char is defined, false otherwise.

    isRTLTextDir()

    Return the current temporary RTL status

    public isRTLTextDir() : bool
    Tags
    public
    since
    4.8.014

    (2009-11-04)

    Return values
    bool

    isUnicodeFont()

    Return true if the current font is unicode type.

    public isUnicodeFont() : bool
    Tags
    author

    Nicola Asuni

    public
    since
    5.8.002

    (2010-08-14)

    Return values
    bool

    true for unicode font, false otherwise.

    lastPage()

    Reset pointer to the last document page.

    public lastPage([bool $resetmargins = false ]) : mixed
    Parameters
    $resetmargins : bool = false

    if true reset left, right, top margins and Y position.

    Tags
    public
    since
    2.0.000

    (2008-01-04)

    see

    setPage(), getPage(), getNumPages()

    Line()

    Draws a line between two points.

    public Line(float $x1, float $y1, float $x2, float $y2[, array<string|int, mixed> $style = array() ]) : mixed
    Parameters
    $x1 : float

    Abscissa of first point.

    $y1 : float

    Ordinate of first point.

    $x2 : float

    Abscissa of second point.

    $y2 : float

    Ordinate of second point.

    $style : array<string|int, mixed> = array()

    Line style. Array like for SetLineStyle(). Default value: default line style (empty array).

    Tags
    public
    since
    1.0
    see

    SetLineWidth(), SetDrawColor(), SetLineStyle()

    LinearGradient()

    Paints a linear colour gradient.

    public LinearGradient(float $x, float $y, float $w, float $h[, array<string|int, mixed> $col1 = array() ][, array<string|int, mixed> $col2 = array() ][, array<string|int, mixed> $coords = array(0, 0, 1, 0) ]) : mixed
    Parameters
    $x : float

    abscissa of the top left corner of the rectangle.

    $y : float

    ordinate of the top left corner of the rectangle.

    $w : float

    width of the rectangle.

    $h : float

    height of the rectangle.

    $col1 : array<string|int, mixed> = array()

    first color (Grayscale, RGB or CMYK components).

    $col2 : array<string|int, mixed> = array()

    second color (Grayscale, RGB or CMYK components).

    $coords : array<string|int, mixed> = array(0, 0, 1, 0)

    array of the form (x1, y1, x2, y2) which defines the gradient vector (see linear_gradient_coords.jpg). The default value is from left to right (x1=0, y1=0, x2=1, y2=0).

    Tags
    author

    Andreas W\FCrmser, Nicola Asuni

    since
    3.1.000

    (2008-06-09)

    public

    Puts a link on a rectangular area of the page.

    public Link(float $x, float $y, float $w, float $h, mixed $link[, int $spaces = 0 ]) : mixed

    Text or image links are generally put via Cell(), Write() or Image(), but this method can be useful for instance to define a clickable area inside an image.

    Parameters
    $x : float

    Abscissa of the upper-left corner of the rectangle

    $y : float

    Ordinate of the upper-left corner of the rectangle

    $w : float

    Width of the rectangle

    $h : float

    Height of the rectangle

    $link : mixed

    URL or identifier returned by AddLink()

    $spaces : int = 0

    number of spaces on the text to link

    Tags
    public
    since
    1.5
    see

    AddLink(), Annotation(), Cell(), Write(), Image()

    ListBox()

    Creates a List-box field

    public ListBox(string $name, int $w, int $h, array<string|int, mixed> $values[, array<string|int, mixed> $prop = array() ][, array<string|int, mixed> $opt = array() ][, float|null $x = null ][, float|null $y = null ][, bool $js = false ]) : mixed
    Parameters
    $name : string

    field name

    $w : int

    width

    $h : int

    height

    $values : array<string|int, mixed>

    array containing the list of values.

    $prop : array<string|int, mixed> = array()

    javascript field properties. Possible values are described on official Javascript for Acrobat API reference.

    $opt : array<string|int, mixed> = array()

    annotation parameters. Possible values are described on official PDF32000_2008 reference.

    $x : float|null = null

    Abscissa of the upper-left corner of the rectangle

    $y : float|null = null

    Ordinate of the upper-left corner of the rectangle

    $js : bool = false

    if true put the field using JavaScript (requires Acrobat Writer to be rendered).

    Tags
    public
    author

    Nicola Asuni

    since
    4.8.000

    (2009-09-07)

    Ln()

    Performs a line break.

    public Ln([float|null $h = null ][, bool $cell = false ]) : mixed

    The current abscissa goes back to the left margin and the ordinate increases by the amount passed in parameter.

    Parameters
    $h : float|null = null

    The height of the break. By default, the value equals the height of the last printed cell.

    $cell : bool = false

    if true add the current left (or right o for RTL) padding to the X coordinate

    Tags
    public
    since
    1.0
    see
    Cell()

    MirrorH()

    Horizontal Mirroring.

    public MirrorH([float|null $x = null ]) : mixed
    Parameters
    $x : float|null = null

    abscissa of the point. Default is current x position

    Tags
    public
    since
    2.1.000

    (2008-01-07)

    see

    StartTransform(), StopTransform()

    MirrorL()

    Reflection against a straight line through point (x, y) with the gradient angle (angle).

    public MirrorL([float $angle = 0 ][, float|null $x = null ][, float|null $y = null ]) : mixed
    Parameters
    $angle : float = 0

    gradient angle of the straight line. Default is 0 (horizontal line).

    $x : float|null = null

    abscissa of the point. Default is current x position

    $y : float|null = null

    ordinate of the point. Default is current y position

    Tags
    public
    since
    2.1.000

    (2008-01-07)

    see

    StartTransform(), StopTransform()

    MirrorP()

    Point reflection mirroring.

    public MirrorP([float|null $x = null ][, float|null $y = null ]) : mixed
    Parameters
    $x : float|null = null

    abscissa of the point. Default is current x position

    $y : float|null = null

    ordinate of the point. Default is current y position

    Tags
    public
    since
    2.1.000

    (2008-01-07)

    see

    StartTransform(), StopTransform()

    MirrorV()

    Verical Mirroring.

    public MirrorV([float|null $y = null ]) : mixed
    Parameters
    $y : float|null = null

    ordinate of the point. Default is current y position

    Tags
    public
    since
    2.1.000

    (2008-01-07)

    see

    StartTransform(), StopTransform()

    movePage()

    Move a page to a previous position.

    public movePage(int $frompage, int $topage) : bool
    Parameters
    $frompage : int

    number of the source page

    $topage : int

    number of the destination page (must be less than $frompage)

    Tags
    public
    since
    4.5.000

    (2009-01-02)

    Return values
    bool

    true in case of success, false in case of error.

    MultiCell()

    This method allows printing text with line breaks.

    public MultiCell(float $w, float $h, string $txt[, mixed $border = 0 ][, string $align = 'J' ][, bool $fill = false ][, int $ln = 1 ][, float|null $x = null ][, float|null $y = null ][, bool $reseth = true ][, int $stretch = 0 ][, bool $ishtml = false ][, bool $autopadding = true ][, float $maxh = 0 ][, string $valign = 'T' ][, bool $fitcell = false ]) : int

    They can be automatic (as soon as the text reaches the right border of the cell) or explicit (via the \n character). As many cells as necessary are output, one below the other.
    Text can be aligned, centered or justified. The cell block can be framed and the background painted.

    Parameters
    $w : float

    Width of cells. If 0, they extend up to the right margin of the page.

    $h : float

    Cell minimum height. The cell extends automatically if needed.

    $txt : string

    String to print

    $border : mixed = 0

    Indicates if borders must be drawn around the cell. The value can be a number:

    • 0: no border (default)
    • 1: frame
    or a string containing some or all of the following characters (in any order):
    • L: left
    • T: top
    • R: right
    • B: bottom
    or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)))
    $align : string = 'J'

    Allows to center or align the text. Possible values are:

    • L or empty string: left align
    • C: center
    • R: right align
    • J: justification (default value when $ishtml=false)
    $fill : bool = false

    Indicates if the cell background must be painted (true) or transparent (false).

    $ln : int = 1

    Indicates where the current position should go after the call. Possible values are:

    • 0: to the right
    • 1: to the beginning of the next line [DEFAULT]
    • 2: below
    $x : float|null = null

    x position in user units

    $y : float|null = null

    y position in user units

    $reseth : bool = true

    if true reset the last cell height (default true).

    $stretch : int = 0

    font stretch mode:

    • 0 = disabled
    • 1 = horizontal scaling only if text is larger than cell width
    • 2 = forced horizontal scaling to fit cell width
    • 3 = character spacing only if text is larger than cell width
    • 4 = forced character spacing to fit cell width
    General font stretching and scaling values will be preserved when possible.
    $ishtml : bool = false

    INTERNAL USE ONLY -- set to true if $txt is HTML content (default = false). Never set this parameter to true, use instead writeHTMLCell() or writeHTML() methods.

    $autopadding : bool = true

    if true, uses internal padding and automatically adjust it to account for line width.

    $maxh : float = 0

    maximum height. It should be >= $h and less then remaining space to the bottom of the page, or 0 for disable this feature. This feature works only when $ishtml=false.

    $valign : string = 'T'

    Vertical alignment of text (requires $maxh = $h > 0). Possible values are:

    • T: TOP
    • M: middle
    • B: bottom
    . This feature works only when $ishtml=false and the cell must fit in a single page.
    $fitcell : bool = false

    if true attempt to fit all the text within the cell by reducing the font size (do not work in HTML mode). $maxh must be greater than 0 and equal to $h.

    Tags
    public
    since
    1.3
    see

    SetFont(), SetDrawColor(), SetFillColor(), SetTextColor(), SetLineWidth(), Cell(), Write(), SetAutoPageBreak()

    Return values
    int

    Return the number of cells or 1 for html mode.

    Open()

    This method begins the generation of the PDF document.

    public Open() : mixed

    It is not necessary to call it explicitly because AddPage() does it automatically. Note: no page is created by this method

    Tags
    public
    since
    1.0
    see

    AddPage(), Close()

    Output()

    Send the document to a given destination: string, local file or browser.

    public Output([string $name = 'doc.pdf' ][, string $dest = 'I' ]) : string

    In the last case, the plug-in may be used (if present) or a download ("Save as" dialog box) may be forced.
    The method first calls Close() if necessary to terminate the document.

    Parameters
    $name : string = 'doc.pdf'

    The name of the file when saved

    $dest : string = 'I'

    Destination where to send the document. It can take one of the following values:

    • I: send the file inline to the browser (default). The plug-in is used if available. The name given by name is used when one selects the "Save as" option on the link generating the PDF.
    • D: send to the browser and force a file download with the name given by name.
    • F: save to a local server file with the name given by name.
    • S: return the document as a string (name is ignored).
    • FI: equivalent to F + I option
    • FD: equivalent to F + D option
    • E: return the document as base64 mime multi-part email attachment (RFC 2045)
    Tags
    public
    since
    1.0
    see
    Close()
    Return values
    string

    PageNo()

    Returns the current page number.

    public PageNo() : int
    Tags
    public
    since
    1.0
    see
    getAliasNbPages()
    Return values
    int

    page number

    PageNoFormatted()

    Returns the current page number formatted as a string.

    public PageNoFormatted() : mixed
    Tags
    public
    since
    4.2.005

    (2008-11-06)

    see

    PaneNo(), formatPageNumber()

    PieSector()

    Draw the sector of a circle.

    public PieSector(float $xc, float $yc, float $r, float $a, float $b[, string $style = 'FD' ][, float $cw = true ][, float $o = 90 ]) : mixed

    It can be used for instance to render pie charts.

    Parameters
    $xc : float

    abscissa of the center.

    $yc : float

    ordinate of the center.

    $r : float

    radius.

    $a : float

    start angle (in degrees).

    $b : float

    end angle (in degrees).

    $style : string = 'FD'

    Style of rendering. See the getPathPaintOperator() function for more information.

    $cw : float = true

    indicates whether to go clockwise (default: true).

    $o : float = 90

    origin of angles (0 for 3 o'clock, 90 for noon, 180 for 9 o'clock, 270 for 6 o'clock). Default: 90.

    Tags
    author

    Maxime Delorme, Nicola Asuni

    since
    3.1.000

    (2008-06-09)

    public

    PieSectorXY()

    Draw the sector of an ellipse.

    public PieSectorXY(float $xc, float $yc, float $rx, float $ry, float $a, float $b[, string $style = 'FD' ][, float $cw = false ][, float $o = 0 ][, int $nc = 2 ]) : mixed

    It can be used for instance to render pie charts.

    Parameters
    $xc : float

    abscissa of the center.

    $yc : float

    ordinate of the center.

    $rx : float

    the x-axis radius.

    $ry : float

    the y-axis radius.

    $a : float

    start angle (in degrees).

    $b : float

    end angle (in degrees).

    $style : string = 'FD'

    Style of rendering. See the getPathPaintOperator() function for more information.

    $cw : float = false

    indicates whether to go clockwise.

    $o : float = 0

    origin of angles (0 for 3 o'clock, 90 for noon, 180 for 9 o'clock, 270 for 6 o'clock).

    $nc : int = 2

    Number of curves used to draw a 90 degrees portion of arc.

    Tags
    author

    Maxime Delorme, Nicola Asuni

    since
    3.1.000

    (2008-06-09)

    public

    pixelsToUnits()

    Converts pixels to User's Units.

    public pixelsToUnits(int $px) : float
    Parameters
    $px : int

    pixels

    Tags
    public
    see

    setImageScale(), getImageScale()

    Return values
    float

    value in user's unit

    Polycurve()

    Draws a poly-Bezier curve.

    public Polycurve(float $x0, float $y0, array<string|int, float> $segments[, string $style = '' ][, array<string|int, mixed> $line_style = array() ][, array<string|int, mixed> $fill_color = array() ]) : mixed

    Each Bezier curve segment is a tangent to the line between the control points at either end of the curve.

    Parameters
    $x0 : float

    Abscissa of start point.

    $y0 : float

    Ordinate of start point.

    $segments : array<string|int, float>

    An array of bezier descriptions. Format: array(x1, y1, x2, y2, x3, y3).

    $style : string = ''

    Style of rendering. See the getPathPaintOperator() function for more information.

    $line_style : array<string|int, mixed> = array()

    Line style of curve. Array like for SetLineStyle(). Default value: default line style (empty array).

    $fill_color : array<string|int, mixed> = array()

    Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K) or array(C,M,Y,K,SpotColorName). Default value: default color (empty array).

    Tags
    public
    see
    SetLineStyle()
    since
    3.0008

    (2008-05-12)

    Polygon()

    Draws a polygon.

    public Polygon(array<string|int, mixed> $p[, string $style = '' ][, array<string|int, mixed> $line_style = array() ][, array<string|int, mixed> $fill_color = array() ][, bool $closed = true ]) : mixed
    Parameters
    $p : array<string|int, mixed>

    Points 0 to ($np - 1). Array with values (x0, y0, x1, y1,..., x(np-1), y(np - 1))

    $style : string = ''

    Style of rendering. See the getPathPaintOperator() function for more information.

    $line_style : array<string|int, mixed> = array()

    Line style of polygon. Array with keys among the following:

    • all: Line style of all lines. Array like for SetLineStyle().
    • 0 to ($np - 1): Line style of each line. Array like for SetLineStyle().
    If a key is not present or is null, not draws the line. Default value is default line style (empty array).
    $fill_color : array<string|int, mixed> = array()

    Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K) or array(C,M,Y,K,SpotColorName). Default value: default color (empty array).

    $closed : bool = true

    if true the polygon is closes, otherwise will remain open

    Tags
    public
    since
    2.1.000

    (2008-01-08)

    PolyLine()

    Draws a polygonal line

    public PolyLine(array<string|int, mixed> $p[, string $style = '' ][, array<string|int, mixed> $line_style = array() ][, array<string|int, mixed> $fill_color = array() ]) : mixed
    Parameters
    $p : array<string|int, mixed>

    Points 0 to ($np - 1). Array with values (x0, y0, x1, y1,..., x(np-1), y(np - 1))

    $style : string = ''

    Style of rendering. See the getPathPaintOperator() function for more information.

    $line_style : array<string|int, mixed> = array()

    Line style of polygon. Array with keys among the following:

    • all: Line style of all lines. Array like for SetLineStyle().
    • 0 to ($np - 1): Line style of each line. Array like for SetLineStyle().
    If a key is not present or is null, not draws the line. Default value is default line style (empty array).
    $fill_color : array<string|int, mixed> = array()

    Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K) or array(C,M,Y,K,SpotColorName). Default value: default color (empty array).

    Tags
    since
    4.8.003

    (2009-09-15)

    public

    printTemplate()

    Print an XObject Template.

    public printTemplate(string $id[, float|null $x = null ][, float|null $y = null ][, float $w = 0 ][, float $h = 0 ][, string $align = '' ][, string $palign = '' ][, bool $fitonpage = false ]) : mixed

    You can print an XObject Template inside the currently opened Template. An XObject Template is a PDF block that is a self-contained description of any sequence of graphics objects (including path objects, text objects, and sampled images). An XObject Template may be painted multiple times, either on several pages or at several locations on the same page and produces the same results each time, subject only to the graphics state at the time it is invoked.

    Parameters
    $id : string

    The ID of XObject Template to print.

    $x : float|null = null

    X position in user units (empty string = current x position)

    $y : float|null = null

    Y position in user units (empty string = current y position)

    $w : float = 0

    Width in user units (zero = remaining page width)

    $h : float = 0

    Height in user units (zero = remaining page height)

    $align : string = ''

    Indicates the alignment of the pointer next to template insertion relative to template height. The value can be:

    • T: top-right for LTR or top-left for RTL
    • M: middle-right for LTR or middle-left for RTL
    • B: bottom-right for LTR or bottom-left for RTL
    • N: next line
    $palign : string = ''

    Allows to center or align the template on the current line. Possible values are:

    • L : left align
    • C : center
    • R : right align
    • '' : empty string : left for LTR or right for RTL
    $fitonpage : bool = false

    If true the template is resized to not exceed page dimensions.

    Tags
    author

    Nicola Asuni

    public
    since
    5.8.017

    (2010-08-24)

    see

    startTemplate(), endTemplate()

    RadialGradient()

    Paints a radial colour gradient.

    public RadialGradient(float $x, float $y, float $w, float $h[, array<string|int, mixed> $col1 = array() ][, array<string|int, mixed> $col2 = array() ][, array<string|int, mixed> $coords = array(0.5, 0.5, 0.5, 0.5, 1) ]) : mixed
    Parameters
    $x : float

    abscissa of the top left corner of the rectangle.

    $y : float

    ordinate of the top left corner of the rectangle.

    $w : float

    width of the rectangle.

    $h : float

    height of the rectangle.

    $col1 : array<string|int, mixed> = array()

    first color (Grayscale, RGB or CMYK components).

    $col2 : array<string|int, mixed> = array()

    second color (Grayscale, RGB or CMYK components).

    $coords : array<string|int, mixed> = array(0.5, 0.5, 0.5, 0.5, 1)

    array of the form (fx, fy, cx, cy, r) where (fx, fy) is the starting point of the gradient with color1, (cx, cy) is the center of the circle with color2, and r is the radius of the circle (see radial_gradient_coords.jpg). (fx, fy) should be inside the circle, otherwise some areas will not be defined.

    Tags
    author

    Andreas W\FCrmser, Nicola Asuni

    since
    3.1.000

    (2008-06-09)

    public

    RadioButton()

    Creates a RadioButton field.

    public RadioButton(string $name, int $w[, array<string|int, mixed> $prop = array() ][, array<string|int, mixed> $opt = array() ][, string $onvalue = 'On' ][, bool $checked = false ][, float|null $x = null ][, float|null $y = null ][, bool $js = false ]) : mixed
    Parameters
    $name : string

    Field name.

    $w : int

    Width of the radio button.

    $prop : array<string|int, mixed> = array()

    Javascript field properties. Possible values are described on official Javascript for Acrobat API reference.

    $opt : array<string|int, mixed> = array()

    Annotation parameters. Possible values are described on official PDF32000_2008 reference.

    $onvalue : string = 'On'

    Value to be returned if selected.

    $checked : bool = false

    Define the initial state.

    $x : float|null = null

    Abscissa of the upper-left corner of the rectangle

    $y : float|null = null

    Ordinate of the upper-left corner of the rectangle

    $js : bool = false

    If true put the field using JavaScript (requires Acrobat Writer to be rendered).

    Tags
    public
    author

    Nicola Asuni

    since
    4.8.000

    (2009-09-07)

    Rect()

    Draws a rectangle.

    public Rect(float $x, float $y, float $w, float $h[, string $style = '' ][, array<string|int, mixed> $border_style = array() ][, array<string|int, mixed> $fill_color = array() ]) : mixed
    Parameters
    $x : float

    Abscissa of upper-left corner.

    $y : float

    Ordinate of upper-left corner.

    $w : float

    Width.

    $h : float

    Height.

    $style : string = ''

    Style of rendering. See the getPathPaintOperator() function for more information.

    $border_style : array<string|int, mixed> = array()

    Border style of rectangle. Array with keys among the following:

    • all: Line style of all borders. Array like for SetLineStyle().
    • L, T, R, B or combinations: Line style of left, top, right or bottom border. Array like for SetLineStyle().
    If a key is not present or is null, the correspondent border is not drawn. Default value: default line style (empty array).
    $fill_color : array<string|int, mixed> = array()

    Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K) or array(C,M,Y,K,SpotColorName). Default value: default color (empty array).

    Tags
    public
    since
    1.0
    see
    SetLineStyle()

    registrationMark()

    Paints a registration mark

    public registrationMark(float $x, float $y, float $r[, bool $double = false ][, array<string|int, mixed> $cola = array(100, 100, 100, 100, 'All') ][, array<string|int, mixed> $colb = array(0, 0, 0, 0, 'None') ]) : mixed
    Parameters
    $x : float

    abscissa of the registration mark center.

    $y : float

    ordinate of the registration mark center.

    $r : float

    radius of the crop mark.

    $double : bool = false

    if true print two concentric crop marks.

    $cola : array<string|int, mixed> = array(100, 100, 100, 100, 'All')

    crop mark color (default spot registration color 'All').

    $colb : array<string|int, mixed> = array(0, 0, 0, 0, 'None')

    second crop mark color (default spot registration color 'None').

    Tags
    author

    Nicola Asuni

    since
    4.9.000

    (2010-03-26)

    public

    registrationMarkCMYK()

    Paints a CMYK registration mark

    public registrationMarkCMYK(float $x, float $y, float $r) : mixed
    Parameters
    $x : float

    abscissa of the registration mark center.

    $y : float

    ordinate of the registration mark center.

    $r : float

    radius of the crop mark.

    Tags
    author

    Nicola Asuni

    since
    6.0.038

    (2013-09-30)

    public

    RegularPolygon()

    Draws a regular polygon.

    public RegularPolygon(float $x0, float $y0, float $r, int $ns[, float $angle = 0 ][, bool $draw_circle = false ][, string $style = '' ][, array<string|int, mixed> $line_style = array() ][, array<string|int, mixed> $fill_color = array() ][, string $circle_style = '' ][, array<string|int, mixed> $circle_outLine_style = array() ][, array<string|int, mixed> $circle_fill_color = array() ]) : mixed
    Parameters
    $x0 : float

    Abscissa of center point.

    $y0 : float

    Ordinate of center point.

    $r : float

    Radius of inscribed circle.

    $ns : int

    Number of sides.

    $angle : float = 0

    Angle oriented (anti-clockwise). Default value: 0.

    $draw_circle : bool = false

    Draw inscribed circle or not. Default value: false.

    $style : string = ''

    Style of rendering. See the getPathPaintOperator() function for more information.

    $line_style : array<string|int, mixed> = array()

    Line style of polygon sides. Array with keys among the following:

    • all: Line style of all sides. Array like for SetLineStyle().
    • 0 to ($ns - 1): Line style of each side. Array like for SetLineStyle().
    If a key is not present or is null, not draws the side. Default value is default line style (empty array).
    $fill_color : array<string|int, mixed> = array()

    Fill color. Format: array(red, green, blue). Default value: default color (empty array).

    $circle_style : string = ''

    Style of rendering of inscribed circle (if draws). Possible values are:

    • D or empty string: Draw (default).
    • F: Fill.
    • DF or FD: Draw and fill.
    • CNZ: Clipping mode (using the even-odd rule to determine which regions lie inside the clipping path).
    • CEO: Clipping mode (using the nonzero winding number rule to determine which regions lie inside the clipping path).
    $circle_outLine_style : array<string|int, mixed> = array()

    Line style of inscribed circle (if draws). Array like for SetLineStyle(). Default value: default line style (empty array).

    $circle_fill_color : array<string|int, mixed> = array()

    Fill color of inscribed circle (if draws). Format: array(red, green, blue). Default value: default color (empty array).

    Tags
    public
    since
    2.1.000

    (2008-01-08)

    removePageRegion()

    Remove a single no-write region.

    public removePageRegion(int $key) : mixed
    Parameters
    $key : int

    region key

    Tags
    author

    Nicola Asuni

    public
    since
    5.9.003

    (2010-10-13)

    see

    setPageRegions(), getPageRegions()

    replaceMissingChars()

    Replace missing font characters on selected font with specified substitutions.

    public replaceMissingChars(string $text[, string $font = '' ][, string $style = '' ][, array<string|int, mixed> $subs = array() ]) : string
    Parameters
    $text : string

    Text to process.

    $font : string = ''

    Font name (family name).

    $style : string = ''

    Font style.

    $subs : array<string|int, mixed> = array()

    Array of possible character substitutions. The key is the character to check (integer value) and the value is a single intege value or an array of possible substitutes.

    Tags
    public
    since
    5.9.153

    (2012-03-28)

    Return values
    string

    Processed text.

    resetColumns()

    Remove columns and reset page margins.

    public resetColumns() : mixed
    Tags
    public
    since
    5.9.072

    (2011-04-26)

    resetHeaderTemplate()

    Reset the xobject template used by Header() method.

    public resetHeaderTemplate() : mixed
    Tags
    public

    resetLastH()

    Reset the last cell height.

    public resetLastH() : mixed
    Tags
    public
    since
    5.9.000

    (2010-10-03)

    rollbackTransaction()

    This method allows to undo the latest transaction by returning the latest saved TCPDF object with startTransaction().

    public rollbackTransaction([bool $self = false ]) : TCPDF
    Parameters
    $self : bool = false

    if true restores current class object to previous state without the need of reassignment via the returned value.

    Tags
    public
    since
    4.5.029

    (2009-03-19)

    Return values
    TCPDF

    object.

    Rotate()

    Rotate object.

    public Rotate(float $angle[, float|null $x = null ][, float|null $y = null ]) : mixed
    Parameters
    $angle : float

    angle in degrees for counter-clockwise rotation

    $x : float|null = null

    abscissa of the rotation center. Default is current x position

    $y : float|null = null

    ordinate of the rotation center. Default is current y position

    Tags
    public
    since
    2.1.000

    (2008-01-07)

    see

    StartTransform(), StopTransform()

    RoundedRect()

    Draws a rounded rectangle.

    public RoundedRect(float $x, float $y, float $w, float $h, float $r[, string $round_corner = '1111' ][, string $style = '' ][, array<string|int, mixed> $border_style = array() ][, array<string|int, mixed> $fill_color = array() ]) : mixed
    Parameters
    $x : float

    Abscissa of upper-left corner.

    $y : float

    Ordinate of upper-left corner.

    $w : float

    Width.

    $h : float

    Height.

    $r : float

    the radius of the circle used to round off the corners of the rectangle.

    $round_corner : string = '1111'

    Draws rounded corner or not. String with a 0 (not rounded i-corner) or 1 (rounded i-corner) in i-position. Positions are, in order and begin to 0: top right, bottom right, bottom left and top left. Default value: all rounded corner ("1111").

    $style : string = ''

    Style of rendering. See the getPathPaintOperator() function for more information.

    $border_style : array<string|int, mixed> = array()

    Border style of rectangle. Array like for SetLineStyle(). Default value: default line style (empty array).

    $fill_color : array<string|int, mixed> = array()

    Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K) or array(C,M,Y,K,SpotColorName). Default value: default color (empty array).

    Tags
    public
    since
    2.1.000

    (2008-01-08)

    RoundedRectXY()

    Draws a rounded rectangle.

    public RoundedRectXY(float $x, float $y, float $w, float $h, float $rx, float $ry[, string $round_corner = '1111' ][, string $style = '' ][, array<string|int, mixed> $border_style = array() ][, array<string|int, mixed> $fill_color = array() ]) : mixed
    Parameters
    $x : float

    Abscissa of upper-left corner.

    $y : float

    Ordinate of upper-left corner.

    $w : float

    Width.

    $h : float

    Height.

    $rx : float

    the x-axis radius of the ellipse used to round off the corners of the rectangle.

    $ry : float

    the y-axis radius of the ellipse used to round off the corners of the rectangle.

    $round_corner : string = '1111'

    Draws rounded corner or not. String with a 0 (not rounded i-corner) or 1 (rounded i-corner) in i-position. Positions are, in order and begin to 0: top right, bottom right, bottom left and top left. Default value: all rounded corner ("1111").

    $style : string = ''

    Style of rendering. See the getPathPaintOperator() function for more information.

    $border_style : array<string|int, mixed> = array()

    Border style of rectangle. Array like for SetLineStyle(). Default value: default line style (empty array).

    $fill_color : array<string|int, mixed> = array()

    Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K) or array(C,M,Y,K,SpotColorName). Default value: default color (empty array).

    Tags
    public
    since
    4.9.019

    (2010-04-22)

    Scale()

    Vertical and horizontal non-proportional Scaling.

    public Scale(float $s_x, float $s_y[, float|null $x = null ][, float|null $y = null ]) : mixed
    Parameters
    $s_x : float

    scaling factor for width as percent. 0 is not allowed.

    $s_y : float

    scaling factor for height as percent. 0 is not allowed.

    $x : float|null = null

    abscissa of the scaling center. Default is current x position

    $y : float|null = null

    ordinate of the scaling center. Default is current y position

    Tags
    public
    since
    2.1.000

    (2008-01-07)

    see

    StartTransform(), StopTransform()

    ScaleX()

    Horizontal Scaling.

    public ScaleX(float $s_x[, int $x = '' ][, int $y = '' ]) : mixed
    Parameters
    $s_x : float

    scaling factor for width as percent. 0 is not allowed.

    $x : int = ''

    abscissa of the scaling center. Default is current x position

    $y : int = ''

    ordinate of the scaling center. Default is current y position

    Tags
    public
    since
    2.1.000

    (2008-01-07)

    see

    StartTransform(), StopTransform()

    ScaleXY()

    Vertical and horizontal proportional Scaling.

    public ScaleXY(float $s[, int $x = '' ][, int $y = '' ]) : mixed
    Parameters
    $s : float

    scaling factor for width and height as percent. 0 is not allowed.

    $x : int = ''

    abscissa of the scaling center. Default is current x position

    $y : int = ''

    ordinate of the scaling center. Default is current y position

    Tags
    public
    since
    2.1.000

    (2008-01-07)

    see

    StartTransform(), StopTransform()

    ScaleY()

    Vertical Scaling.

    public ScaleY(float $s_y[, int $x = '' ][, int $y = '' ]) : mixed
    Parameters
    $s_y : float

    scaling factor for height as percent. 0 is not allowed.

    $x : int = ''

    abscissa of the scaling center. Default is current x position

    $y : int = ''

    ordinate of the scaling center. Default is current y position

    Tags
    public
    since
    2.1.000

    (2008-01-07)

    see

    StartTransform(), StopTransform()

    selectColumn()

    Set position at a given column

    public selectColumn([int|null $col = null ]) : mixed
    Parameters
    $col : int|null = null

    column number (from 0 to getNumberOfColumns()-1); empty string = current column.

    Tags
    public
    since
    4.9.001

    (2010-03-28)

    serializeTCPDFtag()

    Serialize data to be used with TCPDF tag in HTML code.

    public serializeTCPDFtag(string $method[, array<string|int, mixed> $params = array() ]) : string
    Parameters
    $method : string

    TCPDF method name

    $params : array<string|int, mixed> = array()

    Method parameters

    Tags
    public

    static

    Return values
    string

    Serialized data

    setAbsX()

    Set the absolute X coordinate of the current pointer.

    public setAbsX(float $x) : mixed
    Parameters
    $x : float

    The value of the abscissa in user units.

    Tags
    public
    since
    5.9.186

    (2012-09-13)

    see

    setAbsX(), setAbsY(), SetAbsXY()

    setAbsXY()

    Set the absolute X and Y coordinates of the current pointer.

    public setAbsXY(float $x, float $y) : mixed
    Parameters
    $x : float

    The value of the abscissa in user units.

    $y : float

    (float) The value of the ordinate in user units.

    Tags
    public
    since
    5.9.186

    (2012-09-13)

    see

    setAbsX(), setAbsY(), SetAbsXY()

    setAbsY()

    Set the absolute Y coordinate of the current pointer.

    public setAbsY(float $y) : mixed
    Parameters
    $y : float

    (float) The value of the ordinate in user units.

    Tags
    public
    since
    5.9.186

    (2012-09-13)

    see

    setAbsX(), setAbsY(), SetAbsXY()

    setAllowLocalFiles()

    Whether to allow local file path in image html tags, when prefixed with file://

    public setAllowLocalFiles(bool $allowLocalFiles) : mixed
    Parameters
    $allowLocalFiles : bool

    true, when local files should be allowed. Otherwise false.

    Tags
    public
    since
    6.4

    setAlpha()

    Set alpha for stroking (CA) and non-stroking (ca) operations.

    public setAlpha([float $stroking = 1 ][, string $bm = 'Normal' ][, float|null $nonstroking = null ][, bool $ais = false ]) : mixed
    Parameters
    $stroking : float = 1

    Alpha value for stroking operations: real value from 0 (transparent) to 1 (opaque).

    $bm : string = 'Normal'

    blend mode, one of the following: Normal, Multiply, Screen, Overlay, Darken, Lighten, ColorDodge, ColorBurn, HardLight, SoftLight, Difference, Exclusion, Hue, Saturation, Color, Luminosity

    $nonstroking : float|null = null

    Alpha value for non-stroking operations: real value from 0 (transparent) to 1 (opaque).

    $ais : bool = false
    Tags
    public
    since
    3.0.000

    (2008-03-27)

    setAuthor()

    Defines the author of the document.

    public setAuthor(string $author) : mixed
    Parameters
    $author : string

    The name of the author.

    Tags
    public
    since
    1.2
    see

    SetCreator(), SetKeywords(), SetSubject(), SetTitle()

    setAutoPageBreak()

    Enables or disables the automatic page breaking mode. When enabling, the second parameter is the distance from the bottom of the page that defines the triggering limit. By default, the mode is on and the margin is 2 cm.

    public setAutoPageBreak(bool $auto[, float $margin = 0 ]) : mixed
    Parameters
    $auto : bool

    Boolean indicating if mode should be on or off.

    $margin : float = 0

    Distance from the bottom of the page.

    Tags
    public
    since
    1.0
    see

    Cell(), MultiCell(), AcceptPageBreak()

    setBarcode()

    Set document barcode.

    public setBarcode([string $bc = '' ]) : mixed
    Parameters
    $bc : string = ''

    barcode

    Tags
    public

    setBooklet()

    Set the booklet mode for double-sided pages.

    public setBooklet([bool $booklet = true ][, float $inner = -1 ][, float $outer = -1 ]) : mixed
    Parameters
    $booklet : bool = true

    true set the booklet mode on, false otherwise.

    $inner : float = -1

    Inner page margin.

    $outer : float = -1

    Outer page margin.

    Tags
    public
    since
    4.2.000

    (2008-10-29)

    setBookmark()

    Adds a bookmark - alias for Bookmark().

    public setBookmark(string $txt[, int $level = 0 ][, float $y = -1 ][, int|string $page = '' ][, string $style = '' ][, array<string|int, mixed> $color = array(0, 0, 0) ][, float $x = -1 ][, mixed $link = '' ]) : mixed
    Parameters
    $txt : string

    Bookmark description.

    $level : int = 0

    Bookmark level (minimum value is 0).

    $y : float = -1

    Y position in user units of the bookmark on the selected page (default = -1 = current position; 0 = page start;).

    $page : int|string = ''

    Target page number (leave empty for current page). If you prefix a page number with the * character, then this page will not be changed when adding/deleting/moving pages.

    $style : string = ''

    Font style: B = Bold, I = Italic, BI = Bold + Italic.

    $color : array<string|int, mixed> = array(0, 0, 0)

    RGB color array (values from 0 to 255).

    $x : float = -1

    X position in user units of the bookmark on the selected page (default = -1 = current position;).

    $link : mixed = ''

    URL, or numerical link ID, or named destination (# character followed by the destination name), or embedded file (* character followed by the file name).

    Tags
    public

    setCellHeightRatio()

    Set the height of the cell (line height) respect the font height.

    public setCellHeightRatio(float $h) : mixed
    Parameters
    $h : float

    cell proportion respect font height (typical value = 1.25).

    Tags
    public
    since
    3.0.014

    (2008-06-04)

    setCellMargins()

    Set the internal Cell margins.

    public setCellMargins([int|float|null $left = null ][, int|float|null $top = null ][, int|float|null $right = null ][, int|float|null $bottom = null ]) : mixed
    Parameters
    $left : int|float|null = null

    left margin

    $top : int|float|null = null

    top margin

    $right : int|float|null = null

    right margin

    $bottom : int|float|null = null

    bottom margin

    Tags
    public
    since
    5.9.000

    (2010-10-03)

    see
    getCellMargins()

    setCellPadding()

    Set the same internal Cell padding for top, right, bottom, left-

    public setCellPadding(int|float $pad) : mixed
    Parameters
    $pad : int|float

    internal padding.

    Tags
    public
    since
    2.1.000

    (2008-01-09)

    see

    getCellPaddings(), setCellPaddings()

    setCellPaddings()

    Set the internal Cell paddings.

    public setCellPaddings([int|float|null $left = null ][, int|float|null $top = null ][, int|float|null $right = null ][, int|float|null $bottom = null ]) : mixed
    Parameters
    $left : int|float|null = null

    left padding

    $top : int|float|null = null

    top padding

    $right : int|float|null = null

    right padding

    $bottom : int|float|null = null

    bottom padding

    Tags
    public
    since
    5.9.000

    (2010-10-03)

    see

    getCellPaddings(), SetCellPadding()

    setColor()

    Defines the color used by the specified type ('draw', 'fill', 'text').

    public setColor(string $type[, float $col1 = 0 ][, float $col2 = -1 ][, float $col3 = -1 ][, float $col4 = -1 ][, bool $ret = false ][, string $name = '' ]) : string
    Parameters
    $type : string

    Type of object affected by this color: ('draw', 'fill', 'text').

    $col1 : float = 0

    GRAY level for single color, or Red color for RGB (0-255), or CYAN color for CMYK (0-100).

    $col2 : float = -1

    GREEN color for RGB (0-255), or MAGENTA color for CMYK (0-100).

    $col3 : float = -1

    BLUE color for RGB (0-255), or YELLOW color for CMYK (0-100).

    $col4 : float = -1

    KEY (BLACK) color for CMYK (0-100).

    $ret : bool = false

    If true do not send the command.

    $name : string = ''

    spot color name (if any)

    Tags
    public
    since
    5.9.125

    (2011-10-03)

    Return values
    string

    The PDF command or empty string.

    setColorArray()

    Set the color array for the specified type ('draw', 'fill', 'text').

    public setColorArray(string $type, array<string|int, mixed> $color[, bool $ret = false ]) : string

    It can be expressed in RGB, CMYK or GRAY SCALE components. The method can be called before the first page is created and the value is retained from page to page.

    Parameters
    $type : string

    Type of object affected by this color: ('draw', 'fill', 'text').

    $color : array<string|int, mixed>

    Array of colors (1=gray, 3=RGB, 4=CMYK or 5=spotcolor=CMYK+name values).

    $ret : bool = false

    If true do not send the PDF command.

    Tags
    public
    since
    3.1.000

    (2008-06-11)

    Return values
    string

    The PDF command or empty string.

    setColumnsArray()

    Set columns array.

    public setColumnsArray(array<string|int, mixed> $columns) : mixed

    Each column is represented by an array of arrays with the following keys: (w = width, s = space between columns, y = column top position).

    Parameters
    $columns : array<string|int, mixed>
    Tags
    public
    since
    4.9.001

    (2010-03-28)

    setCompression()

    Activates or deactivates page compression. When activated, the internal representation of each page is compressed, which leads to a compression ratio of about 2 for the resulting document. Compression is on by default.

    public setCompression([bool $compress = true ]) : mixed

    Note: the Zlib extension is required for this feature. If not present, compression will be turned off.

    Parameters
    $compress : bool = true

    Boolean indicating if compression must be enabled.

    Tags
    public
    since
    1.4

    setCreator()

    Defines the creator of the document. This is typically the name of the application that generates the PDF.

    public setCreator(string $creator) : mixed
    Parameters
    $creator : string

    The name of the creator.

    Tags
    public
    since
    1.2
    see

    SetAuthor(), SetKeywords(), SetSubject(), SetTitle()

    setDefaultMonospacedFont()

    Defines the default monospaced font.

    public setDefaultMonospacedFont(string $font) : mixed
    Parameters
    $font : string

    Font name.

    Tags
    public
    since
    4.5.025

    setDefaultTableColumns()

    Set the default number of columns in a row for HTML tables.

    public setDefaultTableColumns([int $cols = 4 ]) : mixed
    Parameters
    $cols : int = 4

    number of columns

    Tags
    public
    since
    3.0.014

    (2008-06-04)

    setDestination()

    Add a Named Destination.

    public setDestination(string $name[, float $y = -1 ][, int|string $page = '' ][, float $x = -1 ]) : string|false

    NOTE: destination names are unique, so only last entry will be saved.

    Parameters
    $name : string

    Destination name.

    $y : float = -1

    Y position in user units of the destiantion on the selected page (default = -1 = current position; 0 = page start;).

    $page : int|string = ''

    Target page number (leave empty for current page). If you prefix a page number with the * character, then this page will not be changed when adding/deleting/moving pages.

    $x : float = -1

    X position in user units of the destiantion on the selected page (default = -1 = current position;).

    Tags
    public
    author

    Christian Deligant, Nicola Asuni

    since
    5.9.097

    (2011-06-23)

    Return values
    string|false

    Stripped named destination identifier or false in case of error.

    setDisplayMode()

    Defines the way the document is to be displayed by the viewer.

    public setDisplayMode(mixed $zoom[, string $layout = 'SinglePage' ][, string $mode = 'UseNone' ]) : mixed
    Parameters
    $zoom : mixed

    The zoom to use. It can be one of the following string values or a number indicating the zooming factor to use.

    • fullpage: displays the entire page on screen
    • fullwidth: uses maximum width of window
    • real: uses real size (equivalent to 100% zoom)
    • default: uses viewer default mode
    $layout : string = 'SinglePage'

    The page layout. Possible values are:

    • SinglePage Display one page at a time
    • OneColumn Display the pages in one column
    • TwoColumnLeft Display the pages in two columns, with odd-numbered pages on the left
    • TwoColumnRight Display the pages in two columns, with odd-numbered pages on the right
    • TwoPageLeft (PDF 1.5) Display the pages two at a time, with odd-numbered pages on the left
    • TwoPageRight (PDF 1.5) Display the pages two at a time, with odd-numbered pages on the right
    $mode : string = 'UseNone'

    A name object specifying how the document should be displayed when opened:

    • UseNone Neither document outline nor thumbnail images visible
    • UseOutlines Document outline visible
    • UseThumbs Thumbnail images visible
    • FullScreen Full-screen mode, with no menu bar, window controls, or any other window visible
    • UseOC (PDF 1.5) Optional content group panel visible
    • UseAttachments (PDF 1.6) Attachments panel visible
    Tags
    public
    since
    1.2

    setDocCreationTimestamp()

    Set the document creation timestamp

    public setDocCreationTimestamp(mixed $time) : mixed
    Parameters
    $time : mixed

    Document creation timestamp in seconds or date-time string.

    Tags
    public
    since
    5.9.152

    (2012-03-23)

    setDocInfoUnicode()

    Turn on/off Unicode mode for document information dictionary (meta tags).

    public setDocInfoUnicode([bool $unicode = true ]) : mixed

    This has effect only when unicode mode is set to false.

    Parameters
    $unicode : bool = true

    if true set the meta information in Unicode

    Tags
    since
    5.9.027

    (2010-12-01)

    public

    setDocModificationTimestamp()

    Set the document modification timestamp

    public setDocModificationTimestamp(mixed $time) : mixed
    Parameters
    $time : mixed

    Document modification timestamp in seconds or date-time string.

    Tags
    public
    since
    5.9.152

    (2012-03-23)

    setDrawColor()

    Defines the color used for all drawing operations (lines, rectangles and cell borders). It can be expressed in RGB components or gray scale. The method can be called before the first page is created and the value is retained from page to page.

    public setDrawColor([float $col1 = 0 ][, float $col2 = -1 ][, float $col3 = -1 ][, float $col4 = -1 ][, bool $ret = false ][, string $name = '' ]) : string
    Parameters
    $col1 : float = 0

    GRAY level for single color, or Red color for RGB (0-255), or CYAN color for CMYK (0-100).

    $col2 : float = -1

    GREEN color for RGB (0-255), or MAGENTA color for CMYK (0-100).

    $col3 : float = -1

    BLUE color for RGB (0-255), or YELLOW color for CMYK (0-100).

    $col4 : float = -1

    KEY (BLACK) color for CMYK (0-100).

    $ret : bool = false

    If true do not send the command.

    $name : string = ''

    spot color name (if any)

    Tags
    public
    since
    1.3
    see

    SetDrawColorArray(), SetFillColor(), SetTextColor(), Line(), Rect(), Cell(), MultiCell()

    Return values
    string

    the PDF command

    setDrawColorArray()

    Defines the color used for all drawing operations (lines, rectangles and cell borders).

    public setDrawColorArray(array<string|int, mixed> $color[, bool $ret = false ]) : string

    It can be expressed in RGB, CMYK or GRAY SCALE components. The method can be called before the first page is created and the value is retained from page to page.

    Parameters
    $color : array<string|int, mixed>

    Array of colors (1, 3 or 4 values).

    $ret : bool = false

    If true do not send the PDF command.

    Tags
    public
    since
    3.1.000

    (2008-06-11)

    see
    SetDrawColor()
    Return values
    string

    the PDF command

    setDrawSpotColor()

    Defines the spot color used for all drawing operations (lines, rectangles and cell borders).

    public setDrawSpotColor(string $name[, float $tint = 100 ]) : mixed
    Parameters
    $name : string

    Name of the spot color.

    $tint : float = 100

    Intensity of the color (from 0 to 100 ; 100 = full intensity by default).

    Tags
    public
    since
    4.0.024

    (2008-09-12)

    see

    AddSpotColor(), SetFillSpotColor(), SetTextSpotColor()

    setEqualColumns()

    Set multiple columns of the same size

    public setEqualColumns([int $numcols = 0 ][, int $width = 0 ][, int|null $y = null ]) : mixed
    Parameters
    $numcols : int = 0

    number of columns (set to zero to disable columns mode)

    $width : int = 0

    column width

    $y : int|null = null

    column starting Y position (leave empty for current Y position)

    Tags
    public
    since
    4.9.001

    (2010-03-28)

    setExtraXMP()

    Set additional XMP data to be added on the default XMP data just before the end of "x:xmpmeta" tag.

    public setExtraXMP(string $xmp) : mixed

    IMPORTANT: This data is added as-is without controls, so you have to validate your data before using this method!

    Parameters
    $xmp : string

    Custom XMP data.

    Tags
    since
    5.9.128

    (2011-10-06)

    public

    setExtraXMPRDF()

    Set additional XMP data to be added on the default XMP data just before the end of "rdf:RDF" tag.

    public setExtraXMPRDF(string $xmp) : mixed

    IMPORTANT: This data is added as-is without controls, so you have to validate your data before using this method!

    Parameters
    $xmp : string

    Custom XMP RDF data.

    Tags
    since
    6.3.0

    (2019-09-19)

    public

    setFillColor()

    Defines the color used for all filling operations (filled rectangles and cell backgrounds). It can be expressed in RGB components or gray scale. The method can be called before the first page is created and the value is retained from page to page.

    public setFillColor([float $col1 = 0 ][, float $col2 = -1 ][, float $col3 = -1 ][, float $col4 = -1 ][, bool $ret = false ][, string $name = '' ]) : string
    Parameters
    $col1 : float = 0

    GRAY level for single color, or Red color for RGB (0-255), or CYAN color for CMYK (0-100).

    $col2 : float = -1

    GREEN color for RGB (0-255), or MAGENTA color for CMYK (0-100).

    $col3 : float = -1

    BLUE color for RGB (0-255), or YELLOW color for CMYK (0-100).

    $col4 : float = -1

    KEY (BLACK) color for CMYK (0-100).

    $ret : bool = false

    If true do not send the command.

    $name : string = ''

    Spot color name (if any).

    Tags
    public
    since
    1.3
    see

    SetFillColorArray(), SetDrawColor(), SetTextColor(), Rect(), Cell(), MultiCell()

    Return values
    string

    The PDF command.

    setFillColorArray()

    Defines the color used for all filling operations (filled rectangles and cell backgrounds).

    public setFillColorArray(array<string|int, mixed> $color[, bool $ret = false ]) : mixed

    It can be expressed in RGB, CMYK or GRAY SCALE components. The method can be called before the first page is created and the value is retained from page to page.

    Parameters
    $color : array<string|int, mixed>

    Array of colors (1, 3 or 4 values).

    $ret : bool = false

    If true do not send the PDF command.

    Tags
    public
    since
    3.1.000

    (2008-6-11)

    see
    SetFillColor()

    setFillSpotColor()

    Defines the spot color used for all filling operations (filled rectangles and cell backgrounds).

    public setFillSpotColor(string $name[, float $tint = 100 ]) : mixed
    Parameters
    $name : string

    Name of the spot color.

    $tint : float = 100

    Intensity of the color (from 0 to 100 ; 100 = full intensity by default).

    Tags
    public
    since
    4.0.024

    (2008-09-12)

    see

    AddSpotColor(), SetDrawSpotColor(), SetTextSpotColor()

    setFont()

    Sets the font used to print character strings.

    public setFont(string $family[, string $style = '' ][, float|null $size = null ][, string $fontfile = '' ][, mixed $subset = 'default' ][, bool $out = true ]) : mixed

    The font can be either a standard one or a font added via the AddFont() method. Standard fonts use Windows encoding cp1252 (Western Europe). The method can be called before the first page is created and the font is retained from page to page. If you just wish to change the current font size, it is simpler to call SetFontSize(). Note: for the standard fonts, the font metric files must be accessible. There are three possibilities for this:

    • They are in the current directory (the one where the running script lies)
    • They are in one of the directories defined by the include_path parameter
    • They are in the directory defined by the K_PATH_FONTS constant

    Parameters
    $family : string

    Family font. It can be either a name defined by AddFont() or one of the standard Type1 families (case insensitive):

    • times (Times-Roman)
    • timesb (Times-Bold)
    • timesi (Times-Italic)
    • timesbi (Times-BoldItalic)
    • helvetica (Helvetica)
    • helveticab (Helvetica-Bold)
    • helveticai (Helvetica-Oblique)
    • helveticabi (Helvetica-BoldOblique)
    • courier (Courier)
    • courierb (Courier-Bold)
    • courieri (Courier-Oblique)
    • courierbi (Courier-BoldOblique)
    • symbol (Symbol)
    • zapfdingbats (ZapfDingbats)
    It is also possible to pass an empty string. In that case, the current family is retained.
    $style : string = ''

    Font style. Possible values are (case insensitive):

    • empty string: regular
    • B: bold
    • I: italic
    • U: underline
    • D: line through
    • O: overline
    or any combination. The default value is regular. Bold and italic styles do not apply to Symbol and ZapfDingbats basic fonts or other fonts when not defined.
    $size : float|null = null

    Font size in points. The default value is the current size. If no size has been specified since the beginning of the document, the value taken is 12

    $fontfile : string = ''

    The font definition file. By default, the name is built from the family and style, in lower case with no spaces.

    $subset : mixed = 'default'

    if true embedd only a subset of the font (stores only the information related to the used characters); if false embedd full font; if 'default' uses the default value set using setFontSubsetting(). This option is valid only for TrueTypeUnicode fonts. If you want to enable users to change the document, set this parameter to false. If you subset the font, the person who receives your PDF would need to have your same font in order to make changes to your PDF. The file size of the PDF would also be smaller because you are embedding only part of a font.

    $out : bool = true

    if true output the font size command, otherwise only set the font properties.

    Tags
    author

    Nicola Asuni

    public
    since
    1.0
    see

    AddFont(), SetFontSize()

    setFontSize()

    Defines the size of the current font.

    public setFontSize(float $size[, bool $out = true ]) : mixed
    Parameters
    $size : float

    The font size in points.

    $out : bool = true

    if true output the font size command, otherwise only set the font properties.

    Tags
    public
    since
    1.0
    see
    SetFont()

    setFontSpacing()

    Set the amount to increase or decrease the space between characters in a text.

    public setFontSpacing([float $spacing = 0 ]) : mixed
    Parameters
    $spacing : float = 0

    amount to increase or decrease the space between characters in a text (0 = default spacing)

    Tags
    author

    Nicola Asuni

    public
    since
    5.9.000

    (2010-09-29)

    setFontStretching()

    Set the percentage of character stretching.

    public setFontStretching([int $perc = 100 ]) : mixed
    Parameters
    $perc : int = 100

    percentage of stretching (100 = no stretching)

    Tags
    author

    Nicola Asuni

    public
    since
    5.9.000

    (2010-09-29)

    setFontSubsetting()

    Enable or disable default option for font subsetting.

    public setFontSubsetting([bool $enable = true ]) : mixed
    Parameters
    $enable : bool = true

    if true enable font subsetting by default.

    Tags
    author

    Nicola Asuni

    public
    since
    5.3.002

    (2010-06-07)

    setFooterData()

    Set footer data.

    public setFooterData([array<string|int, int> $tc = array(0, 0, 0) ][, array<string|int, int> $lc = array(0, 0, 0) ]) : mixed
    Parameters
    $tc : array<string|int, int> = array(0, 0, 0)

    RGB array color for text.

    $lc : array<string|int, int> = array(0, 0, 0)

    RGB array color for line.

    Tags
    public

    setFooterFont()

    Set footer font.

    public setFooterFont(array<int, string|float|null> $font) : mixed
    Parameters
    $font : array<int, string|float|null>

    Array describing the basic font parameters: (family, style, size).

    Tags
    phpstan-param

    array{0: string, 1: string, 2: float|null} $font

    public
    since
    1.1

    setFooterMargin()

    Set footer margin.

    public setFooterMargin([float $fm = 10 ]) : mixed

    (minimum distance between footer and bottom page margin)

    Parameters
    $fm : float = 10

    distance in user units

    Tags
    public

    setFormDefaultProp()

    Set default properties for form fields.

    public setFormDefaultProp([array<string|int, mixed> $prop = array() ]) : mixed
    Parameters
    $prop : array<string|int, mixed> = array()

    javascript field properties. Possible values are described on official Javascript for Acrobat API reference.

    Tags
    public
    author

    Nicola Asuni

    since
    4.8.000

    (2009-09-06)

    setHeaderData()

    Set header data.

    public setHeaderData([string $ln = '' ][, int $lw = 0 ][, string $ht = '' ][, string $hs = '' ][, array<string|int, int> $tc = array(0, 0, 0) ][, array<string|int, int> $lc = array(0, 0, 0) ]) : mixed
    Parameters
    $ln : string = ''

    header image logo

    $lw : int = 0

    header image logo width in mm

    $ht : string = ''

    string to print as title on document header

    $hs : string = ''

    string to print on document header

    $tc : array<string|int, int> = array(0, 0, 0)

    RGB array color for text.

    $lc : array<string|int, int> = array(0, 0, 0)

    RGB array color for line.

    Tags
    public

    setHeaderFont()

    Set header font.

    public setHeaderFont(array<int, string|float|null> $font) : mixed
    Parameters
    $font : array<int, string|float|null>

    Array describing the basic font parameters: (family, style, size).

    Tags
    phpstan-param

    array{0: string, 1: string, 2: float|null} $font

    public
    since
    1.1

    setHeaderMargin()

    Set header margin.

    public setHeaderMargin([float $hm = 10 ]) : mixed

    (minimum distance between header and top page margin)

    Parameters
    $hm : float = 10

    distance in user units

    Tags
    public

    setHeaderTemplateAutoreset()

    Set a flag to automatically reset the xobject template used by Header() method at each page.

    public setHeaderTemplateAutoreset([bool $val = true ]) : mixed
    Parameters
    $val : bool = true

    set to true to reset Header xobject template at each page, false otherwise.

    Tags
    public

    setHtmlLinksStyle()

    Set the color and font style for HTML links.

    public setHtmlLinksStyle([array<string|int, mixed> $color = array(0, 0, 255) ][, string $fontstyle = 'U' ]) : mixed
    Parameters
    $color : array<string|int, mixed> = array(0, 0, 255)

    RGB array of colors

    $fontstyle : string = 'U'

    additional font styles to add

    Tags
    public
    since
    4.4.003

    (2008-12-09)

    setHtmlVSpace()

    Set the vertical spaces for HTML tags.

    public setHtmlVSpace(array<string|int, mixed> $tagvs) : mixed

    The array must have the following structure (example): $tagvs = array('h1' => array(0 => array('h' => '', 'n' => 2), 1 => array('h' => 1.3, 'n' => 1))); The first array level contains the tag names, the second level contains 0 for opening tags or 1 for closing tags, the third level contains the vertical space unit (h) and the number spaces to add (n). If the h parameter is not specified, default values are used.

    Parameters
    $tagvs : array<string|int, mixed>

    array of tags and relative vertical spaces.

    Tags
    public
    since
    4.2.001

    (2008-10-30)

    setImageScale()

    Set the adjusting factor to convert pixels to user units.

    public setImageScale(float $scale) : mixed
    Parameters
    $scale : float

    adjusting factor to convert pixels to user units.

    Tags
    author

    Nicola Asuni

    public
    since
    1.5.2

    setJPEGQuality()

    Set the default JPEG compression quality (1-100)

    public setJPEGQuality(int $quality) : mixed
    Parameters
    $quality : int

    JPEG quality, integer between 1 and 100

    Tags
    public
    since
    3.0.000

    (2008-03-27)

    setKeywords()

    Associates keywords with the document, generally in the form 'keyword1 keyword2 ...'.

    public setKeywords(string $keywords) : mixed
    Parameters
    $keywords : string

    The list of keywords.

    Tags
    public
    since
    1.2
    see

    SetAuthor(), SetCreator(), SetSubject(), SetTitle()

    setLanguageArray()

    Set language array.

    public setLanguageArray(array<string|int, mixed> $language) : mixed
    Parameters
    $language : array<string|int, mixed>
    Tags
    public
    since
    1.1

    setLastH()

    Set the last cell height.

    public setLastH(float $h) : mixed
    Parameters
    $h : float

    cell height.

    Tags
    author

    Nicola Asuni

    public
    since
    1.53.0.TC034

    setLeftMargin()

    Defines the left margin. The method can be called before creating the first page. If the current abscissa gets out of page, it is brought back to the margin.

    public setLeftMargin(int|float $margin) : mixed
    Parameters
    $margin : int|float

    The margin.

    Tags
    public
    since
    1.4
    see

    SetTopMargin(), SetRightMargin(), SetAutoPageBreak(), SetMargins()

    setLineStyle()

    Set line style.

    public setLineStyle(array<string|int, mixed> $style[, bool $ret = false ]) : string
    Parameters
    $style : array<string|int, mixed>

    Line style. Array with keys among the following:

    • width (float): Width of the line in user units.
    • cap (string): Type of cap to put on the line. Possible values are: butt, round, square. The difference between "square" and "butt" is that "square" projects a flat end past the end of the line.
    • join (string): Type of join. Possible values are: miter, round, bevel.
    • dash (mixed): Dash pattern. Is 0 (without dash) or string with series of length values, which are the lengths of the on and off dashes. For example: "2" represents 2 on, 2 off, 2 on, 2 off, ...; "2,1" is 2 on, 1 off, 2 on, 1 off, ...
    • phase (integer): Modifier on the dash pattern which is used to shift the point at which the pattern starts.
    • color (array): Draw color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K) or array(C,M,Y,K,SpotColorName).
    $ret : bool = false

    if true do not send the command.

    Tags
    public
    since
    2.1.000

    (2008-01-08)

    Return values
    string

    the PDF command

    setLineWidth()

    Defines the line width. By default, the value equals 0.2 mm. The method can be called before the first page is created and the value is retained from page to page.

    public setLineWidth(float $width) : mixed
    Parameters
    $width : float

    The width.

    Tags
    public
    since
    1.0
    see

    Line(), Rect(), Cell(), MultiCell()

    Defines the page and position a link points to.

    public setLink(int $link[, float $y = 0 ][, int|string $page = -1 ]) : mixed
    Parameters
    $link : int

    The link identifier returned by AddLink()

    $y : float = 0

    Ordinate of target position; -1 indicates the current position. The default value is 0 (top of page)

    $page : int|string = -1

    Number of target page; -1 indicates the current page (default value). If you prefix a page number with the * character, then this page will not be changed when adding/deleting/moving pages.

    Tags
    public
    since
    1.5
    see
    AddLink()

    setListIndentWidth()

    Set custom width for list indentation.

    public setListIndentWidth(float $width) : mixed
    Parameters
    $width : float

    width of the indentation. Use negative value to disable it.

    Tags
    public
    since
    4.2.007

    (2008-11-12)

    setLIsymbol()

    Set the default bullet to be used as LI bullet symbol

    public setLIsymbol([string $symbol = '!' ]) : mixed
    Parameters
    $symbol : string = '!'

    character or string to be used (legal values are: '' = automatic, '!' = auto bullet, '#' = auto numbering, 'disc', 'disc', 'circle', 'square', '1', 'decimal', 'decimal-leading-zero', 'i', 'lower-roman', 'I', 'upper-roman', 'a', 'lower-alpha', 'lower-latin', 'A', 'upper-alpha', 'upper-latin', 'lower-greek', 'img|type|width|height|image.ext')

    Tags
    public
    since
    4.0.028

    (2008-09-26)

    setMargins()

    Defines the left, top and right margins.

    public setMargins(int|float $left, int|float $top[, int|float|null $right = null ][, bool $keepmargins = false ]) : mixed
    Parameters
    $left : int|float

    Left margin.

    $top : int|float

    Top margin.

    $right : int|float|null = null

    Right margin. Default value is the left one.

    $keepmargins : bool = false

    if true overwrites the default page margins

    Tags
    public
    since
    1.0
    see

    SetLeftMargin(), SetTopMargin(), SetRightMargin(), SetAutoPageBreak()

    setOpenCell()

    Set the top/bottom cell sides to be open or closed when the cell cross the page.

    public setOpenCell(bool $isopen) : mixed
    Parameters
    $isopen : bool

    if true keeps the top/bottom border open for the cell sides that cross the page.

    Tags
    public
    since
    4.2.010

    (2008-11-14)

    setOverprint()

    Set overprint mode for stroking (OP) and non-stroking (op) painting operations.

    public setOverprint([bool $stroking = true ][, bool|null $nonstroking = null ][, int $mode = 0 ]) : mixed

    (Check the "Entries in a Graphics State Parameter Dictionary" on PDF 32000-1:2008).

    Parameters
    $stroking : bool = true

    If true apply overprint for stroking operations.

    $nonstroking : bool|null = null

    If true apply overprint for painting operations other than stroking.

    $mode : int = 0

    Overprint mode: (0 = each source colour component value replaces the value previously painted for the corresponding device colorant; 1 = a tint value of 0.0 for a source colour component shall leave the corresponding component of the previously painted colour unchanged).

    Tags
    public
    since
    5.9.152

    (2012-03-23)

    setPage()

    Move pointer at the specified document page and update page dimensions.

    public setPage(int $pnum[, bool $resetmargins = false ]) : mixed
    Parameters
    $pnum : int

    page number (1 ... numpages)

    $resetmargins : bool = false

    if true reset left, right, top margins and Y position.

    Tags
    public
    since
    2.1.000

    (2008-01-07)

    see

    getPage(), lastpage(), getNumPages()

    setPageMark()

    Set start-writing mark on current page stream used to put borders and fills.

    public setPageMark() : mixed

    Borders and fills are always created after content and inserted on the position marked by this method. This function must be called after calling Image() function for a background image. Background images must be always inserted before calling Multicell() or WriteHTMLCell() or WriteHTML() functions.

    Tags
    public
    since
    4.0.016

    (2008-07-30)

    setPageOrientation()

    Set page orientation.

    public setPageOrientation(string $orientation[, bool|null $autopagebreak = null ][, float|null $bottommargin = null ]) : mixed
    Parameters
    $orientation : string

    page orientation. Possible values are (case insensitive):

    • P or Portrait (default)
    • L or Landscape
    • '' (empty string) for automatic orientation
    $autopagebreak : bool|null = null

    Boolean indicating if auto-page-break mode should be on or off.

    $bottommargin : float|null = null

    bottom margin of the page.

    Tags
    public
    since
    3.0.015

    (2008-06-06)

    setPageRegions()

    Set no-write regions on page.

    public setPageRegions([array<string|int, mixed> $regions = array() ]) : mixed

    A no-write region is a portion of the page with a rectangular or trapezium shape that will not be covered when writing text or html code. A region is always aligned on the left or right side of the page ad is defined using a vertical segment. You can set multiple regions for the same page.

    Parameters
    $regions : array<string|int, mixed> = array()

    array of no-write regions. For each region you can define an array as follow: ('page' => page number or empy for current page, 'xt' => X top, 'yt' => Y top, 'xb' => X bottom, 'yb' => Y bottom, 'side' => page side 'L' = left or 'R' = right). Omit this parameter to remove all regions.

    Tags
    author

    Nicola Asuni

    public
    since
    5.9.003

    (2010-10-13)

    see

    addPageRegion(), getPageRegions()

    setPageUnit()

    Set the units of measure for the document.

    public setPageUnit(string $unit) : mixed
    Parameters
    $unit : string

    User measure unit. Possible values are:

    • pt: point
    • mm: millimeter (default)
    • cm: centimeter
    • in: inch

    A point equals 1/72 of inch, that is to say about 0.35 mm (an inch being 2.54 cm). This is a very common unit in typography; font sizes are expressed in that unit.
    Tags
    public
    since
    3.0.015

    (2008-06-06)

    setPDFVersion()

    Set the PDF version (check PDF reference for valid values).

    public setPDFVersion([string $version = '1.7' ]) : mixed
    Parameters
    $version : string = '1.7'

    PDF document version.

    Tags
    public
    since
    3.1.000

    (2008-06-09)

    setPrintFooter()

    Set a flag to print page footer.

    public setPrintFooter([bool $val = true ]) : mixed
    Parameters
    $val : bool = true

    set to true to print the page footer (default), false otherwise.

    Tags
    public

    setPrintHeader()

    Set a flag to print page header.

    public setPrintHeader([bool $val = true ]) : mixed
    Parameters
    $val : bool = true

    set to true to print the page header (default), false otherwise.

    Tags
    public

    setProtection()

    Set document protection Remark: the protection against modification is for people who have the full Acrobat product.

    public setProtection([array<string|int, mixed> $permissions = array('print', 'modify', 'copy', 'annot-forms', 'fill-forms', 'extract', 'assemble', 'print-high') ][, string $user_pass = '' ][, string|null $owner_pass = null ][, int $mode = 0 ][, array<string|int, mixed>|null $pubkeys = null ]) : mixed

    If you don't set any password, the document will open as usual. If you set a user password, the PDF viewer will ask for it before displaying the document. The master password, if different from the user one, can be used to get full access. Note: protecting a document requires to encrypt it, which increases the processing time a lot. This can cause a PHP time-out in some cases, especially if the document contains images or fonts.

    Parameters
    $permissions : array<string|int, mixed> = array('print', 'modify', 'copy', 'annot-forms', 'fill-forms', 'extract', 'assemble', 'print-high')

    the set of permissions (specify the ones you want to block):

    • print : Print the document;
    • modify : Modify the contents of the document by operations other than those controlled by 'fill-forms', 'extract' and 'assemble';
    • copy : Copy or otherwise extract text and graphics from the document;
    • annot-forms : Add or modify text annotations, fill in interactive form fields, and, if 'modify' is also set, create or modify interactive form fields (including signature fields);
    • fill-forms : Fill in existing interactive form fields (including signature fields), even if 'annot-forms' is not specified;
    • extract : Extract text and graphics (in support of accessibility to users with disabilities or for other purposes);
    • assemble : Assemble the document (insert, rotate, or delete pages and create bookmarks or thumbnail images), even if 'modify' is not set;
    • print-high : Print the document to a representation from which a faithful digital copy of the PDF content could be generated. When this is not set, printing is limited to a low-level representation of the appearance, possibly of degraded quality.
    • owner : (inverted logic - only for public-key) when set permits change of encryption and enables all other permissions.
    $user_pass : string = ''

    user password. Empty by default.

    $owner_pass : string|null = null

    owner password. If not specified, a random value is used.

    $mode : int = 0

    encryption strength: 0 = RC4 40 bit; 1 = RC4 128 bit; 2 = AES 128 bit; 3 = AES 256 bit.

    $pubkeys : array<string|int, mixed>|null = null

    array of recipients containing public-key certificates ('c') and permissions ('p'). For example: array(array('c' => 'file://../examples/data/cert/tcpdf.crt', 'p' => array('print')))

    Tags
    public
    since
    2.0.000

    (2008-01-02)

    author

    Nicola Asuni

    setRasterizeVectorImages()

    Enable/disable rasterization of vector images using ImageMagick library.

    public setRasterizeVectorImages(bool $mode) : mixed
    Parameters
    $mode : bool

    if true enable rasterization, false otherwise.

    Tags
    public
    since
    5.0.000

    (2010-04-27)

    setRightMargin()

    Defines the right margin. The method can be called before creating the first page.

    public setRightMargin(int|float $margin) : mixed
    Parameters
    $margin : int|float

    The margin.

    Tags
    public
    since
    1.5
    see

    SetLeftMargin(), SetTopMargin(), SetAutoPageBreak(), SetMargins()

    setRTL()

    Enable or disable Right-To-Left language mode

    public setRTL(bool $enable[, bool $resetx = true ]) : mixed
    Parameters
    $enable : bool

    if true enable Right-To-Left language mode.

    $resetx : bool = true

    if true reset the X position on direction change.

    Tags
    public
    since
    2.0.000

    (2008-01-03)

    setSignature()

    Enable document signature (requires the OpenSSL Library).

    public setSignature([mixed $signing_cert = '' ][, mixed $private_key = '' ][, string $private_key_password = '' ][, string $extracerts = '' ][, int $cert_type = 2 ][, array<string|int, mixed> $info = array() ][, string $approval = '' ]) : mixed

    The digital signature improve document authenticity and integrity and allows o enable extra features on Acrobat Reader. To create self-signed signature: openssl req -x509 -nodes -days 365000 -newkey rsa:1024 -keyout tcpdf.crt -out tcpdf.crt To export crt to p12: openssl pkcs12 -export -in tcpdf.crt -out tcpdf.p12 To convert pfx certificate to pem: openssl pkcs12 -in tcpdf.pfx -out tcpdf.crt -nodes

    Parameters
    $signing_cert : mixed = ''

    signing certificate (string or filename prefixed with 'file://')

    $private_key : mixed = ''

    private key (string or filename prefixed with 'file://')

    $private_key_password : string = ''

    password

    $extracerts : string = ''

    specifies the name of a file containing a bunch of extra certificates to include in the signature which can for example be used to help the recipient to verify the certificate that you used.

    $cert_type : int = 2

    The access permissions granted for this document. Valid values shall be: 1 = No changes to the document shall be permitted; any change to the document shall invalidate the signature; 2 = Permitted changes shall be filling in forms, instantiating page templates, and signing; other changes shall invalidate the signature; 3 = Permitted changes shall be the same as for 2, as well as annotation creation, deletion, and modification; other changes shall invalidate the signature.

    $info : array<string|int, mixed> = array()

    array of option information: Name, Location, Reason, ContactInfo.

    $approval : string = ''

    Enable approval signature eg. for PDF incremental update

    Tags
    public
    author

    Nicola Asuni

    since
    4.6.005

    (2009-04-24)

    setSignatureAppearance()

    Set the digital signature appearance (a cliccable rectangle area to get signature properties)

    public setSignatureAppearance([float $x = 0 ][, float $y = 0 ][, float $w = 0 ][, float $h = 0 ][, int $page = -1 ][, string $name = '' ]) : mixed
    Parameters
    $x : float = 0

    Abscissa of the upper-left corner.

    $y : float = 0

    Ordinate of the upper-left corner.

    $w : float = 0

    Width of the signature area.

    $h : float = 0

    Height of the signature area.

    $page : int = -1

    option page number (if < 0 the current page is used).

    $name : string = ''

    Name of the signature.

    Tags
    public
    author

    Nicola Asuni

    since
    5.3.011

    (2010-06-17)

    setSpacesRE()

    Set regular expression to detect withespaces or word separators.

    public setSpacesRE([string $re = '/[^\S\xa0]/' ]) : mixed

    The pattern delimiter must be the forward-slash character "/". Some example patterns are:

    Non-Unicode or missing PCRE unicode support: "/[^\S\xa0]/"
    Unicode and PCRE unicode support: "/(?!\xa0)[\s\p{Z}]/u"
    Unicode and PCRE unicode support in Chinese mode: "/(?!\xa0)[\s\p{Z}\p{Lo}]/u"
    if PCRE unicode support is turned ON ("\P" is the negate class of "\p"):
         \s     : any whitespace character
         \p{Z}  : any separator
         \p{Lo} : Unicode letter or ideograph that does not have lowercase and uppercase variants. Is used to chunk chinese words.
         \xa0   : Unicode Character 'NO-BREAK SPACE' (U+00A0)
    
    Parameters
    $re : string = '/[^\S\xa0]/'

    regular expression (leave empty for default).

    Tags
    public
    since
    4.6.016

    (2009-06-15)

    setSpotColor()

    Set the spot color for the specified type ('draw', 'fill', 'text').

    public setSpotColor(string $type, string $name[, float $tint = 100 ]) : string
    Parameters
    $type : string

    Type of object affected by this color: ('draw', 'fill', 'text').

    $name : string

    Name of the spot color.

    $tint : float = 100

    Intensity of the color (from 0 to 100 ; 100 = full intensity by default).

    Tags
    public
    since
    5.9.125

    (2011-10-03)

    Return values
    string

    PDF color command.

    setSRGBmode()

    Set flag to force sRGB_IEC61966-2.1 black scaled ICC color profile for the whole document.

    public setSRGBmode([bool $mode = false ]) : mixed
    Parameters
    $mode : bool = false

    If true force sRGB output intent.

    Tags
    public
    since
    5.9.121

    (2011-09-28)

    setStartingPageNumber()

    Set the starting page number.

    public setStartingPageNumber([int $num = 1 ]) : mixed
    Parameters
    $num : int = 1

    Starting page number.

    Tags
    since
    5.9.093

    (2011-06-16)

    public

    setSubject()

    Defines the subject of the document.

    public setSubject(string $subject) : mixed
    Parameters
    $subject : string

    The subject.

    Tags
    public
    since
    1.2
    see

    SetAuthor(), SetCreator(), SetKeywords(), SetTitle()

    setTempRTL()

    Force temporary RTL language direction

    public setTempRTL(false|string $mode) : mixed
    Parameters
    $mode : false|string

    can be false, 'L' for LTR or 'R' for RTL

    Tags
    public
    since
    2.1.000

    (2008-01-09)

    setTextColor()

    Defines the color used for text. It can be expressed in RGB components or gray scale. The method can be called before the first page is created and the value is retained from page to page.

    public setTextColor([float $col1 = 0 ][, float $col2 = -1 ][, float $col3 = -1 ][, float $col4 = -1 ][, bool $ret = false ][, string $name = '' ]) : string
    Parameters
    $col1 : float = 0

    GRAY level for single color, or Red color for RGB (0-255), or CYAN color for CMYK (0-100).

    $col2 : float = -1

    GREEN color for RGB (0-255), or MAGENTA color for CMYK (0-100).

    $col3 : float = -1

    BLUE color for RGB (0-255), or YELLOW color for CMYK (0-100).

    $col4 : float = -1

    KEY (BLACK) color for CMYK (0-100).

    $ret : bool = false

    If true do not send the command.

    $name : string = ''

    Spot color name (if any).

    Tags
    public
    since
    1.3
    see

    SetTextColorArray(), SetDrawColor(), SetFillColor(), Text(), Cell(), MultiCell()

    Return values
    string

    Empty string.

    setTextColorArray()

    Defines the color used for text. It can be expressed in RGB components or gray scale.

    public setTextColorArray(array<string|int, mixed> $color[, bool $ret = false ]) : mixed

    The method can be called before the first page is created and the value is retained from page to page.

    Parameters
    $color : array<string|int, mixed>

    Array of colors (1, 3 or 4 values).

    $ret : bool = false

    If true do not send the PDF command.

    Tags
    public
    since
    3.1.000

    (2008-6-11)

    see
    SetFillColor()

    setTextRenderingMode()

    Set Text rendering mode.

    public setTextRenderingMode([int $stroke = 0 ][, bool $fill = true ][, bool $clip = false ]) : mixed
    Parameters
    $stroke : int = 0

    outline size in user units (0 = disable).

    $fill : bool = true

    if true fills the text (default).

    $clip : bool = false

    if true activate clipping mode

    Tags
    public
    since
    4.9.008

    (2009-04-02)

    setTextShadow()

    Set parameters for drop shadow effect for text.

    public setTextShadow([array<string|int, mixed> $params = array('enabled' => false, 'depth_w' => 0, 'depth_h' => 0, 'color' => false, 'opacity' => 1, 'blend_mode' => 'Normal') ]) : mixed
    Parameters
    $params : array<string|int, mixed> = array('enabled' => false, 'depth_w' => 0, 'depth_h' => 0, 'color' => false, 'opacity' => 1, 'blend_mode' => 'Normal')

    Array of parameters: enabled (boolean) set to true to enable shadow; depth_w (float) shadow width in user units; depth_h (float) shadow height in user units; color (array) shadow color or false to use the stroke color; opacity (float) Alpha value: real value from 0 (transparent) to 1 (opaque); blend_mode (string) blend mode, one of the following: Normal, Multiply, Screen, Overlay, Darken, Lighten, ColorDodge, ColorBurn, HardLight, SoftLight, Difference, Exclusion, Hue, Saturation, Color, Luminosity.

    Tags
    since
    5.9.174

    (2012-07-25)

    public

    setTextSpotColor()

    Defines the spot color used for text.

    public setTextSpotColor(string $name[, int $tint = 100 ]) : mixed
    Parameters
    $name : string

    Name of the spot color.

    $tint : int = 100

    Intensity of the color (from 0 to 100 ; 100 = full intensity by default).

    Tags
    public
    since
    4.0.024

    (2008-09-12)

    see

    AddSpotColor(), SetDrawSpotColor(), SetFillSpotColor()

    setTimeStamp()

    Enable document timestamping (requires the OpenSSL Library).

    public setTimeStamp([string $tsa_host = '' ][, string $tsa_username = '' ][, string $tsa_password = '' ][, string $tsa_cert = '' ]) : mixed

    The trusted timestamping improve document security that means that no one should be able to change the document once it has been recorded. Use with digital signature only!

    Parameters
    $tsa_host : string = ''

    Time Stamping Authority (TSA) server (prefixed with 'https://')

    $tsa_username : string = ''

    Specifies the username for TSA authorization (optional) OR specifies the TSA authorization PEM file (see: example_66.php, optional)

    $tsa_password : string = ''

    Specifies the password for TSA authorization (optional)

    $tsa_cert : string = ''

    Specifies the location of TSA certificate for authorization (optional for cURL)

    Tags
    public
    author

    Richard Stockinger

    since
    6.0.090

    (2014-06-16)

    setTitle()

    Defines the title of the document.

    public setTitle(string $title) : mixed
    Parameters
    $title : string

    The title.

    Tags
    public
    since
    1.2
    see

    SetAuthor(), SetCreator(), SetKeywords(), SetSubject()

    setTopMargin()

    Defines the top margin. The method can be called before creating the first page.

    public setTopMargin(int|float $margin) : mixed
    Parameters
    $margin : int|float

    The margin.

    Tags
    public
    since
    1.5
    see

    SetLeftMargin(), SetRightMargin(), SetAutoPageBreak(), SetMargins()

    setUserRights()

    Set User's Rights for PDF Reader WARNING: This is experimental and currently do not work.

    public setUserRights([bool $enable = true ][, string $document = '/FullSave' ][, string $annots = '/Create/Delete/Modify/Copy/Import/Export' ][, string $form = '/Add/Delete/FillIn/Import/Export/SubmitStandalone/SpawnTemplate' ][, string $signature = '/Modify' ][, string $ef = '/Create/Delete/Modify/Import' ][, string $formex = '' ]) : mixed

    Check the PDF Reference 8.7.1 Transform Methods, Table 8.105 Entries in the UR transform parameters dictionary

    Parameters
    $enable : bool = true

    if true enable user's rights on PDF reader

    $document : string = '/FullSave'

    Names specifying additional document-wide usage rights for the document. The only defined value is "/FullSave", which permits a user to save the document along with modified form and/or annotation data.

    $annots : string = '/Create/Delete/Modify/Copy/Import/Export'

    Names specifying additional annotation-related usage rights for the document. Valid names in PDF 1.5 and later are /Create/Delete/Modify/Copy/Import/Export, which permit the user to perform the named operation on annotations.

    $form : string = '/Add/Delete/FillIn/Import/Export/SubmitStandalone/SpawnTemplate'

    Names specifying additional form-field-related usage rights for the document. Valid names are: /Add/Delete/FillIn/Import/Export/SubmitStandalone/SpawnTemplate

    $signature : string = '/Modify'

    Names specifying additional signature-related usage rights for the document. The only defined value is /Modify, which permits a user to apply a digital signature to an existing signature form field or clear a signed signature form field.

    $ef : string = '/Create/Delete/Modify/Import'

    Names specifying additional usage rights for named embedded files in the document. Valid names are /Create/Delete/Modify/Import, which permit the user to perform the named operation on named embedded files Names specifying additional embedded-files-related usage rights for the document.

    $formex : string = ''

    Names specifying additional form-field-related usage rights. The only valid name is BarcodePlaintext, which permits text form field data to be encoded as a plaintext two-dimensional barcode.

    Tags
    public
    author

    Nicola Asuni

    since
    2.9.000

    (2008-03-26)

    setViewerPreferences()

    Set the viewer preferences dictionary controlling the way the document is to be presented on the screen or in print.

    public setViewerPreferences(array<string|int, mixed> $preferences) : mixed

    (see Section 8.1 of PDF reference, "Viewer Preferences").

    • HideToolbar boolean (Optional) A flag specifying whether to hide the viewer application's tool bars when the document is active. Default value: false.
    • HideMenubar boolean (Optional) A flag specifying whether to hide the viewer application's menu bar when the document is active. Default value: false.
    • HideWindowUI boolean (Optional) A flag specifying whether to hide user interface elements in the document's window (such as scroll bars and navigation controls), leaving only the document's contents displayed. Default value: false.
    • FitWindow boolean (Optional) A flag specifying whether to resize the document's window to fit the size of the first displayed page. Default value: false.
    • CenterWindow boolean (Optional) A flag specifying whether to position the document's window in the center of the screen. Default value: false.
    • DisplayDocTitle boolean (Optional; PDF 1.4) A flag specifying whether the window's title bar should display the document title taken from the Title entry of the document information dictionary (see Section 10.2.1, "Document Information Dictionary"). If false, the title bar should instead display the name of the PDF file containing the document. Default value: false.
    • NonFullScreenPageMode name (Optional) The document's page mode, specifying how to display the document on exiting full-screen mode:
      • UseNone Neither document outline nor thumbnail images visible
      • UseOutlines Document outline visible
      • UseThumbs Thumbnail images visible
      • UseOC Optional content group panel visible
      This entry is meaningful only if the value of the PageMode entry in the catalog dictionary (see Section 3.6.1, "Document Catalog") is FullScreen; it is ignored otherwise. Default value: UseNone.
    • ViewArea name (Optional; PDF 1.4) The name of the page boundary representing the area of a page to be displayed when viewing the document on the screen. Valid values are (see Section 10.10.1, "Page Boundaries").:
      • MediaBox
      • CropBox (default)
      • BleedBox
      • TrimBox
      • ArtBox
    • ViewClip name (Optional; PDF 1.4) The name of the page boundary to which the contents of a page are to be clipped when viewing the document on the screen. Valid values are (see Section 10.10.1, "Page Boundaries").:
      • MediaBox
      • CropBox (default)
      • BleedBox
      • TrimBox
      • ArtBox
    • PrintArea name (Optional; PDF 1.4) The name of the page boundary representing the area of a page to be rendered when printing the document. Valid values are (see Section 10.10.1, "Page Boundaries").:
      • MediaBox
      • CropBox (default)
      • BleedBox
      • TrimBox
      • ArtBox
    • PrintClip name (Optional; PDF 1.4) The name of the page boundary to which the contents of a page are to be clipped when printing the document. Valid values are (see Section 10.10.1, "Page Boundaries").:
      • MediaBox
      • CropBox (default)
      • BleedBox
      • TrimBox
      • ArtBox
    • PrintScaling name (Optional; PDF 1.6) The page scaling option to be selected when a print dialog is displayed for this document. Valid values are:
      • None, which indicates that the print dialog should reflect no page scaling
      • AppDefault (default), which indicates that applications should use the current print scaling
    • Duplex name (Optional; PDF 1.7) The paper handling option to use when printing the file from the print dialog. The following values are valid:
      • Simplex - Print single-sided
      • DuplexFlipShortEdge - Duplex and flip on the short edge of the sheet
      • DuplexFlipLongEdge - Duplex and flip on the long edge of the sheet
      Default value: none
    • PickTrayByPDFSize boolean (Optional; PDF 1.7) A flag specifying whether the PDF page size is used to select the input paper tray. This setting influences only the preset values used to populate the print dialog presented by a PDF viewer application. If PickTrayByPDFSize is true, the check box in the print dialog associated with input paper tray is checked. Note: This setting has no effect on Mac OS systems, which do not provide the ability to pick the input tray by size.
    • PrintPageRange array (Optional; PDF 1.7) The page numbers used to initialize the print dialog box when the file is printed. The first page of the PDF file is denoted by 1. Each pair consists of the first and last pages in the sub-range. An odd number of integers causes this entry to be ignored. Negative numbers cause the entire array to be ignored. Default value: as defined by PDF viewer application
    • NumCopies integer (Optional; PDF 1.7) The number of copies to be printed when the print dialog is opened for this file. Supported values are the integers 2 through 5. Values outside this range are ignored. Default value: as defined by PDF viewer application, but typically 1
    Parameters
    $preferences : array<string|int, mixed>

    array of options.

    Tags
    author

    Nicola Asuni

    public
    since
    3.1.000

    (2008-06-09)

    setVisibility()

    Set the visibility of the successive elements.

    public setVisibility(string $v) : mixed

    This can be useful, for instance, to put a background image or color that will show on screen but won't print.

    Parameters
    $v : string

    visibility mode. Legal values are: all, print, screen or view.

    Tags
    public
    since
    3.0.000

    (2008-03-27)

    setX()

    Defines the abscissa of the current position.

    public setX(float $x[, bool $rtloff = false ]) : mixed

    If the passed value is negative, it is relative to the right of the page (or left if language is RTL).

    Parameters
    $x : float

    The value of the abscissa in user units.

    $rtloff : bool = false

    if true always uses the page top-left corner as origin of axis.

    Tags
    public
    since
    1.2
    see

    GetX(), GetY(), SetY(), SetXY()

    setXY()

    Defines the abscissa and ordinate of the current position.

    public setXY(float $x, float $y[, bool $rtloff = false ]) : mixed

    If the passed values are negative, they are relative respectively to the right and bottom of the page.

    Parameters
    $x : float

    The value of the abscissa.

    $y : float

    The value of the ordinate.

    $rtloff : bool = false

    if true always uses the page top-left corner as origin of axis.

    Tags
    public
    since
    1.2
    see

    SetX(), SetY()

    setY()

    Moves the current abscissa back to the left margin and sets the ordinate.

    public setY(float $y[, bool $resetx = true ][, bool $rtloff = false ]) : mixed

    If the passed value is negative, it is relative to the bottom of the page.

    Parameters
    $y : float

    The value of the ordinate in user units.

    $resetx : bool = true

    if true (default) reset the X position.

    $rtloff : bool = false

    if true always uses the page top-left corner as origin of axis.

    Tags
    public
    since
    1.0
    see

    GetX(), GetY(), SetY(), SetXY()

    Skew()

    Skew.

    public Skew(float $angle_x, float $angle_y[, float|null $x = null ][, float|null $y = null ]) : mixed
    Parameters
    $angle_x : float

    angle in degrees between -90 (skew to the left) and 90 (skew to the right)

    $angle_y : float

    angle in degrees between -90 (skew to the bottom) and 90 (skew to the top)

    $x : float|null = null

    abscissa of the skewing center. default is current x position

    $y : float|null = null

    ordinate of the skewing center. default is current y position

    Tags
    public
    since
    2.1.000

    (2008-01-07)

    see

    StartTransform(), StopTransform()

    SkewX()

    Skew horizontally.

    public SkewX(float $angle_x[, float|null $x = null ][, float|null $y = null ]) : mixed
    Parameters
    $angle_x : float

    angle in degrees between -90 (skew to the left) and 90 (skew to the right)

    $x : float|null = null

    abscissa of the skewing center. default is current x position

    $y : float|null = null

    ordinate of the skewing center. default is current y position

    Tags
    public
    since
    2.1.000

    (2008-01-07)

    see

    StartTransform(), StopTransform()

    SkewY()

    Skew vertically.

    public SkewY(float $angle_y[, float|null $x = null ][, float|null $y = null ]) : mixed
    Parameters
    $angle_y : float

    angle in degrees between -90 (skew to the bottom) and 90 (skew to the top)

    $x : float|null = null

    abscissa of the skewing center. default is current x position

    $y : float|null = null

    ordinate of the skewing center. default is current y position

    Tags
    public
    since
    2.1.000

    (2008-01-07)

    see

    StartTransform(), StopTransform()

    StarPolygon()

    Draws a star polygon

    public StarPolygon(float $x0, float $y0, float $r, int $nv, int $ng[, float $angle = 0 ][, bool $draw_circle = false ][, string $style = '' ][, array<string|int, mixed> $line_style = array() ][, array<string|int, mixed> $fill_color = array() ][, string $circle_style = '' ][, array<string|int, mixed> $circle_outLine_style = array() ][, array<string|int, mixed> $circle_fill_color = array() ]) : mixed
    Parameters
    $x0 : float

    Abscissa of center point.

    $y0 : float

    Ordinate of center point.

    $r : float

    Radius of inscribed circle.

    $nv : int

    Number of vertices.

    $ng : int

    Number of gap (if ($ng % $nv = 1) then is a regular polygon).

    $angle : float = 0

    Angle oriented (anti-clockwise). Default value: 0.

    $draw_circle : bool = false

    Draw inscribed circle or not. Default value is false.

    $style : string = ''

    Style of rendering. See the getPathPaintOperator() function for more information.

    $line_style : array<string|int, mixed> = array()

    Line style of polygon sides. Array with keys among the following:

    • all: Line style of all sides. Array like for SetLineStyle().
    • 0 to (n - 1): Line style of each side. Array like for SetLineStyle().
    If a key is not present or is null, not draws the side. Default value is default line style (empty array).
    $fill_color : array<string|int, mixed> = array()

    Fill color. Format: array(red, green, blue). Default value: default color (empty array).

    $circle_style : string = ''

    Style of rendering of inscribed circle (if draws). Possible values are:

    • D or empty string: Draw (default).
    • F: Fill.
    • DF or FD: Draw and fill.
    • CNZ: Clipping mode (using the even-odd rule to determine which regions lie inside the clipping path).
    • CEO: Clipping mode (using the nonzero winding number rule to determine which regions lie inside the clipping path).
    $circle_outLine_style : array<string|int, mixed> = array()

    Line style of inscribed circle (if draws). Array like for SetLineStyle(). Default value: default line style (empty array).

    $circle_fill_color : array<string|int, mixed> = array()

    Fill color of inscribed circle (if draws). Format: array(red, green, blue). Default value: default color (empty array).

    Tags
    public
    since
    2.1.000

    (2008-01-08)

    startLayer()

    Start a new pdf layer.

    public startLayer([string $name = '' ][, bool|null $print = true ][, bool $view = true ][, bool $lock = true ]) : mixed
    Parameters
    $name : string = ''

    Layer name (only a-z letters and numbers). Leave empty for automatic name.

    $print : bool|null = true

    Set to TRUE to print this layer, FALSE to not print and NULL to not set this option

    $view : bool = true

    Set to true to view this layer.

    $lock : bool = true

    If true lock the layer

    Tags
    public
    since
    5.9.102

    (2011-07-13)

    startPage()

    Starts a new page to the document. The page must be closed using the endPage() function.

    public startPage([string $orientation = '' ][, mixed $format = '' ][, bool $tocpage = false ]) : mixed

    The origin of the coordinate system is at the top-left corner and increasing ordinates go downwards.

    Parameters
    $orientation : string = ''

    page orientation. Possible values are (case insensitive):

    • P or PORTRAIT (default)
    • L or LANDSCAPE
    $format : mixed = ''

    The format used for pages. It can be either: one of the string values specified at getPageSizeFromFormat() or an array of parameters specified at setPageFormat().

    $tocpage : bool = false

    if true the page is designated to contain the Table-Of-Content.

    Tags
    since
    4.2.010

    (2008-11-14)

    see

    AddPage(), endPage(), addTOCPage(), endTOCPage(), getPageSizeFromFormat(), setPageFormat()

    public

    startPageGroup()

    Create a new page group.

    public startPageGroup([int|null $page = null ]) : mixed

    NOTE: call this function before calling AddPage()

    Parameters
    $page : int|null = null

    starting group page (leave empty for next page).

    Tags
    public
    since
    3.0.000

    (2008-03-27)

    startTemplate()

    Start a new XObject Template.

    public startTemplate([int $w = 0 ][, int $h = 0 ][, mixed $group = false ]) : string|false

    An XObject Template is a PDF block that is a self-contained description of any sequence of graphics objects (including path objects, text objects, and sampled images). An XObject Template may be painted multiple times, either on several pages or at several locations on the same page and produces the same results each time, subject only to the graphics state at the time it is invoked. Note: X,Y coordinates will be reset to 0,0.

    Parameters
    $w : int = 0

    Template width in user units (empty string or zero = page width less margins).

    $h : int = 0

    Template height in user units (empty string or zero = page height less margins).

    $group : mixed = false

    Set transparency group. Can be a boolean value or an array specifying optional parameters: 'CS' (solour space name), 'I' (boolean flag to indicate isolated group) and 'K' (boolean flag to indicate knockout group).

    Tags
    author

    Nicola Asuni

    public
    since
    5.8.017

    (2010-08-24)

    see

    endTemplate(), printTemplate()

    Return values
    string|false

    the XObject Template ID in case of success or false in case of error.

    startTransaction()

    Stores a copy of the current TCPDF object used for undo operation.

    public startTransaction() : mixed
    Tags
    public
    since
    4.5.029

    (2009-03-19)

    StartTransform()

    Starts a 2D tranformation saving current graphic state.

    public StartTransform() : mixed

    This function must be called before scaling, mirroring, translation, rotation and skewing. Use StartTransform() before, and StopTransform() after the transformations to restore the normal behavior.

    Tags
    public
    since
    2.1.000

    (2008-01-07)

    see

    StartTransform(), StopTransform()

    StopTransform()

    Stops a 2D tranformation restoring previous graphic state.

    public StopTransform() : mixed

    This function must be called after scaling, mirroring, translation, rotation and skewing. Use StartTransform() before, and StopTransform() after the transformations to restore the normal behavior.

    Tags
    public
    since
    2.1.000

    (2008-01-07)

    see

    StartTransform(), StopTransform()

    stringLeftTrim()

    Left trim the input string

    public stringLeftTrim(string $str[, string $replace = '' ]) : string
    Parameters
    $str : string

    string to trim

    $replace : string = ''

    string that replace spaces.

    Tags
    author

    Nicola Asuni

    public
    since
    5.8.000

    (2010-08-11)

    Return values
    string

    left trimmed string

    stringRightTrim()

    Right trim the input string

    public stringRightTrim(string $str[, string $replace = '' ]) : string
    Parameters
    $str : string

    string to trim

    $replace : string = ''

    string that replace spaces.

    Tags
    author

    Nicola Asuni

    public
    since
    5.8.000

    (2010-08-11)

    Return values
    string

    right trimmed string

    stringTrim()

    Trim the input string

    public stringTrim(string $str[, string $replace = '' ]) : string
    Parameters
    $str : string

    string to trim

    $replace : string = ''

    string that replace spaces.

    Tags
    author

    Nicola Asuni

    public
    since
    5.8.000

    (2010-08-11)

    Return values
    string

    trimmed string

    Text()

    Prints a text cell at the specified position.

    public Text(float $x, float $y, string $txt[, int $fstroke = 0 ][, bool $fclip = false ][, bool $ffill = true ][, mixed $border = 0 ][, int $ln = 0 ][, string $align = '' ][, bool $fill = false ][, mixed $link = '' ][, int $stretch = 0 ][, bool $ignore_min_height = false ][, string $calign = 'T' ][, string $valign = 'M' ][, bool $rtloff = false ]) : mixed

    This method allows to place a string precisely on the page.

    Parameters
    $x : float

    Abscissa of the cell origin

    $y : float

    Ordinate of the cell origin

    $txt : string

    String to print

    $fstroke : int = 0

    outline size in user units (0 = disable)

    $fclip : bool = false

    if true activate clipping mode (you must call StartTransform() before this function and StopTransform() to stop the clipping tranformation).

    $ffill : bool = true

    if true fills the text

    $border : mixed = 0

    Indicates if borders must be drawn around the cell. The value can be a number:

    • 0: no border (default)
    • 1: frame
    or a string containing some or all of the following characters (in any order):
    • L: left
    • T: top
    • R: right
    • B: bottom
    or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)))
    $ln : int = 0

    Indicates where the current position should go after the call. Possible values are:

    • 0: to the right (or left for RTL languages)
    • 1: to the beginning of the next line
    • 2: below
    Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: 0.
    $align : string = ''

    Allows to center or align the text. Possible values are:

    • L or empty string: left align (default value)
    • C: center
    • R: right align
    • J: justify
    $fill : bool = false

    Indicates if the cell background must be painted (true) or transparent (false).

    $link : mixed = ''

    URL or identifier returned by AddLink().

    $stretch : int = 0

    font stretch mode:

    • 0 = disabled
    • 1 = horizontal scaling only if text is larger than cell width
    • 2 = forced horizontal scaling to fit cell width
    • 3 = character spacing only if text is larger than cell width
    • 4 = forced character spacing to fit cell width
    General font stretching and scaling values will be preserved when possible.
    $ignore_min_height : bool = false

    if true ignore automatic minimum height value.

    $calign : string = 'T'

    cell vertical alignment relative to the specified Y value. Possible values are:

    • T : cell top
    • A : font top
    • L : font baseline
    • D : font bottom
    • B : cell bottom
    $valign : string = 'M'

    text vertical alignment inside the cell. Possible values are:

    • T : top
    • C : center
    • B : bottom
    $rtloff : bool = false

    if true uses the page top-left corner as origin of axis for $x and $y initial position.

    Tags
    public
    since
    1.0
    see

    Cell(), Write(), MultiCell(), WriteHTML(), WriteHTMLCell()

    TextField()

    Creates a text field

    public TextField(string $name, float $w, float $h[, array<string|int, mixed> $prop = array() ][, array<string|int, mixed> $opt = array() ][, float|null $x = null ][, float|null $y = null ][, bool $js = false ]) : mixed
    Parameters
    $name : string

    field name

    $w : float

    Width of the rectangle

    $h : float

    Height of the rectangle

    $prop : array<string|int, mixed> = array()

    javascript field properties. Possible values are described on official Javascript for Acrobat API reference.

    $opt : array<string|int, mixed> = array()

    annotation parameters. Possible values are described on official PDF32000_2008 reference.

    $x : float|null = null

    Abscissa of the upper-left corner of the rectangle

    $y : float|null = null

    Ordinate of the upper-left corner of the rectangle

    $js : bool = false

    if true put the field using JavaScript (requires Acrobat Writer to be rendered).

    Tags
    public
    author

    Nicola Asuni

    since
    4.8.000

    (2009-09-07)

    Translate()

    Translate graphic object horizontally and vertically.

    public Translate(int $t_x, int $t_y) : mixed
    Parameters
    $t_x : int

    movement to the right

    $t_y : int

    movement to the bottom

    Tags
    public
    since
    2.1.000

    (2008-01-07)

    see

    StartTransform(), StopTransform()

    TranslateX()

    Translate graphic object horizontally.

    public TranslateX(int $t_x) : mixed
    Parameters
    $t_x : int

    movement to the right (or left for RTL)

    Tags
    public
    since
    2.1.000

    (2008-01-07)

    see

    StartTransform(), StopTransform()

    TranslateY()

    Translate graphic object vertically.

    public TranslateY(int $t_y) : mixed
    Parameters
    $t_y : int

    movement to the bottom

    Tags
    public
    since
    2.1.000

    (2008-01-07)

    see

    StartTransform(), StopTransform()

    unhtmlentities()

    Reverse function for htmlentities.

    public unhtmlentities(string $text_to_convert) : string

    Convert entities in UTF-8.

    Parameters
    $text_to_convert : string

    Text to convert.

    Tags
    public
    Return values
    string

    converted text string

    Write()

    This method prints text from the current position.<br />

    public Write(float $h, string $txt[, mixed $link = '' ][, bool $fill = false ][, string $align = '' ][, bool $ln = false ][, int $stretch = 0 ][, bool $firstline = false ][, bool $firstblock = false ][, float $maxh = 0 ][, float $wadj = 0 ][, array<string|int, mixed>|null $margin = null ]) : mixed
    Parameters
    $h : float

    Line height

    $txt : string

    String to print

    $link : mixed = ''

    URL or identifier returned by AddLink()

    $fill : bool = false

    Indicates if the cell background must be painted (true) or transparent (false).

    $align : string = ''

    Allows to center or align the text. Possible values are:

    • L or empty string: left align (default value)
    • C: center
    • R: right align
    • J: justify
    $ln : bool = false

    if true set cursor at the bottom of the line, otherwise set cursor at the top of the line.

    $stretch : int = 0

    font stretch mode:

    • 0 = disabled
    • 1 = horizontal scaling only if text is larger than cell width
    • 2 = forced horizontal scaling to fit cell width
    • 3 = character spacing only if text is larger than cell width
    • 4 = forced character spacing to fit cell width
    General font stretching and scaling values will be preserved when possible.
    $firstline : bool = false

    if true prints only the first line and return the remaining string.

    $firstblock : bool = false

    if true the string is the starting of a line.

    $maxh : float = 0

    maximum height. It should be >= $h and less then remaining space to the bottom of the page, or 0 for disable this feature.

    $wadj : float = 0

    first line width will be reduced by this amount (used in HTML mode).

    $margin : array<string|int, mixed>|null = null

    margin array of the parent container

    Tags
    public
    since
    1.5
    Return values
    mixed

    Return the number of cells or the remaining string if $firstline = true.

    write1DBarcode()

    Print a Linear Barcode.

    public write1DBarcode(string $code, string $type[, float|null $x = null ][, float|null $y = null ][, float|null $w = null ][, float|null $h = null ][, float|null $xres = null ][, array<string|int, mixed> $style = array() ][, string $align = '' ]) : mixed
    Parameters
    $code : string

    code to print

    $type : string

    type of barcode (see tcpdf_barcodes_1d.php for supported formats).

    $x : float|null = null

    x position in user units (null = current x position)

    $y : float|null = null

    y position in user units (null = current y position)

    $w : float|null = null

    width in user units (null = remaining page width)

    $h : float|null = null

    height in user units (null = remaining page height)

    $xres : float|null = null

    width of the smallest bar in user units (null = default value = 0.4mm)

    $style : array<string|int, mixed> = array()

    array of options:

    • boolean $style['border'] if true prints a border
    • int $style['padding'] padding to leave around the barcode in user units (set to 'auto' for automatic padding)
    • int $style['hpadding'] horizontal padding in user units (set to 'auto' for automatic padding)
    • int $style['vpadding'] vertical padding in user units (set to 'auto' for automatic padding)
    • array $style['fgcolor'] color array for bars and text
    • mixed $style['bgcolor'] color array for background (set to false for transparent)
    • boolean $style['text'] if true prints text below the barcode
    • string $style['label'] override default label
    • string $style['font'] font name for text
    • int $style['fontsize'] font size for text
    • int $style['stretchtext']: 0 = disabled; 1 = horizontal scaling only if necessary; 2 = forced horizontal scaling; 3 = character spacing only if necessary; 4 = forced character spacing.
    • string $style['position'] horizontal position of the containing barcode cell on the page: L = left margin; C = center; R = right margin.
    • string $style['align'] horizontal position of the barcode on the containing rectangle: L = left; C = center; R = right.
    • string $style['stretch'] if true stretch the barcode to best fit the available width, otherwise uses $xres resolution for a single bar.
    • string $style['fitwidth'] if true reduce the width to fit the barcode width + padding. When this option is enabled the 'stretch' option is automatically disabled.
    • string $style['cellfitalign'] this option works only when 'fitwidth' is true and 'position' is unset or empty. Set the horizontal position of the containing barcode cell inside the specified rectangle: L = left; C = center; R = right.
    $align : string = ''

    Indicates the alignment of the pointer next to barcode insertion relative to barcode height. The value can be:

    • T: top-right for LTR or top-left for RTL
    • M: middle-right for LTR or middle-left for RTL
    • B: bottom-right for LTR or bottom-left for RTL
    • N: next line
    Tags
    author

    Nicola Asuni

    since
    3.1.000

    (2008-06-09)

    public

    write2DBarcode()

    Print 2D Barcode.

    public write2DBarcode(string $code, string $type[, float|null $x = null ][, float|null $y = null ][, float|null $w = null ][, float|null $h = null ][, array<string|int, mixed> $style = array() ][, string $align = '' ][, bool $distort = false ]) : mixed
    Parameters
    $code : string

    code to print

    $type : string

    type of barcode (see tcpdf_barcodes_2d.php for supported formats).

    $x : float|null = null

    x position in user units

    $y : float|null = null

    y position in user units

    $w : float|null = null

    width in user units

    $h : float|null = null

    height in user units

    $style : array<string|int, mixed> = array()

    array of options:

    • boolean $style['border'] if true prints a border around the barcode
    • int $style['padding'] padding to leave around the barcode in barcode units (set to 'auto' for automatic padding)
    • int $style['hpadding'] horizontal padding in barcode units (set to 'auto' for automatic padding)
    • int $style['vpadding'] vertical padding in barcode units (set to 'auto' for automatic padding)
    • int $style['module_width'] width of a single module in points
    • int $style['module_height'] height of a single module in points
    • array $style['fgcolor'] color array for bars and text
    • mixed $style['bgcolor'] color array for background or false for transparent
    • string $style['position'] barcode position on the page: L = left margin; C = center; R = right margin; S = stretch
    $align : string = ''

    Indicates the alignment of the pointer next to barcode insertion relative to barcode height. The value can be:

    • T: top-right for LTR or top-left for RTL
    • M: middle-right for LTR or middle-left for RTL
    • B: bottom-right for LTR or bottom-left for RTL
    • N: next line
    $distort : bool = false

    if true distort the barcode to fit width and height, otherwise preserve aspect ratio

    Tags
    author

    Nicola Asuni

    since
    4.5.037

    (2009-04-07)

    public

    writeHTML()

    Allows to preserve some HTML formatting (limited support).<br /> IMPORTANT: The HTML must be well formatted - try to clean-up it using an application like HTML-Tidy before submitting.

    public writeHTML(string $html[, bool $ln = true ][, bool $fill = false ][, bool $reseth = false ][, bool $cell = false ][, string $align = '' ]) : mixed

    Supported tags are: a, b, blockquote, br, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, img, li, ol, p, pre, small, span, strong, sub, sup, table, tcpdf, td, th, thead, tr, tt, u, ul NOTE: all the HTML attributes must be enclosed in double-quote.

    Parameters
    $html : string

    text to display

    $ln : bool = true

    if true add a new line after text (default = true)

    $fill : bool = false

    Indicates if the background must be painted (true) or transparent (false).

    $reseth : bool = false

    if true reset the last cell height (default false).

    $cell : bool = false

    if true add the current left (or right for RTL) padding to each Write (default false).

    $align : string = ''

    Allows to center or align the text. Possible values are:

    • L : left align
    • C : center
    • R : right align
    • '' : empty string : left for LTR or right for RTL
    Tags
    public

    writeHTMLCell()

    Prints a cell (rectangular area) with optional borders, background color and html text string.

    public writeHTMLCell(float $w, float $h, float|null $x, float|null $y[, string $html = '' ][, mixed $border = 0 ][, int $ln = 0 ][, bool $fill = false ][, bool $reseth = true ][, string $align = '' ][, bool $autopadding = true ]) : mixed

    The upper-left corner of the cell corresponds to the current position. After the call, the current position moves to the right or to the next line.
    If automatic page breaking is enabled and the cell goes beyond the limit, a page break is done before outputting. IMPORTANT: The HTML must be well formatted - try to clean-up it using an application like HTML-Tidy before submitting. Supported tags are: a, b, blockquote, br, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, img, li, ol, p, pre, small, span, strong, sub, sup, table, tcpdf, td, th, thead, tr, tt, u, ul NOTE: all the HTML attributes must be enclosed in double-quote.

    Parameters
    $w : float

    Cell width. If 0, the cell extends up to the right margin.

    $h : float

    Cell minimum height. The cell extends automatically if needed.

    $x : float|null

    upper-left corner X coordinate

    $y : float|null

    upper-left corner Y coordinate

    $html : string = ''

    html text to print. Default value: empty string.

    $border : mixed = 0

    Indicates if borders must be drawn around the cell. The value can be a number:

    • 0: no border (default)
    • 1: frame
    or a string containing some or all of the following characters (in any order):
    • L: left
    • T: top
    • R: right
    • B: bottom
    or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)))
    $ln : int = 0

    Indicates where the current position should go after the call. Possible values are:

    • 0: to the right (or left for RTL language)
    • 1: to the beginning of the next line
    • 2: below
    Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: 0.
    $fill : bool = false

    Indicates if the cell background must be painted (true) or transparent (false).

    $reseth : bool = true

    if true reset the last cell height (default true).

    $align : string = ''

    Allows to center or align the text. Possible values are:

    • L : left align
    • C : center
    • R : right align
    • '' : empty string : left for LTR or right for RTL
    $autopadding : bool = true

    if true, uses internal padding and automatically adjust it to account for line width.

    Tags
    see

    Multicell(), writeHTML()

    public
    On this page
     

    © 2004-2024 – Nicola Asuni - Tecnick.com - All rights reserved.
    about - disclaimer - privacy