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

Go Back   MobileRead Forums > E-Book Formats > Other formats > LRF

Notices

Reply
 
Thread Tools Search this Thread
Old 01-20-2009, 02:31 PM   #106
yargoflick
Enthusiast
yargoflick is on a distinguished road
 
yargoflick's Avatar
 
Posts: 31
Karma: 60
Join Date: Mar 2007
Location: Newfoundland, Canada
Device: Sony Reader
Quote:
Originally Posted by rogue_ronin View Post
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:
Code:
#!/bin/bash
xterm -hold -e "$@"
Then you want to make the script executable:
Code:
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:
Code:
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.

Last edited by yargoflick; 01-20-2009 at 02:39 PM.
yargoflick is offline   Reply With Quote
Old 01-21-2009, 12:15 AM   #107
lionfish
Connoisseur
lionfish doesn't litterlionfish doesn't litter
 
Posts: 54
Karma: 146
Join Date: Mar 2008
Device: E-Book Reader
Quote:
Originally Posted by rogue_ronin View Post
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.
lionfish is offline   Reply With Quote
Old 01-21-2009, 05:07 AM   #108
Gudy
Guru
Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.
 
Gudy's Avatar
 
Posts: 765
Karma: 1458681
Join Date: Jan 2008
Location: Germany
Device: Pocketbook Touch Lux (623)
Quote:
Originally Posted by lionfish View Post
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...
Gudy is offline   Reply With Quote
Old 01-21-2009, 05:44 AM   #109
elinares
Xtreme Quijote
elinares doesn't litterelinares doesn't litterelinares doesn't litter
 
elinares's Avatar
 
Posts: 101
Karma: 208
Join Date: Sep 2008
Location: La Mancha, Spain
Device: Sony PRS-505
Quote:
Originally Posted by Gudy View Post
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
elinares is offline   Reply With Quote
Old 01-23-2009, 12:52 AM   #110
rogue_ronin
Banned
rogue_ronin has learned how to read e-booksrogue_ronin has learned how to read e-booksrogue_ronin has learned how to read e-booksrogue_ronin has learned how to read e-booksrogue_ronin has learned how to read e-booksrogue_ronin has learned how to read e-booksrogue_ronin has learned how to read e-books
 
Posts: 475
Karma: 796
Join Date: Sep 2008
Location: Honolulu
Device: Nokia 770 (fbreader)
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
rogue_ronin is offline   Reply With Quote
Old 02-02-2009, 05:15 PM   #111
mwestmr
Junior Member
mwestmr began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Feb 2009
Device: iphone
Quotes and other characters with -EPUB (works with -XML)

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.
mwestmr is offline   Reply With Quote
Old 02-06-2009, 12:48 PM   #112
elinares
Xtreme Quijote
elinares doesn't litterelinares doesn't litterelinares doesn't litter
 
elinares's Avatar
 
Posts: 101
Karma: 208
Join Date: Sep 2008
Location: La Mancha, Spain
Device: Sony PRS-505
Quote:
Originally Posted by mwestmr View Post
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 is offline   Reply With Quote
Old 02-08-2009, 02:00 PM   #113
elinares
Xtreme Quijote
elinares doesn't litterelinares doesn't litterelinares doesn't litter
 
elinares's Avatar
 
Posts: 101
Karma: 208
Join Date: Sep 2008
Location: La Mancha, Spain
Device: Sony PRS-505
New version 0.9.175

Uploaded to google code. Please look first post.
elinares is offline   Reply With Quote
Old 02-28-2009, 05:09 PM   #114
hybernation
Enthusiast
hybernation began at the beginning.
 
Posts: 26
Karma: 38
Join Date: Jan 2008
Location: Franklin, TN USA
Device: iPad, iPhone, Kindle 2 US, Sony PR-505
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

Last edited by hybernation; 02-28-2009 at 05:44 PM.
hybernation is offline   Reply With Quote
Old 03-01-2009, 05:38 AM   #115
rcuadro
Wizard
rcuadro ought to be getting tired of karma fortunes by now.rcuadro ought to be getting tired of karma fortunes by now.rcuadro ought to be getting tired of karma fortunes by now.rcuadro ought to be getting tired of karma fortunes by now.rcuadro ought to be getting tired of karma fortunes by now.rcuadro ought to be getting tired of karma fortunes by now.rcuadro ought to be getting tired of karma fortunes by now.rcuadro ought to be getting tired of karma fortunes by now.rcuadro ought to be getting tired of karma fortunes by now.rcuadro ought to be getting tired of karma fortunes by now.rcuadro ought to be getting tired of karma fortunes by now.
 
rcuadro's Avatar
 
Posts: 1,688
Karma: 874275
Join Date: Nov 2008
Location: Virginia Beach, VA
Device: Kindle DX
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 is offline   Reply With Quote
Old 03-01-2009, 05:40 AM   #116
rcuadro
Wizard
rcuadro ought to be getting tired of karma fortunes by now.rcuadro ought to be getting tired of karma fortunes by now.rcuadro ought to be getting tired of karma fortunes by now.rcuadro ought to be getting tired of karma fortunes by now.rcuadro ought to be getting tired of karma fortunes by now.rcuadro ought to be getting tired of karma fortunes by now.rcuadro ought to be getting tired of karma fortunes by now.rcuadro ought to be getting tired of karma fortunes by now.rcuadro ought to be getting tired of karma fortunes by now.rcuadro ought to be getting tired of karma fortunes by now.rcuadro ought to be getting tired of karma fortunes by now.
 
rcuadro's Avatar
 
Posts: 1,688
Karma: 874275
Join Date: Nov 2008
Location: Virginia Beach, VA
Device: Kindle DX
Ooops... I dont know how to delete duplicate messages...

Last edited by rcuadro; 03-01-2009 at 05:44 AM.
rcuadro is offline   Reply With Quote
Old 03-01-2009, 12:48 PM   #117
elinares
Xtreme Quijote
elinares doesn't litterelinares doesn't litterelinares doesn't litter
 
elinares's Avatar
 
Posts: 101
Karma: 208
Join Date: Sep 2008
Location: La Mancha, Spain
Device: Sony PRS-505
Quote:
Originally Posted by rcuadro View Post
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 is offline   Reply With Quote
Old 03-01-2009, 12:54 PM   #118
elinares
Xtreme Quijote
elinares doesn't litterelinares doesn't litterelinares doesn't litter
 
elinares's Avatar
 
Posts: 101
Karma: 208
Join Date: Sep 2008
Location: La Mancha, Spain
Device: Sony PRS-505
Quote:
Originally Posted by hybernation View Post
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:

Code:
	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.
elinares is offline   Reply With Quote
Old 03-01-2009, 07:30 PM   #119
hybernation
Enthusiast
hybernation began at the beginning.
 
Posts: 26
Karma: 38
Join Date: Jan 2008
Location: Franklin, TN USA
Device: iPad, iPhone, Kindle 2 US, Sony PR-505
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.
hybernation is offline   Reply With Quote
Old 03-02-2009, 02:37 AM   #120
rcuadro
Wizard
rcuadro ought to be getting tired of karma fortunes by now.rcuadro ought to be getting tired of karma fortunes by now.rcuadro ought to be getting tired of karma fortunes by now.rcuadro ought to be getting tired of karma fortunes by now.rcuadro ought to be getting tired of karma fortunes by now.rcuadro ought to be getting tired of karma fortunes by now.rcuadro ought to be getting tired of karma fortunes by now.rcuadro ought to be getting tired of karma fortunes by now.rcuadro ought to be getting tired of karma fortunes by now.rcuadro ought to be getting tired of karma fortunes by now.rcuadro ought to be getting tired of karma fortunes by now.
 
rcuadro's Avatar
 
Posts: 1,688
Karma: 874275
Join Date: Nov 2008
Location: Virginia Beach, VA
Device: Kindle DX
Quote:
Originally Posted by elinares View Post
Hi,
You must use Java 1.6...
It looks like I had to tell my Mac to use Java 1.6 lol...
rcuadro is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
A real PDF to epub/djvu/rtf/html software?. DsOft ePub 35 01-02-2011 03:57 PM
PRS-700 Unable to convert pdf to other formats (epub/rtf/doc) testndtv Sony Reader 1 09-24-2010 01:45 PM
How to create non-embedded Unicode EPUB,LRF,TXT,RTF,PDF alexmobile Sony Reader 1 09-23-2009 10:04 PM
Calibre PDF conversions - LRF/EPUB vs RTF jackie_w Calibre 14 09-22-2009 03:06 PM
[Old Thread] unable to convert ebooks(rtf, txt,lit,html,pdf) to lrf in calibre .4.131 jackdeth191 Calibre 9 05-02-2009 02:55 AM


All times are GMT -4. The time now is 02:15 PM.


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