我正在尝试做一个pdf创建者。我尝试了很多并找到了一些编码,但我仍然收到错误,我不知道如何解决它。这是我的代码:
public void GenerarPDF(View view){
try{
Document document=new Document();
File root = new File(Environment.getExternalStorageDirectory(), "Notes");
if (!root.exists()) {
root.mkdirs();
}
File gpxfile = new File(root, "generando.pdf");
PdfWriter.getInstance(document,new FileOutputStream(gpxfile));
document.open();
document.add(new Paragraph("Testing testing and testing"));
document.close();
}catch(Exception e){
e.printStackTrace();
}
}
logcat 错误说:
09-25 07:40:14.337: E/dalvikvm(9397): Could not find class 'org.spongycastle.cert.X509CertificateHolder', referenced from method com.itextpdf.text.pdf.PdfReader.readDecryptedDocObj
09-25 07:40:14.337: W/dalvikvm(9397): VFY: unable to resolve new-instance 2148 (Lorg/spongycastle/cert/X509CertificateHolder;) in Lcom/itextpdf/text/pdf/PdfReader;
请告诉这个错误是什么以及如何解决它。