Sure. Here you go. Basically if we can get this working my company will move ahead with purchasing a version of Slides…
require_once(“java/Java.inc”);
//require_once(“AsposeSlides.php”);
if (DIRECTORY_SEPARATOR==’/’)
$absolute_path = dirname(FILE).’/’;
else
$absolute_path = str_replace(’\’, ‘/’, dirname(FILE)).’/’;
//Using aspose.slides.jar file so that the classes inside the jar file
//can be used
java_require(“aspose.slides.jar”);
//java_require(“jai_core.jar”);
//java_require(“jai_codec.jar”);
//java_require(“mlibwrapper_jai.jar”);
//java_require(“clibwrapper_jiio.jar”);
// java_require(“jai_imageio.jar”);
//Creating a file input stream to read the PPT file
$fistream=new Java(“java.io.FileInputStream”, $absolute_path.“mycampaign.ppt”);
//Instantiate a Presentation object that represents a PPT file
$pres=new Java(“com.aspose.slides.Presentation”,$fistream);
//Accessing a slide using its slide position
$slide=$pres->getSlideByPosition(1);
//Creating a temporary stream to hold the image file
$fistream2=new Java(“java.io.FileInputStream”,$absolute_path.“images/00000005.jpg”);
//Converting the image stream to a simple input stream
$iStream=new Java(“java.io.BufferedInputStream”,$fistream2);
//Creating a picture object
$pic = new Java(“com.aspose.slides.Picture”,$pres,$iStream);
//Adding the picture object to pictures collection of the presentation
//After the picture object is added, the picture is given a uniqe picture Id
$picId = $pres->getPictures()->add($pic);
//Creating JAI class of Java Advanced Imaging API
$JAI=new JavaClass(“javax.media.jai.JAI”);
//Using the Java Advanced Imaging Component
$img = $JAI->create(“fileload”,$absolute_path.“images/00000005.jpg”);
//Calculating picture width and height
$pictureWidth = $img->getWidth() * 4;
$pictureHeight = $img->getHeight() * 4;
echo $img->getWidth();
//Calculating slide width and height
$slideWidth = $slide->getBackground()->getWidth();
$slideHeight = $slide->getBackground()->getHeight();
//Calculating the width and height of picture frame
$pictureFrameWidth = ($slideWidth/2 - $pictureWidth/2);
$pictureFrameHeight = ($slideHeight/2 - $pictureHeight/2);
echo $pictureFrameWidth;
//Adding picture frame to the slide
$slide->getShapes()->addPictureFrame($picId, $pictureFrameWidth, $pictureFrameHeight, $pictureWidth, $pictureHeight);
// replace id
$myshape=$slide->findShape(“PanelID”);
$myshape->getTextFrame()->getParagraphs()->get(0)->getPortions()->get(0)->setText(“987654”);
// replace title
$myshape=$slide->findShape(“PanelTitle”);
$myshape->getTextFrame()->getParagraphs()->get(0)->getPortions()->get(0)->setText(“Parnell Rise | Parnell | Auckland”);
// replace desc
$myshape=$slide->findShape(“PanelDesc”);
$myshape->getTextFrame()->getParagraphs()->get(0)->getPortions()->get(0)->setText(“Lorem ipsum.”);
// replace stats
$myshape=$slide->findShape(“PanelStats”);
$myshape->getTextFrame()->getParagraphs()->get(0)->getPortions()->get(0)->setText(“PanelType”);
$myshape->getTextFrame()->getParagraphs()->get(1)->getPortions()->get(0)->setText(“PanelTraffic”);
$myshape->getTextFrame()->getParagraphs()->get(2)->getPortions()->get(0)->setText(“Illuminated”);
$myshape->getTextFrame()->getParagraphs()->get(3)->getPortions()->get(0)->setText(“Dimensions”);
$myshape->getTextFrame()->getParagraphs()->get(4)->getPortions()->get(0)->setText(“Direction”);
//Creating a file output stream to write the output file
$fostream=new Java(“java.io.FileOutputStream”,$absolute_path.“modified.ppt”);
//Writing the presentation as a PPT file
$pres->write($fostream);
echo “Presentation Created Successfully.”;
$fistream->close();
$fistream2->close();
$iStream->close();
$fostream->close();