Skip to content

Commit c67da2e

Browse files
committed
WIP
1 parent 06c2f56 commit c67da2e

File tree

154 files changed

+3419
-2323
lines changed

Some content is hidden

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

154 files changed

+3419
-2323
lines changed

.travis.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@ language: php
33
dist: precise
44

55
php:
6-
- 5.3
7-
- 5.4
8-
- 5.5
9-
- 5.6
106
- 7.0
117
- 7.1
128
- 7.2
@@ -16,12 +12,9 @@ matrix:
1612
include:
1713
- php: 7.0
1814
env: COVERAGE=1
19-
- php: 5.3
20-
env: COMPOSER_MEMORY_LIMIT=2G
2115
- php: 7.3
2216
env: DEPENDENCIES="--ignore-platform-reqs"
2317
exclude:
24-
- php: 5.3
2518
- php: 7.0
2619
- php: 7.3
2720

docs/elements.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,11 +218,11 @@ Table style can be defined with ``addTableStyle``:
218218
.. code-block:: php
219219
220220
$tableStyle = array(
221-
'borderColor' => '006699',
221+
'borderColor' => new Hex('006699'),
222222
'borderSize' => 6,
223223
'cellMargin' => 50
224224
);
225-
$firstRowStyle = array('bgColor' => '66BBFF');
225+
$firstRowStyle = array('bgColor' => new Hex('66BBFF'));
226226
$phpWord->addTableStyle('myTable', $tableStyle, $firstRowStyle);
227227
$table = $section->addTable('myTable');
228228

docs/general.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ folder <https://github.com/PHPOffice/PHPWord/tree/master/samples/>`__.
4848
$fontStyleName = 'oneUserDefinedStyle';
4949
$phpWord->addFontStyle(
5050
$fontStyleName,
51-
array('name' => 'Tahoma', 'size' => 10, 'color' => '1B2232', 'bold' => true)
51+
array('name' => 'Tahoma', 'size' => 10, 'color' => new Hex('1B2232'), 'bold' => true)
5252
);
5353
$section->addText(
5454
'"The greatest accomplishment is not in never falling, '

docs/recipes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ Apply 'HeadingN' paragraph style to TextRun or Link. Sample code:
7575
$phpWord = new \PhpOffice\PhpWord\PhpWord();
7676
$phpWord->addTitleStyle(1, array('size' => 16, 'bold' => true));
7777
$phpWord->addTitleStyle(2, array('size' => 14, 'bold' => true));
78-
$phpWord->addFontStyle('Link', array('color' => '0000FF', 'underline' => 'single'));
78+
$phpWord->addFontStyle('Link', array('color' => new Hex('0000FF'), 'underline' => 'single'));
7979
8080
$section = $phpWord->addSection();
8181

docs/styles.rst

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Available Font style options:
4848
- ``color``. Font color, e.g. *FF0000*.
4949
- ``doubleStrikethrough``. Double strikethrough, *true* or *false*.
5050
- ``fgColor``. Font highlight color, e.g. *yellow*, *green*, *blue*.
51-
See ``\PhpOffice\PhpWord\Style\Font::FGCOLOR_...`` class constants for possible values
51+
See ``\PhpOffice\PhpWord\Style\Colors\ForegroundColor::$allowed_colors`` variable for possible values
5252
- ``hint``. Font content type, *default*, *eastAsia*, or *cs*.
5353
- ``italic``. Italic, *true* or *false*.
5454
- ``name``. Font name, e.g. *Arial*.
@@ -105,15 +105,14 @@ Available Table style options:
105105

106106
- ``alignment``. Supports all alignment modes since 1st Edition of ECMA-376 standard up till ISO/IEC 29500:2012.
107107
See ``\PhpOffice\PhpWord\SimpleType\JcTable`` and ``\PhpOffice\PhpWord\SimpleType\Jc`` class constants for possible values.
108-
- ``bgColor``. Background color, e.g. '9966CC'.
109-
- ``border(Top|Right|Bottom|Left)Color``. Border color, e.g. '9966CC'.
110-
- ``border(Top|Right|Bottom|Left)Size``. Border size in *twip*.
111-
- ``cellMargin(Top|Right|Bottom|Left)``. Cell margin in *twip*.
112-
- ``indent``. Table indent from leading margin. Must be an instance of ``\PhpOffice\PhpWord\ComplexType\TblWidth``.
113-
- ``width``. Table width in Fiftieths of a Percent or Twentieths of a Point.
114-
- ``unit``. The unit to use for the width. One of ``\PhpOffice\PhpWord\SimpleType\TblWidth``. Defaults to *auto*.
108+
- ``bgColor``. Background color. Must be an instance of ``\PhpOffice\PhpWord\Style\Colors\ColorInterface``.
109+
- ``border(Top|Right|Bottom|Left)Color``. Border color. Must be an instance of ``\PhpOffice\PhpWord\Style\Colors\ColorInterface``.
110+
- ``border(Top|Right|Bottom|Left)Size``. Border size. Must be an instance of ``\PhpOffice\PhpWord\Style\Lengths\Absolute``.
111+
- ``cellMargin(Top|Right|Bottom|Left)``. Cell margin. Must be an instance of ``\PhpOffice\PhpWord\Style\Lengths\Absolute``.
112+
- ``indent``. Table indent from leading margin. Must be an instance of ``\PhpOffice\PhpWord\Lengths\Length``.
113+
- ``width``. Table width. Must be an instance of ``\PhpOffice\PhpWord\Lengths\Length``.
115114
- ``layout``. Table layout, either *fixed* or *autofit* See ``\PhpOffice\PhpWord\Style\Table`` for constants.
116-
- ``cellSpacing`` Cell spacing in *twip*
115+
- ``cellSpacing`` Cell spacing. Must be an instance of ``\PhpOffice\PhpWord\Lengths\Absolute``
117116
- ``position`` Floating Table Positioning, see below for options
118117
- ``bidiVisual`` Present table as Right-To-Left
119118

docs/templates-processing.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,10 @@ The result will be
8989
9090
Customer: ${customer_name#1}
9191
Address: ${customer_address#1}
92-
92+
9393
Customer: ${customer_name#2}
9494
Address: ${customer_address#2}
95-
95+
9696
Customer: ${customer_name#3}
9797
Address: ${customer_address#3}
9898
@@ -113,7 +113,7 @@ The result will then be
113113
114114
Customer: Batman
115115
Address: Gotham City
116-
116+
117117
Customer: Superman
118118
Address: Metropolis
119119
@@ -234,7 +234,7 @@ See ``Sample_40_TemplateSetComplexValue.php`` for examples.
234234

235235
.. code-block:: php
236236
237-
$table = new Table(array('borderSize' => 12, 'borderColor' => 'green', 'width' => 6000, 'unit' => TblWidth::TWIP));
237+
$table = new Table(array('borderSize' => 12, 'borderColor' => 'green', 'width' => Absolute::from("twip", 6000)));
238238
$table->addRow();
239239
$table->addCell(150)->addText('Cell A1');
240240
$table->addCell(150)->addText('Cell A2');

samples/Sample_01_SimpleText.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
$textrun = $section->addTextRun();
4848
$textrun->addText('I am inline styled ', $fontStyle);
4949
$textrun->addText('with ');
50-
$textrun->addText('color', array('color' => '996699'));
50+
$textrun->addText('color', array('color' => new Hex('996699')));
5151
$textrun->addText(', ');
5252
$textrun->addText('bold', array('bold' => true));
5353
$textrun->addText(', ');

samples/Sample_03_Sections.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
$phpWord = new \PhpOffice\PhpWord\PhpWord();
99

1010
// New portrait section
11-
$section = $phpWord->addSection(array('borderColor' => '00FF00', 'borderSize' => 12));
11+
$section = $phpWord->addSection(array('borderColor' => new Hex('00FF00'), 'borderSize' => 12));
1212
$section->addText('I am placed on a default section.');
1313

1414
// New landscape section

samples/Sample_04_Textrun.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
$phpWord->addFontStyle($boldFontStyleName, array('bold' => true));
1414

1515
$coloredFontStyleName = 'ColoredText';
16-
$phpWord->addFontStyle($coloredFontStyleName, array('color' => 'FF8080', 'bgColor' => 'FFFFCC'));
16+
$phpWord->addFontStyle($coloredFontStyleName, array('color' => new Hex('FF8080'), 'bgColor' => new Hex('FFFFCC')));
1717

1818
$linkFontStyleName = 'NLink';
19-
$phpWord->addLinkStyle($linkFontStyleName, array('color' => '0000FF', 'underline' => \PhpOffice\PhpWord\Style\Font::UNDERLINE_SINGLE));
19+
$phpWord->addLinkStyle($linkFontStyleName, array('color' => new Hex('0000FF'), 'underline' => \PhpOffice\PhpWord\Style\Font::UNDERLINE_SINGLE));
2020

2121
// New portrait section
2222
$section = $phpWord->addSection();

samples/Sample_06_Footnote.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
$phpWord->addFontStyle($boldFontStyleName, array('bold' => true));
1818

1919
$coloredFontStyleName = 'ColoredText';
20-
$phpWord->addFontStyle($coloredFontStyleName, array('color' => 'FF8080', 'bgColor' => 'FFFFCC'));
20+
$phpWord->addFontStyle($coloredFontStyleName, array('color' => new Hex('FF8080'), 'bgColor' => new Hex('FFFFCC')));
2121

2222
$linkFontStyleName = 'NLink';
23-
$phpWord->addLinkStyle($linkFontStyleName, array('color' => '0000FF', 'underline' => \PhpOffice\PhpWord\Style\Font::UNDERLINE_SINGLE));
23+
$phpWord->addLinkStyle($linkFontStyleName, array('color' => new Hex('0000FF'), 'underline' => \PhpOffice\PhpWord\Style\Font::UNDERLINE_SINGLE));
2424

2525
// New portrait section
2626
$section = $phpWord->addSection();

samples/Sample_09_Tables.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?php
22
use PhpOffice\PhpWord\Shared\Converter;
3+
use PhpOffice\PhpWord\Style\Lengths\Absolute;
34
use PhpOffice\PhpWord\Style\TablePosition;
45

56
include_once 'Sample_Header.php';
@@ -30,14 +31,14 @@
3031
$section->addText('Fancy table', $header);
3132

3233
$fancyTableStyleName = 'Fancy Table';
33-
$fancyTableStyle = array('borderSize' => 6, 'borderColor' => '006699', 'cellMargin' => 80, 'alignment' => \PhpOffice\PhpWord\SimpleType\JcTable::CENTER, 'cellSpacing' => 50);
34-
$fancyTableFirstRowStyle = array('borderBottomSize' => 18, 'borderBottomColor' => '0000FF', 'bgColor' => '66BBFF');
34+
$fancyTableStyle = array('borderSize' => 6, 'borderColor' => new Hex('006699'), 'cellMargin' => 80, 'alignment' => \PhpOffice\PhpWord\SimpleType\JcTable::CENTER, 'cellSpacing' => 50);
35+
$fancyTableFirstRowStyle = array('borderBottomSize' => 18, 'borderBottomColor' => new Hex('0000FF'), 'bgColor' => new Hex('66BBFF'));
3536
$fancyTableCellStyle = array('valign' => 'center');
3637
$fancyTableCellBtlrStyle = array('valign' => 'center', 'textDirection' => \PhpOffice\PhpWord\Style\Cell::TEXT_DIR_BTLR);
3738
$fancyTableFontStyle = array('bold' => true);
3839
$phpWord->addTableStyle($fancyTableStyleName, $fancyTableStyle, $fancyTableFirstRowStyle);
3940
$table = $section->addTable($fancyTableStyleName);
40-
$table->addRow(900);
41+
$table->addRow(Absolute::from('twip', 900));
4142
$table->addCell(2000, $fancyTableCellStyle)->addText('Row 1', $fancyTableFontStyle);
4243
$table->addCell(2000, $fancyTableCellStyle)->addText('Row 2', $fancyTableFontStyle);
4344
$table->addCell(2000, $fancyTableCellStyle)->addText('Row 3', $fancyTableFontStyle);
@@ -65,8 +66,8 @@
6566
$section->addPageBreak();
6667
$section->addText('Table with colspan and rowspan', $header);
6768

68-
$fancyTableStyle = array('borderSize' => 6, 'borderColor' => '999999');
69-
$cellRowSpan = array('vMerge' => 'restart', 'valign' => 'center', 'bgColor' => 'FFFF00');
69+
$fancyTableStyle = array('borderSize' => 6, 'borderColor' => new Hex('999999'));
70+
$cellRowSpan = array('vMerge' => 'restart', 'valign' => 'center', 'bgColor' => new Hex('FFFF00'));
7071
$cellRowContinue = array('vMerge' => 'continue');
7172
$cellColSpan = array('gridSpan' => 2, 'valign' => 'center');
7273
$cellHCentered = array('alignment' => \PhpOffice\PhpWord\SimpleType\Jc::CENTER);
@@ -111,7 +112,7 @@
111112
$section->addPageBreak();
112113
$section->addText('Table with colspan and rowspan', $header);
113114

114-
$styleTable = array('borderSize' => 6, 'borderColor' => '999999');
115+
$styleTable = array('borderSize' => 6, 'borderColor' => new Hex('999999'));
115116
$phpWord->addTableStyle('Colspan Rowspan', $styleTable);
116117
$table = $section->addTable('Colspan Rowspan');
117118

@@ -147,7 +148,7 @@
147148
$section->addTextBreak(2);
148149
$section->addText('Table with floating positioning.', $header);
149150

150-
$table = $section->addTable(array('borderSize' => 6, 'borderColor' => '999999', 'position' => array('vertAnchor' => TablePosition::VANCHOR_TEXT, 'bottomFromText' => Converter::cmToTwip(1))));
151+
$table = $section->addTable(array('borderSize' => 6, 'borderColor' => new Hex('999999'), 'position' => array('vertAnchor' => TablePosition::VANCHOR_TEXT, 'bottomFromText' => Converter::cmToTwip(1))));
151152
$cell = $table->addRow()->addCell();
152153
$cell->addText('This is a single cell.');
153154

samples/Sample_10_EastAsianFontStyle.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
$section = $phpWord->addSection();
88
$header = array('size' => 16, 'bold' => true);
99
//1.Use EastAisa FontStyle
10-
$section->addText('中文楷体样式测试', array('name' => '楷体', 'size' => 16, 'color' => '1B2232', 'lang' => array('latin' => 'en-US', 'eastAsia' => 'zh-CN')));
10+
$section->addText('中文楷体样式测试', array('name' => '楷体', 'size' => 16, 'color' => new Hex('1B2232'), 'lang' => array('latin' => 'en-US', 'eastAsia' => 'zh-CN')));
1111

1212
// Save file
1313
echo write($phpWord, basename(__FILE__, '.php'), $writers);

samples/Sample_14_ListItem.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
// Define styles
99
$fontStyleName = 'myOwnStyle';
10-
$phpWord->addFontStyle($fontStyleName, array('color' => 'FF0000'));
10+
$phpWord->addFontStyle($fontStyleName, array('color' => new Hex('FF0000')));
1111

1212
$paragraphStyleName = 'P-Style';
1313
$phpWord->addParagraphStyle($paragraphStyleName, array('spaceAfter' => 95));

samples/Sample_15_Link.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
// Define styles
99
$linkFontStyleName = 'myOwnLinStyle';
10-
$phpWord->addLinkStyle($linkFontStyleName, array('bold' => true, 'color' => '808000'));
10+
$phpWord->addLinkStyle($linkFontStyleName, array('bold' => true, 'color' => new Hex('808000')));
1111

1212
// New section
1313
$section = $phpWord->addSection();
@@ -16,7 +16,7 @@
1616
$section->addLink(
1717
'https://github.com/PHPOffice/PHPWord',
1818
'PHPWord on GitHub',
19-
array('color' => '0000FF', 'underline' => \PhpOffice\PhpWord\Style\Font::UNDERLINE_SINGLE)
19+
array('color' => new Hex('0000FF'), 'underline' => \PhpOffice\PhpWord\Style\Font::UNDERLINE_SINGLE)
2020
);
2121
$section->addTextBreak(2);
2222
$section->addLink('http://www.bing.com', null, $linkFontStyleName);

samples/Sample_17_TitleTOC.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
$fontStyle12 = array('spaceAfter' => 60, 'size' => 12);
1414
$fontStyle10 = array('size' => 10);
1515
$phpWord->addTitleStyle(null, array('size' => 22, 'bold' => true));
16-
$phpWord->addTitleStyle(1, array('size' => 20, 'color' => '333333', 'bold' => true));
17-
$phpWord->addTitleStyle(2, array('size' => 16, 'color' => '666666'));
16+
$phpWord->addTitleStyle(1, array('size' => 20, 'color' => new Hex('333333'), 'bold' => true));
17+
$phpWord->addTitleStyle(2, array('size' => 16, 'color' => new Hex('666666')));
1818
$phpWord->addTitleStyle(3, array('size' => 14, 'italic' => true));
1919
$phpWord->addTitleStyle(4, array('size' => 12));
2020

samples/Sample_20_BGColor.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
<?php
22
include_once 'Sample_Header.php';
33

4+
use PhpOffice\PhpWord\Style\Colors\ForegroundColor;
5+
use PhpOffice\PhpWord\Style\Colors\Hex;
6+
47
// New Word document
58
echo date('H:i:s'), ' Create new PhpWord object', EOL;
69
$phpWord = new \PhpOffice\PhpWord\PhpWord();
@@ -10,10 +13,10 @@
1013

1114
$section->addText(
1215
'This is some text highlighted using fgColor (limited to 15 colors)',
13-
array('fgColor' => \PhpOffice\PhpWord\Style\Font::FGCOLOR_YELLOW)
16+
array('fgColor' => new ForegroundColor('yellow'))
1417
);
15-
$section->addText('This one uses bgColor and is using hex value (0xfbbb10)', array('bgColor' => 'fbbb10'));
16-
$section->addText('Compatible with font colors', array('color' => '0000ff', 'bgColor' => 'fbbb10'));
18+
$section->addText('This one uses bgColor and is using hex value (0xfbbb10)', array('bgColor' => new Hex('fbbb10')));
19+
$section->addText('Compatible with font colors', array('color' => new Hex('0000ff'), 'bgColor' => new Hex('fbbb10')));
1720

1821
// Save file
1922
echo write($phpWord, basename(__FILE__, '.php'), $writers);

samples/Sample_21_TableRowRules.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
);
1717

1818
$table1 = $section->addTable(array('cellMargin' => 0, 'cellMarginRight' => 0, 'cellMarginBottom' => 0, 'cellMarginLeft' => 0));
19-
$table1->addRow(3750);
20-
$cell1 = $table1->addCell(null, array('valign' => 'top', 'borderSize' => 30, 'borderColor' => 'ff0000'));
19+
$table1->addRow(Absolute::from('twip', 3750));
20+
$cell1 = $table1->addCell(null, array('valign' => 'top', 'borderSize' => 30, 'borderColor' => new Hex('ff0000')));
2121
$cell1->addImage('./resources/_earth.jpg', array('width' => 250, 'height' => 250, 'alignment' => \PhpOffice\PhpWord\SimpleType\Jc::CENTER));
2222

2323
$section->addTextBreak();
@@ -31,13 +31,13 @@
3131
'cellMarginLeft' => 0,
3232
)
3333
);
34-
$table2->addRow(3750, array('exactHeight' => true));
35-
$cell2 = $table2->addCell(null, array('valign' => 'top', 'borderSize' => 30, 'borderColor' => '00ff00'));
34+
$table2->addRow(Absolute::from('twip', 3750), array('exactHeight' => true));
35+
$cell2 = $table2->addCell(null, array('valign' => 'top', 'borderSize' => 30, 'borderColor' => new Hex('00ff00')));
3636
$cell2->addImage('./resources/_earth.jpg', array('width' => 250, 'height' => 250, 'alignment' => \PhpOffice\PhpWord\SimpleType\Jc::CENTER));
3737

3838
$section->addTextBreak();
3939
$section->addText('In this example, image is 250px height. Rows are calculated in twips, and 1px = 15twips.');
40-
$section->addText('So: $' . "table2->addRow(3750, array('exactHeight'=>true));");
40+
$section->addText('So: $' . "table2->addRow(Absolute::from('twip', 3750), array('exactHeight'=>true));");
4141

4242
// Save file
4343
echo write($phpWord, basename(__FILE__, '.php'), $writers);

samples/Sample_36_RTL.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
$section->addText('Table visually presented as RTL');
1818
$style = array('rtl' => true, 'size' => 12);
19-
$tableStyle = array('borderSize' => 6, 'borderColor' => '000000', 'width' => 5000, 'unit' => \PhpOffice\PhpWord\SimpleType\TblWidth::PERCENT, 'bidiVisual' => true);
19+
$tableStyle = array('borderSize' => 6, 'borderColor' => new Hex('000000'), 'width' => Absolute::from('twip', 5000), 'bidiVisual' => true);
2020

2121
$table = $section->addTable($tableStyle);
2222
$cellHCentered = array('alignment' => \PhpOffice\PhpWord\SimpleType\Jc::CENTER);

samples/Sample_37_Comments.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
$commentOnImage = new \PhpOffice\PhpWord\Element\Comment('Mr Smart', new \DateTime());
4040
$imageComment = $commentOnImage->addTextRun();
4141
$imageComment->addText('Hey, Mars does look ');
42-
$imageComment->addText('red', array('color' => 'FF0000'));
42+
$imageComment->addText('red', array('color' => new Hex('FF0000')));
4343
$phpWord->addComment($commentOnImage);
4444
$image = $section->addImage('resources/_mars.jpg');
4545
$image->setCommentRangeStart($commentOnImage);

samples/Sample_40_TemplateSetComplexValue.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
use PhpOffice\PhpWord\Element\Field;
33
use PhpOffice\PhpWord\Element\Table;
44
use PhpOffice\PhpWord\Element\TextRun;
5-
use PhpOffice\PhpWord\SimpleType\TblWidth;
65

76
include_once 'Sample_Header.php';
87

@@ -19,7 +18,7 @@
1918
$inline->addText('by a red italic text', array('italic' => true, 'color' => 'red'));
2019
$templateProcessor->setComplexValue('inline', $inline);
2120

22-
$table = new Table(array('borderSize' => 12, 'borderColor' => 'green', 'width' => 6000, 'unit' => TblWidth::TWIP));
21+
$table = new Table(array('borderSize' => 12, 'borderColor' => 'green', 'width' => Absolute::from('twip', 6000)));
2322
$table->addRow();
2423
$table->addCell(150)->addText('Cell A1');
2524
$table->addCell(150)->addText('Cell A2');

0 commit comments

Comments
 (0)