1

I’m trying to use Aspose.Slides in my GWT project for this I have placed this aspose-slides-18.9-jdk16.jar file under WEB-INF/lib and i tried the below given code but I cannot compile my project and ppt file is not created

Presentation srcPres = new Presentation("F:\\AsposeSlides\\Src1.pptx");
Presentation destPres = new Presentation("F:\\AsposeSlides\\Src2.pptx");
ISlideCollection slds = destPres.getSlides();

slds.insertClone(2, srcPres.getSlides().get_Item(2));

destPres.save("F:\\AsposeSlides\\outputPres.pptx", SaveFormat.Pptx);

Can anyone suggest me an idea to resolve this issue ?

US-1234
  • 1,519
  • 4
  • 24
  • 61

1 Answers1

2

You can't use java libraries in the client side of a GWT project. You can only use GWT libraries in the client side of a GWT project.

I can see this library is trying to save a file to disk, this can never work in GWT client side.

The solution is to use this code in a servlet (in the server directory of your project structure). Then call that servlet from the client side, and stream back the file contents from the servlet to the client.

Knarf
  • 2,077
  • 1
  • 16
  • 24