import java.io.FileOutputStream;
import java.io.IOException;
import com.lowagie.text.Document;
import com.lowagie.text.DocumentException;
import com.lowagie.text.Font;
import com.lowagie.text.Paragraph;
import com.lowagie.text.pdf.BaseFont;
import com.lowagie.text.pdf.PdfWriter;
public class MainClass {
public static void main(String[] args)throws Exception {
Document document = new Document();
PdfWriter.getInstance(document, new FileOutputStream("2.pdf"));
document.open();
BaseFont bf;
Font font;
bf = BaseFont.createFont("KozMinPro-Regular", "UniJIS-UCS2-H",BaseFont.EMBEDDED);
font = new Font(bf, 12);
document.add(new Paragraph("asdf",font));
document.add(new Paragraph("Font: " + bf.getPostscriptFontName(),font));
document.add(new Paragraph("\u8ab0\u3082\u77e5\u3089\u306a\u3044",font));
document.close();
}
}
|