It looks like your PHP environment couldn’t find JAI libraries. For PHP, it’s better to put all jar files to %JRE%\lib\ext</b> folder. There should be 5 JAI jars, Aspose.Slides and optionally Aspose.Metafiles:
Yeah, I’m using your picture frame tutorial with the following code:
//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”);
Code looks correct so there shouldn’t be any problems. You can try to experiment with Java at first and after that move code to PHP. May be something wrong with ppt file writing? Could you post whole code please.
//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”);
//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”);
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.