python - pdf2htmlEX is not recognized in the py script -
in cmd type following run test script provided in pdf2htmlex :
python test.py
it giving me following error:
'pdf2htmlex' not recognised internal or external command, operable program or batch file.
the test.py script follows:
#!/usr/bin/env python dir = 'test_data' import os import sys open('out2.html','w') outf: outf.write('<!doctype html>\n<html><head><meta charset=\"utf-8\"></head><body><div style="position:absolute;top:0;left:0;width:80%;height:100%;"><iframe width="100%" height="100%" name="pdf"></iframe></div><div style="position:absolute;top:0;right:0;width:20%;height:100%;overflow:auto;text-align:right;">') f in os.listdir(dir): if not f.lower().endswith('.pdf'): continue print f if os.system('pdf2htmlex -l 10 --no-drm 1 --fit-width 1024 --dest-dir html --external-hint-tool="ttfautohint" "%s/%s"' % (dir,f)) != 0: print "error on ", f sys.exit(-1) ff = f[:-3] outf.write('<a href="html/%shtml" target="pdf">%s</a><br/>' % (ff,ff)) outf.flush(); outf.write('</div></body></html>')
the test-data directory contains pages-2.pdf file. why getting error , how can run script?
Comments
Post a Comment