View Full Version : Release : New Tool to Edit ePubs TOC, Edit with Sigil and keep you TOC


Nigol
01-21-2011, 11:45 PM
-------------------------------------------
Functionality
-------------------------------------------

The best way to use it is to add it to your Open With dialog (note that with multiple files selected, there seems to be a bug in windows that just opens the first book. But multiple Open With has been removed from Windows 7, or just put a link in the send to folder).

You can use the Open With plugin to easily open your file from calibre.

Table of Content Editor


Reorder chapters, nest chapters inside others chapter / book and create a multi-level Table of Content by dragging and dropping.

When dragging look for the black line to know where your chapters will be.
Drag a chapter on an other one until the destination chapter is all black, this will nest the chapters inside each other.

Remove unwanted entries, Add new ones based on files or Anchor already present in the files. The Add window will present you with a list of the top 5 lines inside the files (or inclosed with the Anchor Tags) for the Chapter Name.

You can also download chapters from the site kobobooks, when there is no suitable text found.
Clicking the Add button will add new entries at the bottom, right clicking will add the chapters below the chosen chapters).
You can also drag & drop files from the Add windows inside the Table of Content.

You can Mass Rename chapters by just typing a number when selecting the chapters, the will increment automatically.

You can also Convert number to Words (ie 1 --> One), It also works with Roman Numerals.
You can also use the special tag "%T", that will keep the previous text. (ex : You have a Chapter Named : Atlantis, Typing 1 - %T will change the name to 1 - Atlantis). Also if you have a Chapter 1 entry you can just type %T and Number To Words and it will change it to Chapter One.

Change the case of the chapters.
You can shift the source of chapters up or down (It will Remove any Anchors, pointing to the top of the page).
The program can cut your chapter to separate files, instead of multiple chapters per file.
Delete files from your book along with any associated entries in the OPF file. (Look in the Add windows).
Create an inline TOC from your Table of content.

This will check the guide portion of the opf for the "toc" item, and replace it with your new Content file. If this does not exist it will create one at the end, where you can place it where you want.
If you want to edit an existing one, you can use the Add window and the Set as Table of Content command, this will set the file and tell the program to replace this file. Or you can use Sigil and the "Add Semantic" button and Table of Content.




Reading Order Editor


Have you ever opened a book to find out the first page is at the end? You can reorder the order of the book pages or just remove some.
Using this will also remove any "linear" tags inside the books that makes some chapters appear at the end.
This will also recreate the file when there is no reference to you toc inside it, which makes some Table of Content unusable. (A message will popup tell you if it is the case.


Margin Fixer


This will change all the left and right margins value of the css file, while keeping the body tag to 5pt. It will also change any indent that are negative to 0 (Be careful because some books use margins, instead of indent and it could remove them).
An option in the setting menu will let you remove margins instead of zeroing them, usefull with the Kobo Touch when margins can not the modified in book. Use this to remove them and it will remove all margins from the body style.



Edit in Sigil


Sigil is great to cut chapters, Format the text or to correct some incorrectly cut files, but it is missing a very important function (at least before version v0.4 comes out). It does not keep the Table of Content that is already present. Using this the book will be opened with Sigil, and when closed (be sure to save the file at the same place) it will replace it with your old Table of Content, Updating the new files location. If you delete or add new Files be sure to also run the table of Content & Reading Order Editor after it. It will check for any files that are missing when opening and remove them, so just open it and save it again to remove entries.
You can also use any external exe, it will work also.


Cover Editor


Change the Cover without having to reconvert your file (Like calibre does)(Note that using this will convert your covers to SVG).

There is also a from folder button that will take the cover.jpg file that is next to the ePub (useful with calibre, where you can download a new cover, and change it by clicking from folder)

Resize the Cover so that it fits the screen of your eReader.

Note that this has been tested on the Kobo Touch, it resizes the cover in a way that will have the Kobo created a cover without borders, but it might look weird in other viewer like calibre, etc (because it forces a Screen of 800 X 600)
Update all will use the selected settings for all the book that where selected, useful too update multiple covers at once.
Note that if the Cover is not explicitly set inside the opf file, it will use the first file in the book. (You can set it in the Add window)



-------------------------------------------
Requirement


.NET Framework 3.5 or 4.
Mono for Linux & MacOSX (some feature might not work correctly like the preview)

For linux make sure "mono-runtime" & "libmono-winforms2.0-cil" are installed
Not tested on MacOSX, but it should work
Also make sure that the libtidy library is installed (should be by default.




//Usage for Linux
mono ePubFixer.exe



http://epubfixer.googlecode.com/files/MainWindow.jpg
http://epubfixer.googlecode.com/files/TOCEditor.jpg
http://epubfixer.googlecode.com/files/CoverEditor.jpg
http://epubfixer.googlecode.com/files/TOCinLinux.jpg


Here is the page for any future release http://code.google.com/p/epubfixer/

Changelog :
v1.5.3
- In the Cover Editor, unchecking the preserve Aspect Ratio box will revert to previous behavior of setting the SVG to "none" instead "MidXMidY meet".
- Added a menu in the Cover Editor to select the desired aspect ratio that the image will be resized.
- Fixed some issues with Mono / Linux. (Crash with Fix Margins, Preview working, Path issues, Recent Files working)
- Fixed some setting not being remembered or saved in the wrong place.
- Changed the way the Recent Files are stored in the settings.
- Clicking Rename will have the text selected in the Rename tool.
- The Keep Aspect Ratio checkbox inside of the Cover Editor will now be remembered.
- When Saving a cover you will be warned if the cover has a value of linear="no" (Putting the cover at the end of the book).
- Fixed a Memory problem where using the Mass Update in the Cover Editor would eat up all the memory and crash.
- Covers will have a maximum height of 1600 when resizing them (having them not Preserve the Aspect Ratio),
because very high resolution images are sometimes not processed on some readers.
- Removed the Download button from the Add window, since Table of Contents are no longer available on the Kobobooks website.

v1.5.2
- LibTidy didn't work on 64bit systems, the app will now be 32bit even on 64bit systems.
- Added a confirmation box to replace the Inline TOC before doing so.
- Removed Edit HTML Only from Cover Editor, and will make the cover fit to the window, instead of forcing to a 600 x 800 window.
- The id of a Created Inline TOC will be the filename instead of a GUID.
- Added a fix for some files that sigil 0.4.2 can't open, because of a badly formed content.opf file. Opening Sigil or Saving the file through ePubFixer will fix them.
- Bundled a DLL that was required for the libtidy.dll file that is part of Visual C++ Runtime, that if missing from the computer would crash ePubFixer.

v1.5.1
- A book would crash when doing certain thing when there was no guide in the opf.

v1.5.0
- Added a Select All option inthe context menu of the Add window. It will select all the nodes that are expanded.
- Added the Cover Editor to edit the cover without the need to reconvert with calibre. (look in the readme for additional info).
- Added an option to create an Inline Table of Content (look in the readme for additional info).
- Added an option in the setting menu will let you remove margins in the body Style instead of zeroing them. (usefull with the Kobo Touch when margins can not the modified in book.)
- Added support when only .NET 4 was installed (only XP computers, since other already have .NET 3.5 preinstalled)
- Support when Sigil encodes filenames like URLs, they will now be decoded.
- You can set the type of file (Cover & Table of Content) in the Add windows, this is used with the Inline TOC & Cover Editor.
- Deleting a file did not delete the actual file in the Zip. Also it also removes the info in the guide.
- Plenty of Other fix.

v1.4.1
Added support when filenames with spaces were changed to special character (ex: %20). It happens usually with Sigil 4.

v1.4.0
- Using SendTo will Save the most recent files
- Opening a file that does not exists anymore will not crash the program and a message will warn you.
- Added a Delete Files in the Add screen (it will remove the selected files from the ePub and delete entries from the manifest & spine)
- Fixed a bug with Mass Rename if the entry selected had different "parents".
- Fixed a crash if a file was in the spine, but not the manifest.
- Added a kind of a HACK to force files with XML version v1.1 to be parsed.
- If multiple css file are present, It will now (hopefully) select the correct one.
- The CSS tag being for margins is now determined by the first class attribute seen (previously it was the body tag, now it will look further if not found)
- The Option from the Mass Rename tool-Words are UpperCase-has changed, instead you will have Convert To Uppercase & To Title Case.
It will work as Described but now doesn't work only on Number that where converted to Words but on all the text.
- Removed Wall of Text from the Mass Rename tool and added a help button that will show it for info.
- Added a Download button in the Add window, that will search the site Kobobooks for the TOC and add the entries found to the detected text menu.
- Added a Select Download Text in the Add window, to help selecting the chapters when using the Download button.
- Enabled Navigation in the preview window. (Note : when using navigation you may see character not correctly displayed,
this is because of IE and when you navigate to it the program does not fix the page, it does not mean that the book will display that way.
Use the preview button to make sure)
- Added a Saved Message or Error Message when Saving in the status bar. (It will be shown during 5 seconds)
- Added a Select Previous Text option in the Add dialog.
- The Decrypt Files setting is now on by default when using a DRM build.

v1.3.6
- Put a Check that will prevent any none html file to be loaded or saved in the TOC.
- Changed the Version.xml location on the web, so it is more easily changed. Older version might not always show the new version number.
- Multiple Tweaks to Splitting so more file are compatible and do not crash.
- Changed the way settings are stored, so they are kept regardless of version, build or file location.
(The default MS was to have a setting file for each location and each version, so moving the executable would have all your setting lost.)
- A message will pop-up when opening a protected file, telling you it is protected and preventing you from editing this file.
- Added a Expand & Collapse All option in the Add window.
- When adding new Chapters, the text that was already selected in the Add window will now be remembered.
- In the Add window, clicking the columns header will sort the files.
- Added a Recent Files list under a new File Menu in the Main window.
- Fixed a Couple a Bug.

v1.3.4
- Found a situation where the Spine did not have a reference to the TOC (on retail books), So the App will look deeper if this situation arise.
- If the above situation arises opening the Reading Order Editor and Saving will force the reference into the spine. (a message box will open warning you about it)

v1.3.3
- The Show All checkbox will not be remembered anymore.
- The List of Anchors for each file will now be cached for each different Book.
- The Detected Text will now be cached for each different Book, along with the Anchors text.
- Removed the Apply button, it was replaced by a Add button.
- Using the Add command from the context menu will Add all the items under the selected node (instead of at the end of the document).
- The Save button will no longer close the window (and each related windows, exception is split chapters). You will now need to Save and Close.
- The file column width from the Add screen, will no longer have a maximum width.
- Also resizing the form will no longer adjust the columns width.
- The program will now correctly get the filenames for the NCX & OPF files
- For the OPF file it will get the path from the container.xml file (it used to check only for opf extension)
- For the NCX it will get the id from the spine and lookup the file associated with it in the manifest (it used to check for toc.ncx)
- In the Add window all files or anchors present in the TOC will be shown in Green.
- In the Add window with Show All deselected, Anchors present in the TOC will no longer appear.
- The Forms can now get on top of each other when opened and all will close when the main window closes (TOC or Reading Order editor).
- When opening the Add window, there will no longer be any validating to see if the files shown really exists in the ePub. It will instead
check if the file is present in the TOC when saving the ePub.
- When dragging and dropping Nodes they are no longer removed (with Show All off).
- The Add window will now remember if the nodes are Expanded when clicking Show All or Show Anchors.
- Fixed a problem with Reading order editor showing anchors.
- Shifting Chapters will now get the full source (with anchor) if the next/previous entry is the same file with a different anchor (before it just returned the top of the file).
- Fixed a problem when the source in the TOC was encoded with special characters (ex: %20 instead of a space).

v1.3
- Clicking The Add button in the Add window will no longer close the window.
- The entries in the Add window will now be sorted like the reading Order (spine).
- Added a Save Backup Checkbox on the Main Screen.
- Using Send To from a folder would crash the program, it will now collect all the .ePub found inside.
Useful for mass fixing from the calibre library.
- Added an option to check online if any new version is available (Default is enabled)
- The detected text for anchors, use to only find the text next to that anchors, it will now get the folowing lines. (up to 5)
- The program will now remember the Size and Position of the most windows.
- The Show All & Show Anchor Will now be remebered along with column width.
- Added a Split Chapters on Anchor checkbox in the TOC Editor,
that will Split your Html file into multiple files when more than 1 chapter per file is found. (Is pretty slow right now)
- Fixed a bug with the edit in Sigil, where source that had Anchors where removed.
- Fixed a Bug with the Shift function (Again).
- Added an About box inside in the main dialog.
- Added a status strip inside of the preview window that will show the name of the file being previewed.
- Added a couple of tooltips on checkboxes

v1.2
- The Show All & Show Anchor Checkbox from the add windows are no longer shown when in Edit Reading Order Editor.
- Added a Remove Option in the Reading & TOC Editors, You could have done the same thing by deselecting and clicking apply, but it was not intuitive.
- The files are now being extracted in a background Theard, the Editors window will now appear much more quickly.
- A Progress Bar has been added to the bottom of the screen showing the extracting progress.
- Fixed a Crash with the Show Anchors Checkbox when certain files were in the manifest but not in the ePub.
- Added a new column in the Add Screen that Shows a list of Text (now cap to 5 lines) inside of a File or following an Anchor, The selected text will be used if present when adding files to the TOC (instead of the filename).
- Draging Items with Anchors from the Add Window to the TOC would Add all the Anchors with it.
- Fixed a Bug with Shift Up & Down not working correctly.
- Added a Take Next Text in The Add Window. That way say the first line is a chapter number and the second the title of the chapter, you can easily select the title by selecting all the wanted lines.
- Added a Special Tag in the Mass Rename (%T) that will keep the text in place. Useful with the above feature where you would want to add say a number in front to auto-increment.
(example : Chapter Name could become 1 - Chapter Name by typing 1 - %T)
Also please note that any number in %T will also be detected (only the First one), So if %T is Chapter 1, putting Number to Words will result in Chapter One, if %t only is written. If You Write 1 - %T and %T is Chapter 1, you will have One - Chapter 1.
- Selecting multiple chapter in not the right order would make the renaming incorrect, Now the will all be renamed by the way the are on the screen regardless of the order that they were selected.

v1.1
- The Duplicate function was only duplicating 1 file when several were selected
- Added a Show All checkbox into the Add window, to show files that were already added
- Added a Show Anchor checkbox into the Add window, that will parse the html and show all the id tag into the file
- Changed Algorithm that checks for html file, it will now look for all file and media-type that Contains or Ends with html
- The preview into the Add window was only showing 1 preview when multiple were selected, it will now preview all of them

v1.02
- Fixed a Bug where the Temp Files where being Extracted over and OVer again
- Added a Duplicate Options
- Files with no source are now mark in red

v1.01
- When the Add dialog is shown it checks for any type of file html inside the manifest, will now also look to see if the file extension finishes with html
- Files for the preview where extracted when the TOC and reading order was opening, they now wait for it to be opened. (Large files add a small delay)
- The program was looking for the Sigil app in the usual place, and if it was found use it in place, Removed the check, you will now have to set it first.
- Added some wait cursor when the TOC and Reading order where opening and when the files were being extracted.

nrapallo
01-22-2011, 09:24 AM
Wow!

Nice little tool you have created, and timely too. :thumbsup:

I finally bought a hardware reader that supports .epub files and have found myself hand-editing (with winrar) my calibre and Sigil produced/corrected .epubs of some of my larger ebook creations originally in other ebook formats.

You sure have "filled in" a need...... and I'm no stranger to ebook creating.

It seems my hardware ebook reader's limitations (the Next1 is non-Touchscreen and has no way of selecting internal links) have motivated me since "in page" or footnote links are inaccessible to me using the Next1 as is the traditional embedded TOC placed at the beginning of non-epub ebooks.

But that's OK, since I can try to use the toc.ncx to access the most important links (like Chapter Headings that Sigil so nicely collects for you and nests them too!) However, Sigils TOC Editor is of limited functionality (as you obviously are aware of or else there would be no epubfixer :snicker: )

l want to be able to use my ebook reader's Catalog (toc.ncx) function which can properly display and access nested level TOCs. So, that's why I've been hand-editing those toc.ncx and would like to use your tool to accomplish same.

In particular, since you list the spine elements and are able to add them to the TOC, could you also list the <href=> and their corresponding <id=> locations so that ALL internal links could be added to the TOC (probably nested to better present them. I would probably add them to level1 TOC and have them added as level2 TOC entries for them in sequential/page order and maybe create some level3 sub-compartmentalizations) .

Anyway, back to your epubfixer, my initial comments are:
- when I used the Go button to edit the TOC and Reading Order (with a large .epub file), the GUI disappeared for 20-30 seconds, but I knew it hadn't crashed as Sigil does the same thing when loading large .epubs when I use it with "Open With..." from Windows Explorer.
- I waited and then was rewarded with your TOC screen, but the reading order screen didn't show up and was placed right behind that first screen.
- I used the Add button when editing the TOC, and was presented with a blank screen with the heading "File", though no files were listed. I didn't know if it hadn't found any or was still collecting same.

What I'm really getting at here, by mentioning the above, is user feedback. Keep some indication that the original GUI is still there when opening the TOC or Reading Order screens, as well as that Add to TOC screen. A simple animated mouse pointer or log screen would help. It's not knowing if your software crashes that gets me impatient especially when I see nothing being done... :whistle: but that just me! ;)

Also, it would be nice if you could display some summary statistics like # of .html files in the epub or # of TOC (broken down by # of level 1, 2, 3 .... )

I'm off to edit some more so I may have other comments, but to be honest, I WANTED TO CREATE A TOOL LIKE THIS, but cannot undertake such programming tasks due to only being a unix/dos programmer/hack... :eek:

BTW, I'm download number 3 from your Google project host site. ;)

Again, nice job!!!

GeneS
01-22-2011, 12:17 PM
Marvelous utility. Please keep working on it.

I've noted two apparent problems.

The first problem is in setting the Sigil path. I have two installations of Sigil. One is version 0.3.4 in Program Files\Sigil. The other is version 0.1.9 in Program Files\Sigil 0.1.9. It doesn't seem to matter which version I have selected using ePUBFixer's "Set Sigil Path", only Sigil 0.1.9 comes up when I select "Edit in Sigil".

The second issue is that nothing seems to happen when I check on the "Fix Margins" option and then select the "Go" button except that the ePUBFixer menu blinks momentarily. Perhaps I'm just missing a step somewhere.

Thanks for putting this together.

nrapallo
01-22-2011, 12:45 PM
I'm off to edit some more so I may have other comments

:bigwave: I'm back!

In the Edit TOC screen, how can I create a new TOC entry in order to nest (move) into that level 2 all relevant links I want there.

I used the Add function, but it doesn't seem to be able add a blank entry for me so as to create nested levels. How is this supposed to work?

Can this functionality be added?

Nigol
01-22-2011, 01:23 PM
In particular, since you list the spine elements and are able to add them to the TOC, could you also list the <href=> and their corresponding <id=> locations so that ALL internal links could be added to the TOC (probably nested to better present them. I would probably add them to level1 TOC and have them added as level2 TOC entries for them in sequential/page order and maybe create some level3 sub-compartmentalizations) .


the href are actually there in a tooltip inside the TOC & reading order, I guess I could add their position from the spine to make sure they are it the right order.

- when I used the Go button to edit the TOC and Reading Order (with a large .epub file), the GUI disappeared for 20-30 seconds, but I knew it hadn't crashed as Sigil does the same thing when loading large .epubs when I use it with "Open With..." from Windows Explorer.
- I waited and then was rewarded with your TOC screen, but the reading order screen didn't show up and was placed right behind that first screen.
- I used the Add button when editing the TOC, and was presented with a blank screen with the heading "File", though no files were listed. I didn't know if it hadn't found any or was still collecting same.

- I was extracting the file when opening the TOC editor (only for the preview), but didn't see any kind of slow down (on my Core i7), maybe your large ePub was why it was waiting to have it all extracted. I did a small change so that it will start extracting them when the form was finished loaded.
- The reading order should open after the TOC editor, they should not be opened at the same time, I can see why it could be useful, but having two thread writing to the same file could be disastrous.
- If you have a blank screen in the Add windows, there is 2 possibility:
1 - All the files are already present in the TOC or Reading order
2 - The program looks inside the manifest to find files to add, it look of file of type html (or xhtml), if the type is something else it is normal it didn't show them. I already did a fix (not yet released) that will also look at the file extension, if the type is not html.

I tried with a lot of file, but not everybody uses the same specs, so it hard to determine all book. Maybe you could send me your book or just your toc and opf file to at least be sure, if there should be something in the Add window.

About the initial form hiding I could leave it opened, it just seemed more clean this way (I might not have anticipated the impact of very large files, all my test where almost instantaneous). That is why I posted it, to have user comments, I feel that right now it does everything I wanted to do, but there might be something else to add.



Marvelous utility. Please keep working on it.

I've noted two apparent problems.

The first problem is in setting the Sigil path. I have two installations of Sigil. One is version 0.3.4 in Program Files\Sigil. The other is version 0.1.9 in Program Files\Sigil 0.1.9. It doesn't seem to matter which version I have selected using ePUBFixer's "Set Sigil Path", only Sigil 0.1.9 comes up when I select "Edit in Sigil".

The second issue is that nothing seems to happen when I check on the "Fix Margins" option and then select the "Go" button except that the ePUBFixer menu blinks momentarily. Perhaps I'm just missing a step somewhere.

Thanks for putting this together.

You are right about the Sigil path, if it detects the Sigil executable in it's normal locaiton program file etc... it will use it instead, I could just remove the check and force people to set the path first.

Also the fix margins don't have any box, it just does it, maybe a message box would be great (i removed it at first because of it poping when selected multiple tool) all the options will be run in the order they are shown Margins->Sigil->Toc->Reading order for every book selected.

Nigol
01-22-2011, 01:30 PM
:bigwave: I'm back!

In the Edit TOC screen, how can I create a new TOC entry in order to nest (move) into that level 2 all relevant links I want there.

I used the Add function, but it doesn't seem to be able add a blank entry for me so as to create nested levels. How is this supposed to work?

Can this functionality be added?

If you want to nest the level, just drag and drop the chapters (you can select multiple ones) you want to be level 2 on the level 1 entries. You can also drag level 2 to be level 1, just look at the black bar level. But right now it is only 1 html file, 1 entry you can Add.

So are talking about having the same file 2 times in the TOC? I could add a duplicate function.

Nigol
01-22-2011, 02:06 PM
Did a small update based on the feedback. on google code and the file attached to this forum.

http://code.google.com/p/epubfixer/

- When the Add dialog in shown it checks for any type of file html inside the manifest, will now also look to see if the file extension finishes with html
- Files for the preview where extracted when the TOC and reading order was opening, they now wait for it to be opened. (Large files add a small delay)
- The program was looking for the Sigil app in the usual place, and if it was found used it in place, Removed the check, you will now have to set it first.
-Added some wait cursor when the TOC and Reading order where opening and when the files were being extracted.

Going out for the day, so please keep posting comments.

nrapallo
01-22-2011, 03:07 PM
the href are actually there in a tooltip inside the TOC & reading order, I guess I could add their position from the spine to make sure they are it the right order.

I see that now, but those are NOT the <href=>'s I was thinking about above. The thought I had, to add more functionality to existing ebooks, was the have ALL href's in the ebook listed on that Add screen along with their anchor's internal filename and then be able to pick and choose amongst that list to add to the existing TOC. In essence, the user could then have the opportunity to add footnotes under relevant Chapters so as to access them from the toc.ncx. Again this is only important for those that have no hardware/software mechanism to get at those internal links.

My idea was to be able to add a two new TOC level1 entries, one called "Embedded TOC" which could house those links found in older style ebooks (like what Project Gutenberg produces) just for the embedded Table of Contents and List of Illustrations at the beginning of the ebook. The other, called "Internal Links", would be for ALL relevant footnote or "in page" links.

I wouldn't expect your ePubFixer to actually change/add to the TOC, just be able to access that listing of (other) href's used within the epub. The user would then be at liberty to determine which could be retained/discarded and add soley those from the Add screen to the existing TOC. Food for thought!

All this is to accomplish one goal, to embellish the existing TOC in ways Sigil, nor calibre could do algorithmically. :grin2:

- I was extracting the file when opening the TOC editor (only for the preview), but didn't see any kind of slow down (on my Core i7), maybe your large ePub was why it was waiting to have it all extracted.

Yes, the epub was large; its an epub of an entire website I downloaded almost 5 years ago and contains almost 1700 items in the <spine> section of the .opf (it has that many .html files plus almost 1500 images within). So that's probably too extreme a test case, but just highlights the fact that while loading/filtering the items, the GUI should not close until the Edit TOC screen actually is ready...

This is the TOC screen 65285 I see after loading that gargantuan .epub and one of my first thoughts was to create a new Level1 entry for "A" and then move all the Mathematicians with lastname starting with "A" therein. I would need to be able to add a New entry, then move the existing ones therein.

- The reading order should open after the TOC editor, they should not be opened at the same time, I can see why it could be useful, but having two thread writing to the same file could be disastrous.

Yes, I see that now, and you're right about editing the same source files at the same time and the potential for disaster.

- If you have a blank screen in the Add windows, there is 2 possibility:
1 - All the files are already present in the TOC or Reading order
2 - The program looks inside the manifest to find files to add, it look of file of type html (or xhtml), if the type is something else it is normal it didn't show them. I already did a fix (not yet released) that will also look at the file extension, if the type is not html.

Good to know. Now if you could add other internal links (like the aforementioned ALL href's) that can be listed and added, then were looking good.... :whistle:

I tried with a lot of file, but not everybody uses the same specs, so it hard to determine all book. Maybe you could send me your book or just your toc and opf file to at least be sure, if there should be something in the Add window.

Sorry, that epub is copyrighted and made for my own use. :o If you want to see the .opf then I could email it to you. Just PM me.

About the initial form hiding I could leave it opened, it just seemed more clean this way (I might not have anticipated the impact of very large files, all my test where almost instantaneous). That is why I posted it, to have user comments, I feel that right now it does everything I wanted to do, but there might be something else to add.

If you are willing to entertain our comments, then I'm willing to provide same. :)

nrapallo
01-22-2011, 03:27 PM
If you want to nest the level, just drag and drop the chapters (you can select multiple ones) you want to be level 2 on the level 1 entries. You can also drag level 2 to be level 1, just look at the black bar level. But right now it is only 1 html file, 1 entry you can Add.

Well, so you can! Absolutely bang-on functionality! It works like a charm! :2thumbsup

So are talking about having the same file 2 times in the TOC? I could add a duplicate function.

No, the above clears up my issues, except instead of using the "Add" option, could you add a "New" option and allow the user to rename it. It would serve as a placeholder for those (newly created) level2 entries. You could even default its href to be the same as the first level2's href file reference just to be complete.

Freeshadow
01-22-2011, 08:27 PM
looks like THE tool to simplify creation ofomnibus editions :D karma comes the way

Nigol
01-23-2011, 12:57 AM
No, the above clears up my issues, except instead of using the "Add" option, could you add a "New" option and allow the user to rename it. It would serve as a placeholder for those (newly created) level2 entries. You could even default its href to be the same as the first level2's href file reference just to be complete.

If I understand you correctly, it's that there are no file with a summary for people with A, and you would just like to have them group together, so it becomes clearer? Or having 2 TOC's like 1 by name and other by date for example.

I have not fully checked the specs fully, but I don't know what an empty TOC will do with some reader. But right now whenever an entry is loaded and the file is not physically there in the ePub, it will not be shown when loaded and be removed completely from the TOC upon saving. But empty source do come up in my test, and i even wanted to make sure it couldn't be possible.

Also about the Add screen, it only lists the file inside the manifest. It does not parse every HTML file to find the anchor value presents. Although it could be usefull, my main idea was to create a tool that would complement calibre and sigil. And this type of thing could "easily" (it took me a while to fully understand the convert setting in it) be done in calibre with the right settings, having it detect some html tag, let calibre create your TOC, and then use my tool to remove unwanted parts of move some.

I could easily add a Show all checkbox inside the add screen that will show even files that are already present And/Or a New option without a source, but I don't see why it would be of use. I think that is why neither calibre nor sigil is able to do this. I don't even know what it would do on some reader or if it is possible in the specs. I just want to be sure it is something that would be useful without having the tool be too complicated and less intuitive for all users.

Update : I have just tested Added an New Empty TOC Entry, but the calibre viewer seems to remove the entry with no source completely, and looking at the specs (http://www.niso.org/workrooms/daisy/Z39-86-2005.html#NCXElem) and it seems to be required. So it would not change anything because I guess most reader will either ignore it and remove it, or maybe crash. Maybe a duplicate would work for you?

nrapallo
01-23-2011, 08:55 AM
If I understand you correctly, it's that there are no file with a summary for people with A, and you would just like to have them group together, so it becomes clearer? Or having 2 TOC's like 1 by name and other by date for example.

The main thrust for allowing one to add a New TOC entry with a src/href is as a temporary repository for existing level1 TOC entries that can be moved into it as level2 TOC items. This differs slightly from your program's TOC editing capabilities in that with your "drag 'n drop" method the level1 TOC entry name remains whereas in what I'm getting at, that dropped on level1 entry becomes the first level2 TOC entry within the newly crated level1 TOC entry.

For example, with that huge .epub, all 1700 Mathematicians are listed in Alphabetical order as level1 TOC entries. What I wanted to do (after the .epub was created from my .html/.jpg source using calibre and "cleaned up" using Sigil) was to create, using ePubFixer now instead of hand editing, 26 New level1 TOC entries, one for each letter of the Alphabet. Then I would move all the "A" Mathematicians into that newly created "A" entry. And yes, when that new "A" was created it had no src/href and was empty, but AFTER I move all those "A" Mathematicians therein, the first level2 TOC entry i.e. Enrst Abbe could be used to provide that "A" level1 TOC entry with a valid src/href (duplicate!). :smack:

Come to think about it, if you allow any TOC entry to be duplicated, like Ernst Abbe, then I could just rename the first one to "A Mathematicians" and then move the second "Ernst Abbe" along with any other "A" TOC entries therein afterward. It would accomplish the same task and NOT create any invalid/empty TOC entries. :chinscratch:

This is a better approach since the TOC's src/href is already set upon duplication and so there is no need to "guess" or worry about how that empty TOC will be used by the user.

Another benefit of having a Duplicate option would be to allow another placement of say the embedded Table of Contents present at the back of the ebook, to the front.

Soooooo, can a Duplicate option be added to the Add screen instead of a New option? :cool:

I have not fully checked the specs fully, but I don't know what an empty TOC will do with some reader.

Using a Duplicate option instead will not cause any empty TOC issues!

Also about the Add screen, it only lists the file inside the manifest. It does not parse every HTML file to find the anchor value presents. Although it could be usefull,

That's what I had in mind! :rolleyes: :snicker:

The ONLY useful entries to add to the internal toc.ncx are links that not already there but which links? Your software can't determine that on it's own, but if you do parse the .html (ala Beautiful Soup) and extract all the href's and match them with their id's and note the anchor's filename, then those could be listed.

So, for example, if the first .html in the <spine> is "Text/Abbe.html" and has a footnote link, say footnote1 coded like <a href="footnotes.html#note1">footnote1</> then "note1" could be listed and added to the TOC as: <navPoint id="navPoint-24" playOrder="24">
<navLabel>
<text>Ernst Abbe - Footnote1</text>
</navLabel>
<content src="Text/footnotes.html#note1"/>
</navPoint>


Maybe a duplicate would work for you?

In a nutshell, YES!!!!!! ;)

Nigol
01-23-2011, 01:05 PM
Ok so I uploaded a new update with the requested Duplicate Function.

There was also a bug I introduced in v1.0.1 where Temp files where being extracted over and over again. SO please everyone update.

So I hope this helps you.

nrapallo
01-23-2011, 04:10 PM
For the sample .epub attached, I want to add new level2 items under the "Table of Contents" level1 TOC entry in the toc.ncx as there are places under that title to link to it, like<p class="calibre13"><a class="calibre4" href="../Text/10940-h_split_005.htm#ch01">Condition of Persons and Lands</a></p> but they are not included in the toc.ncx, nor available in the Add screen. See "10940-h_split_003.htm" therein.

What functionality could you add to ePubFix to enable me to do this?

Nigol
01-23-2011, 11:04 PM
For the sample .epub attached, I want to add new level2 items under the "Table of Contents" level1 TOC entry in the toc.ncx as there are places under that title to link to it, like<p class="calibre13"><a class="calibre4" href="../Text/10940-h_split_005.htm#ch01">Condition of Persons and Lands</a></p> but they are not included in the toc.ncx, nor available in the Add screen. See "10940-h_split_003.htm" therein.

What functionality could you add to ePubFix to enable me to do this?

OK here is what I did, I have added a Show All button and a Show Anchor button into the Add window. But by looking at the file you were talking there are several id inside the same line, the ch01 is on almost every line.

As a matter of fact that particular line you were talking about points to heading_id_13 (which is already in your TOC, so what adding ch01 will do is point to the beginning of the page instead of the required effect. (since it will point to the very first ch01)

What the Show Anchor does is show the very first id Tag it finds in the html (I am guessing that the navigating to a anchor does work the same, jumping to the first one spotted)

Changelog :

- The Duplicate function was only duplicating 1 file when several were selected
- Added a Show All checkbox into the Add window, to show files that were already added
- Added a Show Anchor checkbox into the Add window, that will parse the html and show all the id tag into the file
- Change Algorithm that checks for html file, it will now look for all file and media-type that Contains or Ends with html
- The preview into the Add window was only showing 1 preview when multiple were selected, it will now preview all of them

Freeshadow
01-24-2011, 01:05 AM
more KARMA for that guy !!!

Nigol
01-24-2011, 10:07 AM
Glade you like it!

nrapallo
01-24-2011, 11:05 AM
OK here is what I did, I have added a Show All button and a Show Anchor button into the Add window. But by looking at the file you were talking there are several id inside the same line, the ch01 is on almost every line.

Oops, how did those duplicate id's get in there.... :dunno:

There shouldn't be any duplicates, but your solution seems appropriate to only use the first one! :thumbsup:

I tried editing that TOC, and after I added that id link, the tooltip and name were the same for the newly added TOC entry. I promptly renamed it to the anchor's text, but thought, :chinscratch: , it would be nice for the Add screen to show the text of the id's anchor or heading (h1/h2/h3..) and use that as the default naming when added, instead of the src/href. Perhaps you can add another column in the Add screen to show what text the link surrounds or at least the first 20-30 characters.

Also, while editing I added a wrong link to the TOC and then found that I couldn't delete it, only unselect it. Could you also add a (one line or multiple lines) Delete TOC entry option?

Thanks for implementing greater functionality as well as retaining your simple but intuitive UI!!!! :2thumbsup

Nigol
01-24-2011, 11:48 AM
Also, while editing I added a wrong link to the TOC and then found that I couldn't delete it, only unselect it. Could you also add a (one line or multiple lines) Delete TOC entry option?


That is kind of why I added the Apply button, it will reload the TOC, without saving to the file, but I will add it anyway, since it might not be intuitive enough.

I will look if having some text detected is doable, because of all the different kind of book, they are sometime very different. Maybe catch the next p or blockquote tag following the anchor or at the beginning of the page. But it is a good idea, to have at least half the job already done.

Nigol
01-25-2011, 11:01 PM
Just letting you all know that I am working on a new update, that will simplify even more Creating TOC.

http://epubfixer.googlecode.com/files/Add%201.jpg
http://epubfixer.googlecode.com/files/Add%203.jpg

- Added a Remove Option in the Reading & TOC Editors, You could have done the same thing by deselecting and clicking apply, but it was not intuitive.
- The files are now being extracted in a background Theard, the Editors window will now appear much more quickly.
- A Progress Bar has been added to the bottom of the screen showing the extracting progress.
- Added a new column in the Add Screen that Shows a list of Text (now cap to 5 lines) inside of a File or following an Anchor, The selected text will be used if present when adding files to the TOC (instead of the filename).
- Added a Take Next Text in The Add Window. That way say the first line is a chapter number and the second the title of the chapter, you can easily select the title by selecting all the wanted lines.
- Added a Special Tag in the Mass Rename (%T) that will keep the text in place. Useful with the above feature where you would want to add say a number in front to auto-increment.
(example : Chapter Name could become 1 - Chapter Name by typing 1 - %T and auto-increment all field)

And some bugs also.

Hope you find this useful and spread the word if you do.

Should be out Tomorrow or the day after.

KenJackson
01-26-2011, 02:18 AM
I took a look at the project page (http://code.google.com/p/epubfixer/) and was pleased to see it's licensed GPL. But I don't see any source code.

I tried to run it with wine (http://www.winehq.org/) on Linux, but it said
wine: Install the Windows version of Mono to run .NET executables

OK, I guess I could install that, but are you going to build any non-Windows version?

Nigol
01-26-2011, 11:09 AM
I took a look at the project page (http://code.google.com/p/epubfixer/) and was pleased to see it's licensed GPL. But I don't see any source code.

The Code is not there because I don't yet use the Source Control. But if interested I would gladly provide it. And right now there was no request for it, so I didn't really bother.

I will post a source with the next version in the download section, I just ask that if anybody wants to make some enhancement that we all work together, instead of doing many different version.


I tried to run it with wine (http://www.winehq.org/) on Linux, but it said
wine: Install the Windows version of Mono to run .NET executables

OK, I guess I could install that, but are you going to build any non-Windows version?

The program is written in C#, which means that to run it you will need either .Net Runtime (3.5) or Mono on Linux or MAC.

That said Mono is not an exact port of the .NET framework and there will surely be some parts of it that are not working. Maybe someone with some experience with Linux could give a hand, has I don't really plan on using Linux soon.

But I have checked the compatibility with Mono. The only problem I see is the WebBrowser window not running on OSX. On version 1.2 only (I changed some things that would not have pass the tests.)

But there is some problems with the libraries I am using, but looking at the report it does not look like something that is used in my App and could be safely removed (all are open source). But there will have some testing to be done and some code modification to do.

Nigol
01-26-2011, 05:19 PM
I have uploaded the new Update 1.2 attached on The First Post and on Google Code. I have also uploaded the Source Code.

Like always please leave comments, suggestions, bugs, etc. And spread the word. Maybe if it is useful/liked enough this post might get stickied :D.

(See the OP or the readme for the changelog)

nrapallo
01-26-2011, 11:24 PM
I have uploaded the new Update 1.2 attached on The First Post and on Google Code.

It's soooo powerful now!

I can nest TOC levels, shift them around, add more TOC entries at will and when in doubt I can even preview the .html where the anchor's located. :cool:

All a click or two away (typing optional! :thumbsup: )!

Thanks Nigol for a worthy update!

Oh, one more request, if I may. How about a "Save as..." button (or dialog prefilled with the filename when the Save button is clicked) for those times when I want to keep the original .epub and haven't copied it beforehand...

Nigol
01-26-2011, 11:35 PM
Oh, one more request, if I may. How about a "Save as..." button (or dialog prefilled with the filename when the Save button is clicked) for those times when I want to keep the original .epub and haven't copied it beforehand...

I am starting to think that you will never be happy :D (Joking). But in all honesty I appreciate your comment it help me build something better that can now more easily create a TOC from almost nothing, without going into sigil and wasting hours to just select the heading.

I do agree with the Save As, Or I would be more inclined to have a Save Backup checkbox, It would have helped me when I started coding it, because I had to keep several copy, because the app would destroy my TOC or stylesheet completely.

nrapallo
01-27-2011, 12:20 PM
I am starting to think that you will never be happy :D (Joking).

You say that as if it's a baaaad thing.... :snicker: It's just my nature! ;)

But in all honesty I appreciate your comment it help me build something better that can now more easily create a TOC from almost nothing, without going into sigil and wasting hours to just select the heading.

I agree! There is nothing worse than finishing a complex and lengthy conversion with calibre and then trying to salvage that conversion by editing the .epub with Sigil only to find the TOC is not the way you like it. ePubFixer to the rescue..... :thumbsup:

I do agree with the Save As, Or I would be more inclined to have a Save Backup checkbox, It would have helped me when I started coding it, because I had to keep several copy, because the app would destroy my TOC or stylesheet completely.

While we are talking about further changes, how about:
Remembering the placement (size and location) of the Add, TOC Editior and Preview screens. Every time I launch the program, I have to re-adjust the windows the way I like them (since I have LOTS of screen real estate available I even enlarge the screens!).
After I add links from the Add screen and am returned to the TOC Editor screen, any subsequent call to "Add" has to re-scan for Show ALL and for Show Anchors. Can this be cached/remembered while still editing the TOC?
In the Add screen, can you allow sorting of "Filename", "Detected Text" by click the Header (sort/reverse sort)
Troubleshooting: If you open my Websters Dictionary 1913_ver21.epub (http://www.mobileread.com/forums/showthread.php?p=283276#post283276), in the Add screen, the filename is truncated after the third hyphen and I can't tell which filename is being shown (they all look the same)


Also, some tips for those "not in the know",
At the Add screen, just drag 'n drop the link(s)to the correct place in the TOC Editor screen. You can still, instead, use the Add button, but that delivers all selected links to the bottom of the existing TOC. Choose which works for you.
After using the Preview option, if you want to see the relevant html code, just right-menu and select "View Source", then you can also see how those links interact. ;)


If you make more changes, Nigol, I'll continue to make comments/suggestions... :whistle:

GeneS
01-28-2011, 11:29 PM
The application does a wonderful (and relatively easily) job of creating a new TOC, saving much laborious editing time. I have however noted that once I have finished, if I call the file up again in Sigil, Sigil will ignore everything I have done and restore the original TOC, thereby destroying all my careful work, putting me back where I was before I used epubfixer.

I have read and re-read the thread several times, so if it was said, I missed it ... but how do I insure that my carefully revised and re-ordered TOC is not later destroyed?

Nigol
01-29-2011, 01:53 PM
The application does a wonderful (and relatively easily) job of creating a new TOC, saving much laborious editing time. I have however noted that once I have finished, if I call the file up again in Sigil, Sigil will ignore everything I have done and restore the original TOC, thereby destroying all my careful work, putting me back where I was before I used epubfixer.

I have read and re-read the thread several times, so if it was said, I missed it ... but how do I insure that my carefully revised and re-ordered TOC is not later destroyed?

That is why there is an Edit in Sigil option, what it does is simply make a copy of your TOC before opening sigil and replacing it afterwards. it will not keep your TOC intact if say you split several chapter and/or rename the files. So I suggest selecting both the Edit in Sigil and Table of Content Editor, because after editing in Sigil the TOC editor will filter unavailable entries (or just put the in red if they where anchors - v1.3 only), and you could add new entries that where done with Sigil, like splitting chapters.

That said I just found a bug (and fixed it in the next version) where a TOC entry that links to Anchors (i.e. TExt/page001.html#filepos011) would not be kept.

I am also working on a Split Chapters on Anchors that will split your html files just before the selected anchors. (we will see if it works well before release, so no promise now).

Nigol
02-01-2011, 11:37 AM
Here is the Changelog for the new update that I just uploaded, hope you like it.

They might me something else, but I did a stupid thing and erased some of the stuff I had already written, so I had to re-write them.

Spread the word if you like it...

Changelog :

- Clicking The Add button in the Add window will no longer close the window.
- The entries in the Add window will now be sorted like the reading Order (spine).
- Added a Save Backup Checkbox on the Main Screen.
- Using Send To from a folder would crash the program, it will now collect all the .ePub found inside.
Useful for mass fixing from the calibre library.
- Added an option to check online if any new version is available (Default is enabled)
- The detected text for anchors, use to only find the text next to that anchors, it will now get the folowing lines. (up to 5)
- The program will now remember the Size and Position of the most windows.
- The Show All & Show Anchor Will now be remebered along with column width.
- Added a Split Chapters on Anchor checkbox in the TOC Editor,
that will Split your Html file into multiple files when more than 1 chapter per file is found. (Is pretty slow right now)
- Fixed a bug with the edit in Sigil, where source that had Anchors where removed.
- Fixed a Bug with the Shift function (Again).
- Added an About box inside in the main dialog.
- Added a status strip inside of the preview window that will show the name of the file being previewed.
- Added a couple of tooltips on checkboxes

nrapallo
02-01-2011, 12:31 PM
Well done, Nigol! :clap:

epUBFixer is so intuitive and easy to use. :thumbsup:

I recently added "back links" to footnotes by manipulating the toc.ncx using ePubFixer. It was easy to do and allowed much need navigation for my (crippled) ADE hardware reader without a touchscreen or back button.

I started with a well-coded epub called 'Lorna Doone.epub' by AlexBell available in this thread Blackmore, R.D.: Lorna Doone. v2 03 Oct 2010 (http://www.mobileread.com/forums/showthread.php?p=1020195#post1020195)

I moved all chapters listed in the TOC Editor screen onto the "Lorna Doone" heading and created level2 TOC entries for the chapters (I had to add another link to chapter 1 from the Add screen). This was just a cosmetic preference of mine.

Then, at the Add screen, I (shift) selected all the anchors listed under "Footnotes.html" and then choose "Select Next Text" for all of them to better describe the footnotes! I moved them onto the TOC Editor's "Footnotes" heading and it created level2 TOC entries for same. I even renamed those level links via (shift) select and rename using "[1] - %T" to add the footnote number back.

In the Add screen, I then expanding each filename listed and moved the detected footnote "back anchor" like "[1]" and moved each one, in turn, onto it's corresponding newly added footnote level2 TOC entry. This created a level3 TOC entry for each level2 TOC footnote!!! Then I mass renamed them using ctrl-click with "%T - back to text" and it changed "[1]" to "[1] - back to text"

It was a bit tedious, but employed very simple drag 'n drop, point and (shift/ctrl) click as well as only minimal typing! :2thumbsup

Attached, please find my fixed version of the original "Lorna Doone.epub".

I hope this inspires others to get fixing .epubs using ePubFixer! :snicker:

p.s. I attach some screenshots of my work

original "Lorna Doone.epub"
6585965860

Add screen after showing all filenames and anchors
6586565866

my "Lorna Doone_fixed.epub"
65861658626586365864

GeneS
02-01-2011, 01:41 PM
Thanks, Nigol, for the update. And thank you, Nick, for the excellent rendition of "Lorna Doone."

It's apparent to me that I'm doing something wrong. I can use epubfixer to create a new TOC and save the file ... works beautifully. However if I make any subsequent modification to the text itself (using epubfixer or not) , and then save the modified file, the new TOC no longer works. Depending on how I've done the modifications, either my changed TOC disappears or if it is still there, clicking on a TOC entry results in incorrect results or an error message.

If I re-edit to Nick's new version of "Lorna Doone," the results are fine.

I've attached my epubfixer fixed version of a Project Gutenburg epub book by Thornton Burgess. Perhaps someone out there can tell me what I'm overlooking.
Thanks for any help.

Gene

nrapallo
02-01-2011, 02:36 PM
Ok, I duplicated the first chapter name and renamed it "Chapters".

I then moved all the chapters titles listed on the TOC Editor screen onto this newly created level1 TOC entry (Chapters) thus creating level2 TOC entries for all those chapters.

I clicked Save and it works!

Try to do the same and compare to the one I've attached below.

Oh, one more change I made was to delete the empty paragraph block [<p>&nbsp;</p>] in "content0001.xhtml" so that the cover image displayed better in (windows) ADE. ;)

GeneS
02-01-2011, 03:09 PM
Thanks, Nick.

I loaded the file you created into epubfixer, having checked 'Edit in Sigil' and 'Edit Table of Contents.'

Then when the file came up in Sigil, I modified the file "contents008.xhtml" by changing the second word in the first paragraph from "those" to "they." then saved the file in Sigil. When Sigil closed, the TOC came up in epubfixer. I applied and saved, then exited from epubfixer.

The attached file is the result and an example of what I'm referring to. The modified TOC is shown when I call up the file (I use the epub plugin in Firefox) but no longer points where it should.

Thanks.

Further edit: As long as I don't change the file structure, I can fix this by saving the toc.ncx file from the epub before I start and then replace it back into the modified file when I'm done, however I was hoping that this would be done as a part of the epubfixer process.

Nigol
02-01-2011, 04:00 PM
Thanks, Nick.

I loaded the file you created into epubfixer, having checked 'Edit in Sigil' and 'Edit Table of Contents.'

Then when the file came up in Sigil, I modified the file "contents008.xhtml" by changing the second word in the first paragraph from "those" to "they." then saved the file in Sigil. When Sigil closed, the TOC came up in epubfixer. I applied and saved, then exited from epubfixer.

The attached file is the result and an example of what I'm referring to. The modified TOC is shown when I call up the file (I use the epub plugin in Firefox) but no longer points where it should.

Thanks.

Please note that the text is in red (that is no good) only the anchor remains. I thought I had fixed that bug. I will check with your provided file.

nrapallo
02-01-2011, 04:01 PM
However if I make any subsequent modification to the text itself (using epubfixer or not), and then save the modified file, the new TOC no longer works.

Oh, I originally missed the part in bold above. I didn't modify the text with Sigil or otherwise. I hand edited with winrar and a text editor my deletion of the cover page's empty paragraph block. I didn't try the below with my version above. :o

Then when the file came up in Sigil, I modified the file "contents008.xhtml" by changing the second word in the first paragraph from "those" to "they." then saved the file in Sigil.

Nigol
02-01-2011, 04:21 PM
I just uploaded the Fix, it was so Stupid, I don't even know why it worked in the first place.

Sigil usually puts the text file in OEBPS/Text/content0001.xhtml, well I was looking for the filename in the manifest (to know where it is now). But instead of using a "/", I used a \ to separate the path from the filename.

I just hope that I did not break something else, so please let me know.

Update : It has nothing to do with the / (although that fixes it partially). It is only because your original file was in the folder "text" (look at the case), But sigil renamed it to "Text". Those are little things that you just can't think about, and you help me find them.

GeneS
02-01-2011, 04:44 PM
I just uploaded the Fix, it was so Stupid, I don't even know why it worked in the first place.

Sigil usually puts the text file in OEBPS/Text/content0001.xhtml, well I was looking for the filename in the manifest (to know where it is now). But instead of using a "/", I used a \.

I just hope that I did not break something else, so please let me know.


BINGO!!!
:thumbsup:
Works like a charm. Thanks for your work on this.

Nigol
02-01-2011, 04:53 PM
BINGO!!!
:thumbsup:
Works like a charm. Thanks for your work on this.

Just look at the update I posted, to just to let you Know the real reason, it was only because of text instead of Text.

nrapallo
02-01-2011, 06:13 PM
OK, some personal comments/suggestions on the latest versions.....


In the Add screen you "remember" the setting for Show All and Show Anchors even after the program is closed. Personally, I would think those settings should be reset each time the programs starts, but not when the Add screen is opened/closed/re-opened while editing the same file. What do you think?

I know this may seem nit-picking, but while in the TOC Editor screen, the Add option perhaps should not be a right-menu option since it doesn't act on anything selected. I think, it would be better suited as an Add button on the TOC Editor screen. :dunno:

Can you consider assigning ePubFixer generated "id"s to all "href"s that don't have an existing "id". This way you can easily add "back links" to any hyperlink. For example, HarryT's "Pictures from Italy.epub (http://www.mobileread.com/forums/showthread.php?p=565318#post565318)" cannot be easily edited to add such "back links" to footnotes [1] and [2] (see attached image) as can my earlier "Lorna Doone.epub" modification. Any suggestions?
EDIT: Perhaps just editing with Sigil to add such anchors would be easier.

Keep up the great work!

Nigol
02-01-2011, 07:38 PM
I see that you have edited your post, you must have found the Check Version into the Setting Menu..:chinscratch:


OK, some personal comments/suggestions on the latest versions.....

In the Add screen you "remember" the setting for Show All and Show Anchors even after the program is closed. Personally, I would think those settings should be reset each time the programs starts, but not when the Add screen is opened/closed/re-opened while editing the same file. What do you think?

I can agree with the Show All, but I kind of like the Show Anchors Always on. Maybe Add a Setting that could be selected what kind of settings you want to keep?

I know this may seem nit-picking, but while in the TOC Editor screen, the Add option perhaps should not be a right-menu option since it doesn't act on anything selected. I think, it would be better suited as an Add button on the TOC Editor screen. :dunno:

A toolbar could be done, to have the same settings as the context menu. I will have to go hunting for suitable icons.

Can you consider assigning ePubFixer generated "id"s to all "href"s that don't have an existing "id". This way you can easily add "back links" to any hyperlink. For example, HarryT's "Pictures from Italy.epub (http://www.mobileread.com/forums/showthread.php?p=565318#post565318)" cannot be easily edited to add such "back links" to footnotes [1] and [2] (see attached image) as can my earlier "Lorna Doone.epub" modification. Any suggestions?

I kind of understand what you want. But not sure. You want to be able to go to a footnote and go back to the original text. But unlike your previous file (where there was a Anchor for the footnote in the original file, this one does not have it). But what I can't understand is how you want me to fix this?

The program just gets all the id's in the html file, there is no editing of the html file being done, so like you said it might be easier to add them in sigil, because I do not think that adding id's to the html will do a good job. And just searching for the same text will add a lot of possible junk. But maybe I misunderstand what you are talking about.

The html parser I use does not really like nested tags and can very easily screw up the file (there are weird types of file, where calibre adds it's own tags, sigil adds it own, etc.) And for every tag added it considers it a separate line, so duplicating text etc. That is why I used HTML Tidy for the new split chapter function, to have it better formatted and "manually" selected the text, but it is so slow.

nrapallo
02-01-2011, 09:34 PM
I see that you have edited your post, you must have found the Check Version into the Setting Menu..:chinscratch:

Yeah, I noticed it in v1.3.2 and then edited my post. You must have implemented that "under the radar" ... :whistle:

I can agree with the Show All, but I kind of like the Show Anchors Always on. Maybe Add a Setting that could be selected what kind of settings you want to keep?

I do like that too; I just didn't need the Show All selected every time. I'm fine with just Show Anchor being remember, no need for a setting/option. :)

A toolbar could be done, to have the same settings as the context menu. I will have to go hunting for suitable icons.

I wouldn't go that far. Any button (like your Go or Save button) would do. I just would like immediate access to it, not through a right-menu click. I know, real nit-picking... :grin2:

I kind of understand what you want. But not sure. You want to be able to go to a footnote and go back to the original text. But unlike your previous file (where there was a Anchor for the footnote in the original file, this one does not have it). But what I can't understand is how you want me to fix this?

The program just gets all the id's in the html file, there is no editing of the html file being done, so like you said it might be easier to add them in sigil, because I do not think that adding id's to the html will do a good job. And just searching for the same text will add a lot of possible junk. But maybe I misunderstand what you are talking about.

Yes, that's exactly what I had in mind, however, I didn't realize that you would THEN need to write that "id" back into the text. This is not ideal, given Sigil accomplishes that task much better.

The html parser I use does not really like nested tags and can very easily screw up the file (there are weird types of file, where calibre adds it's own tags, sigil adds it own, etc.) And for every tag added it considers it a separate line, so duplicating text etc. That is why I used HTML Tidy for the new split chapter function, to have it better formatted and "manually" selected the text, but it is so slow.

:eek: OK, just forget I mentioned it.... ;)

Nigol
02-01-2011, 09:42 PM
Yeah, I noticed it in v1.3.2 and then edited my post. You must have implemented that "under the radar" ... :whistle:


Nope it was there all along in 1.3. I might have to do youtube video or something.

And I wanted people to know (I forgot to re-write it in the readme). That with the Split Chapters, clicking Apply will split the chapters and show the new TOC (also updates the opf file) but not save the TOC (so you can see the new source, if it was split ok etc.) so clicking close will seriously screw the whole thing. So maybe just remove that apply button.

And since there are no urgent need for fixing, I will probably do a new update when there are more important features to add, other than simple annoyance fix.

With the new Tidy dll being used, anyone might like a Tidy Files functions? Or since it is already there in Sigil, it might not be needed. Any other thing that people will like? I usually just add features, as I convert some books and find some problem I cannot fix, but right now I found it pretty much does all I need.

I am thinking of fixing some of the detected text, because the html parser looks like it is missing some things, but other than that... I don't know (other than your suggestions).

nrapallo
02-02-2011, 12:01 AM
:whistle: While you're waiting for comments on new features, do you mind revisiting my issue below:


Troubleshooting: If you open my Websters Dictionary 1913_ver21.epub (http://www.mobileread.com/forums/showthread.php?p=283276#post283276), in the Add screen, the filename is truncated after the third hyphen and I can't tell which filename is being shown (they all look the same)

WARNING: It'll take a loooong time to open the Add screen on that one... :rolleyes:

Thanks!

konrad
02-02-2011, 09:34 AM
:help: Hello ,Nigol
Just downloaded Epub fixer and tried both ways of using (send to and open with), but nothing happens. No program appears, just the hourglass cursor for a second and then nothing happens.Is there something else I need to do or some system requirement that needs to be met . I am running Windows XP home SP2 1gig memory. Please help. Thank you.

Nigol
02-02-2011, 09:51 AM
:help: Hello ,Nigol
Just downloaded Epub fixer and tried both ways of using (send to and open with), but nothing happens. No program appears, just the hourglass cursor for a second and then nothing happens.Is there something else I need to do or some system requirement that needs to be met . I am running Windows XP home SP2 1gig memory. Please help. Thank you.

No there is nothing special to it. But you could always just open the exe and select choose files. If it does not start make sure that you have the .NET framework 3.5 (SP1) installed, has it does not come pre-installed on XP.

Nigol
02-02-2011, 10:37 AM
WARNING: It'll take a loooong time to open the Add screen on that one... :rolleyes:

Thanks!

I see what you mean by loooong.. Well if there is any performance enhancement to do I think we have a perfect candidate to study here. But so people don't freak out, not every book has 27 000 pages and a anchor at every line.


If you open my Websters Dictionary 1913_ver21.epub, in the Add screen, the filename is truncated after the third hyphen and I can't tell which filename is being shown (they all look the same)

Thanks!

Just widen the column and you will see it all, I do not not why it gets cut off at the hyphen (logically you should be able to see up to the end of the column, but this is not part of my code, it is part of the tree control i am using)

nrapallo
02-02-2011, 11:15 AM
I see what you mean by loooong.. Well if there is any performance enhancement to do I think we have a perfect candidate to study here. But so people don't freak out, not every book has 27 000 pages and a anchor at every line.

Yeah, this one is not a sample .epub to learn how to use ePubFixer with... :snicker:

Oh, and by the way, I'm fine with the performance hit, as you note this baby has a lot of hyperlinks and html files! It's a gargantuan epub like my Wikipedia 2006 (http://www.mediafire.com/?y61njj78ll4wa) which is a 40MB .epub. ;)

Just widen the column and you will see it all, I do not not why it gets cut off at the hyphen (logically you should be able to see up to the end of the column, but this is not part of my code, it is part of the tree control i am using)

Thanks! I didn't think of that!

On an unreleated note: One more thing to think about, how about a companion PdfFixer so that it's TOC can be manipulated after the .pdf ebook has been created? There sure are a lot of .pdf ebooks out there with chapter headings just begging to be accessed... :wink3:

dapjukebox
02-04-2011, 03:03 PM
Thanks for such a usefull tool, have corrected quite a few toc's but have today discovered a problem. Not sure if there is any standards for the actual name of the .ncx file but i have discovered that epubfixer only looks for toc.ncx. I have a couple of books that are named differently and epubfixer shows an empty toc.

Nigol
02-04-2011, 03:43 PM
Thanks for such a usefull tool, have corrected quite a few toc's but have today discovered a problem. Not sure if there is any standards for the actual name of the .ncx file but i have discovered that epubfixer only looks for toc.ncx. I have a couple of books that are named differently and epubfixer shows an empty toc.

You are right it only looks at toc.ncx (for opf it looks at only the opf extension), I did not have any problem so I didn't look into it further.

I could do the following change either just look at the extension ncx.

Or a more proper way would be to check for the mimetype application/x-dtbncx+xml in the opf file. I will change it in the next version if there are some problem with some files. But I would like to see your opf & ncx file, just to be sure.

Another reason why the screen would be blank is because the ncx can't be parsed.

dapjukebox
02-04-2011, 04:16 PM
You are right it only looks at toc.ncx (for opf it looks at only the opf extension), I did not have any problem so I didn't look into it further.

I could do the following change either just look at the extension ncx.

Or a more proper way would be to check for the mimetype application/x-dtbncx+xml in the opf file. I will change it in the next version if there are some problem with some files. But I would like to see your opf & ncx file, just to be sure.

Another reason why the screen would be blank is because the ncx can't be parsed.

Thanks for the quick reply, to confirm my suspicions i have just had a peek at the source but as i am a vb sort of person it didn't mean much to me but i did find the bit where it looks for toc.ncx.
Here are both files from both books that alerted me to the problem. Hope they are of some use.
66057

66058

nrapallo
02-04-2011, 04:25 PM
Nigol, can you look at possibly fixing the behaviour of the "TOC Editor" screen's "Apply" or "Save" button when the "Add" screen is open.

I was in the middle of editing one of my huge .epubs, at the Add screen, and wanted to save my work-in-progress thus far. I clicked the Save button and the Add screen was closed. After opening the Add screen again (it took a loooong time on that .epub ;) ), I tried to click just the Apply button and the same thing happened. Instant closure of the Add screen.

Can you just leave that Add screen "as is" and wait for the user to Close that screen and then click Close to exit the TOC Editor screen to finish. This will allow multiple saves while the editing task is still in progress! :)

Jellby
02-05-2011, 05:39 AM
Or a more proper way would be to check for the mimetype application/x-dtbncx+xml in the opf file. I will change it in the next version if there are some problem with some files. But I would like to see your opf & ncx file, just to be sure.

The really proper way would be:

- For the OPF file, look into META-INF/container.xml (this filename does not change), and you'll find something like:

<rootfile full-path="OEBPS/content.opf" media-type="application/oebps-package+xml" />

there you have the OPF file, with full path.

- For the NCX file, look into the OPF file, and search the spine:

<spine toc="ncx">

here, "ncx" is the id of the NCX file. Now you have to search the manifest for the "ncx" id:

<item id="ncx" href="toc.ncx" media-type="application/x-dtbncx+xml" />

and there you have the NCX file.

DaleDe
02-05-2011, 01:56 PM
What formats, other than ncx, can the file be in? According to the spec as I recall that is the only supported format.

Nigol
02-05-2011, 02:12 PM
Yeah the opf file inside container.xml was on my todo list. But from the specs says there should only be 1 opf file inside the ePub. But regardless I think it is better to go the more proper way.

even if there should not be more than 1 opf file (I did not see the same for the ncx).

So I have changed the code to reflect the changes has it was proposed by Jelby.

Nigol
02-09-2011, 09:55 AM
Here are the changes in the new update. It should fix most of the problems that were reported.

v1.3.3
- The Show All checkbox will not be remembered anymore.
- The List of Anchors for each file will now be cached for each different Book.
- The Detected Text will now be cached for each different Book, along with the Anchors text.
- Removed the Apply button, it was replaced by a Add button.
- Using the Add command from the context menu will Add all the items under the selected node (instead of at the end of the document).
- The Save button will no longer close the window (and each related windows, exception is split chapters). You will now need to Save and Close.
- The file column width from the Add screen, will no longer have a maximum width.
- Also resizing the form will no longer adjust the columns width.
- The program will now correctly get the filenames for the NCX & OPF files
- For the OPF file it will get the path from the container.xml file (it used to check only for opf extension)
- For the NCX it will get the id from the spine and lookup the file associated with it in the manifest (it used to check for toc.ncx)
- In the Add window all files or anchors present in the TOC will be shown in Green.
- In the Add window with Show All deselected, Anchors present in the TOC will no longer appear.
- The Forms can now get on top of each other when opened and all will close when the main window closes (TOC or Reading Order editor).
- When opening the Add window, there will no longer be any validating to see if the files shown really exists in the ePub. It will instead
check if the file is present in the TOC when saving the ePub.
- When dragging and dropping Nodes they are no longer removed (with Show All off).
- The Add window will now remember if the nodes are Expanded when clicking Show All or Show Anchors.
- Fixed a problem with Reading order editor showing anchors.
- Shifting Chapters will now get the full source (with anchor) if the next/previous entry is the same file with a different anchor (before it just returned the top of the file).
- Fixed a problem when the source in the TOC was encoded with special characters (ex: %20 instead of a space).

Nigol
02-09-2011, 11:50 AM
The really proper way would be:

- For the NCX file, look into the OPF file, and search the spine:

<spine toc="ncx">

here, "ncx" is the id of the NCX file. Now you have to search the manifest for the "ncx" id:

<item id="ncx" href="toc.ncx" media-type="application/x-dtbncx+xml" />

and there you have the NCX file.

Well it looks like it is not the only way. I have just discovered a book that does not behave like that. Took a free retail book and found out that it did not have any id in the spine element at all. The TOC failed to open in calibre viewer, but did open correctly in Adobe Digital Edition. So I am thinking that Adobe does not even look at the spine for the TOC reference, but calibre does.

I will do a quick update to force the program to look deeper if this situation arise.

Update : v1.3.4 Fixes this.

- Found a situation where the Spine did not have a reference to the TOC (on retail books), So the App will look deeper if this situation arise.
- If the above situation arises opening the Reading Order Editor and Saving will force the reference into the spine. (a message box will open warning you about it)

nrapallo
02-09-2011, 01:06 PM
Here are the changes in the new update. It should fix most of the problems that were reported.

.... :zoiks: :goodjob: ... THANKS!

GeneS
02-09-2011, 01:15 PM
Great! Thanks for the update.:thanks::yahoo:

nrapallo
02-09-2011, 11:16 PM
Found some issues with v1.3.4, namely:

- Adding an anchor to the TOC Editor properly retains the link and makes it green, but dragging the same link using (ctrl)-click deletes the link from the Add screen, as before.

- In the Add screen, I can resize the "File" (filename) column, but I can't the "Detected Text" (anchor) column. What about allowing the columns to be sorted & reverse sorted?

- When saving a large epub (during a long edit session), there's no indication that the save is progressing while it's doing so. It just seems to freeze without any feedback. If I hit the Save button again it will crash saying the file is in use. :smack: Duh? :snicker:

But, overall I very pleased with your efforts to date!!!

p.s. :whistle: Nigol, did you know that Kindle ebooks also use a toc.ncx for their navigational d-pad and it is recommended to have one within .mobi ebooks by Kindle publishing standards? :wink3:

Nigol
02-10-2011, 12:20 AM
- Adding an anchor to the TOC Editor properly retains the link and makes it green, but dragging the same link using (ctrl)-click deletes the link from the Add screen, as before.

This is by design. With Show All on it will retain the entry by both dragging and Adding with the checkbox. With Show All off it will remove the entry with both ways. In fact it basically reloads just like when first opening the screen. While I have tested it fully there might be a bug somewhere.

- In the Add screen, I can resize the "File" (filename) column, but I can't the "Detected Text" (anchor) column. What about allowing the columns to be sorted & reverse sorted?

You can actually resize both column, but there is a minimum width to respect. I actually enabled the sort columns value, but can't seems to get it to work, or I may have to put my own code to allow it to sort. Documentation is pretty poor for the treeview control.

- When saving a large epub (during a long edit session), there's no indication that the save is progressing while it's doing so. It just seems to freeze without any feedback. If I hit the Save button again it will crash saying the file is in use. :smack: Duh? :snicker:

Actually the error you are getting is not because it is saving the file, but because it is extracting the files back to temp folder. You can see the progress bar at the bottom. The saving is all done before the extracting even begins. It is in fact very fast because there is just a little file to update, the program actually access the ePub pretty often without any hitch. I am re-extracting the files because if someone split the chapters it will have to re-extract the files for the preview to work correctly.

But I will put something to catch the error and prevent it from screwing your file when it arises.

What kind of format is the mobi files? It is not just a Zip file?

Update : Checking this has actually lead me to a big bug that will screw your file when saving more than once. SO please don't use it like that for now, I will post an update in a couple of minutes.

nrapallo
02-10-2011, 01:54 AM
Oops another issue.

I downloaded a Gutenberg .html and created a .epub using calibre via my GuteBook program and the resulting .epub fails to continue/open when the Add screen is invoked in v1.3.4. It does open at the Add screen properly in v1.3.2.

Is it coded improperly? The underlying .html is straight from Project Gutenberg etext #22381.

I attach that troublesome .epub below for your perusal.

Nigol
02-10-2011, 10:47 AM
Oops another issue.

I downloaded a Gutenberg .html and created a .epub using calibre via my GuteBook program and the resulting .epub fails to continue/open when the Add screen is invoked in v1.3.4. It does open at the Add screen properly in v1.3.2.

It is because you have a image in the Table of Content, because the previous version didn't care if Anchors were already present or not in the TOC when opening the Add dialog. Now it parses the files in the TOC to see which Anchors are present, And the problem was due to the App trying to parse the image (I guess that it would have taken a long time, but would have finished eventually.)

For now just remove your Unnamed file at the top and it will open right up, but I will put a check to remove it all together, because it will not work in calibre viewer (opens a different window) and ADE. I do not think it is supported to have a image directly in the TOC.

nrapallo
02-10-2011, 11:59 AM
Pushing the envelope always allows you to discover the weirdest things.... ;)

Thanks again! :2thumbsup

nrapallo
02-18-2011, 12:12 AM
Nigol, any interest in adding a new edit option in ePubFixer on the main screen, namely an "Edit Text Files" using any user-supplied text editor?

I have used tweak_epub (http://atlantiswordprocessor.blogspot.com/2010/09/tweaking-epubs-5-make-it-quick-with.html) (part of the Atlantis Word Processor) and it's simplicity is it's strength. It just opens the .epub, let's you change some text using your own text editor for any file therein contained (except images) and then saves the .epub.

It's useful for deleting/editing a CSS style that doesn't work or changing some metadata info. It doesn't pre-parse nor post-split like Sigil, but it get's you (quickly) right to the text you want to change and move on! :thumbsup:

jackie_w
02-18-2011, 12:40 AM
Nigol, any interest in adding a new edit option in ePubFixer on the main screen, namely an "Edit Text Files" using any user-supplied text editor?


Wouldn't this duplicate Calibre's Tweak epub feature?

(...Nigol is of course free to add whatever functionality he wants...)

Nigol
02-18-2011, 02:58 PM
Nigol, any interest in adding a new edit option in ePubFixer on the main screen, namely an "Edit Text Files" using any user-supplied text editor?

I have used tweak_epub (http://atlantiswordprocessor.blogspot.com/2010/09/tweaking-epubs-5-make-it-quick-with.html) (part of the Atlantis Word Processor) and it's simplicity is it's strength. It just opens the .epub, let's you change some text using your own text editor for any file therein contained (except images) and then saves the .epub.

It's useful for deleting/editing a CSS style that doesn't work or changing some metadata info. It doesn't pre-parse nor post-split like Sigil, but it get's you (quickly) right to the text you want to change and move on! :thumbsup:

Well there's kind of actually is this option. The Edit in Sigil option is not bound to the Sigil executable, but whatever program you set. You could actually use any editor. On closing it will restore the Table of Content by finding the files in the zip.

I have not tested it with the program you talked about, but I am sure it would work.

Update : I have tested it with the Tweak_epub you talked about and it works perfectly.

Chang
02-23-2011, 05:14 AM
The program is written in C#, which means that to run it you will need either .Net Runtime (3.5) or Mono on Linux or MAC.

That said Mono is not an exact port of the .NET framework and there will surely be some parts of it that are not working. Maybe someone with some experience with Linux could give a hand, has I don't really plan on using Linux soon.

But I have checked the compatibility with Mono. The only problem I see is the WebBrowser window not running on OSX. On version 1.2 only (I changed some things that would not have pass the tests.)

But there is some problems with the libraries I am using, but looking at the report it does not look like something that is used in my App and could be safely removed (all are open source). But there will have some testing to be done and some code modification to do.

Looks like a nice piece of software and would become handy because I use Sigil for editing my EPUB files. Problem is that I'm working on Mac. Any progress on building Mac version? Other question that comes in my mind is: after Sigil 0.4.0 release, will this be useless? Anyway, keep up the good work!

Nigol
02-23-2011, 09:52 AM
The Edit in Sigil would probably be useless, but it could be use changed to more easily send to third party editor. But the whole program will still have a use, the Table of Content editor for example.

Why don't you have a try at it with Mono? the split chapters will probably not work because the dll is native for windows (you could just replace it with the MAC version of Tidy). I think the preview might not work on MAC. BUt maybe someone could test it, I would love to have some feedback about OS X / Linux compatibility.

crutledge
02-24-2011, 01:26 PM
:thumbsup:I have been playing with the tool and it can be very useful.

Can it convert the inline toc to the toc.ncx? To me this would be very useful since the inline toc contains data no carried in the chapter header.

Perhaps I just need the "for dummies" version of instructions. :thumbsup:

Nigol
02-24-2011, 01:34 PM
:thumbsup:I have been playing with the tool and it can be very useful.

Can it convert the inline toc to the toc.ncx? To me this would be very useful since the inline toc contains data no carried in the chapter header.

Perhaps I just need the "for dummies" version of instructions. :thumbsup:

No it does not, but you can recreate it pretty easily with the Add window. But since calibre does exactly that it might not be necessary to have.

To do it in calibre, just type / in structure detection to disable it and click force auto generated chapter in the second screen and it will use the inline TOC to generate the toc.ncx. (I think, info from memory) You could then tweak it with ePubFixer.

nrapallo
02-24-2011, 02:14 PM
Can it convert the inline toc to the toc.ncx? To me this would be very useful since the inline toc contains data no carried in the chapter header.

Charlie, it doesn't automatically do this, but you can manually manipulate it to resemble that TOC. However, right now, ePubFixer works opposite to this way of thinking/processing, i.e. it shows you where the anchors are not where the hrefs are.

As an ebook creator, I too would like to know where <a href>'s are located and where they point (as I mentioned before :) ). This way it would be easy for you to replicate the internal TOC in toc.ncx form i.e. the Table of Contents .html page shows all the necessary hrefs/links, so it would be easier to have ePubFixer show you those href's in a way that adding them would duplicate its TOC structure.

Perhaps, Nigol, can revisit this and include a Show href option?

Perhaps I just need the "for dummies" version of instructions. :thumbsup:

I'm happy to assist, just link to an existing .epub you want to "fix" and how.

Nigol
02-24-2011, 05:36 PM
Perhaps, Nigol, can revisit this and include a Show href option?


I could, but like I said earlier calibre does convert inline TOC to a standard TOC.

But, I would like request where you can't really do that with anything else, or it takes 2 hours where I could automate this so it is easier.

Nigol
03-02-2011, 03:55 PM
Posted a new update. Some tweaks and bug fixes.

v1.3.6
- Put a Check that will prevent any none html file to be loaded or saved in the TOC.
- Changed the Version.xml location on the web, so it is more easily changed. Older version might not always show the new version number.
- Multiple Tweaks to Splitting so more file are compatible and do not crash.
- Changed the way settings are stored, so they are kept regardless of version, build or file location.
(The default MS was to have a setting file for each location and each version, so moving the executable would have all your setting lost.)
- A message will pop-up when opening a protected file, telling you it is protected and preventing you from editing this file.
- Added a Expand & Collapse All option in the Add window.
- When adding new Chapters, the text that was already selected in the Add window will now be remembered.
- In the Add window, clicking the columns header will sort the files.
- Added a Recent Files list under a new File Menu in the Main window.
- Fixed a Couple of Bug.

arman68
03-08-2011, 02:29 PM
How can we get the DRM build?

Nigol
03-08-2011, 08:46 PM
How can we get the DRM build?

You need to build it from the source, this way you also have the latest unreleased changes.

You will need Visual C# 2010 Express (free) or Visual Studio 2010
and tortoise SVN (free) to download the source from Google code

There is a special build called Release_DRM.

Also the option is turned off by default, you will need to enable it.

purcelljf
06-10-2011, 08:22 PM
This tool has been very useful to me in cleaning up some EPUB files I have (despite the improvements to Sigil 4.0). Thanks to the creator.

Nigol
06-10-2011, 08:30 PM
This tool has been very useful to me in cleaning up some EPUB files I have (despite the improvements to Sigil 4.0). Thanks to the creator.

Your welcome!

Funny thing about your post is that I just click on Forum Spy for the first time and I saw my post appear, just when i clicked on it. This is what I call timing.

I am also working on a new version, but I do not put more effort than i did previously, for lack of time (I used to work on it when it was boring at work, it hasn't for a while) and also I think the program is now pretty much stable.

I do have a couple of feature I already did in the source, but need to tweak a bit before releasing, like downloading a Table of Content directly from the Kobo site.

purcelljf
06-17-2011, 01:49 AM
One thing that took me a while to get used to was determining when the utility was processing the file and when it was finished. I usually open windows explorer now so I can see the tmp files being created and their subsequent disappearance.

Yeah, but I had a bunch of epubs I had created with Atlantis Word that had the cover image at the end of the reading order. Also, there were some Epubs that I needed to add a cover image and assign it to the TOC, but I couldn't do it efficieintly in Sigil, since Word Atlantis uses p tags for all the headings. I even had some EPUBs I couldn't open in SIGIL, but by simply using your utility and saving the epub, I was then able to open them in SIGIL. very cool

Nigol
06-18-2011, 01:01 PM
One thing that took me a while to get used to was determining when the utility was processing the file and when it was finished. I usually open windows explorer now so I can see the tmp files being created and their subsequent disappearance.


I know people have stated before that there is no feedback when a file is saved. I will put a message in the status bar in the next version when the file is saved.

But just to be clear the temp folder is there only for 1 reason, for the previews. Every file that is loaded (ncx or opf files) are loaded in memory from the epub and do not use the temp folder. The reason why I had to do a temp folder for the preview is that I need to have the CSS and Images to work properly.

When saving it takes only a second to update the file, and the progress bar at the bottom shows the status of temp files extraction. So when the files is saved the file is re-extracted, so when you see the progress bar filling again, it means that the file is already saved.

Update : Added to source

Nigol
06-18-2011, 11:16 PM
I uploaded Version 1.4.0

v1.4.0
- Using SendTo will Save the most recent files
- Opening a file that does not exists anymore will not crash the program and a message will warn you.
- Added a Delete Files in the Add screen (it will remove the selected files from the ePub and delete entries from the manifest & spine)
- Fixed a bug with Mass Rename if the entry selected had different "parents".
- Fixed a crash if a file was in the spine, but not the manifest.
- Added a kind of a HACK to force files with XML version v1.1 to be parsed.
- If multiple css file are present, It will now (hopefully) select the correct one.
- The CSS tag being for margins is now determined by the first class attribute seen (previously it was the body tag, now it will look further if not found)
- The Option from the Mass Rename tool-Words are UpperCase-has changed, instead you will have Convert To Uppercase & To Title Case.
It will work as Described but now doesn't work only on Number that where converted to Words but on all the text.
- Removed Wall of Text from the Mass Rename tool and added a help button that will show it for info.
- Added a Download button in the Add window, that will search the site Kobobooks for the TOC and add the entries found to the detected text menu.
- Added a Select Download Text in the Add window, to help selecting the chapters when using the Download button.
- Enabled Navigation in the preview window. (Note : when using navigation you may see character not correctly displayed,
this is because of IE and when you navigate to it the program does not fix the page, it does not mean that the book will display that way.
Use the preview button to make sure)
- Added a Saved Message or Error Message when Saving in the status bar. (It will be shown during 5 seconds)
- Added a Select Previous Text option in the Add dialog.
- The Decrypt Files setting is now on by default when using a DRM build.

Nigol
06-25-2011, 12:13 AM
Small Update

v1.4.1
Added support when filenames with spaces were changed to special character (ex: %20). It happens usually with Sigil 4.

virtual_ink
06-29-2011, 03:49 AM
I'm new to epub creation, new to this forum, and I'm not sure if this is the best place to post my query (or what info I should provide). Please let me know if I should be asking elsewhere and/or including some example files.

An epub I received back from Kobo was rejected by Apple (needs subsections listed in the table of contents). A few hours later, I've hand edited my first TOC file (its like learning a new language!). I've finally added all the sub sections, and its validating fine.

However, when testing on the iPad - all the page numbers on the toc only appear when in horizontal view. In vertical view, only the first six chapters/subsections have pg numbers, and those page numbers are mostly incorrect (the cover, copyright and title page numbers are fine).

Is this a known problem? Wondering if I can fix it, or just remove page numbers altogether (which seems sensible/less problematic) but I don't know how to do either. Not having much luck with google so far. Any help much appreciated!

PS: I edited the TOC file in TextWrangler.

Nigol
06-29-2011, 02:01 PM
First this isn't related to my App, so maybe not the best place to post. My tool is used to create TOC automatically.

Second, because of the way eReader works, a page on a iPhone or on a Kobo will not be the same, also depends on the formatting you have done. So most reader just calculate the page number (I think 1000 word is a page) or like iBooks it just has a page number for each page, so if you put the fonts bigger, your number of pages will increase.

Because of this there is some reader that put the "real page number" beside the calculated page number (the Kindle I think does this), but it must be written inside the TOC. I do not know what you have done, but my thought is that it is these page numbers you have stated, which is very optional.

Also not knowing for which application you are trying it I can't tell you exactly why you are having this problem. I suggest that you read the ePub Specs for all the information you need and more. Also use software like Sigil and calibre, if my tool can help you give me some feedback.

You must mostly need the navmap part of the TOC, if you have anything else, just ignore it.

NCX Specs (http://www.niso.org/workrooms/daisy/Z39-86-2005.html#NCX)
Info on Page Numbers in TOC (http://www.epubbooks.com/blog/346/marking-up-page-numbers-in-the-epub-ncx)

egypt
09-17-2011, 01:27 AM
Hi Negol,

I wonder if you are working on a MAC version of your tool? Please let me know. Thanks a lot.

Nigol
09-17-2011, 06:52 PM
You could try with mono, because it is a mac/linux replacement of .NET framework.

But I did try it briefly with mono in linux and although it worked, They might be small issue like the preview not working. I haven't checked on it further. But since I do not have access to a mac you could give it a try. I think mono is installed by default on OSX.

For linux (on a Backtrack 5 R1 VM) all I did was install mono-runtime & libmono-winform2.0-cil. Running it with
"mono ePubFixer.exe". Since OSX is linux based it should work also.

Tell me of any issue you might have.

JeremyR
09-18-2011, 04:24 AM
This might seem like a redundant request, but it would be very nice if this could generate an inline TOC (an html page in the book as well as the real TOC.

It would be very useful for people who want to convert their epub into mobi for Amazon, which for some reason needs two different TOCs.

(Calibre does this, but puts the inline TOC at the end of the book, which Amazon doesn't like

Nigol
09-20-2011, 03:48 PM
v1.5.0
- Added a Select All option inthe context menu of the Add window. It will select all the nodes that are expanded.
- Added the Cover Editor to edit the cover without the need to reconvert with calibre. (look in the readme for additional info).
- Added an option to create an Inline Table of Content (look in the readme for additional info).
- Added an option in the setting menu will let you remove margins in the body Style instead of zeroing them. (usefull with the Kobo Touch when margins can not the modified in book.)
- Added support when only .NET 4 was installed (only XP computers, since other already have .NET 3.5 preinstalled)
- Support when Sigil encodes filenames like URLs, they will now be decoded.
- You can set the type of file (Cover & Table of Content) in the Add windows, this is used with the Inline TOC & Cover Editor.
- Deleting a file did not delete the actual file in the Zip. Also it also removes the info in the guide.
- Plenty of Other fix.


For the Inline TOC, make sure that you set your existing Table of content before (check in the Add window), because if it is not already set, it will not rewrite it, but create a content.html file inside the book. You can also do this with from Sigil.

For the Cover editor please note that when unchecking the Preserve Aspect Ratio, it will resize the image to fit a ratio of 600 x 800 (0.75) and change the html code for the cover so that it fits in a box of 600 x 800. This was done because on my Kobo Touch, this was the only way for it to have it generate a cover without borders. So people with other ereaders, please give your feedback. With it it is basically the same has calibre does.

Nigol
10-12-2011, 03:40 PM
New Version available

v1.5.2
- LibTidy didn't work on 64bit systems, the app will now be 32bit even on 64bit systems.
- Added a confirmation box to replace the Inline TOC before doing so.
- Removed Edit HTML Only from Cover Editor, and will make the cover fit to the window, instead of forcing to a 600 x 800 window.
- The id of a Created Inline TOC will be the filename instead of a GUID.
- Added a fix for some files that sigil 0.4.2 can't open, because of a badly formed content.opf file. Opening Sigil or Saving the file through ePubFixer will fix them.
- Bundled a DLL that was required for the libtidy.dll file that is part of Visual C++ Runtime, that if missing from the computer would crash ePubFixer.

jackie_w
10-12-2011, 05:52 PM
Hi Nigol,

I wonder if you would explain something regarding cover update?

I notice that if I uncheck 'preserve aspect ratio' then I get an svg cover with this attribute:
preserveAspectRatio="xMidYMid meet"

If I do a Calibre conversion with svg set to 'don't preserve aspect' then I get:
preserveAspectRatio="none"

If viewing in the Calibre epub Viewer, only the Calibre version actually fills the screen - no matter what shape/size the window is. Your version maintains a 3:4 ratio.

Is there some benefit to doing it this way. For users with a 600x800 reader it may not make any difference, but for those with a 7" reader I believe the screen is 600x1024, i.e not 3:4 ratio.

By the way, I'd like to thank you for your work on this utility, I use it all the time :)

Nigol
10-12-2011, 09:03 PM
I did wonder if I should leave it like earlier version where unchecking preserve aspect ratio would change it to preserveAspectRatio="none", but I though that since the image is already re-sized to a 3:4 ratio it won't change anything anything. And that way it might look more correct in the calibre viewer for example.

But like you said I am sure not all reader have the same ratio, so I could revert it like old version and have it put it to "none", but the resizing of the image should also follow.

So I am thinking what about a menu where you can select your aspect ratio, so the image will also follow.

So the preserve aspect ratio mostly only do changes the ratio of the image to 3:4. I do this because on my Kobo Touch, even though it is supposed to resize the image to fit the screen and doesn't always. Maybe other reader don't have this problem.

SO should I just revert it back to preserveAspectRatio="none" like calibre and should I also add a way to set the preferred aspect ratio for the image resizing, if so what are the ratio for other reader or is it only 600 x 1024. The easier way would be to put a menu and select by size since I am sure that a lot of people are not aware of their screen resolution.

jackie_w
10-12-2011, 09:15 PM
I think if you use preserveAspectRatio="none" then you don't need to change the image size at all.

I don't know whether it is device-specific but all my Sony's and PocketBook display preserveAspectRatio="none" svg covers completely edge-to-edge whatever the size of the actual cover.jpg

Edit: I have a Calibre plugin used to copy Calibre covers to the reader to use as standby image(s). It was developed before readers started to have the use-current-book-cover-as-standby-image feature. The only screen resolutions I was asked to support are 600x800, 600x1024 and 824x1200

Nigol
10-12-2011, 11:01 PM
Well I will do both, because on my Kobo the image does need to be resized, because the device itself does it. but I think there is a bug where if an image is bigger that 600 x 800 it won't resize it properly.

jackie_w
10-12-2011, 11:18 PM
...but I think there is a bug where if an image is bigger that 600 x 800 it won't resize it properly.

Do you mean on the Kobo? Sonys/PocketBook are OK with "over-size" images, both as svg covers and as standby images.

Nooks and Kindles work OK with over-size images as standby images (my Calibre plugin has happy Nook and Kindle users), but I don't know about svg covers.

Nigol
10-12-2011, 11:29 PM
Do you mean on the Kobo? Sonys/PocketBook are OK with "over-size" images, both as svg covers and as standby images.


Yeah I mean on the Kobo Touch. Previously there was no resize going on, now it forces the images to fit the screen but even though the dev said it is ok now, I see that there is still some issue with some file, SO I resize them anyway just to be sure.

Nigol
03-26-2012, 08:43 PM
v1.5.3
- In the Cover Editor, unchecking the preserve Aspect Ratio box will revert to previous behavior of setting the SVG to "none" instead "MidXMidY meet".
- Added a menu in the Cover Editor to select the desired aspect ratio that the image will be resized.
- Fixed some issues with Mono / Linux. (Crash with Fix Margins, Preview working, Path issues, Recent Files working)
- Fixed some setting not being remembered or saved in the wrong place.
- Changed the way the Recent Files are stored in the settings.
- Clicking Rename will have the text selected in the Rename tool.
- The Keep Aspect Ratio checkbox inside of the Cover Editor will now be remembered.
- When Saving a cover you will be warned if the cover has a value of linear="no" (Putting the cover at the end of the book).
- Fixed a Memory problem where using the Mass Update in the Cover Editor would eat up all the memory and crash.
- Covers will have a maximum height of 1600 when resizing them (having them not Preserve the Aspect Ratio),
because very high resolution images are sometimes not processed on some readers.
- Removed the Download button from the Add window, since Table of Contents are no longer available on the Kobobooks website.

jackie_w
03-28-2012, 06:08 PM
Hi Nigol,

Glad to see you're still working on this project, I use it practically every day.

For those of us with multiple reading devices, is there some combination of settings I can use so that I end up with code of preserveAspectRatio="none" but without the image being physically resized. Then the same epub would fit to any size/shape screen 'on-the-fly'.

JSWolf
03-31-2012, 03:15 AM
Hi Nigol,

Glad to see you're still working on this project, I use it practically every day.

For those of us with multiple reading devices, is there some combination of settings I can use so that I end up with code of preserveAspectRatio="none" but without the image being physically resized. Then the same epub would fit to any size/shape screen 'on-the-fly'.

Why would you want the aspect ratio of the cover to be wrong? All that happens is it can end up looking awful. Sure you don't fill the screen, but that's OK. The cover will then look good. But if you have the cover fill the screen, then it's awful.

jackie_w
03-31-2012, 08:45 AM
Why would you want the aspect ratio of the cover to be wrong? All that happens is it can end up looking awful. Sure you don't fill the screen, but that's OK. The cover will then look good. But if you have the cover fill the screen, then it's awful.

It's all a matter of opinion, JSWolf. For me, 'awful' is when the screen isn't filled -- with one exception -- when the cover contains human beings. I don't like to see people's faces distorted.

Toxaris
03-31-2012, 02:35 PM
I agree with John, distortion is distortion and should be avoided at all costs.

Nigol
03-31-2012, 11:37 PM
For those of us with multiple reading devices, is there some combination of settings I can use so that I end up with code of preserveAspectRatio="none" but without the image being physically resized. Then the same epub would fit to any size/shape screen 'on-the-fly'.

I could just add a value to not resize in the drop down menu, but this wouldn't really matter since the reader would still resize the image either way, because of the "none" statement. Maybe I am mistaken and it might be that some reader don't use the "none" statement and the image is distorted but doesn't fit, in this case I think you are right and it would be useful to at least have a normal image.

I agree with John, distortion is distortion and should be avoided at all costs.

If you really disagree with the distortion, just leave keep aspect ratio on.

I for one hate having white strips on the cover.

On a side note I have been adding stuff periodically when I find a bug or an annoyance, I just didn't update the version yet. I was meaning to redo some of the code, because has I add stuff and I learn more, I am starting to see that there is some stuff that is really bad programming, even if it works. I usually work on this when It is boring at work, but I just don't have the time I had.

SO if you are interested in more up to date versions, just go on the google code page. I have added a compiled beta build to the subversion repository, so you can check the requested change there.

http://epubfixer.googlecode.com/svn/trunk/ePubFixer/bin/x86/Release/

I have already added the requested change.

Jellby
04-01-2012, 07:00 AM
It depends on the cover. If it's an abstract image, or just a texture with letters, then distortion might not be hideous. As soon as there is any real image there (people, landscape, painting) distortion should be punished. The worst thing about the new 16:9 TV ratio is that it brought distortion everywhere, argh!

jackie_w
04-02-2012, 07:25 AM
SO if you are interested in more up to date versions, just go on the google code page. I have added a compiled beta build to the subversion repository, so you can check the requested change there.

I have already added the requested change.

Thank you very much for this, Nigol :)

JSWolf
04-02-2012, 08:24 PM
Nigol, if you don't like white stripes then set the background to black and you won't have white strips. But depending on the color of the cover, it may or may not work.

If anyone makes an eBook with the aspect ratio incorrect, I think of them as a noob and should not be making eBooks.

Barb-B
07-29-2012, 05:33 AM
Just downloaded your little app, and it is seriously the most awesomely sweet little thing. I've been trying to do some editing of TOC in Sigil, and had gotten stuck on trying to figure out the NavPoint ID for where I wanted to add an entry. Your nifty tool was easy to use, and not only made it easy, but then I could re-open in Sigil and see what I'd been doing wrong before. Thanks so much for your masterfully nerdful contribution! !!!!!

Iskariot
10-28-2012, 07:43 PM
I had your tool lying around for a while and because calibre has no way of simply replacing a cover without rebuilding the entire epub I decided to finally try epubfixer last week.
I have to say it is a delight to use and an excellent addition to other tools like calibre and sigil.
I feel that fundamental, simple, easy functionality like this should be build into calibre.
Thanks.

Nigol
10-29-2012, 12:40 PM
Thanks to all, glad you like it.