Author Topic: Word Processing mini HOWTO  (Read 2971 times)

jubjub

  • Newbie
  • *
  • Posts: 18
    • View Profile
Word Processing mini HOWTO
« on: September 11, 2004, 07:58:28 pm »
WORD PROCESSING WITH OPENZAURUS - MINI HOWTO

Version: 1.0
Date:    11 Sept. 2004
Author:  Michael Davis <slithy@yahoo.com>
Copying: Copy this document and use freely without restriction


CONTENTS

0. Introduction
1. Word Processors
2. Hancom Mobile Word
3. Printing


0. INTRODUCTION

This mini-HOWTO rose out of my frustrations with getting word processing
working on my Sharp Zaurus SL-5000D running OpenZaurus. The stock Word
Processor seems to be broken and I spent many hours searching the Internet
and playing with configurations late into the night before I finally
managed to produce and print a document using my Zaurus.

Most of the information in this HOWTO is available on the Internet in
one form or another, but as far as I could see, it is not all together
in one place. I have written this document in the hope that it will save
time and frustration for OpenZaurus users who wish to do simple word
processing on their handheld.

My Zaurus is a SL-5000D with a 256 Mb SD card, running OpenZaurus
3.3.6-pre1 (Hentges ROM) and Opie 1.1.3. My desktop system is Debian
GNU/Linux 3.0 (woody). Most of the comments below should apply to a
wider range of OpenZaurus ROMs and desktop OSes however.


1. WORD PROCESSORS

It has to be said that there is very little choice of Word Processors for
the Zaurus. Here are the options that I found out about:

- Opie-Write: this app comes as part of OpenZaurus/Opie, but it seems to be
  broken. As soon as you write more than one page of text, Opie-Write freezes.
  According to the bug tracker, this bug was fixed in CVS, but it is still
  present in Opie 1.1.3 (which I am using).
  See http://opie-bugs.oszine.de/bug_view_page.php?bug_id=0001167

- Hancom Mobile Word: from the stock Sharp ROM. It is possible to get this
  working under OpenZaurus/Opie, but there are some issues (see below).

- TextMaker: A commercial word processor available for a variety of desktop
  and PDA environments, apparently being beta tested for the Zaurus. At the
  time of writing this software is not yet available. When it is released,
  one advantage will be the possibility of using the same word processor on
  the desktop and on your Zaurus.
  See http://www.softmaker.de/index_en.htm

- Some people have reported using Abiword under PDAXROM, but as I am not
  using this ROM it was not an option for me and I have no further
  information.

- LaTeX is available but is a work in progress (no .ipk available). There
  has been murmuring for some time about porting Lyx but no results yet.
  See http://users.ox.ac.uk/~univ0103/z-tex/

I have not been able to find a reference to any other word processing
software other than the above. As most of the above software is either
broken, incomplete or not yet available, the only viable option for me
was to install Hancom Mobile Word, so the next section describes how to
do that.


2. INSTALLING HANCOM MOBILE WORD

It is possible to install Hancom Mobile Word (from the Sharp stock ROM) onto
OpenZaurus, but there are quite a few caveats. Here is a simple step-by-step
guide:

- First, you need to get a copy of the .ipk. There are tools available to
  extract this from your Sharp ROM (before you reflash) or from the
  installation CD, but it is easier just to download it from the Hancom
  website. Go to:

  http://mobile.hancom.com/download/product_num_reg.html

  and enter the serial no. from the back of your Zaurus. (I believe that this
  only works with Zaurus SL-5000D / 5500 / 5600). This will take you to a page
  where you can download the Hancom Mobile Word .ipk. The current version at
  the time of writing is hancommobileword_1.4.4_arm.ipk.

- Note that there are later versions of Hancom Mobile Word available (1.5.0)
  but these DO NOT WORK in OpenZaurus, so use the above .ipk instead.

- This .ipk is broken, so we have to fix it before installing:

  # tar zxvf hancommobileword_1.4.4_arm.ipk
  # tar zxvf control.tar.gz
  # vi control (or use your favourite text editor)

  There is a blank line between "Depends:" and "Priority:" in the control
  file. You should delete this line. Your control file should now look
  like this:

    Package: hancommobileword
    Installed-Size: 538444
    Filename: ./hancommobileword_1.4.4_arm.ipk
    Version: 1.4.4
    Depends: qpe-base (1.5.0)
    Priority: optional
    Section: qpe
    Maintainer: www.hancom.com
    Architecture: arm
    Description: HancomMobileWord

  Save this file, then:

  # tar zcvf control.tar.gz ./control
  # tar zcvf hancommobileword_1.4.4_arm.ipk ./data.tar.gz \
    ./control.tar.gz ./debian-binary

- If all went well, it should now be possible to install the .ipk. I
  installed it on my SD card:

  # ipkg -d sd hancommobileword_1.4.4_arm.ipk
  # ipkg-link add hancommobileword

- If you are using OpenZaurus 3.3.6-pre1 or later, this is compiled with ggc3.
  As Hancom Mobile Word is complied with gcc2, you need to install the
  compatibility libraries. See the oz-compat HOWTO:
  http://opie.handhelds.org/cgi-bin/moin.cgi...dcompat_20HowTo
  I had to restart Opie before setting up oz-compat.

Hopefully you should now have a working Hancom Mobile Word!


3. PRINTING

Hancom Mobile Word provides a basic text editing and formatting capability, but
has no facility to print. Of course, it is possible to copy .rtf files created
in Hancom Mobile Word to your desktop, then open in your usual word processor
and print from there. But wouldn't it be more convenient if you could print
directly from your PDA? Well, you can ... at least if your desktop OS is Linux.
Here's how I did it:

- On the desktop box, install lprng and Ted (a RTF editor/converter)
  See http://www.lprng.com
      http://www.nllgg.nl/Ted

- Set up lprng to print to your local printer. If you don't know how to do
  this, check out the tutorials and FAQs at http://www.linuxprinting.org.
  There is a graphical tool, lprngtool, which simplifies this process.

- Now you need to add a print queue to take rtf files as input. I added the
  following section to /etc/printcap:

  # Print RTF files
  rtf
        :lp=/dev/lp0
        :sd=/var/spool/lpd/rtf
        :af=/var/spool/lpd/rtf/acct
        :if=/usr/local/bin/psrtffilter
        :mx#0
        :sh

- Create the file /usr/local/bin/psrtffilter as follows:

  #!/bin/sh
 
  TMPFILE1=/tmp/ps2rtf$$
  TMPFILE2=/tmp/ps2rtf_ps$$
 
  cat - >$TMPFILE1
  ted --printToFilePaper $TMPFILE1 $TMPFILE2 a4
 
  # Here you need to send the contents of $TMPFILE2 to your printer.
  # This should work for a PostScript printer:
  #   cat $TMPFILE2
  # Or for a non-PostScript printer, use Ghostscript, e.g.:
  /usr/bin/gs -q -dBATCH -dSAFER -dNOPAUSE -sDEVICE=ljet4 -sPAPERSIZE=a4 \
  -sModel=unspec -sMediaType=plain \
  -sPrintQuality=presentation -sOutputFile=- $TMPFILE2
 
  # clean up
  rm -f $TMPFILE1 $TMPFILE2

- Don't forget to make the above file executable!

  # chmod 755 /usr/local/bin/psrtffilter

- Make sure that lprng is set up to accept remote jobs. The default
  configuration on my distribution is to reject remote jobs. You may
  need to edit /etc/lprng/lpd.perms. I had to comment out REJECT NOT
  SERVER and REJECT SERVICE=R FORWARD.

- Start (or restart) lprng and test by sending a local rtf file to the
  printer:

  # /etc/init.d/lprng start
  # lpr -Prtf test.rtf

- If that worked, you can now set up your Zaurus to print to this queue.
  First, get lprng for the Zaurus from http://www.wayga.org/ipkg/. I
  installed version 3.8.15-6.

- If installing on your root, this should install with no problems. But
  installation on the SD card is slightly broken. Follow these steps:

  # ipkg -d sd install lprng_3.8.15-6_arm.ipk
  # ipkg-link add lprng
  # cd /usr/lib
  # ln -s liblpr.so.0.0.0 liblpr.so.0

  There is also a directory of links created under /home/root/usr which
  are not required; I deleted this directory.

- It is not necessary to configure lprng on the Zaurus itself, as you can
  just print to lprng on your desktop:

  # lpr -Prtf@mydesktop myfile.rtf

- For the above to work, make sure that your desktop's IP address is
  added to /etc/hosts.

This doesn't allow printing from within Hancom Mobile Word; you do need to
open a terminal to print. However, it is no longer necessary to transfer files
to your desktop or open a desktop word processor.


I hope that this mini-HOWTO is of use to some who, like me, want to use their
Zaurus for word processing and printing.

Teletubbie

  • Sr. Member
  • ****
  • Posts: 252
    • View Profile
    • http://
Word Processing mini HOWTO
« Reply #1 on: September 11, 2004, 08:26:57 pm »
Hi,
Nice howto. It would make sense to put it in a howto section. Maybe it will get lost in forum and the frequently asked question comes back  

There is just one note: If you use tar on debian sarge/sid or gentoo machine, then you need to give tar the option --format=oldgnu. Otherwise ipkg can't handle the ipk.
Cheers,
Sam
« Last Edit: September 11, 2004, 08:28:33 pm by Teletubbie »
SL-5500G
OZ 3.3.6-pre1
Opie 1.1.4

lardman

  • Hero Member
  • *****
  • Posts: 4512
    • View Profile
    • http://people.bath.ac.uk/enpsgp/Zaurus/
Word Processing mini HOWTO
« Reply #2 on: September 12, 2004, 06:35:54 am »
Yes, nice HowTo.

Have you tried compiling a Zaurus native version of Ted, perhaps command line only (see possible rtf2ps patch here: http://oss.ezic.com/), then use native ghostscript (which is also available somewhere or other) to print directly?

Much the same as what you've said, but removes the need for an external machine. Just a thought as I've not tried it.


Si
C750 OZ3.5.4 (GPE, 2.6.x kernel)
SL5500 OZ3.5.4 (Opie)
Nokia 770
Serial GPS, WCF-12, Socket Ethernet & BT, Ratoc USB
WinXP, Mandriva

bb

  • Jr. Member
  • **
  • Posts: 88
    • View Profile
    • http://
Word Processing mini HOWTO
« Reply #3 on: September 12, 2004, 11:11:03 am »
Quote
WORD PROCESSING WITH OPENZAURUS - MINI HOWTO

...<snip>...
I just tried installing LPRng on my Zaurus C860 with the intent of printing to my desktop printer. Both when trying to install version 3.8.15-2 and version 3.8.15-6, I get a dialog box with the message: "ipkg said something went wrong.".

Has anyone else experienced something similar when installing LPRng on a C860?
Best regards,
bb
SL-C860, Cacko 1.23 ROM
512MB SanDisk SD, Origo CF WiFi

lardman

  • Hero Member
  • *****
  • Posts: 4512
    • View Profile
    • http://people.bath.ac.uk/enpsgp/Zaurus/
Word Processing mini HOWTO
« Reply #4 on: September 13, 2004, 05:47:22 am »
One more quick note, I don't have a /bin/bash binary on my Z, so the hancom Word postinst script fails, and this stops the whole lot from installing. To fix this either edit the script or create a symlink from /bin/sh to /bin/bash.

@bb: Try it from the command line...


Si
C750 OZ3.5.4 (GPE, 2.6.x kernel)
SL5500 OZ3.5.4 (Opie)
Nokia 770
Serial GPS, WCF-12, Socket Ethernet & BT, Ratoc USB
WinXP, Mandriva

jubjub

  • Newbie
  • *
  • Posts: 18
    • View Profile
Word Processing mini HOWTO
« Reply #5 on: September 13, 2004, 01:11:42 pm »
Teletubbie: I looked at the HOWTO section but couldn't see how to submit a new HOWTO?

Lardman: What you say about native ted/gs should be possible, but I don't have a cross-compilation environment set up, and I have plenty of other projects to waste my time on :-) But if you want to give it a go, let me know how you get on.

I have refined the print filter on my desktop Linux box, so that it can handle printing text files, RTF files or PostScript files. I created the following aliases in my .profile on the Zaurus:

alias lp='lpr -Prtf@gibson'
alias lpq='lpq -Prtf@gibson'
alias lprm='lprm -Prtf@gibson'

gibson is added to /etc/hosts

So now "lp filename" is enough to print any text or RTF file from the Zaurus. I created and printed a couple of simple documents this weekend and was very pleased with the results. The only thing that I would like to be able to do is change the size of fonts used in headings - are there any scalable fonts for the Z?


Here is the new /usr/local/bin/psrtffilter:

#!/bin/sh
                                                                                   
TMPFILE1=/tmp/ps2rtf$$
TMPFILE2=/tmp/ps2rtf_ps$$
                                                                                   
cat - >$TMPFILE1
FILETYPE=$(file -ib $TMPFILE1 2>/dev/null)
                                                                                   
if [ "$FILETYPE" = "text/rtf" ]
then
  ted --printToFilePaper $TMPFILE1 $TMPFILE2 a4 2>/dev/null
else
  # assume its a text or PostScript file
  enscript --pass-through --no-header --margins=30:30:60:30 -p $TMPFILE2 $TMPFILE1
fi
                                                                                   
# now print the results ...
/usr/bin/gs -q -dBATCH -dSAFER -dNOPAUSE -sPAPERSIZE=a4 \
  -sDEVICE=ijs -sIjsServer=hpijs -sDeviceManufacturer=HEWLETT-PACKARD \
  -sDeviceModel='DESKJET 3820' -dIjsUseOutputFD -sOutputFile=- $TMPFILE2
                                                                                   
# clean up
rm -f $TMPFILE1 $TMPFILE2