Free Support Forum - aspose.com

Portion font format

Hi, can you please look at this code snippet:
String path = “test/fonts.ppt”;

InputStream inputStream = getClass().getClassLoader().getResourceAsStream(path);

Presentation presentation;

try {
presentation = new Presentation(inputStream);
} catch (PptException e) {
throw new RuntimeException(e);
}

Slides slides = presentation.getSlides();

Slide slide = slides.get(0);

Placeholders placeholders = slide.getPlaceholders();

TextHolder textHolder = null;

for(int i = 0; i < placeholders.size(); i++) {
Placeholder placeholder = placeholders.get(i);

if(placeholder instanceof TextHolder) {
textHolder = (TextHolder) placeholder;

break;
}
}

Paragraphs paragraphs = textHolder.getParagraphs();

Paragraph paragraph = paragraphs.get(0);

Portions portions = paragraph.getPortions();

Portion portion;

for(int i = 0; i < portions.size(); i++) {
portion = portions.get(i);
}

portions.clear();

portion = new Portion();

try {
portion.setText(“New Text For Portion”);
} catch (PptEditException e) {
e.printStackTrace();
}

portion.setFontItalic(true);

try {
portions.add(portion);
} catch (PptEditException e) {
e.printStackTrace();
}

try {
presentation.write(new FileOutputStream(new File(“d:/font.ppt”)));
} catch (PptWriteException e) {
e.printStackTrace();
} catch (FileNotFoundException e) {
e.printStackTrace();
}

Problem is that in the output document there is no portion with italic text, there is test document in the attachment.

Thanks, Ivica.

Dear Ivica,

This is because of master styles, since the title placeholder is already Italic, you don't need to set it again, so delete this statement from your code.

portion.setFontItalic(true);

Since the master style is already Italic, when you set it italic again, it turns into non-italic, however, I will confirm it from technical team and let you know.

Ok, but I need to set font styles independently of master styles, is there any whay to do this?

Thanks, Ivica.

Dear ivica,

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Actually, it is a bug and I have reported it for a fix. You should be able to override the master styles.

Hi, can you tell me what is status on this problem. Can you send me bug fix or something?



Thanks, Ivica

Hi, I have just downladed 1.8.4.0 hot fix, and it seems that neither there this problem is not solved, can you just tell me when can I espect some fix for this.

Thanks a lot.

Ivica.

No, it is not yet fixed. Are you getting this problem with other presentations too? If yes, then please provide them too.

Hi, I did not manage to reply earlier, here is two more file with this problem.

Thanks, Ivica.

Hi, can you tell me current status of this issue?
We are waiting on the response already for the past several months. It is getting pretty critical on our end to get the solution.

Thanks, Ivica.

Hello Ivica,

It was fixed in .Net version long time ago. Unfortunately we couldn’t publish new Java version yet.
It will be available on this weekend.

Hi, any news, I cannot see any new fixes for aspose.slides for java.

Thanks, Ivica.

Hello Ivica,

Sorry, there is short delay. We found critical problem which should be fixed asap.
Most probably new version will be available tomorrow.

Hello,

Everything is ready and we are preparing new release.
Please check downloads in a few hours.
Thank you for the patience.

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


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