I am generating the PDF document using HTMLFragment. Word-wrap is not properly working. I see the similar issue topic in your forums. But I don’t see the solution. Here is the reference. Word wrap issue on new Document
Example:
String finalString = "<div style=\"width: 150px;word-wrap: break-word;border: 1px solid #000000;\"> This div contains a very long word: thisisaveryv eryveryveryveryverylongword. The long word will break and wrap to the next line.</div>";
Document pdfDocument = new Document();
Page page = pdfDocument.getPages().add();
page.getPageInfo().setHeight(792);
page.getPageInfo().setWidth(612);
MarginInfo marginInfo = new MarginInfo();
marginInfo.setLeft(60);
marginInfo.setRight(60);
marginInfo.setTop(72);
marginInfo.setBottom(72);
page.getPageInfo().setMargin(marginInfo);
HtmlFragment htmlFragment = new HtmlFragment(finalString);
page.getParagraphs().add(htmlFragment);
pdfDocument.save("filepath", SaveFormat.Pdf);