本文整理汇总了PHP中TCPDF_STATIC::getPageSizeFromFormat方法的典型用法代码示例。如果您正苦于以下问题:PHP TCPDF_STATIC::getPageSizeFromFormat方法的具体用法?PHP TCPDF_STATIC::getPageSizeFromFormat怎么用?PHP TCPDF_STATIC::getPageSizeFromFormat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TCPDF_STATIC
的用法示例。
在下文中一共展示了TCPDF_STATIC::getPageSizeFromFormat方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setPageFormat
/**
* Change the format of the current page
* @param $format (mixed) The format used for pages. It can be either: one of the string values specified at getPageSizeFromFormat() documentation or an array of two numners (width, height) or an array containing the following measures and options:<ul>
* <li>['format'] = page format name (one of the above);</li>
* <li>['Rotate'] : The number of degrees by which the page shall be rotated clockwise when displayed or printed. The value shall be a multiple of 90.</li>
* <li>['PZ'] : The page's preferred zoom (magnification) factor.</li>
* <li>['MediaBox'] : the boundaries of the physical medium on which the page shall be displayed or printed:</li>
* <li>['MediaBox']['llx'] : lower-left x coordinate in points</li>
* <li>['MediaBox']['lly'] : lower-left y coordinate in points</li>
* <li>['MediaBox']['urx'] : upper-right x coordinate in points</li>
* <li>['MediaBox']['ury'] : upper-right y coordinate in points</li>
* <li>['CropBox'] : the visible region of default user space:</li>
* <li>['CropBox']['llx'] : lower-left x coordinate in points</li>
* <li>['CropBox']['lly'] : lower-left y coordinate in points</li>
* <li>['CropBox']['urx'] : upper-right x coordinate in points</li>
* <li>['CropBox']['ury'] : upper-right y coordinate in points</li>
* <li>['BleedBox'] : the region to which the contents of the page shall be clipped when output in a production environment:</li>
* <li>['BleedBox']['llx'] : lower-left x coordinate in points</li>
* <li>['BleedBox']['lly'] : lower-left y coordinate in points</li>
* <li>['BleedBox']['urx'] : upper-right x coordinate in points</li>
* <li>['BleedBox']['ury'] : upper-right y coordinate in points</li>
* <li>['TrimBox'] : the intended dimensions of the finished page after trimming:</li>
* <li>['TrimBox']['llx'] : lower-left x coordinate in points</li>
* <li>['TrimBox']['lly'] : lower-left y coordinate in points</li>
* <li>['TrimBox']['urx'] : upper-right x coordinate in points</li>
* <li>['TrimBox']['ury'] : upper-right y coordinate in points</li>
* <li>['ArtBox'] : the extent of the page's meaningful content:</li>
* <li>['ArtBox']['llx'] : lower-left x coordinate in points</li>
* <li>['ArtBox']['lly'] : lower-left y coordinate in points</li>
* <li>['ArtBox']['urx'] : upper-right x coordinate in points</li>
* <li>['ArtBox']['ury'] : upper-right y coordinate in points</li>
* <li>['BoxColorInfo'] :specify the colours and other visual characteristics that should be used in displaying guidelines on the screen for each of the possible page boundaries other than the MediaBox:</li>
* <li>['BoxColorInfo'][BOXTYPE]['C'] : an array of three numbers in the range 0-255, representing the components in the DeviceRGB colour space.</li>
* <li>['BoxColorInfo'][BOXTYPE]['W'] : the guideline width in default user units</li>
* <li>['BoxColorInfo'][BOXTYPE]['S'] : the guideline style: S = Solid; D = Dashed</li>
* <li>['BoxColorInfo'][BOXTYPE]['D'] : dash array defining a pattern of dashes and gaps to be used in drawing dashed guidelines</li>
* <li>['trans'] : the style and duration of the visual transition to use when moving from another page to the given page during a presentation</li>
* <li>['trans']['Dur'] : The page's display duration (also called its advance timing): the maximum length of time, in seconds, that the page shall be displayed during presentations before the viewer application shall automatically advance to the next page.</li>
* <li>['trans']['S'] : transition style : Split, Blinds, Box, Wipe, Dissolve, Glitter, R, Fly, Push, Cover, Uncover, Fade</li>
* <li>['trans']['D'] : The duration of the transition effect, in seconds.</li>
* <li>['trans']['Dm'] : (Split and Blinds transition styles only) The dimension in which the specified transition effect shall occur: H = Horizontal, V = Vertical. Default value: H.</li>
* <li>['trans']['M'] : (Split, Box and Fly transition styles only) The direction of motion for the specified transition effect: I = Inward from the edges of the page, O = Outward from the center of the pageDefault value: I.</li>
* <li>['trans']['Di'] : (Wipe, Glitter, Fly, Cover, Uncover and Push transition styles only) The direction in which the specified transition effect shall moves, expressed in degrees counterclockwise starting from a left-to-right direction. If the value is a number, it shall be one of: 0 = Left to right, 90 = Bottom to top (Wipe only), 180 = Right to left (Wipe only), 270 = Top to bottom, 315 = Top-left to bottom-right (Glitter only). If the value is a name, it shall be None, which is relevant only for the Fly transition when the value of SS is not 1.0. Default value: 0.</li>
* <li>['trans']['SS'] : (Fly transition style only) The starting or ending scale at which the changes shall be drawn. If M specifies an inward transition, the scale of the changes drawn shall progress from SS to 1.0 over the course of the transition. If M specifies an outward transition, the scale of the changes drawn shall progress from 1.0 to SS over the course of the transition. Default: 1.0.</li>
* <li>['trans']['B'] : (Fly transition style only) If true, the area that shall be flown in is rectangular and opaque. Default: false.</li>
* </ul>
* @param $orientation (string) page orientation. Possible values are (case insensitive):<ul>
* <li>P or Portrait (default)</li>
* <li>L or Landscape</li>
* <li>'' (empty string) for automatic orientation</li>
* </ul>
* @protected
* @since 3.0.015 (2008-06-06)
* @see getPageSizeFromFormat()
*/
protected function setPageFormat($format, $orientation = 'P')
{
if (!empty($format) and isset($this->pagedim[$this->page])) {
// remove inherited values
unset($this->pagedim[$this->page]);
}
if (is_string($format)) {
// get page measures from format name
$pf = TCPDF_STATIC::getPageSizeFromFormat($format);
$this->fwPt = $pf[0];
$this->fhPt = $pf[1];
} else {
// the boundaries of the physical medium on which the page shall be displayed or printed
if (isset($format['MediaBox'])) {
$this->pagedim = TCPDF_STATIC::setPageBoxes($this->page, 'MediaBox', $format['MediaBox']['llx'], $format['MediaBox']['lly'], $format['MediaBox']['urx'], $format['MediaBox']['ury'], false, $this->k, $this->pagedim);
$this->fwPt = ($format['MediaBox']['urx'] - $format['MediaBox']['llx']) * $this->k;
$this->fhPt = ($format['MediaBox']['ury'] - $format['MediaBox']['lly']) * $this->k;
} else {
if (isset($format[0]) and is_numeric($format[0]) and isset($format[1]) and is_numeric($format[1])) {
$pf = array($format[0] * $this->k, $format[1] * $this->k);
} else {
if (!isset($format['format'])) {
// default value
$format['format'] = 'A4';
}
$pf = TCPDF_STATIC::getPageSizeFromFormat($format['format']);
}
$this->fwPt = $pf[0];
$this->fhPt = $pf[1];
$this->pagedim = TCPDF_STATIC::setPageBoxes($this->page, 'MediaBox', 0, 0, $this->fwPt, $this->fhPt, true, $this->k, $this->pagedim);
}
// the visible region of default user space
if (isset($format['CropBox'])) {
$this->pagedim = TCPDF_STATIC::setPageBoxes($this->page, 'CropBox', $format['CropBox']['llx'], $format['CropBox']['lly'], $format['CropBox']['urx'], $format['CropBox']['ury'], false, $this->k, $this->pagedim);
}
// the region to which the contents of the page shall be clipped when output in a production environment
if (isset($format['BleedBox'])) {
$this->pagedim = TCPDF_STATIC::setPageBoxes($this->page, 'BleedBox', $format['BleedBox']['llx'], $format['BleedBox']['lly'], $format['BleedBox']['urx'], $format['BleedBox']['ury'], false, $this->k, $this->pagedim);
}
// the intended dimensions of the finished page after trimming
if (isset($format['TrimBox'])) {
$this->pagedim = TCPDF_STATIC::setPageBoxes($this->page, 'TrimBox', $format['TrimBox']['llx'], $format['TrimBox']['lly'], $format['TrimBox']['urx'], $format['TrimBox']['ury'], false, $this->k, $this->pagedim);
}
// the page's meaningful content (including potential white space)
if (isset($format['ArtBox'])) {
//.........这里部分代码省略.........