Write Presentation

Hi,


I have tried to create a presentation (PPT) from scratch with Aspose 2.2. I have to set the java option -Djava.awt.headless=true. When the presentation was written to a file, the following exception was thrown.
java.awt.HeadlessException
at sun.awt.HeadlessToolkit.getScreenResolution(Unknown Source)
at com.aspose.slides.TextLayout.measureString(SourceFile:1125)
at com.aspose.slides.TextLayout.layoutText(SourceFile:255)
at com.aspose.slides.TextLayout.(SourceFile:126)
at com.aspose.slides.TextFrame.new(SourceFile:728)
at com.aspose.slides.Shape.char(SourceFile:2150)
at com.aspose.slides.Rectangle.char(SourceFile:205)
at com.aspose.slides.TextFrame.char(SourceFile:801)
at com.aspose.slides.Shape.getHeight(SourceFile:1848)
at com.aspose.slides.Slide.int(SourceFile:1104)
at com.aspose.slides.Presentation.write(SourceFile:619)


I have tried with Aspose for 2.3. It throws the following exception.
java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
at java.util.ArrayList.RangeCheck(Unknown Source)
at java.util.ArrayList.get(Unknown Source)
at com.aspose.slides.Paragraphs.get(SourceFile:44)
at com.aspose.slides.Slide.do(SourceFile:225)
at com.aspose.slides.Presentation.do(SourceFile:1479)
at com.aspose.slides.Presentation.cloneSlide(SourceFile:1626)
at com.aspose.slides.Presentation.addEmptySlide(SourceFile:2452)

I have used the code snippet as below:
Presentation preso = new Presentation();
preso.addEmptySlide();
preso.write(new FileOutputStream(fileName));

I would like to stress that these worked well with Aspose 2.1 and I need to upgrade to latest version for the fixes and features available. If you can provide a fix for the issue in Aspose 2.3 at the earliest, it would be better for us to make an appropriate decision.

Thanks,
Mani.

Hi Manivannan,

I have been able to observe the issue specified by you and it seems to be an inconsistency in Aspose.Slides for Java. However, even after the exception is thrown, the slide is successfully added and presentation can be viewed with no problem. An issue with ID 18501 has already been added in our issue tracking system to resolve the problem. This thread has also been linked with the mentioned issue, so that you may be automatically notified, once the issue is resolved.

We are sorry for your inconvenience,

Hi,


The java.lang.IndexOutOfBoundsException: issue occurs even in the latest aspose slides for java version 2.4.0. Though the slide is created properly, the exception was thrown. Is there any way I can suppress this ? I have tried with the following too, but in vain.

private static org.apache.log4j.Logger asposeLogger = org.apache.log4j.Logger.getRootLogger();
asposeLogger.setLevel(org.apache.log4j.Level.OFF);

Please provide us a solution/workaround for the above issue at the earliest.

Thanks,
Manivannan.

Hi Manivannan,

I would like to share that the issue shared has been resolved. Please use the intermediate release of Aspose.Slides for Java 2.4.2 which is shared in attachment here.

Thanks and Regards,

Hi Mudassir,


I have tried with the patch provided by you. The exception was fixed. But the following methods seems to be missing in it.
Shape.isFlipH(),
Shape.isFlipV(),
Shape.setFlipH(),
Shape.setFlipV()

Can you please clarify if there is any change in the above API ?

Thanks,
Mani.

Hi Mani,

I have worked with the properties shared by you and they seem to work fine using Aspose.Slides for Java 2.4.2. For you kind reference, I have attached the code snippet and generated presentation as well.

//Instantiate a Presentation object that represents a PPT file
Presentation pres = new Presentation();

//Accessing a slide using its slide position
Slide slide = pres.addEmptySlide();

//Adding a Ellipse shape into the slide by defining its X,Y postion, width and height
com.aspose.slides.Shape sh=slide.getShapes().addEllipse(2300,1200,1000,2000);

sh.addTextFrame("Hello World");
// Setting shape property
sh.setFlipHorizontal(true);
sh.setFlipVertical (true);

boolean st1,st2;
st1=sh.isFlipHorizontal();
st2=sh.isFlipVertical ();

//Writing the presentation as a PPT file
pres.write("D:\\modified.ppt");

Thanks and Regards,

Hi Mudassir,


In the intermediate release 2.4.2, I could not set the BulletType and the NumberedBulletStyle. It is taking the default numbered bullet type always. The same was working properly with 2.4.0.
para.setHasBullet(true);
para.setBulletType(BulletType.SYMBOL);
String buChar = new String(Character.toChars(8226));
para.setBulletCharacter(buChar.charAt(0));

para.setHasBullet(true);
para.setBulletType(BulletType.NUMBERED);
para.setNumberedBulletStyle(NumberedBulletStyle.BULLET_ALPHA_UC_PAREN_BOTH);
Please suggest any workaround for the same. Can you please confirm if release 2.4.2 is a stable one ?

Hello Dear,

I have worked with the issue shared by you and have been able to reproduce the issue as specified by you. An issue with ID 23062 has been created in our issue tracking system for issue resolution. Since this is intermediate release, we will try to resolve this issue before the product release.

We are sorry for your inconvenience,

The issues you have found earlier (filed as 23062;18501) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.

Hi Mudassir,


The above issue related to numeric bullet type is not proper with the latest release 2.5.0 also. The bullet type is always like [4. ] Can you please try with the addbullet.zip in the above thread and confirm if it is working in your
environment ?

Thanks,
Mani.
(ZOHO Corporation).

Hi,


Also the following exception was thrown
java.lang.NoSuchMethodError: com.aspose.slides.Shapes.remove(Lcom/aspose/slides/Shape;)V

Can you please confirm the same ?

Thanks,
Mani.

Hi Mani,

I have investigated the observation shared by you and have been able to observe that whenever you set the character of the symbol type bullet, it is getting changed to numbered bullet. I have shared the feedback with issue 23062 for necessary investigation as well. Secondly, I am able to remove the shape and have not encountered exception while removing the shape. I have used your example code to delete the title placeholder shape as well. For your kind reference, I have also attached the modified working code. I will share the feedback with you, once the issue is completely resolved.

Thanks and Regards,

Hi Mudassir,


One more issue regarding the Bullet Type. I have created a slide with setting the Bullet Type as Symbol for the whole placeholder and inserted text in PowerPoint. When I tried to read the bullet type using Aspose Slides for Java 2.5.0 it is returning as BulletType.NUMBERED for both symbol and numbered bullet types.

Since we are facing lot of customer queries regarding this issue, please give high priority to the above bullet number issues and provide us a patch as early as possible. Thanks for your understanding.

Best Regards,
Mani
(ZOHO Corporation).

Hi Mudassir,


The sample files for the above issue is attached herewith.

Hi Mani,

I have already been able to reproduce the issue shared and updated the issues status accordingly. I am awaiting response from our development team and will shared the ETA for the possible fix with you as soon as some information is shared by our development team.

Thanks and Regards,

Hi Mudassir,


Any updates on the above Numeric bullet issue ? It will be better if you provide a complete fix for the numeric bullet type issues. Can you please provide a time frame for the fix, so that we can update our customers ?

Thanks for your understanding,
Mani.
(ZOHO Corp.,)

Hi Mani,

I have confirmed from our development team and like to share that the fix for the issue will be available in the July release of Aspose.Slides for Java. We will share the further information with you as soon as some more information is shared by them.

Thanks and Regards,

Hi Mani,

You will be pleased to know that the issue 23062 related to bullets rendering has been resolved in Aspose.Slides for Java 2.6.0.1. I have attached the mentioned version for your reference. Please share if you still have any issue. I also like to share that following code line that you have used in your shared code snippet is no longer required and has been truncated in new version.

para.setHasBullet(true);

Thanks and Regards,

Hi Mudassir,


Thanks for the update. I have tested with the latest release. The following methods are missing
1) Presentation.getSlideSize() and
2) Slides.size().

Can you please suggest an alternative for them ? Also if you can give a list of the changed APIs’ like the removal of setHasBullet(true), it would be easier for me.

Thanks,
Mani.
(ZOHO Corp).

Hi Mani,

I will discuss with our development team and will share the list of changes that have been made in the API. Since the shared version is only a hotfix and not an official release, so the online documentation will be tailored to cater new changes in API once Aspose.Slides for Java 2.7.0 will be released. The Presentation.getSlideSize() method is there in API. However, Presentation.getSlides().size() has been replaced by Presentation.getSlides().getCount(). Please share, if you encounter any other issue.

pres.getSlideSize();
pres.getSlides ().getCount();

Thanks and Regards,