在 gradle 中实现 itext html2pdf

问题描述 投票:0回答:1

应该在 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));
        }
android gradle itext
1个回答
0
投票

你应该从 maven central 实现存储库 https://mvnrepository.com/artifact/com.itextpdf.android

© www.soinside.com 2019 - 2024. All rights reserved.