|
użytkowników online: 26
|
OPINIE UŻYTKOWNIKÓW
|
Uważam, że serwis jest najlepszy na świecie. Wykonany rzetelnie, a wszystkie skrypty sa dopracowane. Zamieszczony materiał godny mistrza. Jestem programistą od wielu lat i bez tego serwisu nie istnieje. Upraszacza życie każdemu programiście. Imponujący jest fakt, że do twórcy serwisu zawsze można się zwrócić z prośbą o pomoc i uzyskuje się ją w bardzo krótkim czasie. Najważniejsze w tym wszystkim jest to, że można korzystać z witryny za symboliczną opłatą.
Marcin Kowalski Multinet Polska
|
|
PODRĘCZNIK PHP 5.x, 4.x, 3.x - częściowo spolszczony / źródło: www.php.net
[Spis]
[A]
[B]
[C]
[D]
[E]
[F]
[G]
[H]
[I]
[J]
[K]
[L]
[M]
[N]
[O]
[P]
[Q]
[R]
[S]
[T]
[U]
[V]
[X]
[W]
[Z]
XXXV. Forms Data Format Functions
Forms Data Format (FDF) is a format for handling
forms within PDF documents. You should read the documentation at
http://partners.adobe.com/asn/acrobat/forms.jsp
for more information on what FDF is and how it is used in general.
The general idea of FDF is similar to HTML forms. The difference is
basically the format how data is transmitted to the server when the submit
button is pressed (this is actually the Form Data Format) and the format
of the form itself (which is the Portable Document Format, PDF).
Processing the FDF data is one of the features provided by the fdf
functions. But there is more. One may as well take an existing PDF form
and populated the input fields with data without modifying the form
itself. In such a case one would create a FDF document
(fdf_create()) set the values of each input field
(fdf_set_value()) and associate it with a PDF form
(fdf_set_file()). Finally it has to be sent to the
browser with MimeType application/vnd.fdf. The Acrobat
reader plugin of your browser recognizes the MimeType, reads the
associated PDF form and fills in the data from the FDF document.
If you look at an FDF-document with a text editor you will find a
catalogue object with the name FDF. Such an object may
contain a number of entries like Fields,
F, Status etc..
The most commonly used entries are Fields which points
to a list of input fields, and F which contains the
filename of the PDF-document this data belongs to. Those entries are
referred to in the FDF documentation as /F-Key or /Status-Key.
Modifying this entries
is done by functions like fdf_set_file() and
fdf_set_status(). Fields are modified with
fdf_set_value(), fdf_set_opt() etc..
You need the FDF toolkit SDK available from
http://partners.adobe.com/asn/acrobat/forms.jsp.
As of PHP 4.3 you need at least SDK version 5.0.
The FDF toolkit library is available in binary form only,
platforms supported by Adobe are Win32, Linux, Solaris and AIX.
You must compile PHP with
--with-fdftk[=DIR].
Notatka:
If you run into problems configuring PHP with fdftk support, check
whether the header file fdftk.h and the library
libfdftk.so are at the right place.
The configure script supports both the directory structure of the
FDF SDK distribution and the usual DIR/include /
DIR/lib layout, so you can point it either
directly to the unpacked distribution directory or put the header
file and the appropriate library for your platform into e.g.
/usr/local/include and
/usr/local/lib and configure with
--with-fdftk=/usr/local.
Note to Win32 Users:
In order to enable this module on a Windows environment, you must copy
fdftk.dll from the DLL folder of the PHP/Win32 binary
package to the SYSTEM32 folder of your windows machine. (Ex: C:\WINNT\SYSTEM32
or C:\WINDOWS\SYSTEM32)
To rozszerzenie nie definiuje posiada żadnych
dyrektyw konfiguracyjnych w pliku php.ini.
Most fdf functions require a fdf resource
as their first parameter. A fdf resource
is a handle to an opened fdf file. fdf
resources may be obtained using fdf_create(),
fdf_open() and fdf_open_string().
Poniższe stałe są zdefiniowane w tym rozszerzeniu i stają się dostępne, gdy
rozszerzenie jest dokompilowane do PHP, lub załadowane dynamicznie przy starcie.
The following examples shows just the evaluation of form data.
Przykład 1. Evaluating a FDF document |
<?php
$fdf = fdf_open_string($HTTP_FDF_DATA);
$volume = fdf_get_value($fdf, "volume");
echo "The volume field has the value '<b>$volume</b>'<br />";
$date = fdf_get_value($fdf, "date");
echo "The date field has the value '<b>$date</b>'<br />";
$comment = fdf_get_value($fdf, "comment");
echo "The comment field has the value '<b>$comment</b>'<br />";
if (fdf_get_value($fdf, "show_publisher") == "On") {
$publisher = fdf_get_value($fdf, "publisher");
echo "The publisher field has the value '<b>$publisher</b>'<br />";
} else
echo "Publisher shall not be shown.<br />";
if (fdf_get_value($fdf, "show_preparer") == "On") {
$preparer = fdf_get_value($fdf, "preparer");
echo "The preparer field has the value '<b>$preparer</b>'<br />";
} else
echo "Preparer shall not be shown.<br />";
fdf_close($fdf);
?>
|
|
User Contributed Noteswesley_grant at yahoo dot com
12-Jan-2006 12:37
Changing the
session.cache_limiter
directive in the php.ini file to 'private'
seems to resolve the issue with sending fdf data and session headers at the same time to Internet Explorer.
bmount at livid dot us
19-Oct-2005 05:05
For those of you struggling with FDF in Internet Explorer, here is your solution:
DO NOT INITIALIZE A SESSION ON THE PAGE THAT GENERATES AND OUTPUTS FDF DATA.
This will fix the page not found error.
03-May-2005 10:08
Use "Yes" instead of "On" to populate checkboxes.
08-Mar-2005 02:56
For the example below, I have not b een able to have it populate checkbox fields.
g8z at yahoo dot com
18-Oct-2004 08:46
This is for users who are looking for a way to merge HTML form data with a PDF Form, then output the PDF Form with data populated in it, to a web browser.
This is a pure PHP solution which does NOT require the FDF toolkit. Contributed by www.TUFaT.com
<?php
$form = 'http://my_domain.com/my_pdf_form.pdf';
function create_fdf ($pdffile, $strings, $keys)
{
$fdf = "%FDF-1.2\n%
|