On Wednesday 14 April 2010 12:20 AM, Mike Orr wrote:
It's not off topic. I have a client who renders PDF in Pylons, and I
may have to do it myself someday. I don't remember offhand if he's
using ReportLab or some other library, but I'll check tonight.

I am already using reportlab and it works absolutely fine for me.
Infact if any one else needs any help with that library, I can certainly do my modest part. But the bottom line is that reportlab is perfect.
I really need to know how I can get pdf rendered to the browser
You have to set the content type as Deron said.

yes, this was one thing pritty obvious I guess, I was too stupid to ignore that.

     response.content_type = "application/pdf"

As for rendering it in the browser window (rather than launching a
viewer application), that's totally up to the browser and plugin. You
have no control over it.

No, I am ok with the browser passing on the responsibility to another app such as evince in GNU/Linux or acrobad reader for windows.

By the way, if the PDF is already in a file with a .pdf extension, you
can use paste.fileapp to send it, which saves some work.



Thanks a lot! the files are indeed getting saved as .pdf so I guess the fileapp will directly send out the file to the browser.
So do I use the paist.fileapp instead of return?
and to use fileapp do I still need to set the response header (content type ) or will that function handle the work?

Happy hacking.

--
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to pylons-disc...@googlegroups.com.
To unsubscribe from this group, send email to 
pylons-discuss+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en.

Reply via email to