Hi,
I’ve created a portion with some Chinese text and set it’s Asian font to “SimSun” and Language ID to “zh”. When I save it as .pptx and open it in PowerPoint, I noticed the Language ID has been correctly set to Chinese (PRC). But for the .ppt file, it has been set to “English (United States)”.
Here’s the code I use:
String path = “Test.ppt”;
Presentation presentation = new Presentation(path);
ISlide slide = presentation.getSlides().get_Item(0);
IAutoShape shape = (IAutoShape) slide.getShapes().get_Item(0);
IParagraph paragraph = shape.getTextFrame().getParagraphs().get_Item(0);
IPortionCollection portions = paragraph.getPortions();
portions.clear();
IPortion portion = new Portion(“末動的 國推動”);
IPortionFormat portionFormat = portion.getPortionFormat();
portionFormat.setEastAsianFont(new FontData(“SimSun”));
portionFormat.setLanguageId(“zh”);
portions.add(portion);
presentation.save(“Test-zh.ppt”, SaveFormat.Ppt);
presentation.save(“Test-zh.pptx”, SaveFormat.Pptx);
Can you check this?
Thanks,
Zeljko