public static void addParagraphProperties(Paragraph paragraph, StringBuilder style) { addIndent(paragraph, style); addJustification(paragraph, style); addBorder(paragraph.getBottomBorder(), "bottom", style); addBorder(paragraph.getLeftBorder(), "left", style); addBorder(paragraph.getRightBorder(), "right", style); addBorder(paragraph.getTopBorder(), "top", style); if (paragraph.pageBreakBefore()) { style.append("break-before:page;"); } style.append("hyphenate:" + (paragraph.isAutoHyphenated() ? "auto" : "none") + ";"); if (paragraph.keepOnPage()) { style.append("keep-together.within-page:always;"); } if (paragraph.keepWithNext()) { style.append("keep-with-next.within-page:always;"); } }