Skip to main content
Balav483
Known Participant
October 1, 2018
Question

How to get the PDEContainer using PDSMCGetPDEContainer

  • October 1, 2018
  • 4 replies
  • 1009 views

Hi Team

I want to get the exact location of the figure and formula from the tagged PDF. i am able to read the tagged structure from the PDF using below code, but i got struck ed to get the PDEcontainer by using PDSMCGetPDEContainer. how to obtain the pdecontainer i am i missing anything here?

ASAtom kidType = PDSElementGetKidWithMCInfo(element,  //The PDSElement containing the kid that is retrieved

                                                    kidIndex, //The index of the kid.

                                                    &kid,     //The kid being accessed (depending on the kid's type) or NULL.

                                                    &mcidInfo,//The kid's information object or NULL.

                                                    NULL,     //Pointer to the kid or NULL.

                                                    &CosPage);    //The CosObj of the page containing the kid or NULL

        char buf[256], title[128];

        buf[0] = title[0] = '\0';

        if (kidType == StructElem_K){

      

      

            ASInt32 title_size = PDSElementGetTitle (kid, reinterpret_cast<ASUns8*> (title));

            char IDS[128];

            IDS[0]  = '\0';

            ASInt32 ID_size = PDSElementGetID (kid, reinterpret_cast<ASUns8*>(IDS));

            strcat (buf, reinterpret_cast<char *>(IDS));

            string CurentName(buf);

            if (CurentName.find("Figure") != string::npos)

            {

                string test(buf);

                PDSMC Obj = (PDSMC) mcidInfo.mcid;

                PDEContainer pdeContainer = PDSMCGetPDEContainer((PDSMC)Obj);// iam getting error

                PDEContent  content = PDEContainerGetContent (pdeContainer);

            }

            GetElemInfo(kid);

        }

Thanks,

Balamurugan V

4 replies

lrosenth
Adobe Employee
Adobe Employee
October 3, 2018

Obviously, this is only a fragment of code so it’s not entirely clear what your overall logic is. So a couple of things come to mind.

First and foremost – did you acquire the page’s content already? You can’t get PDE objects w/o first having acquired the entire page.

Second, the kid (in your code) is the container – so you can use it directly with PDEContainerGetContent().

Participant
February 5, 2025

No, Its not working if we use the kid as container.

Legend
October 1, 2018

Please answer all of my questions.

Legend
October 1, 2018

And what makes you feel you can typecast an MCID into a PSDMC?

Why do you even believe there is a PDEContainer for your content?

Legend
October 1, 2018

What error do you get? Please don't ask us to compile and run your code just to find out !

Balav483
Balav483Author
Known Participant
October 1, 2018

Hi

Thanks for the reply, what we should pass in PDSMC, i am not able to get the  PDEcontainer from PDSMCInfo as in documentation they mentioned that PDSMC is identical to PDEcontainer, but i am not able to get either PDSMC or PDEcontainer from where we have to obtain the PDMSC.