Tuesday, July 8, 2008

Reading PDFs on a PRS-505

Update 07/28/2008: maybe the conversion PDF to LRF is obsolete on the PRS-505. With this firmware update the PDFs are rendered much much better (but still not better than the following conversion).




Since some months I'm an happy user of a Sony Portable Reader System (PRS-505).


It's a fantastic device, and actually I can comfortably read digital articles and books, instead of burning my eyes in front of a lightly monitor.

I can even use it with Linux, thanks to Calibre.

The PRS-505 can natively read PDF files, but the rendering is not always appropriate, and it's very difficult to read long text without headaches. So, I usually convert them from PDF to LRF.

Look at the result. On the left the original PDF. On the right the same page in the resulting LRF.


The conversion is very easy. You mainly need Ghostscript, for embedding all fonts in the PDF, and the pdflrf converter.

I wrote a simple script for easily run them with the correct parameters:

#!/bin/sh
# pdflrf_converter.sh by Lucio Benfante

gs -dSAFER -dNOPLATFONTS -dNOPAUSE -dBATCH -sDEVICE=pdfwrite \
-dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer \
-dCompatibilityLevel=1.4 -dMaxSubsetPct=100 \
-dSubsetFonts=true -dEmbedAllFonts=true \
-sOutputFile=$1.embedding -f $1

pdflrf -r --rotation="0" --colors=8 -i $1.embedding -o $1.lrf

rm $1.embedding

Launch it with passing your PDF file as its single parameter:
pdflrf_converter.sh myBook.pdf

Please let me know if it's useful for you, or if you could find a better set of parameters for gs/pdflrf.

19 comments:

Anonymous said...

Thanks for the info! But how can I put your program into ghostscript?

Lucio Benfante said...

GoRob, I'm not sure I understood what you are asking. My script is using Ghostscript. You must install Ghostscript and launch it (gs...).

Anonymous said...

I have Ghostscript installed in my PC already. After launched it, it showed "gs>", then I tired to enter your scripts, but it didn't allow me to enter multiple lines, and after I hit enter in the end of the first line, it gave me error. And it won't allow me to copy your whole scripts (became a weird sign like "[]"). Wondering if I installed a different version of ghostscipt or wrong way to input?

Lucio Benfante said...

GoRob, You are on Windows, isnt'it?

You have to type at the command prompt the command gs followed by parameters ALL IN THE SAME LINE.

Something like:

gs -dSAFER -dNOPLATFONTS -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -dCompatibilityLevel=1.4 -dMaxSubsetPct=100 -dSubsetFonts=true -dEmbedAllFonts=true -sOutputFile=myfile.pdf.embedding -f myfile.pdf

then:

pdflrf -r --rotation="0" --colors=8 -i myfile.pdf.embedding -o myfile.lrf

Anonymous said...

Thanks for the instruction. But it still didn't work (. I use windows. And does the "myfile.pdf" has to be the pdf file that I want to convert? If so, where should I move that file to? I use pdflrf 0.99verion to do the convertion. It was good, but the display isn't that nice. Can your scripts fix it? Thank you.

Lucio Benfante said...

Yes, it's the file you are converting. It must be in the same directory you execute the script (or provide the full path on the command line).

Yes, my script enhance a little the output of pdflrf.

sys.out said...

Hi Lucio..
have you tried to read PDF programming manuals like O'Reilly 8.5x11 PDFs?

Thanks in advance
Michele

Lucio Benfante said...

Hi Michele,
no, I never tried with O'Reilly PDFs.

Only with those from Pragmatic Programmers and Packt.

sys.out said...

Thank for your answer Lucio :)!
Have you never tried Pdf2lrf?
I'm actually reading a lot of posts on PSR-505 (it's on my wishlist) and it seems a great solution for PDF reading.

Michele

Lucio Benfante said...

Hi Michele,
I tried pdf2lrf about an year ago. The output of pdflrf was much better.

I'm very satified of my PRS-505.

Another great reader is the iLiad:

http://www.irextechnologies.com/products/iliad

...available even in Italy:

http://store.simplicissimus.it/

Endovenoso said...

Hi Lucio, thanks for the post, i have an innocent question, with this conversion you enhance the rendering of the pdf file but it also improves the speed of the page changing?

Felice said...

Ciao Lucio. Anche io ho un PSR505 e anche io ho grosse difficolta' a leggere i file pdf specialmente gli articoli tecnici organizzati su due colonne. Sembra che tu abbia risolto il problema. Ma non essendo un grosso esperto software non riesco a capire bene cosa fare. Puoi essere cosi gentile da descrivirmi passo passo cosa dovrei fare?
Grazie in anticipo. Felice

Lucio Benfante said...

Ciao Felice,
scusa per il ritardo della risposta.

Il post è già abbastanza passo passo. Se mi dici in quali punti incontri difficoltà, ti aiuto volentieri.

Felice said...

Lucio scusa per il ritardo. Ho provato ad usare un software che trasforma i file pdf in lrf. Ma il risultato almeno con articoli pdf non e' stato per niente soddisfacente. Potresti essere cosi gentile da utilizzare il tuo software per questo articolo e dirmi se il miglioramento e' apprezzabile?
http://arxiv.org/PS_cache/arxiv/pdf/0904/0904.2189v1.pdf
Grazie in anticipo.

Felice

Lucio Benfante said...

Felice,
l'ho convertito, e mi sembra un po' più leggibile (perlomeno non ci sono più ampi margini di pagina, che ovviamente nel lettore non servono). Come faccio a passartelo in modo che possa valutare tu stesso?

Endovenoso said...

Thnak you Lucio

Felice said...

Lucio potgresti spedirmelo a felice.russo60@gmail.com

Grazie. Felice

Lucio Benfante said...

@Felice: ciao, hai ricevuto il file che ti ho mandato? Come ti sembra?

Lucio Benfante said...

@Endovenoso: I think, and I have the impression, the page-changing is a little speeded up by converting the PDF to LRF...but I didn't benchmark it.