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 06-27-2012, 01:27 AM   #16
Schrollini
Member
Schrollini began at the beginning.
 
Posts: 23
Karma: 14
Join Date: Apr 2012
Device: Sony PRS-T1
Quote:
Originally Posted by dmiller View Post
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.
I'm not a Windows user myself, so my suggestions will be a bit hit-or-miss. But the one Windows system I did test on was a 64-bit Windows 7 machine, so I have some hope we can get it working for you.

Quote:
Originally Posted by dmiller View Post
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.
Two things might be in play here:
  1. You need to install Python before running the PRSAnnots installer.
  2. You should run the PRSAnnots installer as Administrator. When I tried it as a normal user, I got several registry errors, which might be the ones you give above. PRSAnnots still worked, but the uninstaller didn't.

Quote:
Originally Posted by dmiller View Post
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.
I don't understand what you mean here. Did you get these errors while installing Python? Or did you install Python, and then get these errors while installing PRSAnnots? If it's the former, you're going to have to take it up with the Python installer people. If it's the latter, please see point 2, above. Try deleting all the installed files of PRSAnnots and reinstalling as Administrator.

Quote:
Originally Posted by dmiller View Post
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.
I'm afraid you're going to have to post the error messages before I have a chance of figuring them out.
Schrollini is offline   Reply With Quote
Old 06-27-2012, 01:40 PM   #17
dmiller
Enthusiast
dmiller began at the beginning.
 
Posts: 37
Karma: 16
Join Date: Nov 2011
Device: Sony PRS-T1
Thanks for your patience, Schrollini: Everything worked once I installed as an administrator and figured out how to run the program.

One question before I proceed further: Is there any danger of prsam-tk overwriting comments I've already made on a PDF on my ereader? Put differently, does one need to start the process with prsam or can add pdf's that have already been annotated on the PRS-T1?
dmiller is offline   Reply With Quote
Old 06-27-2012, 07:12 PM   #18
Schrollini
Member
Schrollini began at the beginning.
 
Posts: 23
Karma: 14
Join Date: Apr 2012
Device: Sony PRS-T1
Quote:
Originally Posted by dmiller View Post
Thanks for your patience, Schrollini: Everything worked once I installed as an administrator and figured out how to run the program.
Great to hear!

Quote:
Originally Posted by dmiller View Post
One question before I proceed further: Is there any danger of prsam-tk overwriting comments I've already made on a PDF on my ereader?
No. PRSAnnots never writes to the database where the comments are stored, and it never overwrites an existing file on the reader.

Quote:
Originally Posted by dmiller View Post
Put differently, does one need to start the process with prsam or can add pdf's that have already been annotated on the PRS-T1?
You can use prsam / prsam-tk with files already on the reader, though you won't have access to all of the options with those. Use the prsam import command, or select the file on the reader in prsam-tk. (Note that if you add a file from your computer that is already on the reader, you'll end up with two copies of it on the reader, which may or may not be what you intended.)

Good luck, and let me know if you have any more problems or questions.
Schrollini is offline   Reply With Quote
Old 06-29-2012, 04:10 PM   #19
dmiller
Enthusiast
dmiller began at the beginning.
 
Posts: 37
Karma: 16
Join Date: Nov 2011
Device: Sony PRS-T1
It seems that onecan't pull annotations from an already-annotated PDF on the reader. You have to set up the PDF with prsam before annotating. Is that correct?
dmiller is offline   Reply With Quote
Old 06-30-2012, 06:20 PM   #20
Schrollini
Member
Schrollini began at the beginning.
 
Posts: 23
Karma: 14
Join Date: Apr 2012
Device: Sony PRS-T1
Quote:
Originally Posted by dmiller View Post
It seems that onecan't pull annotations from an already-annotated PDF on the reader. You have to set up the PDF with prsam before annotating. Is that correct?
Existing PDFs may be imported into prsam with the instructions above. Note that you must import the file on the reader; if you select a file on your computer, prsam has no way (currently) to notice that the same file is on your reader. Also note that as soon as you import an annotated PDF into prsam, it will be synced to your computer (wherever you specified for this to happen). You won't see it listed as a file needing syncing until you make another change, but the annotated file should already be on your computer.

If it's not working, you can use the getannotations program to get an annotated version without messing about with the library manager. But let me know specifically what you did and I'll see if I can track down the bug.
Schrollini is offline   Reply With Quote
Old 09-12-2012, 11:40 AM   #21
arnoud999
Junior Member
arnoud999 began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Jul 2012
Device: PRS-T1
Hi Robert,

first of all, thank you for creating this awesome program! This is exactly what I needed .

Are you still working on this program at the moment? Because I have a lot of PDFs where your program can't find the text to be highlighted, and instead adds is as a note to the page. I think this often has to do with linebreaks. I was thinking, would it be possible to 'break up' highlights, line per line, so that problem is averted? Or, if linebreaks are not identifiable, just making the program try every possible way of breaking the highlighted text up into different segments.

These are just ideas from someone with almost no programming experience, but it would be really awesome if PRSAnnots worked for all my PDFs .

Best,
Arnoud
arnoud999 is offline   Reply With Quote
Old 09-13-2012, 04:59 AM   #22
Schrollini
Member
Schrollini began at the beginning.
 
Posts: 23
Karma: 14
Join Date: Apr 2012
Device: Sony PRS-T1
Quote:
Originally Posted by arnoud999 View Post
Are you still working on this program at the moment? Because I have a lot of PDFs where your program can't find the text to be highlighted, and instead adds is as a note to the page. I think this often has to do with linebreaks. I was thinking, would it be possible to 'break up' highlights, line per line, so that problem is averted? Or, if linebreaks are not identifiable, just making the program try every possible way of breaking the highlighted text up into different segments.
I certainly mean to be working on it, but as you see, I haven't done much recently.

I'm hoping to get the pdfloc method for identifying highlighed text working, since this should solve the problems you've been having. But I haven't had a free weekend to sit down and work it out. If you check out that bug report, you'll see a link to a small program to spit out the pdfloc information. You're welcome to give that a go and see if you can find a pattern.

If we can't figure out this new method, something like what you suggest is a good idea that should fix many of the problems.

Thanks for the kind words and suggestions!
Schrollini is offline   Reply With Quote
Old 10-05-2012, 07:08 AM   #23
lampadatriste
Junior Member
lampadatriste began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Oct 2012
Device: sony prs-t1
Thumbs up

I have to start by thanking you so much for this. This new sony reader revealed itself useless to me until you made it "work".

I have only one big problem for now. I use a mscard with books aside from the internal memory of the reader and I've only managed to import the pdf notes on the main memory.

Is there an easy way to access the notes on the mscard, given its folders are very different from the ones in the internal memory?
lampadatriste is offline   Reply With Quote
Old 10-06-2012, 10:31 AM   #24
Schrollini
Member
Schrollini began at the beginning.
 
Posts: 23
Karma: 14
Join Date: Apr 2012
Device: Sony PRS-T1
Quote:
Originally Posted by lampadatriste View Post
I have to start by thanking you so much for this. This new sony reader revealed itself useless to me until you made it "work".
Thanks for the kind words! Glad it's been useful for you.

Quote:
Originally Posted by lampadatriste View Post
I have only one big problem for now. I use a mscard with books aside from the internal memory of the reader and I've only managed to import the pdf notes on the main memory.

Is there an easy way to access the notes on the mscard, given its folders are very different from the ones in the internal memory?
I can't claim to be surprised that it doesn't work -- I don't have a microSD card, so I've never tried it. But there's a fair chance we can get it working, if you're willing to try a few things out. If you're game, here's a few questions to start with:

1) What operating system are you using? Do you use the command line programs (prsam / getannotations) or the graphical program (prsam-tk)? (I'm interested just so that I can speak the right language.)

2) Have you used the getannotations program? If so, does it list PDFs on the microSD card? If so, what happens when you select one of them?

3) Can you browse the contents of the microSD card when it's in the Reader and the Reader is plugged in to your computer? If so, does the card show up as a subdirectory of the Reader, or does it show up as a separate drive?

If you're not sure what I'm asking, just say so, and I'll try to explain further.

Edit: I've opened an issue for this. If you want to help, please comment there or here, whichever you prefer.

Last edited by Schrollini; 10-13-2012 at 11:03 PM. Reason: Add link to issue
Schrollini is offline   Reply With Quote
Old 10-22-2012, 12:10 AM   #25
Schrollini
Member
Schrollini began at the beginning.
 
Posts: 23
Karma: 14
Join Date: Apr 2012
Device: Sony PRS-T1
Version 0.2

I'm pleased to announce version 0.2 of PRSAnnots, the PDF annotation manager for the Sony PRS-T1 ereader (and maybe others). This version provides new features, including:
  • Cropping PDFs before loading them onto the reader.
  • Previewing PDFs before loading them onto the reader.
  • Better handling of PDF annotations, including an option to fake the highlight annotations.
Additionally, a number of bugs have been fixed.

Those of you following development on Github can pull to get the new version. It's also available as a tarball and a Windows installer.

I've also crated a Google Group for announcements and discussion about PRSAnnots. But don't worry, I also plan to make announcments here as well.

There's still work to be done to improve PRSAnnots. Here's some areas where I could use some help:
  • PDFs on microSD cards. I'm told that this doesn't work right now, but I don't have a microSD card handy to trouble shoot. I expect the card has its own database, and I hope it's the same format as the one on the reader. If so, it should be easy to make this work.
  • The PRS-T2. I'm not sure if PRSAnnots works on the T2 right now. If you have one and can test it, please let me know what happens. Even if it doesn't work, it shouldn't be too hard to fix.
  • pdfloc values for highlighted text. Right now, PRSAnnots tries to find highlighted text by matching the phrase stored in the database. This is error-prone, and it limits highlights to 200 characters or so. There's better information stored in the database as "pdfloc"
    coordinates, but we haven't reverse engineered them yet. The details.
I hope you find this release useful.
Schrollini is offline   Reply With Quote
Old 11-03-2012, 01:34 AM   #26
maptau_07
Junior Member
maptau_07 began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Nov 2012
Device: Sony PRS-T2
Testing on PRS-T2

Hi Schrollini,

thank you for the great effort you have put in to this tool! It looks very promising. Unfortunately, it does not yet function on the T2. Loading PDFs on to the device works fine with prsam-tk (once I manually created the Download directory on the ereader) and the database file is also created. Unfortunately, that's where it stops. Once the database has been created, prsam-tk doesn't start again, unless I delete the database file.
I am no good at python programing, so I am not sure which test-parameters would help you the most to fix the issues.
I am running python 2.7 on windows 7. When I start the prsam.py file from within the python GUI, I receive the following error message:

Usage: prsam [init|config|add|import|remove|ls|sync|clean]


Traceback (most recent call last):
File "C:\Python27\Scripts\prsam.py", line 408, in <module>
main(sys.argv[1:])
File "C:\Python27\Scripts\prsam.py", line 403, in main
sys.exit(1)
SystemExit: 1

If I run getannotations.py in the python GUI, I receive the following error message:
C:\Python27\Scripts\getannotations.py mount-point

Find all annotated PDFs on the Sony PRS-T1 mounted at the specified
mount point, and present a menu to let the user chose to export one
of them with annotations. Currently, only the freehand annotations
drawn directly on the page are supported.


Traceback (most recent call last):
File "C:\Python27\Scripts\getannotations.py", line 63, in <module>
sys.exit(0)
SystemExit: 0
>>>
Please let me know how I can assist you trouble shooting this to enable your tool on the sony T2.
Cheers.
maptau_07 is offline   Reply With Quote
Old 11-04-2012, 05:58 PM   #27
Schrollini
Member
Schrollini began at the beginning.
 
Posts: 23
Karma: 14
Join Date: Apr 2012
Device: Sony PRS-T1
Quote:
Originally Posted by maptau_07 View Post
thank you for the great effort you have put in to this tool! It looks very promising. Unfortunately, it does not yet function on the T2.
Thanks for giving it a go. Hopefully we can get things working for you.

Quote:
Originally Posted by maptau_07 View Post
Loading PDFs on to the device works fine with prsam-tk (once I manually created the Download directory on the ereader)
This is a minor issue, but it's good you could work around it. It be nice to avoid it if possible though, so is there an existing directory on the T2 where it would be appropriate to put the files?

Quote:
Originally Posted by maptau_07 View Post
and the database file is also created. Unfortunately, that's where it stops. Once the database has been created, prsam-tk doesn't start again, unless I delete the database file.
That's no good! Just to make sure we're on the same page, the database file you're talking about is the file on your computer with a long funny name that ends in .prc, correct?

The errors you are seeing are actually not big problems. Mostly it's showing that Python on Windows is behaving a bit differently than I'm used to. I can fix that on my own though. Let's focus here, first:

Quote:
Originally Posted by maptau_07 View Post
If I run getannotations.py in the python GUI, I receive the following error message:
C:\Python27\Scripts\getannotations.py mount-point

Find all annotated PDFs on the Sony PRS-T1 mounted at the specified
mount point, and present a menu to let the user chose to export one
of them with annotations. Currently, only the freehand annotations
drawn directly on the page are supported.


Traceback (most recent call last):
File "C:\Python27\Scripts\getannotations.py", line 63, in <module>
sys.exit(0)
SystemExit: 0
>>>
The getannotations.py script isn't smart enough to know where the reader is plugged in. On Windows, the reader should show up as a new drive (F:\ or G:\ or something, depending on your computer). Try passing that drive as an argument to getannotations. (That is getannotations.py F:\. You may need at add quote marks around the drive name: getannotations.py "F:\".) If it works, you'll get a list of files you've annotated and a prompt to choose one of them to download onto your computer. Chances are it won't work, though, but the error message will likely be useful.

This will likely be a bit of work to get things fixed, but I'm 90% sure we can get it to work in the end.
Schrollini is offline   Reply With Quote
Old 11-05-2012, 05:17 AM   #28
maptau_07
Junior Member
maptau_07 began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Nov 2012
Device: Sony PRS-T2
Thanks for getting back so quickly!
Quote:
Originally Posted by Schrollini View Post
This is a minor issue, but it's good you could work around it. It be nice to avoid it if possible though, so is there an existing directory on the T2 where it would be appropriate to put the files?
Well, there is the Sony typical DCIM toplevel folder (F:\DCIM), which remains empty apart from the .thumbnails subfolder.


Quote:
Originally Posted by Schrollini View Post
That's no good! Just to make sure we're on the same page, the database file you're talking about is the file on your computer with a long funny name that ends in .prc, correct?
Yes, the .prc file has been created in Appdata/Roaming/prsannots (697 bytes after transferring one PDF). The .prsannots file has also been created on the reader (38 bytes).

The errors you are seeing are actually not big problems. Mostly it's showing that Python on Windows is behaving a bit differently than I'm used to. I can fix that on my own though. Let's focus here, first:


Quote:
Originally Posted by Schrollini View Post
The getannotations.py script isn't smart enough to know where the reader is plugged in. On Windows, the reader should show up as a new drive (F:\ or G:\ or something, depending on your computer). Try passing that drive as an argument to getannotations. (That is getannotations.py F:\. You may need at add quote marks around the drive name: getannotations.py "F:\".) If it works, you'll get a list of files you've annotated and a prompt to choose one of them to download onto your computer. Chances are it won't work, though, but the error message will likely be useful.
It does not work. The error output is as following:
C:\Python27>python.exe C:\Python27\Scripts\getannotations.py F:\
Traceback (most recent call last):
File "C:\Python27\Scripts\getannotations.py", line 68, in <module>
main(sys.argv[1])
File "C:\Python27\Scripts\getannotations.py", line 52, in main
book = select_book(reader.books)
File "C:\Python27\lib\site-packages\prsannots\generic.py", line 46, in books
self._books = self._get_books()
File "C:\Python27\lib\site-packages\prsannots\prst1.py", line 27, in _get_book
s
group by books._id''')
sqlite3.OperationalError: ambiguous column name: mime_type


Quote:
Originally Posted by Schrollini View Post
This will likely be a bit of work to get things fixed, but I'm 90% sure we can get it to work in the end.
Thank you for putting the effort in! Would be really useful to get it fixed.
Cheers!
maptau_07 is offline   Reply With Quote
Old 11-05-2012, 09:54 AM   #29
Schrollini
Member
Schrollini began at the beginning.
 
Posts: 23
Karma: 14
Join Date: Apr 2012
Device: Sony PRS-T1
Quote:
Originally Posted by maptau_07 View Post
Thanks for getting back so quickly!

Well, there is the Sony typical DCIM toplevel folder (F:\DCIM), which remains empty apart from the .thumbnails subfolder.
Does Sony_Reader\media\books exist on the T2? That was my second guess for the T1. If it exists for both, I can switch to that.

Quote:
Originally Posted by maptau_07 View Post
Yes, the .prc file has been created in Appdata/Roaming/prsannots (697 bytes after transferring one PDF). The .prsannots file has also been created on the reader (38 bytes).
Perfect!

Quote:
Originally Posted by maptau_07 View Post
It does not work. The error output is as following:
C:\Python27>python.exe C:\Python27\Scripts\getannotations.py F:\
Traceback (most recent call last):
File "C:\Python27\Scripts\getannotations.py", line 68, in <module>
main(sys.argv[1])
File "C:\Python27\Scripts\getannotations.py", line 52, in main
book = select_book(reader.books)
File "C:\Python27\lib\site-packages\prsannots\generic.py", line 46, in books
self._books = self._get_books()
File "C:\Python27\lib\site-packages\prsannots\prst1.py", line 27, in _get_book
s
group by books._id''')
sqlite3.OperationalError: ambiguous column name: mime_type
This is very helpful. Could you try changing line 26 of prst1.py from
Code:
where mime_type = "application/pdf" and markup_type != 0
to
Code:
where books.mime_type = "application/pdf" and markups.markup_type != 0
(I've made the changes in bold just to help you see them.) Please try getannotations again after making the change. If it works, go ahead and try prsam and/or prsam-tk. Let me know what happens!
Schrollini is offline   Reply With Quote
Old 11-05-2012, 03:35 PM   #30
maptau_07
Junior Member
maptau_07 began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Nov 2012
Device: Sony PRS-T2
Quote:
Originally Posted by Schrollini View Post
Does Sony_Reader\media\books exist on the T2? That was my second guess for the T1. If it exists for both, I can switch to that.
Yes, that folder exists on the T2 too.



Quote:
Originally Posted by Schrollini View Post
This is very helpful. Could you try changing line 26 of prst1.py from
Code:
where mime_type = "application/pdf" and markup_type != 0
to
Code:
where books.mime_type = "application/pdf" and markups.markup_type != 0
(I've made the changes in bold just to help you see them.) Please try getannotations again after making the change. If it works, go ahead and try prsam and/or prsam-tk. Let me know what happens!
That did the job! getannotations.py showed the PDF and copied it successful to my PC fairly quickly, with the highlights I had made to the file. prsam-tk worked too, but a bit slower, but since it can run in the background, it's not really an issue.
Thanks a lot for fixing it! Anything else you'd like to try on the T2?
maptau_07 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 09:51 AM.


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