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
The line spacing is 20pt. I found vendor/phpoffice/phpword/src/PhpWord/Style/Paragraph.php:202 it adds the 240 twips that cause the different. But i don't understand why?
<?phprequire__DIR__ . '/vendor/autoload.php';
$phpWord = new \PhpOffice\PhpWord\PhpWord();
$section = $phpWord->addSection();
$section->addText(
'"Learn from yesterday, live for today, hope for tomorrow. '
. 'The important thing is not to stop questioning." '
. '(Albert Einstein)',
[],
[
'spacing' => \PhpOffice\Common\Font::pointSizeToTwips(8),
'spacingLineRule' => \PhpOffice\PhpWord\SimpleType\LineSpacingRule::EXACT
]
);
$writer = IOFactory::createWriter($phpWord, 'Word2007');
Context
PHP version: 7.2.7
PHPWord version: 0.15
The text was updated successfully, but these errors were encountered:
I guess it's because the default line spacing rule is AUTO. When using EXACT or AT_LEAST, those 240 twips (which is the default height of one line) should not be added.
This is:
Expected Behavior
The line spacing should be 8pt
Current Behavior
The line spacing is 20pt. I found vendor/phpoffice/phpword/src/PhpWord/Style/Paragraph.php:202 it adds the 240 twips that cause the different. But i don't understand why?
Workaround
How to Reproduce
Context
The text was updated successfully, but these errors were encountered: