![]() |
#16 |
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30
Karma: 15142
Join Date: Sep 2010
Device: SONY PRS-T1
|
gumalcan
glukkon The errors seem to be thrown by the XML parser. Could you provide me with the books which make problems, so I can debug the parsing process? glukkon To remove the char limit for PDF files, I first have to learn how to extract text from them and how to decrypt the text position descriptions. Any information about that is welcome... enitro May I ask what do you want to expand? |
![]() |
![]() |
![]() |
#17 | |
Member
![]() Posts: 15
Karma: 10
Join Date: Jan 2012
Device: Sony PRS-T1
|
This application is really-really great news. Thank you Yoths!
Struggling with a book deadline, I visited this forum after a while in hope for exactly these news. And -- a minute later I also found out about this excellent Calibre plugin as well. So, a really good day for me, and how I appreciate this community! However -- one tiny "please": could you add an option for exporting (text) notes in plain text instead of HTML? Something like this, separated by a blank line and with the page number in brackets: Quote:
Thanks for any feedback. (And, BTW, this Perl tagcloud is really great; it has proven itself as an excellent "last step" in my PRS-T1 reading workflow. Check it out everybody.) Last edited by martz; 04-04-2012 at 09:40 AM. |
|
![]() |
![]() |
Advert | |
|
![]() |
#18 |
Enthusiast
![]() Posts: 26
Karma: 10
Join Date: Mar 2012
Device: PRS-T1
|
Thanks Yoths, for the reply.
![]() I just want to look around the code and take requests, expand functionality and so on, you can PM me the source. Thanks. ![]() |
![]() |
![]() |
![]() |
#19 |
Junior Member
![]() Posts: 6
Karma: 10
Join Date: Apr 2012
Device: Sony PRS-T1
|
I would like to do this:
1. Read a book, highlighting important parts. 2. Use this utility to gather all my hightlights into 1 document. 3. Import that document into my reader so I can study only the important parts. Any chance of you beeing able to code this? I have not been able to import back to the reader your output. It is not in .epub or other acceptable format for it. Or if you know any other means to accomplish the 3 steps, let me know. EDIT: Also, If I marked 220 characters, and extended with 420 characters, that means there are 200 characters in the exported text that are NOT HIGHLIGHTED. Perhaps your util can now detect those, and keep only the highlighted text and make the .epub note-book only out of those? Last edited by papagelos; 04-09-2012 at 08:04 AM. |
![]() |
![]() |
![]() |
#20 |
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30
Karma: 15142
Join Date: Sep 2010
Device: SONY PRS-T1
|
A new version is available (links in the first post are updated).
What's new: - customizable HTML export (via "HtmlExportStyles.xml") - marginal bugfixes enitro You can download the source code from the first post. I'm sorry I kept you waiting... martz, papagelos I'm not yet going to implement other export formats. As workaround you can design your own HTML export style and convert the HTML output to whatever you want with Calibre. |
![]() |
![]() |
Advert | |
|
![]() |
#21 |
Enthusiast
![]() Posts: 26
Karma: 10
Join Date: Mar 2012
Device: PRS-T1
|
Thanks Yoths, appreciate it.
![]() |
![]() |
![]() |
![]() |
#22 | |
Member
![]() Posts: 15
Karma: 10
Join Date: Jan 2012
Device: Sony PRS-T1
|
Quote:
|
|
![]() |
![]() |
![]() |
#23 |
Junior Member
![]() Posts: 1
Karma: 10
Join Date: May 2012
Device: Sony PRS-T1
|
I just want to thank you for the very useful program! It does exactly what I was looking for
![]() Cheers Ebiel |
![]() |
![]() |
![]() |
#24 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
I got a PRS-T1 yesterday and I think that the highlight would be a handy thing for error hunting. To test it, I highlighted a few words and hooked the PRS-T1 to my computer. I fired up your program and it found that the book that I made a highlight in. When I press the export button, the following error pops u
![]() Any ideas? The ePUB validates and is not restricted in any way. |
![]() |
![]() |
![]() |
#25 |
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30
Karma: 15142
Join Date: Sep 2010
Device: SONY PRS-T1
|
Toxaris
Would you please post the the error message as well? |
![]() |
![]() |
![]() |
#26 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
The picture is the error message...
|
![]() |
![]() |
![]() |
#27 |
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30
Karma: 15142
Join Date: Sep 2010
Device: SONY PRS-T1
|
Hmm... I don't see any picture in your post...
edit OK, I got the picture (I have no access to dropbox here at work, so it is invisible for me in your post...) Toxaris Could you please try this version? Last edited by Yoths; 05-21-2012 at 08:31 AM. |
![]() |
![]() |
![]() |
#28 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
That version works without an issue!
|
![]() |
![]() |
![]() |
#29 |
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30
Karma: 15142
Join Date: Sep 2010
Device: SONY PRS-T1
|
A new version is available (links in the first post are updated).
What's new: - bugfix: export annotations containing "<", ">" and "&" charachters - bugfix: parse XML files importing a local DTD |
![]() |
![]() |
![]() |
#30 | |
Junior Member
![]() Posts: 2
Karma: 10
Join Date: May 2012
Device: Sony PRS T1
|
Quote:
To use the script, copy the 'books.db' file from the Sony reader (of course after the highlighting annotations are made with the Sony) in Your working directory, make two subfolders called joined and marked, copy all text files from Sony reader, which should be augmented by the Sony highlighting annotations into the subfolder joined and call the script. The augmented text files with the same file name are created then in subfolder marked and can be treated by Your favorite text editor on the PC. Here is the script: Code:
#!/usr/bin/python # insert_text_markers # Reads 'books.db' in current directory and converts # each TXT-file in subdir 'joined' into TXT-file in subdir 'marked' # with marked text indicated in 'books.db' marked by '[[[' and ']]]'. import os,sys import sqlite3 book2ind = {} # Text file names (without path) to contents index. annotation = [] # Array of annotations with rows (cid,txt,ca,cb). # Calculates byte offset from position coding in annotation table: def pos2ind(pos): if pos[0:4] == "TXTk": ind = 0 for k in range(15,11,-1): ind = 256*ind + ord(pos[k]) return ind else: return None # Compare function to sort annotations by range: def cmp_pos(a,b): if a[2] < b[2]: return -1 if a[2] > b[2]: return 1 if a[3] < b[3]: return -1 if a[3] > b[3]: return 1 return 0 # Reads book names and annotation ranges: def readdb(name): conn = sqlite3.connect(name) c = conn.cursor() for row in c.execute("SELECT * FROM books"): book2ind[row[13]] = row[0] for row in c.execute("SELECT * FROM annotation"): cid = int(row[1]) # The content id of the corresponding textfile. txt = row[6] # The marked text. ca = pos2ind(row[7]) # Start index of marked text in text file. cb = pos2ind(row[8]) # End index of marked text in text file. if ca != None and cb != None: annotation.append((cid,txt,ca,cb)) conn.close() def add_marks(all_txt,cur_cid): k = 0 n = len(all_txt) arr = [] for (cid,txt,ca,cb) in annotation: # print(cid,ca,cb,txt) if k <= ca: arr.append(all_txt[k:ca]) arr.append("[[[") arr.append(all_txt[ca:cb]) arr.append("]]]") k = cb arr.append(all_txt[k:n]) return "".join(arr) readdb("books.db") annotation.sort(cmp_pos) for name in os.listdir("joined"): if name in book2ind: print("Add marks to '%s' ..." % name) fh = open(os.path.join("joined",name),"rb") content = fh.read() fh.close() content = add_marks(content,book2ind[name]) fh = open(os.path.join("marked",name),"wb") fh.write(content) fh.close() Probable it should also run under Windows. I don't need a more sophisticated setup and changes for Your needs should be manageable. |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Annotations | vsh1ft | Onyx Boox | 1 | 01-04-2012 10:38 PM |
Pdf annotations and Kindle annotations | BranMakMorn | Calibre | 0 | 06-25-2011 02:42 PM |
Classic My annotations are gone | cypresstwist | Barnes & Noble NOOK | 0 | 09-26-2010 03:29 PM |
Neo Annotations | jezster | BeBook | 1 | 05-27-2010 03:20 PM |