Form filled PDF (using pdftk and forge_fdf)
Posted: Fri Jan 16, 2009 2:01 am
My problem is regarding the PHP generated PDF.
I have a page with HTML form field that will popup a PDF when user click a button on the HTML page. I have the PDF template with Form fields there. So, what I do is to get the data from HTML, put into forge_fdf, then use pdftk to read the PDF template & fill in the form values. Then generate the pdf as standard output. I don't have problem here.. I can succesfully create the pdf form with the form data. However, the problem is that the generated PDF is no longer editable, unlike the template which people can type when open by Adobe.
I have tried:
$fields_readonly = false;
$fdf= forge_fdf( '',
$fdf_data_strings,
$fdf_data_names,
$fields_hidden,
$fields_readonly );
// try to make it now readonly
and this:
passthru( 'pdftk my_application.pdf fill_form '. $fdf_fn. ' output - flatten allow modifycontents' );
passthru( 'pdftk my_application.pdf fill_form '. $fdf_fn. ' output - flatten allow allfeatures' );
anyone has any idea how to make the output form editable?
I have a page with HTML form field that will popup a PDF when user click a button on the HTML page. I have the PDF template with Form fields there. So, what I do is to get the data from HTML, put into forge_fdf, then use pdftk to read the PDF template & fill in the form values. Then generate the pdf as standard output. I don't have problem here.. I can succesfully create the pdf form with the form data. However, the problem is that the generated PDF is no longer editable, unlike the template which people can type when open by Adobe.
I have tried:
$fields_readonly = false;
$fdf= forge_fdf( '',
$fdf_data_strings,
$fdf_data_names,
$fields_hidden,
$fields_readonly );
// try to make it now readonly
and this:
passthru( 'pdftk my_application.pdf fill_form '. $fdf_fn. ' output - flatten allow modifycontents' );
passthru( 'pdftk my_application.pdf fill_form '. $fdf_fn. ' output - flatten allow allfeatures' );
anyone has any idea how to make the output form editable?