views:

18

answers:

0

Hi everyone,

I have a pdf file with a submit button. This sends the information using XFDF to an asp.net handler. There, I can get the data but I can't avoid the Adobe Reader message "An error occurred during the submit process. Cannot process content of type". The thing is, the pdf app is working as a client for my ASP.NET app, so I need to send something that makes sense to it (I know, doesn't make too much sense sending back html for adobe reader :))

On the ProcessRequest method of the handler, I have tried creating a pdf with a confirmation message ("Data submitted successfully"). It works, but this feedback sounds VERY unusual: you hit a submit button and then get another window with another pdf with a message. No, I don't want this.

Does anybody know how to access the reader API to send a message to it requesting an alert box to be shown? Thank you very much!

UPDATE!

I found the solution! :) I've created an empty FDF file using iTextSharp and sent it back to Adobe Reader. Now, I am not getting that error message anymore. The code of the ASP.NET handler would be something like this...

    public void ProcessRequest(HttpContext context)
    {
        byte[] content = context.Request.BinaryRead(context.Request.ContentLength);
        var reader = new FdfReader(content);

        // Do whatever you want with the values here

        var writer = new FdfWriter();
        MemoryStream memoryStream = new MemoryStream();
        writer.WriteTo(memoryStream);
        context.Response.ContentType = "application/vnd.fdf";
        context.Response.BinaryWrite(memoryStream.ToArray());
    }

P.s.: Instead of using XFDF to send values, now I am using FDF.