View Single Post
Old 04-01-2022, 08:10 PM   #54
Terry Brown
Enthusiast
Terry Brown began at the beginning.
 
Posts: 41
Karma: 10
Join Date: Jun 2010
Location: Portland, OR
Device: M1 Max Mac Studio, iPad Pro 2018 12.9, iPhone 7
Quote:
Originally Posted by JSWolf View Post
There is a simple solution. You can do it the way the ModifyePub plugin does it. You can create an ORIGINAL_EPUB file for the original ePub is such a file does not exists. That way it's very easy to restore the original ePub if need be.
Is this what you are suggesting? Assume the epub file for a book is "book.epub" and I do the following with an external program:
  1. Copy book.epub
  2. Copy book.epub to book.ORIGINAL_EPUB
  3. Use
    Code:
    calibredb add_format
    to add book.ORIGINAL_EPUB to formats.
  4. Use
    Code:
    calibredb remove_format
    to remove book.ebub from the format list.
  5. Use my stuff to paginate my copy of book.epub and name it book.epub.
  6. Use
    Code:
    calibredb add_format
    to add the paginated book.epub to the format list.
  7. Done.

This gets the job done using all external tools. I could do this quickly (a day or two) and sort of integrate epubpaginator with Calibre.

But what I think is that you are suggesting I use ModifyePub as a template and create a Calibre Plugin.

Well.

I have looked at creating a Calibre plugin and I think it would take me weeks to figure out. I do pretty well with python and python libraries and I have figured out enough about epub to be pretty dangerous, but when I look at the Calibre plugin examples, my eyes glaze over. I spent my career writing verilog code and down to the metal diagnostic software to verify my hardware designs, not complex object-oriented code.

Classes and the complex structure of Calibre (to say nothing of QT) seem pretty overwhelming to me.

Would you recommend me not creating such a hack? Do you think maybe I am smarter that I think and can really make a Calibre plugin??

And, by the way, if I do generate ebook.ORIGINAL_EPUB, you imply it is easy to restore. Is that done by some magic in the calibre interface? or? The only way I can see to do this is to export ebook.ORIGINAL_EPUB to disk, rename it, and add it back.
Terry Brown is offline   Reply With Quote