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 04-22-2008, 11:28 PM   #1
alanine
Connoisseur
alanine has a complete set of Star Wars action figures.alanine has a complete set of Star Wars action figures.alanine has a complete set of Star Wars action figures.alanine has a complete set of Star Wars action figures.
 
Posts: 54
Karma: 399
Join Date: Sep 2007
Device: iLiad v2
Too slow to open PDFs? A solution!

If you find some PDFs are too slow to operate on your iLiad, i.e., more than 5 seconds to turn a page, you are very likely having a poorly generated PDF with Type3 font.

Type3 fonts are bitmap fonts, and the iPDF software on your iLiad doesn't handle them very well (a problem with the poppler library it uses). One evidence is that they open fine and very quickly in Acrobat Reader on your PC.

To test if a PDF is using such bitmap fonts, open them in Acrobat Reader and check the embedded font list, or zoom in to 1000% and see if the characters have rough edges. Type1 fonts or TTF fonts should have very smooth edges.

If you are indeed having such PDFs, there is a way to fix them by replacing Type3 fonts with their Type1 counterparts.

(The following is for Linux folks, and if you are using Windows or Mac, you can also try it if you have Perl installed but I don't guarantee success)

First, you need to obtain a PS file for the same PDF. Many tech papers offer both PS and PDF for download (e.g., from citeseer). Or you can convert PDF to PS file by pdf2ps under Linux.

Second, you need to use a tool (written in Perl) called pkfix. It's able to fix the Type3 fonts in many PS file with Type1 fonts.

pkfix doesn't work on all PS files, and if it fails, there is also a tool called pkfix-helper (on the same page) that is able to figure out which are the matching Type1 fonts by comparing font matrix. You may use the pkfix-helper first, and then pkfix.

The last step is simply to convert PS back to PDF. You may do this using ps2pdf under Linux.
alanine is offline   Reply With Quote
Old 04-23-2008, 07:46 PM   #2
-Thomas-
Addict
-Thomas- once ate a cherry pie in a record 7 seconds.-Thomas- once ate a cherry pie in a record 7 seconds.-Thomas- once ate a cherry pie in a record 7 seconds.-Thomas- once ate a cherry pie in a record 7 seconds.-Thomas- once ate a cherry pie in a record 7 seconds.-Thomas- once ate a cherry pie in a record 7 seconds.-Thomas- once ate a cherry pie in a record 7 seconds.-Thomas- once ate a cherry pie in a record 7 seconds.-Thomas- once ate a cherry pie in a record 7 seconds.-Thomas- once ate a cherry pie in a record 7 seconds.-Thomas- once ate a cherry pie in a record 7 seconds.
 
-Thomas-'s Avatar
 
Posts: 325
Karma: 1725
Join Date: Dec 2007
Location: Münster, Germany
Device: iRex iLiad v2
Thanks for the info. My Linux PDF printer used to create PDFs with Type3 fonts, and now I know why it takes forever to load them on the iLiad...
-Thomas- is offline   Reply With Quote
Old 04-25-2008, 10:04 AM   #3
yokos
Pac-Man caught my iLiad.
yokos can teach chickens to fly.yokos can teach chickens to fly.yokos can teach chickens to fly.yokos can teach chickens to fly.yokos can teach chickens to fly.yokos can teach chickens to fly.yokos can teach chickens to fly.yokos can teach chickens to fly.yokos can teach chickens to fly.yokos can teach chickens to fly.yokos can teach chickens to fly.
 
yokos's Avatar
 
Posts: 807
Karma: 3595
Join Date: Apr 2006
Location: Germany; next to Baltic Sea
Device: Boox Max Lumi, iRex iLiad (RIP)
Thx for the link to pkfix, alanine.
This can be helpful when I get intouch with created-by-dvips ps files.
yokos is offline   Reply With Quote
Old 09-25-2008, 10:22 AM   #4
nekokami
fruminous edugeek
nekokami ought to be getting tired of karma fortunes by now.nekokami ought to be getting tired of karma fortunes by now.nekokami ought to be getting tired of karma fortunes by now.nekokami ought to be getting tired of karma fortunes by now.nekokami ought to be getting tired of karma fortunes by now.nekokami ought to be getting tired of karma fortunes by now.nekokami ought to be getting tired of karma fortunes by now.nekokami ought to be getting tired of karma fortunes by now.nekokami ought to be getting tired of karma fortunes by now.nekokami ought to be getting tired of karma fortunes by now.nekokami ought to be getting tired of karma fortunes by now.
 
nekokami's Avatar
 
Posts: 6,745
Karma: 551260
Join Date: Oct 2006
Location: Northeast US
Device: iPad, eBw 1150
Thanks! I don't know how I missed this post earlier. This should help a lot.

Is there a way to batch-check PDF files to see if they've used Type 3 fonts? It would be nice to process them all before loading them onto the iLiad and experiencing the slowdown.
nekokami is offline   Reply With Quote
Old 09-25-2008, 10:30 AM   #5
-Thomas-
Addict
-Thomas- once ate a cherry pie in a record 7 seconds.-Thomas- once ate a cherry pie in a record 7 seconds.-Thomas- once ate a cherry pie in a record 7 seconds.-Thomas- once ate a cherry pie in a record 7 seconds.-Thomas- once ate a cherry pie in a record 7 seconds.-Thomas- once ate a cherry pie in a record 7 seconds.-Thomas- once ate a cherry pie in a record 7 seconds.-Thomas- once ate a cherry pie in a record 7 seconds.-Thomas- once ate a cherry pie in a record 7 seconds.-Thomas- once ate a cherry pie in a record 7 seconds.-Thomas- once ate a cherry pie in a record 7 seconds.
 
-Thomas-'s Avatar
 
Posts: 325
Karma: 1725
Join Date: Dec 2007
Location: Münster, Germany
Device: iRex iLiad v2
Quote:
Originally Posted by nekokami View Post
Is there a way to batch-check PDF files to see if they've used Type 3 fonts? It would be nice to process them all before loading them onto the iLiad and experiencing the slowdown.
There is a tool for Linux called pdffonts (it's in the xpdf-utils package on Debian) which lists all fonts used in a PDF file. Here's some example output:
Code:
$ pdffonts print.pdf
name                                 type              emb sub uni object ID
------------------------------------ ----------------- --- --- --- ---------
[none]                               Type 3            yes no  yes     87  0
[none]                               Type 3            yes no  yes    183  0
[none]                               Type 3            yes no  yes     42  0
[none]                               Type 3            yes no  yes     33  0
This could be of help for batch-checking files.
-Thomas- is offline   Reply With Quote
Old 09-25-2008, 10:38 AM   #6
nekokami
fruminous edugeek
nekokami ought to be getting tired of karma fortunes by now.nekokami ought to be getting tired of karma fortunes by now.nekokami ought to be getting tired of karma fortunes by now.nekokami ought to be getting tired of karma fortunes by now.nekokami ought to be getting tired of karma fortunes by now.nekokami ought to be getting tired of karma fortunes by now.nekokami ought to be getting tired of karma fortunes by now.nekokami ought to be getting tired of karma fortunes by now.nekokami ought to be getting tired of karma fortunes by now.nekokami ought to be getting tired of karma fortunes by now.nekokami ought to be getting tired of karma fortunes by now.
 
nekokami's Avatar
 
Posts: 6,745
Karma: 551260
Join Date: Oct 2006
Location: Northeast US
Device: iPad, eBw 1150
Cool. I have Ubuntu here at work (I gave away the Ubuntu machine at home to someone who didn't have a computer, and that's a nightmare story of its own.) I'll try that.
nekokami is offline   Reply With Quote
Old 09-26-2008, 03:15 AM   #7
Martijn
Connoisseur
Martijn has learned how to read e-booksMartijn has learned how to read e-booksMartijn has learned how to read e-booksMartijn has learned how to read e-booksMartijn has learned how to read e-booksMartijn has learned how to read e-booksMartijn has learned how to read e-books
 
Martijn's Avatar
 
Posts: 68
Karma: 855
Join Date: Jan 2007
Location: Netherlands
Device: iLiad
I think the following bash script could be used to batch-check pdf files:
Code:
#!/bin/bash
for i in $*; do
  c=`pdffonts $i | grep -c "Type 3" `
  if [ $c -ne 0 ]; then
    echo $i
  fi
done
Say you name it check.sh, then
Code:
check.sh *.pdf
Should give the names of all the files that use type 3 fonts.

Note: I haven't tested this yet.
Martijn is offline   Reply With Quote
Old 09-26-2008, 05:17 AM   #8
-Thomas-
Addict
-Thomas- once ate a cherry pie in a record 7 seconds.-Thomas- once ate a cherry pie in a record 7 seconds.-Thomas- once ate a cherry pie in a record 7 seconds.-Thomas- once ate a cherry pie in a record 7 seconds.-Thomas- once ate a cherry pie in a record 7 seconds.-Thomas- once ate a cherry pie in a record 7 seconds.-Thomas- once ate a cherry pie in a record 7 seconds.-Thomas- once ate a cherry pie in a record 7 seconds.-Thomas- once ate a cherry pie in a record 7 seconds.-Thomas- once ate a cherry pie in a record 7 seconds.-Thomas- once ate a cherry pie in a record 7 seconds.
 
-Thomas-'s Avatar
 
Posts: 325
Karma: 1725
Join Date: Dec 2007
Location: Münster, Germany
Device: iRex iLiad v2
Quote:
Originally Posted by Martijn View Post
Note: I haven't tested this yet.
The script works fine, but only if you don't have white spaces in your filenames. I've made some small changes, and now it works:
Code:
#!/bin/bash
for i in "$@"; do
  c=`pdffonts "$i" | grep -c "Type 3" `
  if [ $c -ne 0 ]; then
    echo $i
  fi
done
This lists all PDFs with Type3 fonts:
Code:
$ check.sh *.pdf
-Thomas- is offline   Reply With Quote
Old 09-26-2008, 10:08 AM   #9
nekokami
fruminous edugeek
nekokami ought to be getting tired of karma fortunes by now.nekokami ought to be getting tired of karma fortunes by now.nekokami ought to be getting tired of karma fortunes by now.nekokami ought to be getting tired of karma fortunes by now.nekokami ought to be getting tired of karma fortunes by now.nekokami ought to be getting tired of karma fortunes by now.nekokami ought to be getting tired of karma fortunes by now.nekokami ought to be getting tired of karma fortunes by now.nekokami ought to be getting tired of karma fortunes by now.nekokami ought to be getting tired of karma fortunes by now.nekokami ought to be getting tired of karma fortunes by now.
 
nekokami's Avatar
 
Posts: 6,745
Karma: 551260
Join Date: Oct 2006
Location: Northeast US
Device: iPad, eBw 1150
Great, thanks! I brought my iLiad to work (where my linux machine is) and I may be able to try this later today.
nekokami is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Confused by behavior of two pdfs w/permissions passwords, but no open passwords/DRM grr PDF 0 12-21-2009 02:21 PM
calibre - very slow conversion, very slow on PRS cremofix Calibre 3 06-10-2009 04:21 PM
Iliad won't open some PDFs sputnik iRex 1 07-15-2008 08:38 PM
too slow to read pdfs with many pages? alanine iRex 4 10-12-2007 06:41 PM
TOO SLOW to open "Table of Contents" mdhuang Sony Reader 16 09-06-2007 10:29 PM


All times are GMT -4. The time now is 07:12 PM.


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