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

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

Notices

Reply
 
Thread Tools Search this Thread
Old 04-14-2008, 01:17 PM   #1
hal9000
Enthusiast
hal9000 doesn't litterhal9000 doesn't litterhal9000 doesn't litter
 
hal9000's Avatar
 
Posts: 35
Karma: 230
Join Date: Feb 2008
Device: Airis Dbook (with booq Classic OS 2.2)
Software: LRF TOC Editor v1.10


What is "LRF TOC Editor"?

Usually, when a LRF file for the SONY eReader is created, the TOC information is automatically added, but sometimes may happen that such information is not added, because the conversion tool doesn’t support it or because the source file doesn’t have a TOC, or may be that the TOC information is added but it’s incorrect or there are more or less entries that it should. In these cases "LRF TOC Editor" can open the existing LRF file, without the need to have the source file from which it was created, and then add, remove, modify or sort the TOC entries as we want, and then save these changes to the same or other LRF file. In order to work, "LRF TOC Editor" need that the application Calibre (or its former version libprs500, by Kovid Goyal, is installed on your system. It can be downloaded from http://calibre-ebook.com/. If this application is not found in its default folder, a folder selection dialog will appear to search for it.


The user interface

In the top area of the window there are two buttons to load and save a LRF, a button to change the language between English and Spanish, a help and a checkbox to control whether the text should be displayed using the book styles or using the default text style.

Under the buttons there are the two main panels. The one to the left is the TOC panel and the one to the right is the text panel.

Finally under the TOC panel there are the buttons to move the TOC entries, rename them, remove them and add new ones.


How does "LRF TOC Editor" work?

Once a LRF file has been loaded we can perform the following actions:
  • move the current entry up or down, using the arrow buttons under the TOC panel or pressing on the keyboard the shift key at the same time than the up or down arrow keys while the TOC panel is active
  • rename the current entry, using the button with the edition icon under the TOC panel or pressing the F2 key on the keyboard while the TOC panel is active
  • remove the current entry, using the button with a red X under the TOC panel or pressing the delete key on the keyboard while the TOC panel is active
  • add a new TOC entry pointing to the text selected on the text panel, using the button with a green + under the TOC panel or pressing the shift key at the same time than the enter key while the text panel is active; a new entry can only be added pointing to a text fragment which is not already assigned to another TOC entry
  • go to the text fragment pointed by a TOC entry, clicking on that entry or moving across the TOC with the keyboard
  • go to the corresponding TOC entry for a text fragment, right clicking on a currently assigned text fragment on the text panel, or pressing the space key while the text panel is active
  • assign the current text fragment to the current TOC entry, right clicking on a currently unassigned text fragment on the text panel, or pressing the space key while the text panel is active; by doing this the text fragment previously pointed by the TOC entry is released and that TOC entry will point now to the new text fragment

When a TOC entry is renamed the current name will be displayed so we can modify it, and when a TOC entry is created or pointed to a new text position a fragment of the text on that position will be displayed as suggestion for the name.

The added or modified TOC entries will be displayed in green. Sometimes a TOC entry may be displayed in red, this means that this entry is pointed to an inexistent text position or it’s pointed to an object that "LRF TOC Editor" cannot handle (see "limitations" section).


"LRF TOC Editor" limitations
  • There cannot be two or more entries in the TOC pointing to the same text position
  • When a text block or page is too long, there may be visualization problems in the text panel at the end of that block or page, in that cases it's necessary to view text without styles and may be use short text too
  • When viewing without styles the images and the canvas contents are not displayed
  • Even when the view with styles is enabled, what is shown by the application does not always match 100% what is shown in the actual device, mainly on for some margins, spacing and font sizes
  • The libprs500/Calibre version equal or older to 0.4.50 doesn’t preserve the special characters in the TOC entries, such as accentuated characters; if when opening a previously saved LRF you observe that this kind of characters have disappeared you’ll need to replace them with the equivalent standard characters, such as the equivalent unaccentuated characters; this problem has been fixed on Calibre 0.4.51
  • The load time for some documents is too long, I know it; may be some day I have the time to optimize it, or may be not


Acknowledgements

As said above, "LRF TOC Editor" need that the application Calibre, by Kovid Goyal, is installed in order to work. I want to thank Kovid for create Calibre and all the set of conversion tools which are part of it. I also want to thank him for bear my tickets about bugs and mainly the tickets asking for new program features. ;-)


Change log
  • v1.10 (07/Jan/10):
    • added: show the cover thumbnail for the loaded file
    • added: support for additional styles within a text block, instead applying an unique style to the whole block, thus allowing a representation closer to the one on the PRS screen
    • added: support for "<canvas>" blocks; now images will be displayed
    • added: "Calibre - E-book Management" and "Calibre2" paths to the possible default locations of Calibre
    • added: navigation through pages using CTRL+PagUp/PagDown and CTRL+Home/End
    • removed: page and object number for each item in TOC and text panels
    • removed: header row in TOC and text panels
    • changed: new color to highlight selected items
    • changed: icons for up and down buttons
    • changed: new TOC panel font for better visibility
    • changed: the way to show that a text panel item is linked to a TOC entry, showing a blue bar to its left, along the full height of the item, instead showing a checked box
    • changed: the way to select the TOC entry linked to a text panel item or to assign a text panel item to the current TOC entry, right-clicking with the mouse on the text panel item instead clicking on the corresponding checkbox
    • changed: now there are three visualization modes (full text with styles, full text without styles and short text without styles)
    • changed: dialogs for add/rename/reassign TOC entries so the operation can be cancelled
    • changed: use of external DLL for keyboard and mouse events control, as the standard method fails with the control type used for the text panel
    • fixed: problem with long names and with detection of the end of conversion process, which prevents the application from working on Windows XP
    • fixed: now if the text have an special color for its status, as for example a modified item, the color is preserved when the item is selected, changing its background color only
    • fixed: sometimes the available action buttons were displayed incorrectly for the current selected item
    • fixed: scroll position change on TOC panel when an entry is removed
    • fixed: sometimes there could be problems with files containing special characters in it's name; now the work is made with a renamed copy of the file
  • v1.02 (07/may/08): internal fixings to improve stability
  • v1.01 (03/may/08): modification to reflect the name change of libprs500 to Calibre, and to allow the application to find Calibre files on its default folder
  • v1.00 (27/apr/08): initial release

Contact

For any question, doubts or suggestion, use the following links:

. in English:
https://www.mobileread.com/forums/showthread.php?t=22823

. in Spanish:
http://www.todoumpc.com/forum/forum_posts.asp?TID=5322

____________________

"LRF TOC Editor" is free software and it can be distributed freely as long as the author and the above contact links are mentioned.
Attached Files
File Type: rar LRF TOC Editor v1.10.rar (122.4 KB, 1457 views)

Last edited by hal9000; 01-07-2010 at 09:50 AM. Reason: Application update
hal9000 is offline   Reply With Quote
Old 04-17-2008, 11:00 AM   #2
mdhuang
Bookworm
mdhuang doesn't littermdhuang doesn't litter
 
mdhuang's Avatar
 
Posts: 113
Karma: 154
Join Date: Aug 2007
Device: Sony CLIE NX80V, PRS-500
Thank you for your efforts!
That's something I have been looking for. I downloaded many LRF files from the net and often times found that the TOC is missing or incomplete. Sometimes I manually decomplile it and edit it but it is too time consuming. A GUI based tool will be an ideal solution.

Quote:
Originally Posted by hal9000 View Post
Hi.

When I create LRF file with libprs500, I often get the LRF without TOC or with a TOC which includes footnotes, or any other problems related to the TOC, so I was looking for a way to modify these LRF files to edit and fix the TOC, but as far as I know, currently there is no way to edit the TOC of an existent LRF file.

I got disappointed at first, but then I decided that if the application didn't exist I will create it, and that's what I'm doing. "LRF TOC Editor" can take an LRF, show you the content and the TOC and let you add/remove TOC entries, rename them and change the location they links to.

The application works in Windows, it's programmed in VB.NET and relies on "lrf2lrs" and "lrs2lrf", which are part of libprs500 (by Kovid Goyal) to decompile the original LRF file and recompile it once the changes are made.

It has limitations too:
• there cannot exist two or more entries in the TOC linking to the same location
• only <textblock> placed directly inside a <page> will be shown, no <canvas> nor <textblock> inside other containers (at least in the first version)
• when you select to show the content with it's original style only the style of the whole textblock is applied, ignoring substyles used locally inside the textblock

Anyway I think it results very usable even with these limitations. I hope to have it finished soon and that you find it useful... I will.
mdhuang is offline   Reply With Quote
Old 04-27-2008, 10:11 AM   #3
hal9000
Enthusiast
hal9000 doesn't litterhal9000 doesn't litterhal9000 doesn't litter
 
hal9000's Avatar
 
Posts: 35
Karma: 230
Join Date: Feb 2008
Device: Airis Dbook (with booq Classic OS 2.2)
Ok, I finished it at last.

You can download "LRF TOC Editor" from the first post on this thread, there is a copy of the readme too, with info about the application.

I hope you find it useful.

------

P.S.: By the way, can a moderator change the thread title to "Software: LRF TOC Editor v1.0" please?

Last edited by hal9000; 04-27-2008 at 10:15 AM.
hal9000 is offline   Reply With Quote
Old 04-27-2008, 11:15 AM   #4
hal9000
Enthusiast
hal9000 doesn't litterhal9000 doesn't litterhal9000 doesn't litter
 
hal9000's Avatar
 
Posts: 35
Karma: 230
Join Date: Feb 2008
Device: Airis Dbook (with booq Classic OS 2.2)
Oops... Sorry, the first file I uploaded was wrong. I changed it, the correct one have the suffix "_fixed".

Last edited by hal9000; 04-27-2008 at 11:44 AM.
hal9000 is offline   Reply With Quote
Old 04-27-2008, 09:07 PM   #5
harpum
Enthusiast
harpum began at the beginning.
 
Posts: 47
Karma: 24
Join Date: Jan 2007
Device: Axim 51v/LG chocolate
Thank you for making a TOC editing tool.
I have some LRF files from pdflrf. But I cannot use it for these files. I think the reason is these files only contains PNG file.
Can you add some functions for these files.
Thanks again.^^

Last edited by harpum; 04-27-2008 at 09:08 PM. Reason: mistake
harpum is offline   Reply With Quote
Old 04-27-2008, 10:18 PM   #6
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,657
Karma: 127838196
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
I've made the thread a sticky for easier finding.

Thank you for the ToC editor.
JSWolf is offline   Reply With Quote
Old 04-28-2008, 03:53 AM   #7
hal9000
Enthusiast
hal9000 doesn't litterhal9000 doesn't litterhal9000 doesn't litter
 
hal9000's Avatar
 
Posts: 35
Karma: 230
Join Date: Feb 2008
Device: Airis Dbook (with booq Classic OS 2.2)
Quote:
Originally Posted by JSWolf View Post
I've made the thread a sticky for easier finding.

Thank you for the ToC editor.
Thanks JSWolf. Could you please change the "Work in progress:" to "Software:" in the thread title. I changed it in the first message, but for the thread is still the same.
hal9000 is offline   Reply With Quote
Old 04-28-2008, 03:56 AM   #8
hal9000
Enthusiast
hal9000 doesn't litterhal9000 doesn't litterhal9000 doesn't litter
 
hal9000's Avatar
 
Posts: 35
Karma: 230
Join Date: Feb 2008
Device: Airis Dbook (with booq Classic OS 2.2)
Quote:
Originally Posted by harpum View Post
Thank you for making a TOC editing tool.
I have some LRF files from pdflrf. But I cannot use it for these files. I think the reason is these files only contains PNG file.
Can you add some functions for these files.
Thanks again.^^
Well, this version only supports text and even that is supported with some restrictions. May be the next version could support <canvas> blocks. I'll think of it.
hal9000 is offline   Reply With Quote
Old 05-03-2008, 09:36 AM   #9
hal9000
Enthusiast
hal9000 doesn't litterhal9000 doesn't litterhal9000 doesn't litter
 
hal9000's Avatar
 
Posts: 35
Karma: 230
Join Date: Feb 2008
Device: Airis Dbook (with booq Classic OS 2.2)
I updated LRF TOC Editor to version 1.01 just to reflect the name change of libprs500 to calibre, and to allow the application to locate calibre on its default folder. The file can be downloaded from the first post on this thread.
hal9000 is offline   Reply With Quote
Old 05-07-2008, 01:17 PM   #10
hal9000
Enthusiast
hal9000 doesn't litterhal9000 doesn't litterhal9000 doesn't litter
 
hal9000's Avatar
 
Posts: 35
Karma: 230
Join Date: Feb 2008
Device: Airis Dbook (with booq Classic OS 2.2)
I updated "LRF TOC Editor" to version 1.02. No new features has been added, just some internal fixings to improve stability. The file can be downloaded in the first post of this thread.
hal9000 is offline   Reply With Quote
Old 05-08-2008, 02:53 AM   #11
Lime2K
Member
Lime2K began at the beginning.
 
Lime2K's Avatar
 
Posts: 21
Karma: 10
Join Date: May 2007
Device: Sony Reader (PRS-500)
Wow! Thank you so much for this awesome tool! It definitely falls into the 'I didn't realize how awesome of a tool this would be until I had it' category.

If I had some extra money, I'd send you some ^_^.

(Now, the first person who makes a tool to add images to a LRF file, I will officially love you forever!)
Lime2K is offline   Reply With Quote
Old 06-09-2008, 06:13 AM   #12
hal9000
Enthusiast
hal9000 doesn't litterhal9000 doesn't litterhal9000 doesn't litter
 
hal9000's Avatar
 
Posts: 35
Karma: 230
Join Date: Feb 2008
Device: Airis Dbook (with booq Classic OS 2.2)
Next version coming

I'm working on the next version of LRF TOC Editor. At the moment of writing this post this is the change log for it:

Quote:
v1.03 (--/---/08):
  • added: show the cover thumbnail for the loaded file
  • added: navigation through pages using CTRL+PagUp/PagDown and CTRL+Home/End
  • added: support for additional styles within a text block, instead applying an unique style to the whole block, thus allowing a representation closer to the one on the PRS screen
  • removed: page and object number for each item in TOC and text panels
  • removed: header row in TOC and text panels
  • changed: new color to highlight selected items
  • changed: icons for up and down buttons
  • changed: new TOC panel font for better visibility
  • changed: the way to show that a text panel item is linked to a TOC entry, showing a blue bar to its left, along the full height of the item, instead showing a checked box
  • changed: the way to select the TOC entry linked to a text panel item or to assign a text panel item to the current TOC entry, right-clicking with the mouse on the text panel item instead clicking on the corresponding checkbox
  • changed: use of external DLL for keyboard and mouse events control, as the standard method fails with the control type used for the text panel
  • changed: dialogs for add/rename/reassign TOC entries so the operation can be cancelled
  • changed: now there are three visualization modes (full text with styles, full text without styles and short text without styles)
  • fixed: scroll position change on TOC panel when an entry is removed
  • fixed: now if the text have an special color for its status, as for example a modified item, the color is preserved when the item is selected, changing its background color only
  • fixed: sometimes the available action buttons were displayed incorrectly for the current selected item
I hope to have it finished soon. Anyway the change log still may grow, so I'm thinking of give it version number 1.1 instead 1.03.
hal9000 is offline   Reply With Quote
Old 06-10-2008, 01:01 AM   #13
lionfish
Connoisseur
lionfish doesn't litterlionfish doesn't litter
 
Posts: 54
Karma: 146
Join Date: Mar 2008
Device: E-Book Reader
Hi, Hal9000:

Can this TOC editor expand to a complete LRF editor, i.e. can edit the content?

My reason is I have some LRF books but after reading I found some typing errors in them. There are two ways to fix it. This first is to fix the source text if I have and convert to LRF format. The second is to reverse it to LRS format, then manually fix it and convert back to LRF format.
lionfish is offline   Reply With Quote
Old 06-10-2008, 03:55 AM   #14
hal9000
Enthusiast
hal9000 doesn't litterhal9000 doesn't litterhal9000 doesn't litter
 
hal9000's Avatar
 
Posts: 35
Karma: 230
Join Date: Feb 2008
Device: Airis Dbook (with booq Classic OS 2.2)
Quote:
Originally Posted by lionfish View Post
Hi, Hal9000:

Can this TOC editor expand to a complete LRF editor, i.e. can edit the content?

My reason is I have some LRF books but after reading I found some typing errors in them. There are two ways to fix it. This first is to fix the source text if I have and convert to LRF format. The second is to reverse it to LRS format, then manually fix it and convert back to LRF format.
I know what you say, I have some LRF that would need to be fixed too. As for the application, well, I have enough difficulties just trying to make it work as I want, so it will remain a TOC editor by now. But who knows? May be a future version allow some kind of content editing.
hal9000 is offline   Reply With Quote
Old 06-10-2008, 12:49 PM   #15
Dr. Drib
Grand Sorcerer
Dr. Drib ought to be getting tired of karma fortunes by now.Dr. Drib ought to be getting tired of karma fortunes by now.Dr. Drib ought to be getting tired of karma fortunes by now.Dr. Drib ought to be getting tired of karma fortunes by now.Dr. Drib ought to be getting tired of karma fortunes by now.Dr. Drib ought to be getting tired of karma fortunes by now.Dr. Drib ought to be getting tired of karma fortunes by now.Dr. Drib ought to be getting tired of karma fortunes by now.Dr. Drib ought to be getting tired of karma fortunes by now.Dr. Drib ought to be getting tired of karma fortunes by now.Dr. Drib ought to be getting tired of karma fortunes by now.
 
Dr. Drib's Avatar
 
Posts: 44,712
Karma: 55613375
Join Date: Jan 2007
Location: Peru
Device: Kindle: Oasis 3, Voyage WiFi; Kobo: Libra 2, Aura One
"The Appliciation failed to initialize properly. 0xC000013."


I have the required calibre 0.4.56 and that program's working fine. (At this particular moment, I don't plan to upgrade to the current version of calibre, as this version is working fine and I'm continuing to play with it.)

Any suggestions, anyone about getting TOC to work?

Thanks,
Don
Dr. Drib 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
Sigil Toc editor Enesco Sigil 16 09-23-2010 06:41 AM
How does the TOC editor work? Kivgaen Sigil 31 06-25-2010 10:28 AM
Problem with TOC editor alecE Sigil 2 10-29-2009 01:30 AM
Making a TOC for LRFs? Issues with Calibre + LRF TOC editor not working Magitek LRF 0 05-06-2009 01:25 PM
TOC in LRF sAGV Sony Reader 14 12-18-2007 10:50 AM


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


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