TxT转PDF可以直接使用IText就可以了,IText在pdf领域可以说暂时是最好的方案了.通过直接读取txt文件,然后生成pdf,再添加文本就可以了. 代码如下: public class Txt2PDF { private static final String FONT = "C:\\Windows\\Fonts\\simhei.ttf"; public static void text2pdf(String text, String pdf) throws DocumentE
public class TxtWrite { public static void main(String args[]){ contentToTxt("D:\\xyky.txt","3"); } public static void contentToTxt(String filePath, String content) { try{ BufferedWriter writer = new BufferedWriter(new FileWriter(new F