Hi,
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.
Word to Images
<?php
// starting word
$word = new COM("word.application") or die("ERROR: Unable to instantiate Word");
echo "Loaded Word, version {$word->Version}\
";
//bring it to front
$word->Visible = 1;
//Set $FilePath and $DocFileName
$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();
//closing word
$word->Quit();
//free the object
$word = null;
?>
PPT to Images.
<html>
<head>
<title>ShotDev.Com Tutorial</title>
</head>
<body>
<?
$ppApp = new COM("PowerPoint.Application");
$ppApp->Visible = True;
// $strPath = realpath(basename(getenv($_SERVER["SCRIPT_NAME"]))); // C:/AppServ/www/myphp
$strPath = "C:\\\\";
$ppName = "Presentation.pptx";
$FileName = "MyPP";
//*** Open Document ***//
$ppApp->Presentations->Open(realpath($ppName));
//*** Save Document ***//
$ppApp->ActivePresentation->SaveAs($strPath."/".$FileName,17); //'*** 18=PNG, 19=BMP **'
//$ppApp->ActivePresentation->SaveAs(realpath($FileName),17);
$ppApp->Quit;
$ppApp = null;
?>
PowerPoint Created to Folder <b><?=$FileName?></b>
</body>
</html>
-Thanks