本文整理汇总了PHP中pdf_end_page函数的典型用法代码示例。如果您正苦于以下问题:PHP pdf_end_page函数的具体用法?PHP pdf_end_page怎么用?PHP pdf_end_page使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pdf_end_page函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createPDF
public function createPDF($fname)
{
$pdf = pdf_new();
pdf_open_file($pdf, '');
$image = pdf_load_image($pdf, "png", $fname, "");
$w = pdf_get_value($pdf, "imagewidth", $image);
$h = pdf_get_value($pdf, "imageheight", $image);
pdf_begin_page($pdf, $w * 2, $h * 2);
pdf_place_image($pdf, $image, $w / 2, $h / 2, 1);
pdf_end_page($pdf);
pdf_close($pdf);
$mybuf = PDF_get_buffer($pdf);
$mylen = strlen($mybuf);
header("Content-type: application/pdf");
header("Content-Length: {$mylen}");
header("Content-Disposition: inline; filename=chart.pdf");
print $mybuf;
PDF_delete($pdf);
unlink($fname);
}
示例2: save
/**
* Output the result of the canvas
*
* @param array $param Parameter array
* @abstract
*/
function save($param = false)
{
parent::save($param);
pdf_end_page($this->_pdf);
pdf_close($this->_pdf);
$buf = pdf_get_buffer($this->_pdf);
$len = strlen($buf);
$fp = @fopen($param['filename'], 'wb');
if ($fp) {
fwrite($fp, $buf, strlen($buf));
fclose($fp);
}
pdf_delete($this->_pdf);
}
示例3: next_page
function next_page($height)
{
if ($this->_status == PDFLIB_STATUS_PAGE_STARTED) {
pdf_end_page($this->pdf);
}
pdf_begin_page($this->pdf, mm2pt($this->media->width()), mm2pt($this->media->height()));
// Calculate coordinate of the next page bottom edge
$this->offset -= $height - $this->offset_delta;
// Reset the "correction" offset to it normal value
// Note: "correction" offset is an offset value required to avoid page breaking
// in the middle of text boxes
$this->offset_delta = 0;
pdf_translate($this->pdf, 0, -$this->offset);
parent::next_page($height);
$this->_status = PDFLIB_STATUS_PAGE_STARTED;
}
示例4: next_page
function next_page()
{
$this->_show_watermark();
$this->current_page++;
pdf_end_page($this->pdf);
pdf_begin_page($this->pdf, mm2pt($this->media->width()), mm2pt($this->media->height()));
// Calculate coordinate of the next page bottom edge
$this->offset -= $this->height - $this->offset_delta;
// Reset the "correction" offset to it normal value
// Note: "correction" offset is an offset value required to avoid page breaking
// in the middle of text boxes
$this->offset_delta = 0;
pdf_translate($this->pdf, 0, -$this->offset);
}
示例5: pdf_restore
pdf_restore($pdf);
/* draw second hand */
pdf_setrgbcolor($pdf, 1.0, 0.0, 0.0);
pdf_setlinewidth($pdf, 2);
pdf_save($pdf);
pdf_rotate($pdf, -(($ltime['seconds'] - 15.0) * 6.0));
pdf_moveto($pdf, -$radius / 5, 0.0);
pdf_lineto($pdf, $radius, 0.0);
pdf_stroke($pdf);
pdf_restore($pdf);
/* draw little circle at center */
pdf_circle($pdf, 0, 0, $radius / 30);
pdf_fill($pdf);
pdf_restore($pdf);
/* DONE */
pdf_end_page($pdf);
pdf_close($pdf);
pdf_delete($pdf);
// hides "Generating ..." message:
echo "<script language='JavaScript'>document.getElementById('loading').style.display = 'none';</script>";
if (!file_exists($file)) {
?>
<h2 style="color: red">Error occured: file <?php
echo $file;
?>
does not exist!</h2>
<?php
}
?>
It is exactly <?php
echo $stime;
示例6: my_new_pdf_end_page
function my_new_pdf_end_page(&$pdf)
{
pdf_end_page($pdf);
}
示例7: writeToStream
function writeToStream($stream)
{
pdf_end_page($this->pdf);
pdf_close($this->pdf);
$buf = pdf_get_buffer($this->pdf);
fwrite($stream, $buf);
pdf_delete($this->pdf);
}
示例8: end_page
function end_page()
{
pdf_end_page($this->pdf);
}