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 04-30-2009, 09:41 PM   #181
alxwang
Connoisseur
alxwang began at the beginning.
 
Posts: 96
Karma: 14
Join Date: Mar 2009
Device: Kindle DX, PocketBook 360
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
alxwang is offline   Reply With Quote
Old 05-01-2009, 02:56 PM   #182
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 alxwang View Post
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 is offline   Reply With Quote
Advert
Old 05-01-2009, 03:11 PM   #183
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 v0.9.209

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)
elinares is offline   Reply With Quote
Old 05-01-2009, 04:48 PM   #184
alxwang
Connoisseur
alxwang began at the beginning.
 
Posts: 96
Karma: 14
Join Date: Mar 2009
Device: Kindle DX, PocketBook 360
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

Last edited by alxwang; 05-01-2009 at 04:51 PM.
alxwang is offline   Reply With Quote
Old 05-01-2009, 04:52 PM   #185
alxwang
Connoisseur
alxwang began at the beginning.
 
Posts: 96
Karma: 14
Join Date: Mar 2009
Device: Kindle DX, PocketBook 360
The picture name works awesome!!!
Thanks a lot!
alxwang is offline   Reply With Quote
Advert
Old 05-01-2009, 05:28 PM   #186
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 alxwang View Post
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 is offline   Reply With Quote
Old 05-01-2009, 05:47 PM   #187
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
TTF to TTC Tool

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.
elinares is offline   Reply With Quote
Old 05-01-2009, 10:43 PM   #188
alxwang
Connoisseur
alxwang began at the beginning.
 
Posts: 96
Karma: 14
Join Date: Mar 2009
Device: Kindle DX, PocketBook 360
It works with Chinese now. Really nice.
One more question: you embed the font in PDF or?
Thanks for this nice tool. Really useful.
alxwang is offline   Reply With Quote
Old 05-02-2009, 04:57 AM   #189
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 alxwang View Post
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...
elinares is offline   Reply With Quote
Old 05-02-2009, 12:09 PM   #190
alxwang
Connoisseur
alxwang began at the beginning.
 
Posts: 96
Karma: 14
Join Date: Mar 2009
Device: Kindle DX, PocketBook 360
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
alxwang is offline   Reply With Quote
Old 05-02-2009, 07:34 PM   #191
patricks
Junior Member
patricks began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Jan 2009
Device: none (iread?)
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?

Last edited by patricks; 05-02-2009 at 09:19 PM.
patricks is offline   Reply With Quote
Old 05-03-2009, 08:29 AM   #192
patricks
Junior Member
patricks began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Jan 2009
Device: none (iread?)
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)
patricks is offline   Reply With Quote
Old 05-03-2009, 08:47 AM   #193
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,887
Karma: 128597114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Are you sure you have the correct version of Java installed?
JSWolf is offline   Reply With Quote
Old 05-03-2009, 10:28 AM   #194
patricks
Junior Member
patricks began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Jan 2009
Device: none (iread?)
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).

Last edited by patricks; 05-03-2009 at 12:52 PM.
patricks is offline   Reply With Quote
Old 05-06-2009, 02:47 PM   #195
ericshliao
Guru
ericshliao will become famous soon enoughericshliao will become famous soon enoughericshliao will become famous soon enoughericshliao will become famous soon enoughericshliao will become famous soon enoughericshliao will become famous soon enough
 
Posts: 976
Karma: 687
Join Date: Nov 2007
Device: Dell X51v; iLiad v2
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:
Code:
		</div>
		<div align="Justify">
That's not an elegant way.

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.
Attached Thumbnails
Click image for larger version

Name:	sample.PNG
Views:	402
Size:	68.3 KB
ID:	28528  
Attached Files
File Type: txt test.html.txt (1.5 KB, 396 views)

Last edited by ericshliao; 05-07-2009 at 09:45 AM.
ericshliao 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 08:20 PM.


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