Hi!

Just checking if the mail list works or not.
The forwarded message was sent out one day ago - still
hasn't appeared on the list.
If you see this message we would be grateful if you could
(try to) answer the question.

Thanks!

-------- Original Message --------
Subject:        FW: Re: [graphics-dev] save chart image to file
Date:   Tue, 25 May 2010 13:51:11 +0400
From:   Doan Nguyen Van <[email protected]>
To:     'Oleg Mikheev' <[email protected]>





*From:* Doan Nguyen Van [mailto:[email protected]]
*Sent:* Tuesday, May 25, 2010 13:46
*To:* '[email protected]'
*Cc:* '[email protected]'
*Subject:* Re: [graphics-dev] save chart image to file



On 02/24/10 10:10, Ingrid Halama wrote:

> Hi,



> What is the problem? In case you want to access the generated shapes
within the chart: The chart document supports interface
::com::sun::star::srawing::XDrawPageSupplier. The given draw page
contains generated draw shapes as well as persistent ones.





Hi Ingrid,



I’ve been able to get interface XDrawPage from a XChartDocument. But
when I export the shapes in the draw page, the exported image is empty.
May be it’s a bug of OpenOffice.org? My code for exporting is:



            XDrawPageSupplier drawPageSupplier =

                  UnoRuntime./queryInterface/(XDrawPageSupplier.*class*,
aChartDoc);

            XDrawPage drawPage = drawPageSupplier.getDrawPage();



            Object shapeAsObject = drawPage.getByIndex(0);

            XShape chartShape = (XShape)
UnoRuntime./queryInterface/(XShape.*class*, shapeAsObject);

            XComponent pageToExport = (XComponent)
UnoRuntime./queryInterface/(XComponent.*class*,

                              chartShape);



            //Create an exporter

            XExporter exporter = (XExporter)UnoRuntime./queryInterface/(

                              XExporter.*class*,


xMultiServiceFactory.createInstance("com.sun.star.drawing.GraphicExportFilter"));



            PropertyValue[] exportProperties = *new* PropertyValue[2];

            exportProperties[0] = *new* PropertyValue();

            exportProperties[0].Name = "MediaType";

            exportProperties[0].Value = "image/jpeg";



            exportProperties[1] = *new* PropertyValue();

            exportProperties[1].Name = "URL";

            exportProperties[1].Value = "file:///E:/Temp/Chart_OO.jpeg";



            exporter.setSourceDocument(pageToExport);

            XFilter drawFilter = (XFilter)
UnoRuntime./queryInterface/(XFilter.*class*, exporter);

            drawFilter.filter(exportProperties);



aChartDoc is a XChartDocument. With XDrawPage received from
XSpreadsheet, the above code perfectly works.



Thanks and best regards,

Doan Nguyen Van


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to