01-23-2012 07:53 AM
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,
01-24-2012 07:48 PM
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.
03-10-2012 08:31 PM
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/platfo
It's only for BB10/PlayBook and newer. OS 7.1 and earlier still supports Java.