downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

fdf_enum_values> <fdf_close
Last updated: Fri, 20 May 2011

view this page in

fdf_create

(PHP 4, PHP 5)

fdf_createCrear un nuevo documento FDF

Descripción

resource fdf_create ( void )

Crea un nuevo documento FDF.

Esta función es requerida si se desea poblar campos de entrada en un documento PDF con datos.

Valores devueltos

Devuelve un gestor de documento FDF, o FALSE en caso de error.

Ejemplos

Example #1 Poblar un documento PDF

<?php
$salida_fdf 
fdf_create();
fdf_set_value($salida_fdf"volume"$volumen0);

fdf_set_file($salida_fdf"http:/prueba_fdf/etiqueta_resultado.pdf");
fdf_save($salida_fdf"salida_prueba.fdf");
fdf_close($salida_fdf);
Header("Content-type: application/vnd.fdf");
$aa fopen("salida_prueba.fdf""r");
fpassthru($aa);
unlink("salida_prueba.fdf");
?>

Ver también



fdf_enum_values> <fdf_close
Last updated: Fri, 20 May 2011
 
add a note add a note User Contributed Notes fdf_create
jwadhwani at pobox dot com 06-Jun-2006 03:08
For fdf_save you need to provide the complete path, such as :fdf_save($outfdf,"c:/inetpub/wwwroot/temp_sites/fdf/outtest.fdf"); and not only outtest.fdf.
Punkisdead 04-Oct-2003 07:03
<?php
$outfdf
= fdf_create();
$volume = "test";
fdf_set_value($outfdf, "volume", $volume, 0);

fdf_set_file($outfdf, "http://localhost/webapps/volume.pdf");
Header("Content-type: application/vnd.fdf");
fdf_save($outfdf);
fdf_close($outfdf);

?>

This works for IE 5.5+ 

It will populate the fields and open the resulting pdf for you, without having to create an fdf file and adding the open script to the pdf...
mlarke at nanuc dot ca 11-Aug-2003 12:14
Header("Content-type: application/vnd.fdf"); simply does not work in IE. The easiest method to automatically load the fdf file is to open the 'pdf' file via php. With use of Acrobat
document -> page action -> page open -> add -> javascript
and paste the following into the pdf file:

this.importAnFDF("my_fdf_file.fdf");

This will auto-load the fdf contents
Cheers Mike
Sergei 17-Mar-2003 07:43
I thought the following might save someone a lot of time. The example fdf snippet above, namely:

<?php
$outfdf
= fdf_create();
fdf_set_value($outfdf, "volume", $volume, 0);

fdf_set_file($outfdf, "http:/testfdf/resultlabel.pdf");
fdf_save($outfdf, "outtest.fdf");
fdf_close($outfdf);
Header("Content-type: application/vnd.fdf");
$fp = fopen("outtest.fdf", "r");
fpassthru($fp);
unlink("outtest.fdf");
?>

will not work (or there's at least a big possibility it won't) in IE (version 6 sure and I suspect lower versions as well) if you have session.auto_start on. Apparently, setting a cookie before feeding the fdf to the browser somehow messes it up. It works fine in Netscape though. I spent days on Google before I found a post somewhere about someone else having the same problem.

The solution? Well, I created a separate directory in the web tree and turned session.auto_start off just for that directory like this:

<Location /new_directory>
    php_admin_flag session.auto_start 0
</Location>

Hope this was useful to somebody.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites