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.

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

header("Content-Length:$len");<br />

header("Content-Disposition:inline; filename=coords.pdf");<br />

echo $buf;<br />

pdf_delete($pdf);<br />

?><br />

Figure 10-4 shows the output of Example 10-4.<br />

Figure 10-4. Different text alignments<br />

The pdf_show_boxed( ) function returns the number of characters that did not fit in<br />

the box. If the feature parameter is present, it must be set to the string "blind". This<br />

prevents the text from being drawn on the page and is useful for checking whether a<br />

string will fit in the box without actually drawing it.<br />

Text Attributes<br />

There are three common ways to alter the appearance of text. One is to underline,<br />

overline, or strike out the text using parameters. Another is to change the stroking<br />

and filling. The third is to change the text’s color.<br />

Each of the underline, overline, and strikeout parameters may be set to "true" or<br />

"false" independently of the others. For example:<br />

pdf_set_parameter($pdf, "underline", "true"); // enable underlining<br />

This is the Title of the Book, eMatter Edition<br />

Copyright © 2002 O’Reilly & Associates, Inc. All rights reserved.<br />

Text | 241

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

Saved successfully!

Ooh no, something went wrong!