{"id":21277932,"url":"https://github.com/b13/t3ext-format","last_synced_at":"2025-07-11T08:32:10.989Z","repository":{"id":6594177,"uuid":"7837011","full_name":"b13/t3ext-format","owner":"b13","description":"TYPO3 Extension: Helper extension to allow easy use of putting data in different formats (CSV, Excel, PDF etc)","archived":false,"fork":false,"pushed_at":"2024-10-08T05:18:32.000Z","size":7469,"stargazers_count":6,"open_issues_count":2,"forks_count":2,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-11-10T03:58:50.469Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/b13.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-01-26T11:54:45.000Z","updated_at":"2024-10-08T05:18:24.000Z","dependencies_parsed_at":"2023-01-13T14:02:57.465Z","dependency_job_id":null,"html_url":"https://github.com/b13/t3ext-format","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b13%2Ft3ext-format","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b13%2Ft3ext-format/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b13%2Ft3ext-format/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b13%2Ft3ext-format/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/b13","download_url":"https://codeload.github.com/b13/t3ext-format/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225708281,"owners_count":17511635,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-21T10:08:18.591Z","updated_at":"2025-07-11T08:32:10.982Z","avatar_url":"https://github.com/b13.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TYPO3 Extension format\n\n\u003e [!CAUTION]\n\u003e This TYPO3 Extension will not be maintained by b13 any further starting January 2025. So, you're on your own using this extension.\n\u003e \n\u003e *Why?*\n\u003e \n\u003e This extension was initially created back when TYPO3 v4 was hip and cool. However, we've experienced in the past years, that we've utilized composer-based packages directly for solving these problems, when they are needed. We don't need \"one-fits-it-all\" solution.\n\u003e\n\u003e If you need a CSV file (or output) generated by PHP, copy over the file into your project, or code the 5 lines on your own.\n\u003e\n\u003e If you need Excel support, utilize the composer package `phpoffice/phpspreadsheet` directly.\n\u003e\n\u003e And if you need PDF creation support - we recommend also to look into solutions you need - some people need wkhtmltopdf, some need mpdf, and others a different requirement.\n\n----\n\nUtility Extension for putting data in different formats like\n\n* CSV\n* PDF\n* Excel\n\n## Installation\n\nSimply install the extension with Composer or the Extension Manager. Include the TypoScript if you want to use the PDF generation.\n\n## Usage\n\n### CSV\n\nUse the public API of the `CsvService` to generate a CSV file or output the CSV string directly.\n\n### Excel\n\nThere is no wrapper functionality to help with the creation of excel files. However the library\n`phpoffice/phpspreadsheet` is required as a composer dependency and can therefore be used out of\nthe box in composer based installations.\n\n### PDF\n\nThe PDF functionality relies on wkhtmltopdf which must be available on the server.\nThere are several ways to provide the binary. Please refer to the wkhtmltopdf documentation. \n\nThe extension provides a PdfService. here is an example usage:\n\n```\n$pdfService = GeneralUtility::makeInstance(PdfService::class);\n$pdfService-\u003esetContent($myHtml);\n$absolutepathToFile = $pdfService-\u003esaveToFile('myPdf');\n```\n\nThis will create a file `myPdf.pdf` with the contents of `$myHtml` in a directory that can be configured in TypoScript.\nThe whole TypoScript configuration (`constants.typoscript`):\n\n```\nplugin.tx_format {\n  settings {\n    pdf {\n      // Path to the wkhtmltopdf binary\n      binaryFilePath = /usr/local/bin/wkhtmltopdf\n      // Path were the PDFs are stored\n      tempDirectoryPath = /tmp/\n      // Default file name of the generated PDF\n      tempFileName =\n      // If set the fileName will be appended with X characters of the md5 hash of the content\n      md5Length = 0\n      // Use print media-type instead of screen\n      printMediaTypeAttribute = 1\n      // Generates lower quality pdf/ps. Useful to shrink the result document space\n      lowQualityAttribute = 0\n      // Adds a html footer\n      footerHtmlAttribute =\n      // URL to render (instead of content)\n      url =\n      // Minimum font size\n      minimumFontSize = 15\n      // Set the page left margin (default 10mm)\n      marginLeft = 10\n      // Set the page right margin (default 10mm)\n      marginRight = 10\n      // Set the page top margin\n      marginTop = 10\n      // Set the page bottom margin\n      marginBottom = 10\n      // The default page size of the rendered document is A4, but using this\n      // --page-size optionthis can be changed to almost anything else, such as: A3,\n      // Letter and Legal.  For a full list of supported pages sizes please see\n      // \u003chttp://qt-project.org/doc/qt-4.8/qprinter.html#PaperSize-enum\u003e.\n      pageSize =\n      // Wait some milliseconds for javascript finish (default 200)\n      javaScriptDelay = 200\n      // Set orientation to Landscape or Portrait (default Portrait)\n      orientation = Portrait\n      // Whether a generated PDF should be kept at the end of the process. By default it is deleted.\n      persistPDF = 0\n      // For all supported attributes refer to https://wkhtmltopdf.org/usage/wkhtmltopdf.txt\n      additionalAttributes =\n    }\n  }\n}\n```\n\nEvery setting can be overwritten during runtime:\n\n```\n$pdfService = GeneralUtility::makeInstance(PdfService::class);\n$pdfService-\u003esetSettings(\n  [\n    'orientation' =\u003e 'Landscape,\n    'marginLeft' =\u003e 25,\n    'tempDirectoryPath' =\u003e PATH_site . 'something/public/'\n  ]\n);\n```\n### Sharing our expertise\n\n[Find more TYPO3 extensions we have developed](https://b13.com/useful-typo3-extensions-from-b13-to-you) 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.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fb13%2Ft3ext-format","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fb13%2Ft3ext-format","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fb13%2Ft3ext-format/lists"}