05.05.2013 Views

Programming PHP

Programming PHP

Programming PHP

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

You can also move the location and draw text in one function, with pdf_show_xy( ):<br />

pdf_show_xy(pdf, text, x, y);<br />

The pdf_continue_text( ) function moves to the next line and outputs text:<br />

pdf_continue_text(pdf, text);<br />

Set the leading parameter with pdf_set_parameter( ) to change the vertical separation<br />

between lines.<br />

The pdf_show_boxed( ) function lets you define a rectangular area within which a<br />

string of text is formatted:<br />

$c = pdf_show_boxed(pdf, text, x, y, width, height, mode [, feature]);<br />

The mode parameter controls the alignment of the text within the box, and can be<br />

"left", "right", "center", "justify", or "fulljustify". The difference between<br />

"justify" and "fulljustify" is in the treatment of the last line. The last line in a<br />

"justify"-formatted area is not justified, whereas in a "fulljustify" area it is.<br />

Example 10-4 shows all five cases.<br />

Example 10-4. Text alignment within a box<br />

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!