Example usage for org.apache.pdfbox.cos COSArray indexOfObject

List of usage examples for org.apache.pdfbox.cos COSArray indexOfObject

Introduction

In this page you can find the example usage for org.apache.pdfbox.cos COSArray indexOfObject.

Prototype

public int indexOfObject(COSBase object) 

Source Link

Document

This will return the index of the entry or -1 if it is not found.

Usage

From source file:org.apache.fop.render.pdf.pdfbox.StructureTreeMergerUtil.java

License:Apache License

public static int findObjectPositionInKidsArray(COSObject kid) {
    COSObject parent = (COSObject) kid.getItem(COSName.P);
    COSBase kids = parent.getItem(COSName.K);
    if (kids instanceof COSArray) {
        COSArray kidsArray = (COSArray) kids;
        return kidsArray.indexOfObject(kid);
    } else {//  w w w.  ja v a 2 s. c o  m
        return 0;
    }
}