本文整理匯總了PHP中Cpdf::newPage方法的典型用法代碼示例。如果您正苦於以下問題:PHP Cpdf::newPage方法的具體用法?PHP Cpdf::newPage怎麽用?PHP Cpdf::newPage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Cpdf
的用法示例。
在下文中一共展示了Cpdf::newPage方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1:
function new_page()
{
$this->_page_count++;
$ret = $this->_pdf->newPage();
$this->_pages[] = $ret;
return $ret;
}
示例2: extract
function new_page()
{
$this->_page_number++;
$ret = $this->_pdf->newPage();
if (isset($this->_page_text)) {
extract($this->_page_text);
$text = str_replace(array("{PAGE_NUM}", "{PAGE_COUNT}"), array($this->_page_number, $this->_page_count), $text);
$this->text($x, $y, $text, $font, $size, $color, $adjust, $angle);
}
return $ret;
}
示例3: Util
include_once 'pdfClass/class.pdf.php';
$util = new Util();
//echo "JJJJJJJJJJJJJJJJJJJJ";
//$util->securAdmin($_SESSION);
//echo "KKKKKKKKKKKKKK";
//exit;
//$pdf = new Cpdf(array(0,0,684,297));
$pdf = new Cpdf(array(0, 0, 684, 297));
$pdf->selectFont('pdfClass/fonts/Helvetica');
for ($i = 1; $i <= $_POST[total]; $i++) {
$login = $util->createPassword();
//$pass=$util->createPassword();
$sql = "insert into tbcard values('cardId','{$login}',NOW(),'{$balance}','1','none','')";
mysql_query($sql);
//$util->insertAccount($login,$pass,$_POST[balance]);
//echo "HHHH";
if ($i != 1) {
$pdf->newPage();
}
$pdf->addText(60, 235, 14, '<b>PREPAID CARD</b>');
$pdf->addText(60, 200, 12, '<b>Balance</b>: ' . number_format($_POST[balance], 2));
$pdf->addText(60, 160, 12, '<b>Code</b>: ' . $login);
//$pdf->addText(40,190,12,'<b>Password</b>: '.$pass);
}
$pdfcode = $pdf->output();
@chmod("accounts", 777);
$file = 'file-' . date('Ymd-his');
$fp = fopen('accounts/' . $file . '.pdf', 'wb');
fwrite($fp, $pdfcode);
fclose($fp);
header('location: accounts/' . $file . '.pdf');