本文整理匯總了PHP中HTML2FPDF::Image方法的典型用法代碼示例。如果您正苦於以下問題:PHP HTML2FPDF::Image方法的具體用法?PHP HTML2FPDF::Image怎麽用?PHP HTML2FPDF::Image使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類HTML2FPDF
的用法示例。
在下文中一共展示了HTML2FPDF::Image方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: date
$curdate = "" . date("Y-m-d") . "";
//Current Date
$date_diff = abs(strtotime($curdate) - strtotime($DoM));
$noofdays = floor($date_diff / (60 * 60 * 24));
$lastaddress = "Hebbal, Bangalore, Karnataka";
//Title
$pdf->SetFont("Times", "B", 20);
$pdf->Cell(190, 17.5, "Missing Person Details", 1, 1, 'C');
//$pdf->Cell(200,10,$curdate,20,1);
//$pdf->Ln();
//Missing Person Photo
$upload = "images/" . $uid . ".jpg";
$x = $pdf->GetX();
$y = $pdf->GetY();
$pdf->SetXY($x, $y);
$pdf->Image($upload, $x + 1, $y + 1, 48, 48, 'jpg');
$x = $pdf->GetX();
$y = $pdf->GetY() - 49;
$pdf->SetXY($x, $y);
$pdf->Cell(50, 50, " ", 1, 0);
//Missing Person Details
$pdf->SetFont("Arial", "B", 8);
$pdf->Cell(40, 5, "Unique ID: ", 1, 0, 'L');
$pdf->SetFont("Helvetica", "", 8);
$pdf->Cell(100, 5, $uid, 1, 1, 'C');
$x = $pdf->GetX();
$y = $pdf->GetY();
$pdf->SetXY($x + 50, $y);
$pdf->SetFont("Arial", "B", 8);
$pdf->Cell(40, 5, "Name: ", 1, 0, 'L');
$pdf->SetFont("Helvetica", "", 8);
示例2: substr
$imageData = "";
//print count($_POST["img"]);
for ($i = 0; $i < count($_POST["img"]); $i++) {
$imageData .= $_POST["img"][$i];
}
//print $imageData;
$filteredData = substr($imageData, strpos($imageData, ",") + 1);
$unencodedData = base64_decode($filteredData);
$fp = fopen($_SERVER["DOCUMENT_ROOT"] . __uploaddir__ . 'file.png', 'wb');
fwrite($fp, $unencodedData);
fclose($fp);
$image = imagecreatefrompng($_SERVER["DOCUMENT_ROOT"] . __uploaddir__ . 'file.png');
imagejpeg($image, $_SERVER["DOCUMENT_ROOT"] . __uploaddir__ . 'file.jpg', '100');
imagedestroy($image);
//génération du pdf
$pdf = new HTML2FPDF();
$pdf->SetFont('Arial', '', 11);
$pdf->AddPage();
$pdf->Text(5, 10, $_POST["urlpage"]);
$pdf->Text(170, 10, date("d/m/Y H:i:s"));
$pdf->Image($_SERVER["DOCUMENT_ROOT"] . __uploaddir__ . 'file.jpg', 5, 20, 200);
$pdf->Output($_SERVER["DOCUMENT_ROOT"] . __uploaddir__ . 'doc.pdf');
//$pdf->Output();
?>
<center><a href="<?php
echo __uploaddir__;
?>
doc.pdf"><?php
echo $trad["Cliquez ici pour voir le pdf"];
?>
</a></center>