new COM("com.sun.star.ServiceManager") Time Out Error
Hi can somewone help out...
I want to connect to openoffice using php
But my code stucks at
$osm = new COM("com.sun.star.ServiceManager") or die ("Please be sure that OpenOffice.org is installed.\n");
with a Time out message!
does anyone why this is???
you'll need to make sure that the java classes are on the classpath that PHP/COM can have access to...
but... this means that OpenOffice/StarOffice are installed on the server that PHP is running on. is that what your intention is?
Yes.. Ik have already installed OpenOffice on my localsystem, which is also my server...
How do i put the java classes on the classpath??
I am using Windows XP
I think it makes more sense to first ask what is it you're trying to do with open office?
Originally Posted by Cribz
I'm Trying to generate openoffice writer's document with php. This document can for example be an invoice.
-thanks in advance-
I'm guessing you're just following a tutorial? Maybe this one? http://www.oooforum.org/forum/viewtopic.phtml?t=3474
Just to point out, if you are using this one, it's quite old and for OOo 1.1. Might behave differently if you're using 2.
Is there another way to control OpenOffice from PHP?
I'm now using version 2.3
Well, if you look at the forum I linked to, there's http://www.oooforum.org/forum/viewtopic.phtml?t=68902 this
Originally Posted by Cribz
It looks like they have something working fairly well. Their description seems to work on linux, windows is probably slightly different (paths, etc).
I will take a look at it...
Any Solution? I also want to open a writer doc...and I got the same Problem.
Where do i have to put which java files?
I use OpenOffice 3, Windows XP and PHP 5.2.6
I tried it with this code
Originally Posted by mychastic
and then this error: "Fatal error: Maximum execution time of 60 seconds exceeded in C:\xampp\htdocs\Test\test.php on line 19"
// get the ServiceManager.
// This step varies greatly from language to language.
// This technique is specifically for PHP running on Windows,
// where OOo has been installed onto the *same* computer that is running PHP.
$oServiceManager = new COM( "com.sun.star.ServiceManager" );
// Get the Desktop object
$*****top = $oServiceManager->createInstance( "com.sun.star.frame.Desktop" );
// Ask the Desktop object to create a new drawing.
// Note the empty array of arguments.
// This wold be an array of com.sun.star.beans.PropertyValue structs if
// you needed to specify additional arguments.
$oArgs = array();
$oDrawDoc = $*****top->loadComponentFromURL( "private:factory/sdraw", $oArgs );
So whats wrong here?
I want you take a look at http://www.webdeveloper.com/forum/sh...d.php?t=187281. There is 2 solution with OpenOffice. Using API or using MACRO. Macro is easiest way to do something like file conversion.
I want you take a look at PUNO : http://www.wstech2.net/index.php?do=puno. With PUNO, you can access OpenOffice API. I have using it quite a while.. The result is : i can control presentation file in a web browser. I have tested it using my ubuntu 7.10 + OpenOffice 2.4.1. Not test in OOo 3 yet, because no SDK at the moment. So, if there is another question about it, welcome... The COM windows tutorial in there is good too..
The main and usual problem call ServiceManager with COM extension is permission! Have you set the permission?? COM permission.
There is a tool : JODConverter. You can take a tour on it and its guide(how to starting OOo as a service). http://www.artofsolving.com/opensource/jodconverter. This may insipire you..
For my experiment, the best result to control OOo is using java, not PHP! So, JSP or other technology may be suitable to you if you try to control OOo with its API.
Who is the man, installed OOo as a service, to satisfy web application, in a shared hosting?? None will!!
Hope this help you all..
Of cource there will be an error occured. You have created unfinish code. After loadComponentFromURL, what will you do about it? If there is nothing, then close it!
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)