tags:

views:

149

answers:

1

I have a system that prepopulates PDF fields via XFDF.

THe XFDF code seems fine, but when I try to open it with the header() in PHP, PDF fires an error. If I ignore it and refresh the page, it works fine and poplulates the form correctly.

Below is the XFDF code as well as the header I am using...

Any idea why PDF doesnt display it right away?

Thanks in advnace for the help

:) Unmash

<?xml version="1.0" encoding="UTF-8" ?> <xfdf xmlns="http://ns.adobe.com/xfdf/" xml:space="preserve">

<'fields>

<field name="user_name"> <value>Some Name <'/field>

<field name="course_name"> <value>Some Course <`/field>

<`/fields>

<`f href="http://the_URL_to_the_PDF_that_needs_to_be_populated_with_the_XFDF info" />

<`/xfdf>

I am trying to open the above with the header command below..

header("Content-type: application/vnd.adobe.xfdf");

A: 

Try:

// No space after this opening tag
$xfdf =<<<'XFDF'
<?xml version="1.0" encoding="UTF-8" ?> 
<xfdf xmlns="http://ns.adobe.com/xfdf/" xml:space="preserve">
   <fields>
      <field name="user_name"> <value>Some Name </field>
      <field name="course_name"> <value>Some Course </field>
   </fields>
   <f href="http://the_URL_to_the_PDF_that_needs_to_be_populated_with_the_XFDF info" />
</xfdf>

XFDF; // No space before this closing tag

header('Content-type: application/vnd.adobe.xfdf');
echo $xfdf;
Phill Pafford
Nope... didnt work...getting XML starting with an invalid character, but thank you for trying to help me :).