Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Get Text Format - RichTextArea
Hello. Is there any form to get the format of the text written in a RichTextArea?
For example, I want to get the font type, size, and so forth. I need those values to pass them to a PDF writer, so that the text of the PDF is in the same format than in the RichTextArea.
I am using iText and this is an example:
Paragraph paragraph = new Paragraph();
//The value of font should be the font of the text written in the RichTextArea
paragraph.add(new Chunk(text,font));
document.add(paragraph);
Thank you.
Hi,
It won't work this way: what about other html tags... ?
You will need to parse you html-content. You can do that with your favorite xml parser to get the text and its attributes.
Easier, you can use FlyingSaucer to generate PDf from Html source
https://code.google.com/archive/p/flying-saucer/
HTH
Sebastien