Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Trusted Contributor
Posts: 166
Registered: ‎12-09-2011
My Device: 9550,9300,9800,9700,9900,9850,9860

Extract Images from PDF file

I am working on a project. Where I have to extract the images from some of PDF file.

And show them in HorizontalFieldManager.


So I want the source code for extracting or converting images from PDF file.

Please help me...If any one know such type of code....Please post here

Thanks and Regards,

Nitish Subudhi 

Thanks & Regards,
Nitish Subudhi

Feel Free To Press The Like Button On The Right Side To Thank The User That Helped You.
Please Mark Posts As Solved If You Found a Solution.
Highlighted
Developer
Posts: 1,807
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.3.2.858, Z10 (STL100-3)-10.3.1.2576, Z30 (STA100-5)-10.3.1.2582, Passport (SQW100-1)-10.3.1.2576, PlayBook (16GB)-2.1.0.1917
My Carrier: Verizon

Re: Extract Images from PDF file

You are in luck but have some work to do.

 

I wrote this and have worked on it for some time: http://pdfrend4bb.codeplex.com/

 

I ran into issues with actually getting it to render on older systems (easier on newer systems but still issues). When Java was dropped for BB10, I jumped on the NDK and stopped working on it. Many people have asked me what is needed to make it work, I ask them what they need, and it ends up being something that doesn't need the "renderer" portion of the program. So I run them through what they need to change and they seem more then content.

 

It requires another library called LCMS which is linked on the home page.

 

Technically, the only thing you need to do is extend PDFRenderer and override "public XYRectFloat drawImage(PDFImage image)". This will allow you to get the Bitmap for the image. You then create a PDFFile, get a PDFPage from the PDFFile, pass it in to the constructor of your PDFRenderer and then call "go". Every image will call your overwritten function and you will get all the images within the PDF.

 

A more direct way would be adding a "get" function to get PDFImage within the PDFImageCmd class (located in PDFPage.java). Then you can simply iterate through all PDFCmd(s) within a PDFPage and call "getImage" to get the actual image (note: it will parse it at that point unless you called getImage at a previous point).

 

So you will need to do some work, as I am busy with my own projects and work right now, so good luck.

---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.
Developer
Posts: 139
Registered: ‎02-23-2012
My Device: Blackberry bold
My Carrier: Vodafone India

Re: Extract Images from PDF file

Why they dropped java?

and which technology will replace java?
warm regards
Mohammed Aziz
Developer
Posts: 1,807
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.3.2.858, Z10 (STL100-3)-10.3.1.2576, Z30 (STA100-5)-10.3.1.2582, Passport (SQW100-1)-10.3.1.2576, PlayBook (16GB)-2.1.0.1917
My Carrier: Verizon

Re: Extract Images from PDF file

Why did they drop Java? Don't know. Do a search on these forums to see the many opinions and read the rants of various devs.

 

As for what will replace it: https://bdsc.webapps.blackberry.com/devzone/platforms

 

It's only for BB10/PlayBook and newer. OS 7.1 and earlier still supports Java.

---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.