-5
public static final String[] HTML="D:/testing.htm","D:/testing.htm","D:/testing.htm","D:/testing.htm"};
public static final String DEST = ""D:/multiple_html_pages2.pdf";
public static void main(String[] args) throws IOException, DocumentException {
File file = new File(DEST);
file.getParentFile().mkdirs();
new ParseMultipleHtmlFiles2().createPdf(DEST);
}
public void createPdf(String file) throws IOException, DocumentException {
Document document = new Document();
PdfWriter.getInstance(document, new FileOutputStream(file));
document.open();
for (String htmlfile : HTML) {
String html = Utilities.readFileToString(htmlfile);
// parsing error are showing there :
ElementList list = XMLWorkerHelper.parseToElementList(htmlfile);
for (com.itextpdf.text.Element e : list) {
document.add(e);
}
document.newPage();
}
document.close();
}
어떤 오류 메시지가 표시 될까요? – Jens
XMLWorkerHelper – user3442032
유형에 대해 parseToElementList (String) 메소드가 정의되지 않았습니다. 패키지를 가져올 때 클래스를 가져 오시겠습니까? – Jens