Ubuntu Forums ubuntu.com - launchpad.net - ubuntu help  

Go Back   Ubuntu Forums > The Ubuntu Forum Community > Other Community Discussions > Tutorials & Tips
Register Reset Password Forum Help Forum Council Search Today's Posts Mark Forums Read

Tutorials & Tips
The place to find Ubuntu related Tips & Tricks.

 
Thread Tools Display Modes
Old March 3rd, 2006   #1
WolfJay_83
Just Give Me the Beans!
 
WolfJay_83's Avatar
 
Join Date: Jul 2005
Location: Waterloo, Canada
Beans: 42
Send a message via MSN to WolfJay_83
Lightbulb Howto: Download Word docs as PDF's, rtf's or latex from firefox

All my proffessors post their sylabi and documents online as word documents, I hate downloading them because I have to fire up a word processor just to read a short document.

wvware is a command line package that can convert microsoft word files to PDF, rich text or latex (among others) see: http://wvware.sourceforge.net/#wv
You can download it in synaptic - search for wv, you also need tetex-extra.
Alternatively, you can open a terminal and type:
Code:
sudo apt-get install wv tetex-extra
If it doesnt work, you may need to configure extra repositories: https://wiki.ubuntu.com/AddingRepositoriesHowto


To get firefox to use wvware to download word documents as any of these files, here are the steps....

Create a text file with the following:
Code:
#!/bin/bash
wvPDF ${1:5} ${1:5}.pdf
firefox ${1:5}.pdf
Save the script and make it executable:
Save it as "Download_PDF" in your home directory or where ever you want.
Open a terminal, (and go to the directory if you had something other than home)
type: chmod +x Download_PDF
that will make it an executable shell script.

Make firefox use it as a program
When you click to download a text file, firefox will ask if you want to open it with your default word-processor. Click the dropdown and select "other".
Locate your "Download_PDF" script. - firefox will remember this from now on.
Clicking "ok" will pop up a new file open or save window for a new pdf file.

The end result:

when you click to download a word file, if you select "Download_PDF", it will pop up another window allowing you to open or save the pdf file instead of the orrigional word file.

Modifications
instead of using wvpdf in the script, you can use
wvhtml -html output - will load right in firefox
wvlatex -latex output
wvrtf - microsoft rich text format
wvtext -converts to plain text - may also load in firefox

notes
If you download a filename "document.doc", this will result in a pdf file called "document.doc.pdf" This is not a problem, however, astheticaly, someone may want to improve on this.

I am not sure how to edit the list of programs firefox uses by default. It would be handy to be able to have all of the possible conversions listed on the dropdown of "open with". Any suggestions?

I did this because no firefox extension exists with this functionality. If someone knows of an extension, or would like to make one that does something like this, I'm sure it would be handy. -I dont know anything about programming extensions.
__________________
Jason Locklin
Undergraduate Psychology Student, University of Waterloo
Homepage
WolfJay_83 is offline   Reply With Quote

Bookmarks

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:02 AM.


vBulletin ©2000 - 2009, Jelsoft Enterprises Ltd. Ubuntu Logo, Ubuntu and Canonical © Canonical Ltd. Tango Icons © Tango Desktop Project. lingonberry