We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Metacharacter problem

Hi, I have problem metacharacters (slide number). Whet I want to change text of one paragraph, clear portions and add new ones, number is inserted in the middle of my newly inserted text. Have a look at my code snippet:
try {
presentation = new Presentation(inputStream);
} catch (PptException e) {
throw new RuntimeException();
}

Slide slide = presentation.getSlideByPosition(1);

Shapes shapes = slide.getShapes();

Shape shape = shapes.get(1);

TextFrame textFrame = shape.getTextFrame();

Paragraph paragraph = textFrame.getParagraphs().get(2);

Portions portions = paragraph.getPortions();

portions.clear();

portions.add(new Portion(“my text”));

presentation.write(outputStream);

and when you look at newly created presentation you will see text: “my tex1”.

Can you tell me why is this is happening and how can I get around this?

Also can you tell me how can I insert any of metacharacters?

There is an example document in the attachment. I am using java version.

Thanks, Ivica.

Hello Ivica,

Technical team will look into this problem and provide you possible solution if any. Thanks for your patience.

Hello Ivica,

MetaCharacters property is read-only so you can’t change or create new meta characters.
To delete all meta characters you should delete whole shape and create new one.