22 #require_once 'Zend/Pdf/Canvas/Interface.php'; 25 #require_once 'Zend/Pdf/Element.php'; 26 #require_once 'Zend/Pdf/Element/Array.php'; 27 #require_once 'Zend/Pdf/Element/String/Binary.php'; 28 #require_once 'Zend/Pdf/Element/Boolean.php'; 29 #require_once 'Zend/Pdf/Element/Dictionary.php'; 30 #require_once 'Zend/Pdf/Element/Name.php'; 31 #require_once 'Zend/Pdf/Element/Null.php'; 32 #require_once 'Zend/Pdf/Element/Numeric.php'; 33 #require_once 'Zend/Pdf/Element/String.php'; 34 #require_once 'Zend/Pdf/Resource/GraphicsState.php'; 35 #require_once 'Zend/Pdf/Resource/Font.php'; 36 #require_once 'Zend/Pdf/Resource/Image.php'; 91 abstract protected function _addProcSet($procSetName);
139 if ($x2 !==
null || $y2 !==
null) {
142 $xScale = $with/$canvas->
getWidth();
153 $this->
scale($xScale, $yScale);
202 $this->_contents .= $widthObj->toString() .
" w\n";
222 #require_once 'Zend/Pdf/Page.php'; 233 $dashPattern->items[] = $dashElement;
236 $this->_contents .= $dashPattern->toString() .
' ' 237 . $phaseEleemnt->toString() .
" d\n";
254 $this->_font = $font;
255 $this->_fontSize = $fontSize;
259 $this->_contents .= $fontNameObj->toString() .
' ' . $fontSizeObj->toString() .
" Tf\n";
274 if ($style->
getFont() !==
null) {
277 $this->_contents .= $style->
instructions($this->_dictionary->Resources);
279 $this->_style = $style;
328 $this->_contents .=
" q\n";
341 if ($this->_saveCount-- <= 0) {
342 #require_once 'Zend/Pdf/Exception.php'; 345 $this->_contents .=
" Q\n";
371 $graphicsState->setAlpha($alpha,
$mode);
375 $this->_contents .= $gStateNameObject->toString() .
" gs\n";
390 public function clipCircle($x, $y, $radius, $startAngle =
null, $endAngle =
null)
393 $x + $radius, $y + $radius,
394 $startAngle, $endAngle);
416 public function clipEllipse($x1, $y1, $x2, $y2, $startAngle =
null, $endAngle =
null)
437 if ($startAngle !==
null) {
438 if ($startAngle != 0) { $startAngle = fmod($startAngle, M_PI*2); }
439 if ($endAngle != 0) { $endAngle = fmod($endAngle, M_PI*2); }
441 if ($startAngle > $endAngle) {
445 $clipPath = $xC->toString() .
' ' . $yC->toString() .
" m\n";
446 $clipSectors = (int)ceil(($endAngle - $startAngle)/M_PI_4);
447 $clipRadius = max($x2 - $x1, $y2 - $y1);
450 $pAngle = $startAngle + ($endAngle - $startAngle)*
$count/(
float)$clipSectors;
454 $clipPath .= $pX->toString() .
' ' . $pY->toString() .
" l\n";
457 $this->_contents .= $clipPath .
"h\nW\nn\n";
465 $xDelta = 2*(M_SQRT2 - 1)*($x2 - $x1)/3.;
466 $yDelta = 2*(M_SQRT2 - 1)*($y2 - $y1)/3.;
472 $this->_contents .= $xC->toString() .
' ' . $yUp->toString() .
" m\n" 473 . $xr->toString() .
' ' . $yUp->toString() .
' ' 474 . $xRight->toString() .
' ' . $yu->toString() .
' ' 475 . $xRight->toString() .
' ' . $yC->toString() .
" c\n" 476 . $xRight->toString() .
' ' . $yd->toString() .
' ' 477 . $xr->toString() .
' ' . $yDown->toString() .
' ' 478 . $xC->toString() .
' ' . $yDown->toString() .
" c\n" 479 . $xl->toString() .
' ' . $yDown->toString() .
' ' 480 . $xLeft->toString() .
' ' . $yd->toString() .
' ' 481 . $xLeft->toString() .
' ' . $yC->toString() .
" c\n" 482 . $xLeft->toString() .
' ' . $yu->toString() .
' ' 483 . $xl->toString() .
' ' . $yUp->toString() .
' ' 484 . $xC->toString() .
' ' . $yUp->toString() .
" c\n" 503 foreach ($x as
$id => $xVal) {
508 $path = $xObj->toString() .
' ' . $yObj->toString() .
" m\n";
511 $path .= $xObj->toString() .
' ' . $yObj->toString() .
" l\n";
515 $this->_contents .=
$path;
518 $this->_contents .=
" h\n W\nn\n";
521 $this->_contents .=
" h\n W*\nn\n";
545 $this->_contents .= $x1Obj->toString() .
' ' . $y1Obj->toString() .
' ' 546 . $widthObj->toString() .
' ' . $height2Obj->toString() .
" re\n" 577 public function drawCircle($x, $y, $radius, $param4 =
null, $param5 =
null, $param6 =
null)
580 $x + $radius, $y + $radius,
581 $param4, $param5, $param6);
606 public function drawEllipse($x1, $y1, $x2, $y2, $param5 =
null, $param6 =
null, $param7 =
null)
608 if ($param5 ===
null) {
612 }
else if ($param6 ===
null) {
619 $startAngle = $param5;
622 if ($param7 ===
null) {
648 if ($startAngle !==
null) {
649 if ($startAngle != 0) { $startAngle = fmod($startAngle, M_PI*2); }
650 if ($endAngle != 0) { $endAngle = fmod($endAngle, M_PI*2); }
652 if ($startAngle > $endAngle) {
656 $clipPath = $xC->toString() .
' ' . $yC->toString() .
" m\n";
657 $clipSectors = (int)ceil(($endAngle - $startAngle)/M_PI_4);
658 $clipRadius = max($x2 - $x1, $y2 - $y1);
661 $pAngle = $startAngle + ($endAngle - $startAngle)*
$count/(
float)$clipSectors;
665 $clipPath .= $pX->toString() .
' ' . $pY->toString() .
" l\n";
668 $this->_contents .=
"q\n" . $clipPath .
"h\nW\nn\n";
676 $xDelta = 2*(M_SQRT2 - 1)*($x2 - $x1)/3.;
677 $yDelta = 2*(M_SQRT2 - 1)*($y2 - $y1)/3.;
683 $this->_contents .= $xC->toString() .
' ' . $yUp->toString() .
" m\n" 684 . $xr->toString() .
' ' . $yUp->toString() .
' ' 685 . $xRight->toString() .
' ' . $yu->toString() .
' ' 686 . $xRight->toString() .
' ' . $yC->toString() .
" c\n" 687 . $xRight->toString() .
' ' . $yd->toString() .
' ' 688 . $xr->toString() .
' ' . $yDown->toString() .
' ' 689 . $xC->toString() .
' ' . $yDown->toString() .
" c\n" 690 . $xl->toString() .
' ' . $yDown->toString() .
' ' 691 . $xLeft->toString() .
' ' . $yd->toString() .
' ' 692 . $xLeft->toString() .
' ' . $yC->toString() .
" c\n" 693 . $xLeft->toString() .
' ' . $yu->toString() .
' ' 694 . $xl->toString() .
' ' . $yUp->toString() .
' ' 695 . $xC->toString() .
' ' . $yUp->toString() .
" c\n";
699 $this->_contents .=
" B*\n";
702 $this->_contents .=
" f*\n";
705 $this->_contents .=
" S\n";
709 if ($startAngle !==
null) {
710 $this->_contents .=
"Q\n";
738 $this->_contents .=
"q\n" 739 .
'1 0 0 1 ' . $x1Obj->toString() .
' ' . $y1Obj->toString() .
" cm\n" 740 . $widthObj->toString() .
' 0 0 ' . $heightObj->toString() .
" 0 0 cm\n" 741 . $imageNameObj->toString() .
" Do\n" 781 $this->_contents .= $x1Obj->toString() .
' ' . $y1Obj->toString() .
" m\n" 782 . $x2Obj->toString() .
' ' . $y2Obj->toString() .
" l\n S\n";
808 foreach ($x as
$id => $xVal) {
813 $path = $xObj->toString() .
' ' . $yObj->toString() .
" m\n";
816 $path .= $xObj->toString() .
' ' . $yObj->toString() .
" l\n";
820 $this->_contents .=
$path;
825 $this->_contents .=
" b\n";
828 $this->_contents .=
" b*\n";
833 $this->_contents .=
" h\n f\n";
836 $this->_contents .=
" h\n f*\n";
840 $this->_contents .=
" S\n";
871 $this->_contents .= $x1Obj->toString() .
' ' . $y1Obj->toString() .
' ' 872 . $widthObj->toString() .
' ' . $height2Obj->toString() .
" re\n";
876 $this->_contents .=
" B*\n";
879 $this->_contents .=
" f*\n";
882 $this->_contents .=
" S\n";
915 if(!is_array($radius)) {
916 $radius = array($radius, $radius, $radius, $radius);
918 for (
$i = 0;
$i < 4;
$i++) {
919 if(!isset($radius[
$i])) {
937 $this->_contents .= $x1Obj->toString() .
' ' . $y1Obj->toString() .
" m\n";
940 $this->_contents .= $x1Obj->toString() .
' ' . $y1Obj->toString() .
" l\n";
943 if ($radius[1] != 0) {
950 $this->_contents .= $x1Obj->toString() .
' ' . $y1Obj->toString() .
' ' 951 . $x2Obj->toString() .
' ' . $y2Obj->toString() .
' ' 952 . $x3Obj->toString() .
' ' . $y3Obj->toString() .
' ' 959 $this->_contents .= $x1Obj->toString() .
' ' . $y1Obj->toString() .
" l\n";
962 if ($radius[2] != 0) {
969 $this->_contents .= $x1Obj->toString() .
' ' . $y1Obj->toString() .
' ' 970 . $x2Obj->toString() .
' ' . $y2Obj->toString() .
' ' 971 . $x3Obj->toString() .
' ' . $y3Obj->toString() .
' ' 978 $this->_contents .= $x1Obj->toString() .
' ' . $y1Obj->toString() .
" l\n";
981 if ($radius[3] != 0) {
988 $this->_contents .= $x1Obj->toString() .
' ' . $y1Obj->toString() .
' ' 989 . $x2Obj->toString() .
' ' . $y2Obj->toString() .
' ' 990 . $x3Obj->toString() .
' ' . $y3Obj->toString() .
' ' 997 $this->_contents .= $x1Obj->toString() .
' ' . $y1Obj->toString() .
" l\n";
1000 if ($radius[0] != 0) {
1007 $this->_contents .= $x1Obj->toString() .
' ' . $y1Obj->toString() .
' ' 1008 . $x2Obj->toString() .
' ' . $y2Obj->toString() .
' ' 1009 . $x3Obj->toString() .
' ' . $y3Obj->toString() .
' ' 1013 switch ($fillType) {
1015 $this->_contents .=
" B*\n";
1018 $this->_contents .=
" f*\n";
1021 $this->_contents .=
" S\n";
1041 if ($this->_font ===
null) {
1042 #require_once 'Zend/Pdf/Exception.php'; 1052 $this->_contents .=
"BT\n" 1053 . $xObj->
toString() .
' ' . $yObj->toString() .
" Td\n" 1054 . $textObj->toString() .
" Tj\n" 1127 $this->_contents .=
'1 0 0 1 ' . $xObj->toString() .
' ' . $yObj->toString() .
" cm\n" 1128 . $cos->toString() .
' ' . $sin->toString() .
' ' . $mSin->toString() .
' ' . $cos->toString() .
" 0 0 cm\n" 1129 .
'1 0 0 1 ' . $mXObj->toString() .
' ' . $mYObj->toString() .
" cm\n";
1147 $this->_contents .= $xScaleObj->toString() .
' 0 0 ' . $yScaleObj->toString() .
" 0 0 cm\n";
1165 $this->_contents .=
'1 0 0 1 ' . $xShiftObj->toString() .
' ' . $yShiftObj->toString() .
" cm\n";
1179 public function skew($x, $y, $xAngle, $yAngle)
1191 $this->_contents .=
'1 0 0 1 ' . $xObj->toString() .
' ' . $yObj->toString() .
" cm\n" 1192 .
'1 ' . $tanXObj->toString() .
' ' . $tanYObj->toString() .
" 1 0 0 cm\n" 1193 .
'1 0 0 1 ' . $mXObj->toString() .
' ' . $mYObj->toString() .
" cm\n";
1210 if (! empty($procSet)) {
1213 $this->_contents .=
$data;
const FILL_METHOD_NON_ZERO_WINDING
drawEllipse($x1, $y1, $x2, $y2, $param5=null, $param6=null, $param7=null)
_addProcSet($procSetName)
setLineColor(Zend_Pdf_Color $color)
rawWrite($data, $procSet=null)
translate($xShift, $yShift)
setAlpha($alpha, $mode='Normal')
setStyle(Zend_Pdf_Style $style)
drawText($text, $x, $y, $charEncoding='')
drawCanvas(Zend_Pdf_Canvas_Interface $canvas, $x1, $y1, $x2=null, $y2=null)
skew($x, $y, $xAngle, $yAngle)
drawLine($x1, $y1, $x2, $y2)
drawPolygon($x, $y, $fillType=Zend_Pdf_Page::SHAPE_DRAW_FILL_AND_STROKE, $fillMethod=Zend_Pdf_Page::FILL_METHOD_NON_ZERO_WINDING)
_attachResource($type, Zend_Pdf_Resource $resource)
drawRectangle($x1, $y1, $x2, $y2, $fillType=Zend_Pdf_Page::SHAPE_DRAW_FILL_AND_STROKE)
clipPolygon($x, $y, $fillMethod=Zend_Pdf_Page::FILL_METHOD_NON_ZERO_WINDING)
drawLayoutBox($box, $x, $y)
if($exist=($block->getProductCollection() && $block->getProductCollection() ->getSize())) $mode
setFillColor(Zend_Pdf_Color $color)
drawRoundedRectangle($x1, $y1, $x2, $y2, $radius, $fillType=Zend_Pdf_Page::SHAPE_DRAW_FILL_AND_STROKE)
setLineDashingPattern($pattern, $phase=0)
clipEllipse($x1, $y1, $x2, $y2, $startAngle=null, $endAngle=null)
const SHAPE_DRAW_FILL_AND_STROKE
setFont(Zend_Pdf_Resource_Font $font, $fontSize)
clipRectangle($x1, $y1, $x2, $y2)
clipCircle($x, $y, $radius, $startAngle=null, $endAngle=null)
drawImage(Zend_Pdf_Resource_Image $image, $x1, $y1, $x2, $y2)
drawCircle($x, $y, $radius, $param4=null, $param5=null, $param6=null)