Viewing M$ word in 0.9.3


Forum: DSL Ideas and Suggestions
Topic: Viewing M$ word in 0.9.3
started by: nucpc

Posted by nucpc on Feb. 03 2005,20:04
Congratulations on 0.9.3, beautiful work.

I don't know if its just the documents I'm viewing (which should be
fairly demanding) but,

antiword -p a4 filename > /tmp/temp.ps
gvu /tmp/temp.ps

is giving some great results and is a gift to script...
(doesn't often like direct `piping'  thus the need for tmp)

Posted by cbagger01 on Feb. 05 2005,05:57
Funny that you mention this.  Great minds think alike. My thoughts were to create a short shell script that does something like this:

Code Sample
#!/bin/bash
#
#  wordview   Rev0 2/5/05
#  originally submitted by cbagger01 from the DSL forum
#
antiword -p letter "$*" > /tmp/"$*".ps
gvu /tmp/"$*".ps
rm /tmp/"$*".ps
exit



save the script as wordview  and then do a "chmod 755 wordview" to make it executable.

and then associate the *.doc extension to run "wordview" in the emelfm file manager.

So then all you need to do is double-click on the Word document and up pops the nice formatted postscript conversion of your document for viewing or printing.

Give it a try.  Maybe it is worth adding in a future version of DSL.

Posted by roberts on Feb. 05 2005,17:56
FYI, around 0.9.0 build we tried to eliminate Xpdf by using a technique very similar to the above suggestion. But it was dropped because of gvu rendering ability of some postscript files.
Posted by nucpc on Feb. 06 2005,17:12
Hi Cbagger, great to be in good company.

Robert, I finally got the script to fall over (a little bit) on one document when it got confused
around an included image (where upon it just produced a few blank pages before returning
text) but apart from that I've not hit big trouble (with -p a4 postscript output).

Accepting it might never be clean enough for DSL: antiword + gvu is however definitely
beating wvHtml + dillo, or previously, wvLaTeX + latex2rtf + Ted or any other combinations
I've tried. Perhaps still worth consideration??

Posted by nucpc on Feb. 07 2005,11:00
Hi again CB, Robert,
CB - I've just noticed that in the `word processor' posts from a while back you'd
already mentioned antiword and (oh yep) gv in almost the same sentence....
hmmm, beginning to get the feeling I'm a few steps behind folk....
I'll try to stay a bit more up to date in future. Cheers.

Posted by Doofer on Feb. 07 2005,12:07
To interact better with Gatesworld, it'd be nice to have the choice of (formatted, read-only) gvu or (editable, save as rtf) flwriter. Is there an easy way to offer this?

If I were a programmer - Deedlidle-deedlidle-deedlum - how hard to hack gvu & flwriter to add 'open .DOC', using antiword, to their Open File dialogues?

Posted by remo on Feb. 07 2005,13:27
Loved your script cbagger! I tried it out and came up with a couple of possible adjustments:

Edit-1

#!/bin/bash
#
#  wordview   Rev0 2/5/05
#  originally submitted by cbagger01 from the DSL forum
#
antiword -p a4 "$*" > /home/knoppix/tmp/"$*".ps
ps2pdf /home/knoppix/tmp/"$*".ps
xpdf "$*".pdf
rm "$*".pdf
exit

This creates a pdf-file which is opened in xpdf.


Edit-2

#!/bin/bash
#
#  wordview   Rev0 2/5/05
#  originally submitted by cbagger01 from the DSL forum
#
antiword "$*" > /home/knoppix/tmp/"$*".txt
ted /home/knoppix/tmp/"$*".txt
rm /home/knoppix/tmp/"$*".txt
exit

This script converts the word-document to .txt and opens it in Ted.
It could of course be opened in any word-processor/text-editor that can read .txt files.

Lots of possibilities with this scripts. So, thanks again!

-r

Posted by cbagger01 on Feb. 09 2005,06:09
Cool.

I like the PDF tweak.  I did not realize that ps2pdf was included in DSL.

It gives me the new idea to allow the user to keep their converted *.pdf file for future use and save it to the current directory and then clean up the old *.ps file.

PDF files are good because they can be viewed on almost any computer running a semi-recent operating system.

Posted by RoGuE_StreaK on Feb. 13 2005,04:12
Tried this today, but nothing worked - when I try just "antiword", it says it can't find it (0.9.1).  Then tried the "/usr/lib/siag/antiword/antiword" (or similar), it found antiword, but the when I modified the doc2pdf script, still didn't work?
Haven't burnt 0.9.3 yet - is there any difference here?

On a related but general note, is there any way to bring up a terminal so it shows the error messages you sometimes only see after you exit out of X?  (like when you load a theme that has errors, you don't see the errors until you get out of X)

Posted by cbagger01 on Feb. 13 2005,07:14
I think that antiword and gvu were moved into a stanard bin folder like /usr/bin or /usr/X11R6/bin so they are easily found in your path.

This change seems to take place with DSL version 0.9.3

But antiword and gvu have been kicking around in different directories ever since siag was added to the DSL livecd.

Posted by roberts on Feb. 17 2005,16:48
I have resurrected the GUI code that I was working on, antiword and ps2pdf, for 0.9.0 and have updated it with many ideas from this thread. We will have a more powerful Word Viewer/Converter in the next release. This was a good thread. Thanks to all.
Posted by softgun on Feb. 21 2005,18:45
Quote (roberts @ Feb. 17 2005,11:48)
I have resurrected the GUI code that I was working on, antiword and ps2pdf, for 0.9.0 and have updated it with many ideas from this thread. We will have a more powerful Word Viewer/Converter in the next release. This was a good thread. Thanks to all.

Do we then need FL writer?
For those who really need a word processor abiword and open office are available as extensions.

Posted by cbagger01 on Feb. 21 2005,18:59
Yes, we still need something like FL writer.

All these programs do is let you view MSWord files OR let you convert them to PDF format.

They do not let you write your own documents like a word processor program.  For that you need something like TED, FL Writer or Pathetic Writer.

Posted by RoGuE_StreaK on Mar. 05 2005,03:21
Tried the scripts again today (well, doc2pdf...), didn't work so I tried disecting it a bit, it hits an error on the first command, antiword outputing to a ps file => says "I can not open your font names file for reading"
Any thoughts?
When I just do "antiword -p A4 suchandsuch.doc" it shows the contents in the term, in what looks maybe like a postscript format, but outputting it to a .ps file results in said error?

Posted by nucpc on Mar. 06 2005,21:07
RS, so even if it does give you the error can it make a .ps file? It sounds like it trying
to output something and so ' > temp.ps' shouldn't really upset it anymore than it already
is and ` gs temp.ps ' might give you something (with a substitute font).

Posted by gunnix on Mar. 08 2005,22:16
Hi,

I followed this thread with great interest. I looked to get something similar for excel and powerpoint files.

In combination with xlhtml and this script < http://users.skynet.be/six/gpure/tech/linux/config/xls2html >
I view excell files in dillo.

In combination with pptview and this script < http://users.skynet.be/six/gpure/tech/linux/config/ppt2html >
I view powerpoint files in dillo.

It's very useful on an old machine which can't run those heavy office programs but you want to get a preview anyway... It would better to have a program to convert it to a ps file tho. But I didn't find that.

grtz

Posted by cbagger01 on Mar. 09 2005,04:53
Those scripts look pretty neat.

Where do you get xlhtml and pptview and how big are they?

Posted by reidar on Mar. 09 2005,07:15
Hey, thanks a lot gunnix!!! I didn't even know an xlhtml or ppthtml existed. But they seem to be available through apt-get, so I bet we could make dsl-packages out of them using cbagger's script!

This is really good!

-r

Posted by gunnix on Mar. 09 2005,12:52
I ment ppthtml in my post, not pptview. I just named the script pptview on my computer, that's why.

The programs are very small. Don't thank me, thank the author ;)

grtz

Posted by nucpc on Mar. 09 2005,21:10
Gunnix, many thanks for the post - along with reider I didn't know of ppthtml and xlhtml
but now I've seen them I think they are musts for DSL. The xlhtml was particularly nice and
at 19 K and 60 K (uncompressed) respectively with no libs surely they'd compliment the distro!!

Thanks again.

Posted by roberts on Mar. 17 2005,04:19
Another great thread. Thanks guys. Look for Gunnix's suggestion in RC2.
Posted by clivesay on Mar. 25 2005,17:36
gunnix -

I have the script. Exactly what command do I use to view a file? I'm not having much luck. Thanks

Chris

Posted by gunnix on Mar. 25 2005,17:51
Hey clivesay, be sure to install xlhtml and ppthtml first. I use dillo to view the html file, but you can change that in the script.
The command is: xls2html file.xls (if you named the script xls2html)
The other one is similar: ppt2html file.ppt

grtz

Posted by clivesay on Mar. 25 2005,18:05
Got it! Thanks!

Chris

Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.