Skip to content

How to add link to image? #49

@dvdtth

Description

@dvdtth

Taking the following code from the samples folder:

$currentSlide = $objPHPPowerPoint->getActiveSlide();
$shape = $currentSlide->createDrawingShape();
$shape->setName('PHPPowerPoint logo')
      ->setDescription('PHPPowerPoint logo')
      ->setPath('./resources/phppowerpoint_logo.gif')
      ->setHeight(36)
      ->setOffsetX(10)
      ->setOffsetY(10);
$shape->getShadow()->setVisible(true)
                   ->setDirection(45)
                   ->setDistance(10);

Adding the following line to add a hyperlink to the image doesn't seem to work.

$shape->getHyperlink()->setUrl('https://github.com/PHPOffice/PHPPowerPoint/')
                      ->setTooltip('PHPPowerPoint');

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions