【发布时间】:2023-03-04 00:58:02
【问题描述】:
我正在使用 Netbeans、谷歌应用引擎、java。当我尝试按如下方式创建 pdf 时,它会显示此错误。
Java.io.FileOutputStream 是 Google App Engine 中的受限类。
我的代码是,
Document document = new Document();
PdfWriter.getInstance(document, new BufferedOutputStream(new FileOutputStream("C:\\Examplenamaaaa.pdf")));
document.open();
PdfPTable table = new PdfPTable(2);
PdfPCell cell = new PdfPCell(new Paragraph("column span 2"));
cell.setColspan(2);
table.addCell(cell);
table.addCell("1");
table.addCell("Namita");
table.addCell("2");
table.addCell("Asmita");
document.add(table);
document.close();
【问题讨论】: