Highlighted

XDP & XML Acting Strange in IE..but fine in FireFox...Please Help!!

Avatar

Guest

15-09-2008

I have an invoice form (PDF) and XML working perfectly from a URL:<br /><br />www.server.com/invoice.php (Writes out XML & XDP for the invoice)<br /><br />The problem is in IE, I always get an Adobe error ("There was an error opening this document. This file cannot be found"). However if I F5/Refresh...it opens up fine.<br /><br />In Firefox, there are no issues...opens right up 1st time, everytime.<br /><br />This makes me wonder if this is a caching issue with IE. I really need this to work...so any help would be appreciated.<br /><br />This is the top of the PHP program that generates the required XML & XDP.<br /><br /><?php<br />header('Content-type: application/vnd.adobe.xdp+xml'); <br />header("Cache-Control: no-cache, must-revalidate"); <br />header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");<br />header("Pragma: no-cache"); <br /><br />echo '<?xml version="1.0" encoding="UTF-8"?>';<br />echo '<?xfa generator="XFA2_4" APIVersion="2.8.8118.0"?>';<br />echo '<xdp:xdp xmlns:xdp="http://ns.adobe.com/xdp/" timeStamp="2008-09-09T13:53:37Z" uuid="7e9c3eb4-45c9-4ae2-9b3f-5f1e38cb7f57">';<br />echo '<xfa:datasets xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/">';<br />echo ' <xfa:data>';<br />.....etc......<br />echo ' </xfa:data>';<br />echo '</xfa:datasets>';<br />echo '<pdf href="http://www.server.com/pdf_forms/invoice.pdf" xmlns="http://ns.adobe.com/xdp/pdf/"/>';<br />echo '</xdp:xdp>';

Replies

Highlighted

Avatar

Guest

16-09-2008

You need to set Adobe Reader/Acrobat prefernece for display pdf in web browser.



To do this -

Start Acrobat/Reader

Chose Edit > Preferences.

Select Internet in the list on the left.

Check Display PDF in Browser, and click OK.



Hope this helps.
Highlighted

Avatar

Guest

06-10-2008

XDP and XML Acting Strange In IE... I have the exact same problem. Setting preference in Acrobat Reader did not help. I also have issue with Firefox, having to hit refresh over and over. The same form created with ASP doe not have this problem. Possibly something to do with PHP. My development machine is IIS with XP and SQL Server Express. Any ideas? Shawn, did you get the problem solved?

Thanks
Highlighted

Avatar

Guest

08-10-2008

I did fix it, but don't have the slightest idea how or why it is now working. In fact everytime I create a new one, I spend about a day messing around with it trying to get the new one working. Some of the things to review:



1. Make sure your form xml matches exactly. What I did was create the form, name my data fields and then save it. I then open the PDF in Acrobat, populate every field as a user would then export the form data as XML. I then go back to use this XML as a sample data source as well as using it in my PHP code to ensure it matches.



2. I had to use a two step process to read the file into the browser. pdf_formname.php (sets the correct header and fopens/echos the content of the next file). xdp_formname.php (reads from the database and exports the correct xml). Very likely this is not at all needed, but since it is working, I'm afraid to touch it.



3. Make sure your html reference at the bottom of your XML/XDP is pointing to a real file.



4. Cleared my cache more times that I can count.



Sorry I can't be more help. I just wish there was a better debugging tool from Adobe that would tell me what file it thinks is missing rather than a generic message.
Highlighted

yodadobe

03-11-2008

I have had problems in the past to to IE ignoring the content type. It will assume anything in the URL after a period as being a file extension and use that over the mime type. I made all the URLs end in .pdf and it made IE behave for me.



If you define a schema to associate your form data with, then your XML file can reference the same schema. There are many editing tools including IntelliJ Idea that I use which will validate your XML for you. This also separates your layout hierarchy from your data hierarchy. You can move an element from one sub form to another without changing the data file.