Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


How do I get a list of inline/anchored objects in a text frame?

Community Beginner ,
Jan 21, 2014 Jan 21, 2014

Copy link to clipboard

Copied

Hi,

I was wondering whether anyone knew how to get the UID list of inline/anchored objects within a text box?

I have written a script to get me the page items in the text box, but I was wondering whether there was a way to get these in C++?  This is because while I get the UID of a graphic frame that is inline in the text frame, when I try to see whether it is 'valid' (i.e., the UID is in the document database) I find that it is not.

Initially in C++ I tried using the IHierarchy interface on the text frame and while this did return a child of the text box, it's page item type was not that of a graphic box and it had a different UID from that found using the page item script that I had written.

I have also tried to use GetUIDListOfInlines() from IFrameUtils, but I have not managed to get either the IMultiColumnTextFrame or the ITextFrameColumn interface from the text frame, so I am unable to use this method.  Does anyone know a way to get either of these interfaces on a text frame or do they only apply to graphic frames?

Any help would be greatly appreciated!

Thanks,

Dan Tate.

TOPICS
SDK

Views

569

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Jan 21, 2014 Jan 21, 2014

Copy link to clipboard

Copied

In C++ the IHierarchy has some more levels of nesting.

To find out details, DebugClassUtils or IObjectModel::GetIDName() give clear text class names.

The SDK provides a "DebugWindow" application as a sink for TRACE output.

Regards,

Dirk

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 21, 2014 Jan 21, 2014

Copy link to clipboard

Copied

That's interesting, thanks, I'll give that a try.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Jan 21, 2014 Jan 21, 2014

Copy link to clipboard

Copied

Hello,

Have a look in SnpInspectLayoutModel.cpp. Look for InspectStoryInlines.

P.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 22, 2014 Jan 22, 2014

Copy link to clipboard

Copied

LATEST

Hi,

Thanks for the help, I can now get the inline items from the text frame.  In case anyone else needs this, here's the code that I'm using (pPageItem is a UIDRef):

InterfacePtr<IHierarchy> pageItemHierarchy(pPageItem, UseDefaultIID());

if(pageItemHierarchy)

{

    int32 nChildren = pageItemHierarchy->GetChildCount();

    for (int32 child = 0; child < nChildren; ++child)

    {

        IDataBase *db=pPageItem.GetDataBase();

        UIDRef childUIDRef(pPageItem.GetDataBase(), pageItemHierarchy->GetChildUID(child));

        if (db->GetClass( childUIDRef.GetUID()) == kMultiColumnItemBoss)

        {

            UIDList InlineList(db);

            InterfacePtr<IMultiColumnTextFrame>mcf( childUIDRef, UseDefaultIID() );

            if(mcf)

            {

                Utils<IFrameUtils>()->GetUIDListOfInlines(mcf, false, &InlineList);

                int32 inlineLen = InlineList.Length();

                for (int32 j=0; j < inlineLen; ++j)

                {

                    UIDRef inlineRef (childUIDRef.GetDataBase(), InlineList);

                    AddProperPageItems(inlineRef, pResultList, pDocName);

                }

            }

        }

    }

}

Hope that's helpful!

Dan

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines