Scripts to convert files to/from Palm's PDB format
Jun 27, '06 07:30:00AM
Contributed by: tangawk
I often like to read and edit documents, articles, and papers on my Palm device (using the excellent QED), and then continue back at home on the Mac. This requires quick and easy inter-conversion from .txt to .pdb. In addition, for reading PDFs as text, the conversion must respect the column flow in multi-column PDF fliles (or else you end up reading across, rather than down, the columns in your text file).
This is how to create AppleScript droplets to convert text, PDF, and Word documents to .pdb and then back to text.
- Read and follow this excellent hint for converting text to pdb for Palm OS. Make sure during this you pay attention to:
- Installing xCode tools first (to compile unix make/install files)
- The tips about using sudo to avoid "permission denied" errors
In fact, to use these droplets, you don't need to get the AppleScript on the above site to work (just compile xpdf and text2pdb), but it is very useful so I'd do it anyway.
- Use the following scripts to do your conversions...
[robg adds: I haven't tested these scripts, and any errors are probably a result of my bad work with cut-and-paste...]
The Scripts:
So now follow the other scripts for other tasks. Again, replace my path:
Users/tangawk/Desktop/pending_junk/boks
with your own in each script, then keep all the saved applets there so you can drag and drop to convert at will!
- Text to PDB
- PDF to text
- PDF to PDB -- this is a droplet version of the script linked in the hint at the start of this hint. Again, it's great for batch conversion of scientific papers for reading on your Palm on the train. Edit in QED, then drop the PDB back on the pdb-text applet above, and continue at home!
- RTF/DOC/HTML to text via Word -- this was written to batch convert .rtf or .doc to .txt for subsequent conversion to .pdb or other things. Useful if your eBook comes as .rtf, and you want it as .pdb. Make sure your version of Word is set to open without the welcome screen, or the script will founder. At a pinch, the script will also work with simple .html files, as Word will recognise and convert these (ie strip HTML code from text).
Change .rtf in the renaming part of the script to doc or html as appropriate (but as previously, conversion to text will still occur).
If there are any slick scripters out there who can tidy this code up, I'd love to hear from them, but they work great in their current mode. Hope they're useful to others!
Comments (4)
Mac OS X Hints
http://hints.macworld.com/article.php?story=20060624121633885