Java 通过wkhtmltopdf在线生成PDF
1. 下载安装wkhtmltopdf; 百度网盘: https://pan.baidu.com/s/1Lb28f93nY0N86iW0MhFA9g 提取码:s2fa 2. 创建一个工具类WKHtmlToPdfUtilUtil.java,写入以下代码: package com.zghky.utils; import java.io.BufferedReader; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.util.Date; public class WKHtmlToPdfUtil { private static class ClearBufferThread implements Runnable { private InputStream in; public ClearBufferThread(InputStream inputStream) { this.in = inputStream; } @Override public void run() {