Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- error_reporting (E_ALL | E_STRICT);
- @ini_set ('display_errors', 'on');
- require_once '../../../../vendor/autoload.php';
- $my_content = $_POST['html_content'];
- $phpWord = new PhpOfficePhpWordPhpWord();
- $section = $phpWord->addSection();
- PhpOfficePhpWordSharedHtml::addHtml($section, $my_content);
- header('Content-Type: application/octet-stream');
- header('Content-Disposition: attachement;filename="teste.docx"');
- $objWriter = PhpOfficePhpWordIOFactory::createWriter($phpWord, 'Word2007');
- $objWriter->save('php://output');
- ?>
Add Comment
Please, Sign In to add comment