soffice cli interface?

Zbigniew Koziol softquake-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org
Thu May 1 22:29:15 UTC 2008


On Thu, May 1, 2008 at 12:15 PM, Sy Ali <sy1234-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org> wrote:
> On Wed, Apr 23, 2008 at 10:32 AM, Neil Watson
>  <tlug-neil-8agRmHhQ+n2CxnSzwYWP7Q at public.gmane.org> wrote:
>  > I store my resume as a latex file.  With a little scripting I can output
>  >  this as HTML, txt and PDF.  However there are troublesome group of
>  >  recruiters that can only seem to deal with a resume in Word format.  Is
>  >  it possible to script OpenOffice to convert files from the shell?
>
>  (comedy)  Create a new openoffice document, then paste in
>  carefully-edited screenshots.  =)

Not a long time ago I had a question too about converting files, in
particular in context of creating "reports". Indeed, ODT format is
very nice for that. Let me share some basic experience.

1. One needs to create a "template", by using OO and saving it as ODT
file, i.e. a document that will be converted later from command line
or by using scripts like PHP (my case) .
2. unzip the ODT file to empty directory. It will contain content.xml file.
3. Have a look there and guess how easy it is to figure out what is its content.
4. Use your methods to replace items there (XML values) with what you
want to have there. One can freely add more content, as long as the
structure of XML is not changed. I used to add for instance new rows
of a table filled in with values from database.
5. Use for instance zip command from command line (zip -r content.xml
file.odt) to replace content.xml in ODT file with the modified
content.xml. Thats it!

XML files are huge but they compress up to 10 times, so no need to
worry much about disk space.

Regarding 5) - I considered using zip build in functions in PHP (if
php is compiled -with-zip), and also Archive_Zip from PEAR but I found
it more convenient in my case of using zip -r as a exec command from
PHP.

Conversion of files from command line between various formats is
possible by using OO, but I so far did not figure out all the details.
One may have a look for "uconv", I think, or something similar on
Google. It looks also that these things can be done by using macros
created for OO (macros can be run from commandline as well; macros are
a version of BASIC, but one would need to spend some time to learn how
to program them). If indeed this could be accomplished well than OO
would become one of the best tools for creating even complex reports
on the fly.

zb.
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list