poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 52244] New: The method getFontName() & getFontSize() returns error value.
Date Fri, 25 Nov 2011 10:03:59 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=52244

             Bug #: 52244
           Summary: The method getFontName() & getFontSize() returns error
                    value.
           Product: POI
           Version: 3.8-dev
          Platform: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HSLF
        AssignedTo: dev@poi.apache.org
        ReportedBy: andy20050125@163.com
    Classification: Unclassified


Created attachment 27984
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=27984
Attachment is the template file.

The template font is Arial, but the program says it's Times New Roman.


        String url = "D:\\Temp\\template.ppt";

        org.apache.poi.hslf.HSLFSlideShow hslf = null;
        try {
            hslf = new HSLFSlideShow(url);
        } catch (IOException e) {
            e.printStackTrace();
        }
        org.apache.poi.hslf.usermodel.SlideShow slidePPT = new
org.apache.poi.hslf.usermodel.SlideShow(hslf);
        org.apache.poi.hslf.model.Slide[] slides = slidePPT.getSlides();

        for(org.apache.poi.hslf.model.Slide slide: slides){
            TextRun[] textRuns = slide.getTextRuns();
            for(TextRun rt : textRuns){
                RichTextRun[] rtrs = rt.getRichTextRuns();
                for(RichTextRun rtr : rtrs){
                    System.out.println("Text: " + rtr.getText());
                    System.out.println("Color: " + rtr.getFontColor());
                    System.out.println("FontName: " + rtr.getFontName());
                    System.out.println("FontSize: " + rtr.getFontSize());
                    System.out.println("Alignment: " + rtr.getAlignment());
                    System.out.println();
                }
            }
        }

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Mime
View raw message