edc411e6dd
We give users the ability to edit Html/Pdf, but it's a little cumbersome to use the edited Html for an Html file, and difficult to use it for a Pdf. I believe we could make it fairly painless in both cases by allowing the user to set a callback to edit the generated Html. This can be accomplished with fewer than a dozen lines of very simple code. I think this would be easier than grabbing the Html in pieces, editing it, and reassembling it. I think it would also be simpler than an alternative I considered, namely the addition of a new method (e.g. saveEditedHtml) to each of the Html and Pdf writers. One edit that users might like to make when editing html is to add fallback fonts, something that is not currently available in PhpSpreadsheet, and might be difficult to add. A natural extension to that idea would be the use of webfonts, something which is guaranteed difficult to add. See samples/Basic/17b_Html for an example of this. None of the PDF writers support webfonts yet. That doesn't mean they won't do so in future, but, for now, samples/Pdf/21a_Pdf is a prosaic example of something you could do with this callback. In fact, this opens the door to letting the user replace the entire body with data of their choosing, effectively allowing PhpSpreadsheet (where you can set things like paper size and orientation) to be used as a front-end to the Pdf processor without the user having to be be overly familiar with the vagaries of the PDF processor. I think this is actually a pretty nice idea. YMMV. See samples/Basic/21b_Pdf for an example. |
||
---|---|---|
.github | ||
bin | ||
docs | ||
samples | ||
src/PhpSpreadsheet | ||
tests | ||
.gitattributes | ||
.gitignore | ||
.php_cs.dist | ||
.scrutinizer.yml | ||
.travis.yml | ||
CHANGELOG.PHPExcel.md | ||
CHANGELOG.md | ||
CONTRIBUTING.md | ||
LICENSE | ||
README.md | ||
composer.json | ||
composer.lock | ||
mkdocs.yml | ||
phpunit.xml.dist |
README.md
PhpSpreadsheet
PhpSpreadsheet is a library written in pure PHP and providing a set of classes that allow you to read from and to write to different spreadsheet file formats, like Excel and LibreOffice Calc.
Documentation
Read 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 master
branch.
Do you need to migrate? There is an automated tool for that.
License
PhpSpreadsheet is licensed under MIT.