From: <php...@li...> - 2012-04-24 15:53:03
|
I've been building an app using the iText library for PDFs. So far so good. Except now I'm getting this error with the following code: public function sigAction() { $outfile = '/home/beau/pdf/public/pdfs/OUT.pdf'; $output = new java('java.io.FileOutputStream', $outfile); $pdffile = '/home/beau/pdf/public/pdfs/IN.pdf'; try { java_require('/home/beau/pdf/iText/itextpdf-5.2.1.jar'); $PdfReader = new java('com.itextpdf.text.pdf.PdfReader', $pdffile); $PdfStamper = new java('com.itextpdf.text.pdf.PdfStamper'); $version = new Java("java.lang.Character", '0'); $stamper = $PdfStamper->createSignature($PdfReader, $output, $version); //<-- error here $stamper->close(); } catch(Exception $e){ $e->getMessage(); } } The error that's getting thrown is when I call the $PdfStamper->createSignature( ... ) method. The $version (I guess) needs to be a char type, and I'm pretty sure it is, but it still throws the conversion exception: Java Exception com.zend.javamw.a: Cannot convert 0 of type [class java.lang.Character] to char com.zend.javamw.a: Cannot convert 0 of type [class java.lang.Character] to char at com.zend.javamw.n.b(Unknown Source) Any help would be appreciated. :D -Beau |