dever 6 лет назад
Родитель
Сommit
8f14935cc1
1 измененных файлов с 6 добавлено и 2 удалено
  1. 6 2
      service/convert.py

+ 6 - 2
service/convert.py

@@ -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']