Getting a java.io.CharConversionException with pdftk while using MAMP?
Submitted by Nick Vahalik on Fri, 02/05/2010 - 11:08
Man, talk about a frustrating problem! I kept getting this errors while calling pdftk (from the mac installer, which the version as of this writing is 1.12):
Unhandled Java Exception:
<<No stacktrace available>>
Anyway, after much hair pulling, the answer was found! Before calling shell_exec (or whatever function you use to call pdftk) you need to unset the
DYLD_LIBRARY_PATH environment variable.
# unset this so pdftk will work!
- put the output in a variable
$pdf_data = shell_exec(’/usr/local/bin/pdftk ‘. $file_name .’ fill_form ‘.
$fdf_fn. ‘ output – flatten’);