Results 1 to 4 of 4

Thread: PHP and FDF

  1. #1
    Join Date
    Jan 2006
    Posts
    32

    PHP and FDF

    Hi Everyone,
    I am trying to use PHP's FDF functions to populate multiple PDF forms and am having a little trouble getting started because I'm not sure if my Windows Server 2003 is set up for this or my php.ini settings (I'm not a server or settings expert by any means). From php.net/fdf I have found....

    REQUIREMENTS
    -Says I need the FDF toolkit from Adobe, no problem, I downloaded it but what the heck am I supposed to do with it?

    INSTALLATION
    -You must compile PHP with --with-fdftk[=DIR]. Does this just mean move the fdftk.dll into the system32 directory? or is there something else I need to do?

    -Are there any dlls I need to enable in php.ini? I noticed there was an fdf.dll in there which is why I am asking.

    Any help would be appreciated. Thanks!!

  2. #2
    Join Date
    May 2006
    Location
    Teh Interweb
    Posts
    314
    Did you recompile php with the --with-fdftk[=DIR] flag?

    You can check if this is done by creating a phpinfo() page and checking the configure command section.

    [[email protected]] ~ $ cat .signature
    cat: .signature: No such file or directory

  3. #3
    Join Date
    Aug 2005
    Location
    UK
    Posts
    654
    Quote Originally Posted by tmac007
    -You must compile PHP with --with-fdftk[=DIR]. Does this just mean move the fdftk.dll into the system32 directory? or is there something else I need to do?
    Nope

    You'll likely need to recompile php from source so it can be made aware that you have FDF. The default compile/binarays won't come with it turned on becuse its not used much.

  4. #4
    Join Date
    Jan 2006
    Posts
    32
    Thank you for the information guys. I think I've found a way around this but doesn't seem to be populating the PDF. I can create the FDF file using the function

    function createFDF($file,$info){
    $data="%FDF-1.2\n% \n1 0 obj\n<< \n/FDF << /Fields [ ";
    foreach($info as $field => $val){
    if(is_array($val)){
    $data.='<</T('.$field.')/V[';
    foreach($val as $opt)
    $data.='('.trim($opt).')';
    $data.=']>>';
    }else{
    $data.='<</T('.$field.')/V('.trim($val).')>>';
    }
    }
    $data.="] \n/F (".$file.") /ID [ <".md5(time()).">\n] >>". " \n>> \nendobj\ntrailer\n". "<<\n/Root 1 0 R \n\n>>\n%%EOF\n";
    return $data;
    }

    I then write the resulting FDF file to a predetermined directory for later retrieval.

    HOWEVER....When I open the FDF file via a URL, the corresponding PDF opens but the data is not populated. Any ideas? If you would like to see what I am talking about I can send a link for you to look at.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •