Home > Net >  How to differentiate text and images from a PDF file using java?
How to differentiate text and images from a PDF file using java?

Time:03-29

So i have to make an android app using Java that reads a PDF File and displays it on screen without using other programs(such as PDF Reader). How to make a distinction between text and image in that file? in other words, there is text and in between text ther is an image, how do i verify where it is text and where is an image?

CodePudding user response:

PDF files don't work like that.

It is a complex format, and there is a lot more data in the files than just text and images, such as metadata and formatting.

If you want to handle PDF files in your app, you should use a PDF library, such as the ones listed here:

https://camposha.info/android-examples/android-pdf-libraries/#gsc.tab=0

How exactly to load text will depend on the specific library you choose, and you should check the relevant documentation.

  • Related