什么是 PDFBox 等同于 iText document.add(new Paragraph(string))

What is the PDFBox equivalent to iText document.add(new Paragraph(string))

我终于放弃了 PDFBox 的 iText。要创建的文档的要求很简单。对于 iText,我一直在使用

for (Foo foo : foos) {
  document.add(new Paragraph(foo.getName()));
}

PDFBox 相当于什么? Their Hello World example 并没有给出任何线索。

PDFBox 还没有用于生成文本块的高级 API。有一些文章比如 How can I create fixed-width paragraphs with PDFbox? How to generate multiple lines in PDF using Apache pdfbox

此外还有 https://github.com/dhorions/boxable 等项目将 table 格式添加到 PDFBox。