[Zope] keep from switching browser windows

Tuttle, Gene cetuttle at rottlundhomes.com
Tue Oct 12 09:07:49 EDT 2004


I have a formulator form that I am using for data gathering.  After the form
is filled in and validated it redirects to a python script that generates
XFDF data. (xfdf is Acrobat XML data)
This when sent to the browser should open Acrobat in the same window and
display the data in the PDF document, however it switches the browser to a
different instance of the browser.
If I take out the line:
request.RESPONSE.setHeader('Content-Type', 'application/Vnd.fdf')
it will display the xml data in the same window.
Is it possible to make the Acrobat start in the same window? 
The same thing happens if I put the URL into the browser. (goes to a
differant window to open up the acrobat.)


The SCRIPT:
## Script (Python) "generate_pdfdata.fdf"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=generic_form
##title=
##

# Import a standard function, and get the HTML request and response objects.
from Products.PythonScripts.standard import html_quote
request = container.REQUEST
request.RESPONSE.setHeader('Content-Type', 'application/Vnd.fdf')
print """<?xml version="1.0" encoding="UTF-8"?>"""
print """<xfdf xmlns="http://ns.adobe.com/xfdf/" xml:space="preserve">"""
print """<f
href="http://mplssrv5:8080/SAS/PDFforms/rottlund/mn_1025_4_98"/>"""

print """   <fields>
	<field name="address">
		<value>14661 Trotters Trail </value>
	</field>
	<field name="buyer">
		<field name="name">
			<value>John &amp; Jane Doe</value>
		</field>
		<field name="address">
			<field name="street">
				<value>14661 Any Streen</value>
			</field>
			<field name="csz">
				<value>Big City  AA 99999</value>
			</field>
		</field>
	</field>
	<field name="lot">
		<value>5</value>
	</field>
	<field name="block">
		<value>102</value>
	</field>
	<field name="plan">
		<field name="name">
			<value>1781ahgl01 Addison -A- HGL01</value>
		</field>
	</field>
	<field name="amount">
		<value>500</value>
	</field>
		<field name="bydate">
		<value>23-sep-2004</value>
	</field>


	
	<field name="today">
		<value>16-sep-2004</value>
	</field>



	<field name="dep_amount">
		<value>1000.00</value>
	</field>

	<field name="checknumber">
		<value>12376</value>
	</field>

	<field name="bank">
		<value>Norwest</value>
	</field>




  </fields>
"""


print """</xfdf>"""

return printed


More information about the Zope mailing list