Skip to content

Commit 7736ecc

Browse files
author
Phil Wilkinson
committed
Merge remote-tracking branch 'origin/master' into reader-embed-media-support
# Conflicts: # src/PhpPresentation/Reader/PowerPoint2007.php # src/PhpPresentation/Slide/Background/Image.php
2 parents 5474775 + 13c4f1f commit 7736ecc

File tree

94 files changed

+3097
-751
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+3097
-751
lines changed

.github/workflows/validator.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Validator
2+
on: [push, pull_request]
3+
jobs:
4+
odf:
5+
name: ODF Validator
6+
runs-on: ubuntu-latest
7+
steps:
8+
- name: Setup PHP
9+
uses: shivammathur/setup-php@v2
10+
with:
11+
php-version: '8.4'
12+
extensions: mbstring, intl, gd, xml, dom, json, fileinfo, curl, zip, iconv
13+
- uses: actions/checkout@v2
14+
15+
- name: Composer Install
16+
run: composer install --ansi --prefer-dist --no-interaction --no-progress
17+
18+
- name: Generate samples files
19+
run: composer run samples
20+
21+
- name: Download ODFValidator
22+
run: wget https://repo1.maven.org/maven2/org/odftoolkit/odfvalidator/0.12.0/odfvalidator-0.12.0-jar-with-dependencies.jar -O odfvalidator.jar
23+
24+
# https://odftoolkit.org/conformance/ODFValidator.html#what-is-checked
25+
- name: Validate documents (ODF 1.2)
26+
run: java -jar odfvalidator.jar -1.2 -e -r samples/results/ -x "^.*\/Sample_(04|22).*odp"
27+
## 04 & 22 excluded
28+
## Cause : src/PhpPresentation/Writer/ODPresentation/Content.php::writeTableStyle

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ php-cs-fixer.phar
1414
.phpunit.result.cache
1515
composer.phar
1616
vendor
17-
/batch_CI.bat
17+
/odfvalidator.jar
1818

1919
### Samples
2020
/samples/Sample_00_Test.php

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,5 @@ More examples are provided in the [samples folder](samples/). You can also read
139139

140140
We welcome everyone to contribute to PHPPresentation. Below are some of the things that you can do to contribute:
141141

142-
- Read [our contributing guide](https://github.com/PHPOffice/PHPPresentation/blob/master/CONTRIBUTING.md)
143-
- [Fork us](https://github.com/PHPOffice/PHPPresentation/fork) and [request a pull](https://github.com/PHPOffice/PHPPresentation/pulls) to the [develop](https://github.com/PHPOffice/PHPPresentation/tree/develop) branch
142+
- [Fork us](https://github.com/PHPOffice/PHPPresentation/fork) and [request a pull](https://github.com/PHPOffice/PHPPresentation/pulls) to the [master](https://github.com/PHPOffice/PHPPresentation) branch
144143
- Submit [bug reports or feature requests](https://github.com/PHPOffice/PHPPresentation/issues) to GitHub
145-
- Follow [@PHPOffice](https://twitter.com/PHPOffice) on Twitter

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
"require-dev": {
2929
"phpunit/phpunit": ">=7.0",
3030
"phpmd/phpmd": "2.*",
31-
"phpstan/phpstan": "^0.12.88 || ^1.0.0"
31+
"phpstan/phpstan": "^0.12.88 || ^1.0.0",
32+
"dompdf/dompdf": "^3.1"
3233
},
3334
"suggest": {
3435
"ext-gd": "Required to add images"

docs/changes/1.2.0.md

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,32 @@
44

55
## Enhancements
66

7-
- `phpoffice/phpspreadsheet`: Allow version 1.9 or 2.0 by [@Progi1984](https://github.com/Progi1984) fixing [#790](https://github.com/PHPOffice/PHPPresentation/pull/790), [#812](https://github.com/PHPOffice/PHPPresentation/pull/812) in [#816](https://github.com/PHPOffice/PHPPresentation/pull/816)
7+
- `phpoffice/phpspreadsheet`: Allow version 1.9 or 2.0 by [@Progi1984](https://github.com/Progi1984) fixing [#790](https://github.com/PHPOffice/PHPPresentation/issues/790), [#812](https://github.com/PHPOffice/PHPPresentation/pull/812) in [#816](https://github.com/PHPOffice/PHPPresentation/pull/816)
88
- Group Shape: moving the shape now moves all contained shapes. Offsets and size are calculated based on the contained shapes by [@DennisBirkholz](https://github.com/DennisBirkholz) in [#690](https://github.com/PHPOffice/PHPPresentation/pull/690)
99
- Added support for PHP 8.4 by [@Progi1984](https://github.com/Progi1984) in [#839](https://github.com/PHPOffice/PHPPresentation/pull/839)
10-
- `phpoffice/phpspreadsheet`: Allow version 3.0 by [@Progi1984](https://github.com/Progi1984) fixing [#836](https://github.com/PHPOffice/PHPPresentation/pull/836) in [#839](https://github.com/PHPOffice/PHPPresentation/pull/839)
10+
- `phpoffice/phpspreadsheet`: Allow version 3.0 by [@Progi1984](https://github.com/Progi1984) fixing [#836](https://github.com/PHPOffice/PHPPresentation/issues/836) in [#839](https://github.com/PHPOffice/PHPPresentation/pull/839)
1111
- `createAutoShape` : Add method to create geometric shapes by [@mhasanshahid](https://github.com/mhasanshahid) & [@Progi1984](https://github.com/Progi1984) in [#848](https://github.com/PHPOffice/PHPPresentation/pull/848)
12+
- Reader : Option to not load images by [@Progi1984](https://github.com/Progi1984) fixing [#795](https://github.com/PHPOffice/PHPPresentation/issues/795) in [#850](https://github.com/PHPOffice/PHPPresentation/pull/850)
13+
- ODPresentation Writer : Support for rotation for RichText by [@Progi1984](https://github.com/Progi1984) fixing [#279](https://github.com/PHPOffice/PHPPresentation/pull/279) in [#409](https://github.com/PHPOffice/PHPPresentation/pull/409)
14+
- HTML Writer by [@Progi1984](https://github.com/Progi1984) fixing [#221](https://github.com/PHPOffice/PHPPresentation/pull/221), [#567](https://github.com/PHPOffice/PHPPresentation/pull/567), [#644](https://github.com/PHPOffice/PHPPresentation/pull/644) in [#850](https://github.com/PHPOffice/PHPPresentation/pull/855)
15+
- PDF Writer by [@Progi1984](https://github.com/Progi1984) fixing [#181](https://github.com/PHPOffice/PHPPresentation/pull/181), [#381](https://github.com/PHPOffice/PHPPresentation/pull/381), [#472](https://github.com/PHPOffice/PHPPresentation/pull/472), [#693](https://github.com/PHPOffice/PHPPresentation/pull/693), [#725](https://github.com/PHPOffice/PHPPresentation/pull/725) in [#850](https://github.com/PHPOffice/PHPPresentation/pull/855)
16+
- PowerPoint2007 Reader : Support for BarChart by [@Progi1984](https://github.com/Progi1984) fixing [#824](https://github.com/PHPOffice/PHPPresentation/pull/824) in [#856](https://github.com/PHPOffice/PHPPresentation/pull/856)
1217

1318
## Bug fixes
1419

15-
- Word2007 Reader: Fixed cast of spacing by [@Progi1984](https://github.com/Progi1984) fixing [#729](https://github.com/PHPOffice/PHPPresentation/pull/729), [#796](https://github.com/PHPOffice/PHPPresentation/pull/796) in [#818](https://github.com/PHPOffice/PHPPresentation/pull/818)
20+
- PowerPoint2007 Reader: Fixed cast of spacing by [@Progi1984](https://github.com/Progi1984) fixing [#729](https://github.com/PHPOffice/PHPPresentation/pull/729), [#796](https://github.com/PHPOffice/PHPPresentation/pull/796) in [#818](https://github.com/PHPOffice/PHPPresentation/pull/818)
1621
- CI : Fixed PHPCSFixer by [@kw-pr](https://github.com/kw-pr) in [#835](https://github.com/PHPOffice/PHPPresentation/pull/835)
17-
- Word2007 Reader: Fixed cast of color by [@Progi1984](https://github.com/Progi1984) fixing [#826](https://github.com/PHPOffice/PHPPresentation/pull/826) in [#840](https://github.com/PHPOffice/PHPPresentation/pull/840)
18-
- Word2007 Reader: Fixed panose with 20 characters by [@Progi1984](https://github.com/Progi1984) fixing [#798](https://github.com/PHPOffice/PHPPresentation/pull/798) in [#842](https://github.com/PHPOffice/PHPPresentation/pull/842)
22+
- PowerPoint2007 Reader: Fixed cast of color by [@Progi1984](https://github.com/Progi1984) fixing [#826](https://github.com/PHPOffice/PHPPresentation/pull/826) in [#840](https://github.com/PHPOffice/PHPPresentation/pull/840)
23+
- PowerPoint2007 Reader: Fixed panose with 20 characters by [@Progi1984](https://github.com/Progi1984) fixing [#798](https://github.com/PHPOffice/PHPPresentation/pull/798) in [#842](https://github.com/PHPOffice/PHPPresentation/pull/842)
1924
- `Gd::setImageResource()` : Fixed when imagecreatetruecolor returns false by [@jaapdh](https://github.com/jaapdh) in [#843](https://github.com/PHPOffice/PHPPresentation/pull/843)
20-
- Word2007 Writer: LineChart supports LabelPosition for Series by [@pal-software](https://github.com/pal-software) fixing [#606](https://github.com/PHPOffice/PHPPresentation/pull/606) in [#8434](https://github.com/PHPOffice/PHPPresentation/pull/844)
25+
- PowerPoint2007 Writer: LineChart supports LabelPosition for Series by [@pal-software](https://github.com/pal-software) fixing [#606](https://github.com/PHPOffice/PHPPresentation/pull/606) in [#8434](https://github.com/PHPOffice/PHPPresentation/pull/844)
2126
- `createDrawingShape` has no container defined by [@Progi1984](https://github.com/Progi1984) fixing [#820](https://github.com/PHPOffice/PHPPresentation/pull/820) in [#845](https://github.com/PHPOffice/PHPPresentation/pull/845)
2227
- ODPresentation Reader : Read differents units for margin by [@Progi1984](https://github.com/Progi1984) fixing [#830](https://github.com/PHPOffice/PHPPresentation/pull/830) in [#847](https://github.com/PHPOffice/PHPPresentation/pull/847)
28+
- PowerPoint2007 Reader : Fixed loading of fonts by [@ag3202](https://github.com/ag3202) and [@Progi1984](https://github.com/Progi1984) in [#851](https://github.com/PHPOffice/PHPPresentation/pull/851)
29+
- PhpOffice\PhpPresentation\Style\TextStyle : Fixed typo for default indent by [@Progi1984](https://github.com/Progi1984) in [#857](https://github.com/PHPOffice/PHPPresentation/pull/857)
2330

2431
## Miscellaneous
32+
- CI: Added ODFValidator by [@Progi1984](https://github.com/Progi1984) fixing [#678](https://github.com/PHPOffice/PHPWord/issues/678) in [#653](https://github.com/PHPOffice/PHPWord/pull/653)
2533

2634
## BC Breaks
35+
- \PhpOffice\PhpPresentation\Style\Border::lineWidth use pixels as reference (and not anymore points)

docs/index.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ Documentation.
3535
- Output to different file formats:
3636
- PowerPoint 2007 (.pptx)
3737
- OpenDocument Presentation (.odp)
38+
- HTML (.html)
39+
- PDF (.pdf)
3840
- Serialized Spreadsheet
3941
- ... and lots of other things!
4042

@@ -50,15 +52,15 @@ Below are the supported features for each file formats.
5052
| **Document** | Mark as final | | | | :material-check: |
5153
| **Document Properties** | Standard | | :material-check: | | :material-check: |
5254
| | Custom | | :material-check: | | :material-check: |
53-
| **Slides** | | | :material-check: | | :material-check: |
55+
| **Slides** | | :material-check: | :material-check: | :material-check: | :material-check: |
5456
| | Name | | :material-check: | | |
5557
| **Element Shape** | AutoShape | | | | :material-check: |
56-
| | Image | | :material-check: | | :material-check: |
57-
| | Hyperlink | | :material-check: | | :material-check: |
58+
| | Image | :material-check: | :material-check: | :material-check: | :material-check: |
59+
| | Hyperlink | :material-check: | :material-check: | :material-check: | :material-check: |
5860
| | Line | | :material-check: | | :material-check: |
59-
| | MemoryImage | | :material-check: | | :material-check: |
61+
| | MemoryImage | :material-check: | :material-check: | :material-check: | :material-check: |
6062
| | RichText | | :material-check: | | :material-check: |
61-
| | Table | | :material-check: | | :material-check: |
63+
| | Table | :material-check: | :material-check: | :material-check: | :material-check: |
6264
| | Text | | :material-check: | | :material-check: |
6365
| **Charts** | Area | | :material-check: | | :material-check: |
6466
| | Bar | | :material-check: | | :material-check: |
@@ -84,10 +86,10 @@ Below are the supported features for each file formats.
8486
| | Image | :material-check: | :material-check: | :material-check: |
8587
| | Hyperlink | :material-check: | :material-check: | :material-check: |
8688
| | RichText | :material-check: | :material-check: | :material-check: |
87-
| | Table | | | |
89+
| | Table | | | :material-check: |
8890
| | Text | :material-check: | :material-check: | :material-check: |
8991
| **Charts** | Area | | | |
90-
| | Bar | | | |
92+
| | Bar | | | :material-check: |
9193
| | Bar3D | | | |
9294
| | Doughnut | | | |
9395
| | Line | | | |
@@ -101,7 +103,5 @@ Below are the supported features for each file formats.
101103

102104
We welcome everyone to contribute to PHPPresentation. Below are some of the things that you can do to contribute:
103105

104-
- Read [our contributing guide](https://github.com/PHPOffice/PHPPresentation/blob/master/CONTRIBUTING.md)
105-
- [Fork us](https://github.com/PHPOffice/PHPPresentation/fork) and [request a pull](https://github.com/PHPOffice/PHPPresentation/pulls) to the [develop](https://github.com/PHPOffice/PHPPresentation/tree/develop) branch
106+
- [Fork us](https://github.com/PHPOffice/PHPPresentation/fork) and [request a pull](https://github.com/PHPOffice/PHPPresentation/pulls) to the [master](https://github.com/PHPOffice/PHPPresentation) branch
106107
- Submit [bug reports or feature requests](https://github.com/PHPOffice/PHPPresentation/issues) to GitHub
107-
- Follow [@PHPOffice](https://twitter.com/PHPOffice) on Twitter

docs/usage/readers.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,21 @@ $reader = IOFactory::createReader('ODPresentation');
1010
$reader->load(__DIR__ . '/sample.odp');
1111
```
1212

13+
### Options
14+
15+
#### Load without images
16+
17+
You can load a presentation without images.
18+
19+
``` php
20+
<?php
21+
22+
use PhpOffice\PhpPresentation\Reader\ODPresentation;
23+
24+
$reader = new ODPresentation();
25+
$reader->load(__DIR__ . '/sample.odp', ODPresentation::SKIP_IMAGES);
26+
```
27+
1328
## PowerPoint97
1429
The name of the reader is `PowerPoint97`.
1530

@@ -20,6 +35,21 @@ $reader = IOFactory::createReader('PowerPoint97');
2035
$reader->load(__DIR__ . '/sample.ppt');
2136
```
2237

38+
### Options
39+
40+
#### Load without images
41+
42+
You can load a presentation without images.
43+
44+
``` php
45+
<?php
46+
47+
use PhpOffice\PhpPresentation\Reader\PowerPoint97;
48+
49+
$reader = new PowerPoint97();
50+
$reader->load(__DIR__ . '/sample.ppt', PowerPoint97::SKIP_IMAGES);
51+
```
52+
2353
## PowerPoint2007
2454
The name of the reader is `PowerPoint2007`.
2555

@@ -30,6 +60,21 @@ $reader = IOFactory::createReader('PowerPoint2007');
3060
$reader->load(__DIR__ . '/sample.pptx');
3161
```
3262

63+
### Options
64+
65+
#### Load without images
66+
67+
You can load a presentation without images.
68+
69+
``` php
70+
<?php
71+
72+
use PhpOffice\PhpPresentation\Reader\PowerPoint2007;
73+
74+
$reader = new PowerPoint2007();
75+
$reader->load(__DIR__ . '/sample.pptx', PowerPoint2007::SKIP_IMAGES);
76+
```
77+
3378
## Serialized
3479
The name of the reader is `Serialized`.
3580

docs/usage/writers.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Writers
22

3+
## HTML
4+
The name of the writer is `HTML`.
5+
6+
``` php
7+
<?php
8+
9+
$writer = IOFactory::createWriter($oPhpPresentation, 'HTML');
10+
$writer->save(__DIR__ . '/sample.html');
11+
```
12+
313
## ODPresentation
414
The name of the writer is `ODPresentation`.
515

@@ -10,6 +20,19 @@ $writer = IOFactory::createWriter($oPhpPresentation, 'PowerPoint2007');
1020
$writer->save(__DIR__ . '/sample.pptx');
1121
```
1222

23+
## PDF
24+
The name of the writer is `PDF`.
25+
26+
``` php
27+
<?php
28+
29+
use PhpOffice\PhpPresentation\Writer\PDF\DomPDF;
30+
31+
$writer = IOFactory::createWriter($oPhpPresentation, 'PDF');
32+
$writer->setPDFAdapter(new DomPDF());
33+
$writer->save(__DIR__ . '/sample.pdf');
34+
```
35+
1336
## PowerPoint2007
1437
The name of the writer is `PowerPoint2007`.
1538

phpmd.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<!-- PptSlides needs more coupling (default: 13) -->
2727
<!-- Writer/Office2007/AbstractSlide needs more coupling (default: 13) -->
2828
<properties>
29-
<property name="maximum" value="35" />
29+
<property name="maximum" value="38" />
3030
</properties>
3131
</rule>
3232
<rule ref="rulesets/design.xml/NumberOfChildren">

phpstan.neon.dist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ parameters:
2424
- '#^Parameter \#1 \$image of function imagesy expects GdImage, resource given\.#'
2525
- '#^Parameter \#1 \$image of function imagealphablending expects GdImage, resource given\.#'
2626
- '#^Parameter \#1 \$image of function imagesavealpha expects GdImage, resource given\.#'
27+
# # PHP 8.0 & Attribute
28+
- '#^Attribute class PHPUnit\\Framework\\Attributes\\DataProvider does not exist\.#'
2729

2830
## Remove after remove ArrayObject
2931
treatPhpDocTypesAsCertain: false

0 commit comments

Comments
 (0)