View Full Version : LRFTools. Convert LRF to EPUB, HTML, PDF and RTF


Pages : [1] 2

elinares
09-04-2008, 08:48 AM
Another tool, credits to scotty1024 (LRFParse.java), Bruno Lowagie (iText) and people at apache jakarta project, xHTMLRenderer project and others right now I cannot remember.

It can convert LRF files to RTF, PDF, HTML and EPUB. Also can merge LRF and PDF books in one big PDF with TOC, and merge EPUB files into one. And now you can view epub files (use page and key down/up).

You can convert PDFs to EPUB using this tool.
And starting at version 0.9.193, you can conver MS Word 2007 (docx) files to EPUB
v0.9.204 can deal with all scrambled and/or compressed streams

New version 0.9.236 use latest versions of pdfbox, iText and some other libs. For devs: LRFTools is now a Maven project.

Usage:
http://code.google.com/p/lrf-epub-tools/

Download:
http://code.google.com/p/lrf-epub-tools/downloads/list

ChangeLog:
http://code.google.com/p/lrf-epub-tools/updates/list

Format C:
09-04-2008, 10:23 AM
Genial!
I download a LRF from here, and I'll try it immediatly!

acidzebra
09-04-2008, 10:30 AM
Another tool, credits to scotty1024 (LRFParse.java) and Bruno (iText). It can convert LRF files to RTF, PDF or XML (my own xml format).

Sounds great - does it preserve formatting and images and all?

Format C:
09-04-2008, 10:36 AM
I'm unlucky...

Put the book in a dir called "a". Here's the output:

Error occurred during initialization of VM
Incompatible minimum and maximum heap sizes specified

Any suggestion?

acidzebra
09-04-2008, 10:39 AM
Error occurred during initialization of VM
Incompatible minimum and maximum heap sizes specified

I had the same, but removing the "-Xms100M" part solved that - I don't know what it is for? Something for allocating heap size?

As for images, it looks like they are preserved! Yay!

Some of the formatting looked a bit weird in PDF but links work, the formatting looks better in RTF but I lost the links.

Great effort! This totally should be a sticky post.

Format C:
09-04-2008, 10:46 AM
Removed the option, here's the output:


Creando 2003.rtf...java.lang.NullPointerException
at java.lang.StringBuffer.<init>(Unknown Source)
at com.lowagie.text.Meta.<init>(Unknown Source)
at com.lowagie.text.Header.<init>(Unknown Source)
at com.lowagie.text.Document.addHeader(Unknown Source)
at lrf.objects.Book.getRTF(Book.java:245)
at lrf.parse.RecurseDirs.dumpToRTF(RecurseDirs.java:1 56)
at lrf.parse.RecurseDirs.convertAction(RecurseDirs.ja va:204)
at lrf.parse.RecurseDirs.<init>(RecurseDirs.java:108)
at lrf.parse.RecurseDirs.main(RecurseDirs.java:33)
RTF Error


Same with pdf.

acidzebra
09-04-2008, 11:28 AM
Removed the option, here's the output:


Creando 2003.rtf...java.lang.NullPointerException
at java.lang.StringBuffer.<init>(Unknown Source)
at com.lowagie.text.Meta.<init>(Unknown Source)
at com.lowagie.text.Header.<init>(Unknown Source)
at com.lowagie.text.Document.addHeader(Unknown Source)
at lrf.objects.Book.getRTF(Book.java:245)
at lrf.parse.RecurseDirs.dumpToRTF(RecurseDirs.java:1 56)
at lrf.parse.RecurseDirs.convertAction(RecurseDirs.ja va:204)
at lrf.parse.RecurseDirs.<init>(RecurseDirs.java:108)
at lrf.parse.RecurseDirs.main(RecurseDirs.java:33)
RTF Error


Same with pdf.

Wow, you ARE unlucky. I tried this on my corporate XP box.

Commandline: java -jar LRFTools.jar convert d:\export -RTF
Where D:\export contained the lrfs (a single one to test, actually)

java version "1.6.0_01"
Java(TM) SE Runtime Environment (build 1.6.0_01-b06)
Java HotSpot(TM) Client VM (build 1.6.0_01-b06, mixed mode, sharing)

So what command line and java version for you?

elinares
09-04-2008, 11:33 AM
I'm unlucky...

Put the book in a dir called "a". Here's the output:

Error occurred during initialization of VM
Incompatible minimum and maximum heap sizes specified

Any suggestion?

Yes, I must say you need a java VM version 1.6, and append also -Xmx100M. I'm going to edit initial post to reflect this.

elinares
09-04-2008, 11:35 AM
Removed the option, here's the output:


Creando 2003.rtf...java.lang.NullPointerException
at java.lang.StringBuffer.<init>(Unknown Source)
at com.lowagie.text.Meta.<init>(Unknown Source)
at com.lowagie.text.Header.<init>(Unknown Source)
at com.lowagie.text.Document.addHeader(Unknown Source)
at lrf.objects.Book.getRTF(Book.java:245)
at lrf.parse.RecurseDirs.dumpToRTF(RecurseDirs.java:1 56)
at lrf.parse.RecurseDirs.convertAction(RecurseDirs.ja va:204)
at lrf.parse.RecurseDirs.<init>(RecurseDirs.java:108)
at lrf.parse.RecurseDirs.main(RecurseDirs.java:33)
RTF Error


Same with pdf.

Hmm, Could you send/post me the book? I'll try...

Format C:
09-04-2008, 11:44 AM
OK tried java -version:

java version "1.6.0_04"
Java(TM) SE Runtime Environment (build 1.6.0_04-b12)
Java HotSpot(TM) Client VM (build 10.0-b19, mixed mode, sharing)

elinares
09-04-2008, 11:44 AM
Sounds great - does it preserve formatting and images and all?
Yes, it supports PNG, GIF, BMP and JPG both to PDF and RTF. I have try to conserve formatting, but sometimes with books created with some tools tends to create one paragrap per line, and then the conversions try to emit a new Paragraph for each line. I've try to 'concatenate' these, there is a program parameter to do this (Beta) : -catpar. So if you try:

java -jar LRFTools.jar convert dir -PDF -RTF -catpar

LRFTools try to concatenate these lines, but this is not always the best formatting...

Format C:
09-04-2008, 11:50 AM
No luck with < java -Xms100M -Xmx100M -jar LRFTools.jar convert a -RTF > neither.

I'm trying this book here:

http://www.mobileread.com/forums/showthread.php?p=246429#post246429

acidzebra
09-04-2008, 11:55 AM
I have try to conserve formatting, but sometimes with books created with some tools tends to create one paragrap per line, and then the conversions try to emit a new Paragraph for each line

Hmmm, I attached two examples. The source file for conversion to lrf was plain HTML, no special formatting. The de-converted rtf file looks great, but the line spacing on the PDF goes wonky in places. See the attached examples.

I will reiterate, great tool - many many thanks.

GeneS
09-04-2008, 02:48 PM
I'm trying it with no luck so far.
Running java -version, results in:
Java(TM) SE Runtime Environment (build 1.6.0_07_b06)
Java HotSpot(TM) Client VM (Build 10.0-b23, mixed mode, sharing)

Trying to run the command:
java -Xms100M -Xmx100M -jar LRFTools.jar convert h:\ebook Conversion\lrftools -RTF

trying to get just an rtf output for a single lrf (Trumpet-Major.lrf) in the directory results in:

java.lang.NullPointerException
at lrf.parse.ResurseDirs.convertAction(RecurseDirs.ja va:186)
at lrf.parse.ResurseDirs.(init)(RecurseDirs.java:108)
at lrf.parse.ResurseDirs.main(RecurseDirs.java:33)

Since I'm not a java-phile, I have no idea where to go from here. Any help out there?

Thanks,
Gene

elinares
09-04-2008, 04:32 PM
No luck with < java -Xms100M -Xmx100M -jar LRFTools.jar convert a -RTF > neither.

I'm trying this book here:

http://www.mobileread.com/forums/showthread.php?p=246429#post246429

OK, this night I will take a look...

elinares
09-04-2008, 04:35 PM
Hmmm, I attached two examples. The source file for conversion to lrf was plain HTML, no special formatting. The de-converted rtf file looks great, but the line spacing on the PDF goes wonky in places. See the attached examples.

I will reiterate, great tool - many many thanks.

Could you post me the example please (lrf file)? Thanks

elinares
09-04-2008, 04:38 PM
I'm trying it with no luck so far.
Running java -version, results in:
Java(TM) SE Runtime Environment (build 1.6.0_07_b06)
Java HotSpot(TM) Client VM (Build 10.0-b23, mixed mode, sharing)

Trying to run the command:
java -Xms100M -Xmx100M -jar LRFTools.jar convert h:\ebook Conversion\lrftools -RTF

trying to get just an rtf output for a single lrf (Trumpet-Major.lrf) in the directory results in:

java.lang.NullPointerException
at lrf.parse.ResurseDirs.convertAction(RecurseDirs.ja va:186)
at lrf.parse.ResurseDirs.(init)(RecurseDirs.java:108)
at lrf.parse.ResurseDirs.main(RecurseDirs.java:33)

Since I'm not a java-phile, I have no idea where to go from here. Any help out there?

Thanks,
Gene

Try with quotes on dir:

java -Xms100M -Xmx100M -jar LRFTools.jar convert "h:\ebook Conversion\lrftools" -RTF

acidzebra
09-04-2008, 04:44 PM
Could you post me the example please (lrf file)? Thanks

You can grab both the lrf and the raw HTML here:
http://www.mobileread.com/forums/showthread.php?t=28515

I've reviewed the same section in the HTML file and see nothing special, but perhaps I am overlooking it. It was converted with Calibre's html2lrf, the command used is in the same post as the files.

On that note, what I would really love is well-formatted HTML from LRF, any chance of that?

JSWolf
09-04-2008, 06:06 PM
Great effort! This totally should be a sticky post.
I made this a sticky earlier today.

elinares
09-04-2008, 07:58 PM
No luck with < java -Xms100M -Xmx100M -jar LRFTools.jar convert a -RTF > neither.

I'm trying this book here:

http://www.mobileread.com/forums/showthread.php?p=246429#post246429

Hope new version 0.1.21 works well...

GeneS
09-04-2008, 08:14 PM
Try with quotes on dir:

java -Xms100M -Xmx100M -jar LRFTools.jar convert "h:\ebook Conversion\lrftools" -RTF

Thanks, Elinares:
Enclosing the directory in quotes got me part-way there. Got a conversion without error messages, but the file contains only the images--no text. If there are no images in the file, I get a single blank rtf page. Any ideas?
Thanks,
GeneS

Format C:
09-05-2008, 05:18 AM
Hope new version 0.1.21 works well...

It works well with the file I linked before.
It does not with other files, which I got by conversion from other formats.
Calibre read them well, and the LRF2LRS converter works well.

I cannot post them here, though, because in the US they're still under copyright.

In any case, Thank you!

:thanks:

Format C:
09-05-2008, 06:29 AM
I changed font size with =X='s LRF2LRF and it worked, but I got a RTF with a bold "Error! Hyperlink reference not valid." at each page break.

Things are getting better...

;)

elinares
09-05-2008, 06:54 AM
I changed font size with =X='s LRF2LRF and it worked, but I got a RTF with a bold "Error! Hyperlink reference not valid." at each page break.

Things are getting better...

;)

Yes, I've notice it if you use Microsoft Word, StarOffice does not prompt you. Anyway links in RTF have problems actually; I'm working on...

JeffElkins
09-05-2008, 01:58 PM
java -Xms100M -jar /usr/local/bin/LRFTools.jar convert dick_pk/ -RTF
java.io.FileNotFoundException: /software/sony/dick_pk\Do_Androids_Dream_of_Electric_Sheep.lrf (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at lrf.objects.Book.getFile(Book.java:173)
at lrf.objects.Book.<init>(Book.java:119)
at lrf.parse.RecurseDirs.convertAction(RecurseDirs.ja va:189)
at lrf.parse.RecurseDirs.<init>(RecurseDirs.java:101)
at lrf.parse.RecurseDirs.main(RecurseDirs.java:26)


Not working here. Does this require Windows? I ask because of the java.io.FileNotFoundException.

elinares
09-06-2008, 06:43 AM
Not working here. Does this require Windows? I ask because of the java.io.FileNotFoundException.

I've made a mistake. No, windows is not required, but *nix does not like '\' as path separator ...

smithno
09-06-2008, 08:41 AM
I've read this thread twice and I can't find a URL to download LRFTools from. Am I just missing it or is the link missing?

JSWolf
09-06-2008, 09:04 AM
I've read this thread twice and I can't find a URL to download LRFTools from. Am I just missing it or is the link missing?
See the first post in this thread for the attachment.

http://www.mobileread.com/forums/showthread.php?t=28707

elinares
09-06-2008, 07:35 PM
Thanks, Elinares:
Enclosing the directory in quotes got me part-way there. Got a conversion without error messages, but the file contains only the images--no text. If there are no images in the file, I get a single blank rtf page. Any ideas?
Thanks,
GeneS

Try with version 0.1.36. If you convert to it to XML, check that <Text> tags have really text (are not empty)...

GeneS
09-06-2008, 08:32 PM
Try with version 0.1.36. If you convert to it to XML, check that <Text> tags have really text (are not empty)...

Using 0.1.36 results in:

java -Xms100M -Xmx100M -jar lrftools-0.1.36.jar convert "h:\ebook conversion\lrftools" -RTF
java.lang.ArrayIndexOutOfBoundsException: 173
at lrf.parse.PointedBuffer.getShort(PointedBuffer.jav a:62)
at lrf.parse.PointedBuffer.getShort(PointedBuffer.jav a:55)
at lrf.objects.tags.TagStream.<init>(TagStream.java:45)
at lrf.objects.BBObj.loadTag(BBObj.java:316)
at lrf.objects.BBObj.<init>(BBObj.java:166)
at lrf.objects.Text.<init>(Text.java:10)
at lrf.objects.Book.loadObjects(Book.java:554)
at lrf.objects.Book.<init>(Book.java:113)
at lrf.parse.RecurseDirs.convertAction(RecurseDirs.ja va:217)
at lrf.parse.RecurseDirs.<init>(RecurseDirs.java:111)
at lrf.parse.RecurseDirs.main(RecurseDirs.java:27)

Thanks for looking at this.
Gene

JeffElkins
09-06-2008, 08:34 PM
Working well here for lrf->rtf! Do you plan:

lrf->html
image extraction?

Thanks for your efforts!

elinares
09-07-2008, 06:33 AM
Using 0.1.36 results in:

java -Xms100M -Xmx100M -jar lrftools-0.1.36.jar convert "h:\ebook conversion\lrftools" -RTF
java.lang.ArrayIndexOutOfBoundsException: 173
at lrf.parse.PointedBuffer.getShort(PointedBuffer.jav a:62)
at lrf.parse.PointedBuffer.getShort(PointedBuffer.jav a:55)
at lrf.objects.tags.TagStream.<init>(TagStream.java:45)
at lrf.objects.BBObj.loadTag(BBObj.java:316)
at lrf.objects.BBObj.<init>(BBObj.java:166)
at lrf.objects.Text.<init>(Text.java:10)
at lrf.objects.Book.loadObjects(Book.java:554)
at lrf.objects.Book.<init>(Book.java:113)
at lrf.parse.RecurseDirs.convertAction(RecurseDirs.ja va:217)
at lrf.parse.RecurseDirs.<init>(RecurseDirs.java:111)
at lrf.parse.RecurseDirs.main(RecurseDirs.java:27)

Thanks for looking at this.
Gene
Hmm, Could you send me the LRF? have Copyright?

elinares
09-07-2008, 08:03 AM
Working well here for lrf->rtf! Do you plan:

lrf->html
image extraction?

Thanks for your efforts!

Version 0.2.38 (released today) has basic support for HTML, including links and images.

GeneS
09-07-2008, 08:27 AM
Hmm, Could you send me the LRF? have Copyright?

LRF is attached. It's the recently posted Thomas Hardy novel.
Gene

elinares
09-11-2008, 04:11 PM
LRF is attached. It's the recently posted Thomas Hardy novel.
Gene

Well, I belive this is OK with new version 0.2.45 posted just now.
Enjoy...

GeneS
09-11-2008, 10:57 PM
LRF is attached. It's the recently posted Thomas Hardy novel.
Gene

Well, I belive this is OK with new version 0.2.45 posted just now.
Enjoy...

Simply, MARVELOUS. :thanks: Works great! :2thumbsup

GeneS

elinares
09-23-2008, 06:23 AM
Posted new version. Render engine has been completely rewritten, and a new action is added: merge; starting at a dir, build a big PDF with all pdf and lrf found on it; with a TOC.

JasonWalton
09-23-2008, 08:58 AM
Where can I find this LRFParse.java of which you speak?

elinares
09-23-2008, 09:56 AM
Where can I find this LRFParse.java of which you speak?

I don't remember exactly. I get it from a yahoo users group.
Sorry, Eladio

elinares
10-07-2008, 07:49 AM
Hi,
This new version supports conversions to ePub format.
Enjoy, Eladio

Format C:
10-07-2008, 01:38 PM
Hi,
This new version supports conversions to ePub format.
Enjoy, Eladio

I'm getting this message with the last two versions, no matter which book I use:

java.lang.NullPointerException
at lrf.RecurseDirs.convertAction(RecurseDirs.java:288 )
at lrf.RecurseDirs.<init>(RecurseDirs.java:125)
at lrf.RecurseDirs.main(RecurseDirs.java:32)

:blink:

elinares
10-07-2008, 05:36 PM
I'm getting this message with the last two versions, no matter which book I use:

java.lang.NullPointerException
at lrf.RecurseDirs.convertAction(RecurseDirs.java:288 )
at lrf.RecurseDirs.<init>(RecurseDirs.java:125)
at lrf.RecurseDirs.main(RecurseDirs.java:32)

:blink:

Please, double check command-line arguments (or post it here for revision).
Thanks for testing.

elinares
10-09-2008, 04:33 AM
Hello,
I've discovered the way to allow an epub file to be font-resized on our device. I'm working on the next version.

Format C:
10-09-2008, 08:55 AM
Please, double check command-line arguments (or post it here for revision).
Thanks for testing.

I've solved using less memory (-Xmx50M).

:thumbsup:

Format C:
10-09-2008, 08:58 AM
A question about HTML:

The choice of the tags to be used (<p>, <h#>, etc...) is made by the tool or are they written in the final file by transcoding something that is in the original lrf?

Thanx

JeffElkins
10-09-2008, 12:00 PM
Hello,
I've discovered the way to allow an epub file to be font-resized on our device. I'm working on the next version.

Elinares, are you making the source available?

JeffElkins
10-09-2008, 12:32 PM
Btw, with the current 0.9.101 when extracting to html, the image tag is preceded by "file:"


<img src="file:This_Crowded_Earth/3.png"


This breaks the html with some browsers and with FBReader.

elinares
10-10-2008, 08:26 PM
A question about HTML:

The choice of the tags to be used (<p>, <h#>, etc...) is made by the tool or are they written in the final file by transcoding something that is in the original lrf?

Thanx

Current version uses iText library. This library works well for PDF and RTF, but it does not make a good job with HTML. Right now I'm rewriting the Render of HTML, so next version will work significantly better for HTML and EPUB.
So the choice now is taken by iText.
Hope i answer your question,
Eladio

elinares
10-10-2008, 08:27 PM
Elinares, are you making the source available?
No problem, when i get some time i want to make it available at sourceforge.

elinares
10-10-2008, 08:32 PM
Btw, with the current 0.9.101 when extracting to html, the image tag is preceded by "file:"


<img src="file:This_Crowded_Earth/3.png"


This breaks the html with some browsers and with FBReader.

OK. This will be fixed soon.

elinares
10-10-2008, 08:35 PM
I've having problems to find an OTF (Opentype font) free to include in LRFTools. EPUB files MUST embed these fonts to work properly. Now I'm working with "AurulentSans", but it is no very good.
Anyone konws a free OTF font?
Thanks, Eladio

kovidgoyal
10-10-2008, 08:56 PM
AS far as I know, EPUB files dont have to have embedded fonts. In any case google the liberation fonts.

elinares
10-11-2008, 06:46 PM
AS far as I know, EPUB files dont have to have embedded fonts. In any case google the liberation fonts.

Thanks!

elinares
10-14-2008, 04:16 PM
New Version 0.9.105 removes "file:" from img src tag, and now EPUB and PDF files are better converted. EPUB files also can be resized on device.
Enjoy, Eladio

elinares
10-16-2008, 11:05 AM
New version v0.9.119.
Some BUGS corrected, and now embedding OTF fonts is optional (you saves about 300K of size) and overwriting existing files is also optional.

Mods, please, is possible to change the title of the thread? I think it is better:
"LRFTools. Convert LRF to EPUB, HTML, PDF and RTF"

JeffElkins
10-20-2008, 08:47 PM
New version v0.9.119.
Some BUGS corrected, and now embedding OTF fonts is optional (you saves about 300K of size) and overwriting existing files is also optional.

Mods, please, is possible to change the title of the thread? I think it is better:
"LRFTools. Convert LRF to EPUB, HTML, PDF and RTF"

A bug in .119: Chapter headings are duplicated when converting to html. e.g.:

Forward
Forward

Chapter 1
Chapter 1

etc.

elinares
10-21-2008, 01:27 PM
A bug in .119: Chapter headings are duplicated when converting to html. e.g.:

Forward
Forward

Chapter 1
Chapter 1

etc.

Hi Jeff, I cannot reproduce this bug with my books. could you send me yours for testing?
Thanks, Eladio

JeffElkins
10-21-2008, 01:36 PM
Hi Jeff, I cannot reproduce this bug with my books. could you send me yours for testing?
Thanks, Eladio

It's a book uploaded to mobileread,com -- Available: Here (http://www.mobileread.com/forums/showthread.php?t=30852)

elinares
10-22-2008, 11:48 AM
A bug in .119: Chapter headings are duplicated when converting to html. e.g.:

Forward
Forward

Chapter 1
Chapter 1

etc.

Well, really this book has footers. The Sony Reader is able to show them. When converting to HTML, I am confused about how to handle Headers an Footers. Now both are shown one time (what you see is footer and then title). I suppose is better to disable it when converting to HTML, or to make it optional with a new command line argument...

elinares
10-22-2008, 11:56 AM
New version v0.9.134 solves more bugs and permit Merging of some epub into one, using TOC to index the new epub.

elinares
10-23-2008, 04:28 AM
Version 0.9.134 has regression errors. Corrected at version 0.9.136.
Sorry for the inconvenience.

elinares
10-23-2008, 01:19 PM
I've incorporated an EPUB Viewer (see thumbs). Very basic for now, but using xhtmlrenderer from Sun (Supports CSS 2.1) as LGPL. I'm trying to share source code at sourceforge this weekend.

New Version 0.9.137 with new action 'view epubfile' . See initial post in a while...

P.D. I belive this starts to be a little off-topic (epub viewer must go to another thread?)

igorsk
10-23-2008, 05:22 PM
Don't use Sourceforge... better check Google Code or Mobileread's Dev Hub.

elinares
10-23-2008, 06:40 PM
Don't use Sourceforge... better check Google Code or Mobileread's Dev Hub.

OK, I'll take a look on them.

Posted new version 0.9.137.

elinares
10-25-2008, 06:41 AM
I've posted source code at http://code.google.com/p/lrf-epub-tools/

elinares
10-28-2008, 03:19 PM
New version.

JeffElkins
10-28-2008, 04:19 PM
Very nice! Thanks for the continued effort on this badly needed tool.

NoelEiffe
11-02-2008, 01:05 PM
Hi there...

Trying to run this tool ...

Using this command (on a mac in terminal):

java -Xms200M -Xmx300M -jar LRFTools-v0.9.148.jar action convert dir -HTML -noo


Getting these errors:

Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java :675)
at java.security.SecureClassLoader.defineClass(Secure ClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader .java:260)
at java.net.URLClassLoader.access$100(URLClassLoader. java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java: 195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.j ava:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:3 16)
at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:280)
at java.lang.ClassLoader.loadClass(ClassLoader.java:2 51)
at java.lang.ClassLoader.loadClassInternal(ClassLoade r.java:374)

Not quite sure what I might be doing wrong here...any ideas?

Thanks much...

Noel

elinares
11-03-2008, 06:35 PM
Hi there...

Trying to run this tool ...

Using this command (on a mac in terminal):

java -Xms200M -Xmx300M -jar LRFTools-v0.9.148.jar action convert dir -HTML -noo


Getting these errors:

Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java :675)
at java.security.SecureClassLoader.defineClass(Secure ClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader .java:260)
at java.net.URLClassLoader.access$100(URLClassLoader. java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java: 195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.j ava:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:3 16)
at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:280)
at java.lang.ClassLoader.loadClass(ClassLoader.java:2 51)
at java.lang.ClassLoader.loadClassInternal(ClassLoade r.java:374)

Not quite sure what I might be doing wrong here...any ideas?

Thanks much...

Noel

It seems to be a problem with JVM (Java) Version. I've compiled LRFTools with latest SDK (1.6), so try to upgrade your JRE or SDK with it.
Thanks for testing,
Eladio

badgoodDeb
11-11-2008, 05:06 PM
@NoelEiffe: On a mac, I had to go to http://apple.com/downloads and explicitly search for java 1.6 .... but it *is* available. Just doesn't seem to download unless you go and ask for it. Oh, I had to relink the "Current" directory of the javas to point to the 1.6 one, too.

However, using a similar command:
java -Xms200M -Xmx300M -jar LRFTools-v0.9.148.jar convert "LRFs" -RTF -noo

I got this error:
Apple AWT Startup Exception : *** - [NSCFArray insertObject:atIndex:]} attempt to insert nil
Apple AWT Restarting Native Event Thread

Any clues about this? It said the same thing for -HTML and for -RTF and for -PDF. (Didn't try -XML) Oddly, converting to -EPUB *did* work (fantastically, thank you so very much!!) So I used Stanza to read the EPUB files and export as mobipocket, my final target.

But any idea why the insert nil error with 3 formats and not with EPUB ?

elinares
11-12-2008, 06:29 PM
@NoelEiffe: On a mac, I had to go to http://apple.com/downloads and explicitly search for java 1.6 .... but it *is* available. Just doesn't seem to download unless you go and ask for it. Oh, I had to relink the "Current" directory of the javas to point to the 1.6 one, too.

However, using a similar command:
java -Xms200M -Xmx300M -jar LRFTools-v0.9.148.jar convert "LRFs" -RTF -noo

I got this error:
Apple AWT Startup Exception : *** - [NSCFArray insertObject:atIndex:]} attempt to insert nil
Apple AWT Restarting Native Event Thread

Any clues about this? It said the same thing for -HTML and for -RTF and for -PDF. (Didn't try -XML) Oddly, converting to -EPUB *did* work (fantastically, thank you so very much!!) So I used Stanza to read the EPUB files and export as mobipocket, my final target.

But any idea why the insert nil error with 3 formats and not with EPUB ?

Hi, look at http://blog.nominet.org.uk/tech/2008/04/24/restarting-the-awt-native-event-thread/; it seems you have a problem with your java configuration.
Thanks for testing,
Eladio

badgoodDeb
11-13-2008, 02:44 PM
Thank you!! What they describe in there is EXACTLY what I did. I was uneasy about it at the time, too. I'll go fix it.

Seleuco
11-16-2008, 03:17 PM
Hola. Gran trabajo (good work)

Im using Java(TM) SE Runtime Environment (build 1.6.0_07-b06)

Some bugs i found:

- Otelo - Shakespeare.lrf makes a big crash.

- PDF: Bug with spanish fonts bad.jpg <-> good.jpg. Be nice to put an index from lrf metadatawith hyperlinks in the PDF.

- Epub: Double spaces between words? is wrong (ugly) with the Ebook viewer calibre and with the Stanza in the iphone with styles on.

- Epub: Images sometimes in incorrect order, varius epub null pointers, not working hyperlinks from TOC (clicking is not going to the relevant section)

In spanish:

- El lrf de otelo peta la JVM.
- PDF: Fallos con fuentes bad.jpg <-> good.jpg. Seria genial que metiera un indice a partir de la metada del lrf con hiperenlaces.
- Epub: mete doble espacios entre palabras? se ve mal con el Ebook viewer de calibre y con el stanza del iphone si aplicas estilos.
- Epub: imagenes a veces en orden incorrecto e incluso dadas la vuelta,fallos de null pointer, no funciona los hiperenlaces del TOC (si pinchas no va a la sección correspondiente)


Te adjunto ejemplos. Un saludote.

elinares
11-18-2008, 11:43 AM
Hola. Gran trabajo (good work)

Im using Java(TM) SE Runtime Environment (build 1.6.0_07-b06)

Some bugs i found:

- Otelo - Shakespeare.lrf makes a big crash.

- PDF: Bug with spanish fonts bad.jpg <-> good.jpg. Be nice to put an index from lrf metadatawith hyperlinks in the PDF.

- Epub: Double spaces between words? is wrong (ugly) with the Ebook viewer calibre and with the Stanza in the iphone with styles on.

- Epub: Images sometimes in incorrect order, varius epub null pointers, not working hyperlinks from TOC (clicking is not going to the relevant section)

In spanish:

- El lrf de otelo peta la JVM.
- PDF: Fallos con fuentes bad.jpg <-> good.jpg. Seria genial que metiera un indice a partir de la metada del lrf con hiperenlaces.
- Epub: mete doble espacios entre palabras? se ve mal con el Ebook viewer de calibre y con el stanza del iphone si aplicas estilos.
- Epub: imagenes a veces en orden incorrecto e incluso dadas la vuelta,fallos de null pointer, no funciona los hiperenlaces del TOC (si pinchas no va a la sección correspondiente)


Te adjunto ejemplos. Un saludote.

Try new version 0.9.158; some of the bugs are corrected.
I'll try to fix others when i get some time...

***sorry***
Me ayudaría si identificases cada bug con el libro y página que lo tiene. Si no, tendría que repasar todos los libros uno por uno!
***End sorry***
Thanks for testing,
Eladio

recordsmith
11-18-2008, 06:31 PM
Hey guys,

I am new to running Java. Could someone tell me how to run this program? I am running OS X10.5. I have downloaded it. Now when I try to run the command on the first page I get "Unable to access LRFT..." What is the process for running the program?

Thanks
Jon

pilotbob
11-18-2008, 06:38 PM
Hey guys,

I am new to running Java. Could someone tell me how to run this program? I am running OS X10.5. I have downloaded it. Now when I try to run the command on the first page I get "Unable to access LRFT..." What is the process for running the program?

Thanks
Jon

Does the command line on the first message not work for you? What command are you running?

BOb

Seleuco
11-18-2008, 06:54 PM
OK. Nice work! A big improvement.

****
Parece que ya no peta ningún epub.

El problema de las fuentes en e PDF lo tienes en la regenta (al ppio del libro el primer diálogo pag 5) y muchos otros libros donde aparecen guión y letra. (este bug particularmente es el que mas me joroba ya que muchos de los lrf que tengo tienen ese problema) Me da gana de sacar el eclipse y tirar de debugger, pero tiene telita tu código (me baje del svn los src)... jeje....

Lo curioso es que se ve mal con el acrobat (versión 8) de windows, el el iphone se ve bién.

También sigue pasando lo del doble espaciado... también me parece muy critico porque hace el formato del epub poco usable. Pasa en todos los epub...

He probado rápido y parece que sigue sin ir bien los enlaces en los epub, en uno me han funcionado pero en otros muchos no.

******

recordsmith
11-18-2008, 08:37 PM
Yes the I have tried the command from the first message and I got the, "Unable to access LRFTools-v0.9.148.jar" message. I am using terminal. I am accessing the .jar file from the directory it resides in. Any thoughts?

recordsmith
11-18-2008, 08:41 PM
I am sorry, I am dumb. I just spelled the .jar file wrong. I went back and looked at the command. Dumb.

Sorry again for being stupid.

Gagan
11-19-2008, 01:43 AM
I tried to use java -Xms200M -Xmx300M -jar LRFTools-vx.y.z.jar convertPDF "C:\test" but it dint work. It gave me the parameter output meaning some parameter is wrong.
Can u plz tell me how to convert pdf to epub using this tool.
Thanx.

Gagan
11-19-2008, 01:44 AM
actually this is the command I ran ..the correct version of the LRF...
java -Xms200M -Xmx300M -jar LRFTools-v0.9.148.jar convertPDF "C:\test"

elinares
11-24-2008, 05:22 AM
actually this is the command I ran ..the correct version of the LRF...
java -Xms200M -Xmx300M -jar LRFTools-v0.9.148.jar convertPDF "C:\test"

Hi gagan. To use convertPDF actually you need to specify -SVG. I've reserved the above command line for the new PDF2EPUB conversion method. So, now you must write:

java -Xms200M -Xmx300M -jar LRFTools-v0.9.148.jar convertPDF "C:\test" -SVG

QBColleen
11-26-2008, 04:43 AM
1) I downloaded Water for Elephants in .rgo format...what the heck is that? What can open it. When I clicked it..adobe acrobat opened and said, "sorry it won't work here"..(it has the adobe icon)...
2) I still can't find a DRM buster(remover thingie), I have one .lit file and just a couple of .pdf's that won't open ...are drm'd.

3) Which brings me to frictionwise...(yes, frictionwise!!) I downloaded Duma Key in .lit cuz at the time I was converting my .lit's to .rtf's...I, not having dealt with them or purchased a book, assumed (wrongly) that I'd convert it...well I found out the hard way...it wouldn't convert.

4) I'm now wanting to purchase another book: Edgar Sawtelle...and don't see .lrf option. Is is safe to click BBEB? If I pick the wrong format...they won't swap with me or even answer an inquiry.

I ramble...it's almost 1 a.m., but these are my questions that I've wanted answered for several days.

Colleen with more converter's than books (almost)

TIA, C in CA

elinares
12-04-2008, 01:25 PM
True PDF to EPUB conversion added.

badgoodDeb
12-06-2008, 04:26 PM
Any chance of PDF to HTML ??? That would be truly wondermous!!

Right now I can use LRFtools to go from LRF to HTML, and then html2mobi to go to Mobi. If I had a way to make PDF become mobi, I'd be so happy!!!

P.S. Thanks for the goodness in LRFtools that lets me make LRF files become readable in mobi (on my Kindle). Now I'm just reaching for the moon, and asking for PDFs to work equally well for my particular needs. ;)

elinares
12-07-2008, 03:40 PM
Any chance of PDF to HTML ??? That would be truly wondermous!!

Right now I can use LRFtools to go from LRF to HTML, and then html2mobi to go to Mobi. If I had a way to make PDF become mobi, I'd be so happy!!!

P.S. Thanks for the goodness in LRFtools that lets me make LRF files become readable in mobi (on my Kindle). Now I'm just reaching for the moon, and asking for PDFs to work equally well for my particular needs. ;)

You can now convert PDF to EPUB. If you change book file name extension from .epub to .zip you can open book content, and this is html/css (LRFTools saves html pages, images and css files to OBPS directory).

badgoodDeb
12-12-2008, 04:19 PM
You can now convert PDF to EPUB. If you change book file name extension from .epub to .zip you can open book content, and this is html/css (LRFTools saves html pages, images and css files to OBPS directory).

I wonder if I'm missing some fonts, or some program. Here is a sample of what LRFTools made for me, with EPUB output. The first is from a PDF file, so I used "convertPDF". It's not a useable output, at least viewing the html (epub) bits on my mac. Would it be better after html2mobi conversion?

The second is similar (PDF via convertPDF) but is at least readable. I like the title alteration (should be BUBBLE).

The third is from a LRF file. I used "convert -EPUB" (older version maybe, if the options don't currently match). It's quite good, other than quotation marks. But I can't get "good" from an original PDF file. My success (above) is with "convert -HTML". THAT's great!

badgoodDeb
12-12-2008, 04:20 PM
Also -- SVG isn't recognized by many browsers on the mac. Is JPG an option?

DaleDe
12-16-2008, 06:10 PM
Also -- SVG isn't recognized by many browsers on the mac. Is JPG an option?

SVG is a vector language while JPG is a raster language. Read the wiki article to learn about the difference Graphics (http://wiki.mobileread.com/wiki/Graphics)
Converting to SWF and using a shockwave add on would be better but the ePUB standard only supports SVG.

Dale

astrodad
12-17-2008, 04:24 PM
I tried this on this file:

http://www.mobileread.com/forums/showthread.php?t=34128

The line spacing was really bad. It went into triple-spacing.

lionfish
12-25-2008, 04:15 AM
Thank you very much for this nice program.

I've added a GUI for a simpler usage. Simply put it together with the LRFTools is OK.

elinares
12-26-2008, 12:02 PM
Thank you very much for this nice program.

I've added a GUI for a simpler usage. Simply put it together with the LRFTools is OK.

Nice! Thank you man!

drwowe
12-29-2008, 11:56 AM
Is there a problem with the mergeEPUB command?

I'm trying to merge several short stories into a single book. I put all the stories in a directore called chapters. Then I run the command

java -jar LRFTools-v0.9.160.jar mergeEPUB chapters -o book.epub

but all I get is the help message.

--
edit: Looking at the source code on code.google.com I see the -t and -a options are required as well to specify a title and author. It works now, but the help text should be fixed since these options aren't mentioned anywhere.

elinares
12-29-2008, 01:11 PM
Is there a problem with the mergeEPUB command?

I'm trying to merge several short stories into a single book. I put all the stories in a directore called chapters. Then I run the command

java -jar LRFTools-v0.9.160.jar mergeEPUB chapters -o book.epub

but all I get is the help message.

--
edit: Looking at the source code on code.google.com I see the -t and -a options are required as well to specify a title and author. It works now, but the help text should be fixed since these options aren't mentioned anywhere.

Thanks, fixed.

Oletros
01-02-2009, 12:35 PM
Hi,

I tried to convert some lrf files to epub or html but all the non english characters doesn't convert well.

/Spanish
Todos los acentos se convierten en letras sin sentido

I can send the files if you wish

Muchas gracias por tu programa

elinares
01-02-2009, 06:30 PM
Hi,

I tried to convert some lrf files to epub or html but all the non english characters doesn't convert well.

/Spanish
Todos los acentos se convierten en letras sin sentido

I can send the files if you wish

Muchas gracias por tu programa

OK, pm me with them.

elinares
01-04-2009, 01:56 PM
Hi,

I tried to convert some lrf files to epub or html but all the non english characters doesn't convert well.

/Spanish
Todos los acentos se convierten en letras sin sentido

I can send the files if you wish

Muchas gracias por tu programa

I've corrected some bugs on lrf to epub direct creation. Download new version v0.9.168 at googlecode; and please do not use strange characters on lrf filename, because this string is used to create other filenames (as images). The file you pm me contains '...senda de la profeci<some rare chars>a.lrf'. If you rename it to '...profecía...' the conversion is performed well. Also, the size of the epub is greater than the lrf because you have not used -noe command line.
Thanks for testing,
Eladio

elinares
01-04-2009, 02:02 PM
New Version v0.9.168
line-height (spacing between lines) corrrected (lrf->epub,html). Also relative font sizes used to allow resizing at devices.
I'm trying to better support other languages (now english and spanish).
Source code and compiled jar at google code as usual (see first post).
Happy new year to all.
Eladio

Oletros
01-04-2009, 02:58 PM
Hi,

I have tried the new version but when I select epub it still doesn't convert well accentuated chars. HTML, rtf and PDF output are fine

elinares
01-04-2009, 03:25 PM
Hi,

I have tried the new version but when I select epub it still doesn't convert well accentuated chars. HTML, rtf and PDF output are fine

I've pm-ed you with the file converted and an image of Digital Editions showing the converted file. If you don't see the same as I, probably you must check your regional configuration (both OS and java).

Oletros
01-04-2009, 04:00 PM
I've pm-ed you with the file converted and an image of Digital Editions showing the converted file. If you don't see the same as I, probably you must check your regional configuration (both OS and java).

I'm using Mac OS X, perhaps the problem is there.

rogue_ronin
01-09-2009, 07:41 AM
Hey, trying these out, seem great -- having trouble with the gui.

The gui generates a proper command line, but an error window pops up:

Cannot run program "cmd": java.io.IOException: error=2, No such file or directory

If I copy and paste the command line, it works fine.

Help?

m a r

lionfish
01-11-2009, 09:37 PM
Hey, trying these out, seem great -- having trouble with the gui.

The gui generates a proper command line, but an error window pops up:



If I copy and paste the command line, it works fine.

Help?

m a r

cmd.exe is the command line program in Windows. It usually locates in \Windows\System32\. You may check if it exists or your Path setting doesn't include this directory.

elinares
01-12-2009, 07:47 AM
Some Bugs corrected (images on convertPDF), -noe and -nopb options added to convertPDF.

rogue_ronin
01-16-2009, 06:26 AM
Ahhh. Of course, Windows.

I'm using Linux. Anything I can patch to make it work properly for me?

m a r

yargoflick
01-20-2009, 03:31 PM
Ahhh. Of course, Windows.

I'm using Linux. Anything I can patch to make it work properly for me?

m a r

If copying the command line generated and pasting into a terminal works, then you could make an executable bash script called 'cmd' that would open an xterm and run the passed command line.
eg:

edit, as root, a new file /usr/local/bin/cmd
make it read as so:

#!/bin/bash
xterm -hold -e "$@"


Then you want to make the script executable:
sudo chmod a+x /usr/local/bin/cmd

Now you should have a 'cmd' program that lrftools can pass a command line to and have an xterm open and run that line, pausing when finished.

You can test it by trying out:
cmd ls -l /etc
or some such thing.

If you're feeling industrious, you could try to find out where lrftools is calling cmd, and change it call bash instead.

lionfish
01-21-2009, 01:15 AM
Ahhh. Of course, Windows.

I'm using Linux. Anything I can patch to make it work properly for me?

m a r

Sorry for not able to make it Linux compatible. First, I don't use Linux and thus can't test. Second, I have tried calling "jave.exe -jar" directly by either Runtime.getRuntime().exec() or ProcessBuilder(), the gui just keep looping.

Gudy
01-21-2009, 06:07 AM
Sorry for not able to make it Linux compatible. First, I don't use Linux and thus can't test. Second, I have tried calling "jave.exe -jar" directly by either Runtime.getRuntime().exec() or ProcessBuilder(), the gui just keep looping.

WaitAMinute. Wait. Just. A. Minute.

Did I understand that right? You're using a GUI written in Java to call another program, also written in Java, and you're calling "jave.exe -jar" directly by either Runtime.getRuntime().exec() or ProcessBuilder()?! That strikes me as, sorry for the language, bass ackwards.

Why not just directly call the main() method of the main class from the LRFTools jar with the arguments as a string array instead? It's nice, clean, simple, and most of all, platform independent. If you don't want to wait for the program to return, use a separate thread to run the LRFTools from the GUI...

elinares
01-21-2009, 06:44 AM
WaitAMinute. Wait. Just. A. Minute.

Did I understand that right? You're using a GUI written in Java to call another program, also written in Java, and you're calling "jave.exe -jar" directly by either Runtime.getRuntime().exec() or ProcessBuilder()?! That strikes me as, sorry for the language, bass ackwards.

Why not just directly call the main() method of the main class from the LRFTools jar with the arguments as a string array instead? It's nice, clean, simple, and most of all, platform independent. If you don't want to wait for the program to return, use a separate thread to run the LRFTools from the GUI...

Yep, this is better than spawnning a new process. You can call lrf.RecurseDirs.main(String args[]), args holding the command-line parameters on a fresh thread to do the work.

Also, if you want to see progress, before calling to the above static method; you can assign to System.out and System.err two new PrintStreams, and then periodically show their contents to a frame on your GUI.

Thanks to all,
Eladio

rogue_ronin
01-23-2009, 01:52 AM
Well, sounds like a proper solution might be in the offing. In the meantime, I will try yargoflick's workaround.

Thanks all,

m a r

mwestmr
02-02-2009, 06:15 PM
Many thanks to Eladio for a great tool!

One of my .lrf files gives some problems with quotes and other characters. When I convert it with -XML I get correct text like:

<Tag Type="BeginP"/>
Vili glanced up, turned his head back toward the interior, and said, with no par
ticular inflection, &quot;Klava with honey for Lord Taltos.&quot; He then turned back to m
e and said, &quot;Your usual table is available, m&apos;lord.&quot;
<Tag Type="EndP"/>

while using -EPUB gives the same paragraph as:

<div class="st012"><span class="st013">Vili glanced up, turned his
head back toward the interior, and said, with no particular
inflection, &ntilde;Klava with honey for Lord Taltos.&icirc; He
then turned back to me and said, &ntilde;Your usual table is
available, m&Iacute;lord.&icirc;</span></div>

In the EPUB version the &ntilde; should be &quot;, &Iacute; should be &apos;, etc. The linebreaks in the XML output also look strange to me.

I'll sent the problematic .lrf file to Eladio by pm.

For what it's worth, this is under OS X 10.5.6 with java -version:
java version "1.6.0_07"
Java(TM) SE Runtime Environment (build 1.6.0_07-b06-153)
Java HotSpot(TM) 64-Bit Server VM (build 1.6.0_07-b06-57, mixed mode)

Matt.

elinares
02-06-2009, 01:48 PM
Many thanks to Eladio for a great tool!

One of my .lrf files gives some problems with quotes and other characters. When I convert it with -XML I get correct text like:

<Tag Type="BeginP"/>
Vili glanced up, turned his head back toward the interior, and said, with no par
ticular inflection, &quot;Klava with honey for Lord Taltos.&quot; He then turned back to m
e and said, &quot;Your usual table is available, m&apos;lord.&quot;
<Tag Type="EndP"/>

while using -EPUB gives the same paragraph as:

<div class="st012"><span class="st013">Vili glanced up, turned his
head back toward the interior, and said, with no particular
inflection, &ntilde;Klava with honey for Lord Taltos.&icirc; He
then turned back to me and said, &ntilde;Your usual table is
available, m&Iacute;lord.&icirc;</span></div>

In the EPUB version the &ntilde; should be &quot;, &Iacute; should be &apos;, etc. The linebreaks in the XML output also look strange to me.

I'll sent the problematic .lrf file to Eladio by pm.

For what it's worth, this is under OS X 10.5.6 with java -version:
java version "1.6.0_07"
Java(TM) SE Runtime Environment (build 1.6.0_07-b06-153)
Java HotSpot(TM) 64-Bit Server VM (build 1.6.0_07-b06-57, mixed mode)

Matt.

I've PMEd you. I can see correct codes, but i'm using a developing version. This weekend i'll publish new version on googlecode.

elinares
02-08-2009, 03:00 PM
Uploaded to google code. Please look first post.

hybernation
02-28-2009, 06:09 PM
Thank you for this tool! Was wondering if you could offer an option in the PDF conversion to retain the "smartquotes" ( &ldquo; and &rdquo; ) instead of converting them all to plain ones ( &quot; ) ?

thanks again
John

rcuadro
03-01-2009, 06:38 AM
For some reason I cant get this to even work... Here is the messages that I get (I am using Java 1.5.0_15)

Microsoft(R) Windows DOS
(C)Copyright Microsoft Corp 1990-2001.

G:\LRFTOOLS>java -Xms200M -Xmx300M -jar LRFTools.jar view
Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknow n Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)

I tried it on my Mac and I get something similar... I am pulling my hair out!!!

rcuadro
03-01-2009, 06:40 AM
Ooops... I dont know how to delete duplicate messages... :smack:

elinares
03-01-2009, 01:48 PM
For some reason I cant get this to even work... Here is the messages that I get (I am using Java 1.5.0_15)

Microsoft(R) Windows DOS
(C)Copyright Microsoft Corp 1990-2001.

G:\LRFTOOLS>java -Xms200M -Xmx300M -jar LRFTools.jar view
Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknow n Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)

I tried it on my Mac and I get something similar... I am pulling my hair out!!!
Hi,
You must use Java 1.6...

elinares
03-01-2009, 01:54 PM
Thank you for this tool! Was wondering if you could offer an option in the PDF conversion to retain the "smartquotes" ( &ldquo; and &rdquo; ) instead of converting them all to plain ones ( &quot; ) ?

thanks again
John

Class lrf.Utils holds toXMLText method as:

public static String toXMLText(String app) {
app=app.replace('\u000C', ' ');
app=app.replace("’", "&apos;");
app=app.replace("'", "&apos;");
app=app.replace("‘", "&apos;");
app=app.replace("\"", "&quot;");
app=app.replace("“", "&quot;");
app=app.replace("”", "&quot;");
app=app.replace(" & ", " &amp; ");
app=app.replace("<", "&lt;");
app=app.replace(">", "&gt;");
app=app.replace("’", "&apos;");
app=app.replace("—", "-");
app=app.replace("…", "...");
app=app.replace("’", "&apos;");
app=app.replace("Æ", "AE");
app=app.replace("á", "&aacute;");
app=app.replace("é", "&eacute;");
app=app.replace("í", "&iacute;");
app=app.replace("ó", "&oacute;");
app=app.replace("ú", "&uacute;");
app=app.replace("Á", "&Aacute;");
app=app.replace("É", "&Eacute;");
app=app.replace("Í", "&Iacute;");
app=app.replace("Ó", "&Oacute;");
app=app.replace("Ú", "&Uacute;");
app=app.replace("ñ", "&ntilde;");
app=app.replace("Ñ", "&Ntilde;");
return app;
}


How must be? app is a String holding raw UTF-8 text.

hybernation
03-01-2009, 08:30 PM
I tried to post this on Google Code but for some reason after typing in the whole thing, the submit button wasn't enabled! :-)

What steps will reproduce the problem?
1. download this free ebook: http://www.pyrsf.com/crookedletterPDF.html
2. run the command
3. see stack trace below

What is the expected output? What do you see instead?

C:\LRFTools>java -Xms200M -Xmx300M -jar LRFTools-v0.9.175.jar convertPDF CL
Loading 'CrookedLetterSmall.pdf' 519 pages -java.lang.ArrayIndexOutOfBoundsExcep
tion: -1
at java.util.Vector.get(Vector.java:696)
at lrf.pdf.flow.Flower.managePieces(Flower.java:123)
at lrf.pdf.PDFSerializer.procPDF(PDFSerializer.java:9 6)
at lrf.pdf.PDFSerializer.recurse(PDFSerializer.java:3 3)
at lrf.RecurseDirs.convertPDFActionParams(RecurseDirs .java:239)
at lrf.RecurseDirs.<init>(RecurseDirs.java:89)
at lrf.RecurseDirs.main(RecurseDirs.java:39)


What version of the product are you using? On what operating system?

v0.9.175 on Windows Vista HP 32-bit JDK 1.6.0_13

Please provide any additional information below.

It does the same thing with SOME other PDF files I have tried. I had JDK 1.6.0_11 installed originally, so I updated to _12 (the latest)...does the same thing.

rcuadro
03-02-2009, 03:37 AM
Hi,
You must use Java 1.6...

It looks like I had to tell my Mac to use Java 1.6 lol...

elinares
03-02-2009, 06:04 AM
I tried to post this on Google Code but for some reason after typing in the whole thing, the submit button wasn't enabled! :-)

What steps will reproduce the problem?
1. download this free ebook: http://www.pyrsf.com/crookedletterPDF.html
2. run the command
3. see stack trace below

What is the expected output? What do you see instead?

C:\LRFTools>java -Xms200M -Xmx300M -jar LRFTools-v0.9.175.jar convertPDF CL
Loading 'CrookedLetterSmall.pdf' 519 pages -java.lang.ArrayIndexOutOfBoundsExcep
tion:
...
I see same error. Working on... found BUG and commited to googlecode.

elinares
03-02-2009, 06:30 AM
Uploaded to google (see first post)
LRFTools v0.9.183
Corrected BUG reported by hybernation (thanks)
Use &ldquo; and &rdquo;

rcuadro
03-02-2009, 09:48 AM
Here is something that i cant figure out. I run LRFTools with the view option and it opens up just fine. I can navigate to a certain LRF... but then I cant do anything else. How do I get it to open the LRF?
I am on a Mac if it makes a difference.

tarifelagund
03-02-2009, 08:19 PM
Hi,
I'm not tech-savvy at all so please bear with me!
I took it that I needed to run the prob through cmd line on my windows vista, but I got this result.

Microsoft Windows [Version 6.0.6001]
Copyright (c) 2006 Microsoft Corporation. All rights reserved.
C:\Users\Vista>java -Xms200M -Xmx300M -jar LRFTools-v0.9.183.jar convert "C:\Use
rs\Vista\Documents\My Library\Larissa Ione" -RTF
Unable to access jarfile LRFTools-v0.9.183.jar

I tried using the GUI thingy to even less success as I couldn't even figure out how to open the thing after downloading it!

Where did I go wrong??
Is there a specific place that I need to download the jar file to? I just have it in my downoads folder.

thanks!

elinares
03-03-2009, 05:30 AM
Hi,
I'm not tech-savvy at all so please bear with me!
I took it that I needed to run the prob through cmd line on my windows vista, but I got this result.

Microsoft Windows [Version 6.0.6001]
Copyright (c) 2006 Microsoft Corporation. All rights reserved.
C:\Users\Vista>java -Xms200M -Xmx300M -jar LRFTools-v0.9.183.jar convert "C:\Use
rs\Vista\Documents\My Library\Larissa Ione" -RTF
Unable to access jarfile LRFTools-v0.9.183.jar

I tried using the GUI thingy to even less success as I couldn't even figure out how to open the thing after downloading it!

Where did I go wrong??
Is there a specific place that I need to download the jar file to? I just have it in my downoads folder.

thanks!

You must full qualify path of jarfile. On your example the only way to work is copying the jarfile on "C:\Users\Vista". If you have the jarfile on "c:\jars\LRFTools-v0.9.183.jar" then your command line must be:

C:\Users\Vista>java -Xms200M -Xmx300M -jar c:\jars\LRFTools-v0.9.183.jar convert "C:\Users\Vista\Documents\My Library\Larissa Ione" -RTF

tarifelagund
03-03-2009, 10:34 AM
I switched the file over to C:\Users\Vista\LRFTools-v0.9.183.jar, but it still does not work...

C:\Users\Vista>>java -Xms200M -Xmx300M -jar C:\Users\Vista\LRFTools-v0.9.183.jar
convert "C:\Users\Vista\Documents\My Library\Larissa Ione" -RTF
'-Xms200M' is not recognized as an internal or external command,
operable program or batch file.

elinares
03-03-2009, 11:28 AM
I switched the file over to C:\Users\Vista\LRFTools-v0.9.183.jar, but it still does not work...

C:\Users\Vista>>java -Xms200M -Xmx300M -jar C:\Users\Vista\LRFTools-v0.9.183.jar
convert "C:\Users\Vista\Documents\My Library\Larissa Ione" -RTF
'-Xms200M' is not recognized as an internal or external command,
operable program or batch file.

Delete '>' from start of command.

tarifelagund
03-04-2009, 09:26 AM
Delete '>' from start of command.

I did as you suggested and deleted >, but it still does not work!:blink:


C:\Users\Vista>java -Xms200M -Xmx300M -jar C:\Users\Vista\LRFTools-v0.9.183 conv
ert C:\Users\Vista\Documents\LRF -html
Unable to access jarfile C:\Users\Vista\LRFTools-v0.9.183

sigh... this is sooo difficult! sorry!!:smack:

rcuadro
03-04-2009, 09:48 AM
I did as you suggested and deleted >, but it still does not work!:blink:


C:\Users\Vista>java -Xms200M -Xmx300M -jar C:\Users\Vista\LRFTools-v0.9.183 conv
ert C:\Users\Vista\Documents\LRF -html
Unable to access jarfile C:\Users\Vista\LRFTools-v0.9.183

sigh... this is sooo difficult! sorry!!:smack:

I found it easier to have the command window starting at the same directory at the LRFTools file is. You also forgot the jar extension... ie LRFToolsv0.0.183.jar

tarifelagund
03-04-2009, 04:17 PM
OH! Stupid of me! Sorry!!
I got as far as:
C:\Users\Vista>java -Xms200M -Xmx300M -jar C:\Users\Vista\LRFTools-v0.9.183\LRFT
ools-v0.9.183.jar convert C:\Users\Vista\Documents\LRF -html
Usage:
java -Xms200M -Xmx300M -jar LRFTools-vx.y.z.jar action (params)

Note: Java VM gets 200MB minimun, 300 maximun memory to work. If you plan to
convert only a few books, you can reduce significantly these values (40,60).

Actions:

1) convertLRF dir (-d dirOut |-z zipfile) (-XML|-PDF|-RTF|-HTML|-EPUB) (options)


Converts to XML, PDF, RTF and/or HTML every LRF file in 'dir' recursively.
You can specify more than one format conversion simultaneously.
Converted files go to the same place as original, except if you specify
'-z zipfile', then go to zipfile; or '-d dir', then output files are created
in dirOut replicating the same original directory tree structure.

(options) one or more of:

-A4 : Means normal paper size (trying to reflow)

-rf nn : Fonts Sizes, nn is a percentage of resistance to change size of font

-catpar str: Try to merge paragraphs not ending with '.', ':','?' this way:
para1+str+para2

-repl "str1" "str2" : Replace instances of str1 (in a block) for str2

-noo : No overwrite existing files.

-noe : No Embed OTF fonts on epub files.

-nopb: Do not emit page breaks.

You cannot output HTML files to a zipfile right now.

2) convertPDF dir (-d dirOut) [-noo|-SVG|-noe|-nopb]

Converts every PDF in 'dir' (with recursion) to EPUB format.
-SVG means use batik to generate Scalable Vector Graphics for each page
Other options same as convertLRF.

3) view

Shows GUI to view epub files.

4) updfmd dir

Search dir recursively, expecting PDF filenames 'BookAuthor-BookTitle.pdf'
and modifies metadata of PDF to reflect BookAuthor and BookTitle so our
Sony PRS can catalog the book conveniently.

5) mergePDF dir -o grouped.pdf

Merge all PDF and LRF files contained at dir (with recursion) into one new
PDF file with a TOC pointing to each old single document. LRF files are
converted first to PDF.

6) mergeEPUB dir -a author -t title -o grouped.epub

Merge all EPUB files contained at dir (with recursion) into one new EPUB
file with a TOC pointing to each old single document.

What's the next step?

Thanks so much for your patience!

rcuadro
03-04-2009, 11:42 PM
Here is how I got it to work... I made a directory in the C drive called C:\LRFTools and another one called c:\eBooks (I put the books I wanted to convert here)
I also renamed the jar file to simply LRFTools.jar to make it easier on me :)

1. Start --> Run --> command
2. cd LRFTools
3. java -Xms200M -Xmx300M -jar LRFTools.jar convert c:\eBooks -EPUB
4. Whala!! LRFTools converted the books I had in the eBook directory to epub.

Hope this helps out a bit :)

tarifelagund
03-06-2009, 08:23 PM
Thanks for everything, but I think I'm destined never to figure this program out... >__<!!

elinares
03-06-2009, 09:05 PM
I'm been looking for a epub "editor", to beautify some of my books (you know, some images, TOC and so on), but I've not found a reasonable way to build it... My company bought a MS Office 2007 license for me, so I decided to incorporate to LRFTools docx2epub capabilities (I'm starting to think that 'LRFTools' is not a good name, but...)

A new command has been added: convertDOCX (similar to convertPDF). For now it supports TOC, links, build a epub NavMap using Heading styles, images and tables. It produces well-formed epub files, splitting xhtml files as usual (below 180KB each so our devices can read it fast).

DOCX files follows OpenXML standard. I don't know if Macs or Linuxes have tools for editing this, sorry for that.

Enjoy,
Eladio

rcuadro
03-07-2009, 12:31 AM
Thanks for everything, but I think I'm destined never to figure this program out... >__<!!

If you type java -version in the command prompt, does it say 1.6?

knurps
03-07-2009, 07:51 AM
This happens to all books (various sources) I try to convert:

C:\LRF\2>java -Xms200M -Xmx300M -jar "c:\LRF\LRFTools.jar" convertLRF "c:\LRF\2" -HTML
Creating test.html...HTML Error:
java.lang.NullPointerException
at java.lang.StringBuffer.<init>(Unknown Source)
at com.lowagie.text.Meta.<init>(Unknown Source)
at com.lowagie.text.Document.addAuthor(Unknown Source)
at lrf.objects.Book.getHTML(Book.java:194)
at lrf.RecurseDirs.dumpToHTML(RecurseDirs.java:376)
at lrf.RecurseDirs.convertAction(RecurseDirs.java:483 )
at lrf.RecurseDirs.convertActionParams(RecurseDirs.ja va:308)
at lrf.RecurseDirs.<init>(RecurseDirs.java:87)
at lrf.RecurseDirs.main(RecurseDirs.java:39)

Test above was done with a random short book (http://www.mobileread.com/forums/showthread.php?t=41145) from the download section.

(To avoid any side effects I put it in a path without spaces and changed all names to a simple 8.3 scheme.)

Java version should be the newest 1.6:

>java -version
java version "1.6.0_12"
Java(TM) SE Runtime Environment (build 1.6.0_12-b04)
Java HotSpot(TM) Client VM (build 11.2-b01, mixed mode, sharing)

LRFTools Version: v0.9.183 (same error with 0.9.193, just different line numbers)

OS: Windows XP

There is only one lrf in c:\LRF\2, using "-Xms40M -Xmx60M" or changing the output format doesn't change anything.

Using a non-existent path results in a very similar error ("java.lang.NullPointerException" and last 4 lines exactly the same as above). It does print the Usage info in addition though.

Anything I am doing wrong?

columbus
03-07-2009, 11:33 AM
Hi, I am having problems also just trying to convert a small sample word file to epub
have tried many variations on the cmd line but always get the same result.
I am obviously being a dummy some where but can't see it - anybody help??

h:\ebook conversions >java -Xms200M -Xmx300M -jar lrftools-v0.9.193.jar convertDOCX h:\ebook conversion\out -EPUB
java.lang.NullpointerException
at lrf.docx.DOCX2EPUB.recurse(DOCX2EPUB.java:38)
at lrf.RecurseDirs.convertDOCXActionParams(RecurseDir s.java:274)
at lrf.RecurseDirs.<init>(RecurseDirs.java:92)
at lrf.RecurseDirs.main(RecurseDirs.java:40)

Have Java(TM) SE Runtime Environment (build 1.6.0_12-b04)

lionfish
03-07-2009, 12:30 PM
This is an improved version. All options are added and now the GUI will call the LRFtools directly so it should be platform independent.

Honestly, I didn't check if all options work, so good luck. :rofl:

elinares
03-07-2009, 12:35 PM
This happens to all books (various sources) I try to convert:

C:\LRF\2>java -Xms200M -Xmx300M -jar "c:\LRF\LRFTools.jar" convertLRF "c:\LRF\2" -HTML
Creating test.html...HTML Error:
java.lang.NullPointerException
at java.lang.StringBuffer.<init>(Unknown Source)
at com.lowagie.text.Meta.<init>(Unknown Source)


Anything I am doing wrong?

No, there was a BUG when author field cannot be get (null or encrypted). I've corrected it, I'll put new version soon.

rcuadro
03-08-2009, 05:27 AM
I noticed something odd... if I unzip the file under windows I get a single jar file. If I do it on a Mac, well, I get a ton of files, folders, and no LRFTools jar file.

tlc
03-10-2009, 03:23 PM
I'm having no success with any of the files I try. Am I doing this right?

$ /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Commands/java -Xms200M -Xmx300M -jar /Users/tlc/bin/LRFTools-v0.9.193.jar convertLRF . -EPUB
Creating foo.epub...java.lang.StringIndexOutOfBoundsExcepti on: String index out of range: -1
at java.lang.String.substring(String.java:1938)
at java.lang.String.substring(String.java:1905)
at lrf.html.StyleItem.translate(StyleItem.java:108)
at lrf.html.HtmlStyle.addTag(HtmlStyle.java:78)
at lrf.html.HtmlStyle.addTags(HtmlStyle.java:73)
at lrf.html.HtmlStyle.<init>(HtmlStyle.java:46)
at lrf.conv.RendererEPUB.push(RendererEPUB.java:42)
at lrf.objects.TextAtr.render(TextAtr.java:17)
at lrf.objects.tags.Tag.render(Tag.java:783)
at lrf.objects.Text.render(Text.java:20)
at lrf.objects.tags.Tag.render(Tag.java:783)
at lrf.objects.tags.TagStream.render(TagStream.java:3 2)
at lrf.objects.BBObj.itRendTags(BBObj.java:266)
at lrf.objects.Block.render(Block.java:24)
at lrf.objects.tags.Tag.render(Tag.java:783)
at lrf.objects.tags.TagStream.render(TagStream.java:3 2)
at lrf.objects.BBObj.itRendTags(BBObj.java:266)
at lrf.objects.Page.render(Page.java:15)
at lrf.objects.BBObj.itRendListRef(BBObj.java:258)
at lrf.objects.PageTree.render(PageTree.java:13)
at lrf.objects.BookAtr.render(BookAtr.java:23)
at lrf.objects.Book.getEPUB(Book.java:146)
at lrf.RecurseDirs.dumpToEpub(RecurseDirs.java:463)
at lrf.RecurseDirs.convertAction(RecurseDirs.java:529 )
at lrf.RecurseDirs.convertActionParams(RecurseDirs.ja va:342)
at lrf.RecurseDirs.<init>(RecurseDirs.java:88)
at lrf.RecurseDirs.main(RecurseDirs.java:40)
EPUB Error

rcuadro
03-11-2009, 05:29 AM
It looks like you are missing the directory where the files are located after convertLRF and before -EPUB

elinares
03-11-2009, 06:40 AM
I'm having no success with any of the files I try. Am I doing this right?

Could you PM me the book? It seems to be a problem with font colors...

tlc
03-11-2009, 09:53 AM
I did some debugging last night. Line 108 in StyleItem.java:

return new StyleItem("color","#"+Integer.toHexString(t.getValueAt(0)).substring(2) );

getValueAt returns 0; toHexString returns "0"; substring throws an exception. I changed it to check for length < 2 before doing substring and the conversion completed, but I don't know if 0 valid and this is the right fix.


Also, when I tried to convert to RTF, I got other errors, which I fixed by changing Book#getRTF to guard against null author & title like it already did for null bookID and the conversion completed.

if (getAuth() != null)
doc.addAuthor(getAuth());
if (getTitle() != null)
doc.addTitle(getTitle());
if(getBookID()!=null)
doc.addHeader("BookID", getBookID());

elinares
03-11-2009, 03:29 PM
I did some debugging last night. Line 108 in StyleItem.java:


getValueAt returns 0; toHexString returns "0"; substring throws an exception. I changed it to check for length < 2 before doing substring and the conversion completed, but I don't know if 0 valid and this is the right fix.


Also, when I tried to convert to RTF, I got other errors, which I fixed by changing Book#getRTF to guard against null author & title like it already did for null bookID and the conversion completed.



Great catch! I've commited these changes and others.
New version 0.9.196 ready to download.
@tlc: Thanks :thumbsup:

tarifelagund
03-13-2009, 08:35 AM
If you type java -version in the command prompt, does it say 1.6?

I renamed the file to just be LRFTools.

lordsilent
03-14-2009, 04:27 PM
n/m im retarded

frank1960
03-15-2009, 10:29 AM
I noticed something odd... if I unzip the file under windows I get a single jar file. If I do it on a Mac, well, I get a ton of files, folders, and no LRFTools jar file.

Hi,

anybody successful with the tool under Mac OS X?

Thanks,

Frank

rcuadro
03-15-2009, 10:50 AM
I have had to unzip it under windows and then copied it to my Mac...

rcuadro
03-15-2009, 10:54 AM
I take it that LRFTools cannot convert Sony's LRX format? When i try to convert them to HTML I get a blank page and it cannot do it to EPUB...

badgoodDeb
03-16-2009, 05:19 PM
Hi,

anybody successful with the tool under Mac OS X?

Thanks,

Frank

Yes, though it was the previous version. (my post, back in Dec. (http://www.mobileread.com/forums/showpost.php?p=301953&postcount=85) That's about a mac) I do rememember an issue like you have (no jar, just a lot of files). Don't recall how I fixed it --- I probably went to the author and had it resent as a jar. Or something. ??

But it *can* be done on a mac.

rcuadro
03-17-2009, 10:19 AM
Yes, though it was the previous version. (my post, back in Dec. (http://www.mobileread.com/forums/showpost.php?p=301953&postcount=85) That's about a mac) I do rememember an issue like you have (no jar, just a lot of files). Don't recall how I fixed it --- I probably went to the author and had it resent as a jar. Or something. ??

But it *can* be done on a mac.

I got it to work on a Mac quite nicely I might add. I had a problem using my Mac to unzip the files... I would get a ton of stuff vice just the LRFTools.jar file... so I used a windows computer to unzip it and then transferred it to my Mac :)

elinares
03-17-2009, 08:05 PM
I got it to work on a Mac quite nicely I might add. I had a problem using my Mac to unzip the files... I would get a ton of stuff vice just the LRFTools.jar file... so I used a windows computer to unzip it and then transferred it to my Mac :)

Next version will be uploaded as jar file. Anyway I use winzip to compress jar into zip; so I can not understand why decompressing on macs is problematic...
Meantime you can use this:
http://rapidshare.com/files/210484761/LRFTools-v0.9.196.jar.html

rcuadro
03-18-2009, 07:29 AM
I dont know why but the Mac is a little funny like that sometimes lol.

RandallFlagg
03-23-2009, 03:04 AM
Here is how I got it to work... I made a directory in the C drive called C:\LRFTools and another one called c:\eBooks (I put the books I wanted to convert here)
I also renamed the jar file to simply LRFTools.jar to make it easier on me :)

1. Start --> Run --> command
2. cd LRFTools
3. java -Xms200M -Xmx300M -jar LRFTools.jar convert c:\eBooks -EPUB
4. Whala!! LRFTools converted the books I had in the eBook directory to epub.

Hope this helps out a bit :)

Thanks for the info. As soon as I figured out that the little Acer Aspire One didn't have java installed and that I also needed to rename the .rar file I was golden. I was converting an lrf so I had to change line 3 to:
java -Xms200M -Xmx300M -jar LRFTools.jar convertLRF c:\eBooks -EPUB
I can now take the epub to Calibre and add my cover. That's really all I wanted was to have covers on my lrfs. :thanks::D

RandallFlagg
03-24-2009, 06:10 PM
I noticed something odd... if I unzip the file under windows I get a single jar file. If I do it on a Mac, well, I get a ton of files, folders, and no LRFTools jar file.

Yeah, it did it to me too. I installed it last night on my mac mini and copied the files via usb flash drive to my Acer Aspire One with xp. Today I was too lazy to fire up either computer, so I dl'd it again for my xp server. When the single .jar file came up, I right clicked it and with winrar extract here option all the files installed. Hope that helps someone.:)

I've got a couple of blackmask.com books and I keep getting this error. java.lang.OutOfMemoryError: Java heap space I've googled it and have tried to adjust the heap space both in the control panel java app and in a command prompt. I've also tried changing the command values, but the books still refuse to convert. I have success with about 70% of the lrfs I've tried so I know I have it set up to work. Has anyone else ran into this error and if so, were you able to convert the book to any other format. I just want to add a cover so I've been converting to epub. I then edit the epub in calibre, add a cover and convert back to lrf.

Student1
03-27-2009, 08:08 PM
Hi,

by reading this thread i am guessing we need to install java vm to have this working as it wasn t very clear in the instructions! Anyway seems like a very interesting project! Had just a few scanned lrf to convert to epup, this just hits the spot thanks :)!

elinares
03-28-2009, 05:20 AM
I've got a couple of blackmask.com books and I keep getting this error. java.lang.OutOfMemoryError: Java heap space .

Can I test any of these books?

RandallFlagg
03-28-2009, 11:01 PM
Can I test any of these books?

I sent you a pm:D

elinares
03-30-2009, 12:10 PM
I sent you a pm:D
This is a well-known bug for me. Some streams inside book are scrambled and compressed, most of them we can handle. But some fails to decompress.

I cannot find any system, program or similar able to show, transform or handle in general these books (except Sony software of course).

Sorry, but (for now) i cannot correct this...

till now! I've implemented a brute-force descrambling (well, only 256 posibilities of key is not so brute-force) These books now works (for text, I'll try images next weekend)

I'm uploading v0.9.200 to google (http://code.google.com/p/lrf-epub-tools/downloads) right now with this change.

elinares
03-30-2009, 03:25 PM
New version v0.9.200
Please see first post.
Enjoy,
Eladio

RandallFlagg
03-30-2009, 05:22 PM
Thanks, I going now to try it out.

igorsk
03-31-2009, 09:07 AM
This is a well-known bug for me. Some streams inside book are scrambled and compressed, most of them we can handle. But some fails to decompress.

I cannot find any system, program or similar able to show, transform or handle in general these books (except Sony software of course).

Does lrf2lrs fail on those books too? I'd like to see some samples.
AFAIK you just need to check the object type and stream length. See here:
http://www.sven.de/librie/Librie/PsuedoEncryption?action=diff

elinares
03-31-2009, 03:51 PM
Does lrf2lrs fail on those books too? I'd like to see some samples.
AFAIK you just need to check the object type and stream length. See here:
http://www.sven.de/librie/Librie/PsuedoEncryption?action=diff

I've tested both books with Calibre, it can not show or transform none of them. The unscrambling method described on sven.de/librie is exactly the same I implemented in LRFTools, but for some streams it does not work.

I'm going to pm you the books.

The following code

BYTE keybyte;

declen = LengthOfStream
keybyte = (declen % PsuedoEncryptionKeyByte) + 0x0F;
if ((type == 0x11)||(type == 0x19)||(type == 0x17))
{
if (declen > 0x400) declen = 0x400;
}
for (i = 0; i < declen; i++) {
*(p + i) ^= keybyte;
}

sometimes produces a byte stream (p) wich is not a zip-encoded stream. As keybyte holds 256 possible values, I've test each value trying to unzip resulting streams. If one of them works, I suppose this is the correct keybyte an continue. This weekend I'll try to figure out how can be the keybyte be infered with these sample books directly, because I like to think LRFTools is a fast tools.

bcmartinez
03-31-2009, 08:15 PM
Hello! I'm trying out the PDF2EPUB conversion and I get the following error. Any suggestions?

BMartinez:~ bryan$ java -Xms100M -Xmx300M -jar "/Users/bryan/Downloads/LRFtools/LRFTools-v0.9.200.jar" convertPDF "/Users/bryan/Downloads/epub/pdf"
Loading 'test.pdf' 379 pages -------------java.io.IOException: Not implemented
at org.pdfbox.pdmodel.graphics.color.PDSeparation.cre ateColorSpace(PDSeparation.java:110)
at org.pdfbox.pdmodel.graphics.color.PDColorSpaceInst ance.createColor(PDColorSpaceInstance.java:79)
at org.pdfbox.util.operator.pagedrawer.SetStrokingCMY KColor.process(SetStrokingCMYKColor.java:61)
at org.pdfbox.util.PDFStreamEngine.processOperator(PD FStreamEngine.java:452)
at org.pdfbox.util.PDFStreamEngine.processSubStream(P DFStreamEngine.java:215)
at org.pdfbox.util.PDFStreamEngine.processStream(PDFS treamEngine.java:174)
at org.pdfbox.pdfviewer.PageDrawer.drawPage(PageDrawe r.java:110)
at lrf.pdf.PDFSerializer.procPDF(PDFSerializer.java:9 1)
at lrf.pdf.PDFSerializer.recurse(PDFSerializer.java:3 3)
at lrf.RecurseDirs.convertPDFActionParams(RecurseDirs .java:242)
at lrf.RecurseDirs.<init>(RecurseDirs.java:90)
at lrf.RecurseDirs.main(RecurseDirs.java:40)


Thanks!

RandallFlagg
04-01-2009, 09:36 PM
I tried out your fix and it was able to convert lrf to epub. I was able to add a cover via Calibre. Unfortunately all the text was pushed together, no idents or paragraphs. Also the fonts change size throughout the book and line spacing isn't consistant. :blink: Thanks and I'll try it again should you make any newer changes.:2thumbsup Lastly, I just reconverted it again to make sure it wasn't Calibre when I converted back to lrf. It's not, the epub looks like this in Adobe DE.

http://i291.photobucket.com/albums/ll284/MarkAhriman/epub.jpg

igorsk
04-02-2009, 12:22 PM
I've tested both books with Calibre, it can not show or transform none of them. The unscrambling method described on sven.de/librie is exactly the same I implemented in LRFTools, but for some streams it does not work.

I'm going to pm you the books.

Thanks for the sample. I did a little debugging, and apparently the correct calculation looks like this:
uint8_t get_local_key(int streamlen, uint8_t key)
{
if ( key && key <= 0xF0u )
return streamlen % key + 0xF;
else
return 0;
}

Note the extra check and that only 8 bits of the key are used.

elinares
04-03-2009, 11:24 AM
Thanks for the sample. I did a little debugging, and apparently the correct calculation looks like this:
Hi igorsk,
I've testing the algorithm and this is working right now for me:

BYTE keybyte;

declen = LengthOfStream
keybyte = (declen % (PsuedoEncryptionKeyByte&0xFF)) + 0x0F;
if ((type == 0x11)||(type == 0x19)||(type == 0x17))
{
if (declen > 0x400) declen = 0x400;
}
for (i = 0; i < declen; i++) {
*(p + i) ^= keybyte;
}

For both books (Ed Lacy) PseudoEncriptionKeyByte = -480 (int);
but -480&0xFF = 32, that`s the correct module for declen.

elinares
04-03-2009, 01:52 PM
I tried out your fix and it was able to convert lrf to epub. I was able to add a cover via Calibre. Unfortunately all the text was pushed together, no idents or paragraphs. Also the fonts change size throughout the book and line spacing isn't consistant. :blink: Thanks and I'll try it again should you make any newer changes.:2thumbsup Lastly, I just reconverted it again to make sure it wasn't Calibre when I converted back to lrf. It's not, the epub looks like this in Adobe DE.



Hi RandallFlagg,
I've performed some changes to lrf conversion as you can see:
http://www.mobileread.com/forums/attachment.php?attachmentid=27057&stc=1&d=1238777389
I'm going to upload this new version right now.

elinares
04-03-2009, 02:51 PM
Finally I've found correct way to descrambling streams in LRF, including images; and also I've corrected many bugs regarding text flow.
@RandallFlag: thanks for the examples
@igorsk:thanks for your info.
Enjoy,
Eladio

RandallFlagg
04-03-2009, 03:34 PM
Thanks for all your hard work. I'm downloading it now and will try it out in a bit.

nrapallo
04-03-2009, 04:11 PM
Finally I've found correct way to descrambling streams in LRF, including images; and also I've corrected many bugs regarding text flow.
@RandallFlag: thanks for the examples
@igorsk:thanks for your info.
Enjoy,
Eladio

Congratulations for improving your .lrf conversion to more portable formats. :thumbsup:

Your hard work is truly admirable. Keep up the good work! :clap:

A bit of karma coming your way.... ;)

elinares
04-03-2009, 04:59 PM
Hello! I'm trying out the PDF2EPUB conversion and I get the following error. Any suggestions?



Thanks!
Bad luck... this exception is thrown in pdfbox library and stops execution. It cannot recognize some ColorMaps and i can not catch Exception and continue, so we must wait for pdfbox boys to found correct maps for some images.

jig
04-07-2009, 11:54 AM
I get the following trying to convert several books from LRF to EPUB with ver 204.

java.lang.NegativeArraySizeException
at lrf.objects.Book.getMetaData(Book.java:228)
at lrf.objects.Book.<init>(Book.java:113)
at lrf.RecurseDirs.convertAction(RecurseDirs.java:515 )
at lrf.RecurseDirs.convertActionParams(RecurseDirs.ja va:342)
at lrf.RecurseDirs.<init>(RecurseDirs.java:88)
at lrf.RecurseDirs.main(RecurseDirs.java:40)

Have successfully converted many other books (on a Mac). But a few won't convert.

I also have one book that gets the following exception:
java.lang.IndexOutOfBoundsException
at java.nio.Buffer.checkIndex(Buffer.java:520)
at java.nio.DirectByteBuffer.getInt(DirectByteBuffer. java:648)
at lrf.buffer.MappedReader.getInt(MappedReader.java:7 0)
at lrf.objects.Book.loadObjects(Book.java:342)
at lrf.objects.Book.<init>(Book.java:115)
at lrf.RecurseDirs.convertAction(RecurseDirs.java:515 )
at lrf.RecurseDirs.convertActionParams(RecurseDirs.ja va:342)
at lrf.RecurseDirs.<init>(RecurseDirs.java:88)
at lrf.RecurseDirs.main(RecurseDirs.java:40)

It might be possible the files are corrupt as I don't have another method to test their correctness.

Also, many (most? all?) conversions end up with Unknown as author and title and no cover art.

Great set of tools. Any help appreciated.
Thanks.

elinares
04-07-2009, 12:55 PM
I get the following trying to convert several books from LRF to EPUB with ver 204.

java.lang.NegativeArraySizeException
at lrf.objects.Book.getMetaData(Book.java:228)

Have successfully converted many other books (on a Mac). But a few won't convert.

I also have one book that gets the following exception:
java.lang.IndexOutOfBoundsException
at java.nio.Buffer.checkIndex(Buffer.java:520)

It might be possible the files are corrupt as I don't have another method to test their correctness.

Also, many (most? all?) conversions end up with Unknown as author and title and no cover art.

Great set of tools. Any help appreciated.
Thanks.

I can tak a look to these books if you pm me.
Eladio.

alxwang
04-28-2009, 05:37 PM
How to make this tool works with Chinese?
I convert some Chinese LRF to PDF but all text gone.
I guess it is because Chinese font is not referenced?
Thanks.

elinares
04-29-2009, 04:46 AM
How to make this tool works with Chinese?
I convert some Chinese LRF to PDF but all text gone.
I guess it is because Chinese font is not referenced?
Thanks.

Not sure, Can you pm me a download link for the book?

alxwang
04-29-2009, 04:58 PM
One more suggestion - maybe I just do not know how to use it.
When convert to HTML, All of images are name as 1.jpg, 2.jpg....
Can you change it to something like: 00001.jpg, 00002.jpg .... 011011.jpg.
The reason I ask this is because I use this tool to convert comics. DR1000 can display jpg directly but the files sort order got problem.
Thanks.

elinares
04-29-2009, 06:36 PM
One more suggestion - maybe I just do not know how to use it.
When convert to HTML, All of images are name as 1.jpg, 2.jpg....
Can you change it to something like: 00001.jpg, 00002.jpg .... 011011.jpg.
The reason I ask this is because I use this tool to convert comics. DR1000 can display jpg directly but the files sort order got problem.
Thanks.

OK, change commited. Next release will use same lenght names for images.

elinares
04-30-2009, 07:24 AM
How to make this tool works with Chinese?
I convert some Chinese LRF to PDF but all text gone.
I guess it is because Chinese font is not referenced?
Thanks.

Please try to convert to html (-html option) and review transformed doc: Has sense to you? I think chinese font must be embedded on pdf...

alxwang
04-30-2009, 12:01 PM
HTML works but:
1. Image reference got problem.
2. Random crash about index outbound

Or you can add one more param to let me give you what base font I installed for Chinese?
Then you can use the font I papered to create PDF.
For example:
-basefont "/usr/share/fonts/ttf/
fc-cache/msyh.ttf"

You can just create all font like:
BaseFont.createFont("/usr/share/fonts/ttf/
fc-cache/msyh.ttf", BaseFont.IDENTITY_H,BaseFont.NOT_EMBEDDED);

Thanks

alxwang
04-30-2009, 10:41 PM
Before the new release, If anyone need png file from lrf but want rename it:
CWD=`pwd`

find . -type d -print | while read direct
do
cd $direct
for file in [0-9]*.png
do
if [ ! -f "$file" ]; then
break
fi
bname=`basename $file .png`
nname=`printf %06d $bname`
mv $file $nname.png
done
cd $CWD
done

elinares
05-01-2009, 03:56 PM
HTML works but:
1. Image reference got problem.
2. Random crash about index outbound

Or you can add one more param to let me give you what base font I installed for Chinese?
Then you can use the font I papered to create PDF.
For example:
-basefont "/usr/share/fonts/ttf/
fc-cache/msyh.ttf"

You can just create all font like:
BaseFont.createFont("/usr/share/fonts/ttf/
fc-cache/msyh.ttf", BaseFont.IDENTITY_H,BaseFont.NOT_EMBEDDED);

Thanks

Well, I only have had success using truetype collections. This new parameter is "-cfont filename.ttc f#", that chooses the font number f# from the collection. Using msgothic.ttc, f#=1 something is displayed on the pdf, but I do not know if it is correct...
I'm packaging new version now to upload.

elinares
05-01-2009, 04:11 PM
New version v0.9.209
Added -cfont parameter for convertLRF, to choose font from a collection.
Now image names when converting to html are normalized (sorted)

alxwang
05-01-2009, 05:48 PM
D:\My eBooks>"C:\Program Files\Java\jre6\bin\java" -Xms200M -Xmx300M -jar LRFToo
ls-v0.9.209.jar convertLRF temp -d M:\AALC_TEMP\test\ -PDF -cfont msyh.ttf,f#=1

java.lang.ArrayIndexOutOfBoundsException: 7
at lrf.RecurseDirs.convertActionParams(RecurseDirs.ja va:334)
at lrf.RecurseDirs.<init>(RecurseDirs.java:89)
at lrf.RecurseDirs.main(RecurseDirs.java:41)
Usage:
...
If I remove the "-cfont msyh.ttf,f#=1" no error but the PDF is still not correct - same as before.
Do I have to put the that ttf somewhere?

Any hint?
Thanks

alxwang
05-01-2009, 05:52 PM
The picture name works awesome!!!
Thanks a lot!

elinares
05-01-2009, 06:28 PM
D:\My eBooks>"C:\Program Files\Java\jre6\bin\java" -Xms200M -Xmx300M -jar LRFToo
ls-v0.9.209.jar convertLRF temp -d M:\AALC_TEMP\test\ -PDF -cfont msyh.ttf,f#=1

java.lang.ArrayIndexOutOfBoundsException: 7
at lrf.RecurseDirs.convertActionParams(RecurseDirs.ja va:334)
at lrf.RecurseDirs.<init>(RecurseDirs.java:89)
at lrf.RecurseDirs.main(RecurseDirs.java:41)
Usage:
...
If I remove the "-cfont msyh.ttf,f#=1" no error but the PDF is still not correct - same as before.
Do I have to put the that ttf somewhere?

Any hint?
Thanks

You must use a TTC (truetype font collection), and correct command line is:

-cfont msgothic.ttc 1

I've not found any way to use msyh.ttf, sorry.
Eladio

elinares
05-01-2009, 06:47 PM
I've found a msdos tool (TTSDK) wich can create a ttc from several ttf's. And also I've check that msyh.ttf works this way (using 0 as index of font) for chinese lrf.

alxwang
05-01-2009, 11:43 PM
It works with Chinese now. Really nice.
One more question: you embed the font in PDF or?
Thanks for this nice tool. Really useful.

elinares
05-02-2009, 05:57 AM
It works with Chinese now. Really nice.
One more question: you embed the font in PDF or?
Thanks for this nice tool. Really useful.

According with iText documentation, only the subset of the font your document uses is embedded, not the whole font. This must be true, because the size of the resulting pdf is smaller than TTF file...

alxwang
05-02-2009, 01:09 PM
Nice.
One more question: Is that possible to re-layout the text based LRF to other size. LRF is for 6 inch screen. Can LRFtool generate 10 inches PDF ?
Thanks

patricks
05-02-2009, 08:34 PM
Hi, I'm having trouble using this program to convert from LRF to PDF
It works fine for EPUB with the following instructions:

java -Xms200M -Xmx300M -jar LRFTools-v0.9.209.jar convertLRF c:\eBooks -EPUB

But with PDF at the end it returns the error, "The name 'P103' has no local destination." And the pdf file it creates won't open in acrobat- "The file is damaged and could not be repaired." Other than replacing EPUB with PDF the lines are the same.
Can anyone point out what I'm doing wrong?

patricks
05-03-2009, 09:29 AM
Just tried it on the mac side,used "java -Xms200M -Xmx300M -jar LRFTools-v0-1.9.209.jar convertLRF cd /eBooks/ -EPUB"
and got the following error:

Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java :675)
at java.security.SecureClassLoader.defineClass(Secure ClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader .java:260)
at java.net.URLClassLoader.access$100(URLClassLoader. java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java: 195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.j ava:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:3 16)
at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:280)
at java.lang.ClassLoader.loadClass(ClassLoader.java:2 51)
at java.lang.ClassLoader.loadClassInternal(ClassLoade r.java:374)

JSWolf
05-03-2009, 09:47 AM
Are you sure you have the correct version of Java installed?

patricks
05-03-2009, 11:28 AM
On the windows side I'm sure -1.6xxx (I used the java -version command from this thread).

On the mac side things seem to line up with what's available on the Apple java page:
JavaApplicationLauncher:
Version: 12.2.0
JavaScriptCore:
Version: 5525.26

But the thing that has really got me stumped is that I can convert the lrf file to EPUB, but I can't convert to PDF (as in I get the above error: "The name 'P103' has no local destination." and the pdf file that is created is corrupted).

ericshliao
05-06-2009, 03:47 PM
Hi,
I am using LRFTools 0.9.209 to convert some lrf files to html. I found one minor problem:
The generated html will break line automatically for italic font-style text.
You can see from my attached html file and screenshot.

I don't think it's the problem of LRFTools. It should be the problem of browser (I tried it with IE and Firefox).

I can fix this problem by manually removing:

</div>
<div align="Justify">

That's not an elegant way.:D

I am wondering if this problem might be fixed by LRFTools by properly detecting paragraph and insert <p> tag (or something else), so I raise this issue.
Due to copyright concern, I can't distribute this lrf file to public. If you do need one to analyze the problem, I will try to find a free lrf file with the same problem.

Added:
I roughly browsed several html files generated from lrf, there is a common problem: no paragraph tag. IMHO, adding paragraph tags will make a better conversion.

elinares
05-08-2009, 09:11 AM
Nice.
One more question: Is that possible to re-layout the text based LRF to other size. LRF is for 6 inch screen. Can LRFtool generate 10 inches PDF ?
Thanks

I'll take a look this weekend.

Hi, I'm having trouble using this program to convert from LRF to PDF
It works fine for EPUB with the following instructions:

java -Xms200M -Xmx300M -jar LRFTools-v0.9.209.jar convertLRF c:\eBooks -EPUB

But with PDF at the end it returns the error, "The name 'P103' has no local destination." And the pdf file it creates won't open in acrobat- "The file is damaged and could not be repaired." Other than replacing EPUB with PDF the lines are the same.
Can anyone point out what I'm doing wrong?

Well, this mean page 103 has no anchor destination. It's a bug. Could you pm a link for the lrf?

Just tried it on the mac side,used "java -Xms200M -Xmx300M -jar LRFTools-v0-1.9.209.jar convertLRF cd /eBooks/ -EPUB"
and got the following error:

Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java :675)
at java.security.SecureClassLoader.defineClass(Secure ClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader .java:260)
at java.net.URLClassLoader.access$100(URLClassLoader. java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java: 195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.j ava:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:3 16)
at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:280)
at java.lang.ClassLoader.loadClass(ClassLoader.java:2 51)
at java.lang.ClassLoader.loadClassInternal(ClassLoade r.java:374)

You must use a JVM 1.6 on Mac.

Hi,
I am using LRFTools 0.9.209 to convert some lrf files to html. I found one minor problem:
The generated html will break line automatically for italic font-style text.
You can see from my attached html file and screenshot.

I don't think it's the problem of LRFTools. It should be the problem of browser (I tried it with IE and Firefox).

I can fix this problem by manually removing:

</div>
<div align="Justify">

That's not an elegant way.:D

I am wondering if this problem might be fixed by LRFTools by properly detecting paragraph and insert <p> tag (or something else), so I raise this issue.
Due to copyright concern, I can't distribute this lrf file to public. If you do need one to analyze the problem, I will try to find a free lrf file with the same problem.

Added:
I roughly browsed several html files generated from lrf, there is a common problem: no paragraph tag. IMHO, adding paragraph tags will make a better conversion.
Fixed italic problem. I'm gong to publish new version tomorrow with this.
Why p tags? Actually DIV tag is used instead of P...

elinares
05-08-2009, 01:25 PM
Uploaded new version 0.9.211. Check first post please.
BUGS:
Newline before italics and bolds.
Some improvements converting lrf to epub and html.

elinares
05-08-2009, 02:18 PM
Nice.
One more question: Is that possible to re-layout the text based LRF to other size. LRF is for 6 inch screen. Can LRFtool generate 10 inches PDF ?
Thanks

There is a command line argument (-A4) that do this.

ericshliao
05-08-2009, 02:48 PM
This is some error log. The same lrf file, ok for v0.9.209, error for v0.9.211.
v0.9.211 does fix the break line problem. Thanx.


C:\Downloads\lrf\test> java -Xms200M -Xmx300M -jar LRFTools-v0.9.209.jar convert
LRF . -HTML
Creating Pride and Prejudice.html...HTML Ok

C:\Downloads\lrf\test> java -Xms200M -Xmx300M -jar LRFTools-v0.9.211.jar convert
LRF . -HTML
Creating Pride and Prejudice.html...HTML Error:
java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
at java.util.ArrayList.RangeCheck(Unknown Source)
at java.util.ArrayList.get(Unknown Source)
at com.lowagie.text.Paragraph.add(Unknown Source)
at com.lowagie.text.HeaderFooter.paragraph(Unknown Source)
at com.lowagie.text.html.HtmlWriter.initFooter(Unknow n Source)
at com.lowagie.text.html.HtmlWriter.close(Unknown Source)
at com.lowagie.text.Document.close(Unknown Source)
at lrf.objects.Book.getHTML(Book.java:203)
at lrf.RecurseDirs.dumpToHTML(RecurseDirs.java:423)
at lrf.RecurseDirs.convertAction(RecurseDirs.java:530 )
at lrf.RecurseDirs.convertActionParams(RecurseDirs.ja va:352)
at lrf.RecurseDirs.<init>(RecurseDirs.java:89)
at lrf.RecurseDirs.main(RecurseDirs.java:41)

ericshliao
05-08-2009, 05:48 PM
Why p tags? Actually DIV tag is used instead of P...

It seems that web browser and mobipocket reader will give additional line space to tag <p>, so there will be additional space between two paragraphs. For tag <div>, the line space between two paragraphs is just the same as common lines. That's why I want tag <p>.
Maybe it can be done by inserting addition attribute in <div>, but I don't know how.

alxwang
05-10-2009, 02:02 PM
There is a command line argument (-A4) that do this.

Sweet!
Will test it at Monday.
Thanks a lot

elinares
05-10-2009, 04:30 PM
This is some error log. The same lrf file, ok for v0.9.209, error for v0.9.211.
v0.9.211 does fix the break line problem. Thanx.


C:\Downloads\lrf\test> java -Xms200M -Xmx300M -jar LRFTools-v0.9.209.jar convert
LRF . -HTML
Creating Pride and Prejudice.html...HTML Ok

C:\Downloads\lrf\test> java -Xms200M -Xmx300M -jar LRFTools-v0.9.211.jar convert
LRF . -HTML
Creating Pride and Prejudice.html...HTML Error:
java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
at java.util.ArrayList.RangeCheck(Unknown Source)
at java.util.ArrayList.get(Unknown Source)
at com.lowagie.text.Paragraph.add(Unknown Source)
at com.lowagie.text.HeaderFooter.paragraph(Unknown Source)
at com.lowagie.text.html.HtmlWriter.initFooter(Unknow n Source)
at com.lowagie.text.html.HtmlWriter.close(Unknown Source)
at com.lowagie.text.Document.close(Unknown Source)
at lrf.objects.Book.getHTML(Book.java:203)
at lrf.RecurseDirs.dumpToHTML(RecurseDirs.java:423)
at lrf.RecurseDirs.convertAction(RecurseDirs.java:530 )
at lrf.RecurseDirs.convertActionParams(RecurseDirs.ja va:352)
at lrf.RecurseDirs.<init>(RecurseDirs.java:89)
at lrf.RecurseDirs.main(RecurseDirs.java:41)


Could you pm me a link for the book?

ericshliao
05-10-2009, 06:26 PM
Could you pm me a link for the book?

Here is the ebook.

rogue_ronin
05-11-2009, 08:55 AM
Just tried the newer LRFTools_gui on my linux box. Running Java 1.6.0_10.

Hangs, I'm afraid...

rogue@monster:~/bin/eBooks/LRFTools$ java -jar LRFTools_gui.jar
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at UnicodeIniReader.parseLine(UnicodeIniReader.java:9 4)
at UnicodeIniReader.read(UnicodeIniReader.java:63)
at UnicodeIniReader.<init>(UnicodeIniReader.java:50)
at LRFTools_gui.const_init(LRFTools_gui.java:1642)
at LRFTools_gui.<init>(LRFTools_gui.java:37)
at LRFTools_gui$44.run(LRFTools_gui.java:1539)
at java.awt.event.InvocationEvent.dispatch(Invocation Event.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java: 597)
at java.awt.EventDispatchThread.pumpOneEventForFilter s(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(E ventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarch y(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThre ad.java:122)


The old version still launches fine.

Any suggestions?

m a r

alxwang
05-11-2009, 11:17 PM
Sweet!
Will test it at Monday.
Thanks a lot

A4 Parameter works really well.
Thanks again.

alxwang
05-12-2009, 04:56 PM
-rf a percentage of resistance to change size of font .
What's that mean? Can I use this one to increase font size?
Thanks.

elinares
05-13-2009, 01:56 PM
-rf a percentage of resistance to change size of font .
What's that mean? Can I use this one to increase font size?
Thanks.

It's difficult for me to explain -rf. I've been collecting books taht seems to be 'scanned' and 'OCR-ed', resulting in a reasonable quality but with one problem: small and unnecessary changes of font sizes on the same paragraph.
This is odd. (-rf number) parameter works this way:

When on a paragraph the font size is changed from size 'a' to size 'b'; if this parameter is specified and 'b' is greather or lower than (1+number%)*a, then the size is changed; otherwise the size of the font is not changed.

So, no, you cannot use this param to change font size, but this would not be difficult...

alxwang
05-13-2009, 04:12 PM
It's difficult for me to explain -rf. I've been collecting books taht seems to be 'scanned' and 'OCR-ed', resulting in a reasonable quality but with one problem: small and unnecessary changes of font sizes on the same paragraph.
This is odd. (-rf number) parameter works this way:

When on a paragraph the font size is changed from size 'a' to size 'b'; if this parameter is specified and 'b' is greather or lower than (1+number%)*a, then the size is changed; otherwise the size of the font is not changed.

So, no, you cannot use this param to change font size, but this would not be difficult...

Cool.
The A4 reflow works really well but if I can set a "% of font size increase" it will be even more useful. It tells how much I want the font come to bigger like 120%. It is not new font size.
Thanks.

alxwang
05-13-2009, 09:31 PM
One more question:
I compare the png result and PDF result and I found out the picture quality decreased a lot in PDF compare to png. How can I prevent that happen?
Thanks.

adinb
05-17-2009, 09:46 PM
First off, thanks for the great tool -- I've been using it for a while now with great success!

Today I tried using 0.9.211 to convert a pdf to epub (this particular file works in calibre but formats poorly), but java appears to be throwing an exception on this file 411 pages in:

Desire:Downloads$ soylatte16-i386-1.0.3/jre/bin/java -Xms200M -Xmx300M -jar LRFTools-v0.9.211.jar convertPDF ~/Desktop/ -EPUB
Loading 'In Death.pdf' 431 pages java.util.zip.ZipException: incorrect header check
at java.util.zip.InflaterInputStream.read(InflaterInp utStream.java:147)
at org.pdfbox.filter.FlateFilter.decode(FlateFilter.j ava:97)
at org.pdfbox.cos.COSStream.doDecode(COSStream.java:2 90)
at org.pdfbox.cos.COSStream.doDecode(COSStream.java:2 35)
at org.pdfbox.cos.COSStream.getUnfilteredStream(COSSt ream.java:170)
at org.pdfbox.pdmodel.common.COSStreamArray.getUnfilt eredStream(COSStreamArray.java:200)
at org.pdfbox.pdfparser.PDFStreamParser.<init>(PDFStreamParser.java:101)
at org.pdfbox.pdmodel.common.COSStreamArray.getStream Tokens(COSStreamArray.java:141)
at org.pdfbox.util.PDFStreamEngine.processSubStream(P DFStreamEngine.java:202)
at org.pdfbox.util.PDFStreamEngine.processStream(PDFS treamEngine.java:174)
at org.pdfbox.pdfviewer.PageDrawer.drawPage(PageDrawe r.java:110)
at lrf.pdf.PDFSerializer.procPDF(PDFSerializer.java:9 1)
at lrf.pdf.PDFSerializer.recurse(PDFSerializer.java:3 3)
at lrf.RecurseDirs.convertPDFActionParams(RecurseDirs .java:242)
at lrf.RecurseDirs.<init>(RecurseDirs.java:91)
at lrf.RecurseDirs.main(RecurseDirs.java:41)

Other PDF (and lrf) files I've tried work fine; it may be something particular to this file. Although the zip exception is odd....

mngharry
05-19-2009, 09:18 AM
This is probably a very stupid question, but how do you start this program? When I double click on the .jar file, nothing happens. Got to work it!

simond
06-01-2009, 07:04 AM
OK, I tried going PDF->EPUB and had the following problem:

C:\Users\Simon\Desktop>java -Xms200M -Xmx300M -jar LRFTools-v0.9.211.jar convertPDF ebooks -d ebooks
Loading 'EvidenceExplained.pdf' 885 pages -----------java.io.IOException: Not implemented
at org.pdfbox.pdmodel.graphics.color.PDSeparation.cre ateColorSpace(PDSeparation.java:110)
at org.pdfbox.pdmodel.graphics.color.PDColorSpaceInst ance.createColor(PDColorSpaceInstance.java:79)
at org.pdfbox.util.operator.pagedrawer.SetStrokingCMY KColor.process(SetStrokingCMYKColor.java:61)
at org.pdfbox.util.PDFStreamEngine.processOperator(PD FStreamEngine.java:452)
at org.pdfbox.util.PDFStreamEngine.processSubStream(P DFStreamEngine.java:215)
at org.pdfbox.util.PDFStreamEngine.processStream(PDFS treamEngine.java:174)
at org.pdfbox.pdfviewer.PageDrawer.drawPage(PageDrawe r.java:110)
at lrf.pdf.PDFSerializer.procPDF(PDFSerializer.java:9 1)
at lrf.pdf.PDFSerializer.recurse(PDFSerializer.java:3 3)
at lrf.RecurseDirs.convertPDFActionParams(RecurseDirs .java:242)
at lrf.RecurseDirs.<init>(RecurseDirs.java:91)
at lrf.RecurseDirs.main(RecurseDirs.java:41)

Any ideas?

elinares
06-01-2009, 08:05 AM
OK, I tried going PDF->EPUB and had the following problem:

C:\Users\Simon\Desktop>java -Xms200M -Xmx300M -jar LRFTools-v0.9.211.jar convertPDF ebooks -d ebooks
Loading 'EvidenceExplained.pdf' 885 pages -----------java.io.IOException: Not implemented
at org.pdfbox.pdmodel.graphics.color.PDSeparation.cre ateColorSpace(PDSeparation.java:110)
at org.pdfbox.pdmodel.graphics.color.PDColorSpaceInst ance.createColor(PDColorSpaceInstance.java:79)
at org.pdfbox.util.operator.pagedrawer.SetStrokingCMY KColor.process(SetStrokingCMYKColor.java:61)
at org.pdfbox.util.PDFStreamEngine.processOperator(PD FStreamEngine.java:452)
at org.pdfbox.util.PDFStreamEngine.processSubStream(P DFStreamEngine.java:215)
at org.pdfbox.util.PDFStreamEngine.processStream(PDFS treamEngine.java:174)
at org.pdfbox.pdfviewer.PageDrawer.drawPage(PageDrawe r.java:110)
at lrf.pdf.PDFSerializer.procPDF(PDFSerializer.java:9 1)
at lrf.pdf.PDFSerializer.recurse(PDFSerializer.java:3 3)
at lrf.RecurseDirs.convertPDFActionParams(RecurseDirs .java:242)
at lrf.RecurseDirs.<init>(RecurseDirs.java:91)
at lrf.RecurseDirs.main(RecurseDirs.java:41)

Any ideas?
Bad luck. The library pdfbox don't support all images on pdf. You can try to 'print' your pdf to a BullZip printer or similar. This generate other pdf (identical) but sometimes windows reprocess images and converts it to other format...

simond
06-05-2009, 06:12 AM
Bad luck. The library pdfbox don't support all images on pdf. You can try to 'print' your pdf to a BullZip printer or similar. This generate other pdf (identical) but sometimes windows reprocess images and converts it to other format...

BullZip didn't work, will try other ones later, oh well :)

humanehero
06-14-2009, 08:43 PM
First off, thanks for the great program! It's really a life saver when all I have are LRFs that I need in another format.

While converting somewhere close to 500 books, every once in awhile, the program would get hung up on one book and stop converting. This happened on about twenty different books. Here is the error message I get.

java.lang.IndexOutOfBoundsException
at java.nio.Buffer.checkIndex(Unknown Source)
at java.nio.DirectByteBuffer.getInt(Unknown Source)
at lrf.buffer.MappedReader.getInt(MappedReader.java:7 0)
at lrf.objects.Book.loadObjects(Book.java:339)
at lrf.objects.Book.<init>(Book.java:112)
at lrf.RecurseDirs.convertAction(RecurseDirs.java:525 )
at lrf.RecurseDirs.convertActionParams(RecurseDirs.ja va:352)
at lrf.RecurseDirs.<init>(RecurseDirs.java:89)
at lrf.RecurseDirs.main(RecurseDirs.java:41)

elinares
06-15-2009, 10:01 AM
First off, thanks for the great program! It's really a life saver when all I have are LRFs that I need in another format.

While converting somewhere close to 500 books, every once in awhile, the program would get hung up on one book and stop converting. This happened on about twenty different books. Here is the error message I get.

java.lang.IndexOutOfBoundsException
at lrf.RecurseDirs.main(RecurseDirs.java:41)

Hi, could you PM me with a link to one or some of these books?

erictice
06-15-2009, 12:24 PM
Has anyone tried this in code rather than command line? I am just trying to try the PDF2EPUB_HTML and not having any luck

erictice
06-16-2009, 11:41 AM
I am trying to use the api in a JAVA app and can't seem to get it to convert the pdf. The documentation in the code is non-existent does anyone have a sample of how to do PDF2EPUB_HTML()

elinares
06-19-2009, 07:57 PM
First off, thanks for the great program! It's really a life saver when all I have are LRFs that I need in another format.

While converting somewhere close to 500 books, every once in awhile, the program would get hung up on one book and stop converting. This happened on about twenty different books. Here is the error message I get.

java.lang.IndexOutOfBoundsException
at java.nio.Buffer.checkIndex(Unknown Source)
at java.nio.DirectByteBuffer.getInt(Unknown Source)
at lrf.buffer.MappedReader.getInt(MappedReader.java:7 0)
at lrf.objects.Book.loadObjects(Book.java:339)
at lrf.objects.Book.<init>(Book.java:112)
at lrf.RecurseDirs.convertAction(RecurseDirs.java:525 )
at lrf.RecurseDirs.convertActionParams(RecurseDirs.ja va:352)
at lrf.RecurseDirs.<init>(RecurseDirs.java:89)
at lrf.RecurseDirs.main(RecurseDirs.java:41)
Hmm, i cannot open none of these books with sony library (it says it's corrupted)

elinares
06-19-2009, 08:01 PM
I am trying to use the api in a JAVA app and can't seem to get it to convert the pdf. The documentation in the code is non-existent does anyone have a sample of how to do PDF2EPUB_HTML()
Hi, this class is actually deprecated. See "lrf.RecurseDirs.convertPDFActionParams" function. You will see there is two modes of conversion from PDF to EPUB: classes PDF2SVG and PDFSerializer, the preferred.

And yes, there is no info on the code...

humanehero
06-20-2009, 01:24 PM
hmm... okay. Thanks for trying anyway. I appreciate it. I guess I'll just download them again.

Shadowdh
06-21-2009, 06:24 PM
Hi there, I have a few lrf type ebooks and I want to convert them to either lit format or txt, doc or rtf format... so after a search I found this site and have tried to follow the instructions as they are in this thread... after changing to the LRFTools directory as specified in this thread also I typed out java -Xms200M -Xmx300M -jar LRFTools.jar convertLRF c:\eBooks -RTF and it came back with the message error occurred during initialisation of VM, Too small initial heap... not sure what that means... can anyone help out? I only have about 13 books to convert as I mainly use MSreader or uBook... Many thanks in advance... oh and I should mention that I am not too computer savvy...

Kostas
07-08-2009, 06:34 AM
A great Thank You to Elinares for this wonderful tool! :thanks:
And to Lionfish too for his gui which simplifies novice's life!:) :2thumbsup

svsmailus
07-16-2009, 02:49 AM
Hi,

Trying to get readable PDF's on my iphone. The following images is the output. I'm running Vista business. any help would be greatly appreciated:

jotas
07-23-2009, 04:15 PM
Hi!

I just found this thread and tool. Looks quite promising, I will take a look and try!

Just two questions for the moment:

- Since you already have XML and HTML conversion, will be possible a new and direct .FB2 conversion/output format? This would allow to share and use all .LRF files around with many e-readers, as EPUB should do (well, .RTF is a similar story and headache) if specs are finally added and correctly programmed to devices.

- Today, I also found (IMHO) a quite useful application: LRF2LRF (Font and Margin modifyer) (http://www.mobileread.com/forums/showthread.php?t=24978), would be interesting to merge it to this project also, in some way?

Thanks!
Regards!

Sonist
07-25-2009, 06:15 PM
What is wrong with this command:

java -Xms200M -Xmx300M -jar LRFTools-v0-1.9.211.jar convert -LRFTools/TenderistheNight.lrf -HTML -noo

Trying it on a Mac, but I keep getting the Actions list when I run it.

When I tried the second version of the GUI, I can see it start, but then it just closes.

P.S. Ah, well. I ran the gui in Vista, and it worked (on my Mac it doesn't.)

The conversion was decent, but the TOC didn't work (the chapters lost their tags.)

Thanks for a very useful tool, though!

LRF is a real b*tch of a format....

afv011
08-08-2009, 01:34 PM
Hi,

this is a very nice tool, thanks for the effort.

I have converted a LRF book to EPUB and HTML, and the result is good, with the exception that there are no paragraph breaks. Is this a known problem? I attach a screenshot to show the two formats.

JSWolf
08-08-2009, 01:37 PM
Hi,

this is a very nice tool, thanks for the effort.

I have converted a LRF book to EPUB and HTML, and the result is good, with the exception that there are no paragraph breaks. Is this a known problem? I attach a screenshot to show the two formats.
The screenshot of message I am quoting needs to be deleted. It's showing an illegal book. Original Star Trek novels do not have straight quotes.

As to the problem, just go into the CSS of the ePub and you can fix the problems.

pilotbob
08-08-2009, 03:05 PM
The screenshot of message I am quoting needs to be deleted. It's showing an illegal book. Original Star Trek novels do not have straight quotes.

I really think this falls under fair use.

BOb

afv011
08-08-2009, 09:46 PM
As to the problem, just go into the CSS of the ePub and you can fix the problems.

Thanks for the tip. I have done something different, I have searched/replaced the beginning and end of each paragraph to add a <p> and </p>, it seemed easier that updating the CSS. The LRFTool does a good job of detecting paragraphs as each paragraph is marked with a <div> tag, so my thought was that it should be fairly simple to update it to include a <p> and </p> to have a clear division between paragraphs.

JSWolf
08-08-2009, 09:55 PM
I really think this falls under fair use.

BOb
Fair use would be if it was a legal eBook. This is not a legal eBook so it cannot be fair use.

Nate the great
08-08-2009, 10:40 PM
The screenshot of message I am quoting needs to be deleted. It's showing an illegal book. Original Star Trek novels do not have straight quotes.

As to the problem, just go into the CSS of the ePub and you can fix the problems.

Fair use would be if it was a legal eBook. This is not a legal eBook so it cannot be fair use.

The book might not be fair use (I disagree), but the image is becuase it is only a small part, was posted for noncommercial purposes, and does not detract from the sales of the book.

Whether the book is a illicit copy is not relevant, IMO.

pilotbob
08-08-2009, 10:45 PM
The book might not be fair use (I disagree), but the image is becuase it is only a small part, was posted for noncommercial purposes, and does not detract from the sales of the book.


that's what I meant.. showing an image with part of a page of a book is fair use....

As far as the book, it is entirely possible the book was scanned and OCRed or the person lives in a country where copying the book is legal... I have no idea.

BOb

elinares
08-12-2009, 03:24 PM
Thanks for the tip. I have done something different, I have searched/replaced the beginning and end of each paragraph to add a <p> and </p>, it seemed easier that updating the CSS. The LRFTool does a good job of detecting paragraphs as each paragraph is marked with a <div> tag, so my thought was that it should be fairly simple to update it to include a <p> and </p> to have a clear division between paragraphs.

Some people has made the same comment before. I'm at the beach now, answering with my phone; next week i'll take a look at this...
Happy holidays.

afv011
08-13-2009, 12:34 PM
Some people has made the same comment before. I'm at the beach now, answering with my phone; next week i'll take a look at this...
Happy holidays.

Thanks for your reply; I look forward to your LRFTool update, and enjoy your holiday!

elinares
08-14-2009, 02:16 PM
What is wrong with this command:

java -Xms200M -Xmx300M -jar LRFTools-v0-1.9.211.jar convert -LRFTools/TenderistheNight.lrf -HTML -noo

Trying it on a Mac, but I keep getting the Actions list when I run it.

When I tried the second version of the GUI, I can see it start, but then it just closes.

P.S. Ah, well. I ran the gui in Vista, and it worked (on my Mac it doesn't.)

The conversion was decent, but the TOC didn't work (the chapters lost their tags.)

Thanks for a very useful tool, though!

LRF is a real b*tch of a format....

The command must be convertLRF (this was changed on recent versions). About TOC, well, I'm not sure what you mean 'lost their tags'...

drenthe
08-19-2009, 04:25 PM
For Mac Leopard:
change Java 1.5 to 1.6 in "Java Preferences" application located in (/Applications/Utilities/Java) or (/Applications/Utilities)

then try something like:
java -Xms200M -Xmx300M -jar LRFTools/LRFTools-v0.9.211.jar convertLRF "LRFTools/Convert" -HTML -noo

1 - dont forget quotes
2 - here: LRFTools-v0.9.211.jar in folder "LRFTools" in "home"
3 - here: lrf-files in folder "LRFTools" in folder "Convert"

Demented
08-30-2009, 12:49 PM
I'm only familiar with Java development and I can't seem to make a change to the source of the html converter. Anyone else have any experience? I'm trying to redo the output style from <div><span> to <p>. I'm not having trouble with the code, it's compiling it once I've made my changes to the emitter.java file of src/lrf/html folder.

elinares
09-01-2009, 09:03 AM
I'm only familiar with Java development and I can't seem to make a change to the source of the html converter. Anyone else have any experience? I'm trying to redo the output style from <div><span> to <p>. I'm not having trouble with the code, it's compiling it once I've made my changes to the emitter.java file of src/lrf/html folder.

Well, this class is only used to convert from PDF to EPUB. Actually, conversion from LRF to EPUB is handled via iText libraries. These libraries do not let me change anything. I could post-process output from them (with a flag) to change <div> to <p>... is this enough?

Demented
09-01-2009, 09:49 AM
That would be nice. I've actually been looking at it and I think the best solution would be to remove the divs entirely and then replace the <span> tags with <p> tags. I can't wait to have line breaks again :) Thanks for your hard work on this project.

bkilian
09-01-2009, 06:12 PM
That would be nice. I've actually been looking at it and I think the best solution would be to remove the divs entirely and then replace the <span> tags with <p> tags. I can't wait to have line breaks again :) Thanks for your hard work on this project.That wouldn't work. There are spans for italics, and for a bunch of other things, if you replaced all spans with p, it would break the book.

The problem is that they combine different text CSS for spans and divs to make a single whole. When I converted one, I eventually gave up, and just used vi to convert the LRS directly to HTML. It turned out a lot better.

Demented
09-02-2009, 01:11 AM
Currently there are no italics or any type of formatting for anything. The entire book consists of <div><span> which do absolutely nothing. So I'd be willing to lose the italics:P

jon.handler
09-06-2009, 11:35 AM
For Mac Leopard:
change Java 1.5 to 1.6 in "Java Preferences" application located in (/Applications/Utilities/Java) or (/Applications/Utilities)

then try something like:
java -Xms200M -Xmx300M -jar LRFTools/LRFTools-v0.9.211.jar convertLRF "LRFTools/Convert" -HTML -noo

1 - dont forget quotes
2 - here: LRFTools-v0.9.211.jar in folder "LRFTools" in "home"
3 - here: lrf-files in folder "LRFTools" in folder "Convert"

I did this and I am getting a ClassNotFoundException, but I don't see a class in there that it's looking for. MacBook Pro (Intel 64 bit) OS X 10.5.8. I tried setting CLASSPATH to the location of the jar file but that didn't help.

Any clues?

Jon

jon.handler
09-06-2009, 11:38 AM
I did this and I am getting a ClassNotFoundException, but I don't see a class in there that it's looking for. MacBook Pro (Intel 64 bit) OS X 10.5.8. I tried setting CLASSPATH to the location of the jar file but that didn't help.

Any clues?

Jon

nvm. I faked myself out. wasn't using the "-jar" on the command line :-)

Jon

sharkbc
10-08-2009, 06:18 AM
Hi everybody !

I want to convert my pdf files to epub file.

Im using LRFTools(LRFTools-v0.9.209.jar).


I coverted successfully 10/20 files(10 files i got error.)

this is one of some error i got:


C:\>cd epub

C:\epub>set path="%path";"c:\Program Files\java\jdk1.6.0_12\bin"

C:\epub>java -Xms200M -Xmx300M -jar LRFTools-v0.9.209.jar convertPDF c:\epub\pdf

Loading 'CV_007_027_Business_Knigge.pdf' 21 pages -java.io.IOException: Not impl
emented
at org.pdfbox.pdmodel.graphics.color.PDSeparation.cre ateColorSpace(PDSep
aration.java:110)
at org.pdfbox.pdmodel.graphics.color.PDColorSpaceInst ance.createColor(PD
ColorSpaceInstance.java:79)
at org.pdfbox.util.operator.pagedrawer.SetStrokingCMY KColor.process(SetS
trokingCMYKColor.java:61)
at org.pdfbox.util.PDFStreamEngine.processOperator(PD FStreamEngine.java:
452)
at org.pdfbox.util.PDFStreamEngine.processSubStream(P DFStreamEngine.java
:215)
at org.pdfbox.util.PDFStreamEngine.processStream(PDFS treamEngine.java:17
4)
at org.pdfbox.pdfviewer.PageDrawer.drawPage(PageDrawe r.java:110)
at lrf.pdf.PDFSerializer.procPDF(PDFSerializer.java:9 1)
at lrf.pdf.PDFSerializer.recurse(PDFSerializer.java:3 3)
at lrf.RecurseDirs.convertPDFActionParams(RecurseDirs .java:242)
at lrf.RecurseDirs.<init>(RecurseDirs.java:91)
at lrf.RecurseDirs.main(RecurseDirs.java:41)



Can anybody tell me about this problem and how to fix it.

Or any version of LRF tools that isbetter.

Thanks and regards!

sharkbc
10-08-2009, 06:23 AM
LRF Tools
Hi everybody !

I want to convert my pdf files to epub file.

Im using LRFTools(LRFTools-v0.9.209.jar).


I coverted successfully 10/20 files(10 files i got error.)

this is one of some error i got:


C:\>cd epub

C:\epub>set path="%path";"c:\Program Files\java\jdk1.6.0_12\bin"

C:\epub>java -Xms200M -Xmx300M -jar LRFTools-v0.9.209.jar convertPDF c:\epub\pdf

Loading 'CV_007_027_Business_Knigge.pdf' 21 pages -java.io.IOException: Not impl
emented
at org.pdfbox.pdmodel.graphics.color.PDSeparation.cre ateColorSpace(PDSep
aration.java:110)
at org.pdfbox.pdmodel.graphics.color.PDColorSpaceInst ance.createColor(PD
ColorSpaceInstance.java:79)
at org.pdfbox.util.operator.pagedrawer.SetStrokingCMY KColor.process(SetS
trokingCMYKColor.java:61)
at org.pdfbox.util.PDFStreamEngine.processOperator(PD FStreamEngine.java:
452)
at org.pdfbox.util.PDFStreamEngine.processSubStream(P DFStreamEngine.java
:215)
at org.pdfbox.util.PDFStreamEngine.processStream(PDFS treamEngine.java:17
4)
at org.pdfbox.pdfviewer.PageDrawer.drawPage(PageDrawe r.java:110)
at lrf.pdf.PDFSerializer.procPDF(PDFSerializer.java:9 1)
at lrf.pdf.PDFSerializer.recurse(PDFSerializer.java:3 3)
at lrf.RecurseDirs.convertPDFActionParams(RecurseDirs .java:242)
at lrf.RecurseDirs.<init>(RecurseDirs.java:91)
at lrf.RecurseDirs.main(RecurseDirs.java:41)



Can anybody tell me about this problem and how to fix it.

Or any version of LRF tools that isbetter.

Thanks and regards!

elinares
10-22-2009, 06:06 AM
LRF Tools
Hi everybody !

I want to convert my pdf files to epub file.

Im using LRFTools(LRFTools-v0.9.209.jar).


I coverted successfully 10/20 files(10 files i got error.)

this is one of some error i got:


C:\>cd epub

C:\epub>set path="%path";"c:\Program Files\java\jdk1.6.0_12\bin"

C:\epub>java -Xms200M -Xmx300M -jar LRFTools-v0.9.209.jar convertPDF c:\epub\pdf

Loading 'CV_007_027_Business_Knigge.pdf' 21 pages -java.io.IOException: Not impl
emented
at org.pdfbox.pdmodel.graphics.color.PDSeparation.cre ateColorSpace(PDSep
aration.java:110)
at org.pdfbox.pdmodel.graphics.color.PDColorSpaceInst ance.createColor(PD
ColorSpaceInstance.java:79)
at org.pdfbox.util.operator.pagedrawer.SetStrokingCMY KColor.process(SetS
trokingCMYKColor.java:61)
at org.pdfbox.util.PDFStreamEngine.processOperator(PD FStreamEngine.java:
452)
at org.pdfbox.util.PDFStreamEngine.processSubStream(P DFStreamEngine.java
:215)
at org.pdfbox.util.PDFStreamEngine.processStream(PDFS treamEngine.java:17
4)
at org.pdfbox.pdfviewer.PageDrawer.drawPage(PageDrawe r.java:110)
at lrf.pdf.PDFSerializer.procPDF(PDFSerializer.java:9 1)
at lrf.pdf.PDFSerializer.recurse(PDFSerializer.java:3 3)
at lrf.RecurseDirs.convertPDFActionParams(RecurseDirs .java:242)
at lrf.RecurseDirs.<init>(RecurseDirs.java:91)
at lrf.RecurseDirs.main(RecurseDirs.java:41)



Can anybody tell me about this problem and how to fix it.

Or any version of LRF tools that isbetter.

Thanks and regards!

The library itext does not support all pdf image colorspaces, sorry.

johnydeep
11-08-2009, 12:47 PM
I can get convertPDF to work. I have tried a few pdfs but it seems it just not working. This is what I'm getting "Loading 'Bet_Brain_Never_get_it_wrong.pdf' 6 pages -/ sorting...End." but no file. I used: "java -Xms40M -Xmx60M -jar c:\LRFTools-v0.9.211.jar convertPDF c:\test " with 40-60 and 200-300 MB still no result. Any ideas?:help:

elinares
11-24-2009, 08:28 AM
I'm maven-ized the project, so you can now download and install all dependencies with 'mvn install' from subversion repository at googlecode (see first post). Also, all third party libraries have been upgraded, so I expect some 'PDFs' works now.
Eladio

pikoman
12-08-2009, 08:28 AM
Hi, I tried the LRFtools to convert comic lrf to pdf, the quality is good but the image size is smaller (5-10% less than LRF image). Any idea how can I make the PDF with the same image size of LRF??
Many thanks.