• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
1

InDesign Server - IHyperlinkTable destination iterator not working

Explorer ,
Jun 05, 2023 Jun 05, 2023

Copy link to clipboard

Copied

    Hello All,

    

I am trying to migrate my InDesign Dektop plugin to Indesign Server plugin. Everything except following is working without any issue, Can someone tell me why following calls are not working in Indesign Server. What is the alternative for this?

    

    Here actually I am trying to get destination info of type kPageDestination & kTextAnchorDestination

    On InDesign Server this call (docHyperlinkTable->GetDestinationKeyToUIDMapBeginIter();) doesn't return valid pointer

        

    

    IDataBase *db = GetDataBase(iDocument);

    int32 itterator = 0;

    

    InterfacePtr<IHyperlinkTable> docHyperlinkTable(db, db->GetRootUID(), UseDefaultIID());

    const int32 numDestinations(docHyperlinkTable ? docHyperlinkTable->GetHyperlinkDestinationCount() : 0);

    

    // search the list of hyperlinks destination on this document

    UniqueKeyToUIDMap::const_iterator iter = docHyperlinkTable->GetDestinationKeyToUIDMapBeginIter();

    for(;iter != docHyperlinkTable->GetDestinationKeyToUIDMapEndIter(); ++iter)

    {

        const UID hlDestUID = iter->second;

        

        InterfacePtr<const IHyperlinkDestination> destination(db, hlDestUID, UseDefaultIID());

        ASSERT(destination);

        if(destination)

        {

            const IHyperlinkDestination::DestType type = destination->GetType();

            

            if(type == IHyperlinkDestination::kPageDestination)

            {

                if(pageIndex)

                {

                    PMString destInfo;

                    destination->GetInfo(&destInfo);

                    ----

                    ----

                    ----

                }

            }

            else if(type == IHyperlinkDestination::kTextAnchorDestination)

            {

                if(IndexArr)

                {

                    InterfacePtr<IHyperlinkTextDestinationData> destData(db, hlDestUID, UseDefaultIID());

                    if(destData)

                    {

                        UID textmodel_uid = destData->GetTextModelUID();

                        if(textmodel_uid == textModel)

                        {

                            UID textmark_uid = destData->GetTextMarkerUID();

                            InterfacePtr<IHyperlinkTextDestinationMarker> textmarkdata(db, textmark_uid, UseDefaultIID());

                            if(textmarkdata)

                            {

                                ----

                                ----

                                ----

                                ----

                            }

                        }

                    }

                }

            }

        }

    }

 

Thank You 🙂

TOPICS
SDK

Views

102

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
Explorer ,
Jun 05, 2023 Jun 05, 2023

Copy link to clipboard

Copied

LATEST

Sorry its my bad, I was using InDesing Server 17.0.0.96 but it works properly with newer version of InDesign Server 17.2

So please ignore this post

Votes

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