Continuous text in text-area cuts the PDF overflowing the text when using Itext 7.1.7

pdfHTML allows you to either convert the form-related elements (inputs, text areas) directly into the plain PDF content, or create a PDF with AcroForm (so that those elements are editable, as they are supposed to be in HTML).

To enable that behavior, you should use setCreateAcroForm(true) in ConverterProperties that you pass to HtmlConverter.

If you don't want to have those fields editable, you can flatten those fields as a second step after you have converted the HTML into PDF.

Having that said, the behavior you describe looks like a bug in iText. But the mode of creating the AcroForm and flattening is implemented in a slightly different way and it looks like the textarea would be converted as expected in your case. You haven't attached the whole example so it's hard to verify for sure, but for the small snippet you attached everything is fine. Here is the code you can use:

ByteArrayOutputStream baos = new ByteArrayOutputStream();
HtmlConverter.convertToPdf(new FileInputStream("C:\\file.html"), baos,
        new ConverterProperties().setCreateAcroForm(true));

PdfDocument document = new PdfDocument(new PdfReader(new ByteArrayInputStream(baos.toByteArray())), 
        new PdfWriter(new File("C:\\out.pdf")));
PdfAcroForm acroForm = PdfAcroForm.getAcroForm(document, false);
acroForm.flattenFields();
document.close();

You can detect whenever the text reaches a new line in the input box, and insert '\n' to force line breaks so that when you download an image, it should have the line break hard-coded. Hope this helps!