Utility Extension for putting data in different formats like
Simply install the extension with Composer or the Extension Manager. Include the TypoScript if you want to use the PDF generation.
Use the public API of the
CsvService to generate a CSV file or output the CSV string directly.
There is no wrapper functionality to help with the creation of excel files. However the library
phpoffice/phpspreadsheet is required as a composer dependency and can therefore be used out of
the box in composer based installations.
The PDF functionality relies on wkhtmltopdf which must be available on the server. There are several ways to provide the binary. Please refer to the wkhtmltopdf documentation.
The extension provides a PdfService. here is an example usage:
$pdfService = GeneralUtility::makeInstance(PdfService::class); $pdfService->setContent($myHtml); $absolutepathToFile = $pdfService->saveToFile('myPdf.pdf');
This will create a file
myPdf.pdf with the contents of
$myHtml in a directory that can be configured in TypoScript.
The whole TypoScript configuration (
Every setting can be overwritten during runtime:
$pdfService = GeneralUtility::makeInstance(PdfService::class); $pdfService->setSettings( [ 'orientation' => 'Landscape, 'marginLeft' => 25, 'tempDirectoryPath' => PATH_site . 'something/public/' ] );
Find more TYPO3 extensions we have developed that help us deliver value in client projects. As part of the way we work, we focus on testing and best practices to ensure long-term performance, reliability, and results in all our code.