[Zope] HTMLDOC under Zope

Dennis Allison allison@sumeru.stanford.EDU
Thu, 10 Oct 2002 21:50:44 -0700


I've put up HTMLDOC and am using it under Zope using an External Method
to construct the document.  Major problems getting the embedded figures
to get recognized by HTMLDOC even though they were specified by absolute
URLs (which referenced into a LFSProduct instance).  Eventually, I backed
off and referenced files in the physical file system.

Now everything sorta works.  I can create pdf documents on the fly, but
the behavior at the browser is not what I expect.   The HTMLDOC command
line is set up in the string "command".  Pipes are setup the the htmldoc
program run, returning a string which is returned in RESPONSE after the
Headers are set.


	(stin, stout) = os.popen2( command )
         stin.write( file.getvalue() )
         stin.close()
         pdf = stout.read()
         stout.close()

        # set the response headers for the appropriate content type
        RESPONSE.setHeader('Content-Type','application/pdf')
        RESPONSE.setHeader('Content-Length', str(len(pdf)) )
        RESPONSE.setHeader('Content-Disposition','inline; filename="%s"' % (outfile_name,))
        RESPONSE.write( pdf )

Under Opera 5 with no Acrobat plug-in, this triggers a save-as dialog
and saves the new pdf in the browser's local file system.  Under IE with
an Acrobat plug-in installed, I expect the pdf document to be displayed
with an option to save.  As it happens, the document raises a diagnostic
window indicating that the application type is "unknown" and, hence,
the appropriate Active-X control can't be found.

The Acrobat reader on the my IE test machines is appropriately configured
and regularly downloads pdf's with the desired behavior.

Can anyone point out what the problem is?  

Thanks.  -dra