Re: Module to generate OpenOffice Writer documents

Discussion in 'Python' started by python, Sep 18, 2003.

  1. python

    python Guest

    On Wed, 17 Sep 2003 19:53:15 -0400
    "Ellinghaus, Lance" <> wrote:

    > Has anyone created a module to generate the XML formatted files for
    > OpenOffice?
    >


    Sorry, I can't help you there.

    What I'd be even more interested in is if it is possible to submit the
    xml to OpenOffice, and then use its rendering features to crank out
    pretty PDF files, all through scripts.
     
    python, Sep 18, 2003
    #1
    1. Advertising

  2. On Wed, 17 Sep 2003 20:34:41 -0400, python <>
    wrote:

    > What I'd be even more interested in is if it is possible to submit the
    > xml to OpenOffice, and then use its rendering features to crank out
    > pretty PDF files, all through scripts.


    The Python-UNO bridge might do the trick for you. It lets you
    programatically control OOo apps:

    http://udk.openoffice.org/python/python-bridge.html

    J.
     
    Jordan Krushen, Sep 18, 2003
    #2
    1. Advertising

  3. python <> writes:

    > On Wed, 17 Sep 2003 19:53:15 -0400
    > "Ellinghaus, Lance" <> wrote:
    >
    > > Has anyone created a module to generate the XML formatted files for
    > > OpenOffice?
    > >

    >
    > Sorry, I can't help you there.
    >
    > What I'd be even more interested in is if it is possible to submit the
    > xml to OpenOffice, and then use its rendering features to crank out
    > pretty PDF files, all through scripts.


    I do almost exactly that, though the output is Power Point rather than
    PDF.

    I originally wanted to do this using the Python UNO API but that
    proved somewhat difficult to use (although the Office Basic API is
    also horrible).

    So all I do is to generate a OO XML file, stick it in a fixed location
    then call:
    soffice -display :1 macro:///Standard.Module1.NewConvert

    where the Standard.Module1.NewConvert macro is one that opens the
    file, saves as PPT and closes the document again (the macro is easy
    enough to generate using the macro recording feature).

    The display at :1 is a virtual framebuffer (xvfb) where OpenOffice is
    running -- calling soffice if it is already running asks the main
    program to synchronously run the macro and the soffice command exits
    once the main program is done with its execution.

    As for the XML input file: I generate most of it by hand. I started
    out by generating everything to the specs I wanted (styles, etc.) and
    saving that file. The .SX? files are just ZIP files, with the the
    content stored in the 'content.xml' file, the format of which is
    decently documented. So you can take your template and just build on
    top of it.

    This is much nicer than generating RTF by hand, which I also do in the
    same program :)

    This guy provides automated conversion online using a similar system:

    http://oooconv.free.fr/engine/OOOconv.php



    --
    ===============================================================
    <> Herlev, Denmark
    <URL:http://www.andreasen.org/> <*>
    ===============================================================
     
    Erwin S. Andreasen, Sep 20, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    569
  2. Ellinghaus, Lance

    Module to generate OpenOffice Writer documents

    Ellinghaus, Lance, Sep 18, 2003, in forum: Python
    Replies:
    2
    Views:
    334
  3. DaVinci
    Replies:
    1
    Views:
    598
    Piotr Kobzda
    Oct 5, 2006
  4. Henri
    Replies:
    1
    Views:
    412
    Henri
    Jul 13, 2004
  5. Tony
    Replies:
    2
    Views:
    426
Loading...

Share This Page