-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Description
I wanted to change the page orientation, and realized that it was impossible to do
public function save($filename = null)
{
$fileHandle = parent::prepareForSave($filename);
// PDF settings
$paperSize = strtoupper('A4');
$orientation = strtoupper('portrait');
// Create PDF
$pdf = new \mpdf();
$pdf->_setPageSize($paperSize, $orientation);
$pdf->addPage($orientation);
// Write document properties
$phpWord = $this->getPhpWord();
$docProps = $phpWord->getDocInfo();
$pdf->setTitle($docProps->getTitle());
$pdf->setAuthor($docProps->getCreator());
$pdf->setSubject($docProps->getSubject());
$pdf->setKeywords($docProps->getKeywords());
$pdf->setCreator($docProps->getCreator());
$pdf->writeHTML($this->getContent());
// Write to file
fwrite($fileHandle, $pdf->output($filename, 'S'));
parent::restoreStateAfterSave($fileHandle);
}
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.