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-09-2007, 05:55 PM   #1
chrylis
Junior Member
chrylis began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Nov 2007
Device: iLiad v2
Converting text to PDF with a2ps

Most Linux/Unix systems include the a2ps utility, which can pretty-print text files into PostScript or PDF. Unfortunately, the default a2ps setup isn't very iLiad-friendly, particularly in its selection of fonts that are hard to read on the iLiad's screen.

I've put together a small package that enhances a2ps's settings for printing to PDF for the iLiad. It uses the Bera font family (Bitstream Vera in Type1), which I find much easier to read on the iLiad.

If you have suggestions, especially on how to get a2ps to work more easily with extra fonts, please let me know!
Attached Files
File Type: gz a2ps-iliad-0.01.tar.gz (2.8 KB, 394 views)
chrylis is offline   Reply With Quote
Old 11-09-2007, 07:17 PM   #2
chrylis
Junior Member
chrylis began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Nov 2007
Device: iLiad v2
I also belatedly realized that on my system, this has problems with filenames containing spaces. The latest version of a2ps (4.13) handles the spaces correctly, but ps2pdf (in GPL Ghostscript 8.60) fails. The easiest workaround is to use underscores instead of spaces.
chrylis is offline   Reply With Quote
Advert
Old 11-09-2007, 08:12 PM   #3
tirsales
MIA ... but returning som
tirsales ought to be getting tired of karma fortunes by now.tirsales ought to be getting tired of karma fortunes by now.tirsales ought to be getting tired of karma fortunes by now.tirsales ought to be getting tired of karma fortunes by now.tirsales ought to be getting tired of karma fortunes by now.tirsales ought to be getting tired of karma fortunes by now.tirsales ought to be getting tired of karma fortunes by now.tirsales ought to be getting tired of karma fortunes by now.tirsales ought to be getting tired of karma fortunes by now.tirsales ought to be getting tired of karma fortunes by now.tirsales ought to be getting tired of karma fortunes by now.
 
tirsales's Avatar
 
Posts: 1,600
Karma: 511342
Join Date: Nov 2007
Location: Germany
Device: PRS-505 and *Really* not owning a PRS-700
Sorry, mixed up $* and $@

NTL Using
"$@" instead of $@ works on my system, even when using multiple arguments (e.g. a2ps-iliad "READ ME" "README" "FOO BA"
converts the files "READ ME", README and "FOO BA"

Last edited by tirsales; 11-09-2007 at 08:20 PM.
tirsales is offline   Reply With Quote
Old 11-09-2007, 10:02 PM   #4
chrylis
Junior Member
chrylis began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Nov 2007
Device: iLiad v2
update to package

I incorporated the "$@" since it didn't hurt anything on my system, but I still get an error if I use a filename with spaces. (The error is coming from a bug in ps2pdfwr, which is part of the ghostscript package; if you have a different ghostscript, it may work fine.)

Also, I've overridden the default 24-pt margins to provide slightly more room (since the iLiad isn't actually printing, it doesn't technically need margins at all).
Attached Files
File Type: gz a2ps-iliad-0.02.tar.gz (3.0 KB, 351 views)
chrylis is offline   Reply With Quote
Old 11-10-2007, 04:20 AM   #5
tirsales
MIA ... but returning som
tirsales ought to be getting tired of karma fortunes by now.tirsales ought to be getting tired of karma fortunes by now.tirsales ought to be getting tired of karma fortunes by now.tirsales ought to be getting tired of karma fortunes by now.tirsales ought to be getting tired of karma fortunes by now.tirsales ought to be getting tired of karma fortunes by now.tirsales ought to be getting tired of karma fortunes by now.tirsales ought to be getting tired of karma fortunes by now.tirsales ought to be getting tired of karma fortunes by now.tirsales ought to be getting tired of karma fortunes by now.tirsales ought to be getting tired of karma fortunes by now.
 
tirsales's Avatar
 
Posts: 1,600
Karma: 511342
Join Date: Nov 2007
Location: Germany
Device: PRS-505 and *Really* not owning a PRS-700
The difference is:

Quote:
Originally Posted by test.sh
#! /bin/bash

for i in $@ ; do
echo "'$i'"
done

echo "With quotes"

for i in "$@" ; do
echo "'$i'"
done
results in:

Quote:
./test.sh fooba "duuba" "dooba du"
'fooba'
'duuba'
'dooba'
'du'
With quotes
'fooba'
'duuba'
'dooba du'
You can see that "dooba du" will be used as two arguments with $@, one arg with "$@" which is kinda strange 'cause $@ sould do exactly this (quoting arguments), but it is reproducable on a number of systems.

Have you tested using
Quote:
arg=''

for i in "$@" ; do
j=`echo $i | sed 's/ /\\ /'`
arg=$arg $j
done

a2ps ... $arg
or something similar with escaping, not quoting, the strings? Or using both? (arg=$arg '$j') as it could be a similar problem with multiple scripts run after each other?
e.g. a2ps running "a2pdfwr $@" or whatever.

I can't test it myself, my ps2pdfwr seems to work

Last edited by tirsales; 11-10-2007 at 04:23 AM.
tirsales is offline   Reply With Quote
Advert
Old 11-12-2007, 03:09 AM   #6
chrylis
Junior Member
chrylis began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Nov 2007
Device: iLiad v2
I'm familiar with what the difference is. (I'm more of a Ruby person, but I consider myself shell-literate enough to read the scripts.)

Before placing the blame on ps2pdfwr, I did check everything by hand to verify that it's a problem with interactions with a2ps's delegators. ;-) And, quite frankly, since it's not a major issue for me at the moment, I'm content to let it lie unless it becomes a problem for someone else.
chrylis is offline   Reply With Quote
Old 11-21-2007, 04:10 AM   #7
canfish
Junior Member
canfish began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Sep 2007
Device: +27 (073) 2426052
In Awe

Hi
I and in awe of the skill and inventiveness of Mobileread forum contributers they are making the iLiad reader a multitasking tool! but really I bought just to help me read web documents. Having read the forum I see that I can make my iLiad play music. So tell me how can I make this happen? oh and can I get it to play podcasts as well?
canfish is offline   Reply With Quote
Old 11-23-2007, 11:46 AM   #8
chrylis
Junior Member
chrylis began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Nov 2007
Device: iLiad v2
Quote:
Originally Posted by canfish View Post
Hi
I and in awe of the skill and inventiveness of Mobileread forum contributers they are making the iLiad reader a multitasking tool! but really I bought just to help me read web documents. Having read the forum I see that I can make my iLiad play music. So tell me how can I make this happen? oh and can I get it to play podcasts as well?
Hey there! I bought mine for a very similar reason; however, many of the documents I need to read (such as RFCs) come in a specific text format that works much better when preformatted on the computer (with specific fonts, etc).

As far as playing music, I haven't messed with that yet; you're likely to get more exposure to your question by posting a new thread instead of just replying here, since it's about a different subject. The one tip I can give you is to look into the "mpd" (music player daemon) package. Good luck!
chrylis is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting certain punctuations from text to epub greenapple Calibre 2 05-28-2010 08:27 PM
Converting pdf to text with Adobe Digital kezzie PDF 3 02-28-2010 04:14 AM
Converting OCR Text files jedavis1 Workshop 10 10-01-2009 10:09 PM
Converting PDF - Removing text at top of pages halljames Calibre 4 07-21-2009 07:00 AM
Text becomes center-aligned when converting Alfy Calibre 12 01-19-2009 12:41 AM


All times are GMT -4. The time now is 05:11 PM.


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