ZF-1671: explain how to change font color
Description
The PDF docs don't really explain how to set font color. It appears the only way to do it is to create a new Style, and then set the font and color that way, as in:
$style = new Zend_Pdf_Style();
$style->setFillColor(new Zend_Pdf_Color_HTML('#000077'));
$style->setFont(Zend_Pdf_font::fontWithName(Zend_pdf_font::FONT_HELVETICA),10);
$page->setStyle($style);
It might also be helpful to modify the color section of the manual to explicitly list where color can be used (i.e. within a style object, and not in a page object, etc.)
Comments
Posted by Willie Alberty (willie) on 2007-09-26T20:17:44.000+0000
As with any other PDF drawing operations, text is drawn using the current fill color of the content stream's (page's) graphic state:
{{Zend_Pdf_Style}} objects allow you to set multiple attributes of the graphics state at once, but are not required.
Posted by Wil Sinclair (wil) on 2008-11-25T16:53:30.000+0000
Does this information belong in the reference guide? If so, could you please add it or reassign to Alex, Willie? Otherwise resolve it as 'not an issue'. Thanks.
Posted by Willie Alberty (willie) on 2008-11-25T16:55:42.000+0000
Assigning to Alexander for documentation update.
Posted by Marc Hodgins (mjh_ca) on 2010-11-05T01:11:02.000+0000
Patch to documentation attached.
Posted by Marc Hodgins (mjh_ca) on 2010-11-19T11:50:54.000+0000
Patch applied to trunk in r23406, merged to 1.11 release branch in r23407