Horde_Pdf_Writer::setLink PHP Method

    public function setLink($link, $y = 0, $page = -1)
    {
        if ($y == -1) {
            $y = $this->y;
        }
        if ($page == -1) {
            $page = $this->_page;
        }
        $this->_links[$link] = array($page, $y);
    }

Usage Example

コード例 #1
0
ファイル: WriterTest.php プロジェクト: jubinpatel/horde
 /**
  * Horde Bug #5964
  */
 public function testLinks()
 {
     $pdf = new Horde_Pdf_Writer(array('orientation' => 'P', 'format' => 'A4'));
     $pdf->setInfo('CreationDate', $this->fixtureCreationDate());
     $pdf->open();
     $pdf->setCompression(false);
     $pdf->addPage();
     $pdf->setFont('Helvetica', 'U', 12);
     $pdf->write(15, 'Horde', 'http://www.horde.org');
     $pdf->write(15, "\n");
     $link = $pdf->addLink();
     $pdf->write(15, 'here', $link);
     $pdf->addPage();
     $pdf->setLink($link);
     $pdf->image(__DIR__ . '/fixtures/horde-power1.png', 15, 15, 0, 0, '', 'http://pear.horde.org/');
     $actual = $pdf->getOutput();
     $expected = $this->fixture('links');
     $this->assertEquals($expected, $actual);
 }