<!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>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Could you be more specific?&nbsp; 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>&nbsp;</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>&nbsp;</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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; parent = 
self.aq_parent</FONT></DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; res = 
parent.yourZsql(pdf_id = REQUEST[pdf_id])&nbsp; # get the pdf from your 
DB</FONT></DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; record = 
res.dictionaries()</FONT></DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for n in 
record:</FONT></DIV>
<DIV><FONT face=Arial 
size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pdf = 
record['PDF']</FONT></DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT></DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
RESPONSE.setHeader('Content-Type','application/pdf')<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
RESPONSE.setHeader('Content-Length',len( pdf ))</FONT></DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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>&lt;dtml-call 
"REQUEST.set('pdf_id',pdf_id)"&gt;</FONT></DIV>
<DIV><FONT face=Arial size=2>&lt;dtml-call 
"yourExternalPythonSCript(PARENTS[0],REQUEST,RESPONSE)"&gt;&nbsp; </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</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>&nbsp;</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.&nbsp; I may select the file 
  from an oracle database of get it from a file system.&nbsp; I'm not sure at 
  the moment.</FONT></SPAN></DIV>
  <DIV><SPAN class=318132923-14082003><FONT face=Arial 
  size=2></FONT></SPAN>&nbsp;</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.&nbsp; But in my 
  case the pdf I want to view is based on an ID entered by the user.&nbsp; 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>&nbsp;</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>&nbsp; 1) if the 
  the pdf is on server then</FONT></SPAN></DIV>
  <DIV><SPAN class=318132923-14082003><FONT face=Arial 
  size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; view 
  (\docs\my.pdf)&nbsp; using the correct application type</FONT></SPAN></DIV>
  <DIV><SPAN class=318132923-14082003><FONT face=Arial 
  size=2></FONT></SPAN>&nbsp;</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>&nbsp; 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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;dtml-in 
  sql-get_pdf&gt;</FONT></SPAN></DIV>
  <DIV><SPAN class=318132923-14082003><FONT face=Arial 
  size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  somehow display the pdf</FONT></SPAN></DIV>
  <DIV><SPAN class=318132923-14082003><FONT face=Arial 
  size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &lt;/dtml-in&gt;</FONT></SPAN></DIV>
  <DIV><SPAN class=318132923-14082003><FONT face=Arial 
  size=2></FONT></SPAN>&nbsp;</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>&nbsp;</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>&nbsp;</DIV>
  <DIV><SPAN class=318132923-14082003></SPAN>&nbsp;</DIV>
  <P>
  <HR>

  <P></P>_______________________________________________<BR>Zope maillist&nbsp; 
  -&nbsp; 
  Zope@zope.org<BR>http://mail.zope.org/mailman/listinfo/zope<BR>**&nbsp;&nbsp; 
  No cross posts or HTML encoding!&nbsp; **<BR>(Related lists - 
  <BR>&nbsp;http://mail.zope.org/mailman/listinfo/zope-announce<BR>&nbsp;http://mail.zope.org/mailman/listinfo/zope-dev 
  )<BR></BLOCKQUOTE></BODY></HTML>