Aspose.Slides for Java feature/help request

Hi,

We are using Aspose.Slides for Java. We have implemented 80% of the
features we needed for our application. I have listed some of the features
that are crucial for us but may miss in aspose slides or we may not know
the way to implement it

01) Add more than one Slide Masters to presentation
02) Add Title Master(s) to presentation
03) Modify Header/Footer in Master slides
04) Add more than one custom animation for shapes
05) Add OLE objects (not from file)
06) Add Animation Start option (WithPrevious,AfterPrevious)
07) Add Group Shape
08) Add Sound for Slide Transition
09) Apply Animation Schemes
10) embed Metafile handling into aspose slides itself

so if the features are missing in aspose slides i hope aspose will consider to
implement that for next release or if we didnt know the way to implement it
any help is appreciated



In default MainMaster

1) mainmaster.getPlaceholders().get(index);
2) mainmaster.getShapes().get(index).getPlaceholder();

returns Null ?

(index is less than count of placeholders OR shapes in mainmaster)


Dear nuller,

In order to add title master and slide master, you should clone a slide from template presentation and later remove that slide. Cloning a slide also clones its title and slide masters, and if you will remove the slide, its masters will remain

Please see C# code for doing so from this link. You have to translate it to JAVA, which is simple. Just know C# properties are referred by get/set methods in the JAVA.

Each Slide or MainMaster objects have getHeaderFooter() method, which you can use to manipulate header and footers of slide or its master.

To get the reference to master slides or master of some slide, you can either iterate Presentation.getMasters() collection (array) or you can use Presentation.getSlideById() method by passing master id of slide via Slide.getMasterId() methods.

You can add OLE object from stream e.g BufferedInputStream etc

You can insert animations and transitions using Slide.getSlideShowTransition() and Shape.getAnimationSettings() methods.

Please provide me some sample ppt to show me the type of animations you want. Currently, Aspose.Slides support those of animations that are supported by MS-PowerPoint 2000, later animations are not supported yet.

You cannot add group shapes yet, but this feature will be implemented after two-three months.

Please elaborate point number 10.

nuller:
In default MainMaster

1) mainmaster.getPlaceholders().get(index);
2) mainmaster.getShapes().get(index).getPlaceholder();

returns Null ?

(index is less than count of placeholders OR shapes in mainmaster)




thanks msfaiz, i am wishing to know the answer for the above question as well

msfaiz, thanks for the reply

msfaiz:

In order to add title master and slide master, you should clone a slide from template presentation and later remove that slide. Cloning a slide also clones its title and slide masters, and if you will remove the slide, its masters will remain

Please see C# code for doing so from this link. You have to translate it to JAVA, which is simple. Just know C# properties are referred by get/set methods in the JAVA.

Free Support Forum - aspose.com

got it

msfaiz:

Each Slide or MainMaster objects have getHeaderFooter() method, which you can use to manipulate header and footers of slide or its master.

any setXXX() method of HeaderFooter in Mainmaster throws exception.

msfaiz:

You can add OLE object from stream e.g BufferedInputStream etc

thanks

msfaiz:

You can insert animations and transitions using Slide.getSlideShowTransition() and Shape.getAnimationSettings() methods.

Please provide me some sample ppt to show me the type of animations you want. Currently, Aspose.Slides support those of animations that are supported by MS-PowerPoint 2000, later animations are not supported yet.

query 04 : i am looking for to add more than one animation for shape

shape.setEntryEffect() doesnt allow us to add animtion to some animation array or like that for a single shape that will play one by one based on animation order of that shape when viewing the slideshow

query 06 : setAdvanceMode of AnimationSettings has only two option advance_on_click, advace_on_time but Withprevious and AfterPrevious are missing

query 08 : there is no method like setSoundFile() in SlideShowTransition

query 09: Setting animation using animation schemes will apply animation to all the shapes in the slide

i hope these points makes my questions more clear

msfaiz:

You cannot add group shapes yet, but this feature will be implemented after two-three months.

thanks for the considering group shape for future release

msfaiz:

Please elaborate point number 10.

Leave that for atleast now i will come back to that later

Dear nuller,

For null question, try this code

Shape shp=mainmaster.getShapes().get(index);

if(shp.isTextHolder()==true)

{

TextFrame tf=shp.getTextFrame();

}

To set footer text, use this code

TextFrame tf=mainmaster.getShapes().get(3).getTextFrame();

Portion port=tf.getParagraphs().get(0).getPortions().get(0);

Portion newPort=new Portion(port);

tf.getParagraphs().get(0).getPortions().add(newPort);

newPort.setText("footer text");

For animations, please see these animation features are available in MS-PowerPoint 2000 animations.

thanks faiz

msfaiz:




TextFrame tf=mainmaster.getShapes().get(3).getTextFrame();



the code line uses “3” in "mainmaster.getShapes().get(3).getTextFrame()"

is there any way to find a placeholder using PlaceHolderType like MASTER_BODY
and get its textframe

msfaiz:


For animations, please see these animation features are available in MS-PowerPoint 2000 animations.



I dont have Office 2000 but i do have Office XP so i dont know Office 2000 has “Start” option for shape animation or not



For normal slides, you can get it via Placeholder.getPlaceholderType()

However, for master slides, you will have to get them via textframe and check what the text contains e.g

"Click to edit Master title style" means title placeholder

"Click to edit Master text styles\rSecond level\rThird level\rFourth level\rFifth level" means subtitle placeholder

You can also set the alternative text of these placeholders on master slides manually and then access them in your code using

Slide.findShape() or MainMaster.findShape() method.

Can you please attach some ppt with all these animation features, so I could check them on MS-PowerPoint 2000?

thanks faiz,

I have used findShapes() and it works.
For animation, I hope aspose will add more animation features from new Office Version like XP.

I have cloned a title slide from aother presentation
that cloned title master and slide master as well.

If getMasterId() of the new cloned slide returns Slide Master id
How do I get Id of the Title Master or vice versa?

The following checks whether master of the slide is Slide Master or Title Master.

Slide Master is always the instance of MainMaster class.

While, Title Master is just an instance of Slide class.

MainMaster slideMaster=null;

Slide titleMaster=pres.getSlideById(sld.getMasterId());

if(titleMaster instanceof MainMaster)

{

slideMaster=(MainMaster)titleMaster;

}

thanks faiz

Shape s = cloned_slide_master.findShape("BulletBody");

TextFrame t = s.getTextframe();

t.setText("Sample Text");

After writing this sample text the ppt cant be open
powerpoint shows a error message as some part of the file is missing

Hi,

I have cloned a title slide from another presentation
the master of the slide is also cloned

It has a placeholder with alternatetext "Slide Title"
I can able to findShape() it but if i get it’s textframe
and write some text to it the text wont come in
when i open the slide in powerpoint

if i add the title slide using addTitleSlide() of Presentation
then i can able to get the “Slide Title” placeholder
and the text written to it using Textframe comes in powerpoint

i need to add my own title slide from my own template
and also have the text that i written to the placeholders
us well

how do i go about that ?

thanks in advance

I have used Powerpoint XP to create that template ppt, is that a problem ?

I think in a summary if i cloned a slide OR master
the textbox(s) on that slide/master makes problem
if we write text to it …

I hope this post may help you…


Dear nuller,

Cloning any slide which follows TITLE MASTER will also copy the SLIDE MASTER besides TITLE MASTER.

Since your text is present on TITLE MASTER, so it will appear only for those slides which follow TITLE MASTER in other words for title slides. For example, the one you added with Presentation.addTitleSlide.

So, it is a correct behavior.

Editing slides in PP 2007 converts the textholders (a kind of placeholder which contains text) into textframes.

https://forum.aspose.com/t/103860

msfaiz:


Cloning any slide which follows TITLE MASTER will also copy the SLIDE MASTER besides TITLE MASTER.

Since your text is present on TITLE MASTER, so it will appear only for those slides which follow TITLE MASTER in other words for title slides. For example, the one you added with Presentation.addTitleSlide.

So, it is a correct behavior.



thanks faiz, if i clone the "title slide" (slide not master) from my own template
both masters(slide and title) are also cloned automatically
the title slide that i cloned has a placeholder (it has two for title and subtitle)
if i add any text to the any of the placeholder using textframe
and save the ppt
powerpoint doesnt show the text which i written to it
it shows text like "click here to add title"

i have attached the templatefile that used to clone from.

msfaiz:

Editing slides in PP 2007 converts the textholders (a kind of placeholder which contains text) into textframes.

https://forum.aspose.com/t/103860



thanks for the information but is this associated with my problem ?


Placeholders on master slides just tell the formatting and style of text, they are not meant to show text on the normal slides that follow them. If you want some text on the master slide, to appear on normal slide, just add a text frame, like I have added in the attached ppt.

faiz, i am not trying to add text to master
i am adding text to title slide (slide not master)
(checkout my previous post)

PS:
(if my posts are not clear please let me know
i will try to make it more clear as possible
- English is not my first language)


Sorry for the confusion, I finally got your problem. The problem is because Slide Title placeholder is empty with no character/text. But if you add a single character inside it and then clone and try to set its text, no exception will occur.

To illustrate my point, I have attached the code, template presentation and the target presentation generated by the following code.

String strFile="c:\\master_template2.ppt";

Presentation templatePres=new Presentation(new FileInputStream(new File(strFile)));

Presentation targetPres=new Presentation();

Slide sld=templatePres.cloneSlide(templatePres.getSlideByPosition(1), 1, targetPres, new TreeMap());

Shape shp=sld.findShape("Slide Title");

TextHolder thld=(TextHolder)shp.getPlaceholder();

thld.getParagraphs().get(0).getPortions().get(0).setText("Some text set by me.");

targetPres.write(new FileOutputStream(new File("c:\\targetPres.ppt")));