Bug 54895 - how to encoding ,using xslf2png?
Summary: how to encoding ,using xslf2png?
Status: RESOLVED INVALID
Alias: None
Product: POI
Classification: Unclassified
Component: XSLF (show other bugs)
Version: 3.9-FINAL
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-26 09:39 UTC by Gongle
Modified: 2016-01-24 00:26 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gongle 2013-04-26 09:39:28 UTC
Dear sir!
when are using hslf ppt2png,i can do this code[see code1].how to do it by xslf ppt2png?
Looking forward to your reply at the soonest.
my email: skygongle@gmail.com

code1:   Slide[] slide = ppt.getSlides();
            for (int i = 0; i < slide.length; i++) {
                if ((slidenum != -1) && (slidenum != i + 1))
                    continue;
                // ####支持中文####
                TextRun[] truns = slide[i].getTextRuns();
                String title = slide[i].getTitle();
                for (int k = 0; k < truns.length; k++) {
                    RichTextRun[] rtruns = truns[k].getRichTextRuns();
                    for (int l = 0; l < rtruns.length; l++) {
                        int index = rtruns[l].getFontIndex();
                        String name = rtruns[l].getFontName();
                        rtruns[l].setFontIndex(1);
                        rtruns[l].setFontName("宋体");
                        // System.out.println(rtruns[l].getText());
                    }
                }
Comment 1 Andreas Beeker 2016-01-24 00:26:39 UTC
Well the soonest is already long ago ...
The code to export PPT and PPTX to PNG can be found under [1] - maybe there's a 
problem with chinese font encoding.
Feel free to reopen this bug, but please add an example ppt.

Andi

[1] 
https://svn.apache.org/repos/asf/poi/trunk/src/ooxml/java/org/apache/poi/xslf/util/PPTX2PNG.java