Thanks for the snippet. I do get access to my graphics inside the writer
now document but I don't get any further than this with Java. I do have
the Graphic Object but now I need access to the MediaProperties and get
an XGraphic out of it to give it along to the XGraphicProvider
....anyone got some Java clues there?
Object oGraphic = null;
XTextDocument xTextDocument = (XTextDocument) UnoRuntime
.queryInterface(XTextDocument.class, xComponent);
XTextGraphicObjectsSupplier xGraphicSupplier =
(XTextGraphicObjectsSupplier) UnoRuntime
.queryInterface(XTextGraphicObjectsSupplier.class,
xTextDocument);
XNameAccess xNamedGraphics = xGraphicSupplier.getGraphicObjects();
XIndexAccess xIndexedGraphics = (XIndexAccess) UnoRuntime
.queryInterface(XIndexAccess.class, xNamedGraphics);
oGraphic = xIndexedGraphics.getByIndex(0); // gets me the
first image object
... how can I get access to the XGraphic and MediaProperties of the file
now?
Fernand Vanrie schrieb:
Jimmy schreef:
This is not really the approach I was looking for. I'd like to export
images inside a Writer document. Is there some chance to access the
images in the zip file and save those? Has anyone ever tried this
with Java?
No never in java :-) but i tried a lot in basic. For this kind of job
you have with the api 2 choiches.
- Transfering the Graphic to a hidden) drawdoc into a shape in a
Drawpage and from there you can Export
("com.sun.star.drawing.GraphicExportFilter") the graphic to any URL
with a choise of different FileFormats and you can also changes the
PixelSizes (dimensions)
- Using the GraphicProvider ("com.sun.star.graphic.GraphicProvider")
who acts as a container from where you can "store" the Graphic to any
URL But here you can NOTchanges the Pixelsizes only choose a different
fileformat.
Graphic inside (embedded) or linked makes no difference slect the
graphs like
Dim oAllGraphics As Object
Dim oGraphic As Object
AllGraphics = oDocument.getGraphicObjects
Dim n As Integer
FOR n = 0 to oAllGraphics.Count - 1
oGraphic = oAllGraphics(n)
NEXT
Hope it helps
Fernand Vanrie schrieb:
Have a look at some basic-code
http://www.oooforum.org/forum/viewtopic.phtml?t=36724&highlight=xexporter
Fernand
Jimmy schreef:
My Java Component is supposed to export a file to another xml
format and has to save the images right along with the xml file in
a folder. How can I get access to the images in the current
document and save/export them?
I did find an old OOMacro, which didn't actually work for me and I
didn't know how to convert to Java as well:
http://codesnippets.services.openoffice.org/Writer/Writer.ExtractGfx.snip
Any help or examples appreciated.
Jimmy
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]