Highlighted

Image count values in C++

Community Beginner ,
Jun 30, 2020

Copy link to clipboard

Copied

Hi,

I have used this code to find the images whether there is an images(jpg,png,gif,jpeg) in the document or not it provide me the output as "1". Please guide me if it is wrong..

 

do
{
IDocument* document = Utils<ILayoutUIUtils>()->GetFrontDocument();
if (document == nil)
{
break;
}

IDataBase *db = ::GetDataBase(document);

InterfacePtr<ILinksManager> linkmanager(document, UseDefaultIID());
if (linkmanager == nil)
{
break;
}

int32 imageCount = linkmanager->GetLinkCount();
PMString ImageCount;
imagecount.AppendNumber(imageCount);
CAlert::InformationAlert(imagecount);
} while (false);

Rajendran
TOPICS
SDK

Views

77

Likes

Translate

Translate

Report

Report
This conversation has been locked.

Image count values in C++

Community Beginner ,
Jun 30, 2020

Copy link to clipboard

Copied

Hi,

I have used this code to find the images whether there is an images(jpg,png,gif,jpeg) in the document or not it provide me the output as "1". Please guide me if it is wrong..

 

do
{
IDocument* document = Utils<ILayoutUIUtils>()->GetFrontDocument();
if (document == nil)
{
break;
}

IDataBase *db = ::GetDataBase(document);

InterfacePtr<ILinksManager> linkmanager(document, UseDefaultIID());
if (linkmanager == nil)
{
break;
}

int32 imageCount = linkmanager->GetLinkCount();
PMString ImageCount;
imagecount.AppendNumber(imageCount);
CAlert::InformationAlert(imagecount);
} while (false);

Rajendran
TOPICS
SDK

Views

78

Likes

Translate

Translate

Report

Report
Jun 30, 2020 0
Adobe Community Professional ,
Jun 30, 2020

Copy link to clipboard

Copied

Hi Rajendran,

didn't we have this discussion recently?!

 

FWIW: Are you sure that more than 1 graphic is linked to the document?

Could it be that all the graphics were pasted from e.g. PhotoShop or a different application?

Then they would not show up in the list of linked items.

 

Regards,
Uwe Laubender

( ACP )

Likes

Translate

Translate

Report

Report
Jun 30, 2020 0
Most Valuable Participant ,
Jun 30, 2020

Copy link to clipboard

Copied

I don't believe this code can compile; that, or it displays another string than is being constructed here -- with nearly the same name.

Likes

Translate

Translate

Report

Report
Jun 30, 2020 0
Adobe Employee ,
Jul 01, 2020

Copy link to clipboard

Copied

Likes

Translate

Translate

Report

Report
Jul 01, 2020 1