Overview

Packages

  • JAMA
  • None
  • PHP
  • PHPExcel
    • CachedObjectStorage
    • Calculation
    • Cell
    • Chart
      • Renderer
    • Reader
      • Excel2007
      • Excel5
    • RichText
    • Settings
    • Shared
      • Escher
      • OLE
      • Trend
      • ZipArchive
    • Style
    • Worksheet
      • Drawing
    • Writer
      • 2007
      • CSV
      • Excel2007
      • Excel5
      • HTML
      • PDF

Classes

  • PHPExcel_Shared_CodePage
  • PHPExcel_Shared_Date
  • PHPExcel_Shared_Drawing
  • PHPExcel_Shared_Excel5
  • PHPExcel_Shared_File
  • PHPExcel_Shared_Font
  • PHPExcel_Shared_OLERead
  • PHPExcel_Shared_PasswordHasher
  • PHPExcel_Shared_String
  • PHPExcel_Shared_TimeZone
  • PHPExcel_Shared_XMLWriter
  • PHPExcel_Shared_ZipStreamWrapper
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo
  • Download

Class PHPExcel_Shared_Excel5

PHPExcel_Shared_Excel5

Package: PHPExcel\Shared
Category: PHPExcel
Copyright: Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
License: LGPL
Located at controlador/include/phpexcel/PHPExcel/Shared/Excel5.php
Methods summary
public static integer
# sizeCol( PHPExcel_Worksheet $sheet, string $col = 'A' )

Get the width of a column in pixels. We use the relationship y = ceil(7x) where x is the width in intrinsic Excel units (measuring width in number of normal characters) This holds for Arial 10

Get the width of a column in pixels. We use the relationship y = ceil(7x) where x is the width in intrinsic Excel units (measuring width in number of normal characters) This holds for Arial 10

Parameters

$sheet
The sheet
$col
The column

Returns

integer
The width in pixels
public static integer
# sizeRow( PHPExcel_Worksheet $sheet, integer $row = 1 )

Convert the height of a cell from user's units to pixels. By interpolation the relationship is: y = 4/3x. If the height hasn't been set by the user we use the default value. If the row is hidden we use a value of zero.

Convert the height of a cell from user's units to pixels. By interpolation the relationship is: y = 4/3x. If the height hasn't been set by the user we use the default value. If the row is hidden we use a value of zero.

Parameters

$sheet
The sheet
$row
The row index (1-based)

Returns

integer
The width in pixels
public static integer
# getDistanceX( PHPExcel_Worksheet $sheet, string $startColumn = 'A', integer $startOffsetX = 0, string $endColumn = 'A', integer $endOffsetX = 0 )

Get the horizontal distance in pixels between two anchors The distanceX is found as sum of all the spanning columns widths minus correction for the two offsets

Get the horizontal distance in pixels between two anchors The distanceX is found as sum of all the spanning columns widths minus correction for the two offsets

Parameters

$sheet
$startColumn
$startOffsetX
Offset within start cell measured in 1/1024 of the cell width
$endColumn
$endOffsetX
Offset within end cell measured in 1/1024 of the cell width

Returns

integer
Horizontal measured in pixels
public static integer
# getDistanceY( PHPExcel_Worksheet $sheet, integer $startRow = 1, integer $startOffsetY = 0, integer $endRow = 1, integer $endOffsetY = 0 )

Get the vertical distance in pixels between two anchors The distanceY is found as sum of all the spanning rows minus two offsets

Get the vertical distance in pixels between two anchors The distanceY is found as sum of all the spanning rows minus two offsets

Parameters

$sheet
$startRow
(1-based)
$startOffsetY
Offset within start cell measured in 1/256 of the cell height
$endRow
(1-based)
$endOffsetY
Offset within end cell measured in 1/256 of the cell height

Returns

integer
Vertical distance measured in pixels
public static array
# oneAnchor2twoAnchor( PHPExcel_Worksheet $sheet, string $coordinates, integer $offsetX, integer $offsetY, integer $width, integer $height )

Convert 1-cell anchor coordinates to 2-cell anchor coordinates This function is ported from PEAR Spreadsheet_Writer_Excel with small modifications

Convert 1-cell anchor coordinates to 2-cell anchor coordinates This function is ported from PEAR Spreadsheet_Writer_Excel with small modifications

Calculate the vertices that define the position of the image as required by the OBJ record. +------------+------------+ | A | B | +-----+------------+------------+ | |(x1,y1) | | | 1 |(A1)._______|______ | | | | | | | | | | | +-----+----| BITMAP |-----+ | | | | | | 2 | |______________. | | | | (B2)| | | | (x2,y2)| +---- +------------+------------+

Example of a bitmap that covers some of the area from cell A1 to cell B2.

Based on the width and height of the bitmap we need to calculate 8 vars: $col_start, $row_start, $col_end, $row_end, $x1, $y1, $x2, $y2. The width and height of the cells are also variable and have to be taken into account. The values of $col_start and $row_start are passed in from the calling function. The values of $col_end and $row_end are calculated by subtracting the width and height of the bitmap from the width and height of the underlying cells. The vertices are expressed as a percentage of the underlying cell width as follows (rhs values are in pixels): x1 = X / W *1024 y1 = Y / H *256 x2 = (X-1) / W *1024 y2 = (Y-1) / H *256 Where: X is distance from the left side of the underlying cell Y is distance from the top of the underlying cell W is the width of the cell H is the height of the cell

Parameters

$sheet
$coordinates
E.g. 'A1'
$offsetX
Horizontal offset in pixels
$offsetY
Vertical offset in pixels
$width
Width in pixels
$height
Height in pixels

Returns

array
Autene API documentation generated by ApiGen