Extract an image out of a pdf

Put your problem here if it does not fit any of the other categories.

Extract an image out of a pdf

Postby BlueEyes » Mon Nov 08, 2010 5:44 pm

Hallo guys, i am pretty new to android coding, and java coding in general. I am normally a php coder, so i do have some knowledge about coding. But i am keen to learn java and do some useful android apps.

anyways, here to my actual question, i want to read through a directory full of pdf files and extract the first page of every pdf. also i would really like to be able to display pdf files natively, if thats not possible, it would be good to use a built in pdf viewer. does a easy to use pdf lib exist for the taskses i just mentioned? thanks in advance!
BlueEyes
Freshman
Freshman
 
Posts: 6
Joined: Mon Nov 08, 2010 5:19 pm

Top

Re: Extract an image out of a pdf

Postby jonbonazza » Mon Nov 08, 2010 5:49 pm

Hello,

First of all, PHP is not coding, it is scripting. There is a difference. :P

Second, I am pretty sure I remember someone mentioning a PDF API that already exists, however I cannot remember where I read that. I am sure some quick Googling would yeild the results you need.

At any rate, if one should not exist, You would need to look up the internal structure of a PDF file. It should have a header, and a data sector. the header should give you all of the information you need to accurately parse the PDF (i.e. find where the first page starts and first page ends). As far as extracting an image, I am not entirely sure how you would go about that unless PDF files have "tags" embeded into their internal structure, for example, you might have the byte representation of "{img}"come right before the byte representation of the image itself and then followed by the byte representation of"{/img}".
jonbonazza
Master Developer
Master Developer
 
Posts: 665
Joined: Thu Jul 15, 2010 2:58 pm
Location: WV USA

Re: Extract an image out of a pdf

Postby BlueEyes » Tue Nov 09, 2010 8:57 am

thanks for your quick reply! of course i tried to google for something like that, but i didnt come up with good results. anyway, maybe someone who already had a similar problem and used a pdf lib for android can help me out on this ;-)
BlueEyes
Freshman
Freshman
 
Posts: 6
Joined: Mon Nov 08, 2010 5:19 pm

Re: Extract an image out of a pdf

Postby shardulp » Tue Nov 09, 2010 10:14 am

I found code project looks like library "jonbonazza " was mentioning is jni_pdf

http://code.google.com/p/android-pdf/so ... coder.java

have look at above code.. might help!
shardulp
Freshman
Freshman
 
Posts: 6
Joined: Thu Oct 28, 2010 7:42 am

Re: Extract an image out of a pdf

Postby BlueEyes » Tue Nov 09, 2010 3:41 pm

looks good, thanks a lot! I hope I will be able to make anything useful out of this haha
again thanks a lot!
BlueEyes
Freshman
Freshman
 
Posts: 6
Joined: Mon Nov 08, 2010 5:19 pm

Re: Extract an image out of a pdf

Postby BlueEyes » Tue Nov 09, 2010 11:18 pm

looks like the pdf lib is not finished or it is not complete, i am getting compiling errors trying to compile with ndk. anyway i keep on looking for a working pdf lib, if anybody else got it running pls drop me a message ;-)
BlueEyes
Freshman
Freshman
 
Posts: 6
Joined: Mon Nov 08, 2010 5:19 pm

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: Google [Bot] and 15 guests