I need to parse out all image locations and sizes. However, my doImage function is never getting hit. Here is what I have:
public class myImageExtractor extends CSDeviceAdapter
private ArrayList<anImage > images = new ArrayList<>();
protected void doImage(COSName name, PDImage image)
AffineTransform transform = graphicsState.transform;
anImage img = new anImage();
img.positionLeft = transform.getTranslateX();
img.positionTop = transform.getTranslateY();
img.width = image.getWidth();
img.height = image.getHeight();
public ArrayList<anImage> getImages()
Then, in main:
myImageExtractor imageExtractor = new myImageExtractor();
PDPage page = (PDPage) node;
AffineTransform pageTx = new AffineTransform();
//setup interpreter and process
CSDeviceBasedInterpreter imageEnterpreter = new CSDeviceBasedInterpreter(null, imageExtractor);
I also have a custom text extractor setup in the same way, (but overriding onCharacterFound) calling the same functions as the image extractor.
Like I said, no images are being found, and my doImage function never gets called. Any idea what I'm doing wrong?
… ask Spock:
1) no image there
2) your PDF is using inline images (method "inlineImage")
3) some of the more sophisticated ways to "hide" images, e.g. in annotations
As of today, i'm offline. Have fun.
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.