#native_company# #native_desc#
#native_cta#

FDF Support in PHP Page 2

By Uwe Steinmann
on November 16, 2000

How it works

Adobe has developed the portable document format
(PDF) and extended it over the last years. One of these extensions are Acrobat
Forms which allow a user to input data and send it to the
server where it is evaluated, just as HTML forms. Such a PDF document is
very similar to a static PDF document, but when you look at it with
the Acrobat Reader, you will find areas which can be edited.
There are many input fields available just like in HTML, e.g. a submit and reset
button, text input fields, check boxes etc.. Creating such a PDF form
requires Acrobat Exchange 3.x or the
new Acrobat 4 software, which unfortunately only runs on Windows and MacOS.
Both provide a mode to place the different input fields into an existing
PDF document. The submit button carries an attribute which specifies the
URL to call when it is pressed. This is very similar to HTML, but can differ
in the format when the entered data is transfered to the server.
Data from HTML forms is transfered using a certain syntax which can be
observed in the URL after hitting the submit button.
Acrobat Forms support this format, but also FDF (Form Data Format).
FDF is a new format which requires the
FDF Toolkit
(current version is 4.0)
to parse. If PHP has FDF support compiled, it can parse FDF data and
access any field by its name. FDF data is currently stored by PHP in
the variable HTTP_RAW_POST_DATA (just as HTML data is stored in HTTP_POST_DATA).
The actual evaluation of the data has to be done in the PHP script, as opposed
to the HTML post data which is evaluated by the PHP engine.
To get an impression of what the FDF data looks like, here is an example:
%FDF-1.2 %???????? 1 0 obj

It is just the first portion of a complete record, but one should be able to
clearly identify
the input field comment and its value. Here is text for testing.

Comment and Contribute

Your comment has been submitted and is pending approval.

Author:

Uwe Steinmann

Comment:



Comment: