0
아래 코드를 실행하려고합니다. 크기, 11 : 11XMLWorkerHelper 예외 java.lang.IndexOutOfBoundsException : 인덱스 : 11, 크기 : 11
사람이 예외의 원인을 어떤 생각을 가지고 있으며, 그것을 어떻게 해결합니까
java.lang.IndexOutOfBoundsException : 인덱스 그러나이 예외를 받고?
private ByteArrayInputStream getByteArrayInputStream(Document doc) throws DocumentException, IOException {
InputStream pdfStream = new ByteArrayInputStream(doc.html().getBytes());
ByteArrayOutputStream bytesOut = new ByteArrayOutputStream();
com.itextpdf.text.Document document = new com.itextpdf.text.Document(PageSize.LETTER);
PdfWriter writer = PdfWriter.getInstance(document, bytesOut);
document.open();
try{
XMLWorkerHelper.getInstance().parseXHtml(writer, document, pdfStream, Charset.forName("UTF-8"));
}
catch(IOException ioe){
System.out.println(ioe.getMessage());
ioe.printStackTrace();
}catch(Exception e){
e.printStackTrace();
}
document.close();
return new ByteArrayInputStream(bytesOut.toByteArray());
}
지금이 경우 어떻게 될까요? –
문서를 pdf로 변환하려고합니다. – Ashwini
아니요, 위의 게시 된 코드는 어디에서 발생합니까? 스택 추적을 게시하는 방법은 어떻습니까? –