I know this is an older post, however, used this to access my template with 
parameters passed...

        import urllib, tg
>         import xhtml2pdf.pisa as pisa 

        dest = "test-website.pdf"
>         env = []
>         env = request.environ
>         url = "http://";
>         url += env['HTTP_HOST']
>         url +=  '/def_for_html?selected=' + kw['selected']
>         
>         result = file(dest, "wb")
>         pdf = pisa.CreatePDF(
>             urllib.urlopen(url),
>             result,
>             log_warn=1,
>             log_err=1,
>             path=url,
>             link_callback=pisa.pisaLinkLoader(url).getFileName  # 
> retrieves css and js files for html
>             )
>         result.close()
>         import paste.fileapp
>         f = paste.fileapp.FileApp(dest)
>         from tg import use_wsgi_app
>         return use_wsgi_app(f) 
>

The css that html2pdf handles is very limited... floats were my main 
problem.  Had to change html to tables as floats kept throwing up divide by 
0 errors. 

>         
>

-- 
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/turbogears?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to