Im coding in Java..
Does anyone know how i can get the content of a javax.swing.text.html.HTMLDocument as a String? This is what i´ve got so far...
StringWriter writer = new StringWriter();
kit.write(writer, doc, 0, doc.getLength());
String s = writer.toString();
You don't need the editor and reader at all - just read the input stream. For example, with commons-io IOUtils.toString(inputStream)
or you can use:
Content content = document.getContent();
String str = content.getString(0, content.length() - 1);