| View previous topic :: View next topic |
| Author |
Message |
stephen_e_nelson Newbie

Joined: 12 May 2003 Posts: 2
|
Posted: Mon May 12, 2003 8:13 pm Post subject: Autorun Slide Show From Command Line |
|
|
I've got a number of Powerpoint presentations that I'd like to run, automatically, from the command line (or better yet from Perl). I'd like them to run immediately, without splash screen or user interaction. Is there a set of command-line arguments that would allow me to do this?
Thanks... _________________ Stephen Nelson
BCTV Technical Staff |
|
| Back to top |
|
 |
ftack Moderator


Joined: 27 Jan 2003 Posts: 3102 Location: Belgium
|
Posted: Fri May 16, 2003 7:32 am Post subject: |
|
|
| See another slightly more recent thread on this. As far as I know, Impress currently can't do that. |
|
| Back to top |
|
 |
dfrench Moderator

Joined: 03 Mar 2003 Posts: 1605 Location: Wellington, New Zealand
|
Posted: Fri May 16, 2003 7:49 pm Post subject: |
|
|
Here is a starting point ...
1. You can start OO.o and give it a filename from the command line ... but that will take you straight into edit mode unless you do something. There are a few options for the command line which will avoid the splash screen. see http://framework.openoffice.org/servlets/ProjectDocumentList
2. The following macro will run a presentation (endlessly ... there are a few other properties that you can set if you wish) from the current loaded document
| Code: | Sub hello
dim xPresentation as object
set xPresentation = thiscomponent.getpresentation
xPresentation.setPropertyValue("IsEndless", true) 'loops around
xPresentation.start()
End Sub |
3. Save the macro in Standard. Assign the macro to the OpenOffice.Org Open Document event and it will run for each document that you open.
4. To make this more practical, you will need to develop the macro to detect presentation components, otherwise you will get a macro error when you load word documents. This also needs some work to avoid dropping into OO.o from the presentation when user keys ESC |
|
| Back to top |
|
 |
scottcarr Power User

Joined: 05 Feb 2003 Posts: 62 Location: Lebanon, TN
|
Posted: Mon May 19, 2003 12:18 pm Post subject: |
|
|
What OS are you using? _________________ Scott Carr
OOo Documentation Maintainer |
|
| Back to top |
|
 |
stephen_e_nelson Newbie

Joined: 12 May 2003 Posts: 2
|
Posted: Mon May 19, 2003 2:38 pm Post subject: |
|
|
Sorry, forgot... Red Hat 9.
I've moved over to exporting the Powerpoint slides as Quicktime on a nearby Mac, then playing them with Xine. Cumbersome, but it gets me the results I need.
Thanks... _________________ Stephen Nelson
BCTV Technical Staff |
|
| Back to top |
|
 |
Guest
|
Posted: Mon May 19, 2003 2:55 pm Post subject: |
|
|
| Can you play Flash macromedia? |
|
| Back to top |
|
 |
scottcarr Power User

Joined: 05 Feb 2003 Posts: 62 Location: Lebanon, TN
|
Posted: Mon May 19, 2003 2:56 pm Post subject: |
|
|
If you can play Flash, then you can export to Flash from within OOo in version 1.1Beta. _________________ Scott Carr
OOo Documentation Maintainer |
|
| Back to top |
|
 |
Guest
|
Posted: Mon May 19, 2003 6:35 pm Post subject: |
|
|
| Except the export to flash from impress appears to be very limited. |
|
| Back to top |
|
 |
quangtrung Newbie

Joined: 17 Dec 2003 Posts: 2
|
Posted: Thu Dec 18, 2003 6:01 am Post subject: |
|
|
| do you know any event emitted after a slide show is reached the last slide ? By that way we can do a macro to close the application automaticaly after a slide show. I do need it. Please help ! |
|
| Back to top |
|
 |
DannyB Moderator


Joined: 02 Apr 2003 Posts: 3991 Location: Lawrence, Kansas, USA
|
Posted: Thu Dec 18, 2003 7:18 am Post subject: |
|
|
| dfrench wrote: | Here is a starting point ...
1. You can start OO.o and give it a filename from the command line
2. The following macro will run a presentation
|
Sorry I don't have time to write up a complete, detailed, working example and post it.
Between dfrench's useful information, and other posts in the Macros and API section, all the pieces exist to build a complete solution to the original question, as well as another users recent question in a different thread.
dfrench shows code to run a macro when you have the document model in hand. Looking at the macro it is obvious how to make it run once or endlessly.
I have posted messages before describing...
1. How to launch OOo from the command line and make it run a macro.
2. How to pass a parameter to a macro when running the macro from command line.
3. How to convert a document from format XXX into format YYY from the command line. (using techniques 1 and 2)
Pay careful attention to these posts! I have you put a macro into soffice, so that it is permanent. You then launch "soffice" from the command line passing a URL to a macro, along with a parameter to the macro. The macro runs, then it opens the document which is the parameter to the macro. (Then converts it into format YYY, which isn't your goal.)
In your case, you could put in a permanent macro. Launch it from the command line, passing the filename of the Presentation to run. That is, the Impress document pathname is the *parameter* to the macro from the command line. The macro URL is a parameter on the soffice command. The Impress document is "folded into" the URL that launches the macro with a parameter. I am a Python guy instead of a Perl guy, but any good Perl dude should be able to form a shell command containing "soffice" (or soffice.exe on Windows), and a URL of the form: "macro:///MyLibrary/MyModule/MyFunction(/home/danny/Desktop/MyImpressDoc.sxi)" and then pass this URL to "soffice" from the command line.
Under soffice, you would create a new library MyLibrary. Make sure there is a module in this library named MyModule. Within this module, create a MyFunction...
| Code: | Sub MyFunction( cImpressPathname )
cURL = ConvertToURL( cImpressPathname )
oDoc = StarDesktop.loadComponentFromURL( cURL, "_blank", 0, Array() )
|
oDoc now contains the document model. dfrench showed how to get the presentation and run it from the document model -- either once or endlessly.
Seems to me like the problem is solved; at least, all the pieces to the puzzle are present. Just connect the dots and add water.
See related posts in Macros and API on:
How to launch macro from command line.
How to convert document from XXX to YYY from command line.
(note, the above are not the exact subject lines -- I don't have time to do the research right now. Sorry.)
Hope this helps. _________________ Want to make OOo Drawings like the colored flower design to the left? |
|
| Back to top |
|
 |
avantman42 Super User

Joined: 28 Jul 2003 Posts: 751 Location: Staffordshire, UK
|
Posted: Thu Dec 18, 2003 7:37 am Post subject: |
|
|
| DannyB wrote: | | Between dfrench's useful information, and other posts in the Macros and API section, all the pieces exist to build a complete solution to the original question |
Except for suppressing the splash screen. However, this NewsForge article details how to suppress it under Linux:
http://www.newsforge.com/software/03/04/22/1931223.shtml?tid=51
The article only covers Linux, but one of the comments details how to do the same under Windows.
Russ |
|
| Back to top |
|
 |
thirusvga General User

Joined: 27 Mar 2008 Posts: 10
|
Posted: Tue Apr 01, 2008 2:05 am Post subject: Re: Autorun Slide Show From Command Line |
|
|
can u help me .,
how to convert ppt into image....without specifying path with filename....
the following program is convert ppt to image it is run..
Sub Main
' This is the name of the Impress document to split
' into separate documents.
' Each page of this Impress document is saved as a
' separate document, as a PDF, and also as a Flash.
' cImpressDocToSplit = "/home/danny/Desktop/SlideSplitter/SlideDocumentToSplit.sxi"
cImpressDocToSplit = "/var/www/html/sample1.ppt"
SplitSlides( cImpressDocToSplit )
' SplitSlides("\var\www\html\sample.ppt")
End Sub
Sub SplitSlides( cImpressDocToSplit )
' Open the document to find out how many pages it has.
oDoc = StarDesktop.LoadComponentFromURL( ConvertToURL( cImpressDocToSplit ), "_blank", 0, Array() )
nNumPages = oDoc.getDrawPages().getCount()
' Now that we know how many pages it has, close it.
oDoc.close( True )
' Get the name of the document, but without a filename suffix.
cImpressDocToSplitNoSuffix = Left( cImpressDocToSplit, Len( cImpressDocToSplit ) - 4 )
' Now loop once for each page.
nHighestPageNumber = nNumPages-1
' nPageToSave = 2
For nPageToSave = 0 To nHighestPageNumber
' Open the document.
oDoc = StarDesktop.LoadComponentFromURL( ConvertToURL( cImpressDocToSplit ), "_blank", 0, Array() )
' Delete all pages except the one we're interested in keeping
' on this loop.
DeleteAllPagesExcept( oDoc, nPageToSave )
' Prepare to save the document in multiple forms.
' First get the new filename to save it under.
cNewName = cImpressDocToSplitNoSuffix +" "+ CSTR( nPageToSave + 1 )
' Save it as a JPEG.
oDoc.storeToUrl( ConvertToURL( cNewName + ".jpeg" ), _
Array( MakePropertyValue( "FilterName", "impress_jpg_Export" ) ) )
' Close the document without saving it.
oDoc.close( True )
Next
End Sub
' Delete all pages of an Impress or Draw document,
' EXCEPT for a certian page that we want to keep.
Function DeleteAllPagesExcept( oDoc, nPageToKeep )
nNumPages = oDoc.getDrawPages().getCount()
nHighestPageNumber = nNumPages-1
' Delete the last page, then the page before that,
' then the page before that, until we get to the
' page to keep.
' This deletes all pages AFTER the page to keep.
nPageToDelete = nHighestPageNumber
Do while nPageToDelete > nPageToKeep
' Get the page.
oPage = oDoc.getDrawPages().getByIndex( nPageToDelete )
' Tell the document to remove it.
oDoc.getDrawPages().remove( oPage )
nPageToDelete = nPageToDelete - 1
Loop
' Delete all the pages before the page to keep.
For i = 0 To nPageToKeep - 1
' Delete the first page.
nPageToDelete = 0
' Get the page.
oPage = oDoc.getDrawPages().getByIndex( nPageToDelete )
' Tell the document to remove it.
oDoc.getDrawPages().remove( oPage )
Next
End Function
Function MakePropertyValue( Optional cName As String, Optional uValue ) As com.sun.star.beans.PropertyValue
oPropertyValue = createUnoStruct( "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
but how to convet ppt to image with out specify path with file name..please help me...
please send the coding and explanation... |
|
| 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
|