[pylons-discuss] Dynamically-generated PDF to download

2015-01-25 Thread Adam Morris
I have a view that serves up a page that whose template/css contain both define screen and print media. Which means the view's renderer provides a page that serves up html that is formatted for the browser (screen media) and if the user prints it formatted for the page (the print media). The

Re: [pylons-discuss] Dynamically-generated PDF to download

2015-01-25 Thread Wichert Akkerman
On 25 Jan 2015, at 07:37, Adam Morris adam.mor...@igbis.edu.my wrote: I have a view that serves up a page that whose template/css contain both define screen and print media. Which means the view's renderer provides a page that serves up html that is formatted for the browser (screen

Re: [pylons-discuss] Dynamically-generated PDF to download

2015-01-25 Thread Wichert Akkerman
On 25 Jan 2015, at 14:40, Adam Morris adam.mor...@igbis.edu.my wrote: Okay, I get that bit now, and coded it up, but when I go to render it, I use the pyramid.renderers.render object but obviously it ends up downloading a corrupted file because it's not even in PDF format. You are still

Re: [pylons-discuss] Add header parameters in HTTPFound?

2015-01-25 Thread QLands Software
Ok. Got it. I implemented it with a cookie. Thanks On Monday, 12 January 2015 19:25:32 UTC+3, Chris Rossi wrote: Your problem is in misunderstanding HTTP. Sending an 'Authorize' header in a response, will not cause the client to resend that Authorize header in a later request. It just

[pylons-discuss] Can't register TALES expression

2015-01-25 Thread Thierry Florac
Hi, On the model of zope.contentprovider provider: TALES expression, I'm trying to register a new custom expression for Chameleon. My code is very simple and tries to follow Chamelon documentation: from chameleon import PageTemplate def provider_expression(string): def compiler(target,

Re: [pylons-discuss] Dynamically-generated PDF to download

2015-01-25 Thread Adam Morris
Got it working now. Problem was that it was that pdfkit was outputting everything... even verbose stuff, would have thought that would have been off. Thanks for your help. On Monday, January 26, 2015 at 8:20:55 AM UTC+8, Adam Morris wrote: Okay, I've identified pdfkit but with the following

[pylons-discuss] Re: Can't register TALES expression

2015-01-25 Thread Thierry Florac
Probably found! I had to use PageTemplateFile.expression_types... Regards, Thierry 2015-01-25 13:36 GMT+01:00 Thierry Florac tflo...@gmail.com: Hi, On the model of zope.contentprovider provider: TALES expression, I'm trying to register a new custom expression for Chameleon. My code is very

Re: [pylons-discuss] Dynamically-generated PDF to download

2015-01-25 Thread Adam Morris
Okay, I get that bit now, and coded it up, but when I go to render it, I use the pyramid.renderers.render object but obviously it ends up downloading a corrupted file because it's not even in PDF format. So does reportlab have something to take that html/css and paint it to a Canvas or

Re: [pylons-discuss] Dynamically-generated PDF to download

2015-01-25 Thread Adam Morris
Okay, I've identified pdfkit but with the following code I get a blank pdf downloaded, I must be doing something wrong...: from pyramid.renderers import render from pyramid.response import Response import pdfkit import StringIO result =