Mejorar el tiempo para generar el PDF

This commit is contained in:
Mauricio Baeza 2018-02-22 15:12:04 -06:00
parent 765e449d8f
commit 01ed2d9090
2 changed files with 3 additions and 5 deletions

View File

@ -1109,6 +1109,7 @@ class LIBO(object):
def pdf(self, path, data, ods=False):
options = {'AsTemplate': True, 'Hidden': True}
log.info('Abrir plantilla...')
self._template = self._doc_open(path, options)
if self._template is None:
return b''
@ -1123,13 +1124,10 @@ class LIBO(object):
_kill(path_ods)
return data
doc = self._doc_open(path_ods, {'Hidden': True})
options = {'FilterName': 'calc_pdf_Export'}
path_pdf = get_path_temp('.pdf')
doc.storeToURL(self._path_url(path_pdf), self._set_properties(options))
doc.close(True)
self._template.storeToURL(self._path_url(path_pdf), self._set_properties(options))
self._template.close(True)
data = self._read(path_pdf)
_kill(path_ods)
_kill(path_pdf)

View File

@ -8,4 +8,4 @@ threads = 4
py-autoreload = 1
thunder-lock = true
static-map = /static=../static
http-timeout = 180
http-timeout = 300