[Enhancement] viewer command-line parameter to go to ePub TOC entry/bookmark

Bug #1656573 reported by Gary on 2017-01-14
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

There are many times when I would like to open an ePub in the viewer to a specific entry in the TOC. In my case, I am thinking of building an external searchable index for TOC entries so that I can search non-fiction works by topic and then would like to navigate to that topic. Perhaps the --open-at parameter could support that or page number, or a new parameter could be added.

Additionally, if the book is already open, from what I remember, the --open-at parameter seems to reparse and reload the book rather than check that the book is already open and merely go to a page.

Fixed in branch master. The fix will be in the next release. calibre is usually released every Friday.

 status fixreleased

Changed in calibre:
status: New → Fix Released
Gary (empedocles) wrote :

Fantastic. Thank you! Related to the use case I had mentioned above, is getting the path to the currently open book. It would certainly help tremendously. If it can be done, should I open up a new issue?

It can't be done. The viewer is an independent program not part of the
calibre GUI. As such viewer instances have no knowledge of easch other.
You can open multiple copies of the same book in multiple viewer

Gary (empedocles) wrote :

I am only concerned about the currently open book in the viewer. From that, my app can present and filter TOC entries for the open book, and then navigate more quickly than with the built-in UI. I understand there can be multiple instances, but is there anyway to, or possible future way, to determine the instance in focus? Or if the viewer is set to only allow one book at a time, can a command-line parameter be added so the open book can be determined?

Kovid Goyal (kovid) wrote :

Not really, for that to happen the viewer then has to gain the ability
to communicate with other instances, which is a lot of work for
relatively little gain. Patches are welcome.

Gary (empedocles) wrote :

Ok, I'll see if I can figure it out someday.

Gary (empedocles) wrote :

Perhaps if the viewer kept track of recently opened files, for a future menu item to open recent items, then I could at least find that in some file or place and use that as a hack to find the currently open book.

Preferences ==> Miscellaneous ==> open calibre config directory ==>

Look for the "viewer_open_history" key.

(Checking my history, it seems calibre sometimes stores relative paths,
presumably when invoking the viewer via the CLI using relative paths.
This seems rather incorrect.)

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers