Drawing a shape on a slide

Warning

To work with graphic objects HSLF uses Java2D classes
that may throw exceptions if graphical environment is not available. In case if graphical environment
is not available, you must tell Java that you are running in headless mode and
set the following system property: java.awt.headless=true
(either via -Djava.awt.headless=true startup parameter or via System.setProperty("java.awt.headless", "true")).

When you add a shape, you usually specify the dimensions of the shape and the position
of the upper left corner of the bounding box for the shape relative to the upper left
corner of the slide. Distances in the drawing layer are measured in points (72 points = 1 inch).

Export PowerPoint slides into java.awt.Graphics2D

HSLF provides a way to export slides into images. You can capture slides into java.awt.Graphics2D object (or any other)
and serialize it into a PNG or JPEG format. Please note, although HSLF attempts to render slides as close to PowerPoint as possible,
the output may look differently from PowerPoint due to the following reasons:

Java2D renders fonts differently vs PowerPoint. There are always some differences in the way the font glyphs are painted

HSLF uses java.awt.font.LineBreakMeasurer to break text into lines. PowerPoint may do it in a different way.

If a font from the presentation is not avaiable, then the JDK default font will be used.

Current Limitations:

Some types of shapes are not yet supported (WordArt, complex auto-shapes)