08-06-2008, 05:59 AM | #76 |
Enthusiast
Posts: 42
Karma: 12
Join Date: Feb 2008
Device: CyBook, Sony PRS 600
|
That is really excellent work. In fact I made something very similar. But I did not go as far as to analyze the image!
Some ideas: 1. Try to use the command pdfimage from pdflib, this can compile all the png images directly into a single PDF. It is much faster than using convert again. 2. Try to quantize the color of the png file. This will reduce the image file size significantly. For e-ink screen the color depth is only 4 - 16, compared to standard 8 bit channel with 256 colors. 3. This method in fact can also work for djvu file. With ddjvu command one can convert certain page into pgm: 'ddjvu -page=%i -scale=%i -format=pgm %s %s' %(pageno, dpi, inputfile, outputfile) |
08-10-2008, 03:36 AM | #77 |
Junior Member
Posts: 3
Karma: 10
Join Date: Apr 2008
Device: iphone
|
I use another pdf and got
page: 1 page: 2 Traceback (most recent call last): File "/home/kentsin/pi/bin/pi_format.py", line 59, in <module> test_all(sys.argv[1]) File "/home/kentsin/pi/bin/pi_format.py", line 16, in test_all doc.reformat() File "/home/kentsin/pi/bin/pi.py", line 1154, in reformat page = Page(self, pn) File "/home/kentsin/pi/bin/pi.py", line 690, in __init__ BasicPage.__init__(self, doc, page_no, dpi) File "/home/kentsin/pi/bin/pi.py", line 569, in __init__ self.dpi = self.get_dpi() File "/home/kentsin/pi/bin/pi.py", line 695, in get_dpi dpi = self.doc.target_width * 50 / width ZeroDivisionError: float division |
Advert | |
|
08-11-2008, 08:59 AM | #78 |
Enthusiast
Posts: 26
Karma: 161
Join Date: Feb 2008
Device: Sony PRS505
|
Version 0.6 is released. Binary and source can be downloaded from the first post of thread.
ChangeLog: 2008-08-11 Huang Ying <ying.huang.caritas@gmail.com> * Version: 0.6 * pi.py: Initial implementation of embolden. * pi.py: Use norm coordinate in class Page and Line. * pi.py: Add edge trimming support. * pi.py: Add run pages mode. * pi.py: Add page range support. * pi.py: Re-work ImageOutput, split multi-page image. * pi.py: Rotate during scale if approriate. * img_dir_to_pdf.sh: Add color reduction support. |
08-11-2008, 06:03 PM | #79 |
computer scientist
Posts: 108
Karma: 1587
Join Date: Aug 2008
Location: Gothenburg
Device: Gen 3
|
I used v0.5 to merge all files into a pdf, but the result was negated. The text was white and the page was black, what could have caused this?
Am I the only one who has experienced it? Best regards Gianfranco Alongi PS: Great tool ! |
08-12-2008, 04:14 AM | #80 | |
Zealot
Posts: 112
Karma: 113786
Join Date: Jul 2008
Location: Germany
Device: Sony PRS-T3S, CoolReader on 4'' Android phone
|
Quote:
in img_dir_to_pdf.sh line 27 change tiff2pdf -z -o $cwd/$pdf_fn pdf-$pdf_fn.tiff to tiff2pdf -n -z -o $cwd/$pdf_fn pdf-$pdf_fn.tiff I have not tried but in v0.6 caritas changed that to tiff2pdf -nz ... so I guess it will work with 0.6 natively hansl |
|
Advert | |
|
08-12-2008, 08:27 AM | #81 |
computer scientist
Posts: 108
Karma: 1587
Join Date: Aug 2008
Location: Gothenburg
Device: Gen 3
|
Okay. Nice.
I'll try v 0.6 directly once I come home from work And once again;;; what a great tool Maybe you should consider releasing a howto and tutorial on the tool caritas? |
08-20-2008, 01:45 AM | #83 | ||
Junior Member
Posts: 1
Karma: 10
Join Date: Aug 2008
Device: iPhone
|
Quote:
I try the latest pi_06 on my SuSE OSS 10.0.0, it didnt work until I try the fix above. After the fix, pi_06 works well but I encounter this error after some pages generated: Quote:
Last edited by xiblack; 08-20-2008 at 01:49 AM. |
||
08-25-2008, 10:09 AM | #84 |
Addict
Posts: 350
Karma: 705
Join Date: Dec 2006
Location: Mumbai, India
Device: Kindle 1/REB 1200
|
pi-0.6 for Win32
I've attached a working version of pi-0.6 which will work under Windows. I had to make a few changes in the code, which have been attached as a diff. Probably caritas could apply them in the next release (they're generic).
Usage: Unzip pi-0.6-win32.zip somewhere and run as instructed above by caritas (You'll need a working Python with PIL installation). In case you want the proper fonts, unzip xpdf-fonts.zip in the same directory and adjust the paths in bin/xpdfrc (right now it's hardcoded to C:\pi). Enjoy! Last edited by ashkulz; 08-25-2008 at 10:12 AM. |
08-25-2008, 10:46 AM | #85 | |
GuteBook/Mobi2IMP Creator
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:
Now I FINALLY can get to try this out (in WinXP) and perhaps incorporate it into PDFRead. Or do you want to do that as I'm at a disadvantage not knowing python as well as you (and it is your original creation)? Thank you for doing this; I had given up trying to get my windows implementation to work. BTW, I got a proxy server working for the REB1200 if you are interested. It's in the Fictionwise forum and called Linreb. Regards, |
|
08-30-2008, 03:33 AM | #86 | |
Enthusiast
Posts: 26
Karma: 161
Join Date: Feb 2008
Device: Sony PRS505
|
Quote:
I will add it to the next version. |
|
08-30-2008, 04:50 AM | #87 |
Enthusiast
Posts: 26
Karma: 161
Join Date: Feb 2008
Device: Sony PRS505
|
Version 0.7 is released, ChangeLog is as follow:
2008-08-30 Huang Ying <huang.ying.caritas@gmail.com> * Version: 0.7 * pi.py: Add LRF output support. * pi.py: Add TOC support for LRF output format * pi.py: Add output rotate support. * pdfminfo: Add pdfminfo to extract PDF information such as TOC, title, author, etc. * overall: Add initial windows support, thanks ashkulz of mobileread forum. |
08-30-2008, 07:44 PM | #88 | |
Addict
Posts: 350
Karma: 705
Join Date: Dec 2006
Location: Mumbai, India
Device: Kindle 1/REB 1200
|
Quote:
|
|
09-10-2008, 12:21 PM | #89 |
GuteBook/Mobi2IMP Creator
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
|
I tried ashkulz's win32 executable (v0.6) and obtained great results trying to convert the sample chap6.pdf into my readers native .imp format using PDFRead on the resulting .png in the out folder.
The optimal PDFRead settings used were: 1. In Format 'imgdir' 2. Out Format 'imp2' for EBW1150 or 'imp1' for REB1200. Just substitue your reader's format here instead. 3. Use a 'portrait-p' profile and 'portrait-full' layout mode 4. Check the 'no dilation' box (I tried dilation and since the pi .png's are in a lower resolution it looks terrible!) 5. Click 'Convert' Looks promising, now only to get that pi algorithm incorporated into PDFRead (with GUI)! Last edited by nrapallo; 09-12-2008 at 10:20 AM. |
09-10-2008, 05:12 PM | #90 | |
GuteBook/Mobi2IMP Creator
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:
Just a note that I attached .lrf and .prc versions of the above sample chap6.pdf here. This is for the other (popular) small screened ebook readers, Sony PRS-500/505 and Kindle. Last edited by nrapallo; 09-12-2008 at 10:20 AM. |
|
|
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 |