\PHPExcel_Writer_PDF_DomPDF

PHPExcel_Writer_PDF_DomPDF

Copyright (c) 2006 - 2015 PHPExcel

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

Summary

Methods
Properties
Constants
__construct()
getFont()
setFont()
getPaperSize()
setPaperSize()
getOrientation()
setOrientation()
getTempDir()
setTempDir()
save()
getSheetIndex()
setSheetIndex()
getGenerateSheetNavigationBlock()
setGenerateSheetNavigationBlock()
writeAllSheets()
generateHTMLHeader()
generateSheetData()
generateNavigation()
generateStyles()
buildCSS()
generateHTMLFooter()
getImagesRoot()
setImagesRoot()
getEmbedImages()
setEmbedImages()
getUseInlineCss()
setUseInlineCss()
formatColor()
getIncludeCharts()
setIncludeCharts()
getPreCalculateFormulas()
setPreCalculateFormulas()
getUseDiskCaching()
setUseDiskCaching()
getDiskCachingDirectory()
No public properties found
No constants found
prepareForSave()
restoreStateAfterSave()
$tempDir
$font
$orientation
$paperSize
$paperSizes
$phpExcel
$isPdf
$includeCharts
$preCalculateFormulas
$_useDiskCaching
$_diskCachingDirectory
N/A
mapVAlign()
mapHAlign()
mapBorderStyle()
extendRowsForChartsAndImages()
writeImageInCell()
writeChartInCell()
createCSSStyle()
createCSSStyleAlignment()
createCSSStyleFont()
createCSSStyleBorders()
createCSSStyleBorder()
createCSSStyleFill()
generateTableHeader()
generateTableFooter()
generateRow()
assembleCSS()
calculateSpans()
setMargins()
$saveArrayReturnType
$sheetIndex
$imagesRoot
$embedImages
$useInlineCss
$cssStyles
$columnWidths
$defaultFont
$spansAreCalculated
$isSpannedCell
$isBaseCell
$isSpannedRow
$generateSheetNavigationBlock
N/A

Properties

$tempDir

$tempDir : string

Temporary storage directory

Type

string

$font

$font : string

Font

Type

string

$orientation

$orientation : string

Orientation (Over-ride)

Type

string

$paperSize

$paperSize : integer

Paper size (Over-ride)

Type

integer

$paperSizes

$paperSizes : array

Paper Sizes xRef List

Type

array

$phpExcel

$phpExcel : \PHPExcel

PHPExcel object

Type

\PHPExcel

$isPdf

$isPdf : boolean

Is the current writer creating PDF?

Type

boolean

$includeCharts

$includeCharts : boolean

Write charts that are defined in the workbook? Identifies whether the Writer should write definitions for any charts that exist in the PHPExcel object;

Type

boolean

$preCalculateFormulas

$preCalculateFormulas : boolean

Pre-calculate formulas Forces PHPExcel to recalculate all formulae in a workbook when saving, so that the pre-calculated values are immediately available to MS Excel or other office spreadsheet viewer when opening the file

Type

boolean

$_useDiskCaching

$_useDiskCaching : boolean

Use disk caching where possible?

Type

boolean

$_diskCachingDirectory

$_diskCachingDirectory : string

Disk caching directory

Type

string

$saveArrayReturnType

$saveArrayReturnType : string

Temporary storage for Save Array Return type

Type

string

$sheetIndex

$sheetIndex : integer

Sheet index to write

Type

integer

$imagesRoot

$imagesRoot : string

Images root

Type

string

$embedImages

$embedImages : boolean

embed images, or link to images

Type

boolean

$useInlineCss

$useInlineCss : boolean

Use inline CSS?

Type

boolean

$cssStyles

$cssStyles : array

Array of CSS styles

Type

array

$columnWidths

$columnWidths : array

Array of column widths in points

Type

array

$spansAreCalculated

$spansAreCalculated : boolean

Flag whether spans have been calculated

Type

boolean

$isSpannedCell

$isSpannedCell : array

Excel cells that should not be written as HTML cells

Type

array

$isBaseCell

$isBaseCell : array

Excel cells that are upper-left corner in a cell merge

Type

array

$isSpannedRow

$isSpannedRow : array

Excel rows that should not be written as HTML rows

Type

array

$generateSheetNavigationBlock

$generateSheetNavigationBlock : boolean

Generate the Navigation block

Type

boolean

Methods

__construct()

__construct(\PHPExcel  $phpExcel) 

Create a new PHPExcel_Writer_PDF

@param PHPExcel $phpExcel PHPExcel object

Parameters

\PHPExcel $phpExcel

PHPExcel object

getFont()

getFont() 

Get Font

@return string

setFont()

setFont(  $fontName) 

Set font. Examples: 'arialunicid0-chinese-simplified' 'arialunicid0-chinese-traditional' 'arialunicid0-korean' 'arialunicid0-japanese'

@param string $fontName

Parameters

$fontName

getPaperSize()

getPaperSize() 

Get Paper Size

@return int

setPaperSize()

setPaperSize(  $pValue = \PHPExcel_Worksheet_PageSetup::PAPERSIZE_LETTER) : \PHPExcel_Writer_PDF

Set Paper Size

@param string $pValue Paper size

Parameters

$pValue

Returns

\PHPExcel_Writer_PDF

getOrientation()

getOrientation() 

Get Orientation

@return string

setOrientation()

setOrientation(  $pValue = \PHPExcel_Worksheet_PageSetup::ORIENTATION_DEFAULT) : \PHPExcel_Writer_PDF

Set Orientation

@param string $pValue Page orientation

Parameters

$pValue

Returns

\PHPExcel_Writer_PDF

getTempDir()

getTempDir() 

Get temporary storage directory

@return string

setTempDir()

setTempDir(  $pValue = '') 

Set temporary storage directory

@param string $pValue Temporary storage directory

Parameters

$pValue

Throws

\PHPExcel_Writer_Exception

when directory does not exist @return PHPExcel_Writer_PDF

save()

save(  $pFilename = null) 

Save PHPExcel to file

@param string $pFilename Name of the file to save as

Parameters

$pFilename

Throws

\PHPExcel_Writer_Exception

getSheetIndex()

getSheetIndex() : integer

Get sheet index

Returns

integer

setSheetIndex()

setSheetIndex(integer  $pValue) : \PHPExcel_Writer_HTML

Set sheet index

Parameters

integer $pValue

Sheet index

Returns

\PHPExcel_Writer_HTML

getGenerateSheetNavigationBlock()

getGenerateSheetNavigationBlock() : boolean

Get sheet index

Returns

boolean

setGenerateSheetNavigationBlock()

setGenerateSheetNavigationBlock(boolean  $pValue = true) : \PHPExcel_Writer_HTML

Set sheet index

Parameters

boolean $pValue

Flag indicating whether the sheet navigation block should be generated or not

Returns

\PHPExcel_Writer_HTML

writeAllSheets()

writeAllSheets() 

Write all sheets (resets sheetIndex to NULL)

generateHTMLHeader()

generateHTMLHeader(boolean  $pIncludeStyles = false) : string

Generate HTML header

Parameters

boolean $pIncludeStyles

Include styles?

Throws

\PHPExcel_Writer_Exception

Returns

string

generateSheetData()

generateSheetData() : string

Generate sheet data

Throws

\PHPExcel_Writer_Exception

Returns

string

generateNavigation()

generateNavigation() : string

Generate sheet tabs

Throws

\PHPExcel_Writer_Exception

Returns

string

generateStyles()

generateStyles(boolean  $generateSurroundingHTML = true) : string

Generate CSS styles

Parameters

boolean $generateSurroundingHTML

Generate surrounding HTML tags? (<style> and </style>)

Throws

\PHPExcel_Writer_Exception

Returns

string

buildCSS()

buildCSS(boolean  $generateSurroundingHTML = true) : array

Build CSS styles

Parameters

boolean $generateSurroundingHTML

Generate surrounding HTML style? (html { })

Throws

\PHPExcel_Writer_Exception

Returns

array

generateHTMLFooter()

generateHTMLFooter() 

Generate HTML footer

getImagesRoot()

getImagesRoot() : string

Get images root

Returns

string

setImagesRoot()

setImagesRoot(string  $pValue = '.') : \PHPExcel_Writer_HTML

Set images root

Parameters

string $pValue

Returns

\PHPExcel_Writer_HTML

getEmbedImages()

getEmbedImages() : boolean

Get embed images

Returns

boolean

setEmbedImages()

setEmbedImages(boolean  $pValue = '.') : \PHPExcel_Writer_HTML

Set embed images

Parameters

boolean $pValue

Returns

\PHPExcel_Writer_HTML

getUseInlineCss()

getUseInlineCss() : boolean

Get use inline CSS?

Returns

boolean

setUseInlineCss()

setUseInlineCss(boolean  $pValue = false) : \PHPExcel_Writer_HTML

Set use inline CSS?

Parameters

boolean $pValue

Returns

\PHPExcel_Writer_HTML

formatColor()

formatColor(string  $pValue, string  $pFormat) : string

Add color to formatted string as inline style

Parameters

string $pValue

Plain formatted value without color

string $pFormat

Format code

Returns

string

getIncludeCharts()

getIncludeCharts() : boolean

Write charts in workbook? If this is true, then the Writer will write definitions for any charts that exist in the PHPExcel object.

If false (the default) it will ignore any charts defined in the PHPExcel object.

Returns

boolean

setIncludeCharts()

setIncludeCharts(boolean  $pValue = false) : \PHPExcel_Writer_IWriter

Set write charts in workbook Set to true, to advise the Writer to include any charts that exist in the PHPExcel object.

Set to false (the default) to ignore charts.

Parameters

boolean $pValue

Returns

\PHPExcel_Writer_IWriter

getPreCalculateFormulas()

getPreCalculateFormulas() : boolean

Get Pre-Calculate Formulas flag If this is true (the default), then the writer will recalculate all formulae in a workbook when saving, so that the pre-calculated values are immediately available to MS Excel or other office spreadsheet viewer when opening the file If false, then formulae are not calculated on save. This is faster for saving in PHPExcel, but slower when opening the resulting file in MS Excel, because Excel has to recalculate the formulae itself

Returns

boolean

setPreCalculateFormulas()

setPreCalculateFormulas(boolean  $pValue = true) : \PHPExcel_Writer_IWriter

Set Pre-Calculate Formulas Set to true (the default) to advise the Writer to calculate all formulae on save Set to false to prevent precalculation of formulae on save.

Parameters

boolean $pValue

Pre-Calculate Formulas?

Returns

\PHPExcel_Writer_IWriter

getUseDiskCaching()

getUseDiskCaching() : boolean

Get use disk caching where possible?

Returns

boolean

setUseDiskCaching()

setUseDiskCaching(boolean  $pValue = false, string  $pDirectory = null) : \PHPExcel_Writer_Excel2007

Set use disk caching where possible?

Parameters

boolean $pValue
string $pDirectory

Disk caching directory

Throws

\PHPExcel_Writer_Exception

when directory does not exist

Returns

\PHPExcel_Writer_Excel2007

getDiskCachingDirectory()

getDiskCachingDirectory() : string

Get disk caching directory

Returns

string

prepareForSave()

prepareForSave(  $pFilename = null) 

Save PHPExcel to PDF file, pre-save

@param string $pFilename Name of the file to save as

Parameters

$pFilename

Throws

\PHPExcel_Writer_Exception

restoreStateAfterSave()

restoreStateAfterSave(  $fileHandle) 

Save PHPExcel to PDF file, post-save

@param resource $fileHandle

Parameters

$fileHandle

Throws

\PHPExcel_Writer_Exception

mapVAlign()

mapVAlign(string  $vAlign) : string

Map VAlign

Parameters

string $vAlign

Vertical alignment

Returns

string

mapHAlign()

mapHAlign(string  $hAlign) : string|false

Map HAlign

Parameters

string $hAlign

Horizontal alignment

Returns

string|false

mapBorderStyle()

mapBorderStyle(integer  $borderStyle) : string

Map border style

Parameters

integer $borderStyle

Sheet index

Returns

string

extendRowsForChartsAndImages()

extendRowsForChartsAndImages(\PHPExcel_Worksheet  $pSheet,   $row) 

Parameters

\PHPExcel_Worksheet $pSheet
$row

writeImageInCell()

writeImageInCell(\PHPExcel_Worksheet  $pSheet, string  $coordinates) : string

Generate image tag in cell

Parameters

\PHPExcel_Worksheet $pSheet

PHPExcel_Worksheet

string $coordinates

Cell coordinates

Throws

\PHPExcel_Writer_Exception

Returns

string

writeChartInCell()

writeChartInCell(\PHPExcel_Worksheet  $pSheet, string  $coordinates) : string

Generate chart tag in cell

Parameters

\PHPExcel_Worksheet $pSheet

PHPExcel_Worksheet

string $coordinates

Cell coordinates

Throws

\PHPExcel_Writer_Exception

Returns

string

createCSSStyle()

createCSSStyle(\PHPExcel_Style  $pStyle) : array

Create CSS style

Parameters

\PHPExcel_Style $pStyle

PHPExcel_Style

Returns

array

createCSSStyleAlignment()

createCSSStyleAlignment(\PHPExcel_Style_Alignment  $pStyle) : array

Create CSS style (PHPExcel_Style_Alignment)

Parameters

\PHPExcel_Style_Alignment $pStyle

PHPExcel_Style_Alignment

Returns

array

createCSSStyleFont()

createCSSStyleFont(\PHPExcel_Style_Font  $pStyle) : array

Create CSS style (PHPExcel_Style_Font)

Parameters

\PHPExcel_Style_Font $pStyle

PHPExcel_Style_Font

Returns

array

createCSSStyleBorders()

createCSSStyleBorders(\PHPExcel_Style_Borders  $pStyle) : array

Create CSS style (PHPExcel_Style_Borders)

Parameters

\PHPExcel_Style_Borders $pStyle

PHPExcel_Style_Borders

Returns

array

createCSSStyleBorder()

createCSSStyleBorder(\PHPExcel_Style_Border  $pStyle) : string

Create CSS style (PHPExcel_Style_Border)

Parameters

\PHPExcel_Style_Border $pStyle

PHPExcel_Style_Border

Returns

string

createCSSStyleFill()

createCSSStyleFill(\PHPExcel_Style_Fill  $pStyle) : array

Create CSS style (PHPExcel_Style_Fill)

Parameters

\PHPExcel_Style_Fill $pStyle

PHPExcel_Style_Fill

Returns

array

generateTableHeader()

generateTableHeader(\PHPExcel_Worksheet  $pSheet) : string

Generate table header

Parameters

\PHPExcel_Worksheet $pSheet

The worksheet for the table we are writing

Throws

\PHPExcel_Writer_Exception

Returns

string

generateTableFooter()

generateTableFooter() 

Generate table footer

Throws

\PHPExcel_Writer_Exception

generateRow()

generateRow(\PHPExcel_Worksheet  $pSheet, array  $pValues = null, integer  $pRow,   $cellType = 'td') : string

Generate row

Parameters

\PHPExcel_Worksheet $pSheet

PHPExcel_Worksheet

array $pValues

Array containing cells in a row

integer $pRow

Row number (0-based)

$cellType

Throws

\PHPExcel_Writer_Exception

Returns

string

assembleCSS()

assembleCSS(  $pValue = array()) : string

Takes array where of CSS properties / values and converts to CSS string

Parameters

$pValue

Returns

string

calculateSpans()

calculateSpans() 

Calculate information about HTML colspan and rowspan which is not always the same as Excel's