如果要显示原有文本样式,保留所有空格 只需将需要显示的空格替换为\u00a0即可
\u00a0
参考链接:https://stackoverflow.com/questions/42805217/how-to-keep-up-white-spaces-between-words-in-itext5