应该在 build.gradle 文件中放入什么实现来导入 html2pdf 库(itext7 扩展)?
我正在尝试通过 android studio 使用 itext7 将 html 转换为 pdf。 为此,我需要 html2pdf 库中的 HtmlConverter 类(https://api.itextpdf.com/pdfHTML/java/2.1.6/com/itextpdf/html2pdf/HtmlConverter.html),但我似乎无法找到如何在我的项目中实现它。
这就是我要使用的功能:
public void createPdf(URL url, String dest) throws IOException {
HtmlConverter.convertToPdf(url.openStream(), new FileOutputStream(dest));
}
你应该从 maven central 实现存储库 https://mvnrepository.com/artifact/com.itextpdf.android