| View previous topic :: View next topic |
| Author |
Message |
guest25 Guest
|
Posted: Tue Jun 01, 2004 11:46 pm Post subject: can you convert PPT to HTML?? |
|
|
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


Joined: 02 Apr 2003 Posts: 3991 Location: Lawrence, Kansas, USA
|
Posted: Wed Jun 02, 2004 7:30 am Post subject: |
|
|
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 |
|
 |
guest25 Guest
|
Posted: Tue Jun 15, 2004 4:23 am Post subject: |
|
|
Can i do ppt to html conversion for specific slide in ppt ?( instead of whole ppt )
thanks! |
|
| Back to top |
|
 |
DannyB Moderator


Joined: 02 Apr 2003 Posts: 3991 Location: Lawrence, Kansas, USA
|
|
| Back to top |
|
 |
guest25 Guest
|
Posted: Wed Jun 16, 2004 5:45 am Post subject: |
|
|
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

Joined: 26 Aug 2004 Posts: 5
|
Posted: Thu Aug 26, 2004 7:43 pm Post subject: |
|
|
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 |
|
 |
DannyB Moderator


Joined: 02 Apr 2003 Posts: 3991 Location: Lawrence, Kansas, USA
|
Posted: Fri Aug 27, 2004 5:25 am Post subject: |
|
|
| 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 |
|
 |
DannyB Moderator


Joined: 02 Apr 2003 Posts: 3991 Location: Lawrence, Kansas, USA
|
Posted: Fri Aug 27, 2004 5:27 am Post subject: |
|
|
| 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 |
|
 |
eetswong General User

Joined: 26 Aug 2004 Posts: 5
|
Posted: Fri Aug 27, 2004 7:33 am Post subject: |
|
|
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.
BTW, can I know why it only work for the storeToUrl but not the StoreAsUrl? Thanks again for your comments. |
|
| Back to top |
|
 |
DannyB Moderator


Joined: 02 Apr 2003 Posts: 3991 Location: Lawrence, Kansas, USA
|
Posted: Fri Aug 27, 2004 8:12 am Post subject: |
|
|
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 |
|
 |
eetswong General User

Joined: 26 Aug 2004 Posts: 5
|
Posted: Thu Sep 02, 2004 9:43 am Post subject: |
|
|
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 |
|
 |
DannyB Moderator


Joined: 02 Apr 2003 Posts: 3991 Location: Lawrence, Kansas, USA
|
Posted: Fri Sep 03, 2004 12:12 pm Post subject: |
|
|
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 |
|
 |
manuabraham81 Newbie

Joined: 24 May 2007 Posts: 4
|
Posted: Mon May 28, 2007 2:50 am Post subject: Convert PPT to HTML using PHP |
|
|
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 |
|
 |
AndrewZ Moderator


Joined: 21 Jun 2004 Posts: 4140 Location: Colorado, USA
|
Posted: Wed Feb 27, 2008 3:57 pm Post subject: |
|
|
This is an old post, so the following is just for the record. People still read this stuff.
| 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 |
|
 |
igorhrk Newbie

Joined: 22 Mar 2009 Posts: 2 Location: Brazil
|
Posted: Sun Mar 22, 2009 1:43 pm Post subject: |
|
|
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 |
|
 |
|