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

$saveArrayReturnType

$saveArrayReturnType : string

Temporary storage for Save Array Return type.

Type

string

Methods

__construct()

__construct(\PhpOffice\PhpSpreadsheet\Spreadsheet  $spreadsheet) 

Create a new PDF Writer instance.

Parameters

\PhpOffice\PhpSpreadsheet\Spreadsheet $spreadsheet

Spreadsheet object

getFont()

getFont() : string

Get Font.

Returns

string

setFont()

setFont(string  $fontName) : $this

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

Parameters

string $fontName

Returns

$this

getPaperSize()

getPaperSize() : integer

Get Paper Size.

Returns

integer

setPaperSize()

setPaperSize(string  $pValue) : self

Set Paper Size.

Parameters

string $pValue

Paper size see PageSetup::PAPERSIZE_*

Returns

self

getOrientation()

getOrientation() : string

Get Orientation.

Returns

string

setOrientation()

setOrientation(string  $pValue) : self

Set Orientation.

Parameters

string $pValue

Page orientation see PageSetup::ORIENTATION_*

Returns

self

getTempDir()

getTempDir() : string

Get temporary storage directory.

Returns

string

setTempDir()

setTempDir(string  $pValue) : self

Set temporary storage directory.

Parameters

string $pValue

Temporary storage directory

Throws

\PhpOffice\PhpSpreadsheet\Writer\Exception

when directory does not exist

Returns

self

save()

save(string  $pFilename) 

Save Spreadsheet to file.

Parameters

string $pFilename

Name of the file to save as

Throws

\PhpOffice\PhpSpreadsheet\Writer\Exception
\PhpOffice\PhpSpreadsheet\Exception

prepareForSave()

prepareForSave(string  $pFilename) : resource

Save Spreadsheet to PDF file, pre-save.

Parameters

string $pFilename

Name of the file to save as

Throws

\PhpOffice\PhpSpreadsheet\Writer\Exception

Returns

resource

restoreStateAfterSave()

restoreStateAfterSave(resource  $fileHandle) 

Save PhpSpreadsheet to PDF file, post-save.

Parameters

resource $fileHandle

createExternalWriterInstance()

createExternalWriterInstance(array  $config) : \Mpdf\Mpdf

Gets the implementation of external PDF library that should be used.

Parameters

array $config

Configuration array

Returns

\Mpdf\Mpdf —

implementation

inchesToMm()

inchesToMm(float  $inches) : float

Convert inches to mm.

Parameters

float $inches

Returns

float