Hello all, I'm trying to generate a page to print and felt the best way is to convert it to pdf format. The information is on a database (mysql) and when I use <dtml-in printinfo> in the page, it renders the dtml page ok and by putting /html2pdf at the end of the url, it creates the pdf file. However, if the dtml-in command is passed a variable (<dtml-in "printinfo(nameid="SESSION['nameid']">), the dtml form renders fine but the pdf file will not be generated by it. I have tried sorting after the dtml-in command but the same story, even doing a <dtml-var "SESSION[nameid']"> while zope renders it, will not get converted to pdf..... if I save the file and use hmtldoc -f nameid.pdf nameid.html --webpage, it works. Any suggestions how I can resolve this problem? Regards, Mehmet
I've found a "solution" to the problem - I created another table in mysql and passed the variable to it using dtml-call, then used it as a filter in my select statement, it works, but if anyone has a more elegant way, I am only too happy to learn. Regards, Mehmet Mehmet Yousouf wrote:
Hello all,
I'm trying to generate a page to print and felt the best way is to convert it to pdf format. The information is on a database (mysql) and when I use <dtml-in printinfo> in the page, it renders the dtml page ok and by putting /html2pdf at the end of the url, it creates the pdf file. However, if the dtml-in command is passed a variable (<dtml-in "printinfo(nameid="SESSION['nameid']">), the dtml form renders fine but the pdf file will not be generated by it.
I have tried sorting after the dtml-in command but the same story, even doing a <dtml-var "SESSION[nameid']"> while zope renders it, will not get converted to pdf..... if I save the file and use hmtldoc -f nameid.pdf nameid.html --webpage, it works.
Any suggestions how I can resolve this problem?
On Thu, 06 Mar 2003 11:09:04 +0000 "Mehmet Yousouf" <mehmety@carramar.auslin.com.au> wrote:
I have tried sorting after the dtml-in command but the same story, even doing a<dtml-var "SESSION[nameid']"> while zope renders it, will not get converted to pdf..... if I save the file and use hmtldoc -f nameid.pdf nameid.html --webpage, it works.
The problem here is, that htmldoc makes its own request to the named page. This request doesn't know anything about your session, as it can not hanlde cookies or authentication. The solution you tried will break, if someone else will print the page. HTH, __Janko
Thanks for the input, I am not happy with the "fix" but it will have to do till I get a better solution - only 5 computers will be using the program at a time (a manufacturing package for our bedlinen company) initially, each with a particular task so initially it should work, I will try putting in some checking to block anyone else printing the same information. This information can also only get printed once via this route. Regards, Mehmet Janko Hauser wrote:
On Thu, 06 Mar 2003 11:09:04 +0000 "Mehmet Yousouf" <mehmety@carramar.auslin.com.au> wrote:
I have tried sorting after the dtml-in command but the same story, even doing a<dtml-var "SESSION[nameid']"> while zope renders it, will not get converted to pdf..... if I save the file and use hmtldoc -f nameid.pdf nameid.html --webpage, it works.
The problem here is, that htmldoc makes its own request to the named page. This request doesn't know anything about your session, as it can not hanlde cookies or authentication.
The solution you tried will break, if someone else will print the page.
participants (3)
-
Janko Hauser -
Mehmet Yousouf -
Mehmet Yousouf