tags:

views:

191

answers:

0

I'm trying to figure out a situation where when reaching a web page that is supposed to pull some data from database and push that to the user.

Behavior in IE: Instead of serving up the page, the user is presented with a dialog asking the user if they want to open, save or cancel. Clicking "open" and the dialog disappears for a second, then reappears.

Behavior in Firefox: Firefox opens the PDF that should be populated with data, yet does not populate the data.

FDF Background: An FDF contains the data that goes into a PDF (with fields). It contains a list of fields and value pairs as well as a path to the PDF to fill in.

Background: The development server this is happening on is IIS and has a self-signed certificate. The MIME type of application/vnd.fdf is registered with IIS.

Snippet of FDF:

` %FDF-1.2
1 0 obj <<
/FDF <<
/Fields
[
<<
/T (fieldName)
/V (valueOfField)

]
/F (https://servername_here/some_path_here/pdf_form_with_fields.pdf) >>

endobj
trailer
<< /Root 1 0 R >>
%%EOF`

Snippet of web page serving the FDF:
HttpContext.Current.Response.Clear()
HttpContext.Current.Response.ClearHeaders()
HttpContext.Current.Response.ClearContent()
HttpContext.Current.Response.ContentType = "application/vnd.fdf"
Response.Write("%FDF-1.2" + Microsoft.VisualBasic.vbCrLf)

... snip ...

Response.Write(">> " + Microsoft.VisualBasic.vbCrLf)
Response.Write(">> " + Microsoft.VisualBasic.vbCrLf)
Response.Write("endobj" + Microsoft.VisualBasic.vbCrLf)
Response.Write("trailer" + Microsoft.VisualBasic.vbCrLf)
Response.Write("<< /Root 1 0 R >>" + Microsoft.VisualBasic.vbCrLf)
' End of file, the Acrobat way.
Response.Write("%%EOF")
HttpContext.Current.Response.Flush()
HttpContext.Current.Response.Close()

The path leading to the PDF is set so that no authentication is needed to get to the PDF. One can type the path in the /F entry directly into a browser window and the form opens up in the browser.

The client is strongly opposed to using iText in this application.

Questions:
1. Has anyone seen the infinite loop behavior before?
2. What was the cause?
3. How did you fix it?