PdfWriter writer; |
記住別忘了添加iTextAisan.jar不然會報如下錯誤:下載地址:iTextAsian.jar下載(32&64位)
com.lowagie.text.DocumentException: Font 'STSong-Light' with 'UniGB-UCS2-H' is not recognized.
at com.lowagie.text.pdf.BaseFont.createFont(Unknown Source)
at com.lowagie.text.pdf.BaseFont.createFont(Unknown Source)
at com.lowagie.text.pdf.AsianFontMapper.awtToPdf(Unknown Source)
at com.lowagie.text.pdf.PdfGraphics2D.getCachedBaseFont(Unknown Source)
at com.lowagie.text.pdf.PdfGraphics2D.setFont(Unknown Source)
at com.lowagie.text.pdf.PdfGraphics2D.(Unknown Source)
at com.lowagie.text.pdf.PdfContentByte.createGraphics(Unknown Source)
at JFreeChartExample.convertToPdf(JFreeChartExample.Java:94)
at JFreeChartExample.main(JFreeChartExample.java:63)
com.lowagie.text.DocumentException: Font 'STSong-Light' with 'UniGB-UCS2-H' is not recognized.
at com.lowagie.text.pdf.BaseFont.createFont(Unknown Source)
at com.lowagie.text.pdf.BaseFont.createFont(Unknown Source)
at com.lowagie.text.pdf.AsianFontMapper.awtToPdf(Unknown Source)
at com.lowagie.text.pdf.PdfGraphics2D.getCachedBaseFont(Unknown Source)
at com.lowagie.text.pdf.PdfGraphics2D.setFont(Unknown Source)
at org.jfree.chart.title.TextTitle.arrangeRR(TextTitle.java:488)
at org.jfree.chart.title.TextTitle.arrange(TextTitle.java:450)
at org.jfree.chart.JFreeChart.drawTitle(JFreeChart.java:1125)
at org.jfree.chart.JFreeChart.draw(JFreeChart.java:1015)
at org.jfree.chart.JFreeChart.draw(JFreeChart.java:925)
at JFreeChartExample.convertToPdf(JFreeChartExample.java:97)
at JFreeChartExample.main(JFreeChartExample.java:63)
Exception in thread "main" java.lang.NullPointerException
at com.lowagie.text.pdf.PdfWriter.addSimple(Unknown Source)
at com.lowagie.text.pdf.PdfContentByte.setFontAndSize(Unknown Source)
at com.lowagie.text.pdf.PdfGraphics2D.drawString(Unknown Source)
at org.jfree.text.TextUtilities.drawRotatedString(TextUtilities.java:566)
at org.jfree.text.TextUtilities.drawRotatedString(TextUtilities.java:600)
at org.jfree.text.TextFragment.draw(TextFragment.java:212)
at org.jfree.text.TextLine.draw(TextLine.java:174)
at org.jfree.text.TextBlock.draw(TextBlock.java:269)
at org.jfree.text.TextBlock.draw(TextBlock.java:231)
at org.jfree.chart.title.TextTitle.drawHorizontal(TextTitle.java:628)
at org.jfree.chart.title.TextTitle.draw(TextTitle.java:569)
at org.jfree.chart.JFreeChart.drawTitle(JFreeChart.java:1128)
at org.jfree.chart.JFreeChart.draw(JFreeChart.java:1015)
at org.jfree.chart.JFreeChart.draw(JFreeChart.java:925)
at JFreeChartExample.convertToPdf(JFreeChartExample.java:97)
at JFreeChartExample.main(JFreeChartExample.java:63)
上一篇:win7系統(tǒng)提示Msflxgrd.OCX不能注冊或Msflxgrd.OCX錯誤的解決方法
下一篇:win7系統(tǒng)下試圖加載格式不正確的程序 (異常來自 HRESULT:0x8007000B)win32 error 50