2
try {
  Document document = new Document();
  PdfWriter.getInstance(document, new FileOutputStream("Report.pdf"));
  document.open();
  document.add(new Paragraph("Hello World"));
  document.close();
} catch (Exception e) {
  JOptionPane.showMessageDialog(null, e);
}

これは私が NetBeans で書いたコードですが、最初の行でエラーが発生しています:

error 1 in 1st line: Document is abstract; cannot be instantiated 

error 2 in 2nd line cannot find symbol ,symbol: variable PdfWriter
4

4 に答える 4