[Zope] pdf on-the-fly (again)
Alec Mitchell
apm13 at columbia.edu
Thu Apr 15 12:00:29 EDT 2004
On Thursday 15 April 2004 07:22 am, Alex77 wrote:
> Hi,
> I'm using html2pdf external ( http://zope.org/Members/mjablonski/howtoPDF)
> script to generate on-the-fly pdf. I usually add the URL /html2pdf to the
> document I want to be converted into pdf. The problem comes when I pass a
> parameter to the URL I want to convert
> (i.e. detail?param=myvalue), the corrisponding pdf URL is
> detail?param=myvalue/html2pdf , but it does not work since
> "param=myvalue/html2pdf" is evaluated as QUERY_STRING and then the html2pdf
> script is never called.
> how can I force the html2pdf script to work?
Change the URL to 'detail/html2pdf?param-myvalue'. A good way to accomplish
this is using make_query from ZTUtils in a python script which generates the
PDF url for you like this:
from ZTUtils import make_query
form = getattr(request,'form',{})
query=''
if form: query='?'+make_query(form)
pdfurl=request.URL0+'/html2pdf'+query
return pdfurl
Hope that helps,
Alec Mitchell
More information about the Zope
mailing list