本文整理汇总了PHP中TCPDF_STATIC::setPageBoxes方法的典型用法代码示例。如果您正苦于以下问题:PHP TCPDF_STATIC::setPageBoxes方法的具体用法?PHP TCPDF_STATIC::setPageBoxes怎么用?PHP TCPDF_STATIC::setPageBoxes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TCPDF_STATIC
的用法示例。
在下文中一共展示了TCPDF_STATIC::setPageBoxes方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setPageOrientation
/**
* Set page orientation.
* @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>
* @param $autopagebreak (boolean) Boolean indicating if auto-page-break mode should be on or off.
* @param $bottommargin (float) bottom margin of the page.
* @public
* @since 3.0.015 (2008-06-06)
*/
public function setPageOrientation($orientation, $autopagebreak = '', $bottommargin = '')
{
if (!isset($this->pagedim[$this->page]['MediaBox'])) {
// the boundaries of the physical medium on which the page shall be displayed or printed
$this->pagedim = TCPDF_STATIC::setPageBoxes($this->page, 'MediaBox', 0, 0, $this->fwPt, $this->fhPt, true, $this->k, $this->pagedim);
}
if (!isset($this->pagedim[$this->page]['CropBox'])) {
// the visible region of default user space
$this->pagedim = TCPDF_STATIC::setPageBoxes($this->page, 'CropBox', $this->pagedim[$this->page]['MediaBox']['llx'], $this->pagedim[$this->page]['MediaBox']['lly'], $this->pagedim[$this->page]['MediaBox']['urx'], $this->pagedim[$this->page]['MediaBox']['ury'], true, $this->k, $this->pagedim);
}
if (!isset($this->pagedim[$this->page]['BleedBox'])) {
// the region to which the contents of the page shall be clipped when output in a production environment
$this->pagedim = TCPDF_STATIC::setPageBoxes($this->page, 'BleedBox', $this->pagedim[$this->page]['CropBox']['llx'], $this->pagedim[$this->page]['CropBox']['lly'], $this->pagedim[$this->page]['CropBox']['urx'], $this->pagedim[$this->page]['CropBox']['ury'], true, $this->k, $this->pagedim);
}
if (!isset($this->pagedim[$this->page]['TrimBox'])) {
// the intended dimensions of the finished page after trimming
$this->pagedim = TCPDF_STATIC::setPageBoxes($this->page, 'TrimBox', $this->pagedim[$this->page]['CropBox']['llx'], $this->pagedim[$this->page]['CropBox']['lly'], $this->pagedim[$this->page]['CropBox']['urx'], $this->pagedim[$this->page]['CropBox']['ury'], true, $this->k, $this->pagedim);
}
if (!isset($this->pagedim[$this->page]['ArtBox'])) {
// the page's meaningful content (including potential white space)
$this->pagedim = TCPDF_STATIC::setPageBoxes($this->page, 'ArtBox', $this->pagedim[$this->page]['CropBox']['llx'], $this->pagedim[$this->page]['CropBox']['lly'], $this->pagedim[$this->page]['CropBox']['urx'], $this->pagedim[$this->page]['CropBox']['ury'], true, $this->k, $this->pagedim);
}
if (!isset($this->pagedim[$this->page]['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.
$this->pagedim[$this->page]['Rotate'] = 0;
}
if (!isset($this->pagedim[$this->page]['PZ'])) {
// The page's preferred zoom (magnification) factor
$this->pagedim[$this->page]['PZ'] = 1;
}
if ($this->fwPt > $this->fhPt) {
// landscape
$default_orientation = 'L';
} else {
// portrait
$default_orientation = 'P';
}
$valid_orientations = array('P', 'L');
if (empty($orientation)) {
$orientation = $default_orientation;
} else {
$orientation = strtoupper($orientation[0]);
}
if (in_array($orientation, $valid_orientations) and $orientation != $default_orientation) {
$this->CurOrientation = $orientation;
$this->wPt = $this->fhPt;
$this->hPt = $this->fwPt;
} else {
$this->CurOrientation = $default_orientation;
$this->wPt = $this->fwPt;
$this->hPt = $this->fhPt;
}
if (abs($this->pagedim[$this->page]['MediaBox']['urx'] - $this->hPt) < $this->feps and abs($this->pagedim[$this->page]['MediaBox']['ury'] - $this->wPt) < $this->feps) {
// swap X and Y coordinates (change page orientation)
$this->pagedim = TCPDF_STATIC::swapPageBoxCoordinates($this->page, $this->pagedim);
}
$this->w = $this->wPt / $this->k;
$this->h = $this->hPt / $this->k;
if (TCPDF_STATIC::empty_string($autopagebreak)) {
if (isset($this->AutoPageBreak)) {
$autopagebreak = $this->AutoPageBreak;
} else {
$autopagebreak = true;
}
}
if (TCPDF_STATIC::empty_string($bottommargin)) {
if (isset($this->bMargin)) {
$bottommargin = $this->bMargin;
} else {
// default value = 2 cm
$bottommargin = 2 * 28.35 / $this->k;
}
}
$this->SetAutoPageBreak($autopagebreak, $bottommargin);
// store page dimensions
$this->pagedim[$this->page]['w'] = $this->wPt;
$this->pagedim[$this->page]['h'] = $this->hPt;
$this->pagedim[$this->page]['wk'] = $this->w;
$this->pagedim[$this->page]['hk'] = $this->h;
$this->pagedim[$this->page]['tm'] = $this->tMargin;
$this->pagedim[$this->page]['bm'] = $bottommargin;
$this->pagedim[$this->page]['lm'] = $this->lMargin;
$this->pagedim[$this->page]['rm'] = $this->rMargin;
$this->pagedim[$this->page]['pb'] = $autopagebreak;
$this->pagedim[$this->page]['or'] = $this->CurOrientation;
$this->pagedim[$this->page]['olm'] = $this->original_lMargin;
$this->pagedim[$this->page]['orm'] = $this->original_rMargin;
}