问题
I am working on a Java application which creates an encrypted report .txt file (on server which uses 3DES algorithm). This file is then opened on another program which is running on PC and can be decrypted to get the final report.
I am having a requirement of highlighting the headings in the report in BOLD. I came across a way to make a word file with formatting using java. If I create a .doc file with the following HTML tags, MS word opens a the file like any browser.
<HTML>
<BODY>
<b><center> Report Heading <center></b>
<p>Sub-Heading</p>
</BODY>
</HTML>
The file when opened in MS Word, looks like this.
Report Heading
Sub-Heading
I am able to create the document with these tags. But the only thing I am not getting is a 'page break' tag. While writing into a normal .txt file we write '\f' for form feed character which did the needful for me. How can I achieve the same with HTML Tags.? IS there anything equivalent to form feed character in HTML?
来源:https://stackoverflow.com/questions/19381913/creating-a-text-file-in-java-with-bold-formatting-of-headings