Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Sony Reader > Sony Reader Dev Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 11-26-2006, 07:15 AM   #31
William Moates
Zealot
William Moates began at the beginning.
 
Posts: 107
Karma: 35
Join Date: Oct 2006
Location: Greensboro, NC
Device: Sony Librie / Sony Clie / Sony Reader
scotty1024, I've got some questions about the BBeBook application you posted here earlier. I tried to compile it as a JAR on Mac OS X 10.3.9, and it's been an interesting journey. (I've been doing some research online, but haven't been able to find answers, so I'm tossing this to you.)

After learning how to build a Java Tool in Xcode 1.5, I tossed all your Java files into the project, then told it to build. After much experimentation, I learned it needed the following public Java libraries (which I added as JARs):
xpp3 version 1.1.4 http://www.extreme.indiana.edu/xgws/xsoap/xpp/mxp1/
JPedal version 2.40b15 http://www.jpedal.org
PDFBox version 0.7.1 http://www.pdfbox.org
I got it to build the JAR, but when I try to run it, I get this error:

Code:
Exception in thread "main" java.lang.NoClassDefFoundError: org/pdfbox/util/PDFStreamEngine
	at java.lang.ClassLoader.defineClass0(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
	at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)

Executable “java” has exited with status 1.
In your comments in PageParser.java, you refer to PDFBox 0.7.1, so I felt it was the right version to use. Was it?

I checked the version of Java by going to Terminal and typing "java -version", and it returned this:
Code:
java version "1.4.2_09"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_09-233)
Java HotSpot(TM) Client VM (build 1.4.2-56, mixed mode)
In plainer English, I'm running J2SE 1.4.2.

I built it with different versions of the Java libraries because, when I used the most recent versions of all three, I got these errors:

BBeBook.java:341: cannot resolve symbol : method setPreferredSize (java.awt.Dimension)
BBeBook.java:1383: cannot resolve symbol : method enableHighQualityMode ()
BBeBook.java:1387: cannot resolve symbol : method setThumbnaiImageTransparency (boolean)

The first method, setPreferredSize(), is not in J2SE version 1.4.2. It is a method in JComponent, but not JFrame, which is how you use it.
The last two methods are in JPedal, but are not available in versions 3.00 or versions 2.80. They have been removed from PdfDecoder's methods. (JPedal no longer distributes any versions older than 2.80 on their website, but I had version 2.40 from your posting in the Yahoo! Librie group.)
When I comment out all three methods, compile the JAR, then run it, I get the same exception thrown as above.

If you need more info, let me know.
William Moates is offline   Reply With Quote
Old 11-26-2006, 04:57 PM   #32
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Does it run without building it into a jar file?
kovidgoyal is offline   Reply With Quote
Advert
Old 12-22-2006, 08:34 PM   #33
grebki
Junior Member
grebki began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Dec 2006
Device: Sony PRS-500
HTML2LRF works after Connect Reader is run

FYI, I have discovered (at least on my laptop...) that I must run the SONY Connect Reader before HTML2LRF will work -- if I try to run it without ever having run the Sony s/w after a re-boot, it will constantly crash. I don't know why -- I'm guessing that some system variable(s) has to be set or something??

-G
grebki is offline   Reply With Quote
Old 12-23-2006, 01:34 PM   #34
ptully
Junior Member
ptully began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Nov 2006
Device: PRS-500
HTML2LRF on mac (intel)?

Hi - Just got a new intel-based macbook pro. The only thing left to get over on it is HTML2LRF. I know i can get this working on parallels (windows on my mac), but would LOVE to run this natively (it's become one of those necessary programs for me). I just read your latest post saying that you must connect to sony first or else it will crash.

Has anyone compiled and run HTML2LRF on a mac (or on linux for that matter)? I've written several perl scripts to scrap some websites/blogs and automaticly download them to my SD card when i insert it and would love to keep that up without having to boot parallels. Ideas/thoughts (other than i should stick with windows ;-)?

-Pat-
ptully is offline   Reply With Quote
Old 12-23-2006, 01:47 PM   #35
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
It should theoretically be possible to get it running with winelib. Unfortunately, I don't have the necessary experience with winelib programming.
kovidgoyal is offline   Reply With Quote
Advert
Old 12-27-2006, 12:58 AM   #36
unkilbeeg
Enthusiast
unkilbeeg My eyes! My eyes! The light is just too bright!unkilbeeg My eyes! My eyes! The light is just too bright!unkilbeeg My eyes! My eyes! The light is just too bright!unkilbeeg My eyes! My eyes! The light is just too bright!unkilbeeg My eyes! My eyes! The light is just too bright!unkilbeeg My eyes! My eyes! The light is just too bright!unkilbeeg My eyes! My eyes! The light is just too bright!unkilbeeg My eyes! My eyes! The light is just too bright!unkilbeeg My eyes! My eyes! The light is just too bright!unkilbeeg My eyes! My eyes! The light is just too bright!unkilbeeg My eyes! My eyes! The light is just too bright!
 
unkilbeeg's Avatar
 
Posts: 49
Karma: 80904
Join Date: Nov 2006
Location: Bakersfield, CA
Device: Sony PRS-500/Astak EZReader 5"/PocketBook 360/Kindle
Hmmm. Frustrating. So far I've had no luck in finding a way to create LRF files.

HTML2LRF doesn't seem to work very well under wine, at least not here. It creates an LRF file that contains a title page, but no text. My test file is from a Baen HTML download. Admittedly Baen's HTML is U.G.L.Y. Even after considerable cleanup, however, the resulting LRF file is exactly the same. Empty except for the title page.
Code:
libGL error: open DRM failed (Operation not permitted)
libGL error: reverting to (slow) indirect rendering
libGL error: open DRM failed (Operation not permitted)
libGL error: reverting to (slow) indirect rendering
HTML2LRF v 0.1 (c) 2006 Igor Skochinsky
Writing to test.lrf...
0671878484___0.html
fixme:wininet:InternetSetOptionExW Flags 00000000 ignored
fixme:wininet:InternetSetOptionW Option INTERNET_OPTION_CONNECT_RETRIES: STUB
Finalizing... done.
After some modification I was able to get compilebook.pl to run, but the problem with HTML2LRF meant that I got a file with a title page and 53 blank pages. It may not be accidental that this particular book has 53 html files.

BBeBook looks promising, but it's not at all clear how to use it. I echo the request of several others on this thread -- please, someone who is a Java developer, can you tell us what is necessary to make this thing work? I say a Java *developer*, since all the documentation for all things Java seems to assume you are a Java developer (don't get me started on my Tomcat rant....)
unkilbeeg is offline   Reply With Quote
Old 01-02-2007, 12:07 PM   #37
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
https://www.mobileread.com/forums/showthread.php?t=8575
kovidgoyal is offline   Reply With Quote
Old 01-02-2007, 03:56 PM   #38
scotty1024
Banned
scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.
 
Posts: 1,300
Karma: 1479
Join Date: Jul 2006
Location: Peoples Republic of Washington
Device: Reader / iPhone / Librie / Kindle
Sorry folks, I hadn't seen this thread in awhile and no one PM'd me about the issues...

The zip comes with compiled Java .class files, but they are compiled for Java 5 and will not work on a prior Java version such as 1.4.2.

The code works with PDFBox 7.1 or 7.2. I haven't tried it with 7.3.

I'm bundling up the xpp3 and jpedal into a zip and attaching them.

I'll have a look at the Python code and see what kind of command line some folks like. It should be possible to remove the dependency upon Python.
Attached Files
File Type: zip libs.zip (946.7 KB, 551 views)
scotty1024 is offline   Reply With Quote
Old 01-02-2007, 06:42 PM   #39
scotty1024
Banned
scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.
 
Posts: 1,300
Karma: 1479
Join Date: Jul 2006
Location: Peoples Republic of Washington
Device: Reader / iPhone / Librie / Kindle
Just as a status update, I'm assembling version 0.2 of BBeBook.

Implements more command line options (compatible with the Python shell).
Adds switch to rasterize PDF files (convert them into a "picture book").
Comes in a all-in-one JAR file that can be double clicked on Windows or Mac OS X which will run a GUI interface allowing book binding.
Comes with bash/WinXP scripts to compile it and run it from the command line.
scotty1024 is offline   Reply With Quote
Old 01-03-2007, 04:20 PM   #40
scotty1024
Banned
scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.
 
Posts: 1,300
Karma: 1479
Join Date: Jul 2006
Location: Peoples Republic of Washington
Device: Reader / iPhone / Librie / Kindle
Here is the .2 version.

I had to break it into two files so I could upload it.

BBeBook-0.2.jar.tar.bz2 contains the java all-in-one JAR file, which can be double clicked like an .exe file to run the application in GUI mode.

BBeBook-0.2.tar.bz2 contains all of the source, 3rd party files and scripts required to build the JAR file.

Version 0.2 requires Java 5 (j2sdk 1.5.0) or later to run. It will not compile under j2sdk 1.4.2 or earlier.

The code has been slightly re-factored and optimized from .1 and the command line supports passing a -r or --raster option to render a PDF file into an LRF as pictures. The -t --title -a --author --thumbnail command line switches from the python shell have been added as well.

I'm still working on converting it to native Sony Reader, it still assumes the screen is 800x600.

Enjoy.
Attached Files
File Type: bz2 BBeBook-0.2.jar.tar.bz2 (3.88 MB, 658 views)
File Type: bz2 BBeBook-0.2.tar.bz2 (3.64 MB, 808 views)
scotty1024 is offline   Reply With Quote
Old 01-03-2007, 05:31 PM   #41
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Processing of commandline options seems a little buggy
For e.g:
Code:
java -jar /home/kovid/download/BBeBook-0.2.jar  Te\ st.html
Error loading LRF file: te st.html message: te st.html (No such file or directory)
java.io.FileNotFoundException: te st.html (No such file or directory)
        at java.io.FileInputStream.open(Native Method)
        at java.io.FileInputStream.<init>(FileInputStream.java:106)
        at HtmlParser.readWholeFile(HtmlParser.java:80)
        at HtmlParser.<init>(HtmlParser.java:70)
        at BBeBook.parseHTML(BBeBook.java:1616)
        at BBeBook.makeBookFromHtml(BBeBook.java:654)
        at BBeBook.makeBook(BBeBook.java:600)
        at BBeBook.main(BBeBook.java:292)
or
Code:
java -jar /home/kovid/download/BBeBook-0.2.jar -t 'test title' test.html
WARNING: Book Label not supplied, setting to 'UNKNOWN'.
Exception in thread "main" java.io.FileNotFoundException:  (No such file or directory)
        at java.io.FileOutputStream.open(Native Method)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:179)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:131)
        at BBeBook.write(BBeBook.java:755)
        at BBeBook.makeBookFromHtml(BBeBook.java:658)
        at BBeBook.makeBook(BBeBook.java:600)
        at BBeBook.main(BBeBook.java:292)
or
Code:
java -jar /home/kovid/download/BBeBook-0.2.jar test.html
Error loading LRF file: image.gif message: image.gif (No such file or directory)
java.io.FileNotFoundException: image.gif (No such file or directory)
        at java.io.FileInputStream.open(Native Method)
        at java.io.FileInputStream.<init>(FileInputStream.java:106)
        at BBeBook.readWholeFile(BBeBook.java:1091)
        at BBeBook.writeBookToFile(BBeBook.java:965)
        at BBeBook.makeBookFromHtml(BBeBook.java:657)
        at BBeBook.makeBook(BBeBook.java:600)
        at BBeBook.main(BBeBook.java:292)
I believe image.gif is the file that's supposed to have the thumbnail?
kovidgoyal is offline   Reply With Quote
Old 01-03-2007, 07:18 PM   #42
scotty1024
Banned
scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.
 
Posts: 1,300
Karma: 1479
Join Date: Jul 2006
Location: Peoples Republic of Washington
Device: Reader / iPhone / Librie / Kindle
Spaces in command line arguments are indeed problematical. I'll see if I can find any easy fix for the next version.

image.gif is the default icon. The next version will use a Java resource API to supply it. For now you need to have image.gif lying around in the current directory or explicitly specify one.
scotty1024 is offline   Reply With Quote
Old 01-03-2007, 08:08 PM   #43
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You could use something like CLI
http://jakarta.apache.org/commons/cli/

Also setting the title on the command line doesn't seem to work
Code:
java -jar /home/kovid/download/BBeBook-0.2.jar -t'test title' test.html && lrf-meta test.html.lrf | grep Title
Title: test.html
Ditto for author
Code:
java -jar /home/kovid/download/BBeBook-0.2.jar -a'test author' test.html && lrf-meta test.html.lrf | grep Author
Author: Unknown Author

Last edited by kovidgoyal; 01-03-2007 at 08:12 PM.
kovidgoyal is offline   Reply With Quote
Old 01-03-2007, 10:47 PM   #44
scotty1024
Banned
scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.
 
Posts: 1,300
Karma: 1479
Join Date: Jul 2006
Location: Peoples Republic of Washington
Device: Reader / iPhone / Librie / Kindle
You need a space between the switch and its argument, but not one in the argument.

Code:
java -jar /home/kovid/download/BBeBook-0.2.jar -a 'testauthor' test.html
scotty1024 is offline   Reply With Quote
Old 01-04-2007, 12:24 AM   #45
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
One final (I hope) problem with command line options. BBeBook lowercases the input filename when deriving the output filename, for e.g.
Code:
java -jar /home/kovid/download/BBeBook-0.2.jar  Test.html && ls *.lrf
test.html.lrf
Is this intentional? Or will it be fixed in a future version. I'm asking all these questions because I'm planning to integrate BBeBook into libprs500 and I need a stable commandline interface.

Thanks,

Kovid.

EDIT: Here's a modified makeBook function that fixes the lowercasing
Code:
// Process command line arguments
        for (int i=0; i < args.length; i++) {
            String oarg = args[i].trim();
            String arg = oarg.toLowerCase();
            if ("-t".equals(arg) || "--title".equals(arg)) {
                bookTitle.setLength(0);
                bookTitle.append(args[i+1]);
            } else if ("-a".equals(arg) || "--author".equals(arg)) {
                bookAuthor.setLength(0);
                bookAuthor.append(args[i+1]);
            } else if ("-r".equals(arg) || "--raster".equals(arg)) {
                rasterize = true;
            } else if ("--thumbnail".equals(arg)) {
                bookIconName.setLength(0);
                bookIconName.append(args[i+1]);
            } else {
                if (arg.endsWith(".pdf")) {
                    makeBookFromPdf(oarg, rasterize);
                    break;
                } else if (arg.endsWith(".html") || arg.endsWith(".htm")) {
                    makeBookFromHtml(oarg);
                    break;
                } else if (arg.endsWith(".xml")) {
                    makeBookFromXmlConfig(oarg);
                    break;
                }

            }
        }

Last edited by kovidgoyal; 01-04-2007 at 03:22 AM.
kovidgoyal is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
HTML2LRF and inline pictures pepak Calibre 12 02-04-2009 12:12 PM
chaining web2disk to html2lrf beowulf573 Calibre 2 11-19-2008 04:48 PM
Bookdesigner problem vs. html2lrf alophind Sony Reader 7 02-04-2008 12:20 PM
PRS-500 Need help with Html2Lrf (screen attached) alophind Sony Reader Dev Corner 14 02-01-2008 03:56 AM
html2lrf vs rtf2lrf paspas Sony Reader 0 11-18-2007 02:35 PM


All times are GMT -4. The time now is 05:01 PM.


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