OpenOffice-UNO

 view release on metacpan or  search on metacpan

UNO.pm  view on Meta::CPAN

  $uno = OpenOffice::UNO->new;
  $cxt = $uno->createInitialComponentContext;
  $sm  = $cxt->getServiceManager;
  $resolver = $sm->createInstanceWithContext
                  ("com.sun.star.bridge.UnoUrlResolver", $cxt);
  $rsm = $resolver->resolve
      ("uno:socket,host=localhost,port=8100;urp;StarOffice.ServiceManager");

  # get an instance of the Desktop service
  $rc = $rsm->getPropertyValue("DefaultContext");
  $desktop = $rsm->createInstanceWithContext("com.sun.star.frame.Desktop", $rc);

  # create a name/value pair to be used in opening the document
  $pv = $uno->createIdlStruct("com.sun.star.beans.PropertyValue");
  $pv->Name("Hidden");
  $pv->Value(OpenOffice::UNO::Boolean->new(0));

  # open a document
  $sdoc = $desktop->loadComponentFromURL("file:///home/jrandom/test1.sxw",
                                         "_blank", 0, [$pv]);

  # close the document
  $sdoc->dispose();

=head1 DESCRIPTION

This is a straight bridge to the OpenOffice.org API, so the definitve
reference is in the OpenOffice.org SDK.



( run in 0.998 second using v1.01-cache-2.11-cpan-299005ec8e3 )