web/lib/Zend/Pdf/Annotation/Link.php
changeset 1230 68c69c656a2c
parent 807 877f952ae2bd
equal deleted inserted replaced
1229:5a6b6e770365 1230:68c69c656a2c
    13  * to license@zend.com so we can send you a copy immediately.
    13  * to license@zend.com so we can send you a copy immediately.
    14  *
    14  *
    15  * @category   Zend
    15  * @category   Zend
    16  * @package    Zend_Pdf
    16  * @package    Zend_Pdf
    17  * @subpackage Annotation
    17  * @subpackage Annotation
    18  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
    18  * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
    19  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    19  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    20  * @version    $Id: Link.php 24593 2012-01-05 20:35:02Z matthew $
    20  * @version    $Id$
    21  */
    21  */
    22 
    22 
    23 /** Internally used classes */
    23 /** Internally used classes */
    24 require_once 'Zend/Pdf/Element.php';
    24 require_once 'Zend/Pdf/Element.php';
    25 require_once 'Zend/Pdf/Element/Array.php';
    25 require_once 'Zend/Pdf/Element/Array.php';
    38  * Only destinations are used now since only GoTo action can be created by user
    38  * Only destinations are used now since only GoTo action can be created by user
    39  * in current implementation.
    39  * in current implementation.
    40  *
    40  *
    41  * @package    Zend_Pdf
    41  * @package    Zend_Pdf
    42  * @subpackage Annotation
    42  * @subpackage Annotation
    43  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
    43  * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
    44  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    44  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    45  */
    45  */
    46 class Zend_Pdf_Annotation_Link extends Zend_Pdf_Annotation
    46 class Zend_Pdf_Annotation_Link extends Zend_Pdf_Annotation
    47 {
    47 {
    48     /**
    48     /**
    68     }
    68     }
    69 
    69 
    70     /**
    70     /**
    71      * Create link annotation object
    71      * Create link annotation object
    72      *
    72      *
    73      * @param float $x1
    73      * @param float                  $x1
    74      * @param float $y1
    74      * @param float                  $y1
    75      * @param float $x2
    75      * @param float                  $x2
    76      * @param float $y2
    76      * @param float                  $y2
    77      * @param Zend_Pdf_Target|string $target
    77      * @param Zend_Pdf_Target|string $target
    78      * @return Zend_Pdf_Annotation_Link
    78      * @return Zend_Pdf_Annotation_Link
       
    79      * @throws Zend_Pdf_Exception
    79      */
    80      */
    80     public static function create($x1, $y1, $x2, $y2, $target)
    81     public static function create($x1, $y1, $x2, $y2, $target)
    81     {
    82     {
    82         if (is_string($target)) {
    83         if (is_string($target)) {
    83             require_once 'Zend/Pdf/Destination/Named.php';
    84             require_once 'Zend/Pdf/Destination/Named.php';
    84             $destination = Zend_Pdf_Destination_Named::create($target);
    85             $target = Zend_Pdf_Destination_Named::create($target);
    85         }
    86         }
    86         if (!$target instanceof Zend_Pdf_Target) {
    87         if (!$target instanceof Zend_Pdf_Target) {
    87             require_once 'Zend/Pdf/Exception.php';
    88             require_once 'Zend/Pdf/Exception.php';
    88             throw new Zend_Pdf_Exception('$target parameter must be a Zend_Pdf_Target object or a string.');
    89             throw new Zend_Pdf_Exception('$target parameter must be a Zend_Pdf_Target object or a string.');
    89         }
    90         }