<? function pv($name,$value){ $pv=$objServiceManager->Bridge_GetStruct('com.sun.star.beans.PropertyValue'); $pv->Name=$name; $pv->Value=$value; return($pv); } $objServiceManager=new COM('com.sun.star.ServiceManager'); $Stardesktop=$objServiceManager->createInstance('com.sun.star.frame.Desktop'); $doc=$Stardesktop->loadComponentFromURL('private:factory/swriter','_blank',0,array(pv('Hidden',true))); $text=$doc->getText(); $text->setString('Hello World!'); $doc->close(true); ?>
Wymaga zaintalowanego OpenOffice oraz w przypadku nie dzialania nalezy zastosowac sie do instrukcji:
Cytat
My problem was that the COM settings did not allow remote users access to open office.
To change this access the server and follow these steps:
1. Run -> dcomcnfg
2. Component Services -> DCOM Config
3. OpenOffice.org 1.1 Text Document -> Properties -> Identity (tab)
4. Now enter a specific user that has permission (i.e. your admin username and password)
To change this access the server and follow these steps:
1. Run -> dcomcnfg
2. Component Services -> DCOM Config
3. OpenOffice.org 1.1 Text Document -> Properties -> Identity (tab)
4. Now enter a specific user that has permission (i.e. your admin username and password)
(mi pomogla zmiana na: użytkownik interakcyjny)
Problemy:
1. Czy da sie jakos przechwycic wygenerowany strumien danych (w tym przypadku PDF) ? Nie chce zapisywac na dysku, chce wyslac prosto do przegladatki...
2. Niestety metoda setString przyjmuje dane w kodowaniu jakie jest obecnie z windowsie, a zalezy mi na UFT8 i nie mam pojecia jak to zmienic.......