You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Bruce Altner <br...@nasa.gov> on 2007/06/16 01:46:57 UTC

Capture and entire powerpoint slide as a graphic

Greetings:

We have many use cases involving powerpoint in which the poi libraries will
play a pivotal role. I have spent a few weeks exploring the easier things
you can do with the HSLF classes, including extracting images, making new
presentations, etc. But here is one that has stumped me, being a newbie with
the API: extracting the entire contents of a specific slide within a
presentation and  turning it into a graphic. The end use of this is
presentation in a portal. The slides may contain text and graphics.

The Slide class lets you get Slide Atoms and so forth, but I'm unclear as to
how to reassemble these into an an image of the original slide. Is this even
possible?

I was pretty dicouraged until I saw that PresentationPro can convert an
entire ppt file into a flash movie (see April 2007 archives of this list).
If you can do that you should be able to save a single slide as a png file,
right?

Thanks in advance for helpful hints!

Bruce Altner


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


Re: Capture and entire powerpoint slide as a graphic

Posted by David Fisher <df...@jmlafferty.com>.
Perhaps. I do know that the Escher Objects that Yegor creates for me  
are of much higher quality and precision than any of our EMF and WMF  
experiments. Of course that could be because we had POI as a starting  
point and did not end up incorporating anything else. Text Layout was  
important and quite a struggle. (We have contributed results here.)

Since we are rendering a PS file (limited subset/ our own renderer)  
into Escher via java2d. (I also don't know if we contributed this  
code, but we could in the near future.)

I wonder if the renderers you mentioned create a WMF or EMF with the  
precision we can with Escher. Doing so might solve some other  
integration issues for us.

Thanks,
Dave

> On Wednesday 20 June 2007 10:03:58 David Fisher wrote:
>> Hi Daniel,
>>
>> How would you compare the WMF and EMF formats to Escher Drawing layer
>> objects included in an XLS or PPT?
>>
>> This is a question about the format.
>
> It would be yet one more renderer to write.  WMF and EMF are  
> effectively
> serialisations of the actual system calls used to render the  
> picture.  I get
> the impression that Escher is more of a proper vector graphics  
> format.  I
> don't know if that makes it easier or harder to implement a renderer.
>
> All these things appear in a PPT file though.  I received a PPT  
> file recently
> which had a mix of Escher drawing plus a big EMF file centred in  
> it.  It
> would unfortunately all need to be handled in order to render the  
> whole
> thing, but I know people have already managed to do it. :-)
>
> EMF+ is another hurdle since they don't even document that one yet.
>
> Daniel
>
> -- 
> Daniel Noll
> Nuix Pty Ltd
> Suite 79, 89 Jones St, Ultimo NSW 2007, Australia    Ph: +61 2 9280  
> 0699
> Web: http://nuix.com/                               Fax: +61 2 9212  
> 6902
>
> ---------------------------------------------------------------------
> 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


Re: Capture and entire powerpoint slide as a graphic

Posted by Daniel Noll <da...@nuix.com>.
On Wednesday 20 June 2007 10:03:58 David Fisher wrote:
> Hi Daniel,
>
> How would you compare the WMF and EMF formats to Escher Drawing layer
> objects included in an XLS or PPT?
>
> This is a question about the format.

It would be yet one more renderer to write.  WMF and EMF are effectively 
serialisations of the actual system calls used to render the picture.  I get 
the impression that Escher is more of a proper vector graphics format.  I 
don't know if that makes it easier or harder to implement a renderer.

All these things appear in a PPT file though.  I received a PPT file recently 
which had a mix of Escher drawing plus a big EMF file centred in it.  It 
would unfortunately all need to be handled in order to render the whole 
thing, but I know people have already managed to do it. :-)

EMF+ is another hurdle since they don't even document that one yet.

Daniel

-- 
Daniel Noll
Nuix Pty Ltd
Suite 79, 89 Jones St, Ultimo NSW 2007, Australia    Ph: +61 2 9280 0699
Web: http://nuix.com/                               Fax: +61 2 9212 6902

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


Re: Capture and entire powerpoint slide as a graphic

Posted by David Fisher <df...@jmlafferty.com>.
Hi Daniel,

How would you compare the WMF and EMF formats to Escher Drawing layer  
objects included in an XLS or PPT?

This is a question about the format.

>> Java2D can read only JPEG and PNG, that is we parse a ppt file,  
>> read a
>> JPEG and pass it to the target Java2D object. But how to convert WMF
>> or PICT into java.awt.Image?
>
> PICT I'm not sure about -- if there is a project out there which  
> can render
> it, I'd love to know.

Apple supports PICT with QuickTime. And they have a Java API. So,  
it's a solution for MacOSX or Windows, but not necessarily for Linux.

>
> Batik has a renderer for WMF, so that isn't an issue.
>
> The FreeHEP project has a renderer for EMF, so that isn't an issue  
> either.

A renderer is not the same as an interpreter. Knowing Yegor, I am  
sure he was describing the problem of interpreting any "random" valid  
PPT file including interpreting any included graphic object. While  
you are describing the solution of rendering a file. A point to keep  
in mind, renderers may be limited to producing their own particular  
flavor of a validly formatted file. They won't necessarily implement  
every feature of the file format. Keep this in mind when using POI.

I think that you can categorize POI users along two axes:

(1) Interpreter and/or Renderer.
(2) File Format. HSSF (XLS), HSLF (PPT), HWPF (DOC) and the  
beginnings of HDGF (VSD/Visio) format investigation just today by Nick.

POI seems to grow as developers appear to fill out the features in  
these "cells" to the extent of their time, interest and ability.

Regards,
Dave Fisher




>
> Daniel
>
>
> -- 
> Daniel Noll
> Nuix Pty Ltd
> Suite 79, 89 Jones St, Ultimo NSW 2007, Australia    Ph: +61 2 9280  
> 0699
> Web: http://nuix.com/                               Fax: +61 2 9212  
> 6902
>
> ---------------------------------------------------------------------
> 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


Re: Capture and entire powerpoint slide as a graphic

Posted by Daniel Noll <da...@nuix.com>.
On Wednesday 20 June 2007 03:33:51 Yegor Kozlov wrote:
> Java2D can read only JPEG and PNG, that is we parse a ppt file, read a
> JPEG and pass it to the target Java2D object. But how to convert WMF
> or PICT into java.awt.Image?

PICT I'm not sure about -- if there is a project out there which can render 
it, I'd love to know.

Batik has a renderer for WMF, so that isn't an issue.

The FreeHEP project has a renderer for EMF, so that isn't an issue either.

Daniel


-- 
Daniel Noll
Nuix Pty Ltd
Suite 79, 89 Jones St, Ultimo NSW 2007, Australia    Ph: +61 2 9280 0699
Web: http://nuix.com/                               Fax: +61 2 9212 6902

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


Re[2]: Capture and entire powerpoint slide as a graphic

Posted by Yegor Kozlov <ye...@dinom.ru>.
> On Tuesday 19 June 2007 00:55:21 Yegor Kozlov wrote:
>> HSLF can't convert ppt slides into images and I don't think we will
>> ever support it. Even if we will, the ppt2png renderer will be pretty
>> limited. Only simple shapes such as text, images, lines and rectangles
>> can  be  rendered well. Also, in Java we can render only JPEG and PNG.
>> Other picture formats such as PICT, WMF, BMP, etc. may require third-party
>> libraries.

> Well, to be more precise the renderer would render to Java2D, and what the
> caller happens to pass in as a Graphics2D object is the caller's choice.  The
> renderer wouldn't even have to have any explicit code for JPEG nor PNG.

The target is Java2D. I'm absolutely agree.

A potential problem is how to convert pictures contained in a ppt into
java.awt objects.

Java2D can read only JPEG and PNG, that is we parse a ppt file, read a
JPEG and pass it to the target Java2D object. But how to convert WMF
or PICT into java.awt.Image?

Yegor




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


Re: Capture and entire powerpoint slide as a graphic

Posted by Daniel Noll <da...@nuix.com>.
On Tuesday 19 June 2007 00:55:21 Yegor Kozlov wrote:
> HSLF can't convert ppt slides into images and I don't think we will
> ever support it. Even if we will, the ppt2png renderer will be pretty
> limited. Only simple shapes such as text, images, lines and rectangles
> can  be  rendered well. Also, in Java we can render only JPEG and PNG.
> Other picture formats such as PICT, WMF, BMP, etc. may require third-party
> libraries.

Well, to be more precise the renderer would render to Java2D, and what the 
caller happens to pass in as a Graphics2D object is the caller's choice.  The 
renderer wouldn't even have to have any explicit code for JPEG nor PNG.

Daniel


-- 
Daniel Noll
Nuix Pty Ltd
Suite 79, 89 Jones St, Ultimo NSW 2007, Australia    Ph: +61 2 9280 0699
Web: http://nuix.com/                               Fax: +61 2 9212 6902

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


Re: Capture and entire powerpoint slide as a graphic

Posted by Yegor Kozlov <ye...@dinom.ru>.
Hi,

HSLF can't convert ppt slides into images and I don't think we will
ever support it. Even if we will, the ppt2png renderer will be pretty
limited. Only simple shapes such as text, images, lines and rectangles
can  be  rendered well. Also, in Java we can render only JPEG and PNG.
Other picture formats such as PICT, WMF, BMP, etc. may require third-party libraries.


Regards,
Yegor

> Greetings:

> We have many use cases involving powerpoint in which the poi libraries will
> play a pivotal role. I have spent a few weeks exploring the easier things
> you can do with the HSLF classes, including extracting images, making new
> presentations, etc. But here is one that has stumped me, being a newbie with
> the API: extracting the entire contents of a specific slide within a
> presentation and  turning it into a graphic. The end use of this is
> presentation in a portal. The slides may contain text and graphics.

> The Slide class lets you get Slide Atoms and so forth, but I'm unclear as to
> how to reassemble these into an an image of the original slide. Is this even
> possible?

> I was pretty dicouraged until I saw that PresentationPro can convert an
> entire ppt file into a flash movie (see April 2007 archives of this list).
> If you can do that you should be able to save a single slide as a png file,
> right?

> Thanks in advance for helpful hints!

> Bruce Altner


> ---------------------------------------------------------------------
> 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


Re: Capture and entire powerpoint slide as a graphic

Posted by Bruce Altner <br...@nasa.gov>.
Yes, I looked at several of these, including Tonic systems. There appears to
be no shortage of tools that you can run through Powerpoint itself, as
plug-ins as it were, to do this, but that won't work for me. I need to do
this via Java, either as a portlet or a Web Service. That's why Poi looked
so promising.

Bruce

On 6/17/07 7:26 PM, "Daniel Noll" <da...@nuix.com> wrote:

> On Saturday 16 June 2007 09:46:57 Bruce Altner wrote:
>> I was pretty dicouraged until I saw that PresentationPro can convert an
>> entire ppt file into a flash movie (see April 2007 archives of this list).
>> If you can do that you should be able to save a single slide as a png file,
>> right?
>> 
>> Thanks in advance for helpful hints!
> 
> POI itself can't do it, though as you have noted, various third party software
> certainly can (the one I knew of was Tonic Systems, which seems to have been
> acquired by Google...)
> 
> All these projects have implemented their own renderers from scratch, more or
> less.  Though I wouldn't be surprised if some were using POI to actually
> parse the slide show.
> 
> Daniel
> 


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


Re: Capture and entire powerpoint slide as a graphic

Posted by Daniel Noll <da...@nuix.com>.
On Saturday 16 June 2007 09:46:57 Bruce Altner wrote:
> I was pretty dicouraged until I saw that PresentationPro can convert an
> entire ppt file into a flash movie (see April 2007 archives of this list).
> If you can do that you should be able to save a single slide as a png file,
> right?
>
> Thanks in advance for helpful hints!

POI itself can't do it, though as you have noted, various third party software 
certainly can (the one I knew of was Tonic Systems, which seems to have been 
acquired by Google...)

All these projects have implemented their own renderers from scratch, more or 
less.  Though I wouldn't be surprised if some were using POI to actually 
parse the slide show.

Daniel


-- 
Daniel Noll
Nuix Pty Ltd
Suite 79, 89 Jones St, Ultimo NSW 2007, Australia    Ph: +61 2 9280 0699
Web: http://nuix.com/                               Fax: +61 2 9212 6902

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