title: Why do I get a "Could not find PdfGraphics2D" error?
body: <p>I have come across a runtime exception. I wanted to create a PDF document from android device.
  For that I used iText library.</p>
  
  <p>This my code for creating PDF</p>
  
  <pre><code>Document document = new Document();
  PdfWriter.getInstance(document, outStream);
  
  document.open();
  document.add(new Paragraph(data));
  
  document.close();
  </code></pre>
  
  <p>The code works fine. It is creating PDF successfully. but it gives me exception on runtime saying</p>
  
  <pre><code>06-14 10:09:20.491: W/dalvikvm(764): Unable to resolve superclass of Lcom/itextpdf/awt/PdfGraphics2D; (1251)
  06-14 10:09:20.491: W/dalvikvm(764): Link of class 'Lcom/itextpdf/awt/PdfGraphics2D;' failed
  06-14 10:09:20.491: E/dalvikvm(764): Could not find class 'com.itextpdf.awt.PdfGraphics2D', referenced from method com.itextpdf.text.pdf.PdfContentByte.createGraphics
  06-14 10:09:20.491: W/dalvikvm(764): VFY: unable to resolve new-instance 480 (Lcom/itextpdf/awt/PdfGraphics2D;) in Lcom/itextpdf/text/pdf/PdfContentByte;
  06-14 10:09:25.280: E/dalvikvm(764): Could not find class 'org.bouncycastle.cert.X509CertificateHolder', referenced from method com.itextpdf.text.pdf.PdfReader.readDecryptedDocObj
  06-14 10:09:25.280: W/dalvikvm(764): VFY: unable to resolve new-instance 1612 (Lorg/bouncycastle/cert/X509CertificateHolder;) in Lcom/itextpdf/text/pdf/PdfReader;
  </code></pre>
  
  <p>I have done clean and build, added jar to libs folder and make it selected on order and export and i done lot of research for past 2 days. but nothing helped me.
  Based upon my knowledge there should be these possibilities.</p>
  
  <ul>
  <li>The external jar does not loaded properly</li>
  <li>The class PdfGraphics2D extends java.awt.Graphics2D which is not available in android</li>
  </ul>
  
  <p>any help would be appreciable. </p>