itext7创建helloworld

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/forwujinwei/article/details/81915259

在前一篇的基础上写一个helloworld案例

heloworld

public static void main(String[] args ) throws FileNotFoundException{
        PdfWriter writer = new PdfWriter("F:\\hellowprld.pdf");
        PdfDocument pdf = new PdfDocument(writer);
        Document document = new Document(pdf);
        document.add(new Paragraph("Hello World!"));
        document.close();
    }

运行代码到对应目录下找就会发现pdf文件已经创建成功

这里写图片描述

是不是很简单啊,接下来梳理itext7中各个接口的功能

猜你喜欢

转载自blog.csdn.net/forwujinwei/article/details/81915259
今日推荐