[pod] Added the possibility, for function 'document', to import, into an ODT result, external documents of various formats: doc, xls, ppt, etc. This new 'ConvertImporter' uses LibreOffice to first convert the doc into PDF, and then uses the PdfImporter to split the PDF into images (one image per page) and include in in the pod result.

This commit is contained in:
Gaetan Delannay 2013-04-19 15:30:18 +02:00
parent 0a8e06f1d9
commit eaf7156b47
4 changed files with 55 additions and 23 deletions

View file

@ -5,6 +5,8 @@ import os.path
# ------------------------------------------------------------------------------
appyPath = os.path.realpath(os.path.dirname(appy.__file__))
od = 'application/vnd.oasis.opendocument'
ms = 'application/vnd.openxmlformats-officedocument'
mimeTypes = {'odt': '%s.text' % od,
'ods': '%s.spreadsheet' % od,
'doc': 'application/msword',
@ -12,16 +14,21 @@ mimeTypes = {'odt': '%s.text' % od,
'pdf': 'application/pdf'
}
mimeTypesExts = {
'%s.text' % od: 'odt',
'%s.spreadsheet' % od: 'ods',
'application/msword': 'doc',
'text/rtf': 'rtf',
'application/pdf': 'pdf',
'image/png': 'png',
'image/jpeg': 'jpg',
'image/pjpeg': 'jpg',
'image/gif': 'gif'
}
'%s.text' % od: 'odt',
'%s.spreadsheet' % od: 'ods',
'application/msword': 'doc',
'text/rtf': 'rtf',
'application/pdf': 'pdf',
'image/png': 'png',
'image/jpeg': 'jpg',
'image/pjpeg': 'jpg',
'image/gif': 'gif',
'application/vnd.ms-excel': 'xls',
'application/vnd.ms-powerpoint': 'ppt',
'%s.wordprocessingml.document' % ms: 'docx',
'%s.spreadsheetml.sheet' % ms: 'xlsx',
'%s.presentationml.presentation' % ms: 'pptx',
}
# ------------------------------------------------------------------------------
class UnmarshalledFile: