>>>>> Carl K <[EMAIL PROTECTED]> (CK) wrote:

>CK> Here is what the code looks like that generates the pdf:

>CK>     buffer = StringIO()
>CK>     rw = dReportWriter(OutputFile=buffer, ReportFormFile=xmlfile, 
>Cursor=ds)
>CK>     rw.write()
>CK>     pdf = buffer.getvalue()
>CK>     return pdf

You can pipe the pdf through ghostscript and read the png back from
ghostscript's stdout. Like:

gs -q -sDEVICE=png16m -sOutputFile=- - 

Use that command in subprocess with the  stdin/stdout as pipes, send
your PDF data to the process and read the PNG output back.

However you must be aware that this can deadlock if the output is large
enough. So putting the input or the output in a real file is probably safer
anyway.

-- 
Piet van Oostrum <[EMAIL PROTECTED]>
URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4]
Private email: [EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to