Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reader writer flags #2136

Merged
merged 13 commits into from
Jun 4, 2021
Prev Previous commit
Next Next commit
Minor updates to documentation
  • Loading branch information
MarkBaker committed Jun 2, 2021
commit 64fdea8aef9e6f7bf8d21284fdcbad2c3bf503c2
4 changes: 2 additions & 2 deletions docs/topics/reading-and-writing-to-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -1031,14 +1031,14 @@ $reader->load("spreadsheetWithCharts.xlsx");
```
Alternatively, you can specify this in the call to load the spreadsheet:
```php
$reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReaderForFile("05featuredemo.xlsx");
$reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReaderForFile("spreadsheetWithCharts.xlsx");
$reader->load("spreadsheetWithCharts.xlsx", $reader::LOAD_WITH_CHARTS);
```

If you wish to use the IOFactory `load()` method rather than instantiating a specific Reader, then you can still pass these flags.

```php
$spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load("setIncludeCharts.xlsx", \PhpOffice\PhpSpreadsheet\Reader\IReader::LOAD_WITH_CHARTS);
$spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load("spreadsheetWithCharts.xlsx", \PhpOffice\PhpSpreadsheet\Reader\IReader::LOAD_WITH_CHARTS);
```

Likewise, when saving a file using a Writer, loaded charts wil not be saved unless you explicitly tell the Writer to include them:
Expand Down