View Single Post
Old 01-16-2018, 11:38 AM   #266
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,737
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by BeckyEbook View Post
But ... How do I calculate line number for OPF (eg. in metadata, guide)?
Use the formula that KevinH provided and adjust the the character offset as follows:

Code:
coffset = charoffset(linenumber, colnumber, offlst)
if filename == 'content.opf':
    coffset += linenumber - 1
BTW, if you want to check for toc, text and cover guide/landmarks items, you might be able recycle some of the code of the KindleGen plugin, which checks for the presence of these items.

Last edited by Doitsu; 01-19-2018 at 07:49 AM.
Doitsu is offline   Reply With Quote