本文整理汇总了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');