本文整理汇总了PHP中Zend_Pdf_Page::clipRectangle方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Pdf_Page::clipRectangle方法的具体用法?PHP Zend_Pdf_Page::clipRectangle怎么用?PHP Zend_Pdf_Page::clipRectangle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Pdf_Page
的用法示例。
在下文中一共展示了Zend_Pdf_Page::clipRectangle方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _drawItemLabel
/**
* Draw one label section for one item on the PDF document.
*
* @param int $column Horizontal index on the current page
* @param int $row Vertical index on the current page
* @param Item $item The item to report on
*/
private function _drawItemLabel(Zend_Pdf_Page $page, $column, $row, $item)
{
// Start at the bottom left corner and count over for columns and down
// for rows.
$originX = self::MARGIN_LEFT + $column * (self::LABEL_WIDTH + self::HORIZONTAL_SPACING);
$originY = self::PAGE_HEIGHT - self::MARGIN_TOP - ($row + 1) * (self::LABEL_HEIGHT + self::VERTICAL_SPACING);
$page->saveGS();
// Clip on label boundaries to stop text from running over.
$page->clipRectangle($originX, $originY, $originX + self::LABEL_WIDTH, $originY + self::LABEL_HEIGHT);
$image = $this->_getQrCode($this->_baseUrl . '/items/show/' . $item->id);
$page->drawImage($image, $originX, $originY, $originX + self::LABEL_HEIGHT, $originY + self::LABEL_HEIGHT);
$titles = $item->getElementTexts('Dublin Core', 'Title');
if (count($titles) > 0) {
$textOriginX = $originX + self::LABEL_HEIGHT;
$textOriginY = $originY + 0.8 * self::LABEL_HEIGHT;
$cleanTitle = strip_tags(htmlspecialchars_decode($titles[0]->text));
$this->_drawWrappedText($page, $cleanTitle, $textOriginX, $textOriginY, self::LABEL_WIDTH - (self::LABEL_HEIGHT + 4));
}
// Remove clipping rectangle
$page->restoreGS();
// Release objects after use to keep memory usage down
release_object($item);
}