开源软件名称(OpenSource Name):PHPOffice/PhpSpreadsheet开源软件地址(OpenSource Url):https://github.com/PHPOffice/PhpSpreadsheet开源编程语言(OpenSource Language):PHP 100.0%开源软件介绍(OpenSource Introduction):PhpSpreadsheetPhpSpreadsheet is a library written in pure PHP and offers a set of classes that allow you to read and write various spreadsheet file formats such as Excel and LibreOffice Calc. PHP version supportLTS: Support for PHP versions will only be maintained for a period of six months beyond the end of life of that PHP version. Currently the required PHP minimum version is PHP 7.3. See the InstallationUse composer to install PhpSpreadsheet into your project: composer require phpoffice/phpspreadsheet If you are building your installation on a development machine that is on a different PHP version to the server where it will be deployed, or if your PHP CLI version is not the same as your run-time such as {
"require": {
"phpoffice/phpspreadsheet": "^1.23"
},
"config": {
"platform": {
"php": "7.3"
}
}
} and then run composer install to ensure that the correct dependencies are retrieved to match your deployment environment. See CLI vs Application run-time for more details. Additional Installation OptionsIf you want to write to PDF, or to include Charts when you write to HTML or PDF, then you will need to install additional libraries: For PDF Generation, you can install any of the following, and then configure PhpSpreadsheet to indicate which library you are going to use:
and configure PhpSpreadsheet using: // Dompdf, Mpdf or Tcpdf (as appropriate)
$className = \PhpOffice\PhpSpreadsheet\Writer\Pdf\Dompdf::class;
IOFactory::registerWriter('Pdf', $className); or the appropriate PDF Writer wrapper for the library that you have chosen to install. Chart ExportFor Chart export, we support following packages, which you will also need to install yourself using
and then configure PhpSpreadsheet using: Settings::setChartRenderer(\PhpOffice\PhpSpreadsheet\Chart\Renderer\JpGraph::class); // to use jpgraph/jpgraph
//or
Settings::setChartRenderer(\PhpOffice\PhpSpreadsheet\Chart\Renderer\MtJpGraphRenderer::class); // to use mitoteam/jpgraph DocumentationRead more about it, including install instructions, in the official documentation. Or check out the API documentation. Please ask your support questions on StackOverflow, or have a quick chat on Gitter. PHPExcel vs PhpSpreadsheet ?PhpSpreadsheet is the next version of PHPExcel. It breaks compatibility to dramatically improve the code base quality (namespaces, PSR compliance, use of latest PHP language features, etc.). Because all efforts have shifted to PhpSpreadsheet, PHPExcel will no longer be maintained. All contributions for PHPExcel, patches and new features, should target PhpSpreadsheet Do you need to migrate? There is an automated tool for that. LicensePhpSpreadsheet is licensed under MIT. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论