-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Description
This is:
- a bug report
- a feature request
- not a usage question (ask them on https://stackoverflow.com/questions/tagged/phpword)
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
'spacing' => \PhpOffice\Common\Font::pointSizeToTwips(8) - 240,
How to Reproduce
<?php
require __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
Metadata
Metadata
Assignees
Labels
No labels