Created
November 27, 2016 15:42
-
-
Save theredstapler/4700862bafec4ddb1fbd882ebb5801ff to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once 'vendor/autoload.php'; | |
$phpWord = new \PhpOffice\PhpWord\PhpWord(); | |
$section = $phpWord->addSection(); | |
$section->addImage('red_stapler_sign.png',array('width' => 650, 'height' => 365)); | |
$section->addImage('https://images-na.ssl-images-amazon.com/images/I/61NRsJeymIL._SL1500_.jpg',array('width' => 650)); | |
header('Content-Type: application/octet-stream'); | |
header('Content-Disposition: attachment;filename="test.docx"'); | |
$objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'Word2007'); | |
$objWriter->save('php://output'); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment