Created
September 2, 2014 02:03
-
-
Save thequbit/b76ef1153a7e308f6b9b to your computer and use it in GitHub Desktop.
This file contains 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
from wand.image import Image as WandImage | |
import sys | |
if __name__ == '__main__': | |
print "Welcome to wand-text.py!" | |
if len(sys.argv) != 3: | |
print "Usage:\n\n\tpython wand-text.py <input_pdf_filename> <output_image_filename>" | |
else: | |
pdf_filename = sys.argv[1] | |
image_filename = sys.argv[2] | |
try: | |
#if True: | |
img = WandImage(filename=pdf_filename, resolution=400) | |
#img.compression_quality = 99 | |
img.save(filename=image_filename) | |
except Exception, e: | |
print "ERROR: {0}".format(e) | |
print "Exit." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment