...
Code Block |
---|
ServletContext context = request.getSession().getServletContext(); String path = context.getRealPath(request.getContextPath()); int pos = path.lastIndexOf("\\"); path = path.substring(0, pos); String templatePath = path + "\\" + "template.ppt"; FileInputStream templateFileIS = new FileInputStream(templatePath); |
Once the file has been read into a FileInputStream object, we can create an ASPOSE Presentation object based on that object. Note that the constructor throws a PptException, so we will wrap the rest of the code dealing with the presentation object in a try…catch block. Add the following import statement:
Code Block |
---|
import com.aspose.slides.*; |
Now, create the presentation object using the FileInputStream:
...