Created
December 2, 2014 18:17
-
-
Save barryrowlingson/8e01274f12df1c5986b6 to your computer and use it in GitHub Desktop.
Convert PDF to images in a word doc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
mkdir -p pages | |
rm pages/image*png | |
convert -verbose -colorspace RGB -units PixelsPerInch -resize 1024 -geometry 1224 -interlace none -density 200 -quality 80 $1 pages/image.png | |
npages=`ls pages/image-*.png| wc -l` | |
for (( i=0 ; i<$npages ; i++ )) | |
do | |
echo '' | |
echo " " | |
echo 'Notes:' | |
echo " " | |
done > doc.md | |
pandoc -f markdown -t docx doc.md -o doc.docx |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Students want to annotate your lovely beamer PDF slide presentation, but Adobe PDF annotations aren't quiet their bag. They usually get powerpoint slides from lecturers and then scrawl under them.
Solution here is to convert to a word doc. I might do another solution that converts to an LibreOffice Impress XML document so they can scrawl in the notes space. Or teach them all LaTeX... Anyway...
From a folder with a .pdf in it, this creates a 'pages' folder, cleans it out, then uses imagemagick convert to create an image per page. Then loop over the number of pages and create a markdown doc with an image include and a 'notes' text. Then use pandoc to process that markdown into a Word (spit) doc. That can then be opened and students can annotate your slides with free text between the images.