v7‰PNG  IHDR Ÿ f Õ†C1 sRGB ®Îé gAMA ± üa pHYs à ÃÇo¨d GIDATx^íÜL”÷ð÷Yçªö("Bh_ò«®¸¢§q5kÖ*:þ0A­ºšÖ¥]VkJ¢M»¶f¸±8\k2íll£1]q®ÙÔ‚ÆT home/ajdemo/public_html/mempro/library/Am/Pdf/Cell.php000064400000006100152101623110016623 0ustar00 0, self::RIGHT => 0, self::BOTTOM => 0, self::LEFT => 0 ); public function __construct($content) { $this->content = $content; } public function setStyle($styles) { $this->styles = $styles; } public function setWidth($width) { $this->width = $width; } public function setPadding($top=0, $right=0, $bottom=0, $left=0) { $this->padding = array( self::TOP => $top, self::RIGHT => $right, self::BOTTOM => $bottom, self::LEFT => $left ); } public function getPadding($side) { return $this->padding[$side]; } public function getWidth() { return $this->width; } public function render(Am_Pdf_Page_Decorator $page, $x, $y) { if ($font = $this->getProperty('font')) { $fontTmp = $page->getFont(); $fontSizeTmp = $page->getFontSize(); $page->setFont($font['face'], $font['size']); } $lineHeight = $page->getFont()->getLineHeight()/100; $lineBegin = $y - $this->getPadding(self::TOP) - $lineHeight; $width = $this->getWidth() - $this->getPadding(self::LEFT) - $this->getPadding(self::RIGHT); switch ($this->getProperty('align', Am_Pdf_Page_Decorator::ALIGN_LEFT)) { case Am_Pdf_Page_Decorator::ALIGN_LEFT : $lineEnd = $page->drawTextWithFixedWidth($this->content, $x + 1 + $this->getPadding(self::LEFT), $lineBegin, $width); break; case Am_Pdf_Page_Decorator::ALIGN_RIGHT : $lineEnd = $page->drawTextWithFixedWidth($this->content, $x + $this->getWidth() - 1 - $this->getPadding(self::RIGHT), $lineBegin, $width, 'UTF-8', Am_Pdf_Page_Decorator::ALIGN_RIGHT); break; } $rowHeight = $lineBegin - $lineEnd; if ($font) { $page->setFont($fontTmp, $fontSizeTmp); } $shape = $this->getProperty('shape', array( 'type' => Zend_Pdf_Page::SHAPE_DRAW_STROKE, 'color' => new Zend_Pdf_Color_Html('#cccccc') )); return array( 'x' => $x, 'y' => $y, 'width' => $this->getWidth(), 'height' => $rowHeight + $this->getPadding(self::BOTTOM) + $this->getPadding(self::TOP), 'shape' => $shape); } protected function getProperty($propName, $default = null) { if (isset($this->styles[$propName])) { return $this->styles[$propName]; } else { return $default; } } }