View Single Post
Old 12-11-2018, 04:40 PM   #1
EmilThelonius
Enthusiast
EmilThelonius knows who John Galt is.EmilThelonius knows who John Galt is.EmilThelonius knows who John Galt is.EmilThelonius knows who John Galt is.EmilThelonius knows who John Galt is.EmilThelonius knows who John Galt is.EmilThelonius knows who John Galt is.EmilThelonius knows who John Galt is.EmilThelonius knows who John Galt is.EmilThelonius knows who John Galt is.EmilThelonius knows who John Galt is.
 
Posts: 37
Karma: 71294
Join Date: May 2016
Device: Sony DPT-RP1 and Pocketbook Touch Lux 2 and Basic
[MacOS] Help, using shell script and ebook-convert, hazel

Hi Calibre-Community,

I have a question about using the ebook-convert program from calibre in a shell script – as I am a total noob to shell scrips, maybe someone here can help me? I am eager to learn and would be very thankful!

So I am using hazel on a mac to automate certain folders. Within one of the folders I want to have an automatic conversion from ePub to pdf. I stumbled over a very useful shell script in the internet, which can be used directly in hazel:
https://jake.ch/2013/03/03/hazelbooks/


Code:
FULL_PATH="$1"
ORIG_FILE=$(basename "$FULL_PATH")
/Applications/Calibre.app/Contents/MacOS/ebook-convert "$ORIG_FILE" "converted/$(basename "$FULL_PATH" .epub).pdf"
This works pretty well: it makes a pdf and puts it in a "convert" folder. But now I want to tweak the PDF to a certain size, add page numbers, set margins etc...

So I found the commands for the ebook-convert app from calibre:
https://manual.calibre-ebook.com/gen...output-options

But how can I include for example
Code:
--custom-size
to the shell script above? And how do I set the hight and the width?

EmilThelonius is offline   Reply With Quote