Documentation

Drawing
in package

Table of Contents

Methods

angleToDegrees()  : int
Convert angle to degrees.
cellDimensionToPixels()  : int
Convert column width from (intrinsic) Excel units to pixels.
degreesToAngle()  : int
Convert degrees to angle.
EMUToPixels()  : int
Convert EMU to pixels.
pixelsToCellDimension()  : float|int
Convert pixels to column width. Exact algorithm not known.
pixelsToEMU()  : float|int
Convert pixels to EMU.
pixelsToPoints()  : float
Convert pixels to points.
pointsToPixels()  : int
Convert points to pixels.

Methods

angleToDegrees()

Convert angle to degrees.

public static angleToDegrees(int|SimpleXMLElement $angle) : int
Parameters
$angle : int|SimpleXMLElement

Angle

Return values
int

Degrees

cellDimensionToPixels()

Convert column width from (intrinsic) Excel units to pixels.

public static cellDimensionToPixels(float $cellWidth, Font $defaultFont) : int
Parameters
$cellWidth : float

Value in cell dimension

$defaultFont : Font

Default font of the workbook

Return values
int

Value in pixels

degreesToAngle()

Convert degrees to angle.

public static degreesToAngle(int $degrees) : int
Parameters
$degrees : int

Degrees

Return values
int

Angle

EMUToPixels()

Convert EMU to pixels.

public static EMUToPixels(int|SimpleXMLElement $emuValue) : int
Parameters
$emuValue : int|SimpleXMLElement

Value in EMU

Return values
int

Value in pixels

pixelsToCellDimension()

Convert pixels to column width. Exact algorithm not known.

public static pixelsToCellDimension(int $pixelValue, Font $defaultFont) : float|int

By inspection of a real Excel file using Calibri 11, one finds 1000px ~ 142.85546875 This gives a conversion factor of 7. Also, we assume that pixels and font size are proportional.

Parameters
$pixelValue : int

Value in pixels

$defaultFont : Font
Return values
float|int

Value in cell dimension

pixelsToEMU()

Convert pixels to EMU.

public static pixelsToEMU(int $pixelValue) : float|int
Parameters
$pixelValue : int

Value in pixels

Return values
float|int

Value in EMU

pixelsToPoints()

Convert pixels to points.

public static pixelsToPoints(int $pixelValue) : float
Parameters
$pixelValue : int

Value in pixels

Return values
float

Value in points

pointsToPixels()

Convert points to pixels.

public static pointsToPixels(float|int $pointValue) : int
Parameters
$pointValue : float|int

Value in points

Return values
int

Value in pixels


        
On this page

Search results