15 Replies Latest reply on Jul 16, 2013 12:52 PM by B Peterson

    XDP <pdf href="..."> doesn't load data if PDF is online

    seeker__

      In Acrobat I can import/Export data off my LiveCycle form.

       

      XDP file exported by Acrobat has the following lines:

       

           <pdf href="../myForm.pdf"/>

      </xdp:xdp>

       


      If load this file by Acrobat, is works perfectly (Opens the form and populates it). However, I need to have my PDF file on a server, so I edited the file:

       

           <pdf href="https://mysite.com/myForm.pdf"/>

      </xdp:xdp>

       

       

      Now when I open it in Acrobat Pro X,  it opens my web browser and loads the PDF but does not populate it.

       

      Do you know what am I doing wrong? or is this another restricted feature?

        • 1. Re: XDP <pdf href="..."> doesn't load data if PDF is online
          seeker__ Level 1

          I made some progress I'd like to share. Instead of referencing the PDF I used Base64 encoding to include the PDF in the XDP file. It works when I open the file in Acrobat. But when I feed it to the web browser I get the following pop-up error from Acrobat Plugin (inside FireFox):


          The XDP file returned by the server is trying to open local file:


          file:///C|DOCUME~1/ADMINI~1/LOCALS~1/Temp/A9RBD8D.tmp.dir/A9RBD8C.pdf


          but access to local file system is denied.

           

          >OK<

           

          The pop-up window's title is "Adobe Acrobat"

           

           

          I should mention, to get the content open inside the browser I used "application/pdf" as the content type of my http request sent to the browser.

           

          any comment is welcome!

          • 2. Re: XDP <pdf href="..."> doesn't load data if PDF is online
            seeker__ Level 1

            I changed the  content type to "application/vnd.adobe.xdp+xml" and that solved the problem.

            • 3. Re: XDP <pdf href="..."> doesn't load data if PDF is online
              seeker_

              I was wrong change MIME type helped but did not solve the problem.

               

              Opening an XDP file in browser causes Acrobat to issue the error message in my original post.

               

              Please help.

              • 4. Re: XDP <pdf href="..."> doesn't load data if PDF is online
                seeker__ Level 1

                Acrobat_error.jpeg

                 

                Above error is as I have described in my first post pops up by opening a XDP in browser when it is sent from a server. But if I save the same XDP (in FireFox file > save as...) to the Desktop then drag and drop it into a new tab, it opens beautifully.

                 

                this seems to be a Adobe Plugin bug. The temproary file was created by the plugin it self !

                 

                Im using Adobe Reader 10.1 and FireFox 5

                • 5. Re: XDP <pdf href="..."> doesn't load data if PDF is online
                  mdb01803 Level 1

                  Hey Seeker,

                   

                  We have hit this issue as well.  You seem to be the only other human (assuming you are human) to have encountered this issue.  Did you ever find a way around this? 

                   

                  We are pulling the XDP out of a blob field and trying to load up the PDF.

                   

                  Thanks in advance for any help or guidance you can provide.

                  MDB

                  • 6. Re: XDP <pdf href="..."> doesn't load data if PDF is online
                    qweret_

                    Got the same issue.

                     

                    I can't open it in my browser. And if i got it opened(because there is a local copy of the form on my computer), i can't save it with the data inside. I know, that i have to give Reader Extension Rights, but how do i do that inside of php-code?

                     

                    I have a form that is created with LiveCycle, and i want to fill up that form with values from my Database.
                    So i create a .xdp-file on my own, it looks like this:

                    $data = '<?xml version="1.0" encoding="' . $enc . '"?>' . "\n" .

                              '<?xfa generator="XFA2_4" APIVersion="2.5.6290.0"?>' . "\n" .

                              '<xdp:xdp xmlns:xdp="http://ns.adobe.com/xdp/" >' . "\n" .

                              '<xfa:datasets xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/">' .

                              "\n" . '<xfa:data>' . "\n" . '<Formular1>' . "\n";

                     

                     

                              foreach ($info as $field => $val) {

                                        $data .= '<' . $field . '>';

                     

                     

                                        if (is_array($val)) {

                                                  foreach ($val as $opt)

                                                            $data .= htmlentities($opt, ENT_COMPAT, $enc);

                                        } else {

                                                  $data .= htmlentities($val, ENT_COMPAT, $enc);

                                        }

                     

                     

                                        $data .= '</' . $field . '>' . "\n";

                              }

                     

                    $data .= '</Formular1>' . "\n" . '</xfa:data>' . "\n" .

                              '</xfa:datasets>' . "\n" . '<pdf href="' . $file .

                              '" xmlns="http://ns.adobe.com/xdp/pdf/"/>' .

                              "\n" . '</xdp:xdp>' . "\n";

                     


                    I get a Warning, that it can't find the pdf-file that is referenced to this XDP-File. What's wrong?

                     

                    And how can i populate the form with the values inside? I mean, how can i make it a complete PDF instead of a combination of pdf and xdp?

                     

                    Some answers would be awesome. Maybe atleast some alternatives.

                     

                    I am going to write a Tutorial for this, if i get it to work. Already invested soooo much time and still no solution.

                    • 7. Re: XDP <pdf href="..."> doesn't load data if PDF is online
                      tanzelwurm

                      I solved this issue somehow.

                       

                      Instead of linking to the PDF file I embedded the PDF file in the XDP file with

                       

                      $xdpfile .= "<pdf xmlns='http://ns.adobe.com/xdp/pdf/'><document><chunk>" .base64_encode(file_get_contents($pathtofile)). "</chunk></document></pdf>";

                       

                      I loaded the XDP file with modified headers

                       

                           header("Content-Disposition: attachment; filename=$myFile");

                           header("Content-Type: application/vnd.adobe.xdp+xml");

                      I am loading the XDP as an attachment, not inline. That opens a Download/Open window that allows you to open that file in Acrobat Reader (not the browser plugin, the standalone) - with PDF doc an populated data.

                       

                      I worked on that a lot - but no chance of showing the pdf with populated data inside the browser, with the acrobat reader plugin.

                       

                       

                      Acrobat Reader X and IE10

                      • 8. Re: XDP <pdf href="..."> doesn't load data if PDF is online
                        P.Dow

                        I have the same problem (see http://forums.adobe.com/message/5217667#5217667).  I use the following PHP code to send the .xdp file to the browser:

                         

                        header('Content-type: application/vnd.adobe.xdp+xml');
                        header("Content-Disposition: inline; filename=$XDPName");

                        echo $xdp;

                         

                        Here's some things I've noticed:

                         

                        1. This used to work fine, both with .fdf and .xdp files that I would generated and download to the browser.  It stopped working when I started using Adobe Acrobat X to save the .pdf file.

                         

                        2 I originally would use MS Word to create a form, print it as a .pdf, then use Adobe Acrobat to add fields and save it with Reader Extensions.  Then I started using Adobe LiveCycle Designer to create the form, saved it as a .pdf, then opened that .pdf with Adobe Acrobat, make no changes, and save it as a .pdf with Reader Extensions.

                         

                        3. The latest thing I've discovered (just yesterday), is that when I'm on the server or using my laptop on the LAN, it does NOT work. When I access it from outside the LAN with my laptop, it works.  You'd think that being inside the LAN and using

                         

                        <pdf href="https://mysite.com/myForm.pdf"/>

                         

                        it might have a problem getting the form, but it displays the form just fine, but doesn't populate it with the data. What is different about accessing it from the LAN instead of WAN that lets it find the form, but not populate the data?

                         

                        4. I connected my laptop to the LAN via VPN, then tried it, and it works (shows the form & populates it with data).

                        • 9. Re: XDP <pdf href="..."> doesn't load data if PDF is online
                          seeker_ Level 1

                          Your pdf wouldn't get populated with data if you are not loading the pdf

                          locally. Unless you have some licenses or perhaps certifications,...  Its

                          supposed to be a security risk blocked by Adobe!

                           

                          I found the work around to embed the pdf in the xdp file using base64

                          encoding as oppose to linking to it.

                           

                          Hope this helps

                          • 10. Re: XDP <pdf href="..."> doesn't load data if PDF is online
                            P.Dow Level 1

                            Actually, seeker_, I wasn't quite right. It works everywhere except when on the server itself.  I erroneously thought that when I was using my laptop while on the LAN that it didn't work, but it actually does.  So the form does not need to be local; in fact, apparently just the opposite in my case -- it works as long as I'm not on the server.

                             

                            Odd that it used to work, and quit working after upgrading to Adobe Reader X.

                            • 11. Re: XDP <pdf href="..."> doesn't load data if PDF is online
                              seeker_ Level 1

                              Please post some code from your xdf file so we know we are on the same

                              page. I have solved this problem before.

                              • 12. Re: XDP <pdf href="..."> doesn't load data if PDF is online
                                P.Dow Level 1

                                I think the difference may be that I'm using SSL. Here's a sample of a generated xdp file:

                                 

                                <?xml version="1.0" encoding="UTF-8"?>

                                <?xfa generator="XFA2_4" APIVersion="3.5.11185.0"?>

                                <xdp:xdp xmlns:xdp="http://ns.adobe.com/xdp/">

                                <xfa:datasets xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/">

                                <xfa:data>

                                 

                                <topmostSubform>

                                <FormDate>06/12/2013</FormDate>

                                <DateOfBirth>04/09/2008</DateOfBirth>

                                 

                                ...other stuff...

                                 

                                </topmostSubform>

                                 

                                </xfa:data>

                                </xfa:datasets>

                                <pdf href="https://MyWebsite.com/MyBlankForm.pdf" xmlns="http://ns.adobe.com/xdp/pdf/"/>

                                </xdp:xdp>

                                 

                                Notice the "https" in the pdf href -- that may be the difference. This works fine as long as I'm not trying it from the PC that's serving it.

                                • 14. Re: XDP <pdf href="..."> doesn't load data if PDF is online
                                  B Peterson

                                  "Me too." We're having this problem as well. I'm switching from <pdf href="http:..."> to embedded PDF. We have the same HTTP response headers.

                                   

                                  I'll try HTTPS next, but SSL really isn't desirable for an intranet. Somehow the zones are not working properly. Some server/browser pairings work fine but others don't, within the same internal networks.

                                   

                                  Is there any security logging that can be observed to find out exactly what security rule(s) are failing?

                                  • 15. Re: XDP <pdf href="..."> doesn't load data if PDF is online
                                    B Peterson Level 1

                                    I enabled SSL and changed the pdf href to use https. We still get the problem of no prefill.

                                     

                                    I tried SSL with an embedded PDF, and I still get the problem of trying to open a local (temp) file.