-1
我正在尝试创建PDF格式。我试了很多,发现了一些编码,但我仍然收到错误,我不知道如何解决它。这里是我的代码:使用android生成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;
请告诉这是什么错误说,如何解决这个问题。
哦谢谢..我现在正在使用模拟器,我没有正确检查目的地。同一个文件已经创造了很多时间。以上提到的错误可能是一个警告,因为我仍然得到该错误,但工作正常。 –