Thank you, in the meanwhile i've found the solution, i create my pdf
file in 'tmp', inside 'public' and the execute the command via 'os'
module and after copy the pdf created in the 'StringIO' object:
# Creamos el documento que devolveremos
fichero = StringIO.StringIO()
# Creamos el documento intermedio en el servidor
documento = CrearPDF('intranet/public/tmp/informe.pdf', u'Psy ...
[...]
# Creamos los documentos mediante la shell
os.system('pdftk intranet/public/tmp/informe.pdf background
intranet/public/images/fondoPsyche.pdf output
intranet/public/tmp/informeNuevo.pdf')
f = open('intranet/public/tmp/informeNuevo.pdf', 'r')
for linea in f:
fichero.write(linea)
f.close()
os.system('rm -f intranet/public/tmp/informe.pdf')
os.system('rm -f intranet/public/tmp/informeNuevo.pdf')
# Devolvemos el fichero
pdf = fichero.getvalue()
fichero.close()
pylons.response.headers['Content-Type'] = 'application/pdf'
pylons.response.headers['Content-Disposition'] =
'attachment;filename=informe.pdf'
return(pdf)
I have the complete code if anyone wants to watch it, but i think that
that portion is self-explanatory. The class 'CrearPDF' uses
'Reportlab' to create the report.
--
There's no religion but sex and music
-- Sting
--
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en.