Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Sony Reader

Notices

Reply
 
Thread Tools Search this Thread
Old 04-04-2012, 05:27 AM   #16
Yoths
Enthusiast
Yoths is as sexy as a twisted cruller doughtnut.Yoths is as sexy as a twisted cruller doughtnut.Yoths is as sexy as a twisted cruller doughtnut.Yoths is as sexy as a twisted cruller doughtnut.Yoths is as sexy as a twisted cruller doughtnut.Yoths is as sexy as a twisted cruller doughtnut.Yoths is as sexy as a twisted cruller doughtnut.Yoths is as sexy as a twisted cruller doughtnut.Yoths is as sexy as a twisted cruller doughtnut.Yoths is as sexy as a twisted cruller doughtnut.Yoths is as sexy as a twisted cruller doughtnut.
 
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?
Yoths is offline   Reply With Quote
Old 04-04-2012, 09:38 AM   #17
martz
Member
martz began at the beginning.
 
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:
Annotation text annotation text annotation text annotation text. (pp 83)

Next annotation next annotation next annotation. (pp 84)
For explanation: I am using this awesome Perl script for generating tag clouds from my notes. And, of course, I could clean up your HTML file the corrseponding way by myself (with a macro) but I'd save a few keystrokes if I didn't need to do that :-)

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.
martz is offline   Reply With Quote
Advert
Old 04-04-2012, 09:45 AM   #18
enitro
Enthusiast
enitro began at the beginning.
 
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.
enitro is offline   Reply With Quote
Old 04-09-2012, 07:54 AM   #19
papagelos
Junior Member
papagelos began at the beginning.
 
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.
papagelos is offline   Reply With Quote
Old 04-12-2012, 11:39 AM   #20
Yoths
Enthusiast
Yoths is as sexy as a twisted cruller doughtnut.Yoths is as sexy as a twisted cruller doughtnut.Yoths is as sexy as a twisted cruller doughtnut.Yoths is as sexy as a twisted cruller doughtnut.Yoths is as sexy as a twisted cruller doughtnut.Yoths is as sexy as a twisted cruller doughtnut.Yoths is as sexy as a twisted cruller doughtnut.Yoths is as sexy as a twisted cruller doughtnut.Yoths is as sexy as a twisted cruller doughtnut.Yoths is as sexy as a twisted cruller doughtnut.Yoths is as sexy as a twisted cruller doughtnut.
 
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.
Yoths is offline   Reply With Quote
Advert
Old 04-13-2012, 06:37 AM   #21
enitro
Enthusiast
enitro began at the beginning.
 
Posts: 26
Karma: 10
Join Date: Mar 2012
Device: PRS-T1
Thanks Yoths, appreciate it.
enitro is offline   Reply With Quote
Old 04-24-2012, 11:43 AM   #22
martz
Member
martz began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Jan 2012
Device: Sony PRS-T1
Quote:
Originally Posted by Yoths View Post
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.
I'll do that, thanks very much for the tip.
martz is offline   Reply With Quote
Old 05-07-2012, 08:02 AM   #23
ebiel
Junior Member
ebiel began at the beginning.
 
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
ebiel is offline   Reply With Quote
Old 05-21-2012, 01:16 AM   #24
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
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 up:

Any ideas? The ePUB validates and is not restricted in any way.
Toxaris is offline   Reply With Quote
Old 05-21-2012, 03:29 AM   #25
Yoths
Enthusiast
Yoths is as sexy as a twisted cruller doughtnut.Yoths is as sexy as a twisted cruller doughtnut.Yoths is as sexy as a twisted cruller doughtnut.Yoths is as sexy as a twisted cruller doughtnut.Yoths is as sexy as a twisted cruller doughtnut.Yoths is as sexy as a twisted cruller doughtnut.Yoths is as sexy as a twisted cruller doughtnut.Yoths is as sexy as a twisted cruller doughtnut.Yoths is as sexy as a twisted cruller doughtnut.Yoths is as sexy as a twisted cruller doughtnut.Yoths is as sexy as a twisted cruller doughtnut.
 
Posts: 30
Karma: 15142
Join Date: Sep 2010
Device: SONY PRS-T1
Toxaris
Would you please post the the error message as well?
Yoths is offline   Reply With Quote
Old 05-21-2012, 04:04 AM   #26
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
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...
Toxaris is offline   Reply With Quote
Old 05-21-2012, 04:28 AM   #27
Yoths
Enthusiast
Yoths is as sexy as a twisted cruller doughtnut.Yoths is as sexy as a twisted cruller doughtnut.Yoths is as sexy as a twisted cruller doughtnut.Yoths is as sexy as a twisted cruller doughtnut.Yoths is as sexy as a twisted cruller doughtnut.Yoths is as sexy as a twisted cruller doughtnut.Yoths is as sexy as a twisted cruller doughtnut.Yoths is as sexy as a twisted cruller doughtnut.Yoths is as sexy as a twisted cruller doughtnut.Yoths is as sexy as a twisted cruller doughtnut.Yoths is as sexy as a twisted cruller doughtnut.
 
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.
Yoths is offline   Reply With Quote
Old 05-21-2012, 02:25 PM   #28
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
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!
Toxaris is offline   Reply With Quote
Old 05-22-2012, 10:12 AM   #29
Yoths
Enthusiast
Yoths is as sexy as a twisted cruller doughtnut.Yoths is as sexy as a twisted cruller doughtnut.Yoths is as sexy as a twisted cruller doughtnut.Yoths is as sexy as a twisted cruller doughtnut.Yoths is as sexy as a twisted cruller doughtnut.Yoths is as sexy as a twisted cruller doughtnut.Yoths is as sexy as a twisted cruller doughtnut.Yoths is as sexy as a twisted cruller doughtnut.Yoths is as sexy as a twisted cruller doughtnut.Yoths is as sexy as a twisted cruller doughtnut.Yoths is as sexy as a twisted cruller doughtnut.
 
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
Yoths is offline   Reply With Quote
Old 05-31-2012, 08:27 AM   #30
mhr
Junior Member
mhr began at the beginning.
 
Posts: 2
Karma: 10
Join Date: May 2012
Device: Sony PRS T1
Quote:
Originally Posted by Yoths View Post
I wrote a small tool for exporting annotations from the T1 to HTML.
...
Inspired from Your work and after looking into the source code I wanted to have something similar for pure '*.txt' files, to be able to mark errors in such pure text files without any text formatting on the Sony PRS T1 and to correct them later on the PC. I looked into the sq-database and recognized, how Sony saved the begin and end of the marks (its a binary coding) for '*.txt' files. Then I wrote a very basic Python script (no error handling) to augment the naked .txt files with marker symbols, which can easily be searched for in a standard text editor (I choose [[[ ]]] for the markers in the script).

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()
The code runs fine under Linux with python and python-sqlite3 installed.
Probable it should also run under Windows. I don't need a more sophisticated setup and changes for Your needs should be manageable.
mhr is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 08:26 PM.


MobileRead.com is a privately owned, operated and funded community.