Hi Mathias,
The MediaType seems to be correct, but it seems that you provide a wrong
filter name when exporting to SVG.
I don't know how the graphic export filters work, but a look into my
configuration files shows me that the filter name for the SVG export
filter is "svg_Export". So you should at least change this. I don't know
wether you must provide a filter name at all, your code example looks as
if you don't do it for png. Perhaps it works without one for cvg also,
just with the (correct) MediaType only. But it will definitely not work
with a wrong filter name.
this image/svg+xml has been used successfully in OOo 1.1.x
i just tested on a simple draw document it also works in OOo 2 (code at
the end)
where does the svg_Export come from ?
i found long ago the MediaTypes to use by running this small loop
dim tab() as string
oGraphic=CreateUnoService("com.sun.star.drawing.GraphicExportFilter")
tab=ographic.getSupportedMimeTypeNames()
for i=0 to ubound(tab)
msgbox(tab(i))
next i
BTW, i tested with svg_Export
the macro does not fail but produces empty files for bote OOo114 and OOo200
Laurent
'--------
this bugly quick-examples works from a Draw document in OOo 1.1.4 and OOo2.0
sub svgExport
odocument = thiscomponent
filtername = "image/svg+xml"
fichdest = "home/lgodard/tmp/svg2export"
Extdest = ".svg"
oGraphic=CreateUnoService("com.sun.star.drawing.GraphicExportFilter")
dim args3(1) as new com.sun.star.beans.PropertyValue
for i=0 to odocument.drawpages.getcount()-1
opage=odocument.drawPages(i)
ographic.setSourceDocument(opage)
args3(0).Name = "URL"
nom=opage.name
url = ConvertToURL(fichdest+"-"+nom+ ExtDest)
args3(0).Value = url
args3(1).Name = "MediaType"
args3(1).Value = filtername
oGraphic.filter(args3())
next i
end sub
--
Laurent Godard <[EMAIL PROTECTED]> - Ingénierie OpenOffice.org
Indesko >> http://www.indesko.com
Nuxeo CPS >> http://www.nuxeo.com - http://www.cps-project.org
Livre "Programmation OpenOffice.org", Eyrolles 2004
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]