本文整理汇总了PHP中Cpdf::getFirstPageId方法的典型用法代码示例。如果您正苦于以下问题:PHP Cpdf::getFirstPageId方法的具体用法?PHP Cpdf::getFirstPageId怎么用?PHP Cpdf::getFirstPageId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cpdf
的用法示例。
在下文中一共展示了Cpdf::getFirstPageId方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: list
/**
* Class constructor
*
* @param mixed $paper The size of paper to use in this PDF ({@link CPDF_Adapter::$PAPER_SIZES})
* @param string $orientation The orienation of the document (either 'landscape' or 'portrait')
*/
function __construct($paper = "letter", $orientation = "portrait")
{
if (is_array($paper)) {
$size = $paper;
} else {
if (isset(self::$PAPER_SIZES[mb_strtolower($paper)])) {
$size = self::$PAPER_SIZES[mb_strtolower($paper)];
} else {
$size = self::$PAPER_SIZES["letter"];
}
}
if (mb_strtolower($orientation) === "landscape") {
list($size[2], $size[3]) = array($size[3], $size[2]);
}
$this->_pdf = new Cpdf($size, DOMPDF_UNICODE_ENABLED, DOMPDF_FONT_CACHE, DOMPDF_TEMP_DIR);
$this->_pdf->addInfo("Creator", "DOMPDF");
$time = substr_replace(date('YmdHisO'), '\'', -2, 0) . '\'';
$this->_pdf->addInfo("CreationDate", "D:{$time}");
$this->_pdf->addInfo("ModDate", "D:{$time}");
$this->_width = $size[2] - $size[0];
$this->_height = $size[3] - $size[1];
$this->_page_number = $this->_page_count = 1;
$this->_page_text = array();
$this->_pages = array($this->_pdf->getFirstPageId());
$this->_image_cache = array();
}
示例2: elseif
/**
* Class constructor
*
* @param mixed $paper The size of paper to use in this PDF ({@link CPDF_Adapter::$PAPER_SIZES})
* @param string $orientation The orientation of the document (either 'landscape' or 'portrait')
* @param DOMPDF $dompdf The DOMPDF instance
*/
function __construct($paper = "letter", $orientation = "portrait", DOMPDF $dompdf)
{
if (is_array($paper)) {
$size = $paper;
} elseif (isset(self::$PAPER_SIZES[mb_strtolower($paper)])) {
$size = self::$PAPER_SIZES[mb_strtolower($paper)];
} else {
$size = self::$PAPER_SIZES["letter"];
}
if (mb_strtolower($orientation) === "landscape") {
list($size[2], $size[3]) = array($size[3], $size[2]);
}
$this->_dompdf = $dompdf;
$this->_pdf = new Cpdf($size, $dompdf->get_option("enable_unicode"), $dompdf->get_option("font_cache"), $dompdf->get_option("temp_dir"));
$this->_pdf->addInfo("Creator", "DOMPDF");
$time = substr_replace(date('YmdHisO'), '\'', -2, 0) . '\'';
$this->_pdf->addInfo("CreationDate", "D:{$time}");
$this->_pdf->addInfo("ModDate", "D:{$time}");
$this->_width = $size[2] - $size[0];
$this->_height = $size[3] - $size[1];
$this->_page_number = $this->_page_count = 1;
$this->_page_text = array();
$this->_pages = array($this->_pdf->getFirstPageId());
$this->_image_cache = array();
}
示例3: Cpdf
/**
* Class constructor
*
* @param mixed $paper The size of paper to use in this PDF ({@link CPDF_Adapter::$PAPER_SIZES})
* @param string $orientation The orienation of the document (either 'landscape' or 'portrait')
*/
function __construct($paper = "letter", $orientation = "portrait")
{
if (is_array($paper)) {
$size = $paper;
} else {
if (isset(self::$PAPER_SIZES[mb_strtolower($paper)])) {
$size = self::$PAPER_SIZES[$paper];
} else {
$size = self::$PAPER_SIZES["letter"];
}
}
if (mb_strtolower($orientation) == "landscape") {
$a = $size[3];
$size[3] = $size[2];
$size[2] = $a;
}
$this->_pdf = new Cpdf($size);
$this->_pdf->addInfo("Creator", "DOMPDF Converter");
// Silence pedantic warnings about missing TZ settings
if (function_exists("date_default_timezone_get")) {
$tz = @date_default_timezone_get();
date_default_timezone_set("UTC");
$this->_pdf->addInfo("CreationDate", date("Y-m-d"));
date_default_timezone_set($tz);
} else {
$this->_pdf->addInfo("CreationDate", date("Y-m-d"));
}
$this->_width = $size[2] - $size[0];
$this->_height = $size[3] - $size[1];
$this->_pdf->openHere('Fit');
$this->_page_number = $this->_page_count = 1;
$this->_page_text = array();
$this->_pages = array($this->_pdf->getFirstPageId());
$this->_image_cache = array();
}
示例4: Cpdf
/**
* Class constructor
*
* @param mixed $paper The size of paper to use in this PDF ({@link CPDF_Adapter::$PAPER_SIZES})
* @param string $orientation The orienation of the document (either 'landscape' or 'portrait')
*/
function __construct($paper = "letter", $orientation = "portrait")
{
if (is_array($paper)) {
$size = $paper;
} else {
if (isset(self::$PAPER_SIZES[mb_strtolower($paper)])) {
$size = self::$PAPER_SIZES[mb_strtolower($paper)];
} else {
$size = self::$PAPER_SIZES["letter"];
}
}
if (mb_strtolower($orientation) === "landscape") {
$a = $size[3];
$size[3] = $size[2];
$size[2] = $a;
}
$this->_pdf = new Cpdf($size, DOMPDF_UNICODE_ENABLED, DOMPDF_FONT_CACHE, DOMPDF_TEMP_DIR);
$this->_pdf->addInfo("Creator", "dompdf");
// Silence pedantic warnings about missing TZ settings
$time = substr_replace(date('YmdHisO'), '\'', 0 - 2, 0) . '\'';
$this->_pdf->addInfo("CreationDate", "D:" . $time);
$this->_pdf->addInfo("ModDate", "D:" . $time);
$this->_width = $size[2] - $size[0];
$this->_height = $size[3] - $size[1];
$this->_pdf->openHere('Fit');
$this->_page_number = $this->_page_count = 1;
$this->_page_text = array();
$this->_pages = array($this->_pdf->getFirstPageId());
$this->_image_cache = array();
}
示例5: list
/**
* Class constructor
*
* @param mixed $paper The size of paper to use in this PDF ({@link CPDF::$PAPER_SIZES})
* @param string $orientation The orientation of the document (either 'landscape' or 'portrait')
* @param Dompdf $dompdf The Dompdf instance
*/
function __construct($paper = "letter", $orientation = "portrait", Dompdf $dompdf)
{
if (is_array($paper)) {
$size = $paper;
} else {
if (isset(self::$PAPER_SIZES[mb_strtolower($paper)])) {
$size = self::$PAPER_SIZES[mb_strtolower($paper)];
} else {
$size = self::$PAPER_SIZES["letter"];
}
}
if (mb_strtolower($orientation) === "landscape") {
list($size[2], $size[3]) = array($size[3], $size[2]);
}
$this->_dompdf = $dompdf;
$this->_pdf = new \Cpdf($size, true, $dompdf->getOptions()->getFontCache(), $dompdf->getOptions()->getTempDir());
$this->_pdf->addInfo("Producer", sprintf("%s + CPDF", $dompdf->version));
$time = substr_replace(date('YmdHisO'), '\'', -2, 0) . '\'';
$this->_pdf->addInfo("CreationDate", "D:{$time}");
$this->_pdf->addInfo("ModDate", "D:{$time}");
$this->_width = $size[2] - $size[0];
$this->_height = $size[3] - $size[1];
$this->_page_number = $this->_page_count = 1;
$this->_page_text = array();
$this->_pages = array($this->_pdf->getFirstPageId());
$this->_image_cache = array();
}
示例6: Cpdf
/**
* Class constructor
*
* @param mixed $paper The size of paper to use in this PDF ({@link CPDF_Adapter::$PAPER_SIZES})
* @param string $orientation The orientation of the document (either 'landscape' or 'portrait')
* @param DOMPDF $dompdf The DOMPDF instance
*/
function __construct($paper = "letter", $orientation = "portrait", DOMPDF $dompdf)
{
$size = $this->get_size($paper, $orientation);
$this->_width = $size[2] - $size[0];
$this->_height = $size[3] - $size[1];
$this->_dompdf = $dompdf;
$this->_pdf = new Cpdf($size, $dompdf->get_option("enable_unicode"), $dompdf->get_option("font_cache"), $dompdf->get_option("temp_dir"));
$this->_pdf->addInfo("Creator", "DOMPDF");
$time = substr_replace(date('YmdHisO'), '\'', -2, 0) . '\'';
$this->_pdf->addInfo("CreationDate", "D:{$time}");
$this->_pdf->addInfo("ModDate", "D:{$time}");
$this->_page_number = $this->_page_count = 1;
$this->_page_text = array();
$this->_pages = array($this->_pdf->getFirstPageId());
$this->_image_cache = array();
}
示例7: Cpdf
/**
* Class constructor
*
* @param mixed $paper The size of paper to use in this PDF ({@link CPDF_Adapter::$PAPER_SIZES})
* @param string $orientation The orienation of the document (either 'landscape' or 'portrait')
*/
function __construct($paper = "letter", $orientation = "portrait")
{
if (is_array($paper)) {
$size = $paper;
} else {
if (isset(self::$PAPER_SIZES[mb_strtolower($paper)])) {
$size = self::$PAPER_SIZES[$paper];
} else {
$size = self::$PAPER_SIZES["letter"];
}
}
if (mb_strtolower($orientation) == "landscape") {
$a = $size[3];
$size[3] = $size[2];
$size[2] = $a;
}
// OAR - Setting isUnicode to true by default!
// Some people may not want to do this. Should we have
// a DOMPDF config variable somewhere that lets people
// choose?
$this->_pdf = new Cpdf($size, true);
$this->_pdf->addInfo("Creator", "dompdf");
// Silence pedantic warnings about missing TZ settings
if (function_exists("date_default_timezone_get")) {
$tz = @date_default_timezone_get();
date_default_timezone_set("UTC");
$this->_pdf->addInfo("CreationDate", date("Y-m-d"));
date_default_timezone_set($tz);
} else {
$this->_pdf->addInfo("CreationDate", date("Y-m-d"));
}
$this->_width = $size[2] - $size[0];
$this->_height = $size[3] - $size[1];
$this->_pdf->openHere('Fit');
$this->_page_number = $this->_page_count = 1;
$this->_page_text = array();
$this->_pages = array($this->_pdf->getFirstPageId());
$this->_image_cache = array();
}