gpt4 book ai didi

java - 编译itext提供的示例程序

转载 作者:行者123 更新时间:2023-12-02 04:59:33 38 4
gpt4 key购买 nike

http://itextsupport.com/download/xfaworker.html

我已经下载了 iText 示例程序并尝试在我的计算机上测试它。想要测试我是否可以展平我使用 Apache 提供的 PDFBox 库创建的 XFA 表单。我想拼合我的 PDF,以便将它们合并成一个 pdf 文件。下面是我认为编译所需的所有文件的列表。大多数是按照上述网址的说明获得的。

10/02/2015  05:15 PM    <DIR>          ..
23/02/2014 03:34 AM 10,114 antlr4-annotations-4.2.jar
23/02/2014 03:34 AM 327,041 antlr4-runtime-4.2.jar
23/04/2013 11:17 PM 2,199 FillAndFlatten.java
10/02/2015 05:15 PM 358 flatten.bat
16/05/2014 06:05 AM 24,193 itext-licensekey-1.0.3.jar
16/12/2014 08:53 AM 62,418 itext-pdfa-5.5.4.jar
16/12/2014 08:53 AM 97,001 itext-xtra-5.5.4.jar
09/02/2015 03:04 PM 2,226 itextkey.xml
16/12/2014 08:53 AM 2,148,390 itextpdf-5.5.4.jar
06/06/2014 10:41 PM 1,606 LICENSE-abego.TXT
29/05/2014 01:12 AM 1,537 LICENSE-ANTLR.txt
21/09/2014 12:35 AM 17,099 LICENSE-rhino.txt
23/02/2014 03:34 AM 25,515 org.abego.treelayout.core-1.0.1.jar
01/01/2013 03:20 AM 725 README.txt
20/09/2014 11:12 PM 1,134,765 rhino-1.7R4.jar
17/12/2014 01:29 AM 2,230,720 xfaworker-5.5.4.jar
25/05/2012 08:22 PM 27,624 xfa_data.xml
25/05/2012 08:22 PM 80,248 xfa_form.pdf

当我运行 flatten.bat 文件时,这是我得到的输出

C:\Users\jason.STERLINGSYSTEMS\Downloads\flatterner>C:\jdk1.8.0_25x64\bin\javac
-cp "itextpdf-5.5.4.jar;xmlworker-5.5.4.jar;xfaworker-5.5.4.jar;itext-licensekey
-1.0.3.jar" FillAndFlatten.java
FillAndFlatten.java:46: error: cannot access CssAppliers
XFAFlattener xfaf = new XFAFlattener(document, writer);
^
class file for com.itextpdf.tool.xml.html.CssAppliers not found
FillAndFlatten.java:47: error: cannot access CssAppliersAware
xfaf.flatten(new PdfReader(baos.toByteArray()));
^
class file for com.itextpdf.tool.xml.html.CssAppliersAware not found
2 errors

C:\Users\jason.STERLINGSYSTEMS\Downloads\flatterner>java -cp ".;itextpdf-5.5.4.j
ar;xmlworker-5.5.4.jar;xfaworker-5.5.4.jar;itext-licensekey-1.0.3.jar;antlr4-run
time-4.2.jar;antlr4-annotations-4.2.jar;org.abego.treelayout.core-1.0.1.jar;rhin
o-1.7R4.jar" FillAndFlatten
Error: Could not find or load main class FillAndFlatten

所以问题是为什么我会收到 2 个错误?对我来说,我似乎缺少一些库。鉴于我已按照他们的指示进行操作,不太确定我缺少什么?

最佳答案

您必须将xmlworker.jar添加到您的目录flatterner。此文件包含类com.itextpdf.tool.xml.html.CssAppliersAware

关于java - 编译itext提供的示例程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28426535/

38 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com