People here can help you better if you post the error. And downvoting just because a solution didn't work for you is not the way to go. Please spend some time learning the code of conduct before you post something. Also nobody is going to walk you through a solution without you having tried to debug it at least a little bit on your own.
–
arTsmarTMay 17 '14 at 23:01

This is my sample coding for creating pdf file with text and image
content using Itext library and to store the pdf file in the external
Storage location. The only thing is you need to download the itext
library and add it into your project.

Hi Tarrant, I want to create an PDF file in android application not in java swing.
–
KhushwantDec 9 '11 at 6:18

I am using simple code to create a pdf file in my sd card using iText pdf library, but it is giving following errors. 1. Could not find class 'com.itextpdf.text.pdf.PdfGraphics2D', referenced from method com.itextpdf.text.pdf.PdfContentByte.createGraphics 2. Could not find class 'com.itextpdf.text.pdf.PdfPrinterGraphics2D', referenced from method com.itextpdf.text.pdf.PdfContentByte.createPrinterGraphics 3. ERROR/dalvikvm(309): Could not find class 'org.bouncycastle.cms.CMSEnvelopedData', referenced from method com.itextpdf.text.pdf.PdfReader.readDecryptedDocObj
–
KhushwantDec 9 '11 at 6:48

1

I'm assuming you've added the library to your project. I think you may need to run dx (in android sdk) on the jar file since unless you are using Eclipse? Dx is used to turn class files in a non-android jar into dex files so that they can be found/used on the device.
–
tarrantDec 9 '11 at 17:46

Yes i have added library to my project & i am using eclipse as IDE.Could you please share version of iText you have used? as iText 5.0.7 is for developing apps on android but its not free.They are charging around $1500 for license. Do you have any other open source pdf library for android.Please share if you know any.
–
KhushwantDec 10 '11 at 6:04

I used iText 2.0.6. I believe it was open source back then.
–
tarrantDec 13 '11 at 22:32