InDesign Server - IHyperlinkTable destination iterator not working
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 🙂