Hi,
the following code produces the attached ppt.
But the from center option gives different visual in Powerpoint
Note : I am using 1.7.4 java slides.try
{
//Instantiate a Presentation object that represents a PPT file
Presentation pres = new Presentation(new FileInputStream(new File(“source.ppt”)));
//Accessing a slide using its slide position
Slide slide = pres.getSlideByPosition(1);
//Disable following master background settings
slide.setFollowMasterBackground(false);
//Setting the fill type of the background to gradient
slide.getBackground().getFillFormat().setType(FillType.GRADIENT);
//Setting the type of the gradient color
slide.getBackground().getFillFormat().setGradientColorType(GradientColorType.ONE_COLOR);
//Setting the gradient style
slide.getBackground().getFillFormat().setGradientStyle(GradientStyle.FROM_CENTER);
//Setting the background color to blue
slide.getBackground().getFillFormat().setForeColor(java.awt.Color.BLUE);
//Setting the degree of the gradient
// slide.getBackground().getFillFormat().setGradientDegree(18);
//Writing the presentation as a PPT file
pres.write(new FileOutputStream(new File(“modified.ppt”)));
}
catch(Exception ex)
{
System.out.println(ex.toString());
}
Hi,
I have opened the modified.ppt in openoffice impress it brings the correct visual so it seems to be a bug in PowerPoint XP not in aspose.slides.
Anyway thanks
This is your presentation looks like when I open it in MS-PowerPoint 2002.
When we apply from center in Powerpoint 97
When I open the file in Openoffice Impress 2.3