This code creates a slide with a header, image, and footer on a web page
that can then be downloaded and displayed in PowerPoint.  When adding a
header to a new portrait-oriented slide, the text box is not able to be set
any larger than half the width of that slide.  When width is set any larger
than about 500, the size remains the same.

I am using poi package version 3.8, but I had the same result in
3.10-FINAL.  I am viewing this slide in PowerPoint for Mac 2011 version
14.3.9.

--------------------------------------------------------------------------
//create new slide

(where TEXT_MARGIN = 20 and HEADER_HEIGHT = 30 and
presentationDimension.width = 1294)

            Slide slide = ppt.createSlide();

            if (StringUtils.isNotEmpty(headerText)) {

                int headerFontSize = getHeaderFontSize(headerText);

                //make header

                TextBox header = new TextBox();

                header.setText(headerText);

                //left align

                header.setHorizontalAlignment(TextShape.AlignLeft);

                header.setAnchor(new java.awt.Rectangle(TEXT_MARGIN,
TEXT_MARGIN, presentationDimension.width - TEXT_MARGIN * 2, HEADER_HEIGHT));

                // set the header font size:

                RichTextRun rt = header.getTextRun().getRichTextRuns()[0];

                rt.setFontSize(headerFontSize);

                slide.addShape(header);
            }

When I remove all of the formatting code and simply place the same block of
text in a text box and try to render the slide, I have the same issue.

Is this possibly some sort of problem that PowerPoint itself is having when
rendering old ppt slides in Office 2011?

Thanks,
-Melanie

Reply via email to