• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

body -> Master page

Guest
Apr 19, 2013 Apr 19, 2013

Copy link to clipboard

Copied

In framemaker FDK, how does one associate the body page to a master page? please send code snippet.

Views

1.4K

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
community guidelines
Community Expert ,
Apr 19, 2013 Apr 19, 2013

Copy link to clipboard

Copied

Do you know how this works in normal unstructured FM authoring?

I don't know FDK, but your problem may be that the objects you need don't exist, because they don't exist by default in a fresh (not a template) FM document until the first time you perform the following operation:

Format > Page Layout > Apply Master Pages ...

| Master Page Mapping table does not exist.

| A new table will be created in the reference pages.

[ OK ]

And the table thus created may be found via:

View > Reference Pages

MasterPageMaps

but doesn't do anything until you populate it with para tag names, MP page names, and page span specs.

At that point, the author can cause the mapping to occur in a couple of ways, one of which is:

Format > Page Layout > Apply Master Pages ...

(or AMP, as it is sometimes called here)

I suspect there's an easy way to invoke an AMP in FDK.

As to whether FDK can create that Master Page and table, and populate the table, dunno.

Votes

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
community guidelines
Engaged ,
Apr 20, 2013 Apr 20, 2013

Copy link to clipboard

Copied

A body page is represented as "FO_BodyPage" object. You have to write code to get this object (objectid).

FO_BodyPage has a property "MasterpageName". Set this property to the name of the masterpage you want to assign. I think using the alread mentioned APM functionality is the more general way and fit several other problems. To call this you have to get the fcode of the command "APPLYMASTERPAGES" (F_ApiGetNamedObject(FV_SessionId, FO_Command, "APPLYMASTERPAGES"). A command has an Fcode property which you can use to call F_ApiFcodes to execute this command by the FDK. I think the FDK reference will deliver more information. Bye Markus

Votes

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
community guidelines
Guest
Apr 22, 2013 Apr 22, 2013

Copy link to clipboard

Copied

LATEST

After reading throught the manual (not much help) and a lot of trial and error, here is a snippet of the code that works.

The Master Page of a Body Page can be found in the Body Page Properties.  If the Master Page propety content is NULL, the the Body Page is NOT associated with a Master Page.

////////////////////////////////////////////////////////////////////////////////

IntT MasterPage(F_ObjHandleT docId, F_ObjHandleT pageId)

////////////////////////////////////////////////////////////////////////////////

{

    UIntT i    = 0;

    IntT blank = 0;

    F_PropValsT props = F_ApiGetProps(docId, pageId);

    for(i=0U; i < props.len; ++i)

    {

        if ((FP_MasterPage == props.val.propIdent.num) &&

            (FT_String     == props.val.propVal.valType))

        {

            #ifdef DEBUG

            F_Printf(NULL, "    i=%u  ident=%d %s valType=%d  Value=%s", i,

                    props.val.propIdent.num,

                    props.val.propIdent.name,

                    props.val.propVal.valType,

                    props.val.propVal.u.sval);

            #endif

            if (0 == props.val.propVal.u.sval) // None

            {

                ++blank; // No Master Page

                F_Printf(NULL, "NO Master Page\n");

            }

            else

            {

                F_Printf(NULL, "Master Page is %s\n",

                        props.val.propVal.u.sval);

            }

            break;

        }

    }

    F_ApiDeallocatePropVals(&props);

    return blank;

}

Votes

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
community guidelines