You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2013/11/07 16:40:05 UTC

[Bug 55758] New: Problems embedding non-office OLE object into PPT SlideShow

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

            Bug ID: 55758
           Summary: Problems embedding non-office OLE object into PPT
                    SlideShow
           Product: POI
           Version: 3.9
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HSLF
          Assignee: dev@poi.apache.org
          Reporter: petera@deltasoftinc.com

Created attachment 31026
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=31026&action=edit
PPT Slideshow with single molfile embedded

I have attached the code used for this prototype and both files although one is
an empty ppt file which is pointless.  The file of interest is a mol file which
is readable from accelerys draw version 4.1 (You may be able to d/l and install
a trial of this software).  The object created from accelerys is called a mol
file which is a representation of a molecule.  If you copy the mol file and
paste it into a ppt slideshow it creates a ole object in the ppt file.  I have
also attached(no I haven't only one attachement allowed) some java code which
is based on PoiOleXlsInPpt a proof of concept out on the internet at 
http://stackoverflow.com/questions/2849102/embedding-hssfexcel-into-hslfppt-using-apache-poi/16879830#16879830.
The code uses an ppt/mol file and creates a new ppt and then attempts to create
the ole object using poi's internals to embed the mol file and saves the new
ppt file.  Based on our work with the code, the ppt file gets created, but then
when trying to open the saved file with ppt. the application complains that the
ppt file is corrupt and tries to repair but can't manange to repair the file
and can't open the file.  So the ppt slideshow gets created but then can't be
opened by ppt which suggests some is incorrect in the creation of the new file.
Of course this use case works without a problem when the code which embeds the
ole object is commented out.  So there's something in the embedding code which
is not creating the object properly. Thanks.  I was going to try and attach the
code but it doesn't look like multiple attachments are allowed so you got the
ppt slideshow with a molfile embedded in it. I can provide our code if it makes
things easier but I'm just trying to create a new ppt ss with the molfile
embedded in it much like a copy and paste would do in windoze.  My real work is
to get the molefile and embed into ppt but I can do that if we can just fix the
issue with embedding the molefile into ppt. I can provide any additional info
if needed.  Andreas Beeker was helping me on the user group and this bug is
reported based on his suggestion.

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

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


[Bug 55758] Problems embedding non-office OLE object into PPT SlideShow

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55758

Bug 55758 depends on bug 55579, which changed state.

Bug 55579 Summary: [PATCH] Patch for add/embed OLE objects into HSLF
https://issues.apache.org/bugzilla/show_bug.cgi?id=55579

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

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

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


[Bug 55758] Problems embedding non-office OLE object into PPT SlideShow

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55758

Andreas Beeker <an...@gmx.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|3.9                         |3.10-dev
         Depends on|                            |55579
                 OS|                            |Windows 7

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

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


[Bug 55758] Problems embedding non-office OLE object into PPT SlideShow

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55758

--- Comment #1 from Andreas Beeker <an...@gmx.de> ---
Created attachment 31076
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=31076&action=edit
OLE-implementation for Accelrys Draw .mol-file embedding

The attachment contains a c# project to process a .mol file and generated
the neccessary ole object to be embedded by the also included java class.

An Accelrys Draw (AD) ole objects contains two streams.
1. "Contents": the bigger one, which is a concatenation of the following
formats:
   - a mol-file
   - a skc-file
   - a mol-file, an ASCII-file, same as the 1st file, but with a line
     length (byte) as first char of the line
   - a emf-file
   - a wmf-file
   each file is prefixed with little endian integer, which specifies the file
length
2. "\1Ole10Native": a "malformed" Ole10Native object, which is a subset of the
   Contents stream

as it works out, it's enough to embed the Contents stream

In the trial version, AD provides a few .net libraries and
JNI-Bridge consisting out of jar and two dlls. Although it's
possible to produce a few files of the mentioned above with
the bridge, it lacks emf/wmf support. There's a function
to copy data to and from the clipboard, which has the format 
of the contents stream, but it's not working.

After a bit of decompiling of the .net and .jar files,
I've started a small workaround c# project and it became visible
that the clipboard function always throws a "coinitialize hasn't
been called" error, no matter if I called coinitialize manually
or tweaked around the appartment model of the calling code.
The other functions work as designed.

So finally the solution is that c# helper, which generates the
contents stream and an emf preview image, and the embedding code
based on #55579.

It took a bit until the ensemble worked on Peters environment,
so in the rare case, that anybody else uses this code ;) ...
you might need to change the .net dll references and/or copy
various AD dlls to the local working dir.

As for the POI part this is only a very specific test, I'll
(try to) close this bug as "won't fix"

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

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


[Bug 55758] Problems embedding non-office OLE object into PPT SlideShow

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55758

Andreas Beeker <an...@gmx.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |WONTFIX
                 OS|                            |All

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

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