Project

General

Profile

Method Documentation?

Added by Sloan Thrasher 11 months ago

Hi all,

Is there documentation for each of the methods in Fpdf-multicell?

I'm looking for something that details each argument for each method, including the type, and for arguments accept a value from a list, something showing the possible values.

Yes, I've looked through the examples and tutorials. There are many instances where there are arguments that are not mentioned or explained.

Thanks for any help you might offer!

Sloan


Replies (5)

RE: Method Documentation? - Added by Andrei Bintintan 11 months ago

Short answer is unfortunately not. I did start reworking the documentation part cause it's not one of the best but it's not so far that I can show it to you.

For the multicell you'll be using 2 functions:

h3. setStyle

    /**
     * Sets the font parameters for the specified tag
     *
     * @param string $tagName tag name
     * @param string $fontFamily font family
     * @param string $fontStyle font style
     * @param float $fontSize font size
     * @param mixed(string|array) $color font color
     */
    public function setStyle($tagName, $fontFamily, $fontStyle, $fontSize, $color)

Usage:

$multicell->setStyle("style", 'helvetica', "BI", 10, "0,0,220");
$multicell->setStyle("size", 'helvetica', "BI", 12, "0,0,120");
$multicell->setStyle("color", 'helvetica', "BI", 12, "0,255,255");

and

h3. multiCell

The parameters are the same as http://fpdf.org/en/doc/multicell.htm, with the paddings added at the end:

public function multiCell(
    $width,
    $height,
    $data,
    $border = 0,
    $align = 'J',
    $fill = 0,
    $paddingLeft = 0,
    $paddingTop = 0,
    $paddingRight = 0,
    $paddingBottom = 0
) {

Usage:

$multicell->multiCell(0, 5, "

Fpdf Advanced Multicell

", 1, "J", 1, 3, 3, 3, 3);

I hope this helps you a bit.

RE: Method Documentation? - Added by Sloan Thrasher 11 months ago

Andrei,

Thanks for the info, it should help out quite a bit. Do you know what attribute can be added to the tags?

Sloan

RE: Method Documentation? - Added by Andrei Bintintan 11 months ago

The tags are simple place-holders, be warned, it's not a HTML input.

Size and ypos are 2 attributes that are supported.

!Screenshot_428.png!

RE: Method Documentation? - Added by Sloan Thrasher 11 months ago

Thanks!

What is size? # pixels wide?

RE: Method Documentation? - Added by Andrei Bintintan 11 months ago

Sloan Thrasher wrote:

Thanks!

What is size? # pixels wide?

That should be in the Pdf Page Units(how the pdf page was initialized)

    (1-5/5)