Moodle PHP Documentation 5.1
Moodle 5.1dev (Build: 20250620) (7d9030acd6e)
|
Public Member Functions | |
__construct (Spreadsheet $spreadsheet) | |
Create a new PDF Writer instance. | |
buildCSS (bool $generateSurroundingHTML=true) | |
Build CSS styles. | |
formatColor (string $value, string $format) | |
Add color to formatted string as inline style. | |
generateHtmlAll () | |
Save Spreadsheet as html to variable. | |
generateHTMLFooter () | |
Generate HTML footer. | |
generateHTMLHeader (bool $includeStyles=false) | |
Generate HTML header. | |
generateNavigation () | |
Generate sheet tabs. | |
generateSheetData () | |
Generate sheet data. | |
generateStyles (bool $generateSurroundingHTML=true) | |
Generate CSS styles. | |
getBetterBoolean () | |
getDiskCachingDirectory () | |
Get disk caching directory. | |
getEmbedImages () | |
Get embed images. | |
getFont () | |
Get Font. | |
getGenerateSheetNavigationBlock () | |
Get sheet index. | |
getImagesRoot () | |
Get images root. | |
getIncludeCharts () | |
Write charts in workbook? | |
getOrientation () | |
Get Orientation. | |
getPaperSize () | |
Get Paper Size. | |
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. | |
getSheetIndex () | |
Get sheet index. | |
getTempDir () | |
Get temporary storage directory. | |
getUseDiskCaching () | |
Get use disk caching where possible? | |
getUseInlineCss () | |
Get use inline CSS? | |
openFileHandle ($filename) | |
Open file handle. | |
save ($filename, int $flags=0) | |
Save Spreadsheet to file. | |
setBetterBoolean (bool $betterBoolean) | |
setEditHtmlCallback (?callable $callback) | |
Set a callback to edit the entire HTML. | |
setEmbedImages (bool $embedImages) | |
Set embed images. | |
setFont (string $fontName) | |
Set font. | |
setGenerateSheetNavigationBlock (bool $generateSheetNavigationBlock) | |
Set sheet index. | |
setImagesRoot (string $imagesRoot) | |
Set images root. | |
setIncludeCharts (bool $includeCharts) | |
Set write charts in workbook Set to true, to advise the Writer to include any charts that exist in the PhpSpreadsheet object. | |
setOrientation (string $orientation) | |
Set Orientation. | |
setPaperSize (int $paperSize) | |
Set Paper Size. | |
setPreCalculateFormulas (bool $precalculateFormulas) | |
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. | |
setSheetIndex (int $sheetIndex) | |
Set sheet index. | |
setTempDir (string $temporaryDirectory) | |
Set temporary storage directory. | |
setUseDiskCaching (bool $useDiskCache, ?string $cacheDirectory=null) | |
Set use disk caching where possible? | |
setUseInlineCss (bool $useInlineCss) | |
Set use inline CSS? | |
writeAllSheets () | |
Write all sheets (resets sheetIndex to NULL). | |
Static Public Member Functions | |
static | formatColorStatic (string $value, string $format) |
Add color to formatted string as inline style. | |
static | winFileToUrl (string $filename, bool $mpdf=false) |
Convert Windows file name to file protocol URL. | |
Public Attributes | |
const | BODY_LINE = ' <body>' . PHP_EOL |
const | BORDER_ARR |
const | BORDER_NONE = 'none' |
const | COMMENT_HTML_TAGS_PLAINTEXT = true |
const | DISABLE_PRECALCULATE_FORMULAE = 2 |
const | SAVE_WITH_CHARTS = 1 |
Protected Member Functions | |
createExternalWriterInstance (string $orientation, string $unit, $paperSize) | |
Gets the implementation of external PDF library that should be used. | |
maybeCloseFileHandle () | |
Close file handle only if we opened it ourselves. | |
prepareForSave ($filename) | |
Save Spreadsheet to PDF file, pre-save. | |
processFlags (int $flags) | |
restoreStateAfterSave () | |
Save PhpSpreadsheet to PDF file, post-save. | |
Static Protected Attributes | |
static array | $paperSizes |
Paper Sizes xRef List. | |
PhpOffice\PhpSpreadsheet\Writer\Pdf\Tcpdf::__construct | ( | Spreadsheet | $spreadsheet | ) |
Create a new PDF Writer instance.
Spreadsheet | $spreadsheet | Spreadsheet object |
Reimplemented from PhpOffice\PhpSpreadsheet\Writer\Pdf.
|
inherited |
Build CSS styles.
bool | $generateSurroundingHTML | Generate surrounding HTML style? (html { }) |
|
protected |
Gets the implementation of external PDF library that should be used.
string | $orientation | Page orientation |
string | $unit | Unit measure |
array | string | $paperSize | Paper size |
TCPDF | implementation |
|
inherited |
Add color to formatted string as inline style.
string | $value | Plain formatted value without color |
string | $format | Format code |
|
staticinherited |
Add color to formatted string as inline style.
string | $value | Plain formatted value without color |
string | $format | Format code |
|
inherited |
Generate HTML header.
bool | $includeStyles | Include styles? |
|
inherited |
Generate CSS styles.
bool | $generateSurroundingHTML | Generate surrounding HTML tags? (<style> and </style>) |
|
inherited |
Get disk caching directory.
Implements PhpOffice\PhpSpreadsheet\Writer\IWriter.
|
inherited |
Write charts in workbook?
If this is true, then the Writer will write definitions for any charts that exist in the PhpSpreadsheet object. If false (the default) it will ignore any charts defined in the PhpSpreadsheet object.
Implements PhpOffice\PhpSpreadsheet\Writer\IWriter.
|
inherited |
Get Orientation.
Reimplemented from PhpOffice\PhpSpreadsheet\Writer\Html.
|
inherited |
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 PhpSpreadsheet, but slower when opening the resulting file in MS Excel, because Excel has to recalculate the formulae itself.
Implements PhpOffice\PhpSpreadsheet\Writer\IWriter.
|
inherited |
Get use disk caching where possible?
Implements PhpOffice\PhpSpreadsheet\Writer\IWriter.
|
inherited |
Open file handle.
resource | string | $filename |
|
protectedinherited |
Save Spreadsheet to PDF file, pre-save.
resource | string | $filename | Name of the file to save as |
resource |
PhpOffice\PhpSpreadsheet\Writer\Pdf\Tcpdf::save | ( | $filename, | |
int | $flags = 0 ) |
Save Spreadsheet to file.
string | $filename | Name of the file to save as |
Reimplemented from PhpOffice\PhpSpreadsheet\Writer\Html.
|
inherited |
Set a callback to edit the entire HTML.
The callback must accept the HTML as string as first parameter, and it must return the edited HTML as string.
|
inherited |
Set embed images.
$this |
|
inherited |
Set font.
Examples: 'arialunicid0-chinese-simplified' 'arialunicid0-chinese-traditional' 'arialunicid0-korean' 'arialunicid0-japanese'.
$this |
|
inherited |
Set sheet index.
bool | $generateSheetNavigationBlock | Flag indicating whether the sheet navigation block should be generated or not |
$this |
|
inherited |
Set images root.
$this |
|
inherited |
Set write charts in workbook Set to true, to advise the Writer to include any charts that exist in the PhpSpreadsheet object.
Set to false (the default) to ignore charts.
$this |
Implements PhpOffice\PhpSpreadsheet\Writer\IWriter.
|
inherited |
Set Orientation.
string | $orientation | Page orientation see PageSetup::ORIENTATION_* |
|
inherited |
Set Paper Size.
int | $paperSize | Paper size see PageSetup::PAPERSIZE_* |
|
inherited |
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.
bool | $precalculateFormulas | Pre-Calculate Formulas? |
$this |
Implements PhpOffice\PhpSpreadsheet\Writer\IWriter.
|
inherited |
Set sheet index.
int | $sheetIndex | Sheet index |
$this |
|
inherited |
Set temporary storage directory.
string | $temporaryDirectory | Temporary storage directory |
|
inherited |
Set use disk caching where possible?
?string | $cacheDirectory | Disk caching directory |
$this |
Implements PhpOffice\PhpSpreadsheet\Writer\IWriter.
|
inherited |
Set use inline CSS?
$this |
|
staticinherited |
Convert Windows file name to file protocol URL.
string | $filename | file name on local system |
|
inherited |
Write all sheets (resets sheetIndex to NULL).
$this |
|
inherited |