Importing graphic into graphics frame on a Reference page

New Here ,
Mar 03, 2017 Mar 03, 2017

Copy link to clipboard

Copied

Hello All,

Need to import a graphic (by copy) into a graphics frame located on a Reference page of the document. The objective is to have a number for each chapter on the First Master Page. This is done by using 'Frame Above Pgf' of the Paragraph Tag. This works fine manually, as shown below. I would like to have a generic chapter FM file where I can change the chapter number according to the value of <$chapnum>.

Is there a way to import the graphic (number) into the graphics frame? I see Import, but it requires a TextLoc that I don't have.

Any help is greatly appreciated.

#target framemaker

var oDoc, oPage, oFrame, oGfx;

var oDoc = app.ActiveDoc;

if (oDoc.ObjectValid()){

    //

    oPage = oDoc.FirstRefPageInDoc;

    while (oPage.ObjectValid()) {

        alert(oPage.Name);

        oFrame = oPage.PageFrame;

        if(oPage.Name == 'Reference Page 2'){

            oGfx = oFrame.FirstGraphicInFrame;

            if(oGfx.ObjectValid()){

                while (oGfx.ObjectValid()){

                    if (oGfx.constructor.name == 'UnanchoredFrame'){

                    alert(oGfx.Name);

                    }

                oGfx = oGfx.NextGraphicInFrame;

                }

           }

        }

        oPage = oPage.PageNext;

    }

}

TOPICS
Scripting

Views

243

Likes

translate

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
Advocate ,
Mar 03, 2017 Mar 03, 2017

Copy link to clipboard

Copied

This seems to be a very complicated way of doing something that FrameMaker does out of the box. Add a text frame to the first master page, enter a Running H/F variable, style it in any which way you want, and assign the <$chapnum> variable to the Running H/F defnition. Switch back to body page. Done.

Correct me if I did not understand the use case. I have been using Running H/F for all kinds of automated references to chapter numbers, page numbers, even paragraph numbers. Almost no end to what you can do with them.

Cheers

Likes

translate

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
New Here ,
Mar 03, 2017 Mar 03, 2017

Copy link to clipboard

Copied

Thanks 4everJang​,

We whole idea was to create a 'hollow' font in order to use less ink. Don't see how that can be achieved with a standard Windows font.

You're idea works fine and probably I'll modify the master page as per your suggestion.

Cheers.

Likes

translate

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