View Single Post
Old 11-19-2009, 08:06 AM   #1
scotsman
Enthusiast
scotsman doesn't litterscotsman doesn't litter
 
Posts: 32
Karma: 106
Join Date: Mar 2009
Device: irex DR1000S
viewing scribbles on your computer

Hi all,

I just fooled around a bit with the portable scribble merger (https://www.mobileread.com/forums/showthread.php?t=32602), and wrote a shell script which I can use as my standard pdf viewer, which allows me to view the pdfs with the scribbles on my computer screen. I just select the script in the "open with" dialog of my system.

I think this can be very useful for just skim-reading texts you have annotated on the DR1000 before.

Below is the script, feel free to improve it and post your suggestions here. Particularly, it does not distinguish different error messages of the scribble merger.
To avoid previous merged files to be accidentially deleted or overwritten, you can automatically rename all your previous merged files with the command
find ./ -name *Merged.pdf -exec rename "s/Merged/an/g" {} \;
from the root of your SD card (change "an" into anything you want)


#!/bin/bash
#view DR pdf files by first merging the file
options="-all -color blue"
pdfviewer="evince"

#possibly add -overwrite

mergedfile="${1/.pdf/_merged.pdf}"
path=${1%/*}
echo $path

if [ -e $path"/metadata.db" ] #needed because otherwise ism gives a fatal error
then
error=`ism $options $1`
else
error="no metadata"
fi
echo $error
#error=${error%$1*}
error=${error%% *} #cuts the error string to the first word (a bit dirty, but should be no problem unless ism gives more than one error message, which are then not distinguished)

if [ -z $error ]
then
$pdfviewer $mergedfile
rm $mergedfile
else
$pdfviewer $1
fi

Last edited by scotsman; 11-19-2009 at 09:33 AM. Reason: continued improving
scotsman is offline   Reply With Quote