protected function doAttach(GraphicsContext $gc, Node $node) { $parentBookmarkIdentifier = $this->getParentBookmarkIdentifier($node); $firstPoint = self::getFirstPointOf($node); $gc->addBookmark($this->getUniqueId(), $this->name, $firstPoint->getY(), $parentBookmarkIdentifier); $this->setPassive(true); }
protected function doAttach(GraphicsContext $gc, Node $node) { $destinationNode = $this->destination->getNode(); if (!$destinationNode) { throw new RuntimeException('Destination of GoToInternal dosn\'t exist.'); } $firstPoint = self::getFirstPointOf($node); $diagonalPoint = self::getDiagonalPointOf($node); $destinationNodeFirstPoint = self::getFirstPointOf($destinationNode); $gc->goToAction($destinationNode->getGraphicsContext(), $firstPoint->getX(), $firstPoint->getY(), $diagonalPoint->getX(), $diagonalPoint->getY(), $destinationNodeFirstPoint->getY()); }
protected function doDrawEnumeration(Document $document, BasicList $list, GraphicsContext $gc, $xCoord, $yCoord) { $encoding = $list->getEncoding(); $gc->saveGS(); $color = $list->getRecurseAttribute('color'); if ($color) { $gc->setLineColor($color); $gc->setFillColor($color); } $font = $list->getFont($document); $size = $list->getFontSizeRecursively(); if ($font && $size) { $gc->setFont($font, $size); } $gc->drawText($this->enumerationText, $xCoord, $yCoord, $encoding); $gc->restoreGS(); }
protected function doDrawEnumeration(Document $document, BasicList $list, GraphicsContext $gc, $xCoord, $yCoord) { $image = $this->getImage($list); $gc->drawImage($image, $xCoord, $yCoord - $this->imageWidth, $xCoord + $this->imageHeight, $yCoord); }
public function attachGraphicsContext(BaseGraphicsContext $gc) { $this->getZendPdf()->pages[] = $gc->getPage(); $this->graphicsContexts[] = $gc; }
private function drawCircleBorder(GraphicsContext $gc, Node $node, Document $document) { $size = $document->convertUnit($this->size); $gc->setLineWidth($size); $point = $node->getMiddlePoint(); $translation = $node->getPositionTranslation(); if (!$translation->isZero()) { $point = $point->translate($translation->getX(), $translation->getY()); } $this->drawCircle($gc, $node->getAttribute('radius'), $point->getX(), $point->getY(), GraphicsContext::SHAPE_DRAW_STROKE); }
protected function drawRoundedBoundary(GraphicsContext $gc, $x1, $y1, $x2, $y2, $fillType) { $gc->drawRoundedRectangle($x1, $y1, $x2, $y2, $this->getRadius(), $fillType); }
protected function doAttach(GraphicsContext $gc, Node $node) { $firstPoint = self::getFirstPointOf($node); $diagonalPoint = self::getDiagonalPointOf($node); $gc->uriAction($firstPoint->getX(), $firstPoint->getY(), $diagonalPoint->getX(), $diagonalPoint->getY(), $this->uri); }
protected function doGoToAction(BaseGraphicsContext $gc, $x1, $y1, $x2, $y2, $top) { try { $destination = \ZendPdf\Destination\FitHorizontally::create($gc->getPage(), $top); $annotation = $this->createAnnotationLink($x1, $y1, $x2, $y2, $destination); $this->getPage()->attachAnnotation($annotation); } catch (\ZendPdf\Exception\ExceptionInterface $e) { throw new RuntimeException('Error while adding goTo action', 0, $e); } }