The issue there is that it scales/distorts the pages by a fixed percentage, and that fixed percentage is based on what it needs to scale the wider pages by in order to get them to 3:4. So pages that aren't as wide aren't stretched all the way to 3:4; the aspect ratio of the page is therefore less than 3:4, and the Kindle has no choice but to leave gaps on the sides. (There's not margins, since they're "off the page", but the effect is the same.)
I actually had it work that way deliberately, because I thought it would be jarring if some pages were stretched in a much different way or amount than others. Consider, for example, the last page of a chapter. If there were only two lines on the page, it would make each character 2 or 3 inches tall without changing its width!
But I guess you could try it if you really want. It would mean changing the script so that it processed each page one at a time rather than all of them as a group. I don't have time to work more on it today, but maybe sometime in the next few days.
P.S. About turning it into a program that ran outside of a shell... well, it's all automated, so there would be no point to having a GUI except a big button that said "Go!" or something like that. Could you make a GUI with a single button, which when the button was clicked, ran this script? I'm sure it's possible. I would know how to do it for Windows and linux, but I know nothing about such things for a mac. If you sat me in front of a mac, I'm not even sure I'd be able to find the File Manager or "Finder" or whatever it is called. All I really know about OS X is that it's Unix-based underneath and can run Bash.
But what I would suggest is something like an "Context Menu" option associated with PDFs that would run the script on them. (By "context menu" I mean the menu you get in your File Manager when you right click (or hold the mouse button down or whatever you do with those funny 1-button mice macs sometimes have).) For all intents and purposes, the script is a program, and the File Manager probably already has a way of adding "Open With..." options to the context menu, and you'd just need to add this script as an Open With option. But don't ask me how to do that on a mac. I don't have any clue.
Last edited by frabjous; 10-20-2010 at 01:45 AM.
|