DocumentLayout
in package
\PhpOffice\PhpPresentation\DocumentLayout.
Table of Contents
Constants
- LAYOUT_35MM = '35mm'
- LAYOUT_A3 = 'A3'
- LAYOUT_A4 = 'A4'
- LAYOUT_B4ISO = 'B4ISO'
- LAYOUT_B5ISO = 'B5ISO'
- LAYOUT_BANNER = 'banner'
- LAYOUT_CUSTOM = ''
- LAYOUT_LETTER = 'letter'
- LAYOUT_OVERHEAD = 'overhead'
- LAYOUT_SCREEN_16X10 = 'screen16x10'
- LAYOUT_SCREEN_16X9 = 'screen16x9'
- LAYOUT_SCREEN_4X3 = 'screen4x3'
- UNIT_CENTIMETER = 'cm'
- UNIT_EMU = 'emu'
- UNIT_INCH = 'in'
- UNIT_MILLIMETER = 'mm'
- UNIT_PIXEL = 'px'
- UNIT_POINT = 'pt'
Properties
- $dimension : array<string, array<string, int>>
- Dimension types.
- $dimensionX : float
- Layout X dimension.
- $dimensionY : float
- Layout Y dimension.
- $layout : string
- Layout name.
Methods
- __construct() : mixed
- Create a new \PhpOffice\PhpPresentation\DocumentLayout.
- getCX() : float
- Get Document Layout cx.
- getCY() : float
- Get Document Layout cy.
- getDocumentLayout() : string
- Get Document Layout.
- setCX() : self
- Get Document Layout cx.
- setCY() : self
- Get Document Layout cy.
- setDocumentLayout() : self
- Set Document Layout.
- convertUnit() : float
- Convert EMUs to differents units.
Constants
LAYOUT_35MM
public
mixed
LAYOUT_35MM
= '35mm'
LAYOUT_A3
public
mixed
LAYOUT_A3
= 'A3'
LAYOUT_A4
public
mixed
LAYOUT_A4
= 'A4'
LAYOUT_B4ISO
public
mixed
LAYOUT_B4ISO
= 'B4ISO'
LAYOUT_B5ISO
public
mixed
LAYOUT_B5ISO
= 'B5ISO'
LAYOUT_BANNER
public
mixed
LAYOUT_BANNER
= 'banner'
LAYOUT_CUSTOM
public
mixed
LAYOUT_CUSTOM
= ''
LAYOUT_LETTER
public
mixed
LAYOUT_LETTER
= 'letter'
LAYOUT_OVERHEAD
public
mixed
LAYOUT_OVERHEAD
= 'overhead'
LAYOUT_SCREEN_16X10
public
mixed
LAYOUT_SCREEN_16X10
= 'screen16x10'
LAYOUT_SCREEN_16X9
public
mixed
LAYOUT_SCREEN_16X9
= 'screen16x9'
LAYOUT_SCREEN_4X3
public
mixed
LAYOUT_SCREEN_4X3
= 'screen4x3'
UNIT_CENTIMETER
public
mixed
UNIT_CENTIMETER
= 'cm'
UNIT_EMU
public
mixed
UNIT_EMU
= 'emu'
UNIT_INCH
public
mixed
UNIT_INCH
= 'in'
UNIT_MILLIMETER
public
mixed
UNIT_MILLIMETER
= 'mm'
UNIT_PIXEL
public
mixed
UNIT_PIXEL
= 'px'
UNIT_POINT
public
mixed
UNIT_POINT
= 'pt'
Properties
$dimension
Dimension types.
private
array<string, array<string, int>>
$dimension
= [self::LAYOUT_SCREEN_4X3 => ['cx' => 9144000, 'cy' => 6858000], self::LAYOUT_SCREEN_16X10 => ['cx' => 9144000, 'cy' => 5715000], self::LAYOUT_SCREEN_16X9 => ['cx' => 9144000, 'cy' => 5143500], self::LAYOUT_35MM => ['cx' => 10287000, 'cy' => 6858000], self::LAYOUT_A3 => ['cx' => 15120000, 'cy' => 10692000], self::LAYOUT_A4 => ['cx' => 10692000, 'cy' => 7560000], self::LAYOUT_B4ISO => ['cx' => 10826750, 'cy' => 8120063], self::LAYOUT_B5ISO => ['cx' => 7169150, 'cy' => 5376863], self::LAYOUT_BANNER => ['cx' => 7315200, 'cy' => 914400], self::LAYOUT_LETTER => ['cx' => 9144000, 'cy' => 6858000], self::LAYOUT_OVERHEAD => ['cx' => 9144000, 'cy' => 6858000]]
1 px = 9525 EMU @ 96dpi (which is seems to be the default) Absolute distances are specified in English Metric Units (EMUs), occasionally referred to as A units; there are 360000 EMUs per centimeter, 914400 EMUs per inch, 12700 EMUs per point.
$dimensionX
Layout X dimension.
private
float
$dimensionX
$dimensionY
Layout Y dimension.
private
float
$dimensionY
$layout
Layout name.
private
string
$layout
Methods
__construct()
Create a new \PhpOffice\PhpPresentation\DocumentLayout.
public
__construct() : mixed
getCX()
Get Document Layout cx.
public
getCX([string $unit = self::UNIT_EMU ]) : float
Parameters
- $unit : string = self::UNIT_EMU
Return values
floatgetCY()
Get Document Layout cy.
public
getCY([string $unit = self::UNIT_EMU ]) : float
Parameters
- $unit : string = self::UNIT_EMU
Return values
floatgetDocumentLayout()
Get Document Layout.
public
getDocumentLayout() : string
Return values
stringsetCX()
Get Document Layout cx.
public
setCX(float $value[, string $unit = self::UNIT_EMU ]) : self
Parameters
- $value : float
- $unit : string = self::UNIT_EMU
Return values
selfsetCY()
Get Document Layout cy.
public
setCY(float $value[, string $unit = self::UNIT_EMU ]) : self
Parameters
- $value : float
- $unit : string = self::UNIT_EMU
Return values
selfsetDocumentLayout()
Set Document Layout.
public
setDocumentLayout([array<string, int>|string $pValue = self::LAYOUT_SCREEN_4X3 ][, bool $isLandscape = true ]) : self
Parameters
- $pValue : array<string, int>|string = self::LAYOUT_SCREEN_4X3
- $isLandscape : bool = true
Return values
selfconvertUnit()
Convert EMUs to differents units.
protected
convertUnit(float $value, string $fromUnit, string $toUnit) : float
Parameters
- $value : float
- $fromUnit : string
- $toUnit : string