利用jsp把文字转换为PDF图象时如何控制行与行的间距?
alpa 2004-08-17 11:57:51 <%@page import="java.io.*,java.awt.Color,com.lowagie.text.*,com.lowagie.text.pdf.*"%>
<%
response.setHeader("Content-disposition","attachment;filename=file.pdf");
String st1="this is line1";
String st2="this is lin2";
Document document = new Document(PageSize.A4,20,20,40,0);
document.open();
document.add(new Paragraph(st1,FontFactory.getFont(FontFactory.COURIER, 9,Font.BOLD)));
document.add(new Paragraph(st2,FontFactory.getFont(FontFactory.COURIER, 9,Font.BOLD)));
document.close();
%>
在这儿生成两行的文字,字号为9(如果在字号再小,就看不清楚),以这种字体可以在A4纸上
仅可以显示43行,行距太大,我需要显示更多行,怎么减小行距,请给出具体代码。为谢!