Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Readers > More E-Book Readers > Ectaco jetBook

Notices

Reply
 
Thread Tools Search this Thread
Old 05-16-2010, 12:47 AM   #1
syrex314
Junior Member
syrex314 began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Feb 2010
Device: JetBook Lite
JetBook PDF antialiasing script

One thing that bugs me about the JB is that some PDFs render in an ugly, pixellated way. So for those who have Linux, I wrote a perl script that takes a PDF, and uses ImageMagick to antialias and rescale the pages for the native size of the Jetbook's screen. This is provided AS-IS, and I'm sure other software does a better job, but hey-- some of you might find it useful.

Code:
#!/usr/bin/perl
#
# pdfToPpmToPdf.pl
#
# A perl script to convert a PDF to a series of PPM files, one per
# page, then back to PDF. 
#

# file names
$inPdfFileName = "in.pdf";
$outPdfFileName = "out.pdf";
$ppmRoot = "./tmp/page";

print "converting pages to images\n";

# call pdftoppm
system( "pdftoppm", "-gray", $inPdfFileName, $ppmRoot ) == 0
# and handle an error
# this could be improved by checking the error codes listed in the
# pdftoppm manpage
    or die "pdftoppm failed: $?";

print "converting each page to pdf\n";
# convert each page to a pdf
@files = <./tmp/*.pgm>;

foreach $file (@files) {
    $file =~ /(.+)\.pgm/;    # get filename in front of prefix
    print "processing image file $file\n";

    system("mogrify","-antialias","-trim","-resize", "460", $file) == 0
	or die "mogrify failed: $?";

    print "converting $file to $1.pdf\n";

    system( "convert", $file, "$1.pdf" ) == 0
	or die "convert to pdf failed: $?";
}

print "concatenating pdf pages\n";
# concatenate pages with ImageMagic's convert function
system("convert", "./tmp/*.pdf", "out.pdf" ) == 0
	or die "concatenate pdf failed: $?";
syrex314 is offline   Reply With Quote
Old 05-16-2010, 01:59 AM   #2
jblitereader
Addict
jblitereader is no ebook tyro.jblitereader is no ebook tyro.jblitereader is no ebook tyro.jblitereader is no ebook tyro.jblitereader is no ebook tyro.jblitereader is no ebook tyro.jblitereader is no ebook tyro.jblitereader is no ebook tyro.jblitereader is no ebook tyro.jblitereader is no ebook tyro.
 
jblitereader's Avatar
 
Posts: 248
Karma: 1312
Join Date: Mar 2010
Device: jetbook lite
Um, I don't think this is a problem that only the JB has.

Me, I just stay away from pdf, period.
jblitereader is offline   Reply With Quote
Advert
Old 05-16-2010, 08:49 AM   #3
GhostHawk
Data Privateer!
GhostHawk goes to eleven.GhostHawk goes to eleven.GhostHawk goes to eleven.GhostHawk goes to eleven.GhostHawk goes to eleven.GhostHawk goes to eleven.GhostHawk goes to eleven.GhostHawk goes to eleven.GhostHawk goes to eleven.GhostHawk goes to eleven.GhostHawk goes to eleven.
 
GhostHawk's Avatar
 
Posts: 586
Karma: 62887
Join Date: Oct 2009
Location: Fargo ND
Device: Ectaco Jetbook& Jetbook Lite
Same here LE.
GhostHawk is offline   Reply With Quote
Old 05-16-2010, 01:14 PM   #4
Ken Maltby
Wizard
Ken Maltby ought to be getting tired of karma fortunes by now.Ken Maltby ought to be getting tired of karma fortunes by now.Ken Maltby ought to be getting tired of karma fortunes by now.Ken Maltby ought to be getting tired of karma fortunes by now.Ken Maltby ought to be getting tired of karma fortunes by now.Ken Maltby ought to be getting tired of karma fortunes by now.Ken Maltby ought to be getting tired of karma fortunes by now.Ken Maltby ought to be getting tired of karma fortunes by now.Ken Maltby ought to be getting tired of karma fortunes by now.Ken Maltby ought to be getting tired of karma fortunes by now.Ken Maltby ought to be getting tired of karma fortunes by now.
 
Ken Maltby's Avatar
 
Posts: 4,465
Karma: 6900052
Join Date: Dec 2009
Location: The Heart of Texas
Device: Boox Note2, AuraHD, PDA,
I have a number of the image type PDFs that are scanned pages from the "Backwoods
Home Magazine", they are quite readable on my JBL at 200% zoom. I have to scroll
around the page, to see the image properly through the limited window that a 5-inch
640x480 display provides. I have them on the JBL for use outdoors, as more of a
reference for implementing some of what is described in the articles. For an easier and
smoother read I have Netbooks and PCs to read them on. ( I can also read them on my
3.5" PDA display, but that is a real chore and not worth the effort.)

Image based PDFs are nice on a large display and do well for "Coffee Table" books, with
high resolution color graphics, not so great on the small black&white display. Trying to
force them to fit, results in a number of necessary compromises, and becomes a real
chore for the little CPUs in these dedicated readers.

In the case of text based PDFs with embedded graphics, (and a number of HTML based
formats, as well) it can be just a matter of preprocessing the the graphic images, so that
they match the ereaders display requirements. (I use the free GIMP2)

That said, I agree with others here that it makes more sense to just avoid PDFs, for
the small displays, whenever possible.

Luck;
Ken

Last edited by Ken Maltby; 05-16-2010 at 01:29 PM.
Ken Maltby is offline   Reply With Quote
Old 05-16-2010, 01:38 PM   #5
jblitereader
Addict
jblitereader is no ebook tyro.jblitereader is no ebook tyro.jblitereader is no ebook tyro.jblitereader is no ebook tyro.jblitereader is no ebook tyro.jblitereader is no ebook tyro.jblitereader is no ebook tyro.jblitereader is no ebook tyro.jblitereader is no ebook tyro.jblitereader is no ebook tyro.
 
jblitereader's Avatar
 
Posts: 248
Karma: 1312
Join Date: Mar 2010
Device: jetbook lite
Quote:
Originally Posted by Ken Maltby View Post
I have a number of the image type PDFs that are scanned pages from the "Backwoods
Home Magazine", they are quite readable on my JBL at 200% zoom. I have to scroll
around the page, to see the image properly through the limited window that a 5-inch
640x480 display provides.
When I first started reading on the JBL, I had no idea that there were other options for me out there. I only had pdf ebooks, so I thought that's what I had to stick with. I actually had to perform operation scroll right scroll left scroll down for a couple books before I told myself this was ridiculous and began collecting non-pdf ebooks.

When I first showed my brother my JBL, the first question that came out of his mouth was "does this read pdf?"

And a couple days ago, someone started a thread asking about displaying the pdf he just bought/downloaded for his girlfriend.

We as a community need to better educate people about the evils of pdf for the ebook reading community. It's the second worst format imaginable.
jblitereader is offline   Reply With Quote
Advert
Old 05-16-2010, 04:32 PM   #6
syrex314
Junior Member
syrex314 began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Feb 2010
Device: JetBook Lite
I suppose I'm a bit outside the target audience for most ebook readers. I'm not interested in buying ebooks-- I need a portable PDF reader. And for the most part, I'm quite happy with my JetBook for this purpose. :-D
syrex314 is offline   Reply With Quote
Old 05-16-2010, 08:55 PM   #7
Dizmatic
Reader
Dizmatic began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Apr 2010
Device: Nook Color
Quote:
Originally Posted by syrex314 View Post
I suppose I'm a bit outside the target audience for most ebook readers. I'm not interested in buying ebooks-- I need a portable PDF reader. And for the most part, I'm quite happy with my JetBook for this purpose. :-D
I am the same type. For the most part, the JBL does a decent job.
Dizmatic is offline   Reply With Quote
Old 05-18-2010, 07:23 PM   #8
kidtwisted
Member
kidtwisted began at the beginning.
 
kidtwisted's Avatar
 
Posts: 16
Karma: 10
Join Date: May 2010
Location: Southern California
Device: JetBook-Lite
Quote:
Originally Posted by syrex314 View Post
One thing that bugs me about the JB is that some PDFs render in an ugly, pixellated way. So for those who have Linux, I wrote a perl script that takes a PDF, and uses ImageMagick to antialias and rescale the pages for the native size of the Jetbook's screen. This is provided AS-IS, and I'm sure other software does a better job, but hey-- some of you might find it useful.

Code:
#!/usr/bin/perl
#
# pdfToPpmToPdf.pl
#
# A perl script to convert a PDF to a series of PPM files, one per
# page, then back to PDF. 
#

# file names
$inPdfFileName = "in.pdf";
$outPdfFileName = "out.pdf";
$ppmRoot = "./tmp/page";

print "converting pages to images\n";

# call pdftoppm
system( "pdftoppm", "-gray", $inPdfFileName, $ppmRoot ) == 0
# and handle an error
# this could be improved by checking the error codes listed in the
# pdftoppm manpage
    or die "pdftoppm failed: $?";

print "converting each page to pdf\n";
# convert each page to a pdf
@files = <./tmp/*.pgm>;

foreach $file (@files) {
    $file =~ /(.+)\.pgm/;    # get filename in front of prefix
    print "processing image file $file\n";

    system("mogrify","-antialias","-trim","-resize", "460", $file) == 0
	or die "mogrify failed: $?";

    print "converting $file to $1.pdf\n";

    system( "convert", $file, "$1.pdf" ) == 0
	or die "convert to pdf failed: $?";
}

print "concatenating pdf pages\n";
# concatenate pages with ImageMagic's convert function
system("convert", "./tmp/*.pdf", "out.pdf" ) == 0
	or die "concatenate pdf failed: $?";
WOW, thanks for sharing your script. I'm adding it to my toolbox.
kidtwisted is offline   Reply With Quote
Reply

Tags
antialias, jetbook, pdf, pixellated

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Script for converting ePUB to PDF using Prince Jellby ePub 44 03-03-2015 03:21 PM
Super-large pdf support on Jetbook/lite halfgone Ectaco jetBook 4 12-29-2009 08:06 AM
Easy PDF for the jetBook Jack Tingle Ectaco jetBook 4 09-30-2009 04:39 PM
PDF specs for JetBook? Elfwreck Workshop 3 06-12-2009 10:39 PM
prs-gen.pl :: Batch RSS->PDF Script hrbrmstr Sony Reader 1 10-28-2006 11:53 AM


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


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