com.itextpdf.text.DocumentException: Font 'STSong-Light' with 'UniGB-UCS2-H' is

com.itextpdf.text.DocumentException: Font 'STSong-Light' with 'UniGB-UCS2-H' is not recognized.
at com.itextpdf.text.pdf.BaseFont.createFont(BaseFont.java:699)
at com.itextpdf.text.pdf.BaseFont.createFont(BaseFont.java:606)
at com.itextpdf.text.pdf.BaseFont.createFont(BaseFont.java:441)
at com.happy.pdf.WritePDF.chinesePDF(WritePDF.java:81)
at com.happy.pdf.WritePDF.main(WritePDF.java:34)
Exception in thread "main" java.lang.RuntimeException: The document is not open.
at com.itextpdf.text.pdf.PdfWriter.getDirectContent(PdfWriter.java:713)
at com.itextpdf.text.pdf.PdfDocument.isPageEmpty(PdfDocument.java:2182)
at com.itextpdf.text.pdf.PdfDocument.newPage(PdfDocument.java:820)
at com.itextpdf.text.pdf.PdfDocument.close(PdfDocument.java:770)
at com.itextpdf.text.Document.close(Document.java:420)
at com.happy.pdf.WritePDF.chinesePDF(WritePDF.java:97)
at com.happy.pdf.WritePDF.main(WritePDF.java:34)

 

 

修改:iTextAsian.jar 的包名,修改为:com.itextpdf.text.pdf.fonts

你可能感兴趣的:(com.itextpdf.text.DocumentException: Font 'STSong-Light' with 'UniGB-UCS2-H' is)