Daily Archives:February 27th, 2007

Using the Sony Reader PRS500 with the Mac

Sony PRS 500Yesterday, finding myself in Palo Alto, I took advantage of the current UK/US exchange rates to buy myself a new toy in Fry’s.

It’s the Sony PRS – the Portable Reader System – which is a bit like a giant read-only PalmPilot that uses the new e-Paper type display. It’s designed to be a replacement for a paperback – a way of viewing eBooks, and unlike some earlier devices, it’s not limited to DRM-encoded books downloaded from the manufacturer. You can put text files, RTF files, PDF files on it as well, and they look gorgeous.

However, there was a big question-mark over my purchase, which was that there is no official Mac or Linux support for this device. You can use a card reader to plug an SD card into your Mac, copy the files onto it and then plug it into the PRS, but that’s hardly convenient, especially in comparison to the (optional) USB docking station. Sadly, the PRS doesn’t just appear as a USB storage device. You can run the Sony software just fine under Windows using Parallels, but that’s yucky too.

Fortunately, Kovid Goyal came to my rescue with a system called librs500. He’s reverse-engineered the Sony protocols and created a Python-based library and utilities that can transfer files to and from the PRS. Sony owe him some money – the profit from my purchase, at the very least! You need to install a few bits, like Python 2.5, to use libprs500 – the easiest way is probably to use MacPorts. Once you’ve got libprs500 installed, though, you can start to do fun things.

Printing to the PRS

I wanted a way to take an arbitrary document on my Mac and make it available as a PDF on my PRS. Here, in a nutshell, is how to do it:

  • Go into File > Page Setup, pull down the ‘Paper size’ option and create a custom page size that you’ll use, where possible, for printing to the PRS. I called mine ‘Sony Reader’, and it’s 9.06 x 12.24cm, with small margins (0.3cm, in my case). When you want to output something for the PRS, it will usually look best if you set this small page size first.
  • We’ll use the Mac’s PDF Services facility, which lets you print to a PDF and send it to a particular location or program directly from the Print dialog. I created a wrapper script called book2prs which will be given the resulting PDF and will send it to the PRS using Kovid’s prs500 utility. You need to put the script in your ~/Library/PDF Services folder (create it if you haven’t got one). Or, like me, you can put it somewhere else and put an alias in the PDF Services folder which has a nice name. I called mine ‘To Sony Reader’.
  • Once this is all in place, you can plug the PRS into your USB port, pick your custom page size for your document and then go File>Print>PDF>To Sony Reader. All being well, when you unplug your PRS, it will have a new document on it! If something goes wrong – if you forget to plug in the PRS, for example – you won’t get any feedback to that effect, but the script does create a log at /tmp/book2prs.log which might be helpful. Any other error messages will be visible using the Console app. Lots of room for improvement here!
  • If you want to print stuff from Safari, it’s a good idea to customise the toolbar and add the little ‘AA‘buttons which let you change font size. In the absence of other info Safari will use the on-screen font size as a guideline for the font to use for printing, and you want slightly larger than normal for the PRS. I also found the output was much nicer if I set Safari to use a sans-serif font as the default. Again , this may be overwritten by CSS for a specific site, but it’s a useful default.
  • My version of the script will name the file on the PRS based on the title as seen by the print system. So you may need to modify it if, for example, you want to print different pages from the same web site and they all have the same page title. The later ones will overwrite the earlier ones at present.

There you are! Now you too can read Status-Q on a Sony Reader!

Status-Q on a Sony PRS

© Copyright Quentin Stafford-Fraser