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

Go Back   MobileRead Forums > E-Book Readers > More E-Book Readers > iRex > iRex Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 10-18-2006, 12:02 PM   #1
scotty1024
Banned
scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.
 
Posts: 1,300
Karma: 1479
Join Date: Jul 2006
Location: Peoples Republic of Washington
Device: Reader / iPhone / Librie / Kindle
RTFToIliad tool

This tool converts RTF files to iLiad sized PDF files.

Its one redeeming feature is that it can directly convert a Baen ZIP'd RTF file.

As time goes by I'll grow its brain (right now it represents 3 man hours, including writing the RTF parser from scratch) and it will handle more RTF commands to create fancier PDF output.

For now, it goes from Baen ZIP file to iLiad sized PDF in a single step.

It requires the PDF Box jar from http://www.pdfbox.org

Compile it: javac -classpath PDFBox-0.7.2.jar RTFToIliad.java RTFPullParser.java
Run it: java -classpath .:PDFBox-0.7.2.jar RTFToIliad DA1416509402.zip UntoTheBreach.pdf
Attached Files
File Type: zip RTFToIliad.zip (10.1 KB, 418 views)
scotty1024 is offline   Reply With Quote
Old 10-19-2006, 11:10 AM   #2
scotty1024
Banned
scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.
 
Posts: 1,300
Karma: 1479
Join Date: Jul 2006
Location: Peoples Republic of Washington
Device: Reader / iPhone / Librie / Kindle
Today's version:
Supports Roman, Bold, Italic, Bold Italic
Page breaks
Paragraph spacing adjustment
Flows text better
Various bug fixes.

Most all of the active Baen formatting commands are working and the output PDF looks much closer to Word's view of it.
Attached Files
File Type: zip RTFToIliad.zip (12.3 KB, 437 views)
scotty1024 is offline   Reply With Quote
Advert
Old 10-20-2006, 12:49 PM   #3
CommanderROR
eink fanatic
CommanderROR is fluent in JavaScript as well as Klingon.CommanderROR is fluent in JavaScript as well as Klingon.CommanderROR is fluent in JavaScript as well as Klingon.CommanderROR is fluent in JavaScript as well as Klingon.CommanderROR is fluent in JavaScript as well as Klingon.CommanderROR is fluent in JavaScript as well as Klingon.CommanderROR is fluent in JavaScript as well as Klingon.CommanderROR is fluent in JavaScript as well as Klingon.CommanderROR is fluent in JavaScript as well as Klingon.CommanderROR is fluent in JavaScript as well as Klingon.CommanderROR is fluent in JavaScript as well as Klingon.
 
CommanderROR's Avatar
 
Posts: 2,022
Karma: 4924
Join Date: Mar 2006
Location: Germany
Device: STAReBOOK, iRex Iliad, Sony 505, Kindle 2
Thanks for taking the time to do this Scotty!

I don't use .rtf books myself at the moment, but I'm sure all the users that actually use .rtf books like theose from Baen will love this.

Keep up the good work!
CommanderROR is offline   Reply With Quote
Old 10-20-2006, 03:56 PM   #4
scotty1024
Banned
scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.
 
Posts: 1,300
Karma: 1479
Join Date: Jul 2006
Location: Peoples Republic of Washington
Device: Reader / iPhone / Librie / Kindle
Quote:
Originally Posted by CommanderROR
I don't use .rtf books myself at the moment, but I'm sure all the users that actually use .rtf books like theose from Baen will love this.

Keep up the good work!
Thanks!

I didn't have much use for RTF either but I've found that the Baen RTF downloads are closer to the LIT downloads in terms of readability than the HTML downloads.

I use a LIT parser to make my BBeB books but felt an "open" RTF parser was the way to go for the iLiad. Besides, how hard could it be to whip up an RTF parser.

Today is the third posting and with it all the line breaking and page breaking have been implemented. I also cleaned up an RTF bug with \' processing only to discover my good buddy PDFBox only writes out Standard Encoding PDF's. So most of the \' chars are not available in Standard Encoding, oh well... I'll keep picking at it. But I'm not dying for copyright and tilde n characaters so far...

The right hand margin gets a bit bent since I turned on the indent for first line support. Working on that one too.

Other than that, the Baen titles appear readable to me. Being able to download them and feed them straight through the tool certainly saves me time and fiddling when I buy a new title to read.

BTW Java source can be compiled to .exe's with the GCC compiler for those that don't like Java.
Attached Files
File Type: zip RTFToIliad.zip (14.6 KB, 423 views)
scotty1024 is offline   Reply With Quote
Old 10-24-2006, 01:02 PM   #5
rpink
Junior Member
rpink began at the beginning.
 
rpink's Avatar
 
Posts: 7
Karma: 10
Join Date: Oct 2006
Location: Germany
Device: Simpad / Rocket eBook / TabletPC / iLiad / K800i / Cybooke
compile issue and fix

Hi scotty1024,

yust tryed to compile and got 2 errors where a explicit typecast was missing.
For the ones who don´t know java enough.

Problem:
RTFPullParser.java:247: isDigit(char) in java.lang.Character cannot be applied to (int)
} else if (Character.isDigit(c) ||
^
RTFPullParser.java:268: isDigit(char) in java.lang.Character cannot be applied to (int)
} else if (Character.isDigit(c)) {

fixed it with
RTFPullParser.java:247: isDigit(char) in java.lang.Character cannot be applied to (int)
} else if (Character.isDigit((char)c) ||
^
RTFPullParser.java:268: isDigit(char) in java.lang.Character cannot be applied to (int)
} else if (Character.isDigit((char)c)) {

So now i have probaly a missing font, later more.
rpink is offline   Reply With Quote
Advert
Old 10-24-2006, 10:03 PM   #6
scotty1024
Banned
scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.
 
Posts: 1,300
Karma: 1479
Join Date: Jul 2006
Location: Peoples Republic of Washington
Device: Reader / iPhone / Librie / Kindle
What did you try to compile it with?

The standard Sun javac had/has no problems compiling the code to produce the .class files included in the zip file...
scotty1024 is offline   Reply With Quote
Old 10-25-2006, 04:40 AM   #7
rpink
Junior Member
rpink began at the beginning.
 
rpink's Avatar
 
Posts: 7
Karma: 10
Join Date: Oct 2006
Location: Germany
Device: Simpad / Rocket eBook / TabletPC / iLiad / K800i / Cybooke
Thumbs up

OpenSuse 10

java-1.4.2-sun
rpink is offline   Reply With Quote
Old 10-25-2006, 03:38 PM   #8
scotty1024
Banned
scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.
 
Posts: 1,300
Karma: 1479
Join Date: Jul 2006
Location: Peoples Republic of Washington
Device: Reader / iPhone / Librie / Kindle
http://java.sun.com/j2se/1.5.0/docs/...Character.html
scotty1024 is offline   Reply With Quote
Old 10-25-2006, 04:39 PM   #9
CommanderROR
eink fanatic
CommanderROR is fluent in JavaScript as well as Klingon.CommanderROR is fluent in JavaScript as well as Klingon.CommanderROR is fluent in JavaScript as well as Klingon.CommanderROR is fluent in JavaScript as well as Klingon.CommanderROR is fluent in JavaScript as well as Klingon.CommanderROR is fluent in JavaScript as well as Klingon.CommanderROR is fluent in JavaScript as well as Klingon.CommanderROR is fluent in JavaScript as well as Klingon.CommanderROR is fluent in JavaScript as well as Klingon.CommanderROR is fluent in JavaScript as well as Klingon.CommanderROR is fluent in JavaScript as well as Klingon.
 
CommanderROR's Avatar
 
Posts: 2,022
Karma: 4924
Join Date: Mar 2006
Location: Germany
Device: STAReBOOK, iRex Iliad, Sony 505, Kindle 2
@scotty1024

Why don't you start posting your apps and hacks in the Sticky https://www.mobileread.com/forums/showthread.php?t=8167 ?

You are doing so many things that it is becoming hard to follow all your efforts. The thread was created specifically for the purpose of making the findings of all mobileread.com "developers" eaiser and fast to find.

Thanks.
CommanderROR is offline   Reply With Quote
Old 10-25-2006, 04:58 PM   #10
NatCh
Gizmologist
NatCh ought to be getting tired of karma fortunes by now.NatCh ought to be getting tired of karma fortunes by now.NatCh ought to be getting tired of karma fortunes by now.NatCh ought to be getting tired of karma fortunes by now.NatCh ought to be getting tired of karma fortunes by now.NatCh ought to be getting tired of karma fortunes by now.NatCh ought to be getting tired of karma fortunes by now.NatCh ought to be getting tired of karma fortunes by now.NatCh ought to be getting tired of karma fortunes by now.NatCh ought to be getting tired of karma fortunes by now.NatCh ought to be getting tired of karma fortunes by now.
 
NatCh's Avatar
 
Posts: 11,615
Karma: 929550
Join Date: Jan 2006
Location: Republic of Texas Embassy at Jackson, TN
Device: Pocketbook Touch HD3
I can't follow them even when I find them all.
NatCh is offline   Reply With Quote
Old 10-25-2006, 09:54 PM   #11
scotty1024
Banned
scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.
 
Posts: 1,300
Karma: 1479
Join Date: Jul 2006
Location: Peoples Republic of Washington
Device: Reader / iPhone / Librie / Kindle
Quote:
Originally Posted by rpink
OpenSuse 10

java-1.4.2-sun
You'll find that 1.5.0_09 is noticeably faster in addition to compiling RTFToIliad with no complaints.

You can download it directly from Sun: http://java.sun.com/javase/downloads/index.jsp
scotty1024 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
New tool? cloggy Reading and Management 2 08-27-2010 05:13 PM
iPad as a tool petermillard Apple Devices 1 04-13-2010 10:59 AM
agenda2pdf tool Iñigo PDF 1 10-04-2009 09:26 AM
Prototyping tool James007 Reading and Management 4 05-21-2009 10:43 AM
yet another cropping tool moggie PDF 4 01-16-2009 04:42 AM


All times are GMT -4. The time now is 12:57 AM.


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