I am using below code to show hyperlink in pdf file but link is not showing.Drawtext method works fine.It means hyperlink code is not working

$pdf = new \Zend_Pdf();
                        $pdf->pages[] = $pdf->newPage(\Zend_Pdf_Page::SIZE_A4);
                        $page = $pdf->pages[0]; // this will get reference to the first page.
                        $style = new \Zend_Pdf_Style();
$target = \Zend_Pdf_Action_URI::create('http://example.com', true);

             $annotation = \Zend_Pdf_Annotation_Link::create($x+250, $this->y-20, $x+400, $this->y-20, $target);
             $page->drawLine($x+250, $this->y-10, $x+350, $this->y - 10);

In my above code line is showing but hyperlink not showing

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.