本文整理汇总了PHP中FPDF::Link方法的典型用法代码示例。如果您正苦于以下问题:PHP FPDF::Link方法的具体用法?PHP FPDF::Link怎么用?PHP FPDF::Link使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FPDF
的用法示例。
在下文中一共展示了FPDF::Link方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: save
//.........这里部分代码省略.........
$borders .= 'T';
$pdf->SetDrawColor(
hexdec(substr($style->getBorders()->getTop()->getColor()->getRGB(), 0, 2)),
hexdec(substr($style->getBorders()->getTop()->getColor()->getRGB(), 2, 2)),
hexdec(substr($style->getBorders()->getTop()->getColor()->getRGB(), 4, 2))
);
}
if ($style->getBorders()->getBottom()->getBorderStyle() != PHPExcel_Style_Border::BORDER_NONE) {
$borders .= 'B';
$pdf->SetDrawColor(
hexdec(substr($style->getBorders()->getBottom()->getColor()->getRGB(), 0, 2)),
hexdec(substr($style->getBorders()->getBottom()->getColor()->getRGB(), 2, 2)),
hexdec(substr($style->getBorders()->getBottom()->getColor()->getRGB(), 4, 2))
);
}
if ($borders == '') {
$borders = 0;
}
if ($sheet->getShowGridlines()) {
$borders = 'LTRB';
}
// Image?
$iterator = $sheet->getDrawingCollection()->getIterator();
while ($iterator->valid()) {
if ($iterator->current()->getCoordinates() == PHPExcel_Cell::stringFromColumnIndex($column) . ($row + 1)) {
try {
$pdf->Image(
$iterator->current()->getPath(),
$pdf->GetX(),
$pdf->GetY(),
$iterator->current()->getWidth(),
$iterator->current()->getHeight(),
'',
$this->_tempDir
);
} catch (Exception $ex) { }
}
$iterator->next();
}
// Print cell
$pdf->MultiCell(
$cellWidth,
$cellHeight,
$cellData,
$borders,
$alignment,
($style->getFill()->getFillType() == PHPExcel_Style_Fill::FILL_NONE ? 0 : 1)
);
// Coordinates
$endX = $pdf->GetX();
$endY = $pdf->GetY();
// Revert to original Y location
if ($endY > $startY) {
$pdf->SetY($startY);
if ($lineHeight < $lineHeight + ($endY - $startY)) {
$lineHeight = $lineHeight + ($endY - $startY);
}
}
$pdf->SetX($startX + $singleCellWidth);
// Hyperlink?
if ($sheet->getCellByColumnAndRow($column, $row)->hasHyperlink()) {
if (!$sheet->getCellByColumnAndRow($column, $row)->getHyperlink()->isInternal()) {
$pdf->Link(
$startX,
$startY,
$endX - $startX,
$endY - $startY,
$sheet->getCellByColumnAndRow($column, $row)->getHyperlink()->getUrl()
);
}
}
}
// Garbage collect!
$sheet->garbageCollect();
// Next line...
$pdf->Ln($lineHeight);
}
}
// Document info
$pdf->SetTitle($this->_phpExcel->getProperties()->getTitle());
$pdf->SetAuthor($this->_phpExcel->getProperties()->getCreator());
$pdf->SetSubject($this->_phpExcel->getProperties()->getSubject());
$pdf->SetKeywords($this->_phpExcel->getProperties()->getKeywords());
$pdf->SetCreator($this->_phpExcel->getProperties()->getCreator());
// Write to file
fwrite($fileHandle, $pdf->output($pFilename, 'S'));
// Close file
fclose($fileHandle);
}
示例2: execute
public function execute()
{
$pdf = new FPDF();
$pdf->AddPage();
$pdf->SetFont("helvetica", "B", 16);
$pdf->Cell(0, 10, "Hello world!", 0, 1);
$pdf->Ln();
$pdf->SetFont("helvetica", "", 12);
$pdf->SetFillColor(192, 192, 192);
$pdf->Cell(40, 10, "Back", 1, 0, "C", 1);
$pdf->Link(10, 30, 40, 10, "/demos");
$pdf->Output();
$this->output->disable();
}
示例3: Link
/**
* Preserve adding Links in Templates ...won't work
*/
function Link($x, $y, $w, $h, $link)
{
if ($this->_intpl) {
$this->Error('Using links in templates aren\'t possible!');
}
parent::Link($x, $y, $w, $h, $link);
}
示例4: Link
/**
* Preserve adding Links in Templates ...won't work
*/
function Link($x, $y, $w, $h, $link)
{
if (is_subclass_of($this, 'TCPDF')) {
$args = func_get_args();
return call_user_func_array(array($this, 'TCPDF::Link'), $args);
}
if ($this->_intpl) {
$this->Error('Using links in templates aren\'t possible!');
}
parent::Link($x, $y, $w, $h, $link);
}
示例5: Link
/**
* Preserve adding Links in Templates ...won't work
*/
function Link($x, $y, $w, $h, $link, $spaces = 0)
{
if (!is_subclass_of($this, 'TCPDF') && func_num_args() > 5) {
$this->Error('More than 7 arguments for the Image method are only available in TCPDF.');
}
if ($this->_intpl) {
$this->Error('Using links in templates aren\'t possible!');
}
parent::Link($x, $y, $w, $h, $link, $spaces);
}