Shiny New E-Book Gizmo: The Amazon Kindle


View Full Version : PRSUtil.exe


geekraver
10-19-2006, 02:20 AM
[Edited to reflect latest version]

I'm pleased to announce PRSUtil.exe, a tool for accessing the reader that does not require Python. Thanks to Igor et al without whom I would never have got this together.

The zip file contains a compiled version as well as the C sources and VS.Net support files.

You either need to copy it to your c:\Program Files\Sony\CONNECT Reader\Data\bin directory, or you need to copy the files ebookUsb.dll and prsctr.dll from that directory to whatever directory you install PRSutil.exe in.

The syntax for the current usage is:

PRSUtil <cmd> [-lR] [<path> ...]

where:

-l will list file type and size info if <cmd> is 'ls' or 'dir'

-R will recurse, if <cmd> supports recursion

The default path for 'ls' or 'dir' is /.

Thus, to dump the whole file tree, you could use:

PRSUtil ls -R

The available commands are:

ls [-lR] <path>... - list directory contents (can use 'dir' instead of 'ls')

del <path>... - delete one or more files from the reader

get [-R] <readerPath> [<PCpath] - copy one or more files off the reader

put <pcfile> [<readerfile] - put a file on the reader

For 'put', if no destination path is specified, the <pcfile> will be installed as a book. 'put' won't delete an existing file so if you want to overwrite a file on the reader you'll first need to delete it.

NOTE: YOU USE THIS AT YOUR OWN RISK - I TAKE NO RESPONSIBILITY OR LOST OR DAMAGED DATA OR HARDWARE. It works for me.

hkabir
10-19-2006, 02:29 AM
Happy to see the utility. How to use it? Do I have to go to dir: c:\Program Files\Sony\CONNECT Reader\Data\bin at the command prompt, and write PRSUtil ls -R?

hkabir
10-19-2006, 02:34 AM
Hi geekraver,
Would we be able to add new fonts in the next version?

geekraver
10-19-2006, 02:46 AM
Happy to see the utility. How to use it? Do I have to go to dir: c:\Program Files\Sony\CONNECT Reader\Data\bin at the command prompt, and write PRSUtil ls -R?

Yes, its a command prompt utility.

TadW
10-19-2006, 03:29 AM
geekraver, very nice work. Would it be possible that you publish the sources here too?

geekraver
10-19-2006, 10:24 AM
geekraver, very nice work. Would it be possible that you publish the sources here too?

Yup, source will come, probably tonight.

Slava
10-19-2006, 10:45 AM
I'm pleased to announce the first release of PRSUtil.exe, a tool for accessing the reader that does not require Python.

You are not looking for easy way, are you ?-)

www.py2exe.org (http://www.py2exe.org/)
py2exe is a Python Distutils extension which converts Python scripts into executable Windows programs, able to run without requiring a Python installation.

Nice work, Geekraver, sorry couldn't resist :)

yvanleterrible
10-19-2006, 11:44 AM
Can anybody write an app. that would convert any text into the best format,size and all, for the PRS? I think a lot of time could be saved there.

NatCh
10-19-2006, 11:52 AM
First there'd have to be some agreement on what the best format, size and all would be. :tongue3:

Or it could let you set your own best options for those attributes; only real way to select the best ones. :yes:

What I've been doing is opening files in Word, selecting all the text, and changing things to suit me. Doesn't really take that long, actually. :beam:

yvanleterrible
10-19-2006, 11:58 AM
As you've said somewhere else, RTF is a good "kind of open" easily chageable format?

I can use it on the Mac also.

The reason I'm asking is that not everyone wants to use the connect software and that many, like Mac users, can't. But you can workaround that with the SD.

I guess it could also solve Da_Jane's ploblems also.

NatCh
10-19-2006, 12:02 PM
Well, except Jane's backlight "problem". :grin2:

Yup, RTF works great, most of the files I have on my Reader are RTF, and I very much like the fact that I have so much control over the font, size, etc., and there's some discussion around here somewhere (tips & tricks thread (http://www.mobileread.com/forums/showthread.php?t=7892) , I think) about how to insert the meta-data into an RTF via notepad, so you can de-bloat it from Word, and still have that info.

The lack of in-line images is kind of a bummer, but I'm used to that from my Palm. :shrug:

porkupan
10-19-2006, 12:03 PM
Can anybody write an app. that would convert any text into the best format,size and all, for the PRS? I think a lot of time could be saved there.
Well, there is already such program, it's called BookDesginer. But the request to convert any text (and DOC, and PDF, and RTF, etc. - anything!) into the best format for the Reader just seems way too general.

bingle
10-19-2006, 01:08 PM
First there'd have to be some agreement on what the best format, size and all would be. :tongue3:

Or it could let you set your own best options for those attributes; only real way to select the best ones. :yes:

What I've been doing is opening files in Word, selecting all the text, and changing things to suit me. Doesn't really take that long, actually. :beam:

Word has a nice feature where it will show all the styles in a document, also. I find it very useful for changing font sizes and styles but preserving the feel of the original.

yvanleterrible
10-19-2006, 01:30 PM
Oh! I forgot...it has to do batches...big batches!

I installed ProcessTextGroup's ABC Amber LIT Converter. Neat little app. It's got tons of features. Something fast like that would be great, albeit not as fancy will do!

geekraver
10-19-2006, 03:36 PM
Can anybody write an app. that would convert any text into the best format,size and all, for the PRS? I think a lot of time could be saved there.

Perhaps that discussion should be moved to the content sub-forum?

yvanleterrible
10-19-2006, 03:40 PM
Sorry GR did'nt mean to intrude!

geekraver
10-20-2006, 01:52 AM
The source for PRSUtil is available here (http://www.geekraver.com/PRSUtil.zip)

Right now there is code to copy a file from the reader to the PC, but it isn't working, and I haven't figured out why. I figured I'll make what I have done available as it should be very close to having that work; someone might see the error and point out a fix. I haven't written C in about 4 years so I apologize if the code is dumb.

I wrote this in VS.Net 2005 so the project file requires that but it would be easy to adapt; its pretty straightforward C (although some compiler may barf on the zero-size arrays).

TadW
10-20-2006, 04:57 AM
Yup, source will come, probably tonight.
That's cool! :thumbsup:

geekraver
10-28-2006, 03:09 AM
Here is an update to prsutil. It now supports basic file put/get:

prsutil get <path>

will get the specified file from the reader and save it with name 'junk'.

prsutil put <filename>

will put the specified file in the /Data/media/books diretcory on the reader, and

prsutil put <pcpath> <readerpath>

will put the specfied file from the PC to the specified target on the reader.

As before, use at your own risk yadda yadda.

At some point I'll make the interface more usable; right now I think its more important to just make it available in its kludgy form.

Included in the zip is the executable as well as the C project file (VS.Net 2005 native C code project; should be fairly easy to port to other C compilers; main tricky bit is my use of the non-standard zero length arrays in some of the structs).

I'll try hook this up with rss2pdf soon to make an automated RSS feed sync.

vvaann
10-28-2006, 04:14 PM
2 geekraver
Did I understand correctly? I have to collect/unpack all these files (PRSUtil.exe, PRSUtil.zip, ebookUsb.dll, prsctr.dll, new tt0003m_.ttf) in one directory (C:/tmp), attach the reader to USB and switch it on mode when the CONNECT software is off. Then write in the command prompt:
prsutil put <C:/tmp/tt0003m_.ttf> <B:/opt/sony/ebook/FONT/>
if my reader is shown as B: drive

and I have updated font on the reader???
or this utility is simply to add some stuff at any place and we cannot replace files???

geekraver
10-28-2006, 04:52 PM
I'm not sure what the deal is with fonts, as I haven't had much interest in that problem, but I got the impression that adding fonts requires reflashing the reader with a new filesystem image, not just copying files .ttf files to the reader. But if copying worked, then yes, you've pretty much got it; you would use a command like:

prsutil put c:\tt0003m_.ttf /opt/sony/ebook/FONT/tt0003m_.ttf

Note that you need to specify the full filename in the target path, not just the directory.

gseryakov
10-31-2006, 08:04 AM
... But if copying worked, then yes, you've pretty much got it; you would use a command like:

prsutil put c:\tt0003m_.ttf /opt/sony/ebook/FONT/tt0003m_.ttf


AKAIK /opt is mounted as a read-only Cramfs (http://en.wikipedia.org/wiki/Cramfs) . So you can not copy to /opt/whereever.

tcv
11-12-2006, 11:12 AM
Well, there is already such program, it's called BookDesginer.

Does anyone have more information on this program?

Aprilbeginnings
12-05-2006, 08:57 AM
Well, except Jane's backlight "problem". :grin2:

Yup, RTF works great, most of the files I have on my Reader are RTF, and I very much like the fact that I have so much control over the font, size, etc., and there's some discussion around here somewhere (tips & tricks thread (http://www.mobileread.com/forums/showthread.php?t=7892) , I think) about how to insert the meta-data into an RTF via notepad, so you can de-bloat it from Word, and still have that info.

The lack of in-line images is kind of a bummer, but I'm used to that from my Palm. :shrug:

This may be a dumb question but if we convert something into .rtf can we also change the font type. Will the reader show up a font say in comic sans if saved that way or is it going to remain arial? I am curious.

igorsk
12-05-2006, 09:24 AM
No, Reader can only use its built-in fonts.

Aprilbeginnings
12-05-2006, 09:27 AM
Okay, thank you. :)

So another, is there more than one font in it? I have seen arial..... I haven't seen anything that you can change them if that is possible, you said built in fonts so that egged me to ask <G>

NatCh
12-05-2006, 10:57 AM
It has three fonts I think, a serif similar to Times Roman, a sans serif similar to Arial and a courier analog.

igorsk is being modest, he's figured out how to add other fonts to the Reader's set, but as of yet it's a rather messy process (the thread is called "Reader Internals," I think, and it's a long and fairly technical one :shrug: ). I'm one of the ones that is hoping that a self contained executable to handle managing fonts might emerge sometime soon. :grin:

hn_88
01-08-2007, 01:25 AM
Thanks for the nice tool, GeekRaver. Got it working after installing .NET framework. Maybe you can edit your post so that this is made explicit - "This program needs .NET framework - in case you don't have it installed already, you can download it from .... "

Otherwise the error message Windows gives is quite cryptic: just cannot run the executable!

NatCh
01-08-2007, 10:57 AM
I think Internet Explorer 7 installs the most recent .NET framework when it installs, and Vista is supposed to have it integrated in the OS, so the problem will likely take care of itself in time. But you're right, an explicit statement would be a good thing.

Here's a link to the .NET framework (http://www.microsoft.com/downloads/details.aspx?familyid=0856EACB-4362-4B0D-8EDD-AAB15C5E04F5&displaylang=en) if anyone wants it. :nice:

Alexander Turcic
01-19-2007, 10:18 AM
It works here (Windows XP), but only partially. I want to copy the content of the Reader to my HDD... so for instance, I use

PRSUtil get -R /opt/ c:\sonyreader

The program starts copying a few files, but then stops. This happens everytime, no matter which directory I am trying to copy.

Alexander Turcic
01-19-2007, 10:29 AM
Igor's ebook.py utility works fine.

geekraver
01-24-2007, 12:37 AM
I found a bug that I think was your problem; there is an updated version now with that patched.

Alexander Turcic
01-24-2007, 06:24 AM
Thanks, I'll check it out.

seldd
07-07-2008, 02:40 PM
Hi folks!

Does anyone have a working compiled PRSUtil.exe here? I tried to compile myself the source but it doesn't work, I've got an error message (Error executing program!) when attempting to run the utility. However it is possible that I'm doing something wrong, I don't know why it fails. Thanks!

(I have .NET Framework 2.0 installed on my PC.)