它声明DocumentBuilderFactory.newInstance无法解析为某个类型。 以下是代码:
public static void replaceXfaStream(String src, String xml, String dest) throws IOException, DocumentException,
ParserConfigurationException, SAXException {
PdfReader pdfReader = new PdfReader(src);
PdfStamper pdfStamper = new PdfStamper(pdfReader,
new FileOutputStream(dest));
pdfStamper.getWriter().setPdfVersion(PdfWriter.VERSION_1_7);
XfaForm xfa = new XfaForm(pdfReader);
DocumentBuilderFactory fact = new DocumentBuilderFactory.newInstance();
fact.setNamespaceAware(true);
DocumentBuilder db = fact.newDocumentBuilder();
Document doc = db.parse(new FileInputStream(xml));
xfa.setDomDocument(doc);
xfa.setChanged(true);
XfaForm.setXfa(xfa, pdfStamper.getReader(), pdfStamper.getWriter());
pdfStamper.close();
}
非常感谢!