Hi Laurent, hi Mathias,

> 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.

It did not work with any combination of media type and filter name.
There are no complaints but only empty files. "Manual" export with
File/Export works fine.

> 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

This snippet works for me and tells that image/svg+xml is a supported
media type.

> BTW, i tested with svg_Export
> the macro does not fail but produces empty files for bote OOo114 and OOo200

This is the behavior, I always see.

> '--------
> 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

This snippet produces a collection of empty files in my OOo. I'm using
OOo 2.0 (the official one).

Best regards
Bernhard


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to