Free Support Forum -

Display ordered lists in PDF


I have following html code which I am inserting into PDF file.

  • List 1
  • list 2

It should look up like this in PDF

testing listes:

1. list1

2. list2

How can we achieve proper indentation in the PDF file.



Hi Mamatha,

Thanks for contacting support.

I have tested the scenario using following code snippet and the output seems identical to your requirement. Please take a look over the attached output which is generated over my end.


String str =

  1. List
  2. List 2

//Instantiate Pdf pbject by calling its empty constructor

Pdf pdf1 = new Pdf();

//Create a new section in the Pdf object

Section sec1 = pdf1.getSections().add();

//Create a new text paragraph and pass the text to its constructor as argument

Text text1 = new Text(str);




It should be displayed like this. Like in word. period after numbers. Indent infront of list items.

Available options:

1. Apples

2. oranges

How can this be achieved?

Thanks for looking into it.


Hi Mamatha,

Thanks for sharing details.

I have tested the scenario and I am able to reproduce the same problem. For the
sake of correction, I have logged it in our issue tracking system as
PDFJAVA-33172. We
will investigate this issue in details and will keep you updated on the status
of a correction.

apologize for your inconvenience.