exportPicture

Hello,

I am developping a DXL script and I wanted to convert an OLE object (powerpoint slide) to an image.

After many investigations and attempts I finally had to export the OLE object in a PNG file then insert the picture into an object.

I used the exportPicture function to export the picture in PNG format. I would like to know if there is a way to increase the quality of the image generated ?

Thanks in advance.

Best regards,
Matthias VOISIN
SystemAdmin - Thu May 14 04:02:37 EDT 2009

Re: exportPicture
albertosegovia@work - Wed May 20 06:51:34 EDT 2009

Hi Matthias, all,

I have exactly the same problem... exportPicture currently supports only PNG format and the quality is really poor (I need to export UML diagrams and they are not readable).

I need to save the pictures as files, and of course the best would be to get them exported in some vector graphics format. If not, at least I'd like to get a BMP with quality.

I try to find workarounds but I didn't find successful results. I copy the OLE picture to the clipboard using oleCopy, and then I try to get the contents. I have tried the command line of IrfanView:
 

i_view32.exe /clippaste /convert=picture.bmp

 


But it's not good, you get rubbish. What's in the clipboard is not a picture itself, it's an OLE containing a picture.

If I paste in Word (or WordPad, etc), then the picture is correctly pasted and resizeable. But that's not a solution, I need an automatic DXL / command line tool chain to export pictures.

Is there any command line tool to get OLE objects with pictures and save them as picture files?

Thanks!!
Alberto

 

Re: exportPicture
llandale - Wed May 20 15:58:27 EDT 2009

Back in 2003 I did some work on this, but looking at that sloppy code I used exportPicture in PNG format.

Looking in the v9 *.exe I see there is an undocumented command:
string oleRtf(EmbeddedOleObject)

which I presume turns the OLE into an editable string. Perhaps you could then save that string to a file. Here's some old code that may get you started:

EmbeddedOleObject ole
    int i = 1 
    string errmess = null
    RichText rtf
    string s = richTextWithOle o.attributeName    
    i = 1
    for rtf in s do
    {
       if (rtf.isOle)
       {
           ole = rtf.getEmbeddedOle
           string filename = baseFileName "-rtfloop-" i ".png"
           print "Exporting " filename "\n" 
           errmess = exportPicture(ole,filename  , formatPNG)  
           if (!null errmess)
           {
               print "ERROR: " errmess "\n"   
           }  
        i++
       }   
    }

 


- Louie