forked from elmau/empresa-libre
Mejorar el tiempo para generar el PDF
This commit is contained in:
parent
765e449d8f
commit
01ed2d9090
|
@ -1109,6 +1109,7 @@ class LIBO(object):
|
||||||
|
|
||||||
def pdf(self, path, data, ods=False):
|
def pdf(self, path, data, ods=False):
|
||||||
options = {'AsTemplate': True, 'Hidden': True}
|
options = {'AsTemplate': True, 'Hidden': True}
|
||||||
|
log.info('Abrir plantilla...')
|
||||||
self._template = self._doc_open(path, options)
|
self._template = self._doc_open(path, options)
|
||||||
if self._template is None:
|
if self._template is None:
|
||||||
return b''
|
return b''
|
||||||
|
@ -1123,13 +1124,10 @@ class LIBO(object):
|
||||||
_kill(path_ods)
|
_kill(path_ods)
|
||||||
return data
|
return data
|
||||||
|
|
||||||
doc = self._doc_open(path_ods, {'Hidden': True})
|
|
||||||
options = {'FilterName': 'calc_pdf_Export'}
|
options = {'FilterName': 'calc_pdf_Export'}
|
||||||
path_pdf = get_path_temp('.pdf')
|
path_pdf = get_path_temp('.pdf')
|
||||||
doc.storeToURL(self._path_url(path_pdf), self._set_properties(options))
|
self._template.storeToURL(self._path_url(path_pdf), self._set_properties(options))
|
||||||
doc.close(True)
|
|
||||||
self._template.close(True)
|
self._template.close(True)
|
||||||
|
|
||||||
data = self._read(path_pdf)
|
data = self._read(path_pdf)
|
||||||
_kill(path_ods)
|
_kill(path_ods)
|
||||||
_kill(path_pdf)
|
_kill(path_pdf)
|
||||||
|
|
|
@ -8,4 +8,4 @@ threads = 4
|
||||||
py-autoreload = 1
|
py-autoreload = 1
|
||||||
thunder-lock = true
|
thunder-lock = true
|
||||||
static-map = /static=../static
|
static-map = /static=../static
|
||||||
http-timeout = 180
|
http-timeout = 300
|
Loading…
Reference in New Issue