View Single Post
Old 10-20-2010, 10:57 AM   #27
kidblue
Connoisseur
kidblue began at the beginning.
 
Posts: 79
Karma: 10
Join Date: Oct 2010
Device: Kindle 3
Thanks for this new script, but no dice on it. See the "spoiler" below.

You make some awesome points. I completely agree that a contextual menu would be the way to go, even a shortcut that could be applied to a selected folder or file. Heck, that'd be the way to go with Briss, too, for that matter. From a GUI perspective, that would be the most efficient. I imagine there's an easy way to convert a Bash file to Applescript for it, and that'll be a little fun research for me, getting my feet wet. And we Mac users haven't had one-button mice for a few years

I think this is the issue with the concept overall - In dealing with a PDF, the Kindle (and I imagine most readers of the ilk) will expand the text of a given page as far as the margins or "dead" space will allow. In other words, if dealing with a screenplay and center-justified "dialogue" text with no left-justified descriptive text, it will expand the size of that text greatly and on the next page, if there is left-justified text, go back to a smaller size.

What I propose is this (and it may be in the new script, I just haven't seen it yet): A formatting that cuts down on the margins (auto-crop) and confirms that each page is exactly the same size (as per Kindle) as opposed to the same aspect ratio. Because the reader will simply stretch and/or squeeze the page "to fit", we need to "trick" it into seeing each page as exactly the same size. In this case, it's something that PDfs are actually useful for! I think that's exactly what you did

This is interesting in that it still doesn't quite take the place of what Briss does, although I'd like it to. Looking at the average screenplay document, each page, without the margins or dead-space is only 15x20 cm. Comparing that to a Kindle screen (9x12 cm), we're only talking about approximately a 30% reduction, which should be still totally readable. If we could factor in what Briss does and split it vertically, we should be able to end up with a consistently-sized document that is readable, with a "constant" in the size of each page, don't you think?

Error:
(my shell is "noah" and the PDF is "3x7=21.pdf")

Spoiler:
homedf3to4 noah$ ./pdf3to4.sh 3x7=21.pdf
Looking for ebook-meta .../usr/bin/ebook-meta

Looking for pdfmanipulate.../usr/bin/pdfmanipulate

Looking for ghostscript.../usr/local/bin/gs
Creating temporary folder...Delete the temporary folder if the script fails!

Reading metadata...
Author(s) recognized as Unknown.
Title recognized as 3x7=21.
Language recognized as und.

Splitting pages..../pdf3to4.sh: line 135: seq: command not found
done.

./pdf3to4.sh: line 135: seq: command not found

****** ****** ******
Now re-merging the various pages..../pdf3to4.sh: line 116: seq: command not found
Error: Two or more PDF files are required.

Usage:
pdfmanipulate merge [options] file1.pdf file2.pdf ...

Metadata will be used from the first PDF specified.

Merges individual PDFs.


Whenever you pass arguments to pdfmanipulate that have spaces in them, enclose the arguments in quotation marks.

Options:
--version show program's version number and exit

-h, --help show this help message and exit


Merge Options::
Options to control the transformation of pdf

-o OUTPUT, --output=OUTPUT
Path to output file. By default a file is created in
the current directory.


Created by Kovid Goyal <kovid@kovidgoyal.net>

done.

Reinstating metadata...Python function terminated unexpectedly: (2, 'No such file or directory')
Traceback (most recent call last):
File "/Applications/calibre.app/Contents/Resources/Python/lib/python2.6/site.py", line 147, in main
return run_entry_point()
File "/Applications/calibre.app/Contents/Resources/Python/lib/python2.6/site.py", line 116, in run_entry_point
return getattr(pmod, func)()
File "site-packages/calibre/ebooks/metadata/cli.py", line 156, in main
IOError: [Errno 2] No such file or directory: u'output.pdf'
done.

Cleaning up...mv: rename tmppdf3to4dirkk/output.pdf to 3x7=21-stretched.pdf: No such file or directory
done.
Finished. Output saved as 3x7=21-stretched.pdf.
kidblue is offline   Reply With Quote