Forum Moderators: coopster
I am a real newbe with PHP so please excuse me for asking a question that may seem real easy. I have a PDF form online that our customers open in their browser, populate the rather large form then email it as an attachment to our company service manager using the customer’s client side default email program. The problem of course is we can not depend on the email configuration on our customer’s computer and as a consequence we do not always get the email.
What I would like to do is use the Adobe Submit Form command to POST the FDF data to a server side PHP program that will capture the FDF string and email (from the server) the string as an attachment to our service manager. The service manager can use the FDF file to populate a template of the PDF form.
I have been playing with file_get_contents('php://input') in my php script but the problem is I am missing all of the form field identifiers and data. My guess is the special characters used in the FDF string is ignored by the file_get_contents.
I want to thank you in advance for any help you can provide!
That doesn't sound right to me for some reason. php://input will grab the raw input stream so perhaps it is something in your <form> element that is causing you issues. Also, rather than use the input stream and parse data yourself, are you aware of the $_POST superglobal array that prepares the data for you?
I am using Adobe’s SubmitForm function with the FDF option that creates the FDF data string prior to sending it as part of the URL to my PHP program. I get all the data of the string but the field information. I didn’t think $_POST would work with FDF data because there is not the same tag values as associated with a HTML post string. Here is what the FDF string should look like for my small test PDF form with 3 fields:
%FDF-1.2
%âãÏÓ
1 0 obj
<</FDF<</F(form testing.pdf)/Fields[<</T(description)/V(928 204-1517)>><</T(email)/V(email@example.com)>><</T(name)/V(John)>>]/ID[<0C10400DCC483F778385452BA8A48CA3><A0ACCDDBC1C7A24FA0F8D05D975102D2>]/UF(form testing.pdf)>>/Type/Catalog>>
endobj
trailer
<</Root 1 0 R>>
%%EOF
And this is what I get from the PHP program input stream:
%FDF-1.2 %âãÏÓ 1 0 obj <<<><><><>]/ID[<0C10400DCC483F778385452BA8A48CA3>]>>/Type/Catalog/Version/1.3>> endobj trailer <> %%EOF
It seems like the > and < act as escape characters.
[edited by: eelixduppy at 10:56 pm (utc) on April 9, 2009]
[edit reason] removed specifics [/edit]
-- Roger