Lincense

Hi

I've purchased a licence for Slides - but I still have the watermark on all generated presentations.

the code I'm using is:

//Instantiate a Presentation object that represents a PPT file
$pres=&new Java("com.aspose.slides.Presentation");

$fistream=&new Java("java.io.FileInputStream","$javaPath" . "Aspose Slides.lic");
// Create a License object
$license=new Java("com.aspose.slides.License");
//Set the license of Aspose.Slides to avoid the evaluation limitations
$license->setLicense($fistream);

---

Why would the watermark still be present?

Thanks,
Dan

Dear Dan,

It seems, you are getting this problem because you are creating Presentation object before setting the license. You should set the license before doing any operation using Aspose.Slides to avoid evaluation watermarks.

Thanks for the info - I'll try that out.

Thanks,

Dan

I have tried it that way - but watermark is still present? Do we have a working example of activating the license using php anywhere?

Thanks

Dan

Hi Msfaiz

The code now being used is:

$fistream =& new Java("java.io.FileInputStream","$javaPath" . "Aspose Slides.lic");
// Create a License object
$license =& new Java("com.aspose.slides.License");
//Set the license of Aspose.Slides to avoid the evaluation limitations
$license->setLicense($fistream);

//Instantiate a Presentation object that represents a PPT file
$pres =& new Java("com.aspose.slides.Presentation");

Does that look ok to you?.

Thanks,

Dan

Dear Dan,

For working example, please see Aspose.Slides Wiki. It is very useful for new users. There is also one licensing section for setting license in Java and PHP.

Hello Dan,

Next code works fine on my test php server and creates presentation with one empty slide without watermark:

$fistream = new Java(“java.io.FileInputStream”, “C:\Inetpub\wwwroot\Aspose.Slides.lic”);
$license=new Java(“com.aspose.slides.License”);
$license->setLicense($fistream);

$pr = new Java(“com.aspose.slides.Presentation”);

$output_file = new Java(“java.io.File”, “C:\Inetpub\wwwroot\Temp\result.ppt”);
$output_stream = new Java(“java.io.FileOutputStream”, $output_file);
$pr->write($output_stream);
$output_stream->flush();
$output_stream->close();

Please check if you have valid “Aspose.Slides for Java” license and php script doesn’t throw any exceptions.