ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
PhpOffice\PhpSpreadsheet\Writer\Pdf Class Reference
+ Inheritance diagram for PhpOffice\PhpSpreadsheet\Writer\Pdf:
+ Collaboration diagram for PhpOffice\PhpSpreadsheet\Writer\Pdf:

Public Member Functions

 __construct (Spreadsheet $spreadsheet)
 Create a new PDF Writer instance. More...
 
 getFont ()
 Get Font. More...
 
 setFont ($fontName)
 Set font. More...
 
 getPaperSize ()
 Get Paper Size. More...
 
 setPaperSize ($pValue)
 Set Paper Size. More...
 
 getOrientation ()
 Get Orientation. More...
 
 setOrientation ($pValue)
 Set Orientation. More...
 
 getTempDir ()
 Get temporary storage directory. More...
 
 setTempDir ($pValue)
 Set temporary storage directory. More...
 
- Public Member Functions inherited from PhpOffice\PhpSpreadsheet\Writer\Html
 __construct (Spreadsheet $spreadsheet)
 Create a new HTML. More...
 
 save ($pFilename)
 Save Spreadsheet to file. More...
 
 generateHtmlAll ()
 Save Spreadsheet as html to variable. More...
 
 setEditHtmlCallback (?callable $callback)
 Set a callback to edit the entire HTML. More...
 
 getSheetIndex ()
 Get sheet index. More...
 
 setSheetIndex ($pValue)
 Set sheet index. More...
 
 getGenerateSheetNavigationBlock ()
 Get sheet index. More...
 
 setGenerateSheetNavigationBlock ($pValue)
 Set sheet index. More...
 
 writeAllSheets ()
 Write all sheets (resets sheetIndex to NULL). More...
 
 generateHTMLHeader ($pIncludeStyles=false)
 Generate HTML header. More...
 
 generateSheetData ()
 Generate sheet data. More...
 
 generateNavigation ()
 Generate sheet tabs. More...
 
 generateStyles ($generateSurroundingHTML=true)
 Generate CSS styles. More...
 
 buildCSS ($generateSurroundingHTML=true)
 Build CSS styles. More...
 
 generateHTMLFooter ()
 Generate HTML footer. More...
 
 getImagesRoot ()
 Get images root. More...
 
 setImagesRoot ($pValue)
 Set images root. More...
 
 getEmbedImages ()
 Get embed images. More...
 
 setEmbedImages ($pValue)
 Set embed images. More...
 
 getUseInlineCss ()
 Get use inline CSS? More...
 
 setUseInlineCss ($pValue)
 Set use inline CSS? More...
 
 getUseEmbeddedCSS ()
 Get use embedded CSS? More...
 
 setUseEmbeddedCSS ($pValue)
 Set use embedded CSS? More...
 
 formatColor ($pValue, $pFormat)
 Add color to formatted string as inline style. More...
 
- Public Member Functions inherited from PhpOffice\PhpSpreadsheet\Writer\BaseWriter
 getIncludeCharts ()
 Write charts in workbook? If this is true, then the Writer will write definitions for any charts that exist in the PhpSpreadsheet object. More...
 
 setIncludeCharts ($pValue)
 Set write charts in workbook Set to true, to advise the Writer to include any charts that exist in the PhpSpreadsheet object. More...
 
 getPreCalculateFormulas ()
 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. More...
 
 setPreCalculateFormulas ($pValue)
 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. More...
 
 getUseDiskCaching ()
 Get use disk caching where possible? More...
 
 setUseDiskCaching ($pValue, $pDirectory=null)
 Set use disk caching where possible? More...
 
 getDiskCachingDirectory ()
 Get disk caching directory. More...
 
 openFileHandle ($filename)
 Open file handle. More...
 
 __construct (Spreadsheet $spreadsheet)
 IWriter constructor. More...
 
 getIncludeCharts ()
 Write charts in workbook? If this is true, then the Writer will write definitions for any charts that exist in the PhpSpreadsheet object. More...
 
 setIncludeCharts ($pValue)
 Set write charts in workbook Set to true, to advise the Writer to include any charts that exist in the PhpSpreadsheet object. More...
 
 getPreCalculateFormulas ()
 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. More...
 
 setPreCalculateFormulas ($pValue)
 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. More...
 
 save ($pFilename)
 Save PhpSpreadsheet to file. More...
 
 getUseDiskCaching ()
 Get use disk caching where possible? More...
 
 setUseDiskCaching ($pValue, $pDirectory=null)
 Set use disk caching where possible? More...
 
 getDiskCachingDirectory ()
 Get disk caching directory. More...
 

Protected Member Functions

 prepareForSave ($pFilename)
 Save Spreadsheet to PDF file, pre-save. More...
 
 restoreStateAfterSave ()
 Save PhpSpreadsheet to PDF file, post-save. More...
 
- Protected Member Functions inherited from PhpOffice\PhpSpreadsheet\Writer\BaseWriter
 maybeCloseFileHandle ()
 Close file handle only if we opened it ourselves. More...
 

Protected Attributes

 $tempDir = ''
 
 $font = 'freesans'
 
 $orientation
 
 $paperSize
 
- Protected Attributes inherited from PhpOffice\PhpSpreadsheet\Writer\Html
 $spreadsheet
 
 $isPdf = false
 
- Protected Attributes inherited from PhpOffice\PhpSpreadsheet\Writer\BaseWriter
 $includeCharts = false
 
 $preCalculateFormulas = true
 
 $fileHandle
 

Static Protected Attributes

static $paperSizes
 

Additional Inherited Members

- Static Public Member Functions inherited from PhpOffice\PhpSpreadsheet\Writer\Html
static winFileToUrl ($filename)
 Convert Windows file name to file protocol URL. More...
 
- Data Fields inherited from PhpOffice\PhpSpreadsheet\Writer\Html
const VALIGN_ARR
 
const HALIGN_ARR
 
const BORDER_ARR
 

Detailed Description

Definition at line 10 of file Pdf.php.

Constructor & Destructor Documentation

◆ __construct()

PhpOffice\PhpSpreadsheet\Writer\Pdf::__construct ( Spreadsheet  $spreadsheet)

Create a new PDF Writer instance.

Parameters
Spreadsheet$spreadsheetSpreadsheet object

Reimplemented from PhpOffice\PhpSpreadsheet\Writer\Html.

Reimplemented in PhpOffice\PhpSpreadsheet\Writer\Pdf\Tcpdf.

Definition at line 119 of file Pdf.php.

120 {
121 parent::__construct($spreadsheet);
122 //$this->setUseInlineCss(true);
123 $this->tempDir = File::sysGetTempDir() . '/phpsppdf';
124 $this->isPdf = true;
125 }
static sysGetTempDir()
Get the systems temporary directory.
Definition: File.php:111

References PhpOffice\PhpSpreadsheet\Writer\Html\$spreadsheet, and PhpOffice\PhpSpreadsheet\Shared\File\sysGetTempDir().

+ Here is the call graph for this function:

Member Function Documentation

◆ getFont()

PhpOffice\PhpSpreadsheet\Writer\Pdf::getFont ( )

Get Font.

Returns
string

Definition at line 132 of file Pdf.php.

133 {
134 return $this->font;
135 }

References PhpOffice\PhpSpreadsheet\Writer\Pdf\$font.

Referenced by PhpOffice\PhpSpreadsheet\Writer\Pdf\Tcpdf\save().

+ Here is the caller graph for this function:

◆ getOrientation()

PhpOffice\PhpSpreadsheet\Writer\Pdf::getOrientation ( )

Get Orientation.

Returns
string

Definition at line 184 of file Pdf.php.

185 {
186 return $this->orientation;
187 }

References PhpOffice\PhpSpreadsheet\Writer\Pdf\$orientation.

Referenced by PhpOffice\PhpSpreadsheet\Writer\Pdf\Dompdf\save(), PhpOffice\PhpSpreadsheet\Writer\Pdf\Mpdf\save(), and PhpOffice\PhpSpreadsheet\Writer\Pdf\Tcpdf\save().

+ Here is the caller graph for this function:

◆ getPaperSize()

PhpOffice\PhpSpreadsheet\Writer\Pdf::getPaperSize ( )

Get Paper Size.

Returns
int

Definition at line 160 of file Pdf.php.

161 {
162 return $this->paperSize;
163 }

References PhpOffice\PhpSpreadsheet\Writer\Pdf\$paperSize.

Referenced by PhpOffice\PhpSpreadsheet\Writer\Pdf\Dompdf\save(), PhpOffice\PhpSpreadsheet\Writer\Pdf\Mpdf\save(), and PhpOffice\PhpSpreadsheet\Writer\Pdf\Tcpdf\save().

+ Here is the caller graph for this function:

◆ getTempDir()

PhpOffice\PhpSpreadsheet\Writer\Pdf::getTempDir ( )

Get temporary storage directory.

Returns
string

Definition at line 208 of file Pdf.php.

209 {
210 return $this->tempDir;
211 }

References PhpOffice\PhpSpreadsheet\Writer\Pdf\$tempDir.

◆ prepareForSave()

PhpOffice\PhpSpreadsheet\Writer\Pdf::prepareForSave (   $pFilename)
protected

Save Spreadsheet to PDF file, pre-save.

Parameters
string$pFilenameName of the file to save as
Returns
resource

Definition at line 238 of file Pdf.php.

239 {
240 // Open file
241 $this->openFileHandle($pFilename);
242
243 return $this->fileHandle;
244 }
openFileHandle($filename)
Open file handle.
Definition: BaseWriter.php:102

References PhpOffice\PhpSpreadsheet\Writer\BaseWriter\$fileHandle, and PhpOffice\PhpSpreadsheet\Writer\BaseWriter\openFileHandle().

+ Here is the call graph for this function:

◆ restoreStateAfterSave()

PhpOffice\PhpSpreadsheet\Writer\Pdf::restoreStateAfterSave ( )
protected

Save PhpSpreadsheet to PDF file, post-save.

Definition at line 249 of file Pdf.php.

249 : void
250 {
251 $this->maybeCloseFileHandle();
252 }
maybeCloseFileHandle()
Close file handle only if we opened it ourselves.
Definition: BaseWriter.php:123

References PhpOffice\PhpSpreadsheet\Writer\BaseWriter\maybeCloseFileHandle().

+ Here is the call graph for this function:

◆ setFont()

PhpOffice\PhpSpreadsheet\Writer\Pdf::setFont (   $fontName)

Set font.

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

Parameters
string$fontName
Returns
$this

Definition at line 148 of file Pdf.php.

149 {
150 $this->font = $fontName;
151
152 return $this;
153 }

◆ setOrientation()

PhpOffice\PhpSpreadsheet\Writer\Pdf::setOrientation (   $pValue)

Set Orientation.

Parameters
string$pValuePage orientation see PageSetup::ORIENTATION_*
Returns
self

Definition at line 196 of file Pdf.php.

197 {
198 $this->orientation = $pValue;
199
200 return $this;
201 }

Referenced by PhpOffice\PhpSpreadsheet\Writer\Pdf\Mpdf\save().

+ Here is the caller graph for this function:

◆ setPaperSize()

PhpOffice\PhpSpreadsheet\Writer\Pdf::setPaperSize (   $pValue)

Set Paper Size.

Parameters
int$pValuePaper size see PageSetup::PAPERSIZE_*
Returns
self

Definition at line 172 of file Pdf.php.

173 {
174 $this->paperSize = $pValue;
175
176 return $this;
177 }

◆ setTempDir()

PhpOffice\PhpSpreadsheet\Writer\Pdf::setTempDir (   $pValue)

Set temporary storage directory.

Parameters
string$pValueTemporary storage directory
Returns
self

Definition at line 220 of file Pdf.php.

221 {
222 if (is_dir($pValue)) {
223 $this->tempDir = $pValue;
224 } else {
225 throw new WriterException("Directory does not exist: $pValue");
226 }
227
228 return $this;
229 }

Field Documentation

◆ $font

PhpOffice\PhpSpreadsheet\Writer\Pdf::$font = 'freesans'
protected

Definition at line 24 of file Pdf.php.

Referenced by PhpOffice\PhpSpreadsheet\Writer\Pdf\getFont().

◆ $orientation

◆ $paperSize

◆ $paperSizes

PhpOffice\PhpSpreadsheet\Writer\Pdf::$paperSizes
staticprotected

Definition at line 45 of file Pdf.php.

◆ $tempDir

PhpOffice\PhpSpreadsheet\Writer\Pdf::$tempDir = ''
protected

Definition at line 17 of file Pdf.php.

Referenced by PhpOffice\PhpSpreadsheet\Writer\Pdf\getTempDir().


The documentation for this class was generated from the following file: