jruuttun Guest
|
Posted: Fri Feb 13, 2004 12:30 am Post subject: Empty draw to EPS export using macro |
|
|
Hi,
first, thanks for the useful advice I've found in this forum.
Q1: I'm running OOo 1.1.0 on a WinXP and trying to export a drawing using the following subroutine, adapted from DannyB:s examples found in this forum:
| Code: |
Sub ConvertSxdToEpsByURL( cURL)
oDoc = StarDesktop.loadComponentFromURL( cURL, "_blank", 0, Array(MakePropertyValue( "Hidden", True)))
cURL = Left( cURL, Len( cURL ) - 4) + ".eps"
oDoc.storeToURL( cURL, Array( MakePropertyValue( "FilterName", "draw_eps_Export" ))
oDoc.close( True)
End Sub
|
I'm running this macro from the cygwin command line, using an 'invisible' OOo DeskTop. The file from the given URL is loaded OK. The problem is, the exported file seems empty when I view it with gv. What am I missing here?
A manual EPS export from inside OOo works fine.
While at it, here's Q2: My goal is a macro that first selects all, then exports to eps only the selection. This is how far I got with the selection part:
| Code: |
dim document as object
dim dispatcher as object
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
dispatcher.executeDispatch(document, ".uno:SelectAll", "", 0, Array())
|
This works fine, but how do I export just the selection (after having solved Q1...)?
Any advice greatly appreciated. Thanks again.
Janne |
|