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

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

Notices

Reply
 
Thread Tools Search this Thread
Old 04-29-2012, 06:58 PM   #1
Schrollini
Member
Schrollini began at the beginning.
 
Posts: 23
Karma: 14
Join Date: Apr 2012
Device: Sony PRS-T1
PRSAnnots: Managed annotated PDF files for your PRS-T1 or PRS-T2 (& maybe others...)

My PRS-T1 has been a great tool for reading and marking up papers in PDF format. But I wanted a way to get PDF files back off the the reader with the annotations on them, so I could review them on my computer. I couldn't find a tool to do this, so I wrote PRSAnnots.

There are several scripts included, so you can choose your prefered workflow. I wanted to be able to add a PDF to the reader, annotate it, and have it automatically synced, with annotations, back to my computer. This ability is provided by the annotation manager script, prsam. If you prefer a graphical interface, prsam-tk provides some of the same features with an ugly GUI. And if you just want to get a annotated PDF off the reader, use getannotations. All of the heavy lifting is split out into separate libraries, so I hope others can build even better tools.

Features:
  • Get PDFs with both highlighted and freehand annotations. (Text notes attached to highlighted annotations are supported, thus far drawn notes are not.)
  • "Dice" multi-column PDFs into subpages for easier reading and marking on the reader, and reassemble them back on the computer.
  • Run the PDFs through Ghostscript (if available) to produce smaller files that the reader can handle more easily.

PRSAnnots has been developed on Linux, but it should be cross-platform. I've done a little bit of testing on Windows, and I think things are working. But please let me know if you run into problems, either here or on the bug tracker, and I'll do my best to straighten things out.

Right now, this will only work with a Sony PRS-T1 or PRS-T2. From what I gather, the previous models store the same information, but in a different format. It shouldn't be too hard to support them, and I'm happy to assist in getting them to work. I don't know what the situation is with other brands, but I'll give what assistance I can.

PRSAnnots is released under the LGPL. I hope it's useful for you, but if it's not perfect, you can hack on it yourself. I'd love to see native GUIs for Windows and Mac and GTK and Qt, if you feel like building them.

Please check it out and let me know what works and what doesn't.

Last edited by Schrollini; 11-16-2012 at 10:43 PM. Reason: PRS-T2 support
Schrollini is offline   Reply With Quote
Old 05-04-2012, 12:04 PM   #2
spitfire_ch
Junior Member
spitfire_ch began at the beginning.
 
Posts: 7
Karma: 10
Join Date: May 2012
Device: Sony PRS-T1
Wow, you made may day! I have been looking for such a tool since the PRS-T1 was released, this is awesome! Thanks a ton!!!

Best regards
- spitfire
spitfire_ch is offline   Reply With Quote
Old 05-05-2012, 04:14 AM   #3
atels
Member
atels began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Apr 2011
Device: Sony PRS t-1
This app provides annotations and hanwriting while the text is zoomed in?
atels is offline   Reply With Quote
Old 05-05-2012, 06:37 PM   #4
Schrollini
Member
Schrollini began at the beginning.
 
Posts: 23
Karma: 14
Join Date: Apr 2012
Device: Sony PRS-T1
Quote:
Originally Posted by atels View Post
This app provides annotations and hanwriting while the text is zoomed in?
PRSAnnots runs on your computer, not on the reader, so it won't change how your reader operates. (I'm not sure why this thread ended up in a forum mostly devoted to rooted readers; apologies for the confusion.)

However, you can use the ability to "dice" PDF files into smaller pages to avoid the need for zooming on the reader itself. You might want to take a look at this screenshot tour to see what I mean.

Hope this helps.

(And thanks for the kind words, spitfire.)
Schrollini is offline   Reply With Quote
Old 05-05-2012, 06:48 PM   #5
atels
Member
atels began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Apr 2011
Device: Sony PRS t-1
Your app will be very useful for me! I will try it!

thanks!
atels is offline   Reply With Quote
Old 05-29-2012, 11:13 AM   #6
kopytozpakone
Junior Member
kopytozpakone began at the beginning.
 
Posts: 1
Karma: 10
Join Date: May 2012
Device: PSR-1
Help with Python

Hello,

thanks a million for this program! The Sony reader software did not work for me at all, so I really appreciate it!

The pictures draw perfectly.I have some issues with pdf highlited anotations: it says the text which was to be highlited was not found on the page. "This note was supposed to be attached to the following text, which was not found on this page." Maybe it is because I am not sure if I succeded installing PDFMiner. I am windows user, so donloaded the tar archive, unpacked with AllZip and run setup.py. Should I do something else?

Thank you,
Kopyto

Last edited by kopytozpakone; 05-30-2012 at 01:46 AM. Reason: solved part of the problem
kopytozpakone is offline   Reply With Quote
Old 05-30-2012, 10:00 AM   #7
Schrollini
Member
Schrollini began at the beginning.
 
Posts: 23
Karma: 14
Join Date: Apr 2012
Device: Sony PRS-T1
Hi kopytozpakone,

Glad to hear that PRSAnnots is sort of working for you. We'll see if we can fix your problems, but I suspect you may have run up against a current limitation in PRSAnnots.

First, I don't think you're having a problem with PDFMiner. If you were, PRSAnnots would probably exit with a confusing error message. But if you want to be sure, you can open a python interpreter, type import pdfminer, and press Enter. If you don't get an error message, it means that it's installed okay.

The problem is that, right now [1], PRSAnnots tries to find the text to highlight by looking for the string of text that the ereader thinks is highlighted. However, text in PDFs is just a bunch of characters placed on the page -- there's no unique way to turn those characters into strings. Sometimes the ereader and PDFMiner, the library I use, will do this is different ways. When this happens, PRSAnnots may not be able to find the text that the ereader says is highlighted, so it gives you that error message.

What it is supposed to do is tell you the text it was looking for after that error message. Do you see anything following the error message? (It probably looks like textwithnospaces.) Does this happen for every bit of highlighted text, or just some of them? Does it happen on all PDFs, or just a few? If it's an intermittent problem, then you've likely run up against the limitations described above. But if it happens everytime, then there may be something else wrong.

[1] I think I know a better way to do this, but it will take some reverse engineering. It's described here, and I welcome all the help I can get.
Schrollini is offline   Reply With Quote
Old 06-05-2012, 05:34 PM   #8
flobede
Junior Member
flobede began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Apr 2011
Device: Archos 70b
Hello, this seems really nice!
Nevertheless, if I understand correctly, it requires to install Python and run the script through it, right? I must say that I'm quite unexperienced in all this programming stuffs and I wondered to which extent it woulf be possible to insert this script in existing programs. In particular, there are two software I use to sync my documents with my PRS T1:
- Calibre (for litterature readings), where a similar plugin is available but that only works handwritten notes (see: http://www.mobileread.com/forums/sho...d.php?t=173321)
- Zotero for the research bibliography: there is a very convenient extension on it, named Zotfile (http://www.columbia.edu/~jpl2136/zotfile.html) that enables to push and pull pdfs to the eReader, but is unable to retrieve the annotations generated on the PRS-T1
Do you think that the program you developped could easily be insterted into one of these two softwares?
Best regards
FB
flobede is offline   Reply With Quote
Old 06-06-2012, 01:41 AM   #9
Schrollini
Member
Schrollini began at the beginning.
 
Posts: 23
Karma: 14
Join Date: Apr 2012
Device: Sony PRS-T1
Quote:
Originally Posted by flobede View Post
Nevertheless, if I understand correctly, it requires to install Python and run the script through it, right?
You do need Python installed. If you're using Mac or Linux, you almost definitely already have it. On Windows, there's a relatively painless installer available.

Quote:
Originally Posted by flobede View Post
I must say that I'm quite unexperienced in all this programming stuffs and I wondered to which extent it woulf be possible to insert this script in existing programs. In particular, there are two software I use to sync my documents with my PRS T1:
- Calibre (for litterature readings), where a similar plugin is available but that only works handwritten notes (see: http://www.mobileread.com/forums/sho...d.php?t=173321)
Since Calibre is written in Python [1], and has an extension mechanism, it would certainly be possible for PRSAnnots to function as a plugin. I'm happy to help someone do this, but I don't use Calibre, so I have no interest in doing it myself.

I recently saw the plugin you mention, and I offered my assistance in adding support for highlighting. No one has taken me up on that yet, but the offer remains open.

Quote:
Originally Posted by flobede View Post
- Zotero for the research bibliography: there is a very convenient extension on it, named Zotfile (http://www.columbia.edu/~jpl2136/zotfile.html) that enables to push and pull pdfs to the eReader, but is unable to retrieve the annotations generated on the PRS-T1
My guess is that this would be much more difficult. If I understand it, Zotero runs inside of Firefox, which means plugins will need to be programmed in Javascript, not Python. Much of the heavy lifting in PRSAnnots is done by two Python libraries, so it's not a simple matter of translations. But if someone wants to try, I'll do my best to at least explain what's going on in PRSAnnots.

In short, it's certainly possible, especially for Calibre. If someone takes it on, I'll do what I can to help, but I'm not going to do it myself (at least in the near-term).

[1] Which means that you already have Python installed on your machine. But Calibre installs its own private version of Python [a], instead of installing it for everyone to share. There's a chance the PRSAnnots installer will find this Python installation and use it, but I doubt it will. There's no harm in trying, though.

[a] Or at least it does on Linux, where such behavior is frowned upon. So I'm assuming it does the same on Windows, where this behavior is par for the course. [i]

[i] Why yes I have been reading too much DFW. Why do you ask?

Last edited by Schrollini; 06-06-2012 at 01:42 AM. Reason: Grammar
Schrollini is offline   Reply With Quote
Old 06-06-2012, 02:27 AM   #10
flobede
Junior Member
flobede began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Apr 2011
Device: Archos 70b
Thanks for your quick (and annotated) answer! I'll have a closer look at it to see if I may be able to do it, or if it is definitely too complicated for me.
flobede is offline   Reply With Quote
Old 06-14-2012, 06:34 AM   #11
Le_Tigre
Member
Le_Tigre began at the beginning.
 
Posts: 16
Karma: 10
Join Date: Feb 2012
Device: PRS-T1
Great
Many thanks to you! This is awesome!

My problem right now is:
(1) the sync will abbort when it has problems handling the pdf's - so having 1 pdf it can't sync will make it stop

(2) in my case it tended only to mark up the first 200 chars of the annotations and leave the rest unmarked...
Le_Tigre is offline   Reply With Quote
Old 06-15-2012, 12:38 AM   #12
Schrollini
Member
Schrollini began at the beginning.
 
Posts: 23
Karma: 14
Join Date: Apr 2012
Device: Sony PRS-T1
Quote:
Originally Posted by Le_Tigre View Post
My problem right now is:
(1) the sync will abbort when it has problems handling the pdf's - so having 1 pdf it can't sync will make it stop
Yikes! Thanks for catching this. I've pushed a commit to Github that should deal with this by displaying the error but continuing with the next PDF. Please let me know if that fixes this problem. Also, let me know if the problem handling the PDFs is in PRSAnnots, and if so, what it is.

Quote:
Originally Posted by Le_Tigre View Post
(2) in my case it tended only to mark up the first 200 chars of the annotations and leave the rest unmarked...
This is a limitation of how we find the text. Your reader has a database on it that stores information on the annotations. One column of this database stores the highlighted text, but only out to 200 characters. Right now, we try to find these characters on the page and highlight them.

There are two other columns that record the beginning and end of the highlighted region in a "pdfloc" structure. For various reasons, including the one you raised, I want to use this information to set the highlighted region. But the pdfloc format is apparently undocumented, so we'll have to reverse engineer it. Others have figured some of it out, so I think it's a matter of a few hours work to figure out the rest. Here's the progress so far. If anyone out there has insights on this, please speak up.

Thanks for reporting these.
Schrollini is offline   Reply With Quote
Old 06-15-2012, 12:40 PM   #13
Le_Tigre
Member
Le_Tigre began at the beginning.
 
Posts: 16
Karma: 10
Join Date: Feb 2012
Device: PRS-T1
thanks that you do take the pain on realising this. it might actually turn my prs-t1 into something I could work on / study with.

i tried to remove the coded 200 char limit from the reader (or better: enlarge it to 2000 chars (like it was on the older models)) - but failed to get it back on the reader via a install/update script. well I'm way to unexperienced to mess around with code i guess and finaly did not dare to push it after someone told me how to change system apps.
(the changes where rather easy to realise if someone knows what he actually is doing - (well - i did not )

but if i get it right pdf-loc actually will also prevent the error (text not found due to the strings beeing translated different...). so it even seems a better way to realise as it will keep the reader sql database smaler and solve the prob. mentioned in my first post.

i'll have a look if i can find any comments on how this could be realised and post them (if i find any)!

might even try to write to sony if they have any indications on how this could be realised...
Le_Tigre is offline   Reply With Quote
Old 06-16-2012, 07:14 PM   #14
Schrollini
Member
Schrollini began at the beginning.
 
Posts: 23
Karma: 14
Join Date: Apr 2012
Device: Sony PRS-T1
For anyone that wants to help decode the pdfloc information: I've written a quick script that will dump this information out to a text file. Here it is -- just click on the "raw" link to get the file itself. If you put it in the same place as getannotations, etc, from PRSAnnots, it should work. Then mark up a PDF, run the script, and see what you can puzzle out. Post your results here or on the bug.

Thanks!
Schrollini is offline   Reply With Quote
Old 06-26-2012, 05:52 PM   #15
dmiller
Enthusiast
dmiller began at the beginning.
 
Posts: 37
Karma: 16
Join Date: Nov 2011
Device: Sony PRS-T1
Schrollini, I'm anxious to try your program, but--with no previous experience using Python--I am having trouble installing it on my Windows 7 64 bit machine.

When I try to run the prsannots-0.1.1 installer program, I get this error message: "Could not create prsannots-py2.7" and then "Could not set key value Python 2.7 prsannots-0.1.1", etc.

I get the same error message after installing Python using the Windows x86 MSI Installer (2.7.3) and the regular Windows 2.73 installer.

After attempted installation the prsam files show up in the Scripts directory, but I get error messages within Python each time I try to run them.

What am I doing wrong?

Thanks!
dmiller is offline   Reply With Quote
Reply

Tags
annotation, pdf, sync

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't load unprotected PDF files on PRS-300 rsbrux Sony Reader 3 11-21-2010 03:26 AM
Can PRS-950 download pdf files using wifi? mgriffiths Sony Reader 1 10-18-2010 06:50 AM
eBook for PDF files? If so, Sony PRS 600? Alternatives? jferreir Which one should I buy? 4 08-12-2009 12:25 PM
PRS-700 vs PRS-505 for PDF files? LucidDreams Sony Reader 10 01-31-2009 05:16 AM
PRS-500 doesn't display .pdf files Big Brother Sony Reader 1 10-12-2007 10:02 PM


All times are GMT -4. The time now is 11:32 PM.


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