Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > More E-Book Readers > iRex

Notices

Reply
 
Thread Tools Search this Thread
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
Old 11-21-2009, 08:40 AM   #2
scotsman
Enthusiast
scotsman doesn't litterscotsman doesn't litter
 
Posts: 32
Karma: 106
Join Date: Mar 2009
Device: irex DR1000S
help for improvement

I think the above script could be improved if it were possible to specify an output path for the ism merged file. Then one could write that file to a temporary location (some directory mounted tmpfs), which would reduce writes to the SD card and probably increase performance of the scribbling and reading part.

Is ism capable of such an option? The documentation does not show any.
scotsman is offline   Reply With Quote
Advert
Old 11-22-2009, 12:55 PM   #3
thomega
Connoisseur
thomega began at the beginning.
 
Posts: 56
Karma: 22
Join Date: Oct 2008
Location: Würzburg, Germany
Device: iRex DR1000S
Quote:
Originally Posted by scotsman View Post
I think the above script could be improved if it were possible to specify an output path for the ism merged file.[...]
Is ism capable of such an option?
Good idea. I should add this option.
thomega is offline   Reply With Quote
Old 11-07-2010, 08:55 PM   #4
scotsman
Enthusiast
scotsman doesn't litterscotsman doesn't litter
 
Posts: 32
Karma: 106
Join Date: Mar 2009
Device: irex DR1000S
updated version, to also work with firmware 2.0

Hi all,

I got a new version of the scribble viewer script. It works with firmware 2.0 if you use my converter script on https://www.mobileread.com/forums/sho...61#post1204261
It copies the metadata to a temporary location before converting it back to version 1.x, so your original data does not get messed up.

#!/bin/bash
#view DR pdf files by first merging the file

#todo: rewrite file names with spaces into proper linux filenames with space indicators. Otherwise trouble with some pdfs


tempdir=/tmp/ism
suffix="_ismtempfile"
options="-all -color blue -opacity 1 -suffix $suffix"
pdfviewer="evince"

if [ ! -e $tempdir ];then mkdir $tempdir; fi

#possibly add -overwrite
#echo $1 > /tmp/DRpdfview.log
path=`dirname $1`
file=`basename $1`
mergedfile="${file/.pdf/$suffix.pdf}"
if [ "$path" = "$1" ] #to avoid problems when no path is given
then
path=""
fi

if [ -e $path"/metadata.db" ] #needed because otherwise ism gives a fatal error
then
cp $path"/metadata.db" $tempdir
cp $1 $tempdir
DRmetadata_converter.sh $tempdir"/metadata.db"
error=`ism $options $tempdir"/"$file`
rm $tempdir"/"$file
rm $tempdir"/metadata.db"

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 $tempdir"/"$mergedfile
rm $tempdir"/"$mergedfile
else
$pdfviewer $1
fi

#this command renames all files with Merged.pdf into _an.pdf
#find ./ -name *Merged.pdf -exec rename "s/Merged/an/g" {} \;
scotsman is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Scribbles - Exporting to your PC (How to) LivresInOz Onyx Boox 2 07-19-2010 07:03 PM
Better way of merging Scribbles? Jürgen Hubert iRex 15 08-14-2009 11:04 AM
Scribbles and Jpgs pthwaite iRex 4 03-17-2009 12:45 AM
From iLiad to DR1000: Scribbles? Gogolo iRex 4 11-03-2008 02:53 PM
Merging Scribbles with Pdf jæd iRex 15 12-20-2006 04:40 AM


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


MobileRead.com is a privately owned, operated and funded community.