![]() |
#1 |
Junior Member
![]() Posts: 2
Karma: 10
Join Date: Mar 2012
Device: none
|
viewer questions
Is it possible to get the position or the reference (paragraph number) of a book's selectedText?
Also, is it possible to get the text of the paragraph that the selectedText is located within? Also, i'd like to be able to highlight the selectedText in a different color, and have that persist while the book is open. My assumption is that i would have to insert a <span></span> around the selectedText. Would this be something I'd do via Qt or javascript? |
![]() |
![]() |
![]() |
#2 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
An indirect answer to your question...
The viewer has a "Reference Mode" that can be turned on with the icon that looks like a tin of paint. When it is on and you put the cursor over a paragraph, it highlights the text and then displays a hint with the paragraph number. The code behind that should answer part of your question. |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,353
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Alll these things are possible using javascript, just google for how to do them and you will find plenty of hints. And you can change selection color using a special selection CSS selector, again googling will tell you how.
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Kindle Touch] No Image viewer and pdf viewer with white margins | MaxPowerITA | Kindle Developer's Corner | 7 | 04-24-2012 05:27 AM |
[old-topic]ebook-viewer: Open source, crossplatform viewer for EPUB, LIT, MOBI, etc | kovidgoyal | Calibre | 68 | 05-30-2011 08:46 PM |
E-Book Viewer as standalone viewer | Peter Swallow | Library Management | 3 | 05-15-2011 12:06 PM |
# user css for viewer.py/ ebook-viewer/ prs-650 | tscamera | Calibre | 0 | 01-02-2011 06:28 PM |
Ebook Viewer formatting questions | danwdoo | Calibre | 2 | 03-19-2009 09:06 PM |