[Zope] Zope pdf's on the fly

John Ziniti jziniti@speakeasy.org
Mon, 07 Jul 2003 13:47:36 -0500


Dennis Allison wrote:

>Microsoft's IE uses non-standard techniques to determine the type of a 
>file.  To bend it to our will, we've found that the generation program
>needs to be named with a '.pdf' extension.  This, of course, makes it a 
>bit difficult to embed in a dtml call.  (As a form action, it works...)
>
>What I have is an external method that manages the interfact to HTMLDOC
>by building a html file, sending it to HTMLDOC, gathering the result, and 
>returning it with appropriate headers to the client.
>
>If I use a form to set up parameters to the external method and 
>
>	<form action="doit.pdf()">
>	..
>	</form>
>
>it works fine.  Of course, 
>
>	<dtml-varB expr="doit.pdf()">
>
>doesn't.
>

Can't you just have the External Method use calls to setHeader
to set the Content-type of the returned document.  I don't test
much with IE, but surely it will obey the Content-type header?
(Additionally, you can use "Content-dispostion" to set the filename
to beautify that a bit also).

JZ