1

I am looking for some examples to create PDFs having multiple paragraphs. I tried it with ITEXT PDF and it works well,but I want to use PDFBOX 2.0.

Help if any one worked on paragraph creation with PDFBOX 2.x

Example of PDF -.enter image description here

Sks
  • 612
  • 7
  • 23
  • If you don't get an answer then have a look at PlainTextFormatter.java in the source code download. That's the code used for AcroForm field formatting. – Tilman Hausherr Oct 07 '17 at 10:36
  • 1
    You might want to look into [this answer](https://stackoverflow.com/a/19683618/1729265) or [this one](https://stackoverflow.com/a/20681996/1729265). – mkl Oct 07 '17 at 22:20
  • @mkl - Yes, I tried it already. It is bit slow compare compare to ITEXT though. I am trying to create new empty line between two paragraphs but not able too. Any inputs ? – Sks Oct 08 '17 at 04:25
  • In the answers I pointed you to the inputs are transformed to lines in `List lines`. You can simply add an empty line after each paragraph. – mkl Oct 08 '17 at 06:31
  • 1
    @Sks has your question been answered by the two links mentioned by mkl? Then please delete your question and upvote the answers that helped. Re speed, make sure you're using 2.0.7 and not an older version; create PDFont objects for each font at most once per PDF (you can reuse them for different pages). If it is still too slow, create a new question with your code and itext code and tell what times you get, we once found a bug this way: https://issues.apache.org/jira/browse/PDFBOX-3824 – Tilman Hausherr Oct 13 '17 at 09:42

0 Answers0