Mobileread
Mobiperl Mobiperl - Perl tools for handling MobiPocket files
#1  tompe 12-20-2007, 02:53 PM
Mobiperl is a collection of tools I am writing in Perl for handling MobiPocket files. Since it works OK and I am interested in suggestions for more functionality I start a new thread for it.

The latest version is 0.0.43 and it can be found here: http://www.ida.liu.se/~tompe/mobiperl/downloads/ (updated July 2013)

*original text*

I have not yet tested mobiperl in Windows yet but if nobody else beat me to it I will try to test it during and write down how to use the programs under Windows. As I understand it ActivePerl is very common and it contains PPM that can be used to install packages.

Currently Mobiperl consists of:
I am also planning to write a mobi2opf program that explodes a MobiPocket file and tries to create an OPF structure.
Reply 

#2  tompe 12-20-2007, 02:59 PM
Since a lot of people have mentioned that it would be useful to be able to manipulate meta data and to add cover image to a prc or mobi file I wrote mobi2mobi. Here is the description of the program:

A program to manipulate MobiPocket files. Author and title can be set and a cover image (thumb nail image for Gen3) can be added.

There are two kind of prc files used for electronic books. One is a PalmDOC file which does not have a MOBI header but can contain HTML code marked up with MobiPocket specific markup and it can be read by a MobiPocket reader. For this format you cannot store meta information in the header. The other format is MobiPocket and it has a MOBI header and some additional data where you can store meta information and an extended title.

This program can change the extended title for a MobiPocket file. It can also automatically convert a PalmDOC file to a MobiPocket file and set the title.

It can also add author information to a PalmDOC file by converting it to a MobiPocket file and set the author meta information.

You can also add a prefix to a title in a MobiPocket file. This does not work for PalmDOC files.

It is possible to add an image to the file. If there are no other images in the file then the added image will be used as cover image and thumb nail image for Gen3.

Just running the program on a mobifile without any flags will print some information about the file.

Since there is no specification available for the MOBI header this program might generate books that are not entirely correct. So keep the original file...
Reply 

#3  diabloNL 12-20-2007, 03:44 PM
I would love to try it but I have no clue how to run it on Windows XP. I downloaded ActivePerl but don't know what to do next.
Reply 

#4  tompe 12-20-2007, 04:41 PM
Quote diabloNL
I would love to try it but I have no clue how to run it on Windows XP. I downloaded ActivePerl but don't know what to do next.
I will test it myself in a couple of days and can give more information then.

For mobi2mobi you will need to install the Perl packages:
There should be something called PPM to install packages.

To check the documentation do "perldoc mobi2mobi". To change a title do 'perl mobi2mobi --title "New Title" --outfile newfile.mobi originalfile.mobi". I assume you have to use a dosbox or cygwin or some shell with ActivePerl to do this.

But I am really not a Windows user so I might be mistaken.
Reply 

#5  delphidb96 12-20-2007, 04:52 PM
Quote tompe
I will test it myself in a couple of days and can give more information then.

For mobi2mobi you will need to install the Perl packages:

There should be something called PPM to install packages.

To check the documentation do "perldoc mobi2mobi". To change a title do 'perl mobi2mobi --title "New Title" --outfile newfile.mobi originalfile.mobi". I assume you have to use a dosbox or cygwin or some shell with ActivePerl to do this.

But I am really not a Windows user so I might be mistaken.
Or... You could create a standalone Windows executable that does the same thing. This would be of great benefit to the millions of WinXP users who can't get PERL to work right and don't own Linux or OSX machines. After all, we're, by far, the greatest number of mobi readers.

PLEASE!!!

Derek
Reply 

#6  tompe 12-20-2007, 05:51 PM
If it is possible to create an executable than this might be an option. The disadvantage is that I have to boot to Windows to create a new version.

I have uploaded version 0.0.7. The bug I fixed was that the title change did not work for DRM:ed books. Now it works for my dictionary at least.
Reply 

#7  tompe 12-21-2007, 04:41 PM
This is what you need to do to run the Mobiperl program on Windows.

Install ActivePerl 5.8.8 (easily found by google). maybe 5.10 also works but I did not test that version.

Start the "Perl Package Manager" (from the program menu) and install packages. A package can also be installed from a cmd prompt with "ppm install packagename".

For mobi2mobi install the packages:
For html2mobi you have to add the repository http://theoryx5.uwinnipeg.ca/ppms/package.lst to the package manager (in preferences). Then install the packages:
Documentation for mobi2mobi and html2mobi can be found here:
Reply 

#8  tompe 12-21-2007, 04:47 PM
For it to work on Windows with ActivePerl you need to get version 0.0.8 of Mobiperl.

I tested html2mobi on Windows with an HTML file and it worked. There was some problem with an opf file but I will look at that. I will also fix so that lit2mobi works properly on Windows.

It should be possible to package a Perl program in one Windows binary using PAR::Packer but I could not get it to work in Windows with ActivePerl (it did work in Linux). If I get this to work I will distribute the programs that way also. But the solution to the problem might be to wait for a better binary distribution of PAR::Packer and then it can take some time...
Reply 

#9  DaleDe 12-21-2007, 05:51 PM
Quote tompe
This is what you need to do to run the Mobiperl program on Windows.

Install ActivePerl 5.8.8 (easily found by google). maybe 5.10 also works but I did not test that version.

Start the "Perl Package Manager" (from the program menu) and install packages. A package can also be installed from a cmd prompt with "ppm install packagename".

For mobi2mobi install the packages:
For html2mobi you have to add the repository http://theoryx5.uwinnipeg.ca/ppms/package.lst to the package manager (in preferences). Then install the packages:
Documentation for mobi2mobi and html2mobi can be found here:
When I added uwinnipeg to my preference it found 0 pkgs.

Dale
Reply 

#10  tompe 12-21-2007, 06:34 PM
Quote DaleDe
When I added uwinnipeg to my preference it found 0 pkgs.
The same happened for me and it took some time to realize I had put the URL where the name should be and the name where the URL should be. Maybe you have done the same thing?
Reply 

  Next »  Last »  (1/90)
Today's Posts | Search this Thread | Login | Register