Note: This article is only for amazon.co.jp.
Upload your pdf via Send to Kindle (https://www.amazon.co.jp/sendtokindle) app.
Remove an item listed in personal documents.
pdf files to upload must be <=50MB.
Using the following script helps you compress easier.
(Install ghostscript in advance)
$ brew install ghostscript
Create the folowing script as pdfmin.
#!/bin/sh
# Usage:
# $ pdfmin [file...]
cnt=0
for i in $@; do
gs -sDEVICE=pdfwrite \
-dCompatibilityLevel=1.4 \
-dPDFSETTINGS=/ebook \
-dNOPAUSE -dQUIET -dBATCH \
-sOutputFile=${i%%.*}.min.pdf ${i} &
(( (cnt += 1) % 4 == 0 )) && wait
done
(Reffered to this article PDF をコマンドラインから圧縮する - Qiita)
Execute $ pdfmin foo.pdf then foo.min.pdf will be generated.