Skip to main content
February 16, 2012
Answered

get real class of a PageItem

  • February 16, 2012
  • 1 reply
  • 886 views

Hi all,

There are two ways to get a pageItem :

-Document.allPageItems which is an array of extended objects of PageItem ( Rectangle, TextFrame, Oval.....) so we can have precisely the type of object we need.

-Document.pageItem.itemByID() which returns ONLY  objects as PageItem whatever their type.

I need to get a precise object(Rectangle, TextFrame).

But, to prevent looping through all PageItems, I am looking for a mixed method which returns a precise object on the same way of second method ( by usind id )

Thanks.

Pierre RAFFA

This topic has been closed for replies.
Correct answer Harbs.

pageItem.getElements()[0]; should resolve the object.

1 reply

Harbs.
Harbs.Correct answer
Legend
February 16, 2012

pageItem.getElements()[0]; should resolve the object.

February 17, 2012

Hi Harbs,

Thanks a lot. That works fine

Pierre RAFFA

Aquafadas.