<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1170" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Michael,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Could you be more specific? What is it
*exactly* you cannot do?</FONT></DIV>
<DIV><FONT face=Arial size=2>Your question raises alot of issues.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>if you just want to know what do once you have
access to the correct pdf then do something like (roughly in code)</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>*yourExternalPythonScript*</FONT></DIV>
<DIV><FONT face=Arial size=2>def someName(self,REQUEST,RESPONSE):</FONT></DIV>
<DIV><FONT face=Arial size=2> parent =
self.aq_parent</FONT></DIV>
<DIV><FONT face=Arial size=2> res =
parent.yourZsql(pdf_id = REQUEST[pdf_id]) # get the pdf from your
DB</FONT></DIV>
<DIV><FONT face=Arial size=2> record =
res.dictionaries()</FONT></DIV>
<DIV><FONT face=Arial size=2> for n in
record:</FONT></DIV>
<DIV><FONT face=Arial
size=2> pdf =
record['PDF']</FONT></DIV>
<DIV><FONT face=Arial size=2> </FONT></DIV>
<DIV><FONT face=Arial size=2>
RESPONSE.setHeader('Content-Type','application/pdf')<BR>
RESPONSE.setHeader('Content-Length',len( pdf ))</FONT></DIV>
<DIV><FONT face=Arial size=2> RESPONSE.write(
pdf)<BR></FONT></DIV>
<DIV><FONT face=Arial size=2>*the calling dtml script that displays the
pdf*</FONT></DIV>
<DIV><FONT face=Arial size=2><dtml-call
"REQUEST.set('pdf_id',pdf_id)"></FONT></DIV>
<DIV><FONT face=Arial size=2><dtml-call
"yourExternalPythonSCript(PARENTS[0],REQUEST,RESPONSE)"> </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>David</FONT></DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=mguerrero@tachyon.net href="mailto:mguerrero@tachyon.net">Michael
Guerrero</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=zope@zope.org
href="mailto:zope@zope.org">zope@zope.org</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Thursday, August 14, 2003 4:38
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> [Zope] Displaying a pdf
file.</DIV>
<DIV><BR></DIV>
<DIV><SPAN class=318132923-14082003><FONT face=Arial
size=2>Hello,</FONT></SPAN></DIV>
<DIV><SPAN class=318132923-14082003><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=318132923-14082003><FONT face=Arial size=2>What is the best
way to display a pdf file in a zope application. I may select the file
from an oracle database of get it from a file system. I'm not sure at
the moment.</FONT></SPAN></DIV>
<DIV><SPAN class=318132923-14082003><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=318132923-14082003><FONT face=Arial size=2>My Zope Bible book
shows how to upload a pdf file from a filesytem then view it. But in my
case the pdf I want to view is based on an ID entered by the user. There
may be many different pdf and I can't upload them all.</FONT></SPAN></DIV>
<DIV><SPAN class=318132923-14082003><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=318132923-14082003><FONT face=Arial size=2>I want to be able
to </FONT></SPAN></DIV>
<DIV><SPAN class=318132923-14082003><FONT face=Arial size=2> 1) if the
the pdf is on server then</FONT></SPAN></DIV>
<DIV><SPAN class=318132923-14082003><FONT face=Arial
size=2> view
(\docs\my.pdf) using the correct application type</FONT></SPAN></DIV>
<DIV><SPAN class=318132923-14082003><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=318132923-14082003><FONT face=Arial
size=2>or</FONT></SPAN></DIV>
<DIV><SPAN class=318132923-14082003><FONT face=Arial size=2> 2) if I
select the pdf from an oracle table (stored as a BLOB)</FONT></SPAN></DIV>
<DIV><SPAN class=318132923-14082003><FONT face=Arial
size=2> <dtml-in
sql-get_pdf></FONT></SPAN></DIV>
<DIV><SPAN class=318132923-14082003><FONT face=Arial
size=2>
somehow display the pdf</FONT></SPAN></DIV>
<DIV><SPAN class=318132923-14082003><FONT face=Arial
size=2>
</dtml-in></FONT></SPAN></DIV>
<DIV><SPAN class=318132923-14082003><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=318132923-14082003><FONT face=Arial size=2>Thanks for your
help</FONT></SPAN></DIV>
<DIV><SPAN class=318132923-14082003><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=318132923-14082003><FONT face=Arial size=2>Mike
Guerrero</FONT></SPAN></DIV>
<DIV><SPAN class=318132923-14082003><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=318132923-14082003></SPAN> </DIV>
<P>
<HR>
<P></P>_______________________________________________<BR>Zope maillist
-
Zope@zope.org<BR>http://mail.zope.org/mailman/listinfo/zope<BR>**
No cross posts or HTML encoding! **<BR>(Related lists -
<BR> http://mail.zope.org/mailman/listinfo/zope-announce<BR> http://mail.zope.org/mailman/listinfo/zope-dev
)<BR></BLOCKQUOTE></BODY></HTML>