_setPageSize($paperSize, $orientation); $pdf->addPage($orientation); // Write document properties $phpWord = $this->getPhpWord(); $docProps = $phpWord->getDocumentProperties(); $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); } }