Closed lamkute closed 3 months ago
This should work:
<?php
require_once 'vendor/autoload.php';
$phpword = new \PhpOffice\PhpWord\PhpWord();
$section = $phpword->addSection();
$section->getStyle()
->setPaperSize('Letter')
->setLandscape()
;
$section->addText("Hello World!");
$phpword->save('./letter.docx', 'Word2007');
Support question successfully answered. Sample code works. Issue can be marked as closed.
Hello, im trying to create a document in Letter paper size and Landscape orientation with this code. but it still give A4 size. Can anybody help? Thank you!