Check out iText PDF -- it's free and fairly simple for generating pdf's.
hi
I want to create a PDF file dynamically in android application.
like File f = new File("sample.pdf");
we have to use any external api for this? any idea?
how can i do that?
Thanks
mindus
Check out iText PDF -- it's free and fairly simple for generating pdf's.
Phones: Nexus One (N1), and G1
Android Developer & Linux Geek
My Apps: Volume Locker | Shopriant - Shopping and Grocery Lists
Hi
Thanks for your reply.
Does android supports iText? And google android accepts to include iText in the application?
Because android has separate virtual machine (Dalvik) and it does not support all java classes.
If it is supports can u please tell me how to proceed this?
i tried this below sample code. But i got a error.
f = new File(root, "hello.pdf");
FileOutputStream file = new FileOutputStream(f);
Document document = new Document();
PdfWriter.getInstance(document, file);
document.open();
document.add(new Paragraph(result));
document.close();
file.close();
The error is something related to some Color class in iText jar.
Thanks
mindus
Hi,
I found the solution and without using itext we can displaly pdf file.
Thanks
mindus
get the response using response.getEntity().getContent();
It returns input stream and parse the input stream and get the value as a string.
Create a pdf file like file f = new file("android.pdf");
and write the result string in this android.pdf and using intent display it.
By the way please create the file path like sdcard/download something like that.
Using environment class u can get the path.
Thanks
mindus
how to open existing PDF file in Android 2.2 Emulator through a path in C: drive /D drive/...
please give me solution for this
hey hi..
I am Rachana, new to android. I am working on this loading pdf file. Can you tell me in detail how to do that? Actually I want to hardcore that pdf in code.
Thanks,
Rachana
Bookmarks