Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > PDF

Notices

Reply
 
Thread Tools Search this Thread
Old 06-03-2008, 03:48 PM   #61
kergoth
Junior Member
kergoth began at the beginning.
 
Posts: 6
Karma: 10
Join Date: May 2008
Device: Sony PRS-505
I'm getting an error trying to use this:

Code:
clarson@foul mine home#mv!187caf1$ pi_format.py mine.conf 
Traceback (most recent call last):
  File "/home/clarson/Desktop/pi/pi/bin/pi_format.py", line 59, in <module>
    test_all(sys.argv[1])
  File "/home/clarson/Desktop/pi/pi/bin/pi_format.py", line 15, in test_all
    doc = pi.Doc(conf)
  File "/home/clarson/Desktop/pi/pi/bin/pi.py", line 1091, in __init__
    self.get_avg_page_stat()
  File "/home/clarson/Desktop/pi/pi/bin/pi.py", line 1144, in get_avg_page_stat
    self.avg_lh = middle(avg_lhs)
  File "/home/clarson/Desktop/pi/pi/bin/pi.py", line 58, in middle
    return sl[(len(sl) + 1) / 2]
IndexError: list index out of range
kergoth is offline   Reply With Quote
Old 06-05-2008, 01:09 AM   #62
caritas
Enthusiast
caritas doesn't littercaritas doesn't litter
 
Posts: 26
Karma: 161
Join Date: Feb 2008
Device: Sony PRS505
Yes. This is a bug.

You can fix this by changing line 58 of pi.py from

return sl[(len(sl)+1)/2]

to

return sl[len(sl)/2]

I will fix this in next version.
caritas is offline   Reply With Quote
Old 06-09-2008, 08:41 PM   #63
nclark
Junior Member
nclark began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Jun 2008
Device: Sony PRS-505
has anyone had success compiling this on leopard?
nclark is offline   Reply With Quote
Old 06-09-2008, 09:40 PM   #64
nrapallo
GuteBook/Mobi2IMP Creator
nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.
 
nrapallo's Avatar
 
Posts: 2,958
Karma: 2530691
Join Date: Dec 2007
Location: Toronto, Canada
Device: REB1200 EBW1150 Device: T1 NSTG iLiad_v2 NC Device: Asus_TF Next1 WPDN
Quote:
Originally Posted by nclark View Post
has anyone had success compiling this on leopard?
or windows? If so, how?
nrapallo is offline   Reply With Quote
Old 06-09-2008, 09:48 PM   #65
nclark
Junior Member
nclark began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Jun 2008
Device: Sony PRS-505
well i don't know how you'd compile it on windows, but the author provided a link to a cygwin binary for it further up:

https://www.mobileread.com/forums/sho...9&postcount=17

my issue is compiling pi.c... i get a slew of errors when i try to build it against netpbm from macports.
nclark is offline   Reply With Quote
Old 06-09-2008, 10:51 PM   #66
nrapallo
GuteBook/Mobi2IMP Creator
nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.
 
nrapallo's Avatar
 
Posts: 2,958
Karma: 2530691
Join Date: Dec 2007
Location: Toronto, Canada
Device: REB1200 EBW1150 Device: T1 NSTG iLiad_v2 NC Device: Asus_TF Next1 WPDN
Quote:
Originally Posted by nclark View Post
well i don't know how you'd compile it on windows, but the author provided a link to a cygwin binary for it further up:

https://www.mobileread.com/forums/sho...9&postcount=17

my issue is compiling pi.c... i get a slew of errors when i try to build it against netpbm from macports.
Oops, that's me you are referring to and a previous version's windows executable.

I am not the author and since version 0.2 I have not been able to use this code in windows due to some strange behaviour of python using pipes to external programs. It's not the author's fault, just a defect/deficiency of my windows installation!

Last edited by nrapallo; 06-09-2008 at 10:53 PM.
nrapallo is offline   Reply With Quote
Old 06-09-2008, 11:08 PM   #67
nclark
Junior Member
nclark began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Jun 2008
Device: Sony PRS-505
Quote:
Originally Posted by nrapallo View Post
Oops, that's me you are referring to
ah, so i am.

anyone out there, luck on OS X or windows?
nclark is offline   Reply With Quote
Old 06-10-2008, 07:47 AM   #68
IceHand
Linux User
IceHand is a rising star in the heavensIceHand is a rising star in the heavensIceHand is a rising star in the heavensIceHand is a rising star in the heavensIceHand is a rising star in the heavensIceHand is a rising star in the heavensIceHand is a rising star in the heavensIceHand is a rising star in the heavensIceHand is a rising star in the heavensIceHand is a rising star in the heavensIceHand is a rising star in the heavens
 
IceHand's Avatar
 
Posts: 323
Karma: 13682
Join Date: Aug 2007
Location: Germany
Device: Kindle 3
No, sorry. On Linux it works fine ...
IceHand is offline   Reply With Quote
Old 07-04-2008, 05:16 PM   #69
serpentium
eAddictd
serpentium began at the beginning.
 
serpentium's Avatar
 
Posts: 41
Karma: 10
Join Date: Apr 2008
Location: Italia
Device: PRS505, Iliad Book Edition
I want it in MacOSX!!!

Quote:
Originally Posted by nclark View Post
has anyone had success compiling this on leopard?
why doesnt work in osX??? i want it!!!

and... what about to put the code in the software to make lrf from cbz? I will really like to convert cbz to img, render them with this program and compile a lrf, with just one click (and maybe another click to send to my prs505 from calibre )
serpentium is offline   Reply With Quote
Old 07-04-2008, 05:27 PM   #70
DaleDe
Grand Sorcerer
DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.
 
DaleDe's Avatar
 
Posts: 11,470
Karma: 13095790
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2, iPhone 7
Quote:
Originally Posted by serpentium View Post
why doesnt work in osX??? i want it!!!

and... what about to put the code in the software to make lrf from cbz? I will really like to convert cbz to img, render them with this program and compile a lrf, with just one click (and maybe another click to send to my prs505 from calibre )
It works on OSX if you have Python installed.

Dale
DaleDe is offline   Reply With Quote
Old 07-11-2008, 12:35 AM   #71
nclark
Junior Member
nclark began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Jun 2008
Device: Sony PRS-505
Quote:
Originally Posted by DaleDe View Post
It works on OSX if you have Python installed.

Dale
OS X ships with python. it always has.

/System/Library/Frameworks/Python.framework/Versions/2.5/Resources/Python.app/

i haven't had any luck getting it to work (w/ leopard)
nclark is offline   Reply With Quote
Old 07-22-2008, 10:34 AM   #72
hansl
Zealot
hansl has the entire Project Gutenberg collection on their reader and has corrected every single error in every single bookhansl has the entire Project Gutenberg collection on their reader and has corrected every single error in every single bookhansl has the entire Project Gutenberg collection on their reader and has corrected every single error in every single bookhansl has the entire Project Gutenberg collection on their reader and has corrected every single error in every single bookhansl has the entire Project Gutenberg collection on their reader and has corrected every single error in every single bookhansl has the entire Project Gutenberg collection on their reader and has corrected every single error in every single bookhansl has the entire Project Gutenberg collection on their reader and has corrected every single error in every single bookhansl has the entire Project Gutenberg collection on their reader and has corrected every single error in every single bookhansl has the entire Project Gutenberg collection on their reader and has corrected every single error in every single bookhansl has the entire Project Gutenberg collection on their reader and has corrected every single error in every single bookhansl has the entire Project Gutenberg collection on their reader and has corrected every single error in every single book
 
Posts: 112
Karma: 113786
Join Date: Jul 2008
Location: Germany
Device: Sony PRS-T3S, CoolReader on 4'' Android phone
Lightbulb Success with Linux live CD, Trouble with Crop Box

Hi,
I tried this on Windows XP SP2 and found that the Windows version cuts images in two. Then I fiddled around to get the original package running on XP without success.
Depressed I started what I wanted to avoid and tried a Linux live CD, namely Puppy Linux 4.0 together with its development environment since I had to compile and install some packages missing in the distribution like the Python Image Library and others.
This was not too difficult since you always get a good hint where you are currently stuck :-)
In the end it worked out fine and I think this might be an alternative for Windows and MacOS users. If anybody is interested I could add the details in another post.

Only one thing still itches me in the Linux Version: I couldn't get pdftoppm to not ignore my crop box inside the input pdf file. Funny enough, pdftoppm treats crop boxes right in the Windows version??

Greetings,
hansl
hansl is offline   Reply With Quote
Old 07-23-2008, 01:28 AM   #73
hansl
Zealot
hansl has the entire Project Gutenberg collection on their reader and has corrected every single error in every single bookhansl has the entire Project Gutenberg collection on their reader and has corrected every single error in every single bookhansl has the entire Project Gutenberg collection on their reader and has corrected every single error in every single bookhansl has the entire Project Gutenberg collection on their reader and has corrected every single error in every single bookhansl has the entire Project Gutenberg collection on their reader and has corrected every single error in every single bookhansl has the entire Project Gutenberg collection on their reader and has corrected every single error in every single bookhansl has the entire Project Gutenberg collection on their reader and has corrected every single error in every single bookhansl has the entire Project Gutenberg collection on their reader and has corrected every single error in every single bookhansl has the entire Project Gutenberg collection on their reader and has corrected every single error in every single bookhansl has the entire Project Gutenberg collection on their reader and has corrected every single error in every single bookhansl has the entire Project Gutenberg collection on their reader and has corrected every single error in every single book
 
Posts: 112
Karma: 113786
Join Date: Jul 2008
Location: Germany
Device: Sony PRS-T3S, CoolReader on 4'' Android phone
I forgot to praise caritas in my first post. pi is by far the best pdf-preparation-for-conversion-to-ebook tool I know, and the least time consuming regarding interaction and document preparation.
I only fell over this thread by chance and think this tool should be placed in a more prominent place and get a more telling name like ebookpdf (pdf2ebookpdf is probably too long).

hansl
hansl is offline   Reply With Quote
Old 07-23-2008, 09:05 AM   #74
nrapallo
GuteBook/Mobi2IMP Creator
nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.
 
nrapallo's Avatar
 
Posts: 2,958
Karma: 2530691
Join Date: Dec 2007
Location: Toronto, Canada
Device: REB1200 EBW1150 Device: T1 NSTG iLiad_v2 NC Device: Asus_TF Next1 WPDN
Quote:
Originally Posted by hansl View Post
I forgot to praise caritas in my first post. pi is by far the best pdf-preparation-for-conversion-to-ebook tool I know, and the least time consuming regarding interaction and document preparation.
Can you give us a short description of what you needed to get it to compile and your experiences with your Live CD? i.e., which libraries were added (and from where), where did you store the compiled executable, how do you (re-)use the program with your Live CD setup, can you produce a 'windows binaries'from that setup, etc...

Quote:
I only fell over this thread by chance and think this tool should be placed in a more prominent place and get a more telling name like ebookpdf (pdf2ebookpdf is probably too long).

hansl
BTW, from a previous version, it appears that pi is short for pdftoimage. You know those Linux/Unix types, always shortening their typing experience...
nrapallo is offline   Reply With Quote
Old 07-28-2008, 04:05 PM   #75
hansl
Zealot
hansl has the entire Project Gutenberg collection on their reader and has corrected every single error in every single bookhansl has the entire Project Gutenberg collection on their reader and has corrected every single error in every single bookhansl has the entire Project Gutenberg collection on their reader and has corrected every single error in every single bookhansl has the entire Project Gutenberg collection on their reader and has corrected every single error in every single bookhansl has the entire Project Gutenberg collection on their reader and has corrected every single error in every single bookhansl has the entire Project Gutenberg collection on their reader and has corrected every single error in every single bookhansl has the entire Project Gutenberg collection on their reader and has corrected every single error in every single bookhansl has the entire Project Gutenberg collection on their reader and has corrected every single error in every single bookhansl has the entire Project Gutenberg collection on their reader and has corrected every single error in every single bookhansl has the entire Project Gutenberg collection on their reader and has corrected every single error in every single bookhansl has the entire Project Gutenberg collection on their reader and has corrected every single error in every single book
 
Posts: 112
Karma: 113786
Join Date: Jul 2008
Location: Germany
Device: Sony PRS-T3S, CoolReader on 4'' Android phone
How to use pi with a Linux live-CD (Puppy-Linux 4.00)

Quote:
Originally Posted by nrapallo View Post
Can you give us a short description of what you needed to get it to compile and your experiences with your Live CD? i.e., which libraries were added (and from where), where did you store the compiled executable, how do you (re-)use the program with your Live CD setup, can you produce a 'windows binaries'from that setup, etc...
Hi Nick and thanks for asking. I downloaded and installed the following:

- Puppy Linux 4.00 "Dingo" ISO CD-ROM image from puppylinux.org (burn the CD and follow installation instructions from puppylinux.org)

- devx_400.sfs from ibiblio.org - contains development environment for compiling and installation of additional source packages (no install, just save the file in the same directory as the next one below)

- pup_save.2fs created on C: drive by Puppy for additional persistent packages, virtual RAM and faster bootup (you may choose the size, I recommend the maximum which is around 1.3 GB)

- pup_400.sfs and zdrv_400.sfs copied to C: drive by Puppy for faster bootup

- tiff-3.8.2 from www.remotesensing.org (source installation)
- libpng-1.2.29 from www.libpng.org (source installation)
- zlib-1.2.3 from www.zlib.net (source installation)
all source installations went flawless using ./configure, make, make install

- xpdf-3.0.2 from ibiblio.org (binary installation with puppy package manager)

- imagemagick 6.0.6.2-2.7 from dotpups.de
(binary installation, newer version available but I got "convert" only running with this version)

- Python Image Library 1.1.6 from www.pythonware.com (built with python commands)

and finally
- pi_0.5 where I had to make a change in img_dir_to_pdf.sh:
The call to tiff2pdf with arguments -z -o ... always produced a barely readable white characters on black background pdf.
tiff2pdf -n -z -o ... solves the problem and produces black chars on white bg.

So that's it and no, I didn't even try to produce a Windows binary. I preferred to let success shine on me . Also, I had no trouble with Puppy Linux besides finding the right Imagemagick version.

BTW document exchange between Puppy and Windows is easy, you can mount the Windows filesystem in Puppy. And don't worry, the desktop environment is very newbie friendly. So, most installations and mounts are point and click.

Now I can admit that I have a Solaris past and feel happy to dive a little into the Unix feeling again.


hansl

Edit: I forgot to mention that like all 32 bit dinosaurs I had to delete pi.o in order to get pi compiled. All files I added to the live CD have been saved in pup_save.2fs on my hard disk, i.e. I didn't really change the CD but what it loads on bootup from my HD (I have to leave for backup now ...)

Last edited by hansl; 08-05-2008 at 07:30 AM.
hansl is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
My images are disappearing on small screen devices sbrwake Kindle Formats 2 01-10-2009 09:01 PM
Pre-render and cache PDF pages? nekokami iRex 3 07-02-2008 03:26 AM
PDF Text too small! thacursedpie iRex 9 03-18-2008 02:53 PM
Spies can run small devices on body heat. What about eBooks? mogui News 23 09-21-2007 01:31 PM
over 2 mins to render PDF page reh_reh iRex 6 11-11-2006 07:57 AM


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


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