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

Go Back   MobileRead Forums > E-Book Software > Calibre > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 03-19-2013, 05:27 PM   #31
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
Posts: 1,716
Karma: 509671
Join Date: Dec 2011
Location: Midwest USA
Device: Nook STR w/Glowlight, Kindle 3g, Droid
The anchor needs to be a tag with an id attribute. It's not required, but <a> is common:
Code:
<a id="split_here" />
Once that's in place, you need to edit the toc.ncx to add that anchor to the TOC.

Assuming that I added the anchor above to file "OEBPS/file0004.xhtml" I'd need to add an entry to the TOC that looks something like this:
Code:
<navPoint id="split_here" playOrder="99">
   <navLabel>
      <text>split_here</text>
   </navLabel>
   <content src="OEBPS/file0004.xhtml#split_here"/>
</navPoint>
I'd want to put that right after the navPoint for "OEBPS/file0004.xhtml"--or in the correct place in order if there are other anchors in file0004 that are in the TOC. Ideally, playOrder would be updated for the whole TOC list, but EpubSplit doesn't care.

(If you don't have another other anchored TOC entries for OEBPS/file0004.xhtml, you could put it at the end of the navMap tag as the last navPoint tag, but that's a bit ugly.)

I've attached an example.
Attached Files
File Type: epub Test Story Title 67 - Test Author aa.epub (13.6 KB, 26 views)
JimmXinu is offline   Reply With Quote
Old 03-20-2013, 10:27 AM   #32
cakiran
Member
cakiran began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Mar 2013
Device: Bluefire reader, samsung galaxy s3
Not giving split lines for the sample epub you uploaded

Quote:
Originally Posted by JimmXinu View Post
The anchor needs to be a tag with an id attribute. It's not required, but <a> is common:
Code:
<a id="split_here" />
Once that's in place, you need to edit the toc.ncx to add that anchor to the TOC.

Assuming that I added the anchor above to file "OEBPS/file0004.xhtml" I'd need to add an entry to the TOC that looks something like this:
Code:
<navPoint id="split_here" playOrder="99">
   <navLabel>
      <text>split_here</text>
   </navLabel>
   <content src="OEBPS/file0004.xhtml#split_here"/>
</navPoint>
I'd want to put that right after the navPoint for "OEBPS/file0004.xhtml"--or in the correct place in order if there are other anchors in file0004 that are in the TOC. Ideally, playOrder would be updated for the whole TOC list, but EpubSplit doesn't care.

(If you don't have another other anchored TOC entries for OEBPS/file0004.xhtml, you could put it at the end of the navMap tag as the last navPoint tag, but that's a bit ugly.)

I've attached an example.
I used the example epub file that you uploaded and ran it through epubsplit to find the split lines but it just outputs one line

output file: split.epub

and exits no split lines being output. I would expect to see an additional line added to the split lines for the new one we added. Am i correct? So that I can find out the line number and input it to epubsplit to split the epub on that basis. Am i wrong in this assumption?
cakiran is offline   Reply With Quote
Old 03-20-2013, 11:09 AM   #33
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
Posts: 1,716
Karma: 509671
Join Date: Dec 2011
Location: Midwest USA
Device: Nook STR w/Glowlight, Kindle 3g, Droid
If you run it without any line numbers, yes it should be giving you the list of split lines. It does for me.

You might want to make sure you have the most recent version from the source repository--it's split line output is cleaner than the earlier version.
JimmXinu is offline   Reply With Quote
Old 03-20-2013, 03:03 PM   #34
cakiran
Member
cakiran began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Mar 2013
Device: Bluefire reader, samsung galaxy s3
Quote:
Originally Posted by JimmXinu View Post
If you run it without any line numbers, yes it should be giving you the list of split lines. It does for me.

You might want to make sure you have the most recent version from the source repository--it's split line output is cleaner than the earlier version.
Thanks I was able to make it work. The name of the book as it had spaces was not being properly input into my .net app which i fixed and it is working fine.

But for some reason if we do this split_here thing it doesn't copy the TOC file over to the new epub. I tried to move the split_here anchor navpoint to the end of the TOC file even then it doesnt work.
Is there something that is different in these files that it is missing the .ncx file in the resulting file?
cakiran is offline   Reply With Quote
Old 03-20-2013, 03:10 PM   #35
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
Posts: 1,716
Karma: 509671
Join Date: Dec 2011
Location: Midwest USA
Device: Nook STR w/Glowlight, Kindle 3g, Droid
Quote:
Originally Posted by cakiran View Post
But for some reason if we do this split_here thing it doesn't copy the TOC file over to the new epub. I tried to move the split_here anchor navpoint to the end of the TOC file even then it doesnt work.
Is there something that is different in these files that it is missing the .ncx file in the resulting file?
EpubSplit includes only the TOC entries for the split lines you included in it's output.
JimmXinu is offline   Reply With Quote
Old 03-20-2013, 03:14 PM   #36
cakiran
Member
cakiran began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Mar 2013
Device: Bluefire reader, samsung galaxy s3
No TOC.ncx file in the result epub

Quote:
Originally Posted by JimmXinu View Post
EpubSplit includes only the TOC entries for the split lines you included in it's output.
I have included lines at least 19 lines but none show up in the table of contents. The pages are moved but not the TOC. I opened up the epub and didnt see the TOC.ncx file there. Any reason?
cakiran is offline   Reply With Quote
Old 03-20-2013, 03:26 PM   #37
cakiran
Member
cakiran began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Mar 2013
Device: Bluefire reader, samsung galaxy s3
I tried it on the Test Story Title 67 - Test Author aa.epub with the following lines (0 1 2 3 4 5 6) that you uploaded and it also din't show the table of contents.
cakiran is offline   Reply With Quote
Old 03-20-2013, 05:30 PM   #38
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
Posts: 1,716
Karma: 509671
Join Date: Dec 2011
Location: Midwest USA
Device: Nook STR w/Glowlight, Kindle 3g, Droid
Interesting.

In windows, on command line, epubsplit throws an encoding error when it tries to include line 2 in the TOC. That's a line of deliberately difficult characters--it is a testing file after all.

It works fine in calibre, and it works fine if you skip that line. I'll look into it.

The split.epub was started, but it wasn't finished. That's why it appears as if it somewhat worked. Running on CLI, you should have seen error message when it failed.
JimmXinu is offline   Reply With Quote
Old 03-20-2013, 05:51 PM   #39
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
Posts: 1,716
Karma: 509671
Join Date: Dec 2011
Location: Midwest USA
Device: Nook STR w/Glowlight, Kindle 3g, Droid
I've put a fairly brute force fix for that problem in. Go grab the most recent version from the source repository again.
JimmXinu is offline   Reply With Quote
Old 03-20-2013, 05:53 PM   #40
cakiran
Member
cakiran began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Mar 2013
Device: Bluefire reader, samsung galaxy s3
Quote:
Originally Posted by JimmXinu View Post
Interesting.

In windows, on command line, epubsplit throws an encoding error when it tries to include line 2 in the TOC. That's a line of deliberately difficult characters--it is a testing file after all.

It works fine in calibre, and it works fine if you skip that line. I'll look into it.

The split.epub was started, but it wasn't finished. That's why it appears as if it somewhat worked. Running on CLI, you should have seen error message when it failed.
Tried on 2 files including the sample from you and am getting the following error message on CLI.

File "C:\Python27\lib\codecs.py", line 351, in write
data, consumed = self.encode(object, self.errors)
nicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 21: ordinal
not in range(128)

File "C:\Python27\lib\codecs.py", line 351, in write
data, consumed = self.encode(object, self.errors)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 98: ordinal
not in range(128)
cakiran is offline   Reply With Quote
Old 03-20-2013, 05:57 PM   #41
cakiran
Member
cakiran began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Mar 2013
Device: Bluefire reader, samsung galaxy s3
Thanks it worked for one file.

Quote:
Originally Posted by JimmXinu View Post
I've put a fairly brute force fix for that problem in. Go grab the most recent version from the source repository again.
Cool it worked for one file. I will extensively test tomorrow and let know if any thing interesting.

Thanks.
cakiran is offline   Reply With Quote
Old 03-27-2013, 07:47 PM   #42
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 37,614
Karma: 18390312
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Sony Reader PRS-650, iPad, nook STR
Quote:
Originally Posted by JimmXinu View Post
Not in EpubSplit.

Word count is somewhat variable depending on who's doing the counting and page numbers are vary widely, again depending on who's doing the counting.
If you use the ADE way of counting pages, there's no issue there. ADE being the most widely used software for reading ePub, the page numbers people get are most likely going to be the ADE method.
JSWolf is offline   Reply With Quote
Reply

Tags
.net, automate, calibre, commandline, epubsplit

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[GUI Plugin] EpubSplit JimmXinu Plugins 149 10-06-2014 10:34 AM
Automate Calibre Tagging ohemeffgee Library Management 1 11-11-2012 06:56 AM
Any way to automate editting metadata? louwin Library Management 4 04-24-2012 06:58 PM
Help Merging Multiple Small Epubs into One Large Epub kazbates Workshop 14 09-15-2011 02:18 AM
I am looking for a tool that could automate convertion of... astra Workshop 24 08-30-2009 06:38 AM


All times are GMT -4. The time now is 04:55 AM.


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