| View previous topic :: View next topic |
| Author |
Message |
jfb Guest
|
Posted: Tue Oct 28, 2003 9:12 am Post subject: export to eps format. |
|
|
Can someone help me?
Within a BASIC macro, I want to export a DrawDocument to an eps file.
I use "StoreToURL(...)" with the "FilterName" property set to "sdraw_eps_Export"
and obtain an error:
>"Error saving document ...: Wrong parameter.
>The operation was started under a wrong parameter"
and a IOException in BASIC with empty message.
However, if I change the "FilterName" to "StarDraw 3.0" for example, the code works fine!
What is wrong? I guess that some special properties have to be set for the eps-filter to work correctly, but I can't find out which. Am I wrong? Can someone help me?
Thank you. |
|
| Back to top |
|
 |
DannyB Moderator


Joined: 02 Apr 2003 Posts: 3991 Location: Lawrence, Kansas, USA
|
Posted: Tue Oct 28, 2003 9:44 am Post subject: |
|
|
Try 'draw_eps_Export' instead.
In these two past posts, I've given lists of the valid Filter names for OOo 1.1 RC1.
http://www.oooforum.org/forum/viewtopic.php?p=11744#11744
http://www.oooforum.org/forum/viewtopic.php?p=10311#10311
Here is how to obtain such a list...
| Code: | Sub Main
oFF = createUnoService( "com.sun.star.document.FilterFactory" )
oFilterNames = oFF.getElementNames()
' Now print the filter names.
' For i = LBound( oFilterNames ) To UBound( oFilterNames )
' Print oFilterNames(i)
' Next
' Create a Writer doc and save the filter names to it.
oDoc = StarDesktop.loadComponentFromURL( "private:factory/swriter", "_blank", 0, Array() )
oText = oDoc.getText()
oCursor = oText.createTextCursor()
oCursor.gotoEnd( False )
' Print the filter names into a Writer document.
For i = LBound( oFilterNames ) To UBound( oFilterNames )
oText.insertString( oCursor, oFilterNames(i), False )
oText.insertControlCharacter( oCursor, com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK, False )
Next
End Sub |
It's ironic because I just gave the same answer over here....
http://www.oooforum.org/forum/viewtopic.php?p=13213#13213 _________________ Want to make OOo Drawings like the colored flower design to the left? |
|
| Back to top |
|
 |
jfb Guest
|
Posted: Tue Oct 28, 2003 10:56 pm Post subject: export to eps format |
|
|
Oh sorry! I made a mistake in the FilterName ;
In fact, I tried many FilterNames; I used your answer to obtain valid FilterNames, but it still does not work with "eps_Export", and more generally with "bmp_Export", "gif_Export"...
(I am using OpenOffice.org v. 1.0.1)
Should this kind of filter be used in particular way? |
|
| Back to top |
|
 |
DannyB Moderator


Joined: 02 Apr 2003 Posts: 3991 Location: Lawrence, Kansas, USA
|
Posted: Wed Oct 29, 2003 7:03 am Post subject: |
|
|
I created a Draw document. Drew some things into it.
Then I created the following macro within the same Draw document.
| Code: | Sub Main
ThisComponent.storeToURL( ConvertToURL( "c:\test.eps" ),_
Array( MakePropertyValue( "FilterName", "draw_eps_Export" ) ) )
End Sub
' Create and return a new com.sun.star.beans.PropertyValue.
'
Function MakePropertyValue( Optional cName As String, Optional uValue ) As com.sun.star.beans.PropertyValue
Dim oPropertyValue As New com.sun.star.beans.PropertyValue
If Not IsMissing( cName ) Then
oPropertyValue.Name = cName
EndIf
If Not IsMissing( uValue ) Then
oPropertyValue.Value = uValue
EndIf
MakePropertyValue() = oPropertyValue
End Function
|
I run the macro. It saves an EPS file just fine. I can open the EPS file in GSView + Ghostscript and it looks fine. Did this test on OOo 1.1 + WinXP Pro.
Notice that the actual save is done in Sub Main, as a single statement. But it depends upon a function that I frequently use (in my standard library) called MakePropertyValue(). _________________ Want to make OOo Drawings like the colored flower design to the left? |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|