1
0
mirror of https://github.com/pdf2htmlEX/pdf2htmlEX.git synced 2024-07-05 09:38:40 +00:00
pdf2htmlEX/test/test.py

21 lines
641 B
Python
Raw Normal View History

2012-08-27 08:34:06 +00:00
#!/usr/bin/env python
2012-08-27 17:57:39 +00:00
DIR = 'pdf'
2012-08-27 08:34:06 +00:00
import os
outf = open('out.html','w')
2012-08-27 17:57:39 +00:00
outf.write('<html><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;">')
2012-08-27 08:34:06 +00:00
2012-08-27 17:57:39 +00:00
for f in os.listdir(DIR):
2012-08-27 08:34:06 +00:00
if not f.lower().endswith('.pdf'):
continue
print f
os.system('pdf2htmlEX -l 10 --dest-dir html "%s/%s"' % (DIR,f))
2012-08-27 08:34:06 +00:00
ff = f[:-3]+'html'
outf.write('<a href="html/%s" target="pdf">%s</a><br/>' % (ff,ff))
outf.flush();
outf.write('</div></body></html>')