本文整理汇总了PHP中PHPRtfLite::getColorTable方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPRtfLite::getColorTable方法的具体用法?PHP PHPRtfLite::getColorTable怎么用?PHP PHPRtfLite::getColorTable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPRtfLite
的用法示例。
在下文中一共展示了PHPRtfLite::getColorTable方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
/**
* renders list
*/
public function render()
{
$stream = $this->_rtf->getWriter();
$number = 0;
foreach ($this->_items as $item) {
// item is a list
if ($item instanceof PHPRtfLite_List_Numbering) {
if ($this instanceof PHPRtfLite_List_Numbering) {
$item->setPrefix($this->_prefix . $this->getNumber($number) . $this->_separator);
$item->setSuffix($this->_suffix);
}
} else {
$number++;
$listCharFontIndex = $this->getListCharFontIndex();
$listCharacter = $this->getListCharacter($number);
$listCharDefinition = '{\\*\\pn\\pnlvlblt' . '\\pnf' . $listCharFontIndex;
if ($this->_font) {
$listCharDefinition .= '\\pnfs' . $this->_font->getSize() * 2;
if ($color = $this->_font->getColor()) {
$listCharDefinition .= '\\pncf' . $this->_rtf->getColorTable()->getColorIndex($color);
}
}
$listCharDefinition .= '\\pnindent0{\\pntxtb ' . $listCharacter . '}}';
$textIndent = $this->_listIndent + $this->_textIndent;
$stream->write('\\nowidctlpar\\fi-' . $this->_listIndent . '\\li' . $textIndent . "\r\n");
$stream->write($listCharDefinition);
}
// renders item
$item->render();
if (false == $item instanceof PHPRtfLite_List) {
$stream->write('\\par\\pard' . "\r\n");
}
}
}
示例2: renderDefinition
/**
* renders cell definition
*/
public function renderDefinition()
{
$stream = $this->_rtf->getWriter();
if ($this->isVerticalMerged()) {
if ($this->isVerticalMergedFirstInRange()) {
$stream->write('\\clvmgf');
} else {
$stream->write('\\clvmrg');
}
}
$backgroundColor = $this->getBackgroundColor();
if ($backgroundColor) {
$colorTable = $this->_rtf->getColorTable();
$stream->write('\\clcbpat' . $colorTable->getColorIndex($backgroundColor) . ' ');
}
switch ($this->getVerticalAlignment()) {
case self::VERTICAL_ALIGN_TOP:
$stream->write('\\clvertalt');
break;
case self::VERTICAL_ALIGN_CENTER:
$stream->write('\\clvertalc');
break;
case self::VERTICAL_ALIGN_BOTTOM:
$stream->write('\\clvertalb');
break;
}
switch ($this->getRotateTo()) {
case self::ROTATE_RIGHT:
$stream->write('\\cltxtbrl');
break;
case self::ROTATE_LEFT:
$stream->write('\\cltxbtlr');
break;
}
// NOTE: microsoft and all other rtf readers I know confound left with top cell padding
if ($this->_paddingLeft) {
$stream->write('\\clpadft3\\clpadt' . PHPRtfLite_Unit::getUnitInTwips($this->_paddingLeft) . ' ');
}
if ($this->_paddingTop) {
$stream->write('\\clpadfl3\\clpadl' . PHPRtfLite_Unit::getUnitInTwips($this->_paddingTop) . ' ');
}
if ($this->_paddingBottom) {
$stream->write('\\clpadfb3\\clpadb' . PHPRtfLite_Unit::getUnitInTwips($this->_paddingBottom) . ' ');
}
if ($this->_paddingRight) {
$stream->write('\\clpadfr3\\clpadr' . PHPRtfLite_Unit::getUnitInTwips($this->_paddingRight) . ' ');
}
$border = $this->getBorder();
if ($border) {
$stream->write($border->getContent('\\cl'));
}
}
示例3: setParFormat
/**
* sets paragraph format for image
*
* @param PHPRtfLite_ParFormat $parFormat
*/
public function setParFormat(PHPRtfLite_ParFormat $parFormat)
{
$this->_parFormat = $parFormat;
$parFormat->setColorTable($this->_rtf->getColorTable());
}
示例4: setBorderBottom
/**
* sets border format for bottom border
*
* @param PHPRtfLite_Border_Format $borderFormat
*/
public function setBorderBottom(PHPRtfLite_Border_Format $borderFormat)
{
$borderFormat->setColorTable($this->_rtf->getColorTable());
$this->_borderBottom = $borderFormat;
}