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
$phpWord->addSection(["paperSize" => "Letter", 'marginLeft' => 600, 'marginRight' => 600, 'marginTop' => 600, 'marginBottom' => 600]); should produce a file with Letter-sized paper and "skinny" margins.
Current Behavior
Saving files in Word format has the expected result; however, the paper size and margin settings are ignored when saving in ODT format. The resulting document is A4 sized with 0.98 inch margins (0.79 inch bottom margin).
How to Reproduce
<?phprequire __DIR__ . '/vendor/autoload.php';
$phpWord = new \PhpOffice\PhpWord\PhpWord();
$section = $phpWord->addSection(["paperSize" => "Letter"]);
$section->addText("Hello world");
$objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'ODText');
$objWriter->save('file.odt'); // Will have A4 page size$objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'Word2007');
$objWriter->save('file.docx'); // Will have Letter page size
Context
PHP version: 7.2.10
PHPWord version: 0.14
The text was updated successfully, but these errors were encountered:
This is:
Expected Behavior
$phpWord->addSection(["paperSize" => "Letter", 'marginLeft' => 600, 'marginRight' => 600, 'marginTop' => 600, 'marginBottom' => 600]);
should produce a file with Letter-sized paper and "skinny" margins.Current Behavior
Saving files in Word format has the expected result; however, the paper size and margin settings are ignored when saving in ODT format. The resulting document is A4 sized with 0.98 inch margins (0.79 inch bottom margin).
How to Reproduce
Context
The text was updated successfully, but these errors were encountered: