Skip to main content
Balav483
Known Participant
Oct 1, 2018 4:03 AM UTC
Question

How to get the PDEContainer using PDSMCGetPDEContainer

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

6 replies

lrosenth
Adobe Employee
Adobe Employee
Oct 3, 2018 12:23 AM UTC

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().

Translate
Participant
Feb 5, 2025 1:26 PM UTC

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

Translate
Legend
Oct 1, 2018 9:42 AM UTC

Please answer all of my questions.

Translate
Legend
Oct 1, 2018 9:27 AM UTC

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?

Translate
Legend
Oct 1, 2018 9:24 AM UTC

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

Translate
Balav483
Balav483Author
Known Participant
Oct 1, 2018 9:33 AM UTC

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.

Translate