我正在开发一个程序,我将ASCII文件作为输入并将其转换为PDF使用Itext库.
我能够转换和打印它,但字体大小显得太小.目前我已将字体大小设置为6但是,如果我将其更改为7,它不起作用,它不适合PDF正确.
以下是我的代码段的一部分:
Document doc= new Document();
Rectangle test = new Rectangle(531,666);
doc = new Document(test);
doc.setMargins(0,0,0,0);
p = new Paragraph(new Phrase(lineSpacing,line,
FontFactory.getFont(FontFactory.COURIER, fntSize)));
doc.add(p);
Run Code Online (Sandbox Code Playgroud)
我不能用这种方法使用double.还有其他方法吗?