-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;
請告訴這是什麼錯誤說,如何解決這個問題。
哦謝謝..我現在正在使用模擬器,我沒有正確檢查目的地。同一個文件已經創造了很多時間。以上提到的錯誤可能是一個警告,因爲我仍然得到該錯誤,但工作正常。 –