OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

can you convert PPT to HTML??
Goto page 1, 2  Next
 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
guest25
Guest





PostPosted: Tue Jun 01, 2004 11:46 pm    Post subject: can you convert PPT to HTML?? Reply with quote

I could not find any example to convert PPT file to HTML file.
There are some example to convert it to JPEG. but i dont want jpeg.
thanks for your help
Back to top
DannyB
Moderator
Moderator


Joined: 02 Apr 2003
Posts: 3991
Location: Lawrence, Kansas, USA

PostPosted: Wed Jun 02, 2004 7:30 am    Post subject: Reply with quote

Past discussion.....

Convert PPT to HTML from command line...
http://www.oooforum.org/forum/viewtopic.php?t=5137


List of many past conversion examples
http://www.oooforum.org/forum/viewtopic.php?t=4998


Here is a short example....
Code:
Sub Main
   ConvertPPTtoHTML( "c:\documents and settings\dbrewer\desktop\test.ppt" )
End Sub

Sub ConvertPPTtoHTML( cFile )
   cURL = ConvertToURL( cFile )
   
   ' Open the document.
   ' Just blindly assume that the document is of a type that OOo will
   '  correctly recognize and open -- without specifying an import filter.
   oDoc = StarDesktop.loadComponentFromURL( cURL, "_blank", 0, Array(_
            MakePropertyValue( "Hidden", True ),_
            ) )



   cFile = Left( cFile, Len( cFile ) - 4 ) + ".html"
   cURL = ConvertToURL( cFile )
   
   ' Save the document using a filter.   
   oDoc.storeToURL( cURL, Array(_
            MakePropertyValue( "URL", cURL ),_
            MakePropertyValue( "FilterName", "impress_html_Export" ),_
            )
   
   oDoc.close( True )
End Sub


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

_________________
Want to make OOo Drawings like the colored flower design to the left?
Back to top
View user's profile Send private message
guest25
Guest





PostPosted: Tue Jun 15, 2004 4:23 am    Post subject: Reply with quote

Can i do ppt to html conversion for specific slide in ppt ?( instead of whole ppt )

thanks!
Back to top
DannyB
Moderator
Moderator


Joined: 02 Apr 2003
Posts: 3991
Location: Lawrence, Kansas, USA

PostPosted: Tue Jun 15, 2004 5:46 am    Post subject: Reply with quote

See these....

Slide Splitter
http://www.oooforum.org/forum/viewtopic.php?t=7796
http://www.oooforum.org/forum/viewtopic.php?p=32470#32470
http://www.oooforum.org/forum/viewtopic.php?p=23018#23018
http://www.oooforum.org/forum/viewtopic.php?t=2664
http://www.oooforum.org/forum/viewtopic.php?p=9819#9819

Look at how the Slide Splitter works. It opens the document, then deletes every slide except for the slide it wants to keep, then exports it in some format, then closes the document without saving changes.
_________________
Want to make OOo Drawings like the colored flower design to the left?
Back to top
View user's profile Send private message
guest25
Guest





PostPosted: Wed Jun 16, 2004 5:45 am    Post subject: Reply with quote

this slide splitter apporach has performance issue. if i have ppt with 1000 slides,
i still have to load and convert whole document. and then additionaly delete unwanted
page.
I can as well do with call to store method to store all slides and use only that is required.
( since output text/image will have slide number associated with it)
Back to top
eetswong
General User
General User


Joined: 26 Aug 2004
Posts: 5

PostPosted: Thu Aug 26, 2004 7:43 pm    Post subject: Reply with quote

Hi all,

I have try to convert ppt to html using the Filter "impress_html_Export". However I got the error of "com.sun.star.io.IOException". I have try to replace the Filter to "HTML (StarWriter)" and try to convert for doc file. It can convert properly. I just wonder is it becuase I didn't install the library to run "impress_html_Export"? Any comment?

Thanks in Advance.
Back to top
View user's profile Send private message
DannyB
Moderator
Moderator


Joined: 02 Apr 2003
Posts: 3991
Location: Lawrence, Kansas, USA

PostPosted: Fri Aug 27, 2004 5:25 am    Post subject: Reply with quote

eetswong wrote:
I have try to convert ppt to html using the Filter "impress_html_Export". However I got the error of "com.sun.star.io.IOException". I have try to replace the Filter to "HTML (StarWriter)" and try to convert for doc file. It can convert properly. I just wonder is it becuase I didn't install the library to run "impress_html_Export"? Any comment?


I don't believe you have to install any optional component in order to have the impress_html_Export filter.

Are you sure your URL is correct? You must pass a URL, and not a pathname. Be sure you are using storeToURL and not storeAsUrl.
_________________
Want to make OOo Drawings like the colored flower design to the left?
Back to top
View user's profile Send private message
DannyB
Moderator
Moderator


Joined: 02 Apr 2003
Posts: 3991
Location: Lawrence, Kansas, USA

PostPosted: Fri Aug 27, 2004 5:27 am    Post subject: Reply with quote

guest25 wrote:
this slide splitter apporach has performance issue. if i have ppt with 1000 slides,


It would be possible to modify the slide splitter approach.

First use a macro that removes the last 500 pages. Then use a macro that removes the first 500 pages. Now you have two 500 page documents. Run slide splitter on each of those. You could in turn split each 500 page document into a pair of 250 page documents; each of which would get even better performance in the slide splitter.
_________________
Want to make OOo Drawings like the colored flower design to the left?
Back to top
View user's profile Send private message
eetswong
General User
General User


Joined: 26 Aug 2004
Posts: 5

PostPosted: Fri Aug 27, 2004 7:33 am    Post subject: Reply with quote

Danny, many thanks for your comment. I do use storeAsUrl which make it fail. It now work fine if I change it back to storeToUrl. Razz

BTW, can I know why it only work for the storeToUrl but not the StoreAsUrl? Thanks again for your comments.
Back to top
View user's profile Send private message
DannyB
Moderator
Moderator


Joined: 02 Apr 2003
Posts: 3991
Location: Lawrence, Kansas, USA

PostPosted: Fri Aug 27, 2004 8:12 am    Post subject: Reply with quote

storeToURL saves a copy of the document. The document is not associated with the saved file. For example, if your document was Untitled47, then it is still Untitled47 after a storeToURL.

If you do a storeAsURL, the document you just saved is now associated with the document in memory. Therefore, it must be possible to reload the saved document into OOo. If you are saving into certian formats, such as PDF, this is not possible.

In general, when saving to most non-native formats, always use storeToURL and not storeAsURL.
_________________
Want to make OOo Drawings like the colored flower design to the left?
Back to top
View user's profile Send private message
eetswong
General User
General User


Joined: 26 Aug 2004
Posts: 5

PostPosted: Thu Sep 02, 2004 9:43 am    Post subject: Reply with quote

Danny, can I ask you one more question? Thank in advance.

I have try to do the convertion in both hidden mode and not hidden mode. I find an observation that when I run 1 convertion process. The convertion will be succeeded on both cases. However, when I run 4 concurrent convertion process, the one without hidden mode can convert the document properly for all the 4 concurrent process. The one with hidden mode will have all 4 concurrent process running and then never complete. I need to kill the process and restart the openoffice. I am not sure is there anything that I need to special take care to ensure concurrent convertion process can be run in hidden mode? Many thanks.
Back to top
View user's profile Send private message
DannyB
Moderator
Moderator


Joined: 02 Apr 2003
Posts: 3991
Location: Lawrence, Kansas, USA

PostPosted: Fri Sep 03, 2004 12:12 pm    Post subject: Reply with quote

Maybe we need to be clear on what you mean by "Hidden" mode.

If you mean using the "-headless" command line option when starting OOo, then don't do that. This option is going to go away. It is a kludge. It was a bad idea. I don't remember where I read that. But the developers are aware of the need to be able to use OOo in a "server" mode, and I suspect that they may have plans to address this in a much better way than the "-headless" command line option.

If you meant using the "Hidden" property to loadComponentFromURL(), then the only problem I can think of is if you fail to close the document after you are done with it. Other than that, I don't know what the problem could be. (Well, OOo might hae a memory leak. Wouldn't be the first bug.)

In addition to the -headless command line option, there is also the -invisible option, and the -server option.
_________________
Want to make OOo Drawings like the colored flower design to the left?
Back to top
View user's profile Send private message
manuabraham81
Newbie
Newbie


Joined: 24 May 2007
Posts: 4

PostPosted: Mon May 28, 2007 2:50 am    Post subject: Convert PPT to HTML using PHP Reply with quote

Hi,


Can you please give me an example of PPT to HTML using PHP code.

I am waiting for your valuable suggestions.

Thanks
Back to top
View user's profile Send private message Send e-mail
AndrewZ
Moderator
Moderator


Joined: 21 Jun 2004
Posts: 4140
Location: Colorado, USA

PostPosted: Wed Feb 27, 2008 3:57 pm    Post subject: Reply with quote

This is an old post, so the following is just for the record. People still read this stuff. Smile

DannyB wrote:
If you mean using the "-headless" command line option when starting OOo, then don't do that. This option is going to go away. It is a kludge. It was a bad idea.


-headless seemed pointless before, OpenOffice.org 2.3.0+ implements proper use of -headless. Linux no longer requires an X server (not even Xvfb) if you install the headless RPM package and use the -headless option. IMO, -headless is easier than Xvfb.

Quote:
Can you please give me an example of PPT to HTML using PHP code.


Just run the PyODConverter script from PHP's exec()
_________________
<signature>
* Did you solve your problem? Do others a favor: Post the solution
* OpenOffice.org Ninja
* BleachBit
</signature>
Back to top
View user's profile Send private message Visit poster's website
igorhrk
Newbie
Newbie


Joined: 22 Mar 2009
Posts: 2
Location: Brazil

PostPosted: Sun Mar 22, 2009 1:43 pm    Post subject: Reply with quote

AndrewZ wrote:


Quote:
Can you please give me an example of PPT to HTML using PHP code.


Just run the PyODConverter script from PHP's exec()


The script works if I run it in terminal, but in php whit the exec() this return a error, look the message with print exec("./convert.sh");

ERROR!failed to connect to OpenOffice.org on port 8101
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
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