Marcel Stör
Marcel Stör

Reputation: 23535

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

I'm finally dumping iText for PDFBox. The requirements for the document to be created are trivial. With iText I've been using something like

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

What is the PDFBox equivalent to that? Their Hello World example doesn't really give a clue.

Upvotes: 0

Views: 656

Answers (1)

Maruan Sahyoun
Maruan Sahyoun

Reputation: 589

PDFBox doesn't have a high level API for generating blocks of text (yet). There are some articles such as How can I create fixed-width paragraphs with PDFbox? How to generate multiple lines in PDF using Apache pdfbox

In addition there are projects such as https://github.com/dhorions/boxable who add table formatting to PDFBox.

Upvotes: 1

Related Questions