poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yegor Kozlov <yegor.koz...@dinom.ru>
Subject Re: Issue drawing XSLFTable
Date Thu, 04 Oct 2012 11:10:58 GMT
XSLF can render only simple shapes. Rendering of complex objects like
tables and charts is not yet supported.

Yegor

On Tue, Oct 2, 2012 at 5:55 PM, Jamie Johnson <jej2003@gmail.com> wrote:
> I used the tutorial at
> https://svn.apache.org/repos/asf/poi/trunk/src/examples/src/org/apache/poi/xslf/usermodel/Tutorial4.java
> to build a power point file with a table (no change to the source) and
> then tried to draw that as an image using the code below, but I am not
> seeing the table getting drawn to the image, it is simply blank.  Can
> anyone help me understand why this is not working?  Is this a bug or
> am I doing something incorrectly?  Thanks in advance.
>
>         XMLSlideShow ppt = new XMLSlideShow(OPCPackage.open(file));
>
>         Dimension pgsize = ppt.getPageSize();
>
>         // convert each slide into a .svg file
>         XSLFSlide[] slide = ppt.getSlides();
>         for (int i = 0; i < slide.length; i++) {
>
>             String title = slide[i].getTitle();
>             System.out.println("Rendering slide " + (i + 1) + (title
> == null ? "" : ": " + title));
>
>
>                 BufferedImage image = new BufferedImage(pgsize.width,
> pgsize.height, BufferedImage.TYPE_INT_RGB);
>
>             Graphics2D graphics = image.createGraphics();
>             graphics.setPaint(Color.white);
>                         graphics.fill(new Rectangle2D.Float(0, 0, pgsize.width, pgsize.height));
>                         slide[i].draw(graphics);
>                         ImageIO.write(image, "png", new FileOutputStream(name + "-slide-"
+
> (i + 1) + ".png"));
>
>         }
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
>

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


Mime
View raw message