phppdflib

PDFLib fit_textflow values


In PDFLib fit_textflow, what do the first four variables represent?

$p->fit_textflow($llx1, $lly1, $urx1, $ury1, "");

Solution

  • From the PDFlib 10.0.3 API Reference chapter 5.2 " Multi-Line Text with Textflows"

    llx, lly, urx, ury
    x and y coordinates of the lower left and upper right corners of the target rectangle (the fitbox) in user coordinates. The corners can also be specified in reverse order. Shapes other than a rectangle can be filled with the wrap option.

    But please get in mind the correct method syntax is

    $p->fit_textflow($tf, $llx1, $lly1, $urx1, $ury1,"");
    

    where the first parameter $tf is the handle you retrieve as return value from create_textflow() or add_textflow(). So you do not request for the parameter 1-4, more correct are parameter 2-5.

    When you want to double check this with a complete code sample, please check the starter_textflow.php sample, which is included in each PDFlib PHP package as well in the PDFlib Cookbook.

    HTH Rainer