I have a requirement where need to generate the PDF document. if i add text which is more that 4000k then text gets overflow the screen and it comes in single line. How to add a line break so that the text should be in paragraph itself.
Discussion posts and replies are publicly visible
Did you read my blog post on this topic?
https://appian.rocks/2023/10/23/great-pdfs-with-appian/
Try adding word-wrap and white-space CSS to your paragraphhtml<p style="word-wrap: break-word; overflow-wrap: break-word; white-space: pre-wrap; width: 100%;"> your long text here...</p>
word-wrap: break-word — breaks long words/strings at the container boundaryoverflow-wrap: break-word — modern equivalent, use both for compatibilitywhite-space: pre-wrap — preserves line breaks (\n) from your Appian text field and wraps normally
Use this CSS in the HTML before PDF generation: white-space: pre-wrap; overflow-wrap: break-word; word-wrap: break-word;
If the text is inside a table, also set table-layout: fixed; width: 100%; and put the text in a <p> or <div>, not plain inline text.