I want to convert word documents into images. Each page in word document will be converted into images. I found following example and it converts ppt file into image. I found word to image convertor script in php but it is not working , I am getting no output after executing page. I also tried phpword to convert word file to pdf and then get images by using imagick but in the phpword i didn't get images(inside word file) data. i get only text in the coverted pdf file. I tried so many ways but didn't get any solution. Anyone can help me to found any way or solution?
$word = new COM("word.application") or die("ERROR: Unable to instantiate Word");
echo "Loaded Word, version {$word->Version}";
$word->Visible = 1;
$FilePath = "C:\\\\";
$DocFilename = "Sample.docx";
$stat = $word->Documents->Open(realpath("$DocFilename")) or die ("ERROR: Could not open Word Doc");
$word->Documents[1]->SaveAs("$FilePath", 17);
$word->Documents[1]->Close();
Description: The file appears to be corrupted. in D:\wamp64\www\Projects\sbaski.com\php_ppt_to_mail\php_ppt_to_mail.php on line 14 ( ! ) com_exception: Source: Microsoft Word
Description: The file appears to be corrupted. in D:\wamp64\www\Projects\sbaski.com\php_ppt_to_mail\php_ppt_to_mail.php on line 14 – Vikas Rathor Feb 06 '20 at 12:58