You are here

function createXFDF in FillPDF 5

createXFDF

Tales values passed via associative array and generates XFDF file format with that data for the pdf address sullpiled.

Parameters

string $file The pdf file - url or file path accepted:

array $info data to use in key/value pairs no more than 2 dimensions:

string $enc default UTF-8, match server output: default_charset in php.ini:

Return value

string The XFDF data for acrobat reader to use in the pdf form file

1 call to createXFDF()
fillpdf_generate_pdf in ./fillpdf.module
Generates the PDF ouput based on field values It (1) constructs the XFDF from the form's fields, (2) saves the XFDF to /files/xfdf/x.xfdf, (3) redirects to the servlet at SERVLET_URL which downloads this XFDF, merges it with the user-specified…

File

./xfdf.inc, line 14

Code

function createXFDF($file, $info, $enc = 'UTF-8') {
  $data = '<?xml version="1.0" encoding="' . $enc . '"?>' . "\n" . '<xfdf xmlns="http://ns.adobe.com/xfdf/" xml:space="preserve">' . "\n" . '<fields>' . "\n";
  $data .= print_fields($info);
  $data .= '</fields>' . "\n" . '<ids original="' . md5($file) . '" modified="' . time() . '" />' . "\n" . '<f href="' . $file . '" />' . "\n" . '</xfdf>' . "\n";
  return $data;
}