OK, method getKeepTogether() is used in PdfDocument.add(Element) if the element is Paragraph, but not if it is ListItem, although ListItem extends Paragraph ...
public boolean add(Element element) throws DocumentException {
...
try {
switch(element.type()) {
...
case Element.PARAGRAPH: {
...
// if a paragraph has to be kept together, we wrap it in a table object
if (paragraph.getKeepTogether()) {
...
case Element.LISTITEM: {
...
The value
keeptogetheron aListItemis ignoredexpected result
The flag has the same behavior as by
Paragraph.The text was updated successfully, but these errors were encountered: