略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: HaruPage::createURLAnnotation

2024-12-21

HaruPage::createURLAnnotation

(PECL haru >= 0.0.1)

HaruPage::createURLAnnotationCreate and return new HaruAnnotation instance

说明

HaruPage::createURLAnnotation ( array $rectangle , string $url ) : object

Creates a new HaruAnnotation instance.

参数

rectangle

An array with 4 coordinates of the clickable area.

url

The URL to open.

返回值

Returns a new HaruAnnotation instance.

错误/异常

发生错误时抛出 HaruException 异常。

add a note add a note

User Contributed Notes 2 notes

up
0
266073 at gmail dot com
7 years ago
By default createURLAnnotation will create a cell with a solid border around it.  This is controlled by the haruAnnotation object returned by the method.  Create a reference to the haruAnnotation object and alter the border style to remove the solid border.

<?php
$haruAnotation
= $currentHaruPage->createURLAnnotation(Array($leftX,$bottomY,$rightX,$topY),'http://'.$dataItem);
$haruAnotation->setBorderStyle(0, 0, 0); // this alters the border
?>
up
0
Kore
9 years ago
Like shown in the source code [1] the array defining the rectangle should look like:

<?php
$rect
= array(
   
$bottomLeftXCoordinate,
   
$bottomLeftYCoordinate,
   
$topRightXCoordinate,
   
$topRightYCoordinate,
);
?>

As always these values have to be given in "pt" (point, 72dpi).

[1] http://cvs.php.net/viewvc.cgi/pecl/haru/haru.c?view=markup#l701

官方地址:https://www.php.net/manual/en/harupage.createurlannotation.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3