itext7 new PdfWriter 就出错
VS2022 导入了itext7
测试 HelloWorld 失败……
实际文件夹里是创建了pdf文件,但是内容是空的。
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using iText;
using System.Windows.Forms;
using iText.Kernel.Geom;
using iText.Kernel.Pdf.Canvas;
using iText.Kernel.Pdf.Xobject;
using iText.Kernel.Pdf;
using System.Security.Cryptography;
using Rectangle = iText.Kernel.Geom.Rectangle;
using iText.Layout.Element;
using iText.Layout.Properties;
using iText.Layout;
//点击按钮创建PDF
private void button3_Click(object sender, EventArgs e)
{
PdfWriter writer = new PdfWriter("D:/hellowprld.pdf");
PdfDocument pdf = new PdfDocument(writer);
Document document = new Document(pdf);
document.Add(new Paragraph("Hello World!"));
document.Close();
}

...全文
相关推荐
使用iText 7 生成pdf
NULL 博文链接:https://lewjun.iteye.com/blog/2432331
iText中文开发手册
iText中文开发手册,介绍完整的开发步骤,提供开发实例
itext7jar包
itext7jar包集合直接可以用在项目中,全部拷贝即可,里面还有一个日志包也要一起使用。
Java 使用iText7生成带页码的PDF文件(同时生成目录,但是不会合并两个PDF)
gradle项目,首次使用请先下载jar包(右键项目→Gradle→Refresh),不然报错!
itext 生成pdf 目录
itext 生成pdf 目录,itext 生成pdf 目录,itext 生成pdf 目录


