|
@@ -114,8 +114,12 @@ class Convert(object):
|
|
|
def command(self, info):
|
|
|
File.mkdir(info['path'])
|
|
|
convert = 'cd ' + info['path'] + ' && '
|
|
|
- convert = convert + 'libreoffice --invisible --convert-to pdf ' + info['local']
|
|
|
- convert = convert + ' && '
|
|
|
+
|
|
|
+ if info['ext'] != '.pdf':
|
|
|
+ convert = convert + 'libreoffice --invisible --convert-to pdf ' + info['local']
|
|
|
+ convert = convert + ' && '
|
|
|
+ else:
|
|
|
+ info['pdf'] = info['local']
|
|
|
convert = convert + 'pdf2htmlEX --zoom 1.3 --no-drm 1 --split-pages 1 '
|
|
|
convert = convert + '--embed-css 1 --embed-javascript 0 --embed-image 0 --embed-font 1 --process-outline 0 '
|
|
|
convert = convert + '--embed-external-font 0 --dest-dir '+info['path']+' --page-filename %d.page ' + info['pdf']
|