LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 09-03-2009, 08:37 AM   #1
dbc001
Member
 
Registered: Jan 2004
Distribution: Slackware, Ubuntu
Posts: 97

Rep: Reputation: 15
Script to convert OOo docs to text over ssh (Almost there - help!)


Posting this to the server forum because it involves scripting on a headless server.

I'm trying to get a script that will convert openoffice.org docs (.odt) to text over ssh or via cron job. I found a script that works here:
http://www.togaware.com/linux/surviv...t_MS_Word.html
Baiscally the site provides a macro, which gets invoked thusly:
Code:
#!/bin/sh

DIR=$(pwd)
DOC=$DIR/$1

/usr/bin/oowriter -invisible "macro:///Standard.Module1.ConvertWordToPDF($DOC)"
Code:
$ doc2pdf my.doc
But that seems to require an X11 display, and as I said, I'll be running this over ssh and via cron so by default there's no X display available.

Here's the error I get when I run the script as described in the tutorial above:
Code:
$ ./doc2txt.sh ~/Documents/resume\ 2008.odt 
javaldx: Could not find a Java Runtime Environment! 
$ /usr/lib/openoffice/program/soffice.bin X11 error: Can't open display: 
   Set DISPLAY environment variable, use -display option
   or check permissions of your X-Server
   (See "man X" resp. "man xhost" for details)
I definitely do have a Java Runtime Environment - openoffice runs fine when logged in locally.

So my question is, how do I tell my script where my JRE is, and how do I pass openoffice to a local display?

Thanks in advance for the help!

P.S. I'm running Ubuntu 8.10.
 
Old 09-03-2009, 10:13 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Sounds like a job for xvfb:

http://linux.about.com/cs/linux101/g/xvfb.htm
 
Old 09-03-2009, 03:26 PM   #3
dbc001
Member
 
Registered: Jan 2004
Distribution: Slackware, Ubuntu
Posts: 97

Original Poster
Rep: Reputation: 15
I just discovered this:
http://www.oooforum.org/forum/viewtopic.phtml?t=11890
I'll report back if it works.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Convert MS word docs to .tex file kushalkoolwal Linux - Software 2 08-14-2009 03:02 PM
Convert docs to postscript? okos Linux - Software 4 10-01-2007 09:17 PM
Hyperlinks in OOo docs leupi Linux - Software 5 04-17-2005 10:55 AM
Convert OOo files to pdf format LinuxLala Linux - Software 5 08-19-2004 12:32 PM
how to convert a text file into shell script meng_en Linux - General 9 10-15-2002 10:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration