How to get all drawable element

Tags: #<Tag:0x00007f7cabab0408>

For get the pdf information, it need an instance of com.inet.pdfc.model.Document
For geting a specific page information use the method getPage(<pageindex>)

Document document = resultModel.getComparisonParameters().getFirstFile().getContent();
Page page = document.getPage( i );

And for all drawable elements

List<DrawableElement> list = page.getElementList().getList();

For further using the drawable element, it can be cast in the correct class for more information about the elements.

for( DrawableElement drawableElement : list ) {
    switch( drawableElement.getType() ){
        case Text:
            TextElement textElement = (TextElement)drawableElement;
            break;
        case Shape:
            ShapeElement shapeElement = (ShapeElement)drawableElement;
            break;
        case Image:
            ImageElement imageElement = (ImageElement)drawableElement;
            break;
    }
}

View full sourcecode

© Copyright 1996 - 2018, i-net software; All Rights Reserved.