View Single Post
Old 12-13-2006, 12:24 AM   #22
alex_d
Addict
alex_d doesn't litteralex_d doesn't litter
 
Posts: 303
Karma: 187
Join Date: Dec 2006
Device: Sony Reader
PDFrasterFarian - pre-rasterizer and post-processor

Thanks a lot, kovidgoyal. Alright, I've combined all of this into a .cmd script that turns PDFs into pre-rastered LRFs.

The advantages of converting PDFs are:

PDF text has much greater boldness
Page turns take approx 2s (including eInk refresh) (regardless of the pdf)
Opportunity to set zoom region
All formatting, graphics, tables, etc. are 100% preserved
Non-english fonts displayed correctly

Disadvantage:

Large file size
Since images are at a specific resolution, you must optimize either for portrait or landscape.


PDFrasterFarian has a nice interface and explains everything. There is no learning curve or command prompts, just extract and double-click.
You can also call it using PDFrasterFarian.cmd inputfile.pdf outputfile.lrf


Strongly Recommended: Use a program like Adobe Acrobat to edit the PDF's cropbox and select the specific region you'd like to zoom into. (The cropped region should be the same size for each page.) Tips on integrating software to do this are appreciated.



The script reads a PDF, rasterizes it using Ghostscript, enhances the text using ImageMagick, writes a .lrs file, and finally compiles a full LRF BBeB using lrs2lrf. (These programs are called from directories in the zip file. They do not get installed.)

Still TODO: Option to create landscape-mode LRFs. Write a better image-enhancement algorithm to improve text boldness (current one is really clumsy). Extract the ToC from the pdf. Allow full command-line parameters (promptless operation). Reduce size of outputted lrfs.

PDFrasterFarian will hit 1.0 when I feel a good image algorithm is found. If any image expert out there knows a decent one.. please share. I'm using this framework. Right now I'm just using the imagemagick unsharp filter, which is silly.
alex_d is offline   Reply With Quote