How to get all drawable element

Tags: #<Tag:0x00007f70c59f98a8>

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;
        case Shape:
            ShapeElement shapeElement = (ShapeElement)drawableElement;
        case Image:
            ImageElement imageElement = (ImageElement)drawableElement;

View full sourcecode

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