Any known issues using AutoFiller over SSL?

I’m having trouble using the AutoFiller directly to the Response.OutputStream over SSL. When using the code on our dev box that is not over SSL it works fine. As soon as we move it to staging which uses SSL, just a blank window is displayed rather than the PDF document.

Any ideas?

Dear msumerano,

I have not met such a problem. You could first write a simple pdf document which is created by Adobe Acrobat or other type of document like MS WORD into the Response.OutputStream over SSL. And check whether the error occurs again.

Best regards.

I will try that. Just in case, though, here’s the code I’m using. You’ll find it very similar to the AutoFiller example.


private void GeneratePDF(string TranIDs)

{

System.IO.FileInfo f;

try

{

f = new FileInfo(_8283FormPath);

if (f.Exists)

{

DataTable dtb = GetData(TranIDs);

if (dtb.Rows.Count > 0)

{

Response.Buffer = true;

Response.Clear();

Response.AddHeader(“Content-disposition”, “inline; filename=” + f.Name);

Response.ContentType = “application/pdf”;

AutoFiller af = new AutoFiller();

af.InputFileName = f.FullName;

af.OutputStream = Response.OutputStream;

af.ImportDataTable(dtb);

af.Save();

Response.End();

}

else

{

lblErr.Text = “No data to generate PDF document with.”;

}

}

else

{

lblErr.Text = “PDF form " + _8283FormPath + " is missing!”;

}

}

catch(Exception ex)

{

if (ex.GetType() != typeof(System.Threading.ThreadAbortException))

{

Response.Clear();

Response.Write(ex.Message + Environment.NewLine + ex.StackTrace);

}

}

}


I found the issue. We have IIS6 compression turned on for ASPX pages on our staging server. When a PDF document is sent in the Response with a content-disposition of “inline”, IIS thinks that it’s an ASPX page regardless if you set the filename in the content-disposition. Therefore, it compresses it, which screws up the Response for some reason. If you hit F5, the PDF magically appears. Smile I turned off compression, and it started working just fine. Now, I’m looking for a workaround since we need compression enabled and this PDF needs to be sent to the browser inline since it’s a pop-up page that handles the PDF generation.