How to get the PDEContainer using PDSMCGetPDEContainer

Sep 30, 2018

Copy link to clipboard

Copied

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

TOPICS
Acrobat SDK and JavaScript

Views

244

Likes

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

How to get the PDEContainer using PDSMCGetPDEContainer

Sep 30, 2018

Copy link to clipboard

Copied

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

TOPICS
Acrobat SDK and JavaScript

Views

245

Likes

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
Sep 30, 2018 0
Oct 01, 2018

Copy link to clipboard

Copied

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

Likes

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
Reply
Loading...
Oct 01, 2018 0
Oct 01, 2018

Copy link to clipboard

Copied

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.

Likes

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
Reply
Loading...
Oct 01, 2018 0
Oct 01, 2018

Copy link to clipboard

Copied

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?

Likes

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
Reply
Loading...
Oct 01, 2018 0
Oct 01, 2018

Copy link to clipboard

Copied

Please answer all of my questions.

Likes

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
Reply
Loading...
Oct 01, 2018 0
lrosenth LATEST
Adobe Employee ,
Oct 02, 2018

Copy link to clipboard

Copied

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

Likes

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
Reply
Loading...
Oct 02, 2018 0