ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Sorry but I think I didn't explain the whole question. In fact I need convert DOC and RTF files automatcly. I suposed I should use the OpenOffice's API. I've already visited www.openoffice.org, but I haven't found any information about it. The real question is how can I use that API in order to apply your sugestion.
I do this on a FreeBSD/Apache production web server. Several users responsible for document creation use Word then save as RTF. They use predetermined strings to identify dynamic text.
This is then parsed in a custom parsing class to basically str_replace each of the variables. From there the finished RTF is passed through rtf2pdf.sh (I use exec() from within my PHP script). I then either pass a link back to the user or fopen and stream the PDF to the user. It works well.
I recommend users use Wordpad since the RTF is simpler and well supported by Ted. As for .doc...I haven't researched that since rtf solved my problem.
The first reply is not an error. Open office can be automated with various scripting languages by using the UNO interface.
The level of automation possible is very general: We have python scripts that load a document, find some tables by searching for given formatting, create blank rows in those tables, fetch contents for the new rows from a database and save the result as PDF with a formatted schedule of values matching an industry standard form.
That said, OOo is a big, heavy server component, and I would like to play with something that runs nicely from the command line. I have a Linux environment in mind for final deployment, but my current test data is on Windows box. Is there a version of Ted compiled for Windows anywhere?
If I recall TED uses a script for conversion before loading the file. You could probably run it under windows using a bash.exe program like that in msys.
you can do nearly anything using cygwin on a windows machine on windows data.
then of course you can transfer directly over to real *nix.
I do this quite a lot myself.
There are a few articles that may help isolate utilities to read doc and rtf files. If the ones listed below do not serve, Googling for "linux convert microsoft word pdf" produces above 1M hits.
The first one is a thread that discusses a problem similar to the one you posted, and has some specifics.
The second includes wvWare, which I have not used ... best wishes ... cheers, makyo
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.