You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add Support for Various Missing Features in HTML Writer
This PR supersedes PHPOffice#1814 and PHPOffice#2343, which had become badly out of sync due to recent changes to the repository.
Implement a number of features implemented in PhpWord,
but not yet supported in PhpWord HTML Writer.
1. Use css @page and page declarations for sections.
2. Wrap sections in div, with page break before each (except first).
3. Add ability to specify generic fallback font for html (documentation change).
4. Add ability to specify handling of whitespace in html (documentation change).
Currently, Word writer preserves space but HTML writer does not.
5. Support for Language, both for document overall and individual text elements.
6. Support for PageBreak for HTML (currently only PDF is supported).
7. Support for Table Border style, color, and size.
8. Support for empty paragraphs (Word writer permits, browsers generally suppress).
9. Default paragraph style should apply to all paragraphs, as well as class Normal.
10. Paragraph style should support line-height.
11. Paragraph style should support indentation.
12. Paragraph style should support page-break-before.
13. Paragraph style should not specify margin-top/bottom when spacing is null.
Copy file name to clipboardExpand all lines: docs/usage/styles/font.md
+3-1
Original file line number
Diff line number
Diff line change
@@ -23,4 +23,6 @@ Available Font style options:
23
23
-``lang``. Language, either a language code like *en-US*, *fr-BE*, etc. or an object (or as an array) if you need to set eastAsian or bidirectional languages
24
24
See ``\PhpOffice\PhpWord\Style\Language`` class for some language codes.
25
25
-``position``. The text position, raised or lowered, in half points
26
-
-``hidden``. Hidden text, *true* or *false*.
26
+
-``hidden``. Hidden text, *true* or *false*.
27
+
`htmlWhiteSpace``. How white space is handled when generating html/pdf. Possible values are *pre-wrap* and *normal* (other css values for white space are accepted, but are not expected to be useful).
28
+
-``htmlGenericFont``. Fallback generic font for html/pdf. Possible values are *sans-serif*, *serif*, and *monospace* (other css values for generic fonts are accepted).
message:"#^Method PhpOffice\\\\PhpWord\\\\Shared\\\\XMLReader\\:\\:getElements\\(\\) should return DOMNodeList\\<DOMElement\\> but returns DOMNodeList\\<DOMNode\\>\\.$#"
525
-
count:1
526
-
path:src/PhpWord/Shared/XMLReader.php
527
-
528
-
-
529
-
message:"#^Method PhpOffice\\\\PhpWord\\\\Shared\\\\XMLReader\\:\\:getElements\\(\\) should return DOMNodeList\\<DOMElement\\> but returns DOMNodeList\\<DOMNode\\>\\|false\\.$#"
530
-
count:2
531
-
path:src/PhpWord/Shared/XMLReader.php
532
-
533
523
-
534
524
message:"#^Method PhpOffice\\\\PhpWord\\\\Shared\\\\XMLWriter\\:\\:getData\\(\\) should return string but returns string\\|false\\.$#"
message:"#^Call to an undefined method Laminas\\\\Escaper\\\\Escaper\\|PhpOffice\\\\PhpWord\\\\Escaper\\\\AbstractEscaper\\:\\:escapeHtml\\(\\)\\.$#"
1185
-
count:1
1186
-
path:src/PhpWord/Writer/HTML/Element/Link.php
1187
-
1188
-
-
1189
-
message:"#^Call to an undefined method Laminas\\\\Escaper\\\\Escaper\\|PhpOffice\\\\PhpWord\\\\Escaper\\\\AbstractEscaper\\:\\:escapeHtmlAttr\\(\\)\\.$#"
1190
-
count:1
1191
-
path:src/PhpWord/Writer/HTML/Element/Link.php
1192
-
1193
-
-
1194
-
message:"#^Call to an undefined method Laminas\\\\Escaper\\\\Escaper\\|PhpOffice\\\\PhpWord\\\\Escaper\\\\AbstractEscaper\\:\\:escapeHtml\\(\\)\\.$#"
1195
-
count:1
1196
-
path:src/PhpWord/Writer/HTML/Element/ListItem.php
1197
-
1198
1173
-
1199
1174
message:"#^Variable \\$row in PHPDoc tag @var does not match assigned variable \\$rowStyle\\.$#"
1200
1175
count:1
1201
1176
path:src/PhpWord/Writer/HTML/Element/Table.php
1202
1177
1203
-
-
1204
-
message:"#^Call to an undefined method Laminas\\\\Escaper\\\\Escaper\\|PhpOffice\\\\PhpWord\\\\Escaper\\\\AbstractEscaper\\:\\:escapeHtml\\(\\)\\.$#"
1205
-
count:2
1206
-
path:src/PhpWord/Writer/HTML/Element/Text.php
1207
-
1208
-
-
1209
-
message:"#^Call to an undefined method Laminas\\\\Escaper\\\\Escaper\\|PhpOffice\\\\PhpWord\\\\Escaper\\\\AbstractEscaper\\:\\:escapeHtml\\(\\)\\.$#"
1210
-
count:1
1211
-
path:src/PhpWord/Writer/HTML/Element/Title.php
1212
-
1213
-
-
1214
-
message:"#^Method PhpOffice\\\\PhpWord\\\\Writer\\\\HTML\\\\Style\\\\AbstractStyle\\:\\:write\\(\\) has no return type specified\\.$#"
message:"#^Else branch is unreachable because previous condition is always true\\.$#"
1220
-
count:1
1221
-
path:src/PhpWord/Writer/HTML/Style/Paragraph.php
1222
-
1223
1178
-
1224
1179
message:"#^Method PhpOffice\\\\PhpWord\\\\Writer\\\\ODText\\\\Element\\\\Field\\:\\:writeDefault\\(\\) has parameter \\$type with no type specified\\.$#"
1225
1180
count:1
@@ -1275,11 +1230,6 @@ parameters:
1275
1230
count:1
1276
1231
path:src/PhpWord/Writer/ODText/Part/Styles.php
1277
1232
1278
-
-
1279
-
message:"#^Variable \\$indent in empty\\(\\) always exists and is not falsy\\.$#"
message:"#^Parameter \\#1 \\$value of method PhpOffice\\\\PhpWord\\\\Writer\\\\RTF\\\\Style\\\\Font\\:\\:setNameIndex\\(\\) expects int, int\\|string given\\.$#"
1340
1285
count:1
@@ -1415,21 +1360,6 @@ parameters:
1415
1360
count:1
1416
1361
path:src/PhpWord/Writer/RTF/Style/Border.php
1417
1362
1418
-
-
1419
-
message:"#^Variable \\$spaceAfter on left side of \\?\\? always exists and is not nullable\\.$#"
1420
-
count:1
1421
-
path:src/PhpWord/Writer/RTF/Style/Paragraph.php
1422
-
1423
-
-
1424
-
message:"#^Variable \\$spaceBefore on left side of \\?\\? always exists and is not nullable\\.$#"
1425
-
count:1
1426
-
path:src/PhpWord/Writer/RTF/Style/Paragraph.php
1427
-
1428
-
-
1429
-
message:"#^Method PhpOffice\\\\PhpWord\\\\Writer\\\\RTF\\\\Style\\\\Tab\\:\\:write\\(\\) has no return type specified\\.$#"
1430
-
count:1
1431
-
path:src/PhpWord/Writer/RTF/Style/Tab.php
1432
-
1433
1363
-
1434
1364
message:"#^PHPDoc tag @param has invalid value \\(\\\\PhpOffice\\\\PhpWord\\\\PhpWord\\)\\: Unexpected token \"\\\\n \", expected variable at offset 86$#"
1435
1365
count:1
@@ -1480,16 +1410,6 @@ parameters:
1480
1410
count:1
1481
1411
path:src/PhpWord/Writer/Word2007/Element/SDT.php
1482
1412
1483
-
-
1484
-
message:"#^Parameter \\#1 \\$content of method PhpOffice\\\\PhpWord\\\\Writer\\\\Word2007\\\\Element\\\\AbstractElement\\:\\:writeText\\(\\) expects string, PhpOffice\\\\PhpWord\\\\Element\\\\TextRun\\|string given\\.$#"
1485
-
count:1
1486
-
path:src/PhpWord/Writer/Word2007/Element/TOC.php
1487
-
1488
-
-
1489
-
message:"#^Parameter \\#3 \\$indent of method PhpOffice\\\\PhpWord\\\\Writer\\\\Word2007\\\\Element\\\\TOC\\:\\:writeStyle\\(\\) expects int, float\\|int given\\.$#"
1490
-
count:1
1491
-
path:src/PhpWord/Writer/Word2007/Element/TOC.php
1492
-
1493
1413
-
1494
1414
message:"#^Property PhpOffice\\\\PhpWord\\\\Writer\\\\Word2007\\\\Element\\\\TableAlignment\\:\\:\\$attributes has no type specified\\.$#"
1495
1415
count:1
@@ -1540,11 +1460,6 @@ parameters:
1540
1460
count:1
1541
1461
path:src/PhpWord/Writer/Word2007/Style/Font.php
1542
1462
1543
-
-
1544
-
message:"#^Method PhpOffice\\\\PhpWord\\\\Writer\\\\WriterInterface\\:\\:save\\(\\) has no return type specified\\.$#"
1545
-
count:1
1546
-
path:src/PhpWord/Writer/WriterInterface.php
1547
-
1548
1463
-
1549
1464
message:"#^Call to an undefined method object\\:\\:read\\(\\)\\.$#"
1550
1465
count:1
@@ -1905,21 +1820,6 @@ parameters:
1905
1820
count:2
1906
1821
path:tests/PhpWordTests/TemplateProcessorTest.php
1907
1822
1908
-
-
1909
-
message:"#^Method PhpOffice\\\\PhpWordTests\\\\TemplateProcessorTest\\:\\:testTemplateCanBeSavedInTemporaryLocation\\(\\) has no return type specified\\.$#"
0 commit comments