https://issues.apache.org/bugzilla/show_bug.cgi?id=55391

            Bug ID: 55391
           Summary: Text Auto fit function in XSLF POI not working
           Product: POI
           Version: 3.9
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSLF
          Assignee: [email protected]
          Reporter: [email protected]

I was asked to raise this as a bug:
http://article.gmane.org/gmane.comp.jakarta.poi.user/19987

Issues with the implementation of the text auto fit function
available in POI. I have a code snipplet here, where I want that the
overflow text ( greater than the size of the anchor ) gets resized to a
smaller font and fit within the TextBox bounds. However, it doesnt do that.
BUT if you manually try to resize it, meaning if you try to increase or
decrease the size of the textbox by even a very small amount, the text gets
reduced to the size of the font that it should be, to fit within that text
box.



public static void main (String[] args) throws FileNotFoundException,
IOException {

    XMLSlideShow ppt = new XMLSlideShow();

    XSLFSlide slide1 = ppt.createSlide();
    XSLFTextBox shape1 = slide1.createTextBox();
    Rectangle anchor = new Rectangle(170, 100, 300, 100);
    shape1.setAnchor(anchor);

    XSLFTextParagraph p1 = shape1.addNewTextParagraph();
    XSLFTextRun r1 = p1.addNewTextRun();
    r1.setText("The Apache POI Project's mission is to create and maintain
Java APIs for manipulating various file formats based upon the Office Open
XML standards (OOXML) and Microsoft's OLE 2 Compound Document format
(OLE2). In short, you can read and write MS Excel files using Java. In
addition, you can read and write MS Word and MS PowerPoint files using
Java. Apache POI is your Java Excel solution (for Excel 97-2008). We have a
complete API for porting other OOXML and OLE2 formats and welcome others to
participate.OLE2 files include most Microsoft Office files such as XLS,
DOC, and PPT as well as MFC serialization API based file formats. Office
OpenXML Format is the new standards based XML file format found in
Microsoft Office 2007 and 2008. This includes XLSX, DOCX and PPTX.
Microsoft opened the specifications to this format in October 2007. We
would welcome contributions.");

    shape1.setTextAutofit(TextAutofit.NORMAL);

    FileOutputStream out = new FileOutputStream("text.pptx");
    ppt.write(out);
    out.close();
    }

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to