2 Replies Latest reply on May 9, 2010 12:24 PM by paulv0627

    XFDF/PDF using Safari - File Cannot Be Found Error

    paulv0627

      I cannot get an XFDF to merge with a PDF using Safari (Windows). A popup appears saying "There was an error opening this document. This file cannot be found". This, and about 50 others work fine in IE, Firefox, Chrome and Opera.

       

      I am streaming an XFDF from a datbase to the browser (content-type "application/vnd.adobe.xfdf"). Within the XFDF is an HREF back to the page that streams the PDF so the plugin can do the merge.

       

      I've tried these things:

       

      Made sure all settings are correct in Acrobat Reader

      Implemented a cross domain policy file (not running cross domain though)

      Ensured that there are no spaces in the URL

      Ensured that there are no weird characters in the URL

      Encoded the URL argument (a GUID)

      Ensured that the URL is enclosed in quotes

      Re-installed Safari and Acrobat Reader.

      Gave "allow all users" permissions to the relevant ASPX pages

      Tried Reader 8 and Reader 9

      Tried PDF's from Acrobat Pro 8 and Acrobat Pro 9

      I have confirmed that streaming just the PDF to Safari works fine.

       

      ANY help, ideas, tips would be most greatly appreciated as this is becoming "personal"

       

      Below is the xfdf content.

       

      Thanks

       

      Paul:

       

      <xfdf xmlns="http://ns.adobe.com/xfdf/" xml:space="preserve"><annots /><f href="http://localhost/PASS/Plans/GetPdf.aspx?id=ad70736b-f1f1-4981-9937-7295c4cd0dde" /><fields><field name="Check Box35"><value>Off</value></field><field name="Check Box36"><value>Off</value></field><field name="Check Box37"><value>Off</value></field><field name="Check Box38"><value>Off</value></field><field name="Check Box39"><value>Off</value></field><field name="Check Box40"><value>Off</value></field><field name="Check Box41"><value>Off</value></field><field name="Check Box42"><value>Off</value></field><field name="Check Box43"><value>Off</value></field><field name="Check Box44"><value>Off</value></field><field name="Check Box45"><value>Off</value></field><field name="Check Box46"><value>Off</value></field><field name="Check Box47"><value>Off</value></field><field name="Check Box48"><value>Off</value></field><field name="Check Box49"><value>Off</value></field><field name="Check Box50"><value>Off</value></field><field name="Check Box51"><value>Off</value></field><field name="Check Box52"><value>Yes</value></field><field name="Check Box53"><value>Off</value></field><field name="Check Box54"><value>Yes</value></field><field name="Check Box55"><value>Yes</value></field><field name="Check Box56"><value>Yes</value></field><field name="Check Box57"><value>Yes</value></field><field name="Check Box58"><value>Off</value></field><field name="Check Box59"><value>Off</value></field><field name="Check Box60"><value>Off</value></field><field name="Check Box61"><value>Off</value></field><field name="Check Box62"><value>Off</value></field><field name="Check Box63"><value>Off</value></field><field name="Check Box64"><value>Yes</value></field><field name="Check Box65"><value>Yes</value></field><field name="Check Box66"><value>Yes</value></field><field name="Check Box67"><value>Yes</value></field><field name="Check Box68"><value>Off</value></field><field name="Check Box69"><value>Off</value></field><field name="Check Box70"><value>Off</value></field><field name="Check Box71"><value>Yes</value></field><field name="Check Box72"><value>Off</value></field><field name="Grade"><value>09</value></field><field name="School"><value>EI Demo High 100</value></field><field name="StudentID"><value>33111512</value></field><field name="Student_First_Name"><value>Anonymous</value></field><field name="Student_Last_Name"><value>Student1512</value></field><field name="Student_Middle_Initial"><value>A</value></field><field name="Text34"><value>dfddfdfdfdfdfdfddfdfdfdfdfdfdddfdfdfdf</value></field></fields><ids original="09EFD4B8D52F82C5D013AE357C0EA09F" modified="C1490D695E5D07478407ED83FD2EE23C" /></xfdf>

        • 1. Re: XFDF/PDF using Safari - File Cannot Be Found Error
          $Aravind.K$

          Hi,

           

          I am facing similar issue with safari browser like you, i can't load pdf document [contentype : "application/vnd.adobe.xdp+xml"] on safari browser [windows].

           

          Error message : "There was an error opening this document. This file cannot be found"

           

          I am searching for solution from couple of days. i will share with you if i found any answer.

           

          My code goes as below :

           

          Response.Clear()

                  Response.Buffer = True

                  Response.ContentType = "application/vnd.adobe.xdp+xml"

                  Dim Responsestring As New StringBuilder()

                  Responsestring.Append("<?xml version='1.0' encoding='UTF-8'?>")

                  Responsestring.Append("<?xfa generator='AdobeDesigner_V8.2'?>")

                  Responsestring.Append("<xdp:xdp xmlns:xdp='http://ns.adobe.com/xdp/'>")

                  Responsestring.Append("<pdf href='http://" + Page.Request.ServerVariables("HTTP_HOST").ToString & Page.Request.ApplicationPath & "Test.pdf' xmlns='http://ns.adobe.com/xdp/pdf/' />")

                  Responsestring.Append("</xdp:xdp>")

                  Response.Write(Responsestring)

                  Response.Flush()

                  Response.End()

           

          Regards,

          Aravind.K

          • 2. Re: XFDF/PDF using Safari - File Cannot Be Found Error
            paulv0627 Level 1

            Hi Aravind

             

            I'm not sure we are trying to do the same thing because I am not familiar with XDP. My problem is with mergering XFDF with the reader on the Safari client. It was never able to get it to work. Ultimately I implemented iTextSharp and did the merge on the server-side. If it may be of any possible value I've listed the code below. The XML Document "doc" is my XFDF data.

             

            Paul

             

               private void MergeXfdfAndSend()
                    {
                                           
                        MemoryStream pdfStream = new MemoryStream();

             

                        PdfReader pdfReader = new PdfReader((byte[])pdf);

             

                        PdfStamper stamper = new PdfStamper(pdfReader, pdfStream);

             

                        MemoryStream xfdfStream = new MemoryStream(System.Text.Encoding.Unicode.GetBytes(doc.OuterXml.ToString()));
                       
                        XfdfReader xfdfReader = new XfdfReader(xfdfStream.ToArray());

             

                        AcroFields acroFields = stamper.AcroFields;
                        acroFields.SetFields(xfdfReader);
                        stamper.FreeTextFlattening = false;
                        stamper.FormFlattening = false;
                        stamper.Writer.CloseStream = false;
                        stamper.Close();

             

                        Response.ContentType = "application/pdf";
                        pdfStream.WriteTo(Response.OutputStream);
                        pdfStream.Close();

             

                        Response.End();
                    }