02-10-2008, 09:32 AM | #196 | |
Grand Sorcerer
Posts: 7,452
Karma: 7185064
Join Date: Oct 2007
Location: Linköpng, Sweden
Device: Kindle Voyage, Nexus 5, Kindle PW
|
Quote:
If somebody else would like to volonteer to produce Windows binaries please feel free to do so. My mobiperl web page give all the information needed to set it up and the Makefile in the distribution contains targets to build things in Windows using nmake. |
|
02-10-2008, 09:33 AM | #197 |
GuteBook/Mobi2IMP Creator
Posts: 2,958
Karma: 2530691
Join Date: Dec 2007
Location: Toronto, Canada
Device: REB1200 EBW1150 Device: T1 NSTG iLiad_v2 NC Device: Asus_TF Next1 WPDN
|
DMcCunney:
My text editor 'Textpad' does recognize the difference between PC and Unix line endings. As tompe points out, it is just one (long) line. tompe: For ease I list the perl script that converts .html to .IMP formats, here: Code:
#!/perl/bin/perl -w # # Adapted by Nick Rapallo (January 2008) # # Modified code taken directly from "SBPubX.doc" (installed by the eBook Publisher # software). Given a single .html it creates .opf project file for later use as well # as .IMP for REB 1200; can change the latter to GEB/EBW 1150 or REB 1100 by # uncommenting the {BuildTarget} lines below. package main; use Win32::OLE; use Win32::OLE qw(EVENTS); Win32::OLE->Initialize(Win32::OLE::COINIT_APARTMENTTHREADED); $usage='Html2imp.pl Authorname Title Category htmlfilename'; die "Usage: $usage\n" if $#ARGV != 3; ################################################################### # # get the interfaces, complain and quit if we cannot # $project = Win32::OLE->new("SBPublisher.Project") or die "Unable to get IProject interface\n"; $builder = Win32::OLE->new("SBPublisher.Builder") or die "Unable to get IBuilder interface\n"; # Setup the event handling. # Win32::OLE->WithEvents($builder, 'EventHandlers'); ################################################################### # # Create a new project and add our document file with optional cover. # $project->ClearAll(); #$project->AddSourceFile("cover.htm"); $project->AddSourceFile($ARGV[3]); ################################################################### # # Set the various "metadata" items for the publication # $project->{AuthorFirstName} = $ARGV[0]; $project->{BookTitle} = $ARGV[1]; $project->{Category} = $ARGV[2]; #$project->{ISBN} = $project->CanonicalizeISBN("0448163004 "); #$project->{BISAC} = "FIC004000"; ################################################################### # # Now build the OEBFF output # $project->{OutputDirectory} = "."; $project->{Compress} = 1; #True $project->{Encrypt} = 0; #False $project->{KeepAnchors} = 1; #True $project->{Language} = "en"; $project->{RequireISBN} = 0; #False $project->{Zoom} = 2; ################################################################### # # Now build the REB 1200 (FullVga) .IMP output #$project->{BookFileName} = $ARGV[3] . "_1200"; #$project->{BookFileName} = $ARGV[0] . " - " . $ARGV[1] . "_1200"; #$project->Save($ARGV[3] . "_1200.opf"); #$project->Save($ARGV[0] . " - " . $ARGV[1] . "_1200.opf"); # #$project->{BuildTarget} = 1; # # Now generate both the OEBFF and/or .IMP output #$builder->GenerateOEBFF($project, 1); #$builder->Build($project); #if (Win32::OLE->LastError() != 0) { # print "ERROR: GenerateOEBFF/Build method failed for REB 1200.\n"; #} else { # print "REB 1200 ebook created!\n"; #} ################################################################### # # Now (optionally) build the EBW/GEB 1150 (gray HalfVga) .IMP output # #$project->{BookFileName} = $ARGV[3]; $project->{BookFileName} = $ARGV[0] . " - " . $ARGV[1]; #$project->Save($ARGV[3] . ".opf"); $project->Save($ARGV[0] . " - " . $ARGV[1] . ".opf"); # $project->{BuildTarget} = 2; # # Now generate both the OEBFF and/or .IMP output #$builder->GenerateOEBFF($project, 1); $builder->Build($project); if (Win32::OLE->LastError() != 0) { print "ERROR: GenerateOEBFF/Build method failed for EBW 1150.\n"; } else { print "EBW 1150 ebook created!\n"; } ################################################################### # # Now (optionally) build the REB 1100 (mono HalfVGA) .RB output # #$project->{BookFileName} = $ARGV[3]; #$project->{BookFileName} = $ARGV[0] . " - " . $ARGV[1]; #$project->Save($ARGV[3] . ".opf"); #$project->Save($ARGV[0] . " - " . $ARGV[1] . ".opf"); # #$project->{BuildTarget} = 3; # # Now generate the .RB output #$builder->Build($project); #if (Win32::OLE->LastError() != 0) { # print "ERROR: Build method failed for REB 1100.\n"; #} else { # print "REB 1100 ebook created!\n"; #} Win32::OLE->Uninitialize(); ################################################################### # # Event Handlers # package EventHandlers; sub OnBuildStart() { my ($project, @args) = @_; # print "Beginning validation...\n"; } sub OnSourceStart() { my ($builder, $filename, @args) = @_; # print "Parsing $filename...\n"; } sub OnError() { # Get the arguments my ($builder, $filename, $msg, $line, $col, $severity, @args) = @_; my @severities = ("NOTE", "FATAL ERROR", "ERROR", "WARNING"); if ($filename =~ m/^.+[\\|\/](.+?)$/) { $filename = $1; } # Print out the error message including any NOTE feedback. # To ignore Warnings, change below to: if ($severity < 3) if ($severity >= 0) { printf(" %-15s (L:%6d, C:%6d) %-7s:", $filename, $line, $col, $severities[$severity]); print " $msg\n"; } } The actual perl script 'html2imp.pl' is an attachment located at https://www.mobileread.com/forums/att...2&d=1202084852 . The .zip file in the first posting there has everything you need. You must have installed the (free) eBook Publisher software from http://www.ebooktechnologies.com/sup...r_download.htm for the interface calls to work. I do not check for that explicitly, but I could add that to the script if you think it will be useful. I'm just learning to program in perl. Most of the code was adapted from example code in the documentation that comes with the eBook Publisher. One word of caution, the eBook Publisher software used to produce .IMP ebooks is 'fussy' and doesn't support all html tags. My work-around includes filtering/changing those troublesome via hand-editing. I could try to incorporate all of this within 'html2imp.pl'. I would really like it if you could incorporate this in your Mobiperl!!! -Nick |
Advert | |
|
02-10-2008, 09:40 AM | #198 | ||
Resident Curmudgeon
Posts: 76,404
Karma: 136564696
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
Quote:
|
||
02-10-2008, 09:50 AM | #199 |
GuteBook/Mobi2IMP Creator
Posts: 2,958
Karma: 2530691
Join Date: Dec 2007
Location: Toronto, Canada
Device: REB1200 EBW1150 Device: T1 NSTG iLiad_v2 NC Device: Asus_TF Next1 WPDN
|
Yes, please provide Windows binaries at your earliest convenience.
I wouldn't want you to remove the <mbp: pagebreak> format-specific tag; just replace it with something more 'accepted'. Your efforts are much appreciated! |
02-10-2008, 09:56 AM | #200 | |
Resident Curmudgeon
Posts: 76,404
Karma: 136564696
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
Advert | |
|
02-10-2008, 10:26 AM | #201 |
Grand Sorcerer
Posts: 7,452
Karma: 7185064
Join Date: Oct 2007
Location: Linköpng, Sweden
Device: Kindle Voyage, Nexus 5, Kindle PW
|
|
02-10-2008, 10:41 AM | #202 | |
Grand Sorcerer
Posts: 7,452
Karma: 7185064
Join Date: Oct 2007
Location: Linköpng, Sweden
Device: Kindle Voyage, Nexus 5, Kindle PW
|
Quote:
contains all the infoirmation. The modules are installed using the "Perl Package Manager" so you do not need any links. The list of modules are given on the webpage. Just enter the name in the package manager and search for them. You also have to remember to add an extra repository to the package manager. You have to match the Perl version with the version of PAR that is working and I found a match by testing a lot of combinations. The important bit is: "I used ActivePerl 5.8.8 build 820 and for building the Windows binary I used PAR-Packer-588.ppd". "build 820" is important. The latest ActivePerl did not work. PAR-Packer-588.pdd can be found at: http://par.wikia.com/wiki/PAR_PPM_Compatibility_List http://theoryx5.uwinnipeg.ca/ppms/PAR-Packer-588.ppd I think I just did "ppm install PAR-Packer-588.ppd" to install it. Or you can probably use the graphical interface to the Package Manager on the ppd file. As I said the Makefile in the distribution then shows how to build the binaries (nmake all; nmake pack). Good luck. Last edited by tompe; 02-10-2008 at 10:44 AM. |
|
02-10-2008, 10:56 AM | #203 | |
New York Editor
Posts: 6,384
Karma: 16540415
Join Date: Aug 2007
Device: PalmTX, Pocket eDGe, Alcatel Fierce 4, RCA Viking Pro 10, Nexus 7
|
Quote:
http://www.activestate.com/store/pro...5-08d58c2648ca Free and open source. ______ Dennis Last edited by DMcCunney; 02-10-2008 at 11:20 AM. |
|
02-10-2008, 05:25 PM | #204 |
Nameless Being
|
I do love to read, but I do NOT have the patience to read through hundreds of posts in this thread to find an answer. So parden me for coming to the end of the thread and posting my question and thoughts.
I installed ActiveStatePerl 5.8.8 and all the necessary (according to his website) addons to run mobi2html on my Win XP PC. I used mobidedrm to de-DRM a MobiPocket file originally purchased for MobiPocket on the Palm. When I go into a DOS Prompt and run mobihtml to convert this file I get a nice unpack folder filled with GIF files and one html file that contains only the following: <html><head></head><body></body></html> This is not much good as far as I can see if that is all it does. The image files are great, but no usable html is unpacked. Has anyone ever gotten this script to work? If so, how... |
02-10-2008, 05:56 PM | #205 |
reader
Posts: 6,975
Karma: 5183568
Join Date: Mar 2006
Location: Mississippi, USA
Device: Kindle 3, Kobo Glo HD
|
Unless you want to modify the scripts (or need the very latest versions), I suggest starting with the Windows binaries: mobiperl-0.0.26-win.zip
However, the problem may be that your MOBI file is using MobiPocket compression (mobigen's -c2 option) which is not supported by mobi2html. I have seen empty HTML files from mobi2html on such files, and another way to confirm this would be if your DRM-free MOBI is readable by MobiPocket Reader but not readable by FBReader. Most DRM-free MOBI files use simple (-c1) compression, but some use the -c2 option. I have no idea what fraction of DRM-laden MOBI files use the higher compression option. Last edited by wallcraft; 02-10-2008 at 06:34 PM. |
02-10-2008, 06:27 PM | #206 | |
Grand Sorcerer
Posts: 7,452
Karma: 7185064
Join Date: Oct 2007
Location: Linköpng, Sweden
Device: Kindle Voyage, Nexus 5, Kindle PW
|
Quote:
So if somebody reverse engineered the compression format could that be something that MobiPocket could complain about? Could they see their secret compression algorithm as part of the DRM? |
|
02-10-2008, 06:29 PM | #207 | |
Nameless Being
|
Quote:
I do wish these guys would start creating executables. Having to install Python, Perl, NameYourStupidScriptingLanguage, etc., then having to attempt to figure out their poorly documented command line sytax is too complicated and time consuming for most people. And in the end, it always seems that the caveats make the whole process a huge waste of time! |
|
02-10-2008, 06:47 PM | #208 |
reader
Posts: 6,975
Karma: 5183568
Join Date: Mar 2006
Location: Mississippi, USA
Device: Kindle 3, Kobo Glo HD
|
I don't see how it could be considered an effective DRM technique. Compression is also highly unlikely to be covered by patents, and in any case all that is required is decompression. This is somewhat analogous to the case with RAR, where there is an open source unrar utility but not one for creating .rar files.
|
02-10-2008, 07:10 PM | #209 | |
New York Editor
Posts: 6,384
Karma: 16540415
Join Date: Aug 2007
Device: PalmTX, Pocket eDGe, Alcatel Fierce 4, RCA Viking Pro 10, Nexus 7
|
Quote:
Mobi's high compression option Isn't intended to be DRM, per se. The purpose is for things like dictionaries. They need high compression to keep the file size within reason, but they can't use Zip because they need to be able to uncompress the file for display at any point in the file, and Zip starts at the beginning. So they have a proprietary and undocumented compression method they developed to handle that requirement. Since they made the Creator and Reader programs freeware, I think the next logical step for them would be to make them open source and get other developers involved, but I think the proprietary compression method would be an obstacle. ______ Dennis |
|
02-10-2008, 08:31 PM | #210 | |
Grand Sorcerer
Posts: 11,470
Karma: 13095790
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2, iPhone 7
|
Quote:
Dale |
|
Tags |
mobi2mobi, mobils |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Mobi2Mobi Mobi2Mobi v0.13 - GUI for Mobiperl tools | Jad | Kindle Formats | 476 | 03-15-2015 06:51 PM |
Tools for Editing Kindle .mobi Files? | GJN | Kindle Formats | 33 | 12-26-2013 03:05 PM |
Handy Perl Script to convert HTML0 files to smartquotes | maggotb0y | Sony Reader | 0 | 04-12-2007 12:49 PM |
PRS-500 Perl tools to generate Reader content | TadW | Sony Reader Dev Corner | 0 | 01-08-2007 06:55 AM |
gmail copy (gmcp) - Perl script to copy files to/from Gmail | Colin Dunstan | Lounge | 0 | 09-04-2004 02:24 PM |