本文整理汇总了PHP中HTML2FPDF::SetXY方法的典型用法代码示例。如果您正苦于以下问题:PHP HTML2FPDF::SetXY方法的具体用法?PHP HTML2FPDF::SetXY怎么用?PHP HTML2FPDF::SetXY使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTML2FPDF
的用法示例。
在下文中一共展示了HTML2FPDF::SetXY方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createPDF
public function createPDF($url)
{
$url = 'http://clients.skiify.com/eximagen/en/boligrafos-plasticos/430-boligrafo-pilot.html';
require_once '/html2pdf/html2fpdf.php';
// Create new HTML2PDF class for an A4 page, measurements in mm
$pdf = new HTML2FPDF('P', 'mm', 'A4');
$buffer = file_get_contents($url);
var_dump($buffer);
// Optional top margin
$pdf->SetTopMargin(1);
$pdf->AddPage();
// Control the x-y position of the html
$pdf->SetXY(0, 0);
$pdf->WriteHTML($buffer);
// The 'D' arg forces the browser to download the file
$pdf->Output('MyFile.pdf', 'D');
}
示例2: date
$status = "Missing";
$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');