【发布时间】:2020-11-29 21:51:03
【问题描述】:
Document document = new Document();
PdfWriter.getInstance(document, new FileOutputStream("test.pdf"));
document.open();
Font font = FontFactory.getFont(FontFactory.COURIER, 16, BaseColor.BLACK);
Chunk chunk = new Chunk("Hello World", font);
document.add(chunk);
document.close();
这会在我的项目的根文件夹中生成test.pdf。现在我需要该文件的java.net.URL。我怎样才能得到它?
【问题讨论】:
-
是什么让你无法生成它?