#!/usr/bin/env python DIR = 'pdf' #DIR = '../../pdf.js/test/pdfs' import os import sys with open('out.html','w') as outf: outf.write('\n
') for 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('%s
' % (ff,ff)) outf.flush(); outf.write('
')