Saturday 15 September 2012

java - How to change the existing custom properties/properties in .pptx files using Apache POI -


I would like to change the property of programatically .pptx files using apache POI. Itext is used with .docx and .pdf. When it comes to .pptx files, there is no way to retrieve / change the properties of .pptx files in the suggested package XLSF. Instead, there are ways to retrieve any slides, dots, etc. Can anyone help it on ?? Thanks in advance

You want to take a look at this. From there, you will see that there is a method. It gives a return, which allows you to access three different types of properties, which are core, expanded and custom in an OOXML file (e.g., .ppt).

Next, what you have to do, the qualities you want to change are assuming that you wanted to change the title (a key property), then you want to do something like this:

  OPCPackage pkg = OPCPackage.open ("input.pptx"); XSLFSlideShow Slideshow = New XSLFSlideShow (PKG); POIXMLProperties props = slideshow.getProperties (); Coreproperties CP = Props. Courier Properties (); Cp.setTitle ("I changed the title!"); FileOutputStream Out = New FileOutputStream ("output.pptx"); Slideshow.write (outside); Out.close (); Pkg.close ();    

No comments:

Post a Comment