PHPOffice
Repos
7

A pure PHP library for reading and writing word processing documents

6379
2420

A pure PHP library for reading and writing spreadsheet files

11553
2736

A pure PHP library for reading and writing presentations documents

1190
459

Events

Created at 1 hour ago
Created at 2 hours ago
issue comment
Edit Word Template

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is still an issue for you, please try to help by debugging it further and sharing your results. Thank you for your contributions.

Created at 2 hours ago
Created at 2 hours ago
Created at 8 hours ago
Created at 8 hours ago
[BUG] Failed to load as a DOM Document from View export

I have an export of a view in laravel in which I have a table with an SVG image and it gives an error: Failed to load as a DOM Document

Created at 12 hours ago
issue comment
Allowed memory size of xxx bytes exhausted with a small file

Ah okay, there are empty cells and around 30k lines, what can I do about it?

Created at 13 hours ago
Created at 13 hours ago

Excel Functions implementation method renaming

Created at 13 hours ago
Created at 15 hours ago
issue comment
suppressFormulaErrors is not configurable

@oleibman this is looking great

Created at 15 hours ago
issue comment
TemplateProcessor insert PageBreak possible?

I've found your solution working also on OpenOffice.

First you need to close previous text tag and reopen new row in the same paragraph with page break: $templateProcessor->setValue('PAGE_BREAK', '</w:t></w:r>'.'<w:r><w:br w:type="page"/></w:r>' . '<w:r><w:t>');

Thank you very much!

Created at 17 hours ago
Created at 18 hours ago
Created at 18 hours ago
issue comment
Allowed memory size of xxx bytes exhausted with a small file

A small file does not necessarily mean a small number of cells; and remember that an Excel cell may contain an empty string, or a null value, or a formula that evaluates to these, so isn't necessarily visible when you look at the file in MS Excel itself.

Created at 18 hours ago
Allowed memory size of xxx bytes exhausted with a small file

This is:

- [x ] a bug report
- [ ] a feature request
- [ ] **not** a usage question (ask them on https://stackoverflow.com/questions/tagged/phpspreadsheet or https://gitter.im/PHPOffice/PhpSpreadsheet)

What is the expected behavior?

To convert a specific sheet from an xls file to csv

What is the current behavior?

Throws an error

What are the steps to reproduce?

I have the following function

    public static function convert_xls_to_csv($xls_file_path, $sheet_name, $csv_file)
    {
        $reader = new \PhpOffice\PhpSpreadsheet\Reader\Xlsx();
        $reader->setLoadSheetsOnly([$sheet_name]);
        $spreadsheet = $reader->load($xls_file_path);

        $writer = new PhpSpreadsheet\Writer\Csv($spreadsheet);
        $writer->save($csv_file);
    }

and an 8MB .xls file with 10+ sheets. However Allowed memory size of xxx bytes exhausted error is thrown.

What features do you think are causing the issue

  • [x] Reader
  • [ ] Writer
  • [ ] Styles
  • [ ] Data Validations
  • [ ] Formula Calculations
  • [ ] Charts
  • [ ] AutoFilter
  • [ ] Form Elements

Which versions of PhpSpreadsheet and PHP are affected?

1.24.1

Created at 19 hours ago

Fix ezyang/htmlpurifier caret version range

Merge pull request #3086 from BrokenSourceCode/master

Fix ezyang/htmlpurifier caret version range

Minor tweak for phpstan and pathinfo return array

Merge remote-tracking branch 'origin/master'

Minor tweak for phpstan and pathinfo return array

Change Log

Change Log

Change Log

Prepare Change Log for next release

Merge branch 'master' into 2.0-Development

Created at 20 hours ago

Resolve merge conflicts for master -> 2.0-dev

Created at 20 hours ago
Created at 20 hours ago

Add throws tag to writer::save

Do not remove @throws

Bugfix for Issue #3013, Named ranges not usable as anchors in OFFSET function

Update Change Log

Support for SimpleCache Interface versions 1.0, 2.0 and 3.0; to stop people moaning; even though it requires a second implementation of the Memory cache for Cells

Correct Namespaces in 11 Tests (#3020)

The setup for unit testing in Github in the "Install dependencies" log reports 11 members as "does not comply with with psr-4 autoloading standard." In each case, it is because the test namespace does not match the directory; in most cases, it was caused by the member being moved from one directory to another without changing the namespace declaration. No harm results from these problems, but there's also no reason to not correct them.

Merge branch 'master' into Cache-SimpleCache3-Support

Merge pull request #3019 from PHPOffice/Cache-SimpleCache3-Support

Support for SimpleCache Interface versions 1.0, 2.0 and 3.0

Minor changes, mainly cosmetic

Merge pull request #3025 from PHPOffice/Minor-Tweaks

Minor changes, mainly cosmetic

Explain that UoM = Unit of Measure (#3014)

Html Writer - Do Not Generate background-color When Fill is None (#3016)

  • Html Writer - Do Not Generate background-color When Fill is None

For PR #3002, I noted that there was a problem with Dompdf truncating images. I raised an issue with them (https://github.com/dompdf/dompdf/issues/2980), and they agree that there is a bug; however, they also suggested a workaround, namely omitting background-color from any cells which the image overlays. That did not at first appear to be a solution which could be generalized for PhpSpreasheet. However, investigating further, I saw that Html Writer is generating background-color for all cells, even though most of them use the default Fill type None (which suggests that background-color should not be specified after all). So this PR changes HTML Writer to generate background-color only when the user has actually set Fill type to something other than None. This is not a complete workaround for the Dompdf problem - we will still see truncation if the image overlays a cell which does specify a Fill type - however, it is almost certainly good enough for most use cases.

In addition to that change, I made the generated Html a little smaller and the code a little more efficient by combining the TD and TH styles for each cell into a single declaration and calling createCssStyle only once.

  • Revamp One Test

Look for both td.style and th.style instead of just td.style in test.

Charts - Add Support for Date Axis (#3018)

  • Charts - Add Support for Date Axis

Fix #2967. Fix #2969 (which had already been fixed prior to opening the issue, but had added urgency for Date Axes). Add ability to set axis type to date axis, in addition to original possiblities of value axis and category axis.

  • Update 33_Chart_create_line_dateaxis.php

No idea why php-cs-fixer is complaining. It didn't do so when I first uploaded. I can't duplicate problem on my own system. Not enough detail in error message for me to act. Grasping at straws, I have moved the function definition (which is the only use of braces in the entire script) from the end of the script to the beginning.

  • Update 33_Chart_create_line_dateaxis.php

Some comments were mis-aligned. This may be related to the reasons behind PR #3025, which didn't take care of this because this script had not yet been merged.

Correct Very Minor Error / Php8.2 Deprecation (#3021)

When Reader/Xlsx/WorkbookView was split off from Reader/Xlsx.php, one statement accidentally brought !empty($this->loadSheetsOnly) with it. That property does not exist in WorkbookView, so the test is useless (it is always empty); and, in fact, the caller passes its own version of loadSheetsOnly as a parameter, so it isn't needed even it did exist. In Php8.2, this might be a deprecation, although it hasn't shown up in the GitHub 8.2 tests. Fix it anyhow.

Implementation of the VALUETOTEXT() Excel Function

Merge pull request #3033 from PHPOffice/ExcelFunctions-ValueToText

Implementation of the VALUETOTEXT() Excel Function

Additional Properties for Trendlines (#3028)

Fix #3011. Some properties for Trendlines were omitted in the original request for this feature. Also, the trendlines sample spreadsheet included two charts. The rendering script 35_Chart_render handles this, but overlays the first output file with the second. It is changed to produce files with different names.

2 Minor Phpstan-related Fixes (#3030)

For one of the Phpstan upgrades, some message text had changed so drastically that the only practical solution at the time was to move the messages from phpstan-baseline.neon to phpstan.neon.dist. This was not ideal, but it allowed us time to move on and study the errors, which I have now done. At one point, Parser is expecting a variable to be an array, and that was not clear from the code. If not an array, the code will error out (which was Phpstan's concern); I have changed it to throw an exception instead. This satisfies Phpstan, and I can get the message out of neon.dist (without needing to restore it to baseline). Unsurprisingly, the exception was never thrown in the existing test suite, although I added a couple of tests to exercise that code.

In Helper/Dimension, Phpstan flagged a statement inappropriately. I suppressed the message using an annotation and filed a bug report https://github.com/phpstan/phpstan/issues/7563. A fix for the problem was merged yesterday, which is good, but it puts us in a tenuous position. The annotation is needed now, but, when the fix is inevitably pushed to the version we use, the no-longer-needed annotation will trigger a different message. Recode so that neither the current nor the future versions will issue a message, eliminating the annotation in the process.

Minor documentation updates

Phpstan Baseline < 4000 Lines Part 1 (#3023)

A lot of easily fixed problems throughout Writer/Xlsx/*, mostly supplying int rather than string as input to WriteAttribute/WriteElement. There are, in fact, so many opportunities, that I will split it over 2 or 3 PRs. But this first one will get Phpstan baseline down to the goal on its own.

Some of the other problems are also easily fixed. In particular, the docBlocks in Style/ConditionalFormatting/ConditionalDataBar do not allow for null values, and should.

Created at 20 hours ago

Support for PHP7.1 (min.)

Merge pull request #2302 from Progi1984/php7.1+

Support for PHP7.1 (min.)

Created at 21 hours ago
pull request closed
Support for PHP7.1 (min.)

Description

Support for PHP7.1 (min.)

Checklist:

  • [x] I have run composer run-script check --timeout=0 and no errors were reported
  • [x] The new code is covered by unit tests (check build/coverage for coverage report)
  • [ ] I have updated the documentation to describe the changes
Created at 21 hours ago
Created at 21 hours ago
Created at 23 hours ago
Created at 1 day ago
Created at 1 day ago
pull request opened
Support for PHP7.1 (min.)

Description

Support for PHP7.1 (min.)

Checklist:

  • [x] I have run composer run-script check --timeout=0 and no errors were reported
  • [x] The new code is covered by unit tests (check build/coverage for coverage report)
  • [ ] I have updated the documentation to describe the changes
Created at 1 day ago

HTML Reader : Override inline style on HTML attribute for table

Merge pull request #2301 from Progi1984/htmlTableStyleAttribute

HTML Reader : Override inline style on HTML attribute for table

Created at 1 day ago
pull request closed
HTML Reader : Override inline style on HTML attribute for table

Description

HTML Reader : Override inline style on HTML attribute for table

Checklist:

  • [x] I have run composer run-script check --timeout=0 and no errors were reported
  • [x] The new code is covered by unit tests (check build/coverage for coverage report)
  • [ ] I have updated the documentation to describe the changes
Created at 1 day ago