import java.io.FileOutputStream;
import java.io.IOException;
import com.lowagie.text.Document;
import com.lowagie.text.DocumentException;
import com.lowagie.text.Paragraph;
import com.lowagie.text.Rectangle;
import com.lowagie.text.pdf.PdfWriter;
/**
*
*
*/
public class Simple6 {
@SuppressWarnings("deprecation")
public static void main(String[] args) throws DocumentException, IOException {
//设置页面尺寸(纸张尺寸)
Rectangle pageSize = new Rectangle(288/2, 720/2);
//设置版心尺寸(内容尺寸,边距)
Document doc = new Document(pageSize, 36, 18, 72, 72);
PdfWriter.getInstance(doc, new FileOutputStream("E:/HelloWorld.pdf"));
doc.open();
doc.add(new Paragraph("Test......."));
doc.add(new Paragraph("Test......."));
doc.add(new Paragraph("Test......."));
doc.close();
}
}
解密pdf-6(pdf设置页面大小及版心尺寸)
最新推荐文章于 2022-04-05 17:37:31 发布