I have a pdf document containing several images.
I want to retrieve names of these images.
How to achieve this using either iText or pdfbox?
I know that ExtractImages extracts images from PDF. I feel that this will somewhere have the functionality to fetch name of the image. However, I don’t know the usage of ExtractImages.
The actual problem to fetch names of PDF is to use it to compress these images to reduce the size of the pdf. Is my approach correct?
What you can get with pdfbox is the key of the image and its suffix (type). You can also save that image.
However this won’t help you unless you are sure that all these images were converted directly to PDF, i.e. without rotation, translation or scaling. If you need this, then you might want to have a look at the PrintImageLocations.java example in the PDFBOX src download.