Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 11-13-2009, 10:31 AM   #31
rvdparis
Connoisseur
rvdparis doesn't litterrvdparis doesn't litter
 
Posts: 53
Karma: 140
Join Date: Apr 2009
Device: Kindle Touch + iPad 1 + iPhone 4
I tried your script on OSX (10.6.2) and I get an error; could you help me out?

python annot.py /READER
/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/pyPdf/pdf.py:52: DeprecationWarning: the sets module is deprecated
from sets import ImmutableSet
Traceback (most recent call last):
File "annot.py", line 295, in <module>
p = Prs600Markup(topdir)
File "annot.py", line 252, in __init__
"/database/cache/cacheExt.xml")
File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/xml/dom/minidom.py", line 1918, in parse
return expatbuilder.parse(file)
File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/xml/dom/expatbuilder.py", line 922, in parse
fp = open(file, 'rb')
IOError: [Errno 2] No such file or directory: '/READER/database/cache/cacheExt.xml'

Although that directory and file DOES exist.
Thanks!
R
rvdparis is offline   Reply With Quote
Old 12-10-2009, 12:35 AM   #32
CDavisJK
Junior Member
CDavisJK began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Oct 2009
Device: PRS-600
Thanks cedricp. I just got this to work on my Ubuntu box. I changed the jarnal style from "red" to "black" in your script so that it doesn't stand out as much. The script works great. Some of the outer edges of my annotations are cut off a little but it is not a big deal because it can still be read.

I might try to update this script to get this working a little better if you don't mind.


Oh, also, for Ubuntu users, you will need to do a "sudo apt-get install python-pypdf" to get the proper python pdf libraries.
CDavisJK is offline   Reply With Quote
Advert
Old 12-10-2009, 02:14 AM   #33
cedricp
Research User
cedricp began at the beginning.
 
cedricp's Avatar
 
Posts: 17
Karma: 16
Join Date: Oct 2009
Device: PRS-600
Yes, please go ahead with improving it And please post it back.

Here are 2 problems that I've found but not solved, mostly by lack of time:
- After some use, I found that it was better to only annotate on the right margin, because the left margin can be cut, possibly by jarnal.
- Also, the scaling does not work so well when using a5 paper, or half-letter. I think there is some offset/margin that they add in their transform, but I could not find them.

Thanks
cedricp is offline   Reply With Quote
Old 12-10-2009, 02:16 AM   #34
cedricp
Research User
cedricp began at the beginning.
 
cedricp's Avatar
 
Posts: 17
Karma: 16
Join Date: Oct 2009
Device: PRS-600
This is weird. I have no idea what would cause the open to fail. Did you try using the open command on the same file in the python console?
cedricp is offline   Reply With Quote
Old 12-15-2009, 03:14 PM   #35
CDavisJK
Junior Member
CDavisJK began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Oct 2009
Device: PRS-600
I got my annotations matching up with the PDF Text a little better now. How I mark up my book is by putting brackets (like [ and ] ) around the text in the margins and making notes there, instead of using a highlighter.

In the python script, under class FreeHand, I have changed "xoff = -20" to be "xoff = -50" and it has been working out better for me.

Thanks again for the script! =)
CDavisJK is offline   Reply With Quote
Advert
Old 12-15-2009, 03:19 PM   #36
CDavisJK
Junior Member
CDavisJK began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Oct 2009
Device: PRS-600
Quote:
Originally Posted by rvdparis View Post
I tried your script on OSX (10.6.2) and I get an error; could you help me out?
I was getting errors until I installed the python-pdf libraries. I'm not sure where to get them in OSX.

However, looking at the script you see:
import pyPdf
import os
import sys
import base64
import shutil
import tempfile
import xml.dom.minidom

These are the packages that you need to work the script. The one that you might be missing is pyPdf. There is a website for the project where you can download the utility, try to install it and see if that works: http://pybrary.net/pyPdf/
CDavisJK is offline   Reply With Quote
Old 12-18-2009, 03:34 AM   #37
computermacgyver
Junior Member
computermacgyver began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Dec 2009
Device: Sony Reader Touch
Works for Touch Edition too

Thanks, cedricp, for the script. It works for me on the Touch Edition too. I just had to update the two directory locations

Changed:
svgdir = self.topdir + "/data/markup/" + self.path
To:
svgdir = self.topdir + "/Sony Reader/markup/" + self.path

and
self.dom = xml.dom.minidom.parse(self.topdir+\
"database/cacheExt.xml")
to
self.dom = xml.dom.minidom.parse(self.topdir+\
"/Sony Reader/database/cacheExt.xml")

. I would really love to get highlights to extract. I've played with the pdfloc tags, and it seems it of some format similar to
#pdfloc(doc_id,page,para,d,char,0,g,1)
where
doc_id document_id? same for all annotations in a document
page page number starting from 0
para paragraph or line? starting from 0, restarting on new page
word word on line, starting at 0
char character starting from 0, restart numbering on new word
0 always 0?
g not sure, perhaps unimportant or related to deleted annotations?
1 always one?

I am unaware of a good PDF library that would allow me to add highlights to a PDF file at a certain page/character location. Does anyone have ideas?

All the best,
Scott
computermacgyver is offline   Reply With Quote
Old 12-27-2009, 02:06 AM   #38
computermacgyver
Junior Member
computermacgyver began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Dec 2009
Device: Sony Reader Touch
Scale attribute

FYI, the script does indeed only work for fully zoomed out annotations. Each "Freehand" annotation is associated with a specific zoom level (specified in its XML tag by the scale="0|1|2|3|4" attribute. Unzoomed is scale="0")

Annotations made on one zoom level do not show on another zoom level (when viewing on the reader itself).

I've made all my annotations under the "L" zoom size (scale="2") so they are obviously misplaced in the jarnal files created. My eyes aren't good enough to make the annotations on the unzoomed in files; so, I think I'm back to the drawing board on a good way to export notes from the Reader still.

How silly.
computermacgyver is offline   Reply With Quote
Old 01-18-2010, 05:00 PM   #39
greenhorn
Junior Member
greenhorn began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Jan 2010
Device: PRS-600
Question

Hi everyone,

first of all: I'm amazed by the fact that there are people like you out there that are capable of finding solutions to problems that sony tells me can't be solved. Thanks!

As you can see, I have hardly got a clue what you guys are talking about here though I've tried and read everything over and over and over again... Sorry

What I do understand is that your python script thingy does exactly what I'd like to do: combine the pdf-files I have and my notes to eventually get a printable version. correct?

I dont understand your explanation, though.

"Usage: annot.py /media/READER "

do i copy the uncompressed file to "F:\database\media" ? or do i rename it according to whereever my database is located? or do i change something in the script while creating an executable version (which - as you can imagine - i have no clue about :/ )
what programe do i use to do so?

I'm so sorry for wasting your time by being such a greenhorn but I would love to get this to work (what do notes serve me if i cant back anything up in case something breaks or if i cant export a readable version where pdf plus notes are "connected"??!) so I would really, really appreciate your help!! ... please...

Thank you so much in advance!

btw I have the prs-600 touch edition... dont know if thats relevant.
greenhorn is offline   Reply With Quote
Old 01-22-2010, 12:22 AM   #40
kronium
Member
kronium began at the beginning.
 
Posts: 15
Karma: 16
Join Date: Jan 2010
Device: Sony PRS-600
No solution for highlighting yet? ARGH, this may be a deal breaker for me.
kronium is offline   Reply With Quote
Old 01-22-2010, 01:03 AM   #41
CDavisJK
Junior Member
CDavisJK began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Oct 2009
Device: PRS-600
Quote:
Originally Posted by greenhorn View Post
btw I have the prs-600 touch edition... dont know if thats relevant.
What Operating System are you using? I assume you are not using Linux, which would make running this script easier. Hopefully you are running MAC, which is similar to Linux (both based on Unix). But, based on your questions I assume that you are on Windows, which I don't use.

If you have a MAC: What you need to do is copy the script (which is named annot.py) to your desktop. Plug in your sony PRS600 and it will auto mount it to /media/READER. This is just the name of the directory. Then go to something like System > Utilities > Terminal or something to open up the MAC command line interface. In Linux you would do a change directory command: "cd /home/CDavisJK/Desktop" to get to your desktop. In MAC it will be something similar but with a different /directory/otherdirectory/etc

Now, if you are on Windows, I really lost. First off, you will have to install python. http://www.python.org/download/windows/ Then, you will open up the Windows command line. In XP you go to the Start menu, click Run, and in the Run prompt you will enter "cmd" without quotes as the command. In vista or 7 is might be similar, I havent really used either. Then you will plug in your prs600. However, you might have to run the command as "annot.py D:/READER"

Im sorry is this is still too vague. Post back with more details and Il try to help you, but if you arent running Linux or MAC I might not be able to help.
CDavisJK is offline   Reply With Quote
Old 01-23-2010, 06:38 PM   #42
greenhorn
Junior Member
greenhorn began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Jan 2010
Device: PRS-600
Thanks for your help, CDavisJK!

You were right, unfortunately I am using Windows Vista...

I've installed Python, opened up the Windows command line, typed cmd, then typed into the "black window" : C:\a\annot.py F:/Reader

and what happens is:

File "C:\a\annot.py", line 155
print "Annotations:"

SyntaxError: invalid syntax


is this at all what I'm supposed to do?

As I wasn't sure I also tried typing "C:\a\annot.py F:/Reader " directly into the command line.... The "black window" appeared for a really short time and apart from that I couldn't figure out what / if something happened.

... What exactly is supposed to be happening, anyway? I was kind of expecting to find a jarnal - file somewhere...


Thanks!
greenhorn is offline   Reply With Quote
Old 01-29-2010, 06:46 PM   #43
sujumayas
Junior Member
sujumayas began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Jan 2010
Device: PSR-600 Sony Reader Touch Edition
Quote:
Originally Posted by cedricp View Post
Hello,

Jarnal is a java note taking application (http://www.dklevine.com/general/soft...000/jarnal.htm). It saves its notes in .jaj file which is nothing more than a zip file of a config file and one .svg file per page. Hand-writing are represented as <path d="Mx y Lx y Lx y ..." .../> in this svg.

On the PRS-600, there is one xml file which list all the annotation in the reader's memory Digital Editions/Annotations/database/media/books, with one .annot file per annotated document. This document refers to .svg files a directory in database/markup/database/media/books. In these .svg, the hand writing is represented with polylines <polyline path="x,y x,y x,y..." .../>

I've just tried to create a .jaj file, unzip it, and put the data of one of my reader's svg in the jarnal svg, converting the polyline in path tag (with a vim macro).
Then rezipped the files in new .jaj, and reopen it. The marking seems to be at the right place.

The nice thing is that jarnal can then generate a new pdf, with the drawing integrated. This can then be reprinted...

I will not be able to develop the script to automate all this before 2-3 weeks, so I post it here in case someone has the skills and the time. Otherwise I'll post a note when/if I can implement it in november.

Good reading.
Oh men thats beautifull works for all handwritings in psr-600?
sujumayas is offline   Reply With Quote
Old 01-30-2010, 06:16 AM   #44
cedricp
Research User
cedricp began at the beginning.
 
cedricp's Avatar
 
Posts: 17
Karma: 16
Join Date: Oct 2009
Device: PRS-600
Free-hand annotation export updated

Dear all,

I've upgraded the annot.py script to take into account a different DB structure put by the reader on the micro-sd. Namely a /Sony Reader/database

I'm also only proposing to export the document for which there is at least one corner annotation, free-hand, highlight.... I'm displaying the corner annotation if it is a text.

HTH
Attached Files
File Type: zip annot.py.zip (3.8 KB, 457 views)
cedricp is offline   Reply With Quote
Old 01-31-2010, 08:14 PM   #45
Onecanuck
Member
Onecanuck began at the beginning.
 
Onecanuck's Avatar
 
Posts: 12
Karma: 10
Join Date: Jan 2010
Device: Sony PRS600S
Cedric.. you lost me at Hello! lol
Onecanuck is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PRS-600 Copying and viewing handwritten notes from PRS-600 stevet Sony Reader 6 07-27-2012 02:09 PM
Printing notes on DX? desertgrandma Amazon Kindle 8 10-16-2010 09:24 AM
Help please! Sony PRS-600:, notes & library adfines Introduce Yourself 7 05-03-2010 08:24 AM
In Dire Need of Workaround to Export Personal Docs with Notes Intact (Sony PRS-600) Secret Agent Man Sony Reader 7 03-23-2010 04:40 PM
PRS-600 Notes Limitations? dasnider Sony Reader 3 03-20-2010 12:14 AM


All times are GMT -4. The time now is 04:39 PM.


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