我想以itext pdf 格式显示所有格式的oracle clob 数据。 目前我正在使用以下代码来显示它。
java.sql.Clob clob=rs.getClob("MESSAGE");
Reader r = clob.getCharacterStream();
char clobVal[] = new char[(int) clob.length()];
r.read(clobVal);
StringWriter sw = new StringWriter();
sw.write(clobVal);
//add some detail information about the country
doc.add(new Paragraph("Country Code: " + sw.toString(), bf12));
上面的代码仅显示字符串,但没有文本格式或 html 格式数据。请帮忙。
最佳答案
PDF 是二进制数据。 CLOB是存储字符数据。使用BLOB,您将能够获得格式化的PDF。
关于java - 显示带有 itext 中所有文本格式的 clob,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59082677/