Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
w2pext
plugin_dbui
Commits
4677401b
Commit
4677401b
authored
Nov 07, 2019
by
LE GAC Renaud
Browse files
Tune views/reports/report_2.pdf (but not working yet).
parent
cb5d7ad4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
views/reports/report_2.pdf
views/reports/report_2.pdf
+6
-5
No files found.
views/reports/report_2.pdf
View file @
4677401b
...
...
@@ -2,7 +2,7 @@
{{
import base64
import
cStringIO
import
io
import os
from subprocess import call
...
...
@@ -12,14 +12,14 @@ from uuid import uuid4
# recuperate the latex string generate by the latex view
# and remove it from the response object
latex = response.body.getvalue()
response.body =
cStringIO
.StringIO()
response.body =
io
.StringIO()
# go to the private directory and create a latex file
cwd = os.getcwd()
os.chdir(os.path.join(request.folder, 'private'))
fn = str(uuid4())
fi = open('%s.tex' % fn, 'w
b
')
fi = open('%s.tex' % fn, 'w')
fi.write(latex)
fi.close()
...
...
@@ -35,7 +35,7 @@ fi.close()
s64 = base64.b64encode(spdf)
# clean files
for ext in ('aux', 'log', 'pdf', 'tex'):
for ext in ('aux', 'log',
'out',
'pdf', 'tex'):
f = '%s.%s' % (fn, ext)
if os.path.exists(f):
os.remove(f)
...
...
@@ -46,6 +46,7 @@ pass
os.chdir(cwd)
# build the response
response.body = io.StringIO()
response.headers['Content-Type']='application/pdf'
response.write(s64, escape=False)
}}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment