Probably the variable asOfDate is null. Best Regards, Paulo Soares
> -----Original Message----- > From: Kenny G. Dubuisson, Jr. [SMTP:[EMAIL PROTECTED]] > Sent: Friday, January 10, 2003 16:13 > To: [EMAIL PROTECTED] > Subject: [iText-questions] BaseFont.getWidth(Unknown source) error > > I have a servlet that creates a PDF using iText. I'm grabbing a date from > the database (as a string) and trying to display it with the following > line > of code: > > cb.showTextAligned(PdfContentByte.ALIGN_CENTER, asOfDate, pageWidth / 2, > pageHeight - 70, 0); > > When I use this, I get the following error (truncated for brevity): > > java.lang.NullPointerException > at com.lowagie.text.pdf.BaseFont.getWidth(Unknown source) > at com.lowagie.text.pdf.BaseFont.getWidthPoint(Unknown source) > at com.lowagie.text.pdf.PdfContentByte.showTextAligned(Unknown source) > ... > > If I change the string variable (asOfDate) to a constant "test", then the > servlet generates the PDF (when I get the error, I just get a blank > browser). Any ideas? > > Thanks, > Kenny > > > > ------------------------------------------------------- > This SF.NET email is sponsored by: > SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! > http://www.vasoftware.com > _______________________________________________ > iText-questions mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/itext-questions ------------------------------------------------------- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com _______________________________________________ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions