Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/385.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/90.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用带格式化的iText的pdf格式的JavaFx html格式文本_Java_Html_Javafx_Itext_Html Editor - Fatal编程技术网

使用带格式化的iText的pdf格式的JavaFx html格式文本

使用带格式化的iText的pdf格式的JavaFx html格式文本,java,html,javafx,itext,html-editor,Java,Html,Javafx,Itext,Html Editor,是否可以使用iText将格式化的HTML-文本(颜色、对齐方式等)从HTMLEditor设置为“可编辑”PDF 我在网上什么也没找到 谢谢。我在这篇文章中找到了一个使用飞碟的解决方案:我在这篇文章中找到了一个使用飞碟的解决方案:最简单的方法是(正如Amedee所建议的)使用pdfHTML。 它是一个iText7插件,可以将HTML5(+CSS3)转换为pdf语法 代码非常简单: HtmlConverter.convertToPdf( "<b>This text

是否可以使用
iText
将格式化的
HTML
-文本(颜色、对齐方式等)从
HTMLEditor
设置为“可编辑”PDF

我在网上什么也没找到


谢谢。

我在这篇文章中找到了一个使用
飞碟的解决方案:

我在这篇文章中找到了一个使用
飞碟的解决方案:

最简单的方法是(正如Amedee所建议的)使用pdfHTML。 它是一个iText7插件,可以将HTML5(+CSS3)转换为pdf语法

代码非常简单:

    HtmlConverter.convertToPdf(
        "<b>This text should be written in bold.</b>", // html to be converted
        new PdfWriter(
            new File("C://users/user2002/output.pdf")  // destination file
        )
    );
HtmlConverter.convertToPdf(
“此文本应以粗体书写。”,//要转换的html
新型PdfWriter(
新文件(“C://users/user2002/output.pdf”)//目标文件
)
);

要了解更多信息,请转到

最简单的方法是(如Amedee所建议的)使用pdfHTML。 它是一个iText7插件,可以将HTML5(+CSS3)转换为pdf语法

代码非常简单:

    HtmlConverter.convertToPdf(
        "<b>This text should be written in bold.</b>", // html to be converted
        new PdfWriter(
            new File("C://users/user2002/output.pdf")  // destination file
        )
    );
HtmlConverter.convertToPdf(
“此文本应以粗体书写。”,//要转换的html
新型PdfWriter(
新文件(“C://users/user2002/output.pdf”)//目标文件
)
);

要了解更多信息,请转至

您可能可以使用iText 7+pdfHTML附加模块来完成此操作,但您需要对您的问题进行更多的解释。您可能可以使用iText 7+pdfHTML附加模块来完成此操作,但您需要对您的问题进行更多的解释。