From: <php...@li...> - 2007-03-01 08:28:35
|
Hi everyone, I'd like to use com.lowagie.text.pdf.PdfContentByte setFontAndSize and showTextAligned functions but I have a problem in passing them a float. Here is my code: ... $cb = $writer->getDirectContent(); $bf = new Java("com.lowagie.text.pdf.BaseFont"); $bf->createFont("Helvetica", "Cp1252", false); $cb->setFontAndSize( $bf , 12); ... I got this error: Fatal error: Uncaught [o(Exception):"java.lang.Exception: Invoke failed: [o(PdfContentByte)]->setFontAndSize((BaseFont)c(BaseFont), (float)o(Float)). Cause: java.lang.IllegalArgumentException: argument type mismatch [...] It seems '12' is considerated as an Object Float and not a primitive type float. I had try different things like making an instance of a Float and call the floatValue() or parseFloat() functions in order to get the float type value but can't make it works. How could I get the real primitive float type value? I use PHP 5.1.1, JRE 1.5.0 Update 11 and iText-1.3.1 jar on Windows XP. Help would be greatly appreciated! Wilfrid |