pdf2jpg #2

Merged
acastro merged 2 commits from pdf2jpg into master 5 years ago

@ -84,5 +84,16 @@ Get Help: `python3 upload_imgs_dir.py --help`
**Edit and run via** `.helper-upload_imgs_dir.sh` **Edit and run via** `.helper-upload_imgs_dir.sh`
# Convert PDFs to folder of JPGs with pdf2jpg.sh
By either:
* running it from this folder and using absolute path to PDF
`./pdf2jpg.sh "/full/path/to/2020_bantayog/PDFname.pdf"`
* copying pdf2jpg.sh to 2020_bantayog/ and running with relative path to PDF
`./pdf2jpg.sh "PDFname.pdf"`
It is
to convert pdfs to jpgs: to convert pdfs to jpgs:
convert -quality 100 -density 300 [name-of-pdf] %02d.jpg convert -quality 100 -density 300 [name-of-pdf] %02d.jpg

@ -7,8 +7,9 @@ python3 upload_imgs_dir.py \
--org 'Communist Party of the Philippines' \ --org 'Communist Party of the Philippines' \
--format 'Bulletin' \ --format 'Bulletin' \
--topic 'Communism, Armed Struggle' \ --topic 'Communism, Armed Struggle' \
--dir '/full/path/to/2020_bantayog/Folder name' \ --dir '/home/andre/Documents/xpub/2019_2021/SI11/2020_bantayog/Ang Bayan, December 1984, Sc CJ Cortez, 2020Jan17' \
# --dry --dry
# Note: # Note:
# * Add this values to you upload specific upload. # * Add this values to you upload specific upload.

@ -0,0 +1,9 @@
#!/bin/sh
PDF="$1"
echo "$PDF"
DIR=`echo "$PDF" | sed s/\.pdf//`
echo "$DIR"
mkdir "$DIR"
echo "Starting convertion ..."
convert -quality 100 -density 300 "$PDF" "$DIR/"%02d.jpg
echo "PDF converted thanks to Damla aka Imagemagick ninja"
Loading…
Cancel
Save