mobipocket notes file extractor
or how to export your mobipocket notes to a text file

This package reads a .MBP file, which is the type of file that stores user added information to any of the file formats that "mobipocket reader" can read. (See www.mobipocket.com for a reader program.)

So, a .MBP file associated to a (for example) .PRC book file, would contain annotations, corrections, drawings and marks made by the user on the book content.

Can you export this notes to any other format?
Actually (2008/03), not.
Except if you use this Perl script.

DOWNLOAD

Actual version: 0.2.d (06/2009):
(more functional, and now it exports also user drawings!, see version history).
If you use windows, download this package, obtained from my Perl code, and gratefully donated by an anonymous contributor: MBP_reader_v02d_win.zip (0.97 MiB)
If you use linux or unix, download this package: MBP_reader_v02d.zip (29 KiB)
This one contains the Perl source code, so it can also be run in a Windows with Perl support (see "running the script...", below).

USAGE

running the program in WINDOWS
  1. Decompress all MBP_reader_v02d_win.zip files in the same FOLDER.
  2. Put a copy of your MBP FILES in that very same FOLDER.
  3. Double-clik on MBP_reader.exe ...
  4. If everything runs ok (maybe it won't, look contact below), all your notes will be in text files named after your original mbp files, plus a ".mbp_notes.txt" extension.
        If drawings exist in the mbp file, they'll be exported to GIF images, named after the mbp file, plus a number and ".gif" extension.
        In case of errors, they'll be reported in the file mbp.errors.txt. You can send me an email with the description of your problem in that file (idleloopyahoo.com).
        Anyway, if some problem arises not related to your file, but to the exe file (it shows up window's errors or something like that), you can try the second method "running the script...", described below.
running the script in WINDOWS & LINUX / UNIX
  1. In linux, Perl is always installed ;)
    In windows, you will need to install a Perl interpreter, for example ActivePerl:
    follow this link (You don't have to give your data if you don't want to, just click "continue"...)
    When you have finished installing it, continue to next step.
  2. Decompress all MBP_reader_v02d.zip files in the same FOLDER.
  3. Put a copy of your MBP FILE in that very same FOLDER.
  4. Open up a command-line console:
    In windows, a MS-DOS console.
  5. Situate the prompt in the FOLDER (cd... 'til reach FOLDER).
  6. Type:
    perl MBP_reader.pl MBP_FILE_NAME.mbp
    where "MBP_FILE_NAME.mbp" is the name of your mobipocket file (the one whith extension '.mbp' which are the ones that contains your notes) from which you want to extract the notes.
    Or, alternatively, type:
    perl MBP_reader.pl
    to extract notes from every file which resides in the FOLDER.
  7. If everything runs ok (maybe it won't, look contact below), all your notes will be in a text file(s) named after your original mbp files, plus a ".mbp_notes.txt" extension.
        If drawings exist in the mbp file, and the system has both the GD perl module and libgd libraries, they'll be exported to GIF images, named after the mbp file, plus a number and ".gif" extension.

  8.     In case of errors, they'll be reported in the file mbp.errors.txt. If some problem arises, you can send me an email with a description of your problem (idleloopyahoo.com).

mbp file format

I've compiled my knowledge in a strange format, just in case someone out there can use it for the good of the humankind (or something like that):
mbp file format description [text format] (last update: 06/2009).
The info stated there contains errors... (I'm sure of that!).
In particular, the type of mbp files I've managed are very simple. More complex ones will pose new characteristics that I am sure are beyond this very first specification.
There're also a lot of unknown parts (marked with three points followed by the number of bytes for which I can't guess the meaning.
I think mbp files do not store Unicode at all. Actually I think it's plain ASCII (may be ISO-8859-1?), big-endian-padded with zeros to a 16 bit limit.

I think that there are more user marks that I haven't parsed... there're 'bout 10 by now, and everytime I look, I see new ones... Since version 0.2.c (07/2008), unknown marks won't stop parsing the file, though they won't be showed in the text output.

I'm particulary proud of the 'reversing' of the mbp user drawing format ;)

Does the program ends with an error with one of your mbp files?: send me it (if not confidential), and I'll try to improve the program...

CONTACT

Problems? suggestions? :
idleloopyahoo.com
Looking for new versions? :
uhmm... dunno, you may check this site in the future...

HISTORY

Can you extract this notes to any other format?
In mobipocket forums, developers say that next versions of mobireader will have this functionality. I've been waiting for years. Unfortunately, I had a problem with a two-hundred-notes MBP file, which was corrupted (?) as I was reading a file... and I simply couldn't lost all that info:
I "had" to make this Perl program to try to patch my file. (In case you guess, yeah, I could patch it: it just had some bytes where it shouldn't ;)

VERSION HISTORY

Usually, each version upgrade upgrades also the mbp file format definition.
  • 0.2.d (06/2009)
    Corrected a byte alignment detail that could have caused previous versions to provide no results. Additionally, format description was updated with a little ongoing work on text position extraction.
  • 0.2.c (07/2008)
    Ups, previous 0.2.b wasn't as flexible as I thought... fixed. Also, PUBLISHER mark recognized.
  • 0.2.b (06/27/2008)
    adds support for these tags: GENRE, ABSTRACT, and COVER. Flexible handling of unknown tags... hope this won't mess things up. Also, this way, broken MBP files won't be so easily patched... but, hey, anyway, probably I'm the only one in the world who patched a broken MBP file ;)))   (if you've also done it, let me know!).
  • 0.2.a (04/30/2008)
    Now it can export user drawings to GIF images!.
  • 0.1.d (04/23/2008)
    adds support for these tags: AUTHOR, TITLE, and CATEGORY. More flexible tagging for Notes.
  • 0.1.c (04/2008)
    adds BOOKMARKs parsing.
  • 0.1.b (04/2008)
    initial release.

LICENSE

Distributed under GPL 3.
(license text included in zip distribution file).

LINKS

www.mobipocket.com
www.mobipocket.com/forum/

en.wikipedia.org/wiki/Perl
perldoc.perl.org
www.activestate.com/store/activeperl/download/